Class reference

LabelSettings

Inherits Resource

Provides common settings to customize the text in a Label.

Description

LabelSettings is a resource that provides common settings to customize the text in a Label. It will take priority over the properties defined in Control.theme. The resource can be shared between multiple labels and changed on the fly, so it's convenient and flexible way to setup text style.

Properties

Color font_color = Color(1, 1, 1, 1)

Color of the text.

int font_size = 16

Size of the text.

float line_spacing = 3.0

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)

The color of the outline.

int outline_size = 0

Text outline size.

float paragraph_spacing = 0.0

Vertical space between paragraphs. Added on top of line_spacing.

Color shadow_color = Color(0, 0, 0, 0)

Color of the shadow effect. If alpha is 0, no shadow will be drawn.

Vector2 shadow_offset = Vector2(1, 1)

Offset of the shadow effect, in pixels.

int shadow_size = 1

Size of the shadow effect.

int stacked_outline_count = 0

The number of stacked outlines.

int stacked_shadow_count = 0

The number of stacked shadows.

Methods

void add_stacked_outline(int index = -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(int index = -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(int index) const

Returns the color of the stacked outline at index.

int get_stacked_outline_size(int index) const

Returns the size of the stacked outline at index.

Color get_stacked_shadow_color(int index) const

Returns the color of the stacked shadow at index.

Vector2 get_stacked_shadow_offset(int index) const

Returns the offset of the stacked shadow at index.

int get_stacked_shadow_outline_size(int index) const

Returns the outline size of the stacked shadow at index.

void move_stacked_outline(int from_index, int to_position)

Moves the stacked outline at index from_index to the given position to_position in the array.

void move_stacked_shadow(int from_index, int to_position)

Moves the stacked shadow at index from_index to the given position to_position in the array.

void remove_stacked_outline(int index)

Removes the stacked outline at index index.

void remove_stacked_shadow(int index)

Removes the stacked shadow at index index.

void set_stacked_outline_color(int index, Color color)

Sets the color of the stacked outline identified by the given index to color.

void set_stacked_outline_size(int index, int size)

Sets the size of the stacked outline identified by the given index to size.

void set_stacked_shadow_color(int index, Color color)

Sets the color of the stacked shadow identified by the given index to color.

void set_stacked_shadow_offset(int index, Vector2 offset)

Sets the offset of the stacked shadow identified by the given index to offset.

void set_stacked_shadow_outline_size(int index, int size)

Sets the outline size of the stacked shadow identified by the given index to size.

Source revision 4f5b14abade2
Connection interrupted. Reload×

Rejoining the server...

Rejoin failed... trying again in seconds.

Failed to rejoin.
Please retry or reload the page.

The session has been paused by the server.

Failed to resume the session.
Please retry or reload the page.