DialogControls-Sliders: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
mNo edit summary
Line 1: Line 1:
'''TokenNames common to most controls, such as x,y,w,h,text,idc... are not listed here.'''
*'''TokenNames common to most controls, such as x,y,w,h,text,idc... are not listed here.'''
*Default scrollbars (sliders) are VERTICAL. Use ST_HORZ to change orientation.


===CT_SLIDER=3===
===CT_SLIDER=3===
Line 8: Line 9:
! bgcolor="#ddddff" | Type
! bgcolor="#ddddff" | Type
! bgcolor="#ddddff" | Remark
! bgcolor="#ddddff" | Remark
|-
| '''style'''
| integer
| generally 1024
|-
|-
| '''coloractive'''
| '''coloractive'''
Line 17: Line 14:
| color of the arrows.
| color of the arrows.
|-
|-
| '''Title'''
| '''Title/Value'''
| class
| classes
|
| Optional and probably script only related
|-
| '''Value'''
| class
|
|-
|}<br clear="all">
 
====Title or Value class====
{| border="1" align="left" cellpadding="3" cellspacing="0" |
! colspan="3" bgcolor="#bbbbff" | Properties
|-
! bgcolor="#ddddff" | Name
! bgcolor="#ddddff" | Type
! bgcolor="#ddddff" | Remark
|-
| '''idc'''
| integer
|
|-
| '''colorBase'''
| color array
|
|-
| '''colorActive'''
| color array
|
|-
|-
|}<br clear="all">
|}<br clear="all">
Line 60: Line 31:
! bgcolor="#ddddff" | Remark
! bgcolor="#ddddff" | Remark
|-
|-
| '''arrowEmpty'''
| '''arrowEmpty/Full'''
| texture
| textures
|
|
|-
| '''arrowFull'''
| texture
|
|-
|-
| '''border'''
| '''border'''
Line 78: Line 45:
| '''colorDisabled'''
| '''colorDisabled'''
| color
| color
|
|-
| '''style'''
| integer
|  
|  
|-
|-
Line 91: Line 54:
| float
| float
|
|
|-
| '''Title/Value'''
| classes
| Optional probably irrelevant as script only related
|-
|-
|}<br clear="all">
|}<br clear="all">




'''Notice:'''


You can change the orientation of the slider with the '''style''' constants ''SL_HORZ'' and ''SL_VERT''.
====Title or Value class====
{| border="1" align="left" cellpadding="3" cellspacing="0" |
! colspan="3" bgcolor="#bbbbff" | Properties
|-
! bgcolor="#ddddff" | Name
! bgcolor="#ddddff" | Type
! bgcolor="#ddddff" | Remark
|-
| '''idc'''
| integer
|
|-
| '''colorBase'''
| color array
|
|-
| '''colorActive'''
| color array
|
|-
|}<br clear="all">
 
==Example==
 
[[Image:ControlSlider.JPG|thumb|200px|A Slider Control]]
[[Image:ControlSlider.JPG|thumb|200px|A Slider Control]]
* '''Example:'''
* '''Example:'''

Revision as of 09:31, 30 January 2012

  • TokenNames common to most controls, such as x,y,w,h,text,idc... are not listed here.
  • Default scrollbars (sliders) are VERTICAL. Use ST_HORZ to change orientation.

CT_SLIDER=3

Properties
Name Type Remark
coloractive color array color of the arrows.
Title/Value classes Optional and probably script only related


CT_XSLIDER=43 or Embedded Scrollbar Class

Embedded scrollbar classes (such as those in listboxes eg) use the xbox properties as per a CT_XSLIDER

Properties
Name Type Remark
arrowEmpty/Full textures
border texture
colorActive color color of the arrows.
colorDisabled color
thumb texture
vspacing float
Title/Value classes Optional probably irrelevant as script only related



Title or Value class

Properties
Name Type Remark
idc integer
colorBase color array
colorActive color array


Example

A Slider Control
  • Example:

class MySlider { idc = -1; type = CT_SLIDER; style = SL_HORZ; x = 0.4; y = 0.2; w = 0.3; h = 0.025; color[] = { 1, 1, 1, 1 }; coloractive[] = { 1, 0, 0, 0.5 }; // This is an ctrlEventHandler to show you some response if you move the sliderpointer. onSliderPosChanged = "hint format[""%1"",_this];"; };

  • Helpful Script Commands:

sliderPosition, sliderRange, sliderSetPosition, sliderSetRange, sliderSetSpeed, sliderSpeed