Settings Slider Control

From Official Kodi Wiki
Revision as of 15:00, 25 May 2006 by >Dankula
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

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

<xml> <control>

     <description>My first settings slider control</description>
     <type>sliderex</type>
     <id>1</id>
     <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>
     font12
     <textcolor>FFFFFFFF</textcolor>
     <disabledcolor>80FFFFFF</disabledcolor>
     <textoffsetx></textoffsetx>
     <pulseonselect></pulseonselect>
     <onup>2</onup>
     <ondown>3</ondown>
     <onleft>1</onleft>
     <onright>1</onright>

</control> </xml>

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 sliderex for a settings 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.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.This is offset from the window's coordinates (normally the top edge of the screen, or 0).
width Specifies the width of the settings slider control. The texturefocus and texturenofocus images will be resized to fit into this width.
height Specifies the height of the settings slider control. The texturefocus and texturenofocus images will be resized to fit into this height.
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.
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.

texturefocus

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.

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.
disabledcolor Color used for the label if the control is disabled.
shadowcolor Specifies the color of the drop shadow on the text, in AARRGGBB format.
textoffsetx Amount to offset the label from the left 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.