slider

This type represents a slider control.

This type inherits control type. All of its base methods and fields are also available in this type.

__call

Constructs the slider.

Arguments

Name

Type

Description

id

Control ID.

low

float

Minimum value.

high

float

Maximum value.

fmt

table[...]

Format. Defaults to {'%.0f'}.

step

float

Step value. Defaults to 1.0.

Format Table

Format table can either be a single string with the desired format, or multiple elements with different minimum actuators. You have to pass multiple values in the descendant order, starting from the highest value to the lowest value. min and add values are both optional, but it makes no sense to leave either of them out.

1. Single Formatting.

Type

Description

string

Format string.

2. Multi Formatting.

Name

Type

Description

min

float?

Minimal value.

add

float?

Add step.

fmt

string

Format string.

Returns

Type

Description

slider

Slider object.

Example

local slider = gui.slider(id, 0, 100, {'%.0f%%'});

get_value

Returns slider' value.

Arguments

None.

Returns

Type

Description

Example

local val = slider:get_value():get();

Last updated