Home

LuaStyle

Style of a GUI element. All of the attributes listed here may be nil if not available for a particular GUI element.

Attributes

gui

Gui of the LuaGuiElement of this style.

name

Name of this style.

minimal_width

Minimal width ensures, that the widget will never be smaller than than that size. It can't be squashed to be smaller.

maximal_width

Maximal width ensures, that the widget will never be bigger than than that size. It can't be stretched to be bigger.

minimal_height

Minimal height ensures, that the widget will never be smaller than than that size. It can't be squashed to be smaller.

maximal_height

Maximal height ensures, that the widget will never be bigger than than that size. It can't be stretched to be bigger.

natural_width

Natural width specifies the width of the element tries to have, but it can still be squashed/stretched to have a smaller or bigger size.

natural_height

Natural height specifies the height of the element tries to have, but it can still be squashed/stretched to have a smaller or bigger size.

top_padding

right_padding

bottom_padding

left_padding

top_margin

right_margin

bottom_margin

left_margin

horizontal_align

Horizontal align of the inner content of the widget, if any.

vertical_align

Vertical align of the inner content of the widget, if any.

font_color

font

top_cell_padding

Space between the table cell contents top and border.

right_cell_padding

Space between the table cell contents right and border.

bottom_cell_padding

Space between the table cell contents bottom and border.

left_cell_padding

Space between the table cell contents left and border.

horizontally_stretchable

Whether the GUI element stretches its size horizontally to other elements. nil if this element does not support stretching.

vertically_stretchable

Whether the GUI element stretches its size vertically to other elements. nil if this element does not support stretching.

horizontally_squashable

Whether the GUI element can be squashed (by maximal width of some parent element) horizontally. nil if this element does not support squashing.

This is mainly meant to be used for scroll-pane. The default value is false.

vertically_squashable

Whether the GUI element can be squashed (by maximal height of some parent element) vertically. nil if this element does not support squashing.

This is mainly meant to be used for scroll-pane. The default (parent) value for scroll pane is true, false otherwise.

rich_text_setting

How this GUI element handles rich text.

hovered_font_color

clicked_font_color

disabled_font_color

pie_progress_color

clicked_vertical_offset

selected_font_color

selected_hovered_font_color

selected_clicked_font_color

strikethrough_color

draw_grayscale_picture

horizontal_spacing

Horizontal space between individual cells.

vertical_spacing

Vertical space between individual cells.

use_header_filler

bar_width

color

column_alignments

Array containing the alignment for every column of this table element. Even though this property is marked as read-only, the alignment can be changed by indexing the LuaCustomTable, like so:

single_line

extra_top_padding_when_activated

extra_bottom_padding_when_activated

extra_left_padding_when_activated

extra_right_padding_when_activated

extra_top_margin_when_activated

extra_bottom_margin_when_activated

extra_left_margin_when_activated

extra_right_margin_when_activated

extra_padding_when_activated

Sets extra_top/right/bottom/left_padding_when_activated to this value.

An array with two values sets top/bottom padding to the first value and left/right padding to the second value. An array with four values sets top, right, bottom, left padding respectively.

extra_margin_when_activated

Sets extra_top/right/bottom/left_margin_when_activated to this value.

An array with two values sets top/bottom margin to the first value and left/right margin to the second value. An array with four values sets top, right, bottom, left margin respectively.

stretch_image_to_widget_size

badge_font

badge_horizontal_spacing

default_badge_font_color

selected_badge_font_color

disabled_badge_font_color

width

Sets both minimal and maximal width to the given value.

height

Sets both minimal and maximal height to the given value.

size

Sets both width and height to the given value. Also accepts an array with two values, setting width to the first and height to the second one.

padding

Sets top/right/bottom/left paddings to this value.

An array with two values sets top/bottom padding to the first value and left/right padding to the second value. An array with four values sets top, right, bottom, left padding respectively.

margin

Sets top/right/bottom/left margins to this value.

An array with two values sets top/bottom margin to the first value and left/right margin to the second value. An array with four values sets top, right, bottom, left margin respectively.

cell_padding

Space between the table cell contents and border. Sets top/right/bottom/left cell paddings to this value.

valid

Is this object valid? This Lua object holds a reference to an object within the game engine. It is possible that the game-engine object is removed whilst a mod still holds the corresponding Lua object. If that happens, the object becomes invalid, i.e. this attribute will be false. Mods are advised to check for object validity if any change to the game state might have occurred between the creation of the Lua object and its access.

object_name

The class name of this object. Available even when valid is false. For LuaStruct objects it may also be suffixed with a dotted path to a member of the struct.