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.
Checking the stable version of the documentation...
ProgressBar¶
Inherits: Range < Control < CanvasItem < Node < Object
将百分比可视化表示的控件。
Description¶
将百分比可视化表示的控件。显示从右到左的填充百分比。
Properties¶
|
||
|
Theme Properties¶
|
||
|
||
|
||
|
||
Enumerations¶
enum FillMode:
FillMode FILL_BEGIN_TO_END = 0
进度条从开头到结尾水平填充,开头和结尾的位置取决于语言的方向。如果 Control.is_layout_rtl 返回 false
则为从左至右填充,如果返回 true
则为从右至左填充。
FillMode FILL_END_TO_BEGIN = 1
进度条从结尾到开头水平填充,开头和结尾的位置取决于语言的方向。如果 Control.is_layout_rtl 返回 false
则为从左至右填充,如果返回 true
则为从右至左填充。
FillMode FILL_TOP_TO_BOTTOM = 2
进度从上到下填充。
FillMode FILL_BOTTOM_TO_TOP = 3
进度从下到上填充。
Property Descriptions¶
int fill_mode = 0
填充方向。可能的取值见 FillMode。
bool show_percentage = true
为 true
时,将在进度条上显示百分比。
Theme Property Descriptions¶
Color font_color = Color(0.95, 0.95, 0.95, 1)
文本的颜色。
Color font_outline_color = Color(1, 1, 1, 1)
ProgressBar 的文本轮廓的色调。
Color font_shadow_color = Color(0, 0, 0, 1)
文本阴影的颜色。
int outline_size = 0
文字轮廓的大小。
注意:如果使用启用了 FontFile.multichannel_signed_distance_field 的字体,其 FontFile.msdf_pixel_range 必须至少设置为 outline_size 的两倍,轮廓渲染才能看起来正确。否则,轮廓可能会比预期的更早被切断。
Font font
show_percentage 为 true
时,用于绘制填充百分比的字体。
int font_size
show_percentage 为 true
时,用于绘制填充百分比的字体。
StyleBox background
背景的样式。
StyleBox fill
进度的样式(即填充进度条的部分)。