LuaGuiElement

An element of the custom GUI. This type is used to represent any kind of a GUI element -- labels as well as buttons as well as frames are all instances of this type. Just like LuaEntity, different kinds of elements support different attributes; attempting to access an attribute on an element that doesn't support it (for instance, trying to access the value of a text field) will result in a run-time error.

The following kinds of GUI elements are supported:

Each GUI element allows access to its children by having them as attributes. Thus, one can use the parent.child syntax to refer to children. Lua also supports the parent["child"] syntax to refer to the same element. This can be used in cases where the child has a name that isn't a valid Lua identifier.

Example
This will add a label called greeting to the top flow. Immediately after, it will change its text to illustrate accessing child elements.
game.player.gui.top.add{type="label", name="greeting", caption="Hi"}
game.player.gui.top.greeting.caption = "Hello there!"
game.player.gui.top["greeting"].caption = "Actually, never mind, I don't like your face"
Example
This will add a tabbed-pane and 2 tabs with contents.
local tabbed_pane = game.player.gui.top.add{type="tabbed-pane"}
local tab1 = tabbed_pane.add{type="tab", caption="Tab 1"}
local tab2 = tabbed_pane.add{type="tab", caption="Tab 2"}
local label1 = tabbed_pane.add{type="label", caption="Label 1"}
local label2 = tabbed_pane.add{type="label", caption="Label 2"}
tabbed_pane.add_tab(tab1, label1)
tabbed_pane.add_tab(tab2, label2)
class LuaGuiElement - sort
add{type=…, name=…, caption=…, tooltip=…, enabled=…, ignored_by_interaction=…, style=…} → LuaGuiElement Add a child element.
clear() Remove children of this element.
destroy() Remove this element, along with its children.
get_mod() → string The mod that owns this Gui element or nil if it's owned by the scenario script.
clear_items() Clears the items in this dropdown or listbox.
get_item(index) → LocalisedString Gets an item at the given index from this dropdown or listbox.
set_item(index, LocalisedString) Sets an item at the given index in this dropdown or listbox.
add_item(LocalisedString, index) Adds an item at the end or at the given index in this dropdown or listbox.
remove_item(index) Removes an item at the given index in this dropdown or listbox.
get_slider_minimum() → double Gets this sliders minimum value.
get_slider_maximum() → double Gets this sliders maximum value.
set_slider_minimum_maximum(minimum, maximum) Sets this sliders minimum and maximum values.
get_slider_value_step() → double Gets the minimum distance the slider can move.
get_slider_discrete_slider() → boolean Gets if the slider only allows being moved to discrete positions.
get_slider_discrete_values() → boolean Gets if the slider only allows being having discrete values.
set_slider_value_step(value) The minimum distance the slider can move.
set_slider_discrete_slider(value) Sets if the slider only allows being moved to discrete positions.
set_slider_discrete_values(value) Sets if the slider only allows being having discrete values.
focus() Focuses this GUI element if possible.
scroll_to_top() Scrolls the scroll bar to the top.
scroll_to_bottom() Scrolls the scroll bar to the bottom.
scroll_to_left() Scrolls the scroll bar to the left.
scroll_to_right() Scrolls the scroll bar to the right.
scroll_to_element(element, scroll_mode) Scrolls the scroll bar such that the specified GUI element is visible to the player.
select_all() Select all text in the text box.
select(start, end) Select a range of text in the text box.
add_tab(tab, content) Adds the given tab and content widgets to this tabbed pane as a new tab.
remove_tab(tab) Removes the given tab and what ever it's associated content is from this tabbed pane.
force_auto_center() Forces this frame to re-auto-center.
scroll_to_item(index, scroll_mode) Scrolls the scroll bar such that the specified listbox item is visible to the player.
index :: uint [R] The unique index of this GUI element.
gui :: LuaGui [R] The GUI this element is a part of.
parent :: LuaGuiElement [R] The direct parent of this element; nil if this is a top-level element.
name :: string [R] The name of this element.
caption :: LocalisedString [RW] The text displayed on the element.
value :: double [RW] How much this progress bar is filled.
direction :: string [R] Direction of the layout.
style :: LuaStyle or string [RW] The style of this element.
visible :: boolean [RW] When not visible the GUI element is hidden completely and takes no space in the layout.
text :: string [RW] The text contained in a textfield or text-box.
children_names :: array of string [R] Names of all the children of this element.
state :: boolean [RW] Is this checkbox or radiobutton checked?
player_index :: uint [R] Index into LuaGameScript::players specifying the player who owns this element.
sprite :: SpritePath [RW] The image to display on this sprite-button or sprite in the default state.
resize_to_sprite :: boolean [RW] Whether should the image widget resize its size according to the sprite in it (true by default)
hovered_sprite :: SpritePath [RW] The image to display on this sprite-button when it is hovered.
clicked_sprite :: SpritePath [RW] The image to display on this sprite-button when it is clicked.
tooltip :: LocalisedString [RW]
horizontal_scroll_policy :: string [RW] Policy of the horizontal scroll bar, possible values are "auto" (default), "never", "always", "auto-and-reserve-space".
vertical_scroll_policy :: string [RW] Policy of the vertical scroll bar, possible values are "auto" (default), "never", "always", "auto-and-reserve-space".
type :: string [R] The type of this GUI element.
children :: array of LuaGuiElement [R] The children elements
items :: array of LocalisedString [RW] The items in this dropdown or listbox.
selected_index :: uint [RW] The selected index for this dropdown or listbox.
number :: double [RW] The number to be shown in the right-bottom corner of the sprite-button, or nil to show nothing.
show_percent_for_small_numbers :: boolean [RW] Related to the number to be shown in the right-bottom corner of the sprite-button.
location :: GuiLocation [RW] The location of this widget when stored in LuaGui::screen or nil if not not set or not in LuaGui::screen.
auto_center :: boolean [RW] If this frame auto-centers on window resize when stored in LuaGui::screen.
position :: Position [RW] The position this camera or minimap is focused on if any.
surface_index :: uint [RW] The surface index this camera or minimap is using.
zoom :: double [RW] The zoom this camera or minimap is using.
minimap_player_index :: uint [RW] The player index this minimap is using.
force :: string [RW] The force this minimap is using or nil if no force is set.
elem_type :: string [R] The elem type of this choose-elem-button.
elem_value :: string or SignalID [RW] The elem value of this choose-elem-button or nil if there is no value.
selectable :: boolean [RW] If the contents of this text-box are selectable.
word_wrap :: boolean [RW] If this text-box will word-wrap automatically.
read_only :: boolean [RW] If this text-box is read-only.
enabled :: boolean [RW] If this GUI element is enabled.
ignored_by_interaction :: boolean [RW] If this GUI element is ignored by interaction.
locked :: boolean [RW] If this choose-elem-button can be changed by the player.
draw_vertical_lines :: boolean [RW] If this table should draw vertical grid lines.
draw_horizontal_lines :: boolean [RW] If this table should draw horizontal grid lines.
draw_horizontal_line_after_headers :: boolean [RW] If this table should draw a horizontal grid line after the headers.
column_count :: uint [R] The number of columns in this table.
vertical_centering :: boolean [RW] Whether the fields of this table should be vertically centered.
slider_value :: double [RW] The value of this slider element.
mouse_button_filter :: MouseButtonFlags [RW] The mouse button filters for this button or sprite-button.
numeric :: boolean [RW] If this text field only accepts numbers.
allow_decimal :: boolean [RW] If this text field (when in numeric mode) allows decimal numbers.
allow_negative :: boolean [RW] If this text field (when in numeric mode) allows negative numbers.
is_password :: boolean [RW] If this text field displays as a password field (renders all characters as '*').
lose_focus_on_confirm :: boolean [RW] If this text field loses focus after defines.events.on_gui_confirmed is fired.
clear_and_focus_on_right_click :: boolean [RW]
drag_target :: LuaGuiElement [RW] The frame drag target for this flow, frame, label, table, or empty-widget.
selected_tab_index :: uint [RW] The selected tab index or nil if no tab is selected.
tabs :: array of TabAndContent [R] The tabs and contents being shown in this tabbed-pane.
entity :: LuaEntity [RW] The entity associated with this entity-preview or nil if no entity is associated.
switch_state :: string [RW] The switch state (left, none, right) for this switch.
allow_none_state :: boolean [RW] If the 'none' state is allowed for this switch.
left_label_caption :: LocalisedString [RW] The text shown for the left switch label.
left_label_tooltip :: LocalisedString [RW] The text shown for the left switch tooltip.
right_label_caption :: LocalisedString [RW] The text shown for the right switch label.
right_label_tooltip :: LocalisedString [RW] The text shown for the right switch tooltip.
operator [] :: LuaGuiElement [R] The indexing operator.
valid :: boolean [R] Is this object valid?
help() → string All methods, and properties that this object supports.
add{type=…, name=…, caption=…, tooltip=…, enabled=…, ignored_by_interaction=…, style=…} → LuaGuiElement

Add a child element.

Parameters
Table with the following fields:
  • type :: string: The kind of the element to add. Has to be one of the above listed gui element types.
  • name :: string (optional): Name of the child element.
  • caption :: LocalisedString (optional): The text displayed on the child element. For frames, this is the "heading". For other elements, like buttons or labels, this is the content. Whilst this attribute may be used on all elements, it doesn't make sense for tables and flows as they won't display it.
  • tooltip :: LocalisedString (optional): Tooltip of the child element.
  • enabled :: boolean (optional): Whether the child element is enabled.
  • ignored_by_interaction :: boolean (optional): Whether the child element is ignored by interaction.
  • style :: string (optional): Style of the new element.
  • Other attributes may have to be specified, depending on type
    • button
      • mouse_button_filter :: MouseButtonFlags (optional): Which mouse buttons the button responds to.
    • flow
    • frame
    • table
      • column_count :: uint: Number of columns.
      • draw_vertical_lines :: boolean (optional): If the table should draw vertical grid lines. Defaults to false if not given.
      • draw_horizontal_lines :: boolean (optional): If the table should draw horizontal grid lines. Defaults to false if not given.
      • draw_horizontal_line_after_headers :: boolean (optional): If the table should draw a horizontal grid line after the headers. Defaults to false if not given.
      • vertical_centering :: boolean (optional): Whether the fields of this table should be vertically centered. Defaults to true if not given.
    • textfield
      • text :: string (optional): The initial text contained in the textfield.
      • numeric :: boolean (optional)
      • allow_decimal :: boolean (optional)
      • allow_negative :: boolean (optional)
      • is_password :: boolean (optional)
      • lose_focus_on_confirm :: boolean (optional)
      • clear_and_focus_on_right_click :: boolean (optional)
    • progressbar
      • value :: double (optional): Initial value of the progressbar, in range [0, 1]. Defaults to 0 if not given.
    • checkbox
      • state :: boolean: Whether the checkbox should be checked by default.
    • radiobutton
      • state :: boolean: Whether the radiobutton should be checked by default.
    • sprite-button
      • sprite :: SpritePath (optional): Path to the image to display on the button.
      • hovered_sprite :: SpritePath (optional): Path to the image to display on the button when it is hovered.
      • clicked_sprite :: SpritePath (optional): Path to the image to display on the button when it is clicked.
      • number :: double (optional): The number shown on the button.
      • show_percent_for_small_numbers :: boolean (optional): Format small numbers as percentages. Defaults to false if not given.
      • mouse_button_filter :: MouseButtonFlags (optional): Which mouse buttons the button responds to.
    • sprite
      • sprite :: SpritePath (optional): Path to the image to display.
    • scroll-pane
      • horizontal_scroll_policy :: string (optional): Policy of the horizontal scroll bar, possible values are "auto" (default), "never", "always", "auto-and-reserve-space".
      • vertical_scroll_policy :: string (optional): Policy of the vertical scroll bar, possible values are "auto" (default), "never", "always", "auto-and-reserve-space".
    • drop-down
      • items :: array of LocalisedString (optional): The initial items in the dropdown.
      • selected_index :: uint (optional): The initial selected index.
    • line
      • direction :: string: The initial direction of the line.
    • list-box
      • items :: array of LocalisedString (optional): The initial items in the listbox.
      • selected_index :: uint (optional): The initial selected index.
    • camera
      • position :: Position: The position the camera centers on.
      • surface_index :: uint (optional): The surface the camera will render else if not given the players surface is used.
      • zoom :: double (optional): The camera zoom - defaults to 0.75.
    • choose-elem-button
      • elem_type :: string: The type of the button - one of the following values.
      • item :: string (optional): If type is "item" - the default value for the button.
      • tile :: string (optional): If type is "tile" - the default value for the button.
      • entity :: string (optional): If type is "entity" - the default value for the button.
      • signal :: SignalID (optional): If type is "signal" - the default value for the button.
      • fluid :: string (optional): If type is "fluid" - the default value for the button.
      • recipe :: string (optional): If type is "recipe" - the default value for the button.
      • decorative :: string (optional): If type is "decorative" - the default value for the button.
      • item-group :: string (optional): If type is "item-group" - the default value for the button.
      • achievement :: string (optional): If type is "achievement" - the default value for the button.
      • equipment :: string (optional): If type is "equipment" - the default value for the button.
      • technology :: string (optional): If type is "technology" - the default value for the button.
    • text-box
      • text :: string (optional): The initial text contained in the text-box.
      • clear_and_focus_on_right_click :: boolean (optional)
    • slider
      • minimum_value :: double (optional): The minimum value for the slider
      • maximum_value :: double (optional): The maximum value for the slider
      • value :: double (optional): The initial value for the slider
      • value_step :: double (optional): The minimum value the slider can move
      • discrete_slider :: boolean (optional)
      • discrete_values :: boolean (optional)
    • minimap
      • position :: Position (optional): The position the minimap centers on or if not given it will center on the player that owns this element.
      • surface_index :: uint (optional): The surface the camera will render else if not given the players surface is used.
      • chart_player_index :: uint (optional): The player index the map should use else if not set the player that owns this element is used.
      • force :: string (optional): The force this minimap should use else if not given the players force that owns this element is used.
      • zoom :: double (optional): The camera zoom - defaults to 0.75.
    • tab
      • badge_text :: LocalisedString (optional): The text to display after the normal tab text (designed to work with numbers)
    • switch
Return value
The added GUI element.
clear()

Remove children of this element. Any LuaGuiElement objects referring to the destroyed elements become invalid after this operation.

Example
game.player.gui.top.clear()
destroy()

Remove this element, along with its children. Any LuaGuiElement objects referring to the destroyed elements become invalid after this operation.

Note: The top-level GUI elements -- LuaGui::top, LuaGui::left, LuaGui::center -- can't be destroyed.
Example
game.player.gui.top.greeting.destroy()
get_mod() → string

The mod that owns this Gui element or nil if it's owned by the scenario script.

Note: This has a not-super-expensive but not free cost to get.
clear_items()

Clears the items in this dropdown or listbox.

get_item(index) → LocalisedString

Gets an item at the given index from this dropdown or listbox.

Parameters
index :: uint: The index to get.
set_item(index, LocalisedString)

Sets an item at the given index in this dropdown or listbox.

Parameters
index :: uint: The index
LocalisedString: The item.
add_item(LocalisedString, index)

Adds an item at the end or at the given index in this dropdown or listbox.

Parameters
LocalisedString: The item.
index :: uint (optional): The index
remove_item(index)

Removes an item at the given index in this dropdown or listbox.

Parameters
index :: uint: The index
get_slider_minimum() → double

Gets this sliders minimum value.

get_slider_maximum() → double

Gets this sliders maximum value.

set_slider_minimum_maximum(minimum, maximum)

Sets this sliders minimum and maximum values.

Parameters
minimum :: double
maximum :: double
Note: The minimum can't be >= the maximum.
get_slider_value_step() → double

Gets the minimum distance the slider can move.

get_slider_discrete_slider() → boolean

Gets if the slider only allows being moved to discrete positions.

get_slider_discrete_values() → boolean

Gets if the slider only allows being having discrete values.

set_slider_value_step(value)

The minimum distance the slider can move.

Parameters
value :: double
Note: can't be > (max - min)
set_slider_discrete_slider(value)

Sets if the slider only allows being moved to discrete positions.

Parameters
value :: boolean
set_slider_discrete_values(value)

Sets if the slider only allows being having discrete values.

Parameters
value :: boolean
focus()

Focuses this GUI element if possible.

scroll_to_top()

Scrolls the scroll bar to the top.

Can only be used if this is scroll-pane or text-box
scroll_to_bottom()

Scrolls the scroll bar to the bottom.

Can only be used if this is scroll-pane or text-box
scroll_to_left()

Scrolls the scroll bar to the left.

Can only be used if this is scroll-pane or text-box
scroll_to_right()

Scrolls the scroll bar to the right.

Can only be used if this is scroll-pane or text-box
scroll_to_element(element, scroll_mode)

Scrolls the scroll bar such that the specified GUI element is visible to the player.

Parameters
element :: LuaGuiElement: The element to scroll to.
scroll_mode :: string (optional): Where the element should be positioned in the scroll-pane. Must be either: "in-view", or "top-third". Defaults to "in-view".
Can only be used if this is scroll-pane
select_all()

Select all text in the text box.

Can only be used if this is textfield or text-box
select(start, end)

Select a range of text in the text box.

Parameters
start :: int: The index of the first character to select.
end :: int: The index of the last character to select.
Example
Select the characters amp from example.
textbox.select(3, 5)
Example
Move the cursor to the start of the text box.
textbox.select(1, 0)
Can only be used if this is textfield or text-box
add_tab(tab, content)

Adds the given tab and content widgets to this tabbed pane as a new tab.

Parameters
tab :: LuaGuiElement: The tab to add, must be a GUI element of type "tab".
content :: LuaGuiElement: The content to show when this tab is selected. Can be any type of GUI element.
Can only be used if this is tabbed-pane
remove_tab(tab)

Removes the given tab and what ever it's associated content is from this tabbed pane.

Parameters
tab :: LuaGuiElement: The tab to remove. If nil all tabs are removed.
Note: Removing a tab does not destroy the tab or the tab contents. It just removes them from the view.
Note: When removing tabs LuaGuiElement::selected_tab_index needs to be manually updated.
Can only be used if this is tabbed-pane
force_auto_center()

Forces this frame to re-auto-center. Only works on frames stored directly in LuaGui::screen.

Can only be used if this is frame
scroll_to_item(index, scroll_mode)

Scrolls the scroll bar such that the specified listbox item is visible to the player.

Parameters
index :: int: The item index to scroll to.
scroll_mode :: string (optional): Where the item should be positioned in the scroll-pane. Must be either: "in-view", or "top-third". Defaults to "in-view".
Can only be used if this is list-box
index :: uint [Read-only]

The unique index of this GUI element.

gui :: LuaGui [Read-only]

The GUI this element is a part of.

parent :: LuaGuiElement [Read-only]

The direct parent of this element; nil if this is a top-level element.

name :: string [Read-only]

The name of this element.

Example
game.player.gui.top.greeting.name == "greeting"
caption :: LocalisedString [Read-Write]

The text displayed on the element. For frames, this is the "heading". For other elements, like buttons or labels, this is the content.

Note: Whilst this attribute may be used on all elements without producing an error, it doesn't make sense for tables and flows as they won't display it.
value :: double [Read-Write]

How much this progress bar is filled. It is a value in range [0, 1].

Can only be used if this is progressbar
direction :: string [Read-only]

Direction of the layout. May be either "horizontal" or "vertical".

Can only be used if this is frame, flow, or line
style :: LuaStyle or string [Read-Write]

The style of this element. When read, this evaluates to a LuaStyle. For writing, it only accepts a string that specifies the textual identifier (prototype name) of the desired style.

visible :: boolean [Read-Write]

When not visible the GUI element is hidden completely and takes no space in the layout.

text :: string [Read-Write]

The text contained in a textfield or text-box.

Can only be used if this is textfield or text-box
children_names :: array of string [Read-only]

Names of all the children of this element. These are the identifiers that can be used to access the child as an attribute of this element.

state :: boolean [Read-Write]

Is this checkbox or radiobutton checked?

Can only be used if this is CheckBox or RadioButton
player_index :: uint [Read-only]

Index into LuaGameScript::players specifying the player who owns this element.

sprite :: SpritePath [Read-Write]

The image to display on this sprite-button or sprite in the default state.

resize_to_sprite :: boolean [Read-Write]

Whether should the image widget resize its size according to the sprite in it (true by default)

hovered_sprite :: SpritePath [Read-Write]

The image to display on this sprite-button when it is hovered.

Can only be used if this is sprite-button
clicked_sprite :: SpritePath [Read-Write]

The image to display on this sprite-button when it is clicked.

tooltip :: LocalisedString [Read-Write]

horizontal_scroll_policy :: string [Read-Write]

Policy of the horizontal scroll bar, possible values are "auto" (default), "never", "always", "auto-and-reserve-space".

Can only be used if this is scroll-pane
vertical_scroll_policy :: string [Read-Write]

Policy of the vertical scroll bar, possible values are "auto" (default), "never", "always", "auto-and-reserve-space".

Can only be used if this is scroll-pane
type :: string [Read-only]

The type of this GUI element.

children :: array of LuaGuiElement [Read-only]

The children elements

items :: array of LocalisedString [Read-Write]

The items in this dropdown or listbox.

selected_index :: uint [Read-Write]

The selected index for this dropdown or listbox. 0 if none.

number :: double [Read-Write]

The number to be shown in the right-bottom corner of the sprite-button, or nil to show nothing.

show_percent_for_small_numbers :: boolean [Read-Write]

Related to the number to be shown in the right-bottom corner of the sprite-button. When set to true, numbers that are not 0 and smaller than one are shown as percent rather than the value, so for example 0.5 is shown as 50% instead.

location :: GuiLocation [Read-Write]

The location of this widget when stored in LuaGui::screen or nil if not not set or not in LuaGui::screen.

auto_center :: boolean [Read-Write]

If this frame auto-centers on window resize when stored in LuaGui::screen.

Can only be used if this is frame
position :: Position [Read-Write]

The position this camera or minimap is focused on if any.

surface_index :: uint [Read-Write]

The surface index this camera or minimap is using.

zoom :: double [Read-Write]

The zoom this camera or minimap is using.

minimap_player_index :: uint [Read-Write]

The player index this minimap is using.

Can only be used if this is minimap
force :: string [Read-Write]

The force this minimap is using or nil if no force is set.

elem_type :: string [Read-only]

The elem type of this choose-elem-button.

Can only be used if this is choose-elem-button
elem_value :: string or SignalID [Read-Write]

The elem value of this choose-elem-button or nil if there is no value.

Note: Types "item", "entity", and "tile" operate with strings. Type "signal" operates with SignalID.
Can only be used if this is choose-elem-button
selectable :: boolean [Read-Write]

If the contents of this text-box are selectable.

Can only be used if this is text-box
word_wrap :: boolean [Read-Write]

If this text-box will word-wrap automatically.

Can only be used if this is text-box
read_only :: boolean [Read-Write]

If this text-box is read-only.

Can only be used if this is text-box
enabled :: boolean [Read-Write]

If this GUI element is enabled.

ignored_by_interaction :: boolean [Read-Write]

If this GUI element is ignored by interaction. This means, that for example, label on a button can't steal the focus or click events of the button.

locked :: boolean [Read-Write]

If this choose-elem-button can be changed by the player.

Can only be used if this is choose-elem-button
draw_vertical_lines :: boolean [Read-Write]

If this table should draw vertical grid lines.

Can only be used if this is table
draw_horizontal_lines :: boolean [Read-Write]

If this table should draw horizontal grid lines.

Can only be used if this is table
draw_horizontal_line_after_headers :: boolean [Read-Write]

If this table should draw a horizontal grid line after the headers.

Can only be used if this is table
column_count :: uint [Read-only]

The number of columns in this table.

Can only be used if this is table
vertical_centering :: boolean [Read-Write]

Whether the fields of this table should be vertically centered. This true by default and overrides LuaStyle::column_alignments.

Can only be used if this is table
slider_value :: double [Read-Write]

The value of this slider element.

Can only be used if this is slider
mouse_button_filter :: MouseButtonFlags [Read-Write]

The mouse button filters for this button or sprite-button.

numeric :: boolean [Read-Write]

If this text field only accepts numbers.

Can only be used if this is textfield
allow_decimal :: boolean [Read-Write]

If this text field (when in numeric mode) allows decimal numbers.

Can only be used if this is textfield
allow_negative :: boolean [Read-Write]

If this text field (when in numeric mode) allows negative numbers.

Can only be used if this is textfield
is_password :: boolean [Read-Write]

If this text field displays as a password field (renders all characters as '*').

Can only be used if this is textfield
lose_focus_on_confirm :: boolean [Read-Write]

If this text field loses focus after defines.events.on_gui_confirmed is fired.

Can only be used if this is textfield
clear_and_focus_on_right_click :: boolean [Read-Write]

Can only be used if this is textfield or text-box
drag_target :: LuaGuiElement [Read-Write]

The frame drag target for this flow, frame, label, table, or empty-widget.

Note: drag_target can only be set to a frame stored directly in LuaGui::screen or nil.
Note: drag_target can only be set on child elements in LuaGui::screen.
Note: drag_target can only be set to a higher level parent element (this element must be owned at some nested level by the drag_target).
selected_tab_index :: uint [Read-Write]

The selected tab index or nil if no tab is selected.

Can only be used if this is tabbed-pane
tabs :: array of TabAndContent [Read-only]

The tabs and contents being shown in this tabbed-pane.

Each TabAndContent is a table:

entity :: LuaEntity [Read-Write]

The entity associated with this entity-preview or nil if no entity is associated.

Can only be used if this is entity-preview
switch_state :: string [Read-Write]

The switch state (left, none, right) for this switch.

Note: If LuaGuiElement::allow_none_state is false this can't be set to 'none'.
Can only be used if this is switch
allow_none_state :: boolean [Read-Write]

If the 'none' state is allowed for this switch.

Note: This can't be set to false if the current switch_state is 'none'.
Can only be used if this is switch
left_label_caption :: LocalisedString [Read-Write]

The text shown for the left switch label.

Can only be used if this is switch
left_label_tooltip :: LocalisedString [Read-Write]

The text shown for the left switch tooltip.

Can only be used if this is switch
right_label_caption :: LocalisedString [Read-Write]

The text shown for the right switch label.

Can only be used if this is switch
right_label_tooltip :: LocalisedString [Read-Write]

The text shown for the right switch tooltip.

Can only be used if this is switch
operator [] :: LuaGuiElement [Read-only]

The indexing operator. Gets children by name.