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...
LabelSettings
繼承: Resource < RefCounted < Object
提供能夠在 Label 中自訂文字的常見設定。
說明
LabelSettings 是一種提供在 Label 中自訂文字的常見設定的資源。優先於 Control.theme 中定義的屬性。該資源可以在多個標籤之間共用,可以隨時替換,因此可以方便、靈活地設定文字樣式。
屬性
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
方法
void |
add_stacked_outline(index: int = -1) |
void |
add_stacked_shadow(index: int = -1) |
get_stacked_outline_color(index: int) const |
|
get_stacked_outline_size(index: int) const |
|
get_stacked_shadow_color(index: int) const |
|
get_stacked_shadow_offset(index: int) const |
|
get_stacked_shadow_outline_size(index: int) const |
|
void |
move_stacked_outline(from_index: int, to_position: int) |
void |
move_stacked_shadow(from_index: int, to_position: int) |
void |
remove_stacked_outline(index: int) |
void |
remove_stacked_shadow(index: int) |
void |
set_stacked_outline_color(index: int, color: Color) |
void |
set_stacked_outline_size(index: int, size: int) |
void |
set_stacked_shadow_color(index: int, color: Color) |
void |
set_stacked_shadow_offset(index: int, offset: Vector2) |
void |
set_stacked_shadow_outline_size(index: int, size: int) |
屬性說明
文字使用的 Font。
Color font_color = Color(1, 1, 1, 1) 🔗
文字的顏色。
文字的大小。
Additional vertical spacing between lines (in pixels), spacing is added to line descent. This value can be negative.
Color outline_color = Color(1, 1, 1, 1) 🔗
輪廓的顏色。
文字輪廓大小。
float paragraph_spacing = 0.0 🔗
Vertical space between paragraphs. Added on top of line_spacing.
Color shadow_color = Color(0, 0, 0, 0) 🔗
陰影效果的顏色。如果 Alpha 為 0 ,則不會繪製陰影。
Vector2 shadow_offset = Vector2(1, 1) 🔗
陰影效果的偏移,單位為圖元。
陰影效果的大小。
int stacked_outline_count = 0 🔗
The number of stacked outlines.
Color stacked_outline_{index}/color = Color(0, 0, 0, 1) 🔗
The color of the outline at index.
Note: index is a value in the 0 .. stacked_outline_count - 1 range.
int stacked_outline_{index}/size = 0 🔗
The size of the outline at index.
Note: index is a value in the 0 .. stacked_outline_count - 1 range.
int stacked_shadow_count = 0 🔗
The number of stacked shadows.
Color stacked_shadow_{index}/color = Color(0, 0, 0, 1) 🔗
The color of the shadow at index.
Note: index is a value in the 0 .. stacked_shadow_count - 1 range.
Vector2 stacked_shadow_{index}/offset = Vector2(1, 1) 🔗
The offset of the shadow at index.
Note: index is a value in the 0 .. stacked_shadow_count - 1 range.
int stacked_shadow_{index}/outline_size = 0 🔗
The size of the shadow outline at index.
Note: index is a value in the 0 .. stacked_shadow_count - 1 range.
方法說明
void add_stacked_outline(index: int = -1) 🔗
Adds a new stacked outline to the label at the given index. If index is -1, the new stacked outline will be added at the end of the list.
void add_stacked_shadow(index: int = -1) 🔗
Adds a new stacked shadow to the label at the given index. If index is -1, the new stacked shadow will be added at the end of the list.
Color get_stacked_outline_color(index: int) const 🔗
Returns the color of the stacked outline at index.
int get_stacked_outline_size(index: int) const 🔗
Returns the size of the stacked outline at index.
Color get_stacked_shadow_color(index: int) const 🔗
Returns the color of the stacked shadow at index.
Vector2 get_stacked_shadow_offset(index: int) const 🔗
Returns the offset of the stacked shadow at index.
int get_stacked_shadow_outline_size(index: int) const 🔗
Returns the outline size of the stacked shadow at index.
void move_stacked_outline(from_index: int, to_position: int) 🔗
Moves the stacked outline at index from_index to the given position to_position in the array.
void move_stacked_shadow(from_index: int, to_position: int) 🔗
Moves the stacked shadow at index from_index to the given position to_position in the array.
void remove_stacked_outline(index: int) 🔗
Removes the stacked outline at index index.
void remove_stacked_shadow(index: int) 🔗
Removes the stacked shadow at index index.
void set_stacked_outline_color(index: int, color: Color) 🔗
Sets the color of the stacked outline identified by the given index to color.
void set_stacked_outline_size(index: int, size: int) 🔗
Sets the size of the stacked outline identified by the given index to size.
void set_stacked_shadow_color(index: int, color: Color) 🔗
Sets the color of the stacked shadow identified by the given index to color.
void set_stacked_shadow_offset(index: int, offset: Vector2) 🔗
Sets the offset of the stacked shadow identified by the given index to offset.
void set_stacked_shadow_outline_size(index: int, size: int) 🔗
Sets the outline size of the stacked shadow identified by the given index to size.