Range

    Inherited By: EditorSpinSlider, , ScrollBar, , SpinBox,

    Abstract base class for range-based controls.

    Range is a base class for nodes that change a floating-point value between a and max_value, using a configured and page size. See e.g. and Slider for examples of higher level nodes using Range.

    Properties

    void

    ( Node with )

    void

    Signals

    Emitted when min_value, , page, or change.


    • value_changed ( float value )

    Emitted when 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 , consider using a debouncing Timer to call the function less often.

    Note: Unlike signals such as , value_changed is also emitted when value is set directly via code.

    Default

    false

    Setter

    set_allow_greater(value)

    Getter

    is_greater_allowed()

    If true, may be greater than max_value.


    • allow_lesser

    Default

    false

    Setter

    set_allow_lesser(value)

    Getter

    is_lesser_allowed()

    If , value may be less than .


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


    • max_value

    Default

    100.0

    Setter

    set_max(value)

    Getter

    get_max()

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


    Default

    0.0

    Setter

    set_min(value)

    get_min()

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


    Default

    0.0

    Setter

    set_page(value)

    Getter

    get_page()

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


    The value mapped between 0 and 1.


    • 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.


    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.


    • value

    Default

    0.0

    Setter

    set_value(value)

    Getter

    get_value()

    Range’s current value.

    Method Descriptions

    • void share ( with )

    • void unshare ( )

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