W3cubDocs

/Godot 3.2

Range

Inherits: Control < CanvasItem < Node < Object

Inherited By: EditorSpinSlider, ProgressBar, ScrollBar, Slider, SpinBox, TextureProgress

Abstract base class for range-based controls.

Description

Range is a base class for Control nodes that change a floating-point value between a minimum and a maximum, using step and page, for example a ScrollBar.

Properties

bool allow_greater false
bool allow_lesser false
bool exp_edit false
float max_value 100.0
float min_value 0.0
float page 0.0
float ratio
bool rounded false
float step 1.0
float value 0.0

Methods

void share ( Node with )
void unshare ( )

Signals

changed ( )

Emitted when min_value, max_value, page, or step change.

value_changed ( float value )

Emitted when value changes.

Property Descriptions

bool allow_greater

Default false
Setter set_allow_greater(value)
Getter is_greater_allowed()

If true, value may be greater than max_value.

bool allow_lesser

Default false
Setter set_allow_lesser(value)
Getter is_lesser_allowed()

If true, value may be less than min_value.

bool exp_edit

Default false
Setter set_exp_ratio(value)
Getter is_ratio_exp()

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

float max_value

Default 100.0
Setter set_max(value)
Getter get_max()

Maximum value. Range is clamped if value is greater than max_value.

float min_value

Default 0.0
Setter set_min(value)
Getter get_min()

Minimum value. Range is clamped if value is less than min_value.

float page

Default 0.0
Setter set_page(value)
Getter get_page()

Page size. Used mainly for ScrollBar. ScrollBar's length is its size multiplied by page over the difference between min_value and max_value.

float ratio

Setter set_as_ratio(value)
Getter get_as_ratio()

The value mapped between 0 and 1.

bool rounded

Default false
Setter set_use_rounded_values(value)
Getter is_using_rounded_values()

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

float step

Default 1.0
Setter set_step(value)
Getter get_step()

If greater than 0, value will always be rounded to a multiple of step. If rounded is also true, value will first be rounded to a multiple of step then rounded to the nearest integer.

float value

Default 0.0
Setter set_value(value)
Getter get_value()

Range's current value.

Method Descriptions

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 range from sharing its member variables with any other.

© 2014–2020 Juan Linietsky, Ariel Manzur, Godot Engine contributors
Licensed under the MIT License.
https://docs.godotengine.org/en/3.2/classes/class_range.html