Slider Control: Difference between revisions

From Official Kodi Wiki
Jump to navigation Jump to search
>DonJ
No edit summary
 
(17 intermediate revisions by 10 users not shown)
Line 1: Line 1:
<section begin="main content" />
The slider control is used for things where a sliding bar best represents the operation at hand (such as a volume control or seek control). You can choose the position, size, and look of the slider control.
The slider control is used for things where a sliding bar best represents the operation at hand (such as a volume control or seek control). You can choose the position, size, and look of the slider control.
===Example===
=== Example ===
<xml>
<syntaxhighlight lang="xml" enclose="div">
<control>
<control type="slider" id="17">
       <description>My first slider control</description>
       <description>My first slider control</description>
       <type>slider</type>
       <left>80</left>
      <id>1</id>
       <top>60</top>
      <posx>80</posx>
       <posy>60</posy>
       <width>250</width>
       <width>250</width>
       <height>30</height>
       <height>30</height>
       <visible>true</visible>
       <visible>true</visible>
       <texturebg>mybackgroundtexture.png</texturebg>
       <texturesliderbar>mybackgroundtexture.png</texturesliderbar>
      <texturesliderbardisabled>mydisabledbackgroundtexture.png</texturesliderbardisabled>
       <textureslidernib>mydowntexture.png</textureslidernib>
       <textureslidernib>mydowntexture.png</textureslidernib>
       <textureslidernibfocus>mydownfocustexture.png</textureslidernibfocus>
       <textureslidernibfocus>mydownfocustexture.png</textureslidernibfocus>
      <textureslidernibdisabled>mydowndisabledtexture.png</textureslidernibdisabled>
       <info></info>
       <info></info>
      <action></action>
       <controloffsetx></controloffsetx>
       <controloffsetx></controloffsetx>
       <controloffsety></controloffsety>
       <controloffsety></controloffsety>
       <pulseonselect></pulseonselect>
       <pulseonselect></pulseonselect>
      <orientation>horizontal</orientation>
       <onup>2</onup>
       <onup>2</onup>
       <ondown>3</ondown>
       <ondown>3</ondown>
Line 23: Line 26:
       <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="usercell" | '''description'''
{| class="prettytable"
| class="usercell" | Only used to make things clear for the skinner. Not read by XBMC at all.
! Tag !! Description
|- class="userrow"
|-  
| class="usercell" | '''type'''
| '''texturesliderbar'''
| class="usercell" | Should be slider for a slider control.
|  
|- class="userrow"
Specifies the image file which should be displayed in the background of the slider control. [[Texture Attributes|See here for additional information about textures.]]
| 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. The slider control's id should be unique, except where the <info> tag is used to fill the contents.
| '''texturesliderbardisabled'''
|- class="userrow"
|  
| class="usercell" | '''posx'''
Specifies the image file which should be displayed in the background of the slider control when it is disabled. (v21+)
| class="usercell" | Specifies where the left edge of the slider control should be drawn. The actual slider background starts <controloffsetx> away from this point. This is offset from the window's coordinates (normally the left edge of the screen, or 0).
|-  
|- class="userrow"
| '''textureslidernib'''
| class="usercell" | '''posy'''
| Specifies the image file which should be displayed for the slider nib.
| class="usercell" | Specifies where the top edge of the slider control should be drawn. The actual slider background starts <controloffsety> away from this point. This is offset from the window's coordinates (normally the top edge of the screen, or 0).
|-  
|- class="userrow"
| '''textureslidernibfocus'''
| class="usercell" | '''width'''
| Specifies the image file which should be displayed for the slider nib when it has focus.
| 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.
|-  
|- class="userrow"
| '''textureslidernibdisabled'''
| class="usercell" | '''height'''
| Specifies the image file which should be displayed for the slider nib when it it is disabled. (v21+)
| 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.
|-  
|- class="userrow"
| '''controloffsetx'''
| class="usercell" | '''visible'''
| Amount to offset the slider background texture from the left edge of the control. Only useful if a value is being rendered as well (ie in int or float mode).
| 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.
| '''controloffsety'''
|- class="userrow"
| Amount to offset the slider background texture from the top edge of the control.
| class="usercell" | '''animation'''
|-  
| class="usercell" |
| '''info'''
Specifies the animation to be run when the control enters a particular state. [[Animating Your Skin|See here for more information.]]
| Specifies the information that the slider controls. [[InfoLabels|See here for more information.]]
|- class="userrow"
|-  
| class="usercell" | '''texturebg'''
| '''action'''
| class="usercell" |
| Can be 'volume' to adjust the volume, 'seek' to change the seek position or 'pvr.seek' for timeshifting in PVR
Specifies the image file which should be displayed in the background of the slider control. 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.
|-  
|- class="userrow"
| '''orientation'''
| class="usercell" | '''textureslidernib'''
| Can be horizontal or vertical (default).  
| 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" | '''controloffsetx'''
| class="usercell" | Amount to offset the slider background texture from the left edge of the control. Only useful if a value is being rendered as well (ie in int or float mode).
|- class="userrow"
| class="usercell" | '''controloffsety'''
| class="usercell" | Amount to offset the slider background texture from the top 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.]]
|- 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.
|}
|}
[[category:Skin Development]]
 
<section end="main content" />
 
== See also ==
'''Development:'''
* [[Add-on development]]
* [[Skinning]]
 
[[Category:Skin development]]

Latest revision as of 03:18, 4 May 2023

The slider control is used for things where a sliding bar best represents the operation at hand (such as a volume control or seek control). You can choose the position, size, and look of the slider control.

Example

<control type="slider" id="17">
      <description>My first slider control</description>
      <left>80</left>
      <top>60</top>
      <width>250</width>
      <height>30</height>
      <visible>true</visible>
      <texturesliderbar>mybackgroundtexture.png</texturesliderbar>
      <texturesliderbardisabled>mydisabledbackgroundtexture.png</texturesliderbardisabled>
      <textureslidernib>mydowntexture.png</textureslidernib>
      <textureslidernibfocus>mydownfocustexture.png</textureslidernibfocus>
      <textureslidernibdisabled>mydowndisabledtexture.png</textureslidernibdisabled>
      <info></info>
      <action></action>
      <controloffsetx></controloffsetx>
      <controloffsety></controloffsety>
      <pulseonselect></pulseonselect>
      <orientation>horizontal</orientation>
      <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
texturesliderbar

Specifies the image file which should be displayed in the background of the slider control. See here for additional information about textures.

texturesliderbardisabled

Specifies the image file which should be displayed in the background of the slider control when it is disabled. (v21+)

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.
textureslidernibdisabled Specifies the image file which should be displayed for the slider nib when it it is disabled. (v21+)
controloffsetx Amount to offset the slider background texture from the left edge of the control. Only useful if a value is being rendered as well (ie in int or float mode).
controloffsety Amount to offset the slider background texture from the top edge of the control.
info Specifies the information that the slider controls. See here for more information.
action Can be 'volume' to adjust the volume, 'seek' to change the seek position or 'pvr.seek' for timeshifting in PVR
orientation Can be horizontal or vertical (default).


See also

Development: