Kodi Documentation 22.0
Kodi is an open source media player and entertainment hub.
Loading...
Searching...
No Matches
Subclass - ControlFadeLabel

Used to show multiple pieces of text in the same position, by fading from one to the other. More...

Classes

class  XBMCAddon::xbmcgui::ControlFadeLabel
 

Functions

 XBMCAddon::xbmcgui::ControlFadeLabel::addLabel (...)
 

Function: addLabel(label)


Add a label to this control for scrolling.
 
 XBMCAddon::xbmcgui::ControlFadeLabel::setScrolling (...)
 

Function: setScrolling(scroll)


Set scrolling. If set to false, the labels won't scroll. Defaults to true.
 

Detailed Description

Used to show multiple pieces of text in the same position, by fading from one to the other.

Class: ControlFadeLabel(x, y, width, height[, font, textColor, alignment])

The fade label control is used for displaying multiple pieces of text in the same space in Kodi. You can choose the font, size, colour, location and contents of the text to be displayed. The first piece of information to display fades in over 50 frames, then scrolls off to the left. Once it is finished scrolling off screen, the second piece of information fades in and the process repeats. A fade label control is not supported in a list container.

Note
This class include also all calls from Control
Parameters
xinteger - x coordinate of control.
yinteger - y coordinate of control.
widthinteger - width of control.
heightinteger - height of control.
font[opt] string - font used for label text. (e.g. 'font13')
textColor[opt] hexstring - color of fadelabel's labels. (e.g. '0xFFFFFFFF')
alignment[opt] integer - alignment of label
  • Flags for alignment used as bits to have several together:
    Definition name Bitflag Description
    XBFONT_LEFT 0x00000000 Align X left
    XBFONT_RIGHT 0x00000001 Align X right
    XBFONT_CENTER_X 0x00000002 Align X center
    XBFONT_CENTER_Y 0x00000004 Align Y center
    XBFONT_TRUNCATED 0x00000008 Truncated text
    XBFONT_JUSTIFIED 0x00000010 Justify text
    XBFONT_TRUNCATED_LEFT 0x00000020 Truncated text from left
Note
You can use the above as keywords for arguments and skip certain optional arguments.
Once you use a keyword, all following arguments require the keyword.
After you create the control, you need to add it to the window with addControl().

Example:

...
self.fadelabel = xbmcgui.ControlFadeLabel(100, 250, 200, 50, textColor='0xFFFFFFFF')
...

Function Documentation

◆ addLabel()

void XBMCAddon::xbmcgui::ControlFadeLabel::addLabel ( ...)

Function: addLabel(label)


Add a label to this control for scrolling.

Parameters
labelstring or unicode - text string to add.
Note
To remove added text use reset() for them.

Example:

...
self.fadelabel.addLabel('This is a line of text that can scroll.')
...

◆ setScrolling()

void XBMCAddon::xbmcgui::ControlFadeLabel::setScrolling ( ...)

Function: setScrolling(scroll)


Set scrolling. If set to false, the labels won't scroll. Defaults to true.

Parameters
scrollboolean - True = enabled / False = disabled

Example:

...
self.fadelabel.setScrolling(False)
...