Factorio API Docs

1.1.59 <>

Class LuaStyle

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

help()
string

All methods and properties that this object supports.


gui
:: LuaGui
[R]

Gui of the LuaGuiElement of this style.


:: string
[R]

Name of this style.


:: int
[RW]

Minimal width ensures, that the widget will never be smaller than than that size.


:: int
[RW]

Maximal width ensures, that the widget will never be bigger than than that size.


:: int
[RW]

Minimal height ensures, that the widget will never be smaller than than that size.


:: int
[RW]

Maximal height ensures, that the widget will never be bigger than than that size.


:: int
[RW]

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.


:: int
[RW]

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.


:: int
[RW]

:: int
[RW]


:: int
[RW]

:: int
[RW]

:: int
[RW]

:: int
[RW]

:: int
[RW]

:: string
[RW]

Horizontal align of the inner content of the widget, possible values are "left", "center" or "right"


:: string
[RW]

Vertical align of the inner content of the widget, possible values are "top", "center" or "bottom"


:: Color
[RW]

:: string
[RW]

:: int
[RW]

Space between the table cell contents top and border.


:: int
[RW]

Space between the table cell contents right and border.


:: int
[RW]

Space between the table cell contents bottom and border.


:: int
[RW]

Space between the table cell contents left and border.


:: boolean
[RW]

If the GUI element stretches its size horizontally to other elements.


:: boolean
[RW]

If the GUI element stretches its size vertically to other elements.


:: boolean
[RW]

If the GUI element can be squashed (by maximal width of some parent element) horizontally.


:: boolean
[RW]

If the GUI element can be squashed (by maximal height of some parent element) vertically.


[RW]

How this GUI element handles rich text.











:: int
[RW]

Horizontal space between individual cells.


:: int
[RW]

Vertical space between individual cells.



:: uint
[RW]

:: Color
[RW]

[R]

Array containing the alignment for every column of this table element.












:: string
[RW]





:: int
[W]

Sets both minimal and maximal width to the given value.


:: int
[W]

Sets both minimal and maximal height to the given value.


:: int or array[int]
[W]

Sets both width and height to the given value.


:: int or array[int]
[W]

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


:: int or array[int]
[W]

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


:: int
[W]

Space between the table cell contents and border.


:: int or array[int]
[W]

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


:: int or array[int]
[W]

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


:: boolean
[R]

Is this object valid?


:: string
[R]

The class name of this object.

Methods

help() → string

All methods and properties that this object supports.

Return values

:: string

Attributes

gui :: LuaGui [Read]

Gui of the LuaGuiElement of this style.


name :: string [Read]

Name of this style.


minimal_width :: int [Read/Write]

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


maximal_width :: int [Read/Write]

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


minimal_height :: int [Read/Write]

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


maximal_height :: int [Read/Write]

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


natural_width :: int [Read/Write]

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 :: int [Read/Write]

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 :: int [Read/Write]


right_padding :: int [Read/Write]


bottom_padding :: int [Read/Write]


left_padding :: int [Read/Write]


top_margin :: int [Read/Write]


right_margin :: int [Read/Write]


bottom_margin :: int [Read/Write]


left_margin :: int [Read/Write]


horizontal_align :: string [Read/Write]

Horizontal align of the inner content of the widget, possible values are "left", "center" or "right"


vertical_align :: string [Read/Write]

Vertical align of the inner content of the widget, possible values are "top", "center" or "bottom"


font_color :: Color [Read/Write]


font :: string [Read/Write]


top_cell_padding :: int [Read/Write]

Space between the table cell contents top and border.

Can only be used if this is LuaTableStyle

right_cell_padding :: int [Read/Write]

Space between the table cell contents right and border.

Can only be used if this is LuaTableStyle

bottom_cell_padding :: int [Read/Write]

Space between the table cell contents bottom and border.

Can only be used if this is LuaTableStyle

left_cell_padding :: int [Read/Write]

Space between the table cell contents left and border.

Can only be used if this is LuaTableStyle

horizontally_stretchable :: boolean [Read/Write]

If the GUI element stretches its size horizontally to other elements.


vertically_stretchable :: boolean [Read/Write]

If the GUI element stretches its size vertically to other elements.


horizontally_squashable :: boolean [Read/Write]

If the GUI element can be squashed (by maximal width of some parent element) horizontally. This is mainly meant to be used for scroll-pane The default value is false.


vertically_squashable :: boolean [Read/Write]

If the GUI element can be squashed (by maximal height of some parent element) vertically. This is mainly meant to be used for scroll-pane The default (parent) value for scroll pane is true, false otherwise.


rich_text_setting :: defines.rich_text_setting [Read/Write]

How this GUI element handles rich text.

Can only be used if this is LuaLabelStyle or LuaTextBoxStyle or LuaTextFieldStyle

hovered_font_color :: Color [Read/Write]

Can only be used if this is LuaButtonStyle

clicked_font_color :: Color [Read/Write]

Can only be used if this is LuaButtonStyle

disabled_font_color :: Color [Read/Write]

Can only be used if this is LuaButtonStyle or LuaTabStyle

pie_progress_color :: Color [Read/Write]

Can only be used if this is LuaButtonStyle

clicked_vertical_offset :: int [Read/Write]

Can only be used if this is LuaButtonStyle

selected_font_color :: Color [Read/Write]

Can only be used if this is LuaButtonStyle

selected_hovered_font_color :: Color [Read/Write]

Can only be used if this is LuaButtonStyle

selected_clicked_font_color :: Color [Read/Write]

Can only be used if this is LuaButtonStyle

strikethrough_color :: Color [Read/Write]

Can only be used if this is LuaButtonStyle

horizontal_spacing :: int [Read/Write]

Horizontal space between individual cells.

Can only be used if this is LuaTableStyle or LuaFlowStyle or LuaHorizontalFlowStyle

vertical_spacing :: int [Read/Write]

Vertical space between individual cells.

Can only be used if this is LuaTableStyle or LuaFlowStyle or LuaVerticalFlowStyle or LuaTabbedPaneStyle

use_header_filler :: boolean [Read/Write]

Can only be used if this is LuaFrameStyle

bar_width :: uint [Read/Write]

Can only be used if this is LuaProgressBarStyle

color :: Color [Read/Write]

Can only be used if this is LuaProgressBarStyle

column_alignments :: LuaCustomTable[uintAlignment] [Read]

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:

Example

table_element.style.column_alignments[1] = "center"

single_line :: boolean [Read/Write]

Can only be used if this is LabelStyle

extra_top_padding_when_activated :: int [Read/Write]

Can only be used if this is ScrollPaneStyle

extra_bottom_padding_when_activated :: int [Read/Write]

Can only be used if this is ScrollPaneStyle

extra_left_padding_when_activated :: int [Read/Write]

Can only be used if this is ScrollPaneStyle

extra_right_padding_when_activated :: int [Read/Write]

Can only be used if this is ScrollPaneStyle

extra_top_margin_when_activated :: int [Read/Write]

Can only be used if this is ScrollPaneStyle

extra_bottom_margin_when_activated :: int [Read/Write]

Can only be used if this is ScrollPaneStyle

extra_left_margin_when_activated :: int [Read/Write]

Can only be used if this is ScrollPaneStyle

extra_right_margin_when_activated :: int [Read/Write]

Can only be used if this is ScrollPaneStyle

stretch_image_to_widget_size :: boolean [Read/Write]

Can only be used if this is ImageStyle

badge_font :: string [Read/Write]

Can only be used if this is TabStyle

badge_horizontal_spacing :: int [Read/Write]

Can only be used if this is TabStyle

default_badge_font_color :: Color [Read/Write]

Can only be used if this is TabStyle

selected_badge_font_color :: Color [Read/Write]

Can only be used if this is TabStyle

disabled_badge_font_color :: Color [Read/Write]

Can only be used if this is TabStyle

width :: int [Write]

Sets both minimal and maximal width to the given value.


height :: int [Write]

Sets both minimal and maximal height to the given value.


size :: int or array[int] [Write]

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 :: int or array[int] [Write]

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 :: int or array[int] [Write]

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 :: int [Write]

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

Can only be used if this is LuaTableStyle

extra_padding_when_activated :: int or array[int] [Write]

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 :: int or array[int] [Write]

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.


valid :: boolean [Read]

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 :: string [Read]

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.

|<

Classes

Events

Concepts

Defines

Builtin types

>|