Up to date

This page is up to date for Godot 4.2. If you still find outdated information, please open an issue.

ScrollBar

继承: Range < Control < CanvasItem < Node < Object

派生: HScrollBar, VScrollBar

滚动条的抽象基类。

描述

滚动条的抽象基类,通常用于对超出控件可视区域的内容进行导航。滚动条是基于 Range 的控件。

属性

float

custom_step

-1.0

float

step

0.0 (overrides Range)

主题属性

Texture2D

decrement

Texture2D

decrement_highlight

Texture2D

decrement_pressed

Texture2D

increment

Texture2D

increment_highlight

Texture2D

increment_pressed

StyleBox

grabber

StyleBox

grabber_highlight

StyleBox

grabber_pressed

StyleBox

scroll

StyleBox

scroll_focus


信号

scrolling ( )

当滚动条滚动时发出。


属性说明

float custom_step = -1.0

  • void set_custom_step ( float value )

  • float get_custom_step ( )

覆盖 在按下增和减按钮时或在 ScrollBar 已获得焦点且使用箭头键时 的步长。


主题属性说明

Texture2D decrement

用作向左/向上滚动 ScrollBar 的按钮的图标。使用 custom_step 属性支持自定义步长。


Texture2D decrement_highlight

当鼠标指针悬停在递减按钮上时显示。


Texture2D decrement_pressed

在按下递减按钮时显示。


Texture2D increment

用作向右/向下滚动 ScrollBar 的按钮的图标。使用 custom_step 属性支持自定义步长。


Texture2D increment_highlight

当鼠标指针悬停在增量按钮上时显示。


Texture2D increment_pressed

在按下增量按钮时显示。


StyleBox grabber

用作拖动条的纹理,表示当前的可拖动元素。


StyleBox grabber_highlight

当鼠标悬停在拖动条上时使用。


StyleBox grabber_pressed

在拖动条被拖动时使用。


StyleBox scroll

用作此 ScrollBar 的背景。


StyleBox scroll_focus

ScrollBar 具有 GUI 焦点时用作背景。