Slider

package
v0.0.0-...-357ca8a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 20, 2025 License: MIT Imports: 27 Imported by: 0

Documentation

Overview

Abstract base class for sliders, used to adjust a value by moving a grabber along a horizontal or vertical axis. Sliders are Range-based controls.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Advanced

type Advanced = class

Advanced exposes a 1:1 low-level instance of the class, undocumented, for those who know what they are doing.

type Any

type Any interface {
	gd.IsClass
	AsSlider() Instance
}

type Extension

type Extension[T gdclass.Interface] struct{ gdclass.Extension[T, Instance] }

Extension can be embedded in a new struct to create an extension of this class. T should be the type that is embedding this Extension

func (*Extension[T]) AsCanvasItem

func (self *Extension[T]) AsCanvasItem() CanvasItem.Instance

func (*Extension[T]) AsControl

func (self *Extension[T]) AsControl() Control.Instance

func (*Extension[T]) AsNode

func (self *Extension[T]) AsNode() Node.Instance

func (*Extension[T]) AsObject

func (self *Extension[T]) AsObject() [1]gd.Object

func (*Extension[T]) AsRange

func (self *Extension[T]) AsRange() Range.Instance

func (*Extension[T]) AsSlider

func (self *Extension[T]) AsSlider() Instance

type ID

type ID Object.ID

ID is a typed object ID (reference) to an instance of this class, use it to store references to objects with unknown lifetimes, as an ID will not panic on use if the underlying object has been destroyed.

func (ID) Instance

func (id ID) Instance() (Instance, bool)

type Instance

type Instance [1]gdclass.Slider

Instance of the class with convieniently typed arguments and results.

var Nil Instance

Nil is a nil/null instance of the class. Equivalent to the zero value.

func New

func New() Instance

func (Instance) AsCanvasItem

func (self Instance) AsCanvasItem() CanvasItem.Instance

func (Instance) AsControl

func (self Instance) AsControl() Control.Instance

func (Instance) AsNode

func (self Instance) AsNode() Node.Instance

func (Instance) AsObject

func (self Instance) AsObject() [1]gd.Object

func (Instance) AsRange

func (self Instance) AsRange() Range.Instance

func (Instance) AsSlider

func (self Instance) AsSlider() Instance

func (Instance) Editable

func (self Instance) Editable() bool

If true, the slider can be interacted with. If false, the value can be changed only by code.

func (Instance) ID

func (self Instance) ID() ID

func (Instance) OnDragEnded

func (self Instance) OnDragEnded(cb func(value_changed bool), flags ...Signal.Flags)

Emitted when the grabber stops being dragged. If 'value_changed' is true, Range.Value is different from the value when the dragging was started.

func (Instance) OnDragStarted

func (self Instance) OnDragStarted(cb func(), flags ...Signal.Flags)

Emitted when the grabber starts being dragged. This is emitted before the corresponding OnRange.ValueChanged signal.

func (Instance) Scrollable

func (self Instance) Scrollable() bool

If true, the value can be changed using the mouse wheel.

func (Instance) SetEditable

func (self Instance) SetEditable(value bool)

SetEditable sets the property returned by [IsEditable].

func (*Instance) SetObject

func (self *Instance) SetObject(obj [1]gd.Object) bool

func (Instance) SetScrollable

func (self Instance) SetScrollable(value bool)

SetScrollable sets the property returned by [IsScrollable].

func (Instance) SetTickCount

func (self Instance) SetTickCount(value int)

SetTickCount sets the property returned by [GetTicks].

func (Instance) SetTicksOnBorders

func (self Instance) SetTicksOnBorders(value bool)

SetTicksOnBorders sets the property returned by [GetTicksOnBorders].

func (Instance) SetTicksPosition

func (self Instance) SetTicksPosition(value TickPosition)

SetTicksPosition sets the property returned by [GetTicksPosition].

func (Instance) TickCount

func (self Instance) TickCount() int

Number of ticks displayed on the slider, including border ticks. Ticks are uniformly-distributed value markers.

func (Instance) TicksOnBorders

func (self Instance) TicksOnBorders() bool

If true, the slider will display ticks for minimum and maximum values.

func (Instance) TicksPosition

func (self Instance) TicksPosition() TickPosition

Sets the position of the ticks. See TickPosition for details.

func (Instance) Virtual

func (self Instance) Virtual(name string) reflect.Value

type TickPosition

type TickPosition int //gd:Slider.TickPosition
const (
	// Places the ticks at the bottom of the [HSlider], or right of the [VSlider].
	//
	// [HSlider]: https://pkg.go.dev/graphics.gd/classdb/HSlider
	// [VSlider]: https://pkg.go.dev/graphics.gd/classdb/VSlider
	TickPositionBottomRight TickPosition = 0
	// Places the ticks at the top of the [HSlider], or left of the [VSlider].
	//
	// [HSlider]: https://pkg.go.dev/graphics.gd/classdb/HSlider
	// [VSlider]: https://pkg.go.dev/graphics.gd/classdb/VSlider
	TickPositionTopLeft TickPosition = 1
	// Places the ticks at the both sides of the slider.
	TickPositionBoth TickPosition = 2
	// Places the ticks at the center of the slider.
	TickPositionCenter TickPosition = 3
)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL