DialogControls-Sliders: Difference between revisions
Jump to navigation
Jump to search
mNo edit summary |
(→CT_XSLIDER=43 or Embedded Scrollbar Class: added more properties and descriptions) |
||
Line 34: | Line 34: | ||
|- | |- | ||
| '''arrowEmpty''' | | '''arrowEmpty''' | ||
| | | String | ||
| Texture shown when the left or right arrow is not pressed | | Texture shown when the left or right arrow is not pressed. | ||
|- | |- | ||
| '''arrowFull''' | | '''arrowFull''' | ||
| | | String | ||
| Texture shown when the left or right arrow is pressed | | Texture shown when the left or right arrow is pressed. | ||
|- | |- | ||
| '''border''' | | '''border''' | ||
| | | String | ||
| | | Texture of the border. | ||
|- | |- | ||
| '''colorActive''' | | '''colorActive''' | ||
| | | Color | ||
| | | Color when the slider is focused. | ||
|- | |- | ||
| '''colorDisabled''' | | '''colorDisabled''' | ||
| | | Color | ||
| | | Color when slider is disabled. | ||
|- | |- | ||
| '''thumb''' | | '''thumb''' | ||
| | | String | ||
| Texture of the part that can be dragged | | Texture of the part that can be dragged. | ||
|- | |- | ||
| ''' | | '''sliderPosition''' | ||
| | | Float | ||
| | | Inital value the slider is set to when loaded. | ||
|- | |||
| '''sliderRange''' | |||
| Array | |||
| Slider range in format {min,max}. | |||
|- | |||
| '''sliderStep''' | |||
| Float | |||
| Increment size when slider is dragged. | |||
|- | |||
| '''sliderStep''' | |||
| Float | |||
| Increment size when slider is dragged. | |||
|- | |||
| '''lineSize''' | |||
| Float | |||
| Increment size when an arrow is pressed. | |||
|- | |- | ||
|}<br clear="all"> | |}<br clear="all"> | ||
Line 78: | Line 94: | ||
// This is an ctrlEventHandler to show you some response if you move the sliderpointer. | // This is an ctrlEventHandler to show you some response if you move the sliderpointer. | ||
onSliderPosChanged = "hint format[""%1"",_this];"; | onSliderPosChanged = "hint format[""%1"",_this];"; | ||
sliderPosition = 500; | sliderPosition = 500; | ||
sliderRange[] = {50,2000}; | sliderRange[] = {50,2000}; | ||
sliderStep = 1; | sliderStep = 1; | ||
lineSize = 1; | |||
};</syntaxhighlight> | };</syntaxhighlight> | ||
Revision as of 01:46, 20 March 2020
General
- 'Sliders' and 'ScrollBars' are synonymous.
- Default scrollbars are vertical. Use ST_HORZ to change orientation.
- Embedded child scrollbars are created by the engine as and when required for various control types. (CT_LISTBOX e.g.). The engine generates it's own idc for them. In most cases you can alter characteristics of that auto-generated scrollbar via class ScrollBar
CT_SLIDER=3 (deprecated)
Properties | ||
---|---|---|
Name | Type | Remark |
coloractive | color array | color of the arrows. |
CT_XSLIDER=43 or Embedded Scrollbar Class
Embedded scrollbar classes (such as those in listboxes e.g.) use the xbox properties as per a CT_XSLIDER
Properties | ||
---|---|---|
Name | Type | Remark |
arrowEmpty | String | Texture shown when the left or right arrow is not pressed. |
arrowFull | String | Texture shown when the left or right arrow is pressed. |
border | String | Texture of the border. |
colorActive | Color | Color when the slider is focused. |
colorDisabled | Color | Color when slider is disabled. |
thumb | String | Texture of the part that can be dragged. |
sliderPosition | Float | Inital value the slider is set to when loaded. |
sliderRange | Array | Slider range in format {min,max}. |
sliderStep | Float | Increment size when slider is dragged. |
sliderStep | Float | Increment size when slider is dragged. |
lineSize | Float | Increment size when an arrow is pressed. |
- Example Config:
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];";
sliderPosition = 500;
sliderRange[] = {50,2000};
sliderStep = 1;
lineSize = 1;
};
Helpful Script Commands
sliderPosition, sliderRange, sliderSetPosition, sliderSetRange, sliderSetSpeed, sliderSpeed