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.Slider
Namespace Electron2D
Kind class
Category UI and Text

Overview

Provides an editable horizontal slider control.

Syntax

public class Electron2D.Slider : Electron2D.Range

Godot 4.7 C# profile compatibility

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

Editable horizontal Range control with pointer, touch, keyboard and gamepad value input.

Remarks

Slider changes Electron2D.Range.Value from pointer, touch, keyboard and gamepad input.

Thread Safety

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

Since

This type is available since Electron2D 0.1.0 Preview.

See Also

  • Electron2D.Range

Members

Member Kind Summary
Editable Property Gets or sets whether user input can change the slider.
Scrollable Property Gets or sets whether wheel-like scrolling is allowed.
Ticks Property Gets or sets the number of visual ticks.
TicksOnBorders Property Gets or sets whether ticks are drawn on borders.
Electron2D.Slider() Constructor Initializes a new instance of the Electron2D.Slider class.
_Draw() Method Draws the slider track and fill.
_GetMinimumSize() Method Gets the minimum size requested by this slider.
_GuiInput(Electron2D.InputEvent) Method Handles GUI input routed to this slider.

Member Details

Editable

Kind: Property

public System.Boolean Editable { get; set; }

Summary

Gets or sets whether user input can change the slider.

Remarks

Programmatic assignments to Electron2D.Range.Value remain allowed.

Value

true when input can edit Electron2D.Range.Value; 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

Scrollable

Kind: Property

public System.Boolean Scrollable { get; set; }

Summary

Gets or sets whether wheel-like scrolling is allowed.

Remarks

The preview stores this property for API consumers; wheel handling is not part of T-0069.

Value

true when scroll input is allowed; 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.Editable

Ticks

Kind: Property

public System.Int32 Ticks { get; set; }

Summary

Gets or sets the number of visual ticks.

Remarks

Tick rendering is not drawn in the preview visual style.

Value

A non-negative tick count.

Exceptions

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

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

TicksOnBorders

Kind: Property

public System.Boolean TicksOnBorders { get; set; }

Summary

Gets or sets whether ticks are drawn on borders.

Remarks

The preview stores this property for API consumers.

Value

true to include border ticks; 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.Ticks

Electron2D.Slider()

Kind: Constructor

public Electron2D.Slider()

Summary

Initializes a new instance of the Electron2D.Slider class.

Remarks

The new slider can receive keyboard/gamepad focus and edit values.

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

_Draw()

Kind: Method

public System.Void _Draw()()

Summary

Draws the slider track and fill.

Remarks

The preview drawing path uses rectangle primitives.

Thread Safety

This callback is invoked on the main scene thread.

Since

This method is available since Electron2D 0.1.0 Preview.

See Also

  • Electron2D.Range.Ratio

_GetMinimumSize()

Kind: Method

public Electron2D.Vector2 _GetMinimumSize()()

Summary

Gets the minimum size requested by this slider.

Remarks

The minimum size does not depend on ticks in this preview.

Returns

A baseline horizontal slider size.

Thread Safety

This callback is invoked on the main scene thread.

Since

This method is available since Electron2D 0.1.0 Preview.

See Also

  • Electron2D.Control.GetMinimumSize

_GuiInput(Electron2D.InputEvent)

Kind: Method

public System.Void _GuiInput(Electron2D.InputEvent)(Electron2D.InputEvent inputEvent)

Summary

Handles GUI input routed to this slider.

Remarks

Input is ignored when Electron2D.Slider.Editable is false.

Parameters

  • inputEvent: The input event delivered by the viewport.

Thread Safety

This callback is invoked on the main scene thread.

Since

This method is available since Electron2D 0.1.0 Preview.

See Also

  • Electron2D.Control._GuiInput(Electron2D.InputEvent)

Clone this wiki locally