Fade label control: Difference between revisions

From Official Kodi Wiki
Jump to navigation Jump to search
>DonJ
No edit summary
No edit summary
(36 intermediate revisions by 12 users not shown)
Line 1: Line 1:
The fade label control is used for displaying multiple pieces of text in the same space in XBMC. 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.
<section begin="main content" />
===Example===
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.
<xml>
=== Example ===
   <control>
<syntaxhighlight lang=xml enclose="div">
   <control type="fadelabel" id="1">
         <description>My First fadelabel</description>
         <description>My First fadelabel</description>
         <type>fadelabel</type>
         <left>80</left>
        <id>1</id>
         <top>60</top>
        <posx>80</posx>
         <posy>60</posy>
         <width>250</width>
         <width>250</width>
         <visible>true</visible>
         <visible>true</visible>
         <scroll>false</scroll>
         <scrollout>true</scrollout>
        <pauseatend>200</pauseatend>
         <label>6</label>
         <label>6</label>
         <info>MusicPlayer.Genre</info>
         <info>MusicPlayer.Genre</info>
Line 18: Line 18:
         <font>font14</font>
         <font>font14</font>
         <textcolor>FFB2D4F5</textcolor>
         <textcolor>FFB2D4F5</textcolor>
        <textoffsetx>20</textoffsetx>
        <scroll>true</scroll>
        <randomize>true</randomize>
   </control>
   </control>
</xml>
</syntaxhighlight>


===Tag Descriptions===
=== Tag descriptions ===
Note that each tag is '''lower case only'''. This is important, as xml tags are case-sensitive.
In addition to the [[Default Control Tags]] the following tags are available. Note that each tag is '''lower case''' only. This is important, as xml tags are case-sensitive.
{| class="dtable"
{| class="prettytable"
|- class="userrow"
! Tags !! Description
| class="usercell" | '''description'''
|-  
| class="usercell" | Only used to make things clear for the skinner. Not read by XBMC at all.
| '''label'''
|- class="userrow"
|  
| class="usercell" | '''type'''
| class="usercell" | Specifies the control type
|- class="userrow"
| class="usercell" | '''id'''
| class="usercell" | Specifies the control's id. The value this takes depends on the control type, and the window that you are using the control on. There are special control id's that must be present in each window. Any other controls that the skinner adds can be any id they like.
|- class="userrow"
| class="usercell" | '''posx'''
| class="usercell" | Specifies where the left of the label should be drawn. This is offset from the window's coordinates (normally the left edge of the screen, or 0). In the case of <align>right</align> however, this specifies the '''right''' of the label.
|- class="userrow"
| class="usercell" | '''posy'''
| class="usercell" | Specifies where the top edge of the label should be drawn. This is offset from the window's coordinates (normally the top edge of the screen, or 0).
|- class="userrow"
| class="usercell" | '''width'''
| class="usercell" | Specifies the width that should be used to draw the label. If the text is longer than the label, then it will be truncated and will scroll.
|- class="userrow"
| class="usercell" | '''visible'''
| class="usercell" |
Specifies a condition as to when this control will be visible. Can be true, false, or a condition. [[Conditional Visibility|See here for more information.]] Defaults to true.
|- class="userrow"
| class="usercell" | '''animation'''
| class="usercell" |
Specifies the animation to be run when the control enters a particular state. [[Animating Your Skin|See here for more information.]]
|- class="userrow"
| class="usercell" | '''label'''
| class="usercell" |
Specifies the text which should be drawn. You should specify an entry from the strings.xml here, however you may also specify a piece of text yourself if you wish, though ofcourse it will not be localisable. [[Label Parsing|You may also specify more than one piece of information here by using the $INFO and $LOCALIZE formats.]]
Specifies the text which should be drawn. You should specify an entry from the strings.xml here, however you may also specify a piece of text yourself if you wish, though ofcourse it will not be localisable. [[Label Parsing|You may also specify more than one piece of information here by using the $INFO and $LOCALIZE formats.]]
|- class="userrow"
|-  
| class="usercell" | '''info'''
| '''info'''
| class="usercell" |
|  
Specifies the information that should be presented. XBMC will <span class="nobr">auto-fill</span> in this info in place of the <label>. [[InfoLabels|See here for more information.]]
Specifies the information that should be presented. Kodi will <span class="nobr">auto-fill</span> in this info in place of the <label>. [[InfoLabels|See here for more information.]]
|- class="userrow"
|-  
| class="usercell" | '''font'''
| '''font'''
| class="usercell" | Specifies the font to use from the font.xml file.
| Specifies the font to use from the font.xml file.
|- class="userrow"
|-  
| class="usercell" | '''textcolor'''
| '''textcolor'''
| class="usercell" | Specified the color the text should be, in hex AARRGGBB format.
| Specified the color the text should be, in hex AARRGGBB format, or a name from the [[Colour themes|colour theme.]]
|- class="userrow"
|-  
| class="usercell" | '''shadowcolor'''
| '''textoffsetx'''
| class="usercell" | Specifies the color of the drop shadow on the text, in AARRGGBB format.
|  Specify the offset from the left edge that the text should be rendered at when static (not scrolling).  The scrolling text will still scroll using the full <width> of the control.
|-
| '''shadowcolor'''
| Specifies the color of the drop shadow on the text, in AARRGGBB format, or a name from the [[Colour themes|colour theme.]]
|-
|  '''angle'''
|  Specifies the angle at which the text should be drawn, measured counter clockwise from the horizontal.
|-
|  '''scrollout'''
|  If set to False the fadelabel will only scroll until the last char is to the right side of the width of the fadelabel instead of all the way out to the left. Defaults to true
|-
|  '''pauseatend'''
|  Specifies the time that the text will wait until it fades away before it scrolls again or moves to the next item.
|-
|  '''resetonlabelchange'''
|  If set to false the fadelabel will not reset the scrolling offset when the label's content changes. Useful if you have things such as the play time (in seconds) inside a fadelabel. Defaults to true.
|-
|  '''scrollspeed'''
|  Scroll speed of text in pixels per second. Defaults to 60.
|-
|  '''scroll'''
|  If set to false, the labels won't scroll. Defaults to true.
|-
|  '''randomize'''
|  If set to true, the labels will be displayed in a random order. Defaults to false.
|}
|}
[[category:Skin Development]]
 
<section end="main content" />
 
== See also ==
'''Development:'''
* [[Add-on development]]
* [[Skinning]]
 
[[Category:Skin development]]

Revision as of 00:39, 13 July 2020

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.

Example

  <control type="fadelabel" id="1">
        <description>My First fadelabel</description>
        <left>80</left>
        <top>60</top>
        <width>250</width>
        <visible>true</visible>
        <scrollout>true</scrollout>
        <pauseatend>200</pauseatend>
        <label>6</label>
        <info>MusicPlayer.Genre</info>
        <info>MusicPlayer.Artist</info>
        <info>MusicPlayer.Album</info>
        <info>MusicPlayer.Year</info>
        <font>font14</font>
        <textcolor>FFB2D4F5</textcolor>
        <textoffsetx>20</textoffsetx>
        <scroll>true</scroll>
        <randomize>true</randomize>
  </control>

Tag descriptions

In addition to the Default Control Tags the following tags are available. Note that each tag is lower case only. This is important, as xml tags are case-sensitive.

Tags Description
label

Specifies the text which should be drawn. You should specify an entry from the strings.xml here, however you may also specify a piece of text yourself if you wish, though ofcourse it will not be localisable. You may also specify more than one piece of information here by using the $INFO and $LOCALIZE formats.

info

Specifies the information that should be presented. Kodi will auto-fill in this info in place of the <label>. See here for more information.

font Specifies the font to use from the font.xml file.
textcolor Specified the color the text should be, in hex AARRGGBB format, or a name from the colour theme.
textoffsetx Specify the offset from the left edge that the text should be rendered at when static (not scrolling). The scrolling text will still scroll using the full <width> of the control.
shadowcolor Specifies the color of the drop shadow on the text, in AARRGGBB format, or a name from the colour theme.
angle Specifies the angle at which the text should be drawn, measured counter clockwise from the horizontal.
scrollout If set to False the fadelabel will only scroll until the last char is to the right side of the width of the fadelabel instead of all the way out to the left. Defaults to true
pauseatend Specifies the time that the text will wait until it fades away before it scrolls again or moves to the next item.
resetonlabelchange If set to false the fadelabel will not reset the scrolling offset when the label's content changes. Useful if you have things such as the play time (in seconds) inside a fadelabel. Defaults to true.
scrollspeed Scroll speed of text in pixels per second. Defaults to 60.
scroll If set to false, the labels won't scroll. Defaults to true.
randomize If set to true, the labels will be displayed in a random order. Defaults to false.


See also

Development: