---
name: "CT SLIDER"
type: topic
source: https://community.bistudio.com/wiki/CT_SLIDER
revid: 349721
updated: 2023-11-20T22:09:51Z
---

# CT SLIDER

### Introduction

> [!IMPORTANT]
> This slider is deprecated. You might want to use [CT_XSLIDER](../topics/CT_XSLIDER.md).

A slider can be used to make the user select a value in a predefined range.

#### Related commands & functions

- Commands: General
- Commands: UI Eventhandlers
- [sliderPosition](../commands/sliderPosition.md)
- [sliderRange](../commands/sliderRange.md)
- [sliderSetPosition](../commands/sliderSetPosition.md)
- [sliderSetRange](../commands/sliderSetRange.md)
- [sliderSetSpeed](../commands/sliderSetSpeed.md)
- [sliderSpeed](../commands/sliderSpeed.md)
- [BIS_fnc_initSliderValue](../functions/BIS_fnc_initSliderValue.md)

#### Related User Interface Eventhandlers

- [Events: General](../topics/User_Interface_Event_Handlers.md#generic-events)
- [onSliderPosChanged](../topics/User_Interface_Event_Handlers.md#onsliderposchanged)

### Alphabetical Order

> [!NOTE]
> TokenNames common to most controls, such as x, y, w, h, text, idc... can be found [**here**](../topics/Arma~3A_GUI_Configuration.md#common-properties).

> [!WARNING]
> 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.

```cpp
#define CT_SLIDER 3
```

#### C

##### color

**Type:** Array

**Description:** Color of the slider.

```cpp
color[] = {1,1,1,0.8};
```

##### colorActive

**Type:** Array

**Description:** Color when the slider is focused.

```cpp
colorActive[] = {1,1,1,1};
```

#### S

##### sliderPosition

**Type:** Number

**Description:** Inital value the slider is set to when loaded.

```cpp
sliderPosition = 42;
```

##### sliderRange

**Type:** Array

**Description:** Slider range in format {min,max}.

```cpp
sliderRange[] = {0,100};
```

##### sliderStep

**Type:** Number

**Description:** Size of the steps when slider is dragged, eg if sliderStep is 1 only integers are possible for the slider value.

```cpp
sliderStep = 1;
```

#### T

##### Title

**Type:** Class

**Description:** n/a

```cpp
class Title
{
    idc = -1;
    colorBase[] = {1,1,1,1};
    colorActive[] = {1,0.5,0,1};
};
```

#### V

##### Value

**Type:** Class

**Description:** n/a

```cpp
class Value
{
    idc = 1200;
    format = "%.f";
    type = "SPTPlain";
    colorBase[] = {1,1,1,1};
    colorActive[] = {1,0.5,0,1};
};
```

### Default Classes

> [!NOTE]
> **Arma 3:** **AddOns:** Classes need to be initialised first with `class SomeClass;`
>
> ---
>
> **Missions:** Since Arma 3 v2.02 one can use `import SomeClass;` to initialise a class (see the [import](../topics/import_~28Config~29.md) keyword).
>
> In older versions, use `"Default" call BIS_fnc_exportGUIBaseClasses;` and paste the result into the [description.ext](../topics/Description.ext.md).

#### RscExample

```cpp
class RscSlider
{
    deletable = 0;
    fade = 0;
    access = 0;
    type = CT_SLIDER;
    style = SL_HORZ;
    color[] = {1,1,1,0.8};
    colorActive[] = {1,1,1,1};
    shadow = 0;
    x = 0;
    y = 0;
    w = 0.3;
    h = 0.025;
};
```

<sub>Source: [BI Community Wiki — CT SLIDER](https://community.bistudio.com/wiki/CT_SLIDER) (revision 349721).</sub>
