Class reference

Range

Inherits Control

Abstract base class for controls that represent a number within a range.

Description

Range is an abstract base class for controls that represent a number within a range, using a configured step and page size. See e.g. ScrollBar and Slider for examples of higher-level nodes using Range.

Properties

bool exp_edit = false

If true, and min_value is greater or equal to 0, value will be represented exponentially rather than linearly.

float ratio

The value mapped between 0 and 1.

bool rounded = false

If true, value will always be rounded to the nearest integer.

int size_flags_vertical = 0

float step = 0.01

If greater than 0, value will always be rounded to a multiple of this property's value above min_value. For example, if min_value is 0.1 and step is 0.2, then value is limited to 0.1, 0.3, 0.5, and so on. If rounded is also true, value will first be rounded to a multiple of this property's value, then rounded to the nearest integer.

Methods

void _value_changed(float new_value) virtual

Called when the Range's value is changed (following the same conditions as value_changed).

void set_value_no_signal(float value)

Sets the Range's current value to the specified value, without emitting the value_changed signal.

void share(Node with)

Binds two Ranges together along with any ranges previously grouped with either of them. When any of range's member variables change, it will share the new value with all other ranges in its group.

void unshare()

Stops the Range from sharing its member variables with any other.

Signals

value_changed(float value)

Emitted when value changes. When used on a Slider, this is called continuously while dragging (potentially every frame). If you are performing an expensive operation in a function connected to value_changed, consider using a debouncing Timer to call the function less often. Note: Unlike signals such as LineEdit.text_changed, value_changed is also emitted when value is set directly via code.

Source revision 5592dc3a7a61
Connection interrupted. Reload×

Rejoining the server...

Rejoin failed... trying again in seconds.

Failed to rejoin.
Please retry or reload the page.

The session has been paused by the server.

Failed to resume the session.
Please retry or reload the page.