{"name":"CT SLIDER","title":"CT SLIDER","type":"topic","url":"https://community.bistudio.com/wiki/CT_SLIDER","revid":349721,"updated":"2023-11-20T22:09:51Z","aliases":[],"markdown":"### Introduction\n\n> [!IMPORTANT]\n> This slider is deprecated. You might want to use CT_XSLIDER.\n\nA slider can be used to make the user select a value in a predefined range.\n\n#### Related commands & functions\n\n- Commands: General\n- Commands: UI Eventhandlers\n- sliderPosition\n- sliderRange\n- sliderSetPosition\n- sliderSetRange\n- sliderSetSpeed\n- sliderSpeed\n- BIS_fnc_initSliderValue\n\n#### Related User Interface Eventhandlers\n\n- Events: General\n- onSliderPosChanged\n\n### Alphabetical Order\n\n> [!NOTE]\n> TokenNames common to most controls, such as x, y, w, h, text, idc... can be found **here**.\n\n> [!WARNING]\n> Not all of the listed attributes might have an effect nor might the list be complete. All attributes were gathered with [this](https://github.com/7erra/BIKI.VR/blob/master/fnc/generateCTPage.sqf) config crawler.\n\n```cpp\n#define CT_SLIDER 3\n```\n\n#### C\n\n##### color\n\n**Type:** Array\n\n**Description:** Color of the slider.\n\n```cpp\ncolor[] = {1,1,1,0.8};\n```\n\n##### colorActive\n\n**Type:** Array\n\n**Description:** Color when the slider is focused.\n\n```cpp\ncolorActive[] = {1,1,1,1};\n```\n\n#### S\n\n##### sliderPosition\n\n**Type:** Number\n\n**Description:** Inital value the slider is set to when loaded.\n\n```cpp\nsliderPosition = 42;\n```\n\n##### sliderRange\n\n**Type:** Array\n\n**Description:** Slider range in format {min,max}.\n\n```cpp\nsliderRange[] = {0,100};\n```\n\n##### sliderStep\n\n**Type:** Number\n\n**Description:** Size of the steps when slider is dragged, eg if sliderStep is 1 only integers are possible for the slider value.\n\n```cpp\nsliderStep = 1;\n```\n\n#### T\n\n##### Title\n\n**Type:** Class\n\n**Description:** n/a\n\n```cpp\nclass Title\n{\n    idc = -1;\n    colorBase[] = {1,1,1,1};\n    colorActive[] = {1,0.5,0,1};\n};\n```\n\n#### V\n\n##### Value\n\n**Type:** Class\n\n**Description:** n/a\n\n```cpp\nclass Value\n{\n    idc = 1200;\n    format = \"%.f\";\n    type = \"SPTPlain\";\n    colorBase[] = {1,1,1,1};\n    colorActive[] = {1,0.5,0,1};\n};\n```\n\n### Default Classes\n\n> [!NOTE]\n> **Arma 3:** **AddOns:** Classes need to be initialised first with `class SomeClass;`\n>\n> ---\n>\n> **Missions:** Since Arma 3 v2.02 one can use `import SomeClass;` to initialise a class (see the import keyword).\n>\n> In older versions, use `\"Default\" call BIS_fnc_exportGUIBaseClasses;` and paste the result into the description.ext.\n\n#### RscExample\n\n```cpp\nclass RscSlider\n{\n    deletable = 0;\n    fade = 0;\n    access = 0;\n    type = CT_SLIDER;\n    style = SL_HORZ;\n    color[] = {1,1,1,0.8};\n    colorActive[] = {1,1,1,1};\n    shadow = 0;\n    x = 0;\n    y = 0;\n    w = 0.3;\n    h = 0.025;\n};\n```","sections":[{"heading":"Introduction","level":3,"markdown":"> [!IMPORTANT]\n> This slider is deprecated. You might want to use CT_XSLIDER.\n\nA slider can be used to make the user select a value in a predefined range."},{"heading":"Related commands & functions","level":4,"markdown":"- Commands: General\n- Commands: UI Eventhandlers\n- sliderPosition\n- sliderRange\n- sliderSetPosition\n- sliderSetRange\n- sliderSetSpeed\n- sliderSpeed\n- BIS_fnc_initSliderValue"},{"heading":"Related User Interface Eventhandlers","level":4,"markdown":"- Events: General\n- onSliderPosChanged"},{"heading":"Alphabetical Order","level":3,"markdown":"> [!NOTE]\n> TokenNames common to most controls, such as x, y, w, h, text, idc... can be found **here**.\n\n> [!WARNING]\n> Not all of the listed attributes might have an effect nor might the list be complete. All attributes were gathered with [this](https://github.com/7erra/BIKI.VR/blob/master/fnc/generateCTPage.sqf) config crawler.\n\n```cpp\n#define CT_SLIDER 3\n```"},{"heading":"C","level":4,"markdown":""},{"heading":"color","level":5,"markdown":"**Type:** Array\n\n**Description:** Color of the slider.\n\n```cpp\ncolor[] = {1,1,1,0.8};\n```"},{"heading":"colorActive","level":5,"markdown":"**Type:** Array\n\n**Description:** Color when the slider is focused.\n\n```cpp\ncolorActive[] = {1,1,1,1};\n```"},{"heading":"S","level":4,"markdown":""},{"heading":"sliderPosition","level":5,"markdown":"**Type:** Number\n\n**Description:** Inital value the slider is set to when loaded.\n\n```cpp\nsliderPosition = 42;\n```"},{"heading":"sliderRange","level":5,"markdown":"**Type:** Array\n\n**Description:** Slider range in format {min,max}.\n\n```cpp\nsliderRange[] = {0,100};\n```"},{"heading":"sliderStep","level":5,"markdown":"**Type:** Number\n\n**Description:** Size of the steps when slider is dragged, eg if sliderStep is 1 only integers are possible for the slider value.\n\n```cpp\nsliderStep = 1;\n```"},{"heading":"T","level":4,"markdown":""},{"heading":"Title","level":5,"markdown":"**Type:** Class\n\n**Description:** n/a\n\n```cpp\nclass Title\n{\n    idc = -1;\n    colorBase[] = {1,1,1,1};\n    colorActive[] = {1,0.5,0,1};\n};\n```"},{"heading":"V","level":4,"markdown":""},{"heading":"Value","level":5,"markdown":"**Type:** Class\n\n**Description:** n/a\n\n```cpp\nclass Value\n{\n    idc = 1200;\n    format = \"%.f\";\n    type = \"SPTPlain\";\n    colorBase[] = {1,1,1,1};\n    colorActive[] = {1,0.5,0,1};\n};\n```"},{"heading":"Default Classes","level":3,"markdown":"> [!NOTE]\n> **Arma 3:** **AddOns:** Classes need to be initialised first with `class SomeClass;`\n>\n> ---\n>\n> **Missions:** Since Arma 3 v2.02 one can use `import SomeClass;` to initialise a class (see the import keyword).\n>\n> In older versions, use `\"Default\" call BIS_fnc_exportGUIBaseClasses;` and paste the result into the description.ext."},{"heading":"RscExample","level":4,"markdown":"```cpp\nclass RscSlider\n{\n    deletable = 0;\n    fade = 0;\n    access = 0;\n    type = CT_SLIDER;\n    style = SL_HORZ;\n    color[] = {1,1,1,0.8};\n    colorActive[] = {1,1,1,1};\n    shadow = 0;\n    x = 0;\n    y = 0;\n    w = 0.3;\n    h = 0.025;\n};\n```"}],"categories":["Control Types"],"groups":["GUI"]}