Range¶
Inherits: Control < CanvasItem < Node < Object
Inherited By: SpinBox, ScrollBar, ProgressBar, TextureProgress, Slider
Category: Core
Brief Description¶
Abstract base class for range-based controls.
Member Functions¶
float | get_as_ratio ( ) const |
float | get_max ( ) const |
float | get_min ( ) const |
float | get_page ( ) const |
float | get_step ( ) const |
float | get_value ( ) const |
bool | is_ratio_exp ( ) const |
bool | is_using_rounded_values ( ) const |
void | set_as_ratio ( float value ) |
void | set_exp_ratio ( bool enabled ) |
void | set_max ( float maximum ) |
void | set_min ( float minimum ) |
void | set_page ( float pagesize ) |
void | set_step ( float step ) |
void | set_use_rounded_values ( bool enabled ) |
void | set_value ( float value ) |
void | share ( Node with ) |
void | unshare ( ) |
Signals¶
- changed ( )
This signal is emitted when min, max, range or step change.
- value_changed ( float value )
This signal is emitted when value changes.
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.
Member Function Description¶
- float get_as_ratio ( ) const
Return value mapped to 0 to 1 range.
- float get_max ( ) const
Return the maximum value.
- float get_min ( ) const
Return the minimum value.
- float get_page ( ) const
Return the page size, if page is 0, paging is disabled.
- float get_step ( ) const
Return the stepping, if step is 0, stepping is disabled.
- float get_value ( ) const
- bool is_ratio_exp ( ) const
- bool is_using_rounded_values ( ) const
- void set_as_ratio ( float value )
Set value mapped to 0 to 1 (unit) range, it will then be converted to the actual value within min and max.
- void set_exp_ratio ( bool enabled )
- void set_max ( float maximum )
- void set_min ( float minimum )
Set minimum value, clamped range value to it if it’s less.
- void set_page ( float pagesize )
Set page size. Page is mainly used for scrollbars or anything that controls text scrolling.
- void set_step ( float step )
Set step value. If step is 0, stepping will be disabled.
- void set_use_rounded_values ( bool enabled )
- void set_value ( float value )