Skip to content
Eduard Gushchin edited this page Jul 1, 2026 · 3 revisions

Home | API by Category | Complete API Index | API Compatibility

Field Value
Full name Electron2D.Range
Namespace Electron2D
Kind class
Category UI and Text

Overview

Provides a numeric value with minimum, maximum, step and ratio state.

Syntax

public class Electron2D.Range : Electron2D.Control

Godot 4.7 C# profile compatibility

Profile: Electron2D 0.1.0 2D
Status: Supported / Parity verified
Out of profile: no
Godot reference: Range

Numeric range base with min/max, step, page, value, ratio, rounding, allow-limits flags and value_changed signal.

Remarks

Range is the shared base for controls such as Electron2D.Slider and Electron2D.ProgressBar. It emits value_changed when Electron2D.Range.Value changes through the normal setter.

Thread Safety

This type is not synchronized. Create and mutate ranges on the main scene thread.

Since

This type is available since Electron2D 0.1.0 Preview.

See Also

  • Electron2D.ProgressBar
  • Electron2D.Slider

Members

Member Kind Summary
AllowGreater Property Gets or sets whether values above Electron2D.Range.MaxValue are allowed.
AllowLesser Property Gets or sets whether values below Electron2D.Range.MinValue are allowed.
ExpEdit Property Gets or sets whether exponential editing is requested by UI controls.
MaxValue Property Gets or sets the maximum value.
MinValue Property Gets or sets the minimum value.
Page Property Gets or sets the page size associated with this range.
Ratio Property Gets or sets the value as a ratio between minimum and maximum.
Rounded Property Gets or sets whether values are rounded to integers after step snapping.
Step Property Gets or sets the step used when snapping values.
Value Property Gets or sets the current value.
Electron2D.Range() Constructor Initializes a new instance of the Electron2D.Range class.
SetValueNoSignal(System.Double) Method Sets Electron2D.Range.Value without emitting value_changed.

Member Details

AllowGreater

Kind: Property

public System.Boolean AllowGreater { get; set; }

Summary

Gets or sets whether values above Electron2D.Range.MaxValue are allowed.

Remarks

Disabling this property clamps the current value if needed.

Value

true to allow greater values; otherwise, false.

Thread Safety

This property is not synchronized. Mutate it on the main scene thread.

Since

This property is available since Electron2D 0.1.0 Preview.

See Also

  • Electron2D.Range.AllowLesser

AllowLesser

Kind: Property

public System.Boolean AllowLesser { get; set; }

Summary

Gets or sets whether values below Electron2D.Range.MinValue are allowed.

Remarks

Disabling this property clamps the current value if needed.

Value

true to allow lesser values; otherwise, false.

Thread Safety

This property is not synchronized. Mutate it on the main scene thread.

Since

This property is available since Electron2D 0.1.0 Preview.

See Also

  • Electron2D.Range.AllowGreater

ExpEdit

Kind: Property

public System.Boolean ExpEdit { get; set; }

Summary

Gets or sets whether exponential editing is requested by UI controls.

Remarks

The preview stores this flag for API consumers; slider input remains linear.

Value

true when exponential editing is requested; otherwise, false.

Thread Safety

This property is not synchronized. Mutate it on the main scene thread.

Since

This property is available since Electron2D 0.1.0 Preview.

See Also

  • Electron2D.Slider

MaxValue

Kind: Property

public System.Double MaxValue { get; set; }

Summary

Gets or sets the maximum value.

Remarks

If assigned below Electron2D.Range.MinValue, the minimum is moved to the same value.

Value

The upper bound used by Electron2D.Range.Value and Electron2D.Range.Ratio.

Exceptions

  • System.ArgumentOutOfRangeException: Thrown when the value is not finite.

Thread Safety

This property is not synchronized. Mutate it on the main scene thread.

Since

This property is available since Electron2D 0.1.0 Preview.

See Also

  • Electron2D.Range.MinValue

MinValue

Kind: Property

public System.Double MinValue { get; set; }

Summary

Gets or sets the minimum value.

Remarks

If assigned above Electron2D.Range.MaxValue, the maximum is moved to the same value.

Value

The lower bound used by Electron2D.Range.Value and Electron2D.Range.Ratio.

Exceptions

  • System.ArgumentOutOfRangeException: Thrown when the value is not finite.

Thread Safety

This property is not synchronized. Mutate it on the main scene thread.

Since

This property is available since Electron2D 0.1.0 Preview.

See Also

  • Electron2D.Range.MaxValue

Page

Kind: Property

public System.Double Page { get; set; }

Summary

Gets or sets the page size associated with this range.

Remarks

The preview stores page size for API consumers; sliders do not render page indicators.

Value

A finite non-negative page value.

Exceptions

  • System.ArgumentOutOfRangeException: Thrown when the assigned value is negative or not finite.

Thread Safety

This property is not synchronized. Mutate it on the main scene thread.

Since

This property is available since Electron2D 0.1.0 Preview.

See Also

  • Electron2D.Range

Ratio

Kind: Property

public System.Double Ratio { get; set; }

Summary

Gets or sets the value as a ratio between minimum and maximum.

Remarks

Assigning this property maps the ratio to Electron2D.Range.Value.

Value

A value in the range 0.0 through 1.0.

Exceptions

  • System.ArgumentOutOfRangeException: Thrown when the assigned value is not finite.

Thread Safety

This property is not synchronized. Mutate it on the main scene thread.

Since

This property is available since Electron2D 0.1.0 Preview.

See Also

  • Electron2D.Range.Value

Rounded

Kind: Property

public System.Boolean Rounded { get; set; }

Summary

Gets or sets whether values are rounded to integers after step snapping.

Remarks

Rounding uses midpoint-away-from-zero behavior.

Value

true to round values; otherwise, false.

Thread Safety

This property is not synchronized. Mutate it on the main scene thread.

Since

This property is available since Electron2D 0.1.0 Preview.

See Also

  • Electron2D.Range.Value

Step

Kind: Property

public System.Double Step { get; set; }

Summary

Gets or sets the step used when snapping values.

Remarks

Non-zero values snap to the nearest step from Electron2D.Range.MinValue.

Value

0 to disable snapping, or a positive finite step.

Exceptions

  • System.ArgumentOutOfRangeException: Thrown when the assigned value is negative or not finite.

Thread Safety

This property is not synchronized. Mutate it on the main scene thread.

Since

This property is available since Electron2D 0.1.0 Preview.

See Also

  • Electron2D.Range.Value

Value

Kind: Property

public System.Double Value { get; set; }

Summary

Gets or sets the current value.

Remarks

Changing this property emits value_changed when the normalized value changes.

Value

The normalized value after clamping and snapping.

Exceptions

  • System.ArgumentOutOfRangeException: Thrown when the assigned value is not finite.

Thread Safety

This property is not synchronized. Mutate it on the main scene thread.

Since

This property is available since Electron2D 0.1.0 Preview.

See Also

  • Electron2D.Range.SetValueNoSignal(System.Double)

Electron2D.Range()

Kind: Constructor

public Electron2D.Range()

Summary

Initializes a new instance of the Electron2D.Range class.

Remarks

The constructor registers the value_changed signal.

Thread Safety

This constructor is not synchronized. Call it from the main scene thread.

Since

This constructor is available since Electron2D 0.1.0 Preview.

See Also

  • Electron2D.Range

SetValueNoSignal(System.Double)

Kind: Method

public System.Void SetValueNoSignal(System.Double)(System.Double value)

Summary

Sets Electron2D.Range.Value without emitting value_changed.

Remarks

The assigned value is still clamped and snapped.

Parameters

  • value: The value to assign.

Exceptions

  • System.ArgumentOutOfRangeException: Thrown when value is not finite.

Thread Safety

This method is not synchronized. Call it on the main scene thread.

Since

This method is available since Electron2D 0.1.0 Preview.

See Also

  • Electron2D.Range.Value

Clone this wiki locally