Difference between revisions of "Slider Control"

From Official Kodi Wiki
Jump to navigation Jump to search
>Dankula
 
>DonJ
Line 92: Line 92:
| class="usercell" | Control id to move to when the user moves right off this control.
| class="usercell" | Control id to move to when the user moves right off this control.
|}
|}
[[category:Skin Development]]

Revision as of 23:19, 24 January 2007

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.

1 Example

<xml> <control>

     <description>My first slider control</description>
     <type>slider</type>
     <id>1</id>
     <posx>80</posx>
     <posy>60</posy>
     <width>250</width>
     <height>30</height>
     <visible>true</visible>
     <texturebg>mybackgroundtexture.png</texturebg>
     <textureslidernib>mydowntexture.png</textureslidernib>
     <textureslidernibfocus>mydownfocustexture.png</textureslidernibfocus>
     <info></info>
     <controloffsetx></controloffsetx>
     <controloffsety></controloffsety>
     <pulseonselect></pulseonselect>
     <onup>2</onup>
     <ondown>3</ondown>
     <onleft>1</onleft>
     <onright>1</onright>

</control> </xml>

2 Available Tags

Note that each tag is lower case only. This is important, as xml tags are case-sensitive.

description Only used to make things clear for the skinner. Not read by XBMC at all.
type Should be slider for a slider control.
id 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.
posx 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).
posy 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).
width 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.
height 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.
visible

Specifies a condition as to when this control will be visible. Can be true, false, or a condition. See here for more information. Defaults to true.

animation

Specifies the animation to be run when the control enters a particular state. See here for more information.

texturebg

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.

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.
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.
pulseonselect Specifies whether the button should pulse when it's selected. Defaults to true.
info

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

onup Control id to move to when the user moves up off this control.
ondown Control id to move to when the user moves down off this control.
onleft Control id to move to when the user moves left off this control.
onright Control id to move to when the user moves right off this control.