Settings Slider Control: Difference between revisions

From Official Kodi Wiki
Jump to navigation Jump to search
>Dankula
No edit summary
 
(13 intermediate revisions by 8 users not shown)
Line 1: Line 1:
The settings slider control is used in the settings screens for when an option is best specified on a sliding scale. You can choose the position, size, and look of the slider control. It is basically a cross between the button control and a slider control. It has a label and focus and non focus textures, as well as a slider control on the right.
The settings slider control is used in the settings screens for when an option is best specified on a sliding scale. You can choose the position, size, and look of the slider control. It is basically a cross between the button control and a slider control. It has a label and focus and non focus textures, as well as a slider control on the right.
===Example===
=== Example ===
<xml>
<syntaxhighlight lang="xml" enclose="div">
<control>
<control type="sliderex" id="12">
       <description>My first settings slider control</description>
       <description>My first settings slider control</description>
      <type>sliderex</type>
      <id>1</id>
       <posx>80</posx>
       <posx>80</posx>
       <posy>60</posy>
       <posy>60</posy>
Line 30: Line 28:
       <onright>1</onright>
       <onright>1</onright>
</control>
</control>
</xml>
</syntaxhighlight>
===Available Tags===
 
Note that each tag is '''lower case only.''' This is important, as xml tags are case-sensitive.
=== Available tags ===
{| class="dtable"
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="userrow"
{| class="prettytable"
| class="usercell" | '''description'''
! Tag !! Description
| class="usercell" | Only used to make things clear for the skinner. Not read by XBMC at all.
|-  
|- class="userrow"
| '''sliderwidth'''
| class="usercell" | '''type'''
| Specifies the width of the slider portion of the slider control (ie without the text value, if present). The texture image for the slider background will be resized to fit into this width, and the nib textures will be resized by the same amount.
| class="usercell" | Should be sliderex for a settings slider control.
|-  
|- class="userrow"
| '''sliderheight'''
| class="usercell" | '''id'''
| Specifies the height of the slider portion of the slider control (ie without the text value, if present). The texture image for the slider background will be resized to fit into this height, and the nib textures will be resized by the same amount.
| 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. The slider control's id should be unique, except where the <info> tag is used to fill the contents.
|-  
|- class="userrow"
| '''texturefocus'''
| class="usercell" | '''posx'''
|  
| class="usercell" | Specifies where the left edge of the slider control should be drawn.This is offset from the window's coordinates (normally the left edge of the screen, or 0).
Specifies the image file which should be displayed for the control when it has focus. [[Texture Attributes|See here for additional information about textures.]]
|- class="userrow"
|-  
| class="usercell" | '''posy'''
| '''texturenofocus'''
| class="usercell" | Specifies where the top edge of the slider control should be drawn.This is offset from the window's coordinates (normally the top edge of the screen, or 0).
| Specifies the image file which should be displayed for the control when it doesn't focus.
|- class="userrow"
|-  
| class="usercell" | '''width'''
| '''texturebg'''
| class="usercell" | Specifies the width of the settings slider control. The texturefocus and texturenofocus images will be resized to fit into this width.
| Specifies the image file which should be displayed in the background of the slider portion of the control. Will be positioned so that the right edge is <textoffsetx> away from the right edge of the <texturefocus> image, and centered vertically.
|- class="userrow"
|-  
| class="usercell" | '''height'''
| '''textureslidernib'''
| class="usercell" | Specifies the height of the settings slider control. The texturefocus and texturenofocus images will be resized to fit into this height.
| Specifies the image file which should be displayed for the slider nib.
|- class="userrow"
|-  
| class="usercell" | '''sliderwidth'''
| '''textureslidernibfocus'''
| class="usercell" | Specifies the width of the slider portion of the slider control (ie without the text value, if present). The texture image for the slider background will be resized to fit into this width, and the nib textures will be resized by the same amount.
| Specifies the image file which should be displayed for the slider nib when it has focus.
|- class="userrow"
|-  
| class="usercell" | '''sliderheight'''
| '''label'''
| class="usercell" | Specifies the height of the slider portion of the slider control (ie without the text value, if present). The texture image for the slider background will be resized to fit into this height, and the nib textures will be resized by the same amount.
| Either a numeric reference into strings.xml (for localization), or a string that will be shown on the left of the control.
|- class="userrow"
|-  
| class="usercell" | '''visible'''
| '''font'''
| class="usercell" |
| Font used for the controls label. From fonts.xml.
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"
| '''textcolor'''
| class="usercell" | '''animation'''
| Color used for displaying the label. In AARRGGBB hex format, or a name from the [[Colour themes|colour theme.]]
| class="usercell" |
|-  
Specifies the animation to be run when the control enters a particular state. [[Animating Your Skin|See here for more information.]]
| '''disabledcolor'''
|- class="userrow"
| Color used for the label if the control is disabled. In AARRGGBB hex format, or a name from the [[Colour themes|colour theme.]]
| class="usercell" | '''texturefocus'''
|-  
| class="usercell" |
| '''shadowcolor'''
Specifies the image file which should be displayed for the control when it has focus. You can use animated gif's, jpgs, pngs, or bmps. This should be the path to the image file from the media/ folder of your skin directory. XBMC will first look inside the compresses Textures.xpr file, and if not found, will look inside the media/ folder for the actual skin file. Compressing textures into Textures.xpr means far faster loading times.
| Specifies the color of the drop shadow on the text. In AARRGGBB hex format, or a name from the [[Colour themes|colour theme.]]
|- class="userrow"
|-  
| class="usercell" | '''texturenofocus'''
| '''textoffsetx'''
| class="usercell" | Specifies the image file which should be displayed for the control when it doesn't focus.
| Amount to offset the label from the left edge of the control.
|- class="userrow"
|-  
| class="usercell" | '''texturebg'''
| '''textwidth'''
| class="usercell" | Specifies the image file which should be displayed in the background of the slider portion of the control. Will be positioned so that the right edge is <textoffsetx> away from the right edge of the <texturefocus> image, and centered vertically.
| Will truncate any text that's too long.
|- class="userrow"
|-  
| class="usercell" | '''textureslidernib'''
| '''info'''
| class="usercell" | Specifies the image file which should be displayed for the slider nib.
|  
|- class="userrow"
| class="usercell" | '''textureslidernibfocus'''
| class="usercell" | Specifies the image file which should be displayed for the slider nib when it has focus.
|- class="userrow"
| class="usercell" | '''label'''
| class="usercell" | Either a numeric reference into strings.xml (for localization), or a string that will be shown on the left of the control.
|- class="userrow"
| class="usercell" | '''font'''
| class="usercell" | Font used for the controls label. From fonts.xml.
|- class="userrow"
| class="usercell" | '''textcolor'''
| class="usercell" | Color used for displaying the label. In AARRGGBB hex format.
|- class="userrow"
| class="usercell" | '''disabledcolor'''
| class="usercell" | Color used for the label if the control is disabled.
|- class="userrow"
| class="usercell" | '''shadowcolor'''
| class="usercell" | Specifies the color of the drop shadow on the text, in AARRGGBB format.
|- class="userrow"
| class="usercell" | '''textoffsetx'''
| class="usercell" | Amount to offset the label from the left edge of the control.
|- class="userrow"
| class="usercell" | '''pulseonselect'''
| class="usercell" | Specifies whether the button should pulse when it's selected. Defaults to true.
|- class="userrow"
| class="usercell" | '''info'''
| class="usercell" |
Specifies the information that the slider controls. [[InfoLabels|See here for more information.]]
Specifies the information that the slider controls. [[InfoLabels|See here for more information.]]
|- class="userrow"
| class="usercell" | '''onup'''
| class="usercell" | Control id to move to when the user moves up off this control.
|- class="userrow"
| class="usercell" | '''ondown'''
| class="usercell" | Control id to move to when the user moves down off this control.
|- class="userrow"
| class="usercell" | '''onleft'''
| class="usercell" | Control id to move to when the user moves left off this control.
|- class="userrow"
| class="usercell" | '''onright'''
| class="usercell" | Control id to move to when the user moves right off this control.
|}
|}
== See also ==
'''Development:'''
* [[Add-on development]]
* [[Skinning]]
[[Category:Skin development]]

Revision as of 00:37, 13 July 2020

The settings slider control is used in the settings screens for when an option is best specified on a sliding scale. You can choose the position, size, and look of the slider control. It is basically a cross between the button control and a slider control. It has a label and focus and non focus textures, as well as a slider control on the right.

Example

<control type="sliderex" id="12">
      <description>My first settings slider control</description>
      <posx>80</posx>
      <posy>60</posy>
      <width>250</width>
      <height>200</height>
      <sliderwidth>100</sliderwidth>
      <sliderheight>20</sliderheight>
      <visible>true</visible>
      <texturefocus>myfocustexture.png</texturefocus>
      <texturenofocus>mynofocustexture.png</texturenofocus>
      <texturebg>mybackgroundtexture.png</texturebg>
      <textureslidernib>mydowntexture.png</textureslidernib>
      <textureslidernibfocus>mydownfocustexture.png</textureslidernibfocus>
      <info></info>
      <label>46</label>
      <font>font12</font>
      <textcolor>FFFFFFFF</textcolor>
      <disabledcolor>80FFFFFF</disabledcolor>
      <textoffsetx></textoffsetx>
      <pulseonselect></pulseonselect>
      <onup>2</onup>
      <ondown>3</ondown>
      <onleft>1</onleft>
      <onright>1</onright>
</control>

Available tags

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.

Tag Description
sliderwidth Specifies the width of the slider portion of the slider control (ie without the text value, if present). The texture image for the slider background will be resized to fit into this width, and the nib textures will be resized by the same amount.
sliderheight Specifies the height of the slider portion of the slider control (ie without the text value, if present). The texture image for the slider background will be resized to fit into this height, and the nib textures will be resized by the same amount.
texturefocus

Specifies the image file which should be displayed for the control when it has focus. See here for additional information about textures.

texturenofocus Specifies the image file which should be displayed for the control when it doesn't focus.
texturebg Specifies the image file which should be displayed in the background of the slider portion of the control. Will be positioned so that the right edge is <textoffsetx> away from the right edge of the <texturefocus> image, and centered vertically.
textureslidernib Specifies the image file which should be displayed for the slider nib.
textureslidernibfocus Specifies the image file which should be displayed for the slider nib when it has focus.
label Either a numeric reference into strings.xml (for localization), or a string that will be shown on the left of the control.
font Font used for the controls label. From fonts.xml.
textcolor Color used for displaying the label. In AARRGGBB hex format, or a name from the colour theme.
disabledcolor Color used for the label if the control is disabled. In AARRGGBB hex format, or a name from the colour theme.
shadowcolor Specifies the color of the drop shadow on the text. In AARRGGBB hex format, or a name from the colour theme.
textoffsetx Amount to offset the label from the left edge of the control.
textwidth Will truncate any text that's too long.
info

Specifies the information that the slider controls. See here for more information.

See also

Development: