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

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.

Member Variables

  • bool allow_greater
  • bool allow_lesser
  • bool exp_edit - If true and min_value is greater than 0, value will be represented exponentially rather than linearly.
  • float max_value - Maximum value. Range is clamped if value is greater than max_value. Default value: 100.
  • float min_value - Minimum value. Range is clamped if value is less than min_value. Default value: 0.
  • float 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 - The value mapped between 0 and 1.
  • bool rounded - If true, value will always be rounded to the nearest integer.
  • float 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 - Range’s current value.

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

  • 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 ( )

Stop Range from sharing its member variables with any other Range.