Attention: Here be dragons

This is the latest (unstable) version of this documentation, which may document features not available in or compatible with released stable versions of Godot.

Slider

Hérite de : Range < Control < CanvasItem < Node < Object

Hérité par : HSlider, VSlider

Classe de base abstraite pour les sliders.

Description

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.

Propriétés

bool

editable

true

FocusMode

focus_mode

2 (overrides Control)

bool

scrollable

true

float

step

1.0 (overrides Range)

int

tick_count

0

bool

ticks_on_borders

false

TickPosition

ticks_position

0

Propriétés du thème

int

center_grabber

0

int

grabber_offset

0

int

tick_offset

0

Texture2D

grabber

Texture2D

grabber_disabled

Texture2D

grabber_highlight

Texture2D

tick

StyleBox

grabber_area

StyleBox

grabber_area_highlight

StyleBox

slider


Signaux

drag_ended(value_changed: bool) 🔗

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


drag_started() 🔗

Emitted when the grabber starts being dragged. This is emitted before the corresponding Range.value_changed signal.


Énumérations

enum TickPosition: 🔗

TickPosition TICK_POSITION_BOTTOM_RIGHT = 0

Places the ticks at the bottom of the HSlider, or right of the VSlider.

TickPosition TICK_POSITION_TOP_LEFT = 1

Places the ticks at the top of the HSlider, or left of the VSlider.

TickPosition TICK_POSITION_BOTH = 2

Places the ticks at the both sides of the slider.

TickPosition TICK_POSITION_CENTER = 3

Place les tics au centre du slider.


Descriptions des propriétés

bool editable = true 🔗

  • void set_editable(value: bool)

  • bool is_editable()

Si true, l'utilisateur peut intéragir avec le curseur. Si false, la valeur ne peut être modifiée que par code.


bool scrollable = true 🔗

  • void set_scrollable(value: bool)

  • bool is_scrollable()

Si true, la valeur peut être changée avec la molette de la souris.


int tick_count = 0 🔗

  • void set_ticks(value: int)

  • int get_ticks()

Le nombre de marqueurs affichées sur le curseur, y compris les marqueurs sur les bords. Les marqueurs représentent des valeurs distribués uniformément.


bool ticks_on_borders = false 🔗

  • void set_ticks_on_borders(value: bool)

  • bool get_ticks_on_borders()

Si true, le curseur affichera des marqueurs pour les valeurs minimales et maximales.


TickPosition ticks_position = 0 🔗

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


Descriptions des propriétés du thème

int center_grabber = 0 🔗

Boolean constant. If 1, the grabber texture size will be ignored and it will fit within slider's bounds based only on its center position.


int grabber_offset = 0 🔗

Vertical or horizontal offset of the grabber.


int tick_offset = 0 🔗

Décalage vertical ou horizontal des tics. Le décalage est inversé pour les tiques haut ou gauche.


Texture2D grabber 🔗

La texture du glisseur (l'élément déplaçable).


Texture2D grabber_disabled 🔗

La texture du glisseur quand il est désactivé.


Texture2D grabber_highlight 🔗

La texture du glisseur quand il a le focus.


Texture2D tick 🔗

La texture des tics, visible lorsque tick_count est supérieur à 0.


StyleBox grabber_area 🔗

The background of the area to the left or bottom of the grabber.


StyleBox grabber_area_highlight 🔗

The background of the area to the left or bottom of the grabber that displays when it's being hovered or focused.


StyleBox slider 🔗

L'arrière-plan pour tout le slider. Affecte la hauteur ou la largeur du grabber_area.