-
Notifications
You must be signed in to change notification settings - Fork 0
/
LuaGuiElement.html
236 lines (236 loc) · 116 KB
/
LuaGuiElement.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
<!DOCTYPE html>
<!-- saved from url=(0054)https://lua-api.factorio.com/latest/LuaGuiElement.html -->
<html lang="en"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>LuaGuiElement</title><link rel="stylesheet" type="text/css" href="./LuaGuiElement_files/lua-doc.css"><script rel="stylesheet" type="text/javascript" src="./LuaGuiElement_files/lua-doc.js.download"></script></head><body><div class="navigation-bar"><span class="navigation"><a href="https://lua-api.factorio.com/latest/index.html">Factorio</a> » <a href="https://lua-api.factorio.com/latest/Classes.html">Classes</a> » LuaGuiElement</span><span class="version">Factorio 0.17.79</span></div><h1>LuaGuiElement</h1><div class="brief-description"><p> 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 <a href="https://lua-api.factorio.com/latest/LuaEntity.html">LuaEntity</a>, 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 <code>value</code> of a text field) will result in a run-time error.</p><p> The following kinds of GUI elements are supported:
</p><ul><li> <code>"button"</code>: Clickable elements that fire <a href="https://lua-api.factorio.com/latest/events.html#on_gui_click">on_gui_click</a> when clicked.</li><li> <code>"sprite-button"</code>: A button that displays an image rather than text.</li><li> <code>"checkbox"</code>: Clickable elements with a cross in the middle that can be turned off or on.</li><li> <code>"flow"</code>: Invisible containers that lay out children either horizontally or vertically. The root
GUI elements (<code>top</code>, <code>left</code> and <code>center</code>; see <a href="https://lua-api.factorio.com/latest/LuaGui.html">LuaGui</a>) are flows.</li><li> <code>"frame"</code>: Grey semi-transparent boxes that contain other elements. They have a caption, and, just
like flows, they lay out children either horizontally or vertically.</li><li> <code>"label"</code>: A piece of text.</li><li> <code>"line"</code>: A vertical or horizontal line.</li><li> <code>"progressbar"</code>: Indicate progress by displaying a partially filled bar.</li><li> <code>"table"</code>: An invisible container that lays out children in a specific number of columns.
Column width is given by the largest element contained in that row.</li><li> <code>"textfield"</code>: Boxes of text the user can type in.</li><li> <code>"radiobutton"</code>: Identical to checkbox except circular.</li><li> <code>"sprite"</code>: An element that shows an image.</li><li> <code>"scroll-pane"</code>: Similar to a flow but includes the ability to show and use scroll bars.</li><li> <code>"drop-down"</code>: A drop down list of other elements.</li><li> <code>"list-box"</code>: A list of other elements.</li><li> <code>"camera"</code>: A camera that shows the game at the given position on the given surface.</li><li> <code>"choose-elem-button"</code>: A button that lets the player pick one of an: item, entity, tile, or signal similar to the filter-select window.</li><li> <code>"text-box"</code>: A multi-line text box that supports selection and copy-paste.</li><li> <code>"slider"</code>: A number picker.</li><li> <code>"minimap"</code>: A minimap preview similar to the normal player minimap.</li><li> <code>"entity-preview"</code>: A preview of an entity. The entity has to be set after the GUI element is created.</li><li> <code>"empty-widget"</code>: A empty widget that just exists. The root GUI element <code>screen</code> is an empty-widget.</li><li> <code>"tabbed-pane"</code>: A collection of tabs.</li><li> <code>"tab"</code>: A tab for use in a tabbed-pane.</li><li> <code>"switch"</code>: A switch with left, right, and none states.</li></ul><p> Each GUI element allows access to its children by having them as attributes. Thus, one can use the
<code>parent.child</code> syntax to refer to children. Lua also supports the <code>parent["child"]</code> 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.
</p><p>
</p><div class="example"><div class="example-header">Example</div>
This will add a label called <code>greeting</code> to the top flow. Immediately after, it will change its text
to illustrate accessing child elements.
<div class="block-code-container"><code class="block"> game.player.gui.top.add{type="label", name="greeting", caption="Hi"}<br>
game.player.gui.top.greeting.caption = "Hello there!"<br>
game.player.gui.top["greeting"].caption = "Actually, never mind, I don't like your face"</code></div>
</div><div class="example"><div class="example-header">Example</div>
This will add a tabbed-pane and 2 tabs with contents.
<div class="block-code-container"><code class="block"> local tabbed_pane = game.player.gui.top.add{type="tabbed-pane"}<br>
local tab1 = tabbed_pane.add{type="tab", caption="Tab 1"}<br>
local tab2 = tabbed_pane.add{type="tab", caption="Tab 2"}<br>
local label1 = tabbed_pane.add{type="label", caption="Label 1"}<br>
local label2 = tabbed_pane.add{type="label", caption="Label 2"}<br>
tabbed_pane.add_tab(tab1, label1)<br>
tabbed_pane.add_tab(tab2, label2)</code></div>
</div></div><div class="brief-listing"><div class="brief-listing" id="LuaGuiElement.brief">class <span class="type-name">LuaGuiElement</span> - <a class="sort" href="javascript:void(0)" onclick="sort('LuaGuiElement.brief');">sort</a><table class="brief-members"><tbody><tr><td class="header"><span class="element-name"><a href="https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.add">add</a>{type=…, name=…, caption=…, tooltip=…, enabled=…, ignored_by_interaction=…, style=…} → <span class="return-type"><span class="param-type"><a href="https://lua-api.factorio.com/latest/LuaGuiElement.html">LuaGuiElement</a></span></span></span></td><td class="description"> Add a child element.</td></tr><tr><td class="header"><span class="element-name"><a href="https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.clear">clear</a>()</span></td><td class="description"> Remove children of this element.</td></tr><tr><td class="header"><span class="element-name"><a href="https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.destroy">destroy</a>()</span></td><td class="description"> Remove this element, along with its children.</td></tr><tr><td class="header"><span class="element-name"><a href="https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.get_mod">get_mod</a>() → <span class="return-type"><span class="param-type"><a href="https://lua-api.factorio.com/latest/Builtin-Types.html#string">string</a></span></span></span></td><td class="description"> The mod that owns this Gui element or <code>nil</code> if it's owned by the scenario script.</td></tr><tr><td class="header"><span class="element-name"><a href="https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.clear_items">clear_items</a>()</span></td><td class="description"> Clears the items in this dropdown or listbox.</td></tr><tr><td class="header"><span class="element-name"><a href="https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.get_item">get_item</a>(index) → <span class="return-type"><span class="param-type"><a href="https://lua-api.factorio.com/latest/Concepts.html#LocalisedString">LocalisedString</a></span></span></span></td><td class="description"> Gets an item at the given index from this dropdown or listbox.</td></tr><tr><td class="header"><span class="element-name"><a href="https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.set_item">set_item</a>(index, LocalisedString)</span></td><td class="description"> Sets an item at the given index in this dropdown or listbox.</td></tr><tr><td class="header"><span class="element-name"><a href="https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.add_item">add_item</a>(LocalisedString, index)</span></td><td class="description"> Adds an item at the end or at the given index in this dropdown or listbox.</td></tr><tr><td class="header"><span class="element-name"><a href="https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.remove_item">remove_item</a>(index)</span></td><td class="description"> Removes an item at the given index in this dropdown or listbox.</td></tr><tr><td class="header"><span class="element-name"><a href="https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.get_slider_minimum">get_slider_minimum</a>() → <span class="return-type"><span class="param-type"><a href="https://lua-api.factorio.com/latest/Builtin-Types.html#double">double</a></span></span></span></td><td class="description"> Gets this sliders minimum value.</td></tr><tr><td class="header"><span class="element-name"><a href="https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.get_slider_maximum">get_slider_maximum</a>() → <span class="return-type"><span class="param-type"><a href="https://lua-api.factorio.com/latest/Builtin-Types.html#double">double</a></span></span></span></td><td class="description"> Gets this sliders minimum value.</td></tr><tr><td class="header"><span class="element-name"><a href="https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.set_slider_minimum_maximum">set_slider_minimum_maximum</a>(minimum, maximum)</span></td><td class="description"> Sets this sliders minimum and maximum values.</td></tr><tr><td class="header"><span class="element-name"><a href="https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.get_slider_value_step">get_slider_value_step</a>() → <span class="return-type"><span class="param-type"><a href="https://lua-api.factorio.com/latest/Builtin-Types.html#double">double</a></span></span></span></td><td class="description"> Gets the minimum distance the slider can move.</td></tr><tr><td class="header"><span class="element-name"><a href="https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.get_slider_discrete_slider">get_slider_discrete_slider</a>() → <span class="return-type"><span class="param-type"><a href="https://lua-api.factorio.com/latest/Builtin-Types.html#boolean">boolean</a></span></span></span></td><td class="description"> Gets if the slider only allows being moved to discrete positions.</td></tr><tr><td class="header"><span class="element-name"><a href="https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.get_slider_discrete_values">get_slider_discrete_values</a>() → <span class="return-type"><span class="param-type"><a href="https://lua-api.factorio.com/latest/Builtin-Types.html#boolean">boolean</a></span></span></span></td><td class="description"> Gets if the slider only allows being having discrete values.</td></tr><tr><td class="header"><span class="element-name"><a href="https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.set_slider_value_step">set_slider_value_step</a>(value)</span></td><td class="description"> The minimum distance the slider can move.</td></tr><tr><td class="header"><span class="element-name"><a href="https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.set_slider_discrete_slider">set_slider_discrete_slider</a>(value)</span></td><td class="description"> Sets if the slider only allows being moved to discrete positions.</td></tr><tr><td class="header"><span class="element-name"><a href="https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.set_slider_discrete_values">set_slider_discrete_values</a>(value)</span></td><td class="description"> Sets if the slider only allows being having discrete values.</td></tr><tr><td class="header"><span class="element-name"><a href="https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.focus">focus</a>()</span></td><td class="description"> Focuses this GUI element if possible.</td></tr><tr><td class="header"><span class="element-name"><a href="https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.scroll_to_top">scroll_to_top</a>()</span></td><td class="description"> Scrolls the scroll bar to the top.</td></tr><tr><td class="header"><span class="element-name"><a href="https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.scroll_to_bottom">scroll_to_bottom</a>()</span></td><td class="description"> Scrolls the scroll bar to the bottom.</td></tr><tr><td class="header"><span class="element-name"><a href="https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.scroll_to_left">scroll_to_left</a>()</span></td><td class="description"> Scrolls the scroll bar to the left.</td></tr><tr><td class="header"><span class="element-name"><a href="https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.scroll_to_right">scroll_to_right</a>()</span></td><td class="description"> Scrolls the scroll bar to the right.</td></tr><tr><td class="header"><span class="element-name"><a href="https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.scroll_to_element">scroll_to_element</a>(element, scroll_mode)</span></td><td class="description"> Scrolls the scroll bar such that the specified GUI element is visible to the player.</td></tr><tr><td class="header"><span class="element-name"><a href="https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.select_all">select_all</a>()</span></td><td class="description"> Select all text in the text box.</td></tr><tr><td class="header"><span class="element-name"><a href="https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.select">select</a>(start, end)</span></td><td class="description"> Select a range of text in the text box.</td></tr><tr><td class="header"><span class="element-name"><a href="https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.add_tab">add_tab</a>(tab, content)</span></td><td class="description"> Adds the given tab and content widgets to this tabbed pane as a new tab.</td></tr><tr><td class="header"><span class="element-name"><a href="https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.remove_tab">remove_tab</a>(tab)</span></td><td class="description"> Removes the given tab and what ever it's associated content is from this tabbed pane.</td></tr><tr><td class="header"><span class="element-name"><a href="https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.force_auto_center">force_auto_center</a>()</span></td><td class="description"> Forces this frame to re-auto-center.</td></tr><tr><td class="header"><span class="element-name"><a href="https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.index">index</a></span><span class="attribute-type"> :: <span class="param-type"><a href="https://lua-api.factorio.com/latest/Builtin-Types.html#uint">uint</a></span></span><span class="attribute-mode"> [R]</span></td><td class="description"> The unique index of this GUI element.</td></tr><tr><td class="header"><span class="element-name"><a href="https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.gui">gui</a></span><span class="attribute-type"> :: <span class="param-type"><a href="https://lua-api.factorio.com/latest/LuaGui.html">LuaGui</a></span></span><span class="attribute-mode"> [R]</span></td><td class="description"> The GUI this element is a part of.</td></tr><tr><td class="header"><span class="element-name"><a href="https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.parent">parent</a></span><span class="attribute-type"> :: <span class="param-type"><a href="https://lua-api.factorio.com/latest/LuaGuiElement.html">LuaGuiElement</a></span></span><span class="attribute-mode"> [R]</span></td><td class="description"> The direct parent of this element; <code>nil</code> if this is a top-level element.</td></tr><tr><td class="header"><span class="element-name"><a href="https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.name">name</a></span><span class="attribute-type"> :: <span class="param-type"><a href="https://lua-api.factorio.com/latest/Builtin-Types.html#string">string</a></span></span><span class="attribute-mode"> [R]</span></td><td class="description"> The name of this element.</td></tr><tr><td class="header"><span class="element-name"><a href="https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.caption">caption</a></span><span class="attribute-type"> :: <span class="param-type"><a href="https://lua-api.factorio.com/latest/Concepts.html#LocalisedString">LocalisedString</a></span></span><span class="attribute-mode"> [RW]</span></td><td class="description">
The text displayed on the element.</td></tr><tr><td class="header"><span class="element-name"><a href="https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.value">value</a></span><span class="attribute-type"> :: <span class="param-type"><a href="https://lua-api.factorio.com/latest/Builtin-Types.html#double">double</a></span></span><span class="attribute-mode"> [RW]</span></td><td class="description"> How much this progress bar is filled.</td></tr><tr><td class="header"><span class="element-name"><a href="https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.direction">direction</a></span><span class="attribute-type"> :: <span class="param-type"><a href="https://lua-api.factorio.com/latest/Builtin-Types.html#string">string</a></span></span><span class="attribute-mode"> [R]</span></td><td class="description"> Direction of the layout.</td></tr><tr><td class="header"><span class="element-name"><a href="https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.style">style</a></span><span class="attribute-type"> :: <span class="param-type"><span class="param-type"><a href="https://lua-api.factorio.com/latest/LuaStyle.html">LuaStyle</a></span> or <span class="param-type"><a href="https://lua-api.factorio.com/latest/Builtin-Types.html#string">string</a></span></span></span><span class="attribute-mode"> [RW]</span></td><td class="description"> The style of this element.</td></tr><tr><td class="header"><span class="element-name"><a href="https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.visible">visible</a></span><span class="attribute-type"> :: <span class="param-type"><a href="https://lua-api.factorio.com/latest/Builtin-Types.html#boolean">boolean</a></span></span><span class="attribute-mode"> [RW]</span></td><td class="description"> When not visible the GUI element is hidden completely and takes no space in the layout.</td></tr><tr><td class="header"><span class="element-name"><a href="https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.text">text</a></span><span class="attribute-type"> :: <span class="param-type"><a href="https://lua-api.factorio.com/latest/Builtin-Types.html#string">string</a></span></span><span class="attribute-mode"> [RW]</span></td><td class="description"> The text contained in a textfield or text-box.</td></tr><tr><td class="header"><span class="element-name"><a href="https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.children_names">children_names</a></span><span class="attribute-type"> :: <span class="param-type">array of <span class="param-type"><a href="https://lua-api.factorio.com/latest/Builtin-Types.html#string">string</a></span></span></span><span class="attribute-mode"> [R]</span></td><td class="description">
Names of all the children of this element.</td></tr><tr><td class="header"><span class="element-name"><a href="https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.state">state</a></span><span class="attribute-type"> :: <span class="param-type"><a href="https://lua-api.factorio.com/latest/Builtin-Types.html#boolean">boolean</a></span></span><span class="attribute-mode"> [RW]</span></td><td class="description"> Is this checkbox or radiobutton checked?</td></tr><tr><td class="header"><span class="element-name"><a href="https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.player_index">player_index</a></span><span class="attribute-type"> :: <span class="param-type"><a href="https://lua-api.factorio.com/latest/Builtin-Types.html#uint">uint</a></span></span><span class="attribute-mode"> [R]</span></td><td class="description"> Index into <a href="https://lua-api.factorio.com/latest/LuaGameScript.html#LuaGameScript.players">LuaGameScript::players</a> specifying the player who owns this element.</td></tr><tr><td class="header"><span class="element-name"><a href="https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.sprite">sprite</a></span><span class="attribute-type"> :: <span class="param-type"><a href="https://lua-api.factorio.com/latest/Concepts.html#SpritePath">SpritePath</a></span></span><span class="attribute-mode"> [RW]</span></td><td class="description"> The image to display on this sprite-button or sprite in the default state.</td></tr><tr><td class="header"><span class="element-name"><a href="https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.resize_to_sprite">resize_to_sprite</a></span><span class="attribute-type"> :: <span class="param-type"><a href="https://lua-api.factorio.com/latest/Builtin-Types.html#boolean">boolean</a></span></span><span class="attribute-mode"> [RW]</span></td><td class="description"> Whether should the image widget resize its size according to the sprite in it (true by default)
</td></tr><tr><td class="header"><span class="element-name"><a href="https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.hovered_sprite">hovered_sprite</a></span><span class="attribute-type"> :: <span class="param-type"><a href="https://lua-api.factorio.com/latest/Concepts.html#SpritePath">SpritePath</a></span></span><span class="attribute-mode"> [RW]</span></td><td class="description"> The image to display on this sprite-button when it is hovered.</td></tr><tr><td class="header"><span class="element-name"><a href="https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.clicked_sprite">clicked_sprite</a></span><span class="attribute-type"> :: <span class="param-type"><a href="https://lua-api.factorio.com/latest/Concepts.html#SpritePath">SpritePath</a></span></span><span class="attribute-mode"> [RW]</span></td><td class="description"> The image to display on this sprite-button when it is clicked.</td></tr><tr><td class="header"><span class="element-name"><a href="https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.tooltip">tooltip</a></span><span class="attribute-type"> :: <span class="param-type"><a href="https://lua-api.factorio.com/latest/Concepts.html#LocalisedString">LocalisedString</a></span></span><span class="attribute-mode"> [RW]</span></td><td class="description"> </td></tr><tr><td class="header"><span class="element-name"><a href="https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.horizontal_scroll_policy">horizontal_scroll_policy</a></span><span class="attribute-type"> :: <span class="param-type"><a href="https://lua-api.factorio.com/latest/Builtin-Types.html#string">string</a></span></span><span class="attribute-mode"> [RW]</span></td><td class="description"> Policy of the horizontal scroll bar, possible values are "auto" (default), "never", "always", "auto-and-reserve-space".</td></tr><tr><td class="header"><span class="element-name"><a href="https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.vertical_scroll_policy">vertical_scroll_policy</a></span><span class="attribute-type"> :: <span class="param-type"><a href="https://lua-api.factorio.com/latest/Builtin-Types.html#string">string</a></span></span><span class="attribute-mode"> [RW]</span></td><td class="description"> Policy of the vertical scroll bar, possible values are "auto" (default), "never", "always", "auto-and-reserve-space".</td></tr><tr><td class="header"><span class="element-name"><a href="https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.type">type</a></span><span class="attribute-type"> :: <span class="param-type"><a href="https://lua-api.factorio.com/latest/Builtin-Types.html#string">string</a></span></span><span class="attribute-mode"> [R]</span></td><td class="description"> The type of this GUI element.</td></tr><tr><td class="header"><span class="element-name"><a href="https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.children">children</a></span><span class="attribute-type"> :: <span class="param-type">array of <span class="param-type"><a href="https://lua-api.factorio.com/latest/LuaGuiElement.html">LuaGuiElement</a></span></span></span><span class="attribute-mode"> [R]</span></td><td class="description"> The children elements
</td></tr><tr><td class="header"><span class="element-name"><a href="https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.items">items</a></span><span class="attribute-type"> :: <span class="param-type">array of <span class="param-type"><a href="https://lua-api.factorio.com/latest/Concepts.html#LocalisedString">LocalisedString</a></span></span></span><span class="attribute-mode"> [RW]</span></td><td class="description"> The items in this dropdown or listbox.</td></tr><tr><td class="header"><span class="element-name"><a href="https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.selected_index">selected_index</a></span><span class="attribute-type"> :: <span class="param-type"><a href="https://lua-api.factorio.com/latest/Builtin-Types.html#uint">uint</a></span></span><span class="attribute-mode"> [RW]</span></td><td class="description"> The selected index for this dropdown or listbox.</td></tr><tr><td class="header"><span class="element-name"><a href="https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.number">number</a></span><span class="attribute-type"> :: <span class="param-type"><a href="https://lua-api.factorio.com/latest/Builtin-Types.html#double">double</a></span></span><span class="attribute-mode"> [RW]</span></td><td class="description"> The number to be shown in the right-bottom corner of the sprite-button, or <code>nil</code> to show nothing.</td></tr><tr><td class="header"><span class="element-name"><a href="https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.show_percent_for_small_numbers">show_percent_for_small_numbers</a></span><span class="attribute-type"> :: <span class="param-type"><a href="https://lua-api.factorio.com/latest/Builtin-Types.html#boolean">boolean</a></span></span><span class="attribute-mode"> [RW]</span></td><td class="description"> Related to the number to be shown in the right-bottom corner of the sprite-button.</td></tr><tr><td class="header"><span class="element-name"><a href="https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.location">location</a></span><span class="attribute-type"> :: <span class="param-type"><a href="https://lua-api.factorio.com/latest/Concepts.html#GuiLocation">GuiLocation</a></span></span><span class="attribute-mode"> [RW]</span></td><td class="description"> The location of this widget when stored in <a href="https://lua-api.factorio.com/latest/LuaGui.html#LuaGui.screen">LuaGui::screen</a> or <code>nil</code> if not not set or not in <a href="https://lua-api.factorio.com/latest/LuaGui.html#LuaGui.screen">LuaGui::screen</a>.</td></tr><tr><td class="header"><span class="element-name"><a href="https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.auto_center">auto_center</a></span><span class="attribute-type"> :: <span class="param-type"><a href="https://lua-api.factorio.com/latest/Builtin-Types.html#boolean">boolean</a></span></span><span class="attribute-mode"> [RW]</span></td><td class="description"> If this frame auto-centers on window resize when stored in <a href="https://lua-api.factorio.com/latest/LuaGui.html#LuaGui.screen">LuaGui::screen</a>.</td></tr><tr><td class="header"><span class="element-name"><a href="https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.position">position</a></span><span class="attribute-type"> :: <span class="param-type"><a href="https://lua-api.factorio.com/latest/Concepts.html#Position">Position</a></span></span><span class="attribute-mode"> [RW]</span></td><td class="description"> The position this camera or minimap is focused on if any.</td></tr><tr><td class="header"><span class="element-name"><a href="https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.surface_index">surface_index</a></span><span class="attribute-type"> :: <span class="param-type"><a href="https://lua-api.factorio.com/latest/Builtin-Types.html#uint">uint</a></span></span><span class="attribute-mode"> [RW]</span></td><td class="description"> The surface index this camera or minimap is using.</td></tr><tr><td class="header"><span class="element-name"><a href="https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.zoom">zoom</a></span><span class="attribute-type"> :: <span class="param-type"><a href="https://lua-api.factorio.com/latest/Builtin-Types.html#double">double</a></span></span><span class="attribute-mode"> [RW]</span></td><td class="description"> The zoom this camera or minimap is using.</td></tr><tr><td class="header"><span class="element-name"><a href="https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.minimap_player_index">minimap_player_index</a></span><span class="attribute-type"> :: <span class="param-type"><a href="https://lua-api.factorio.com/latest/Builtin-Types.html#uint">uint</a></span></span><span class="attribute-mode"> [RW]</span></td><td class="description"> The player index this minimap is using.</td></tr><tr><td class="header"><span class="element-name"><a href="https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.force">force</a></span><span class="attribute-type"> :: <span class="param-type"><a href="https://lua-api.factorio.com/latest/Builtin-Types.html#string">string</a></span></span><span class="attribute-mode"> [RW]</span></td><td class="description"> The force this minimap is using or <code>nil</code> if no force is set.</td></tr><tr><td class="header"><span class="element-name"><a href="https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.elem_type">elem_type</a></span><span class="attribute-type"> :: <span class="param-type"><a href="https://lua-api.factorio.com/latest/Builtin-Types.html#string">string</a></span></span><span class="attribute-mode"> [R]</span></td><td class="description"> The elem type of this choose-elem-button.</td></tr><tr><td class="header"><span class="element-name"><a href="https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.elem_value">elem_value</a></span><span class="attribute-type"> :: <span class="param-type"><span class="param-type"><a href="https://lua-api.factorio.com/latest/Builtin-Types.html#string">string</a></span> or <span class="param-type"><a href="https://lua-api.factorio.com/latest/Concepts.html#SignalID">SignalID</a></span></span></span><span class="attribute-mode"> [RW]</span></td><td class="description"> The elem value of this choose-elem-button or <code>nil</code> if there is no value.</td></tr><tr><td class="header"><span class="element-name"><a href="https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.selectable">selectable</a></span><span class="attribute-type"> :: <span class="param-type"><a href="https://lua-api.factorio.com/latest/Builtin-Types.html#boolean">boolean</a></span></span><span class="attribute-mode"> [RW]</span></td><td class="description"> If the contents of this text-box are selectable.</td></tr><tr><td class="header"><span class="element-name"><a href="https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.word_wrap">word_wrap</a></span><span class="attribute-type"> :: <span class="param-type"><a href="https://lua-api.factorio.com/latest/Builtin-Types.html#boolean">boolean</a></span></span><span class="attribute-mode"> [RW]</span></td><td class="description"> If this text-box will word-wrap automatically.</td></tr><tr><td class="header"><span class="element-name"><a href="https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.read_only">read_only</a></span><span class="attribute-type"> :: <span class="param-type"><a href="https://lua-api.factorio.com/latest/Builtin-Types.html#boolean">boolean</a></span></span><span class="attribute-mode"> [RW]</span></td><td class="description"> If this text-box is read-only.</td></tr><tr><td class="header"><span class="element-name"><a href="https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.enabled">enabled</a></span><span class="attribute-type"> :: <span class="param-type"><a href="https://lua-api.factorio.com/latest/Builtin-Types.html#boolean">boolean</a></span></span><span class="attribute-mode"> [RW]</span></td><td class="description"> If this GUI element is enabled.</td></tr><tr><td class="header"><span class="element-name"><a href="https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.ignored_by_interaction">ignored_by_interaction</a></span><span class="attribute-type"> :: <span class="param-type"><a href="https://lua-api.factorio.com/latest/Builtin-Types.html#boolean">boolean</a></span></span><span class="attribute-mode"> [RW]</span></td><td class="description"> If this GUI element is ignored by interaction.</td></tr><tr><td class="header"><span class="element-name"><a href="https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.locked">locked</a></span><span class="attribute-type"> :: <span class="param-type"><a href="https://lua-api.factorio.com/latest/Builtin-Types.html#boolean">boolean</a></span></span><span class="attribute-mode"> [RW]</span></td><td class="description"> If this choose-elem-button can be changed by the player.</td></tr><tr><td class="header"><span class="element-name"><a href="https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.draw_vertical_lines">draw_vertical_lines</a></span><span class="attribute-type"> :: <span class="param-type"><a href="https://lua-api.factorio.com/latest/Builtin-Types.html#boolean">boolean</a></span></span><span class="attribute-mode"> [RW]</span></td><td class="description"> If this table should draw vertical grid lines.</td></tr><tr><td class="header"><span class="element-name"><a href="https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.draw_horizontal_lines">draw_horizontal_lines</a></span><span class="attribute-type"> :: <span class="param-type"><a href="https://lua-api.factorio.com/latest/Builtin-Types.html#boolean">boolean</a></span></span><span class="attribute-mode"> [RW]</span></td><td class="description"> If this table should draw horizontal grid lines.</td></tr><tr><td class="header"><span class="element-name"><a href="https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.draw_horizontal_line_after_headers">draw_horizontal_line_after_headers</a></span><span class="attribute-type"> :: <span class="param-type"><a href="https://lua-api.factorio.com/latest/Builtin-Types.html#boolean">boolean</a></span></span><span class="attribute-mode"> [RW]</span></td><td class="description"> If this table should draw a horizontal grid line after the headers.</td></tr><tr><td class="header"><span class="element-name"><a href="https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.column_count">column_count</a></span><span class="attribute-type"> :: <span class="param-type"><a href="https://lua-api.factorio.com/latest/Builtin-Types.html#uint">uint</a></span></span><span class="attribute-mode"> [R]</span></td><td class="description"> The number of columns in this table.</td></tr><tr><td class="header"><span class="element-name"><a href="https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.vertical_centering">vertical_centering</a></span><span class="attribute-type"> :: <span class="param-type"><a href="https://lua-api.factorio.com/latest/Builtin-Types.html#boolean">boolean</a></span></span><span class="attribute-mode"> [RW]</span></td><td class="description"> Whether the fields of this table should be vertically centered.</td></tr><tr><td class="header"><span class="element-name"><a href="https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.slider_value">slider_value</a></span><span class="attribute-type"> :: <span class="param-type"><a href="https://lua-api.factorio.com/latest/Builtin-Types.html#double">double</a></span></span><span class="attribute-mode"> [RW]</span></td><td class="description"> The value of this slider element.</td></tr><tr><td class="header"><span class="element-name"><a href="https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.mouse_button_filter">mouse_button_filter</a></span><span class="attribute-type"> :: <span class="param-type"><a href="https://lua-api.factorio.com/latest/Concepts.html#MouseButtonFlags">MouseButtonFlags</a></span></span><span class="attribute-mode"> [RW]</span></td><td class="description"> The mouse button filters for this button or sprite-button.</td></tr><tr><td class="header"><span class="element-name"><a href="https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.numeric">numeric</a></span><span class="attribute-type"> :: <span class="param-type"><a href="https://lua-api.factorio.com/latest/Builtin-Types.html#boolean">boolean</a></span></span><span class="attribute-mode"> [RW]</span></td><td class="description"> If this text field only accepts numbers.</td></tr><tr><td class="header"><span class="element-name"><a href="https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.allow_decimal">allow_decimal</a></span><span class="attribute-type"> :: <span class="param-type"><a href="https://lua-api.factorio.com/latest/Builtin-Types.html#boolean">boolean</a></span></span><span class="attribute-mode"> [RW]</span></td><td class="description"> If this text field (when in numeric mode) allows decimal numbers.</td></tr><tr><td class="header"><span class="element-name"><a href="https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.allow_negative">allow_negative</a></span><span class="attribute-type"> :: <span class="param-type"><a href="https://lua-api.factorio.com/latest/Builtin-Types.html#boolean">boolean</a></span></span><span class="attribute-mode"> [RW]</span></td><td class="description"> If this text field (when in numeric mode) allows negative numbers.</td></tr><tr><td class="header"><span class="element-name"><a href="https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.is_password">is_password</a></span><span class="attribute-type"> :: <span class="param-type"><a href="https://lua-api.factorio.com/latest/Builtin-Types.html#boolean">boolean</a></span></span><span class="attribute-mode"> [RW]</span></td><td class="description"> If this text field displays as a password field (renders all characters as '*').</td></tr><tr><td class="header"><span class="element-name"><a href="https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.lose_focus_on_confirm">lose_focus_on_confirm</a></span><span class="attribute-type"> :: <span class="param-type"><a href="https://lua-api.factorio.com/latest/Builtin-Types.html#boolean">boolean</a></span></span><span class="attribute-mode"> [RW]</span></td><td class="description"> If this text field loses focus after <a href="https://lua-api.factorio.com/latest/defines.html#defines.events.on_gui_confirmed">defines.events.on_gui_confirmed</a> is fired.</td></tr><tr><td class="header"><span class="element-name"><a href="https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.clear_and_focus_on_right_click">clear_and_focus_on_right_click</a></span><span class="attribute-type"> :: <span class="param-type"><a href="https://lua-api.factorio.com/latest/Builtin-Types.html#boolean">boolean</a></span></span><span class="attribute-mode"> [RW]</span></td><td class="description"> </td></tr><tr><td class="header"><span class="element-name"><a href="https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.drag_target">drag_target</a></span><span class="attribute-type"> :: <span class="param-type"><a href="https://lua-api.factorio.com/latest/LuaGuiElement.html">LuaGuiElement</a></span></span><span class="attribute-mode"> [RW]</span></td><td class="description"> The frame drag target for this flow, frame, label, table, or empty-widget.</td></tr><tr><td class="header"><span class="element-name"><a href="https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.selected_tab_index">selected_tab_index</a></span><span class="attribute-type"> :: <span class="param-type"><a href="https://lua-api.factorio.com/latest/Builtin-Types.html#uint">uint</a></span></span><span class="attribute-mode"> [RW]</span></td><td class="description"> The selected tab index or <code>nil</code> if no tab is selected.</td></tr><tr><td class="header"><span class="element-name"><a href="https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.tabs">tabs</a></span><span class="attribute-type"> :: <span class="param-type">array of <span class="param-type">TabAndContent</span></span></span><span class="attribute-mode"> [R]</span></td><td class="description"> The tabs and contents being shown in this tabbed-pane.</td></tr><tr><td class="header"><span class="element-name"><a href="https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.entity">entity</a></span><span class="attribute-type"> :: <span class="param-type"><a href="https://lua-api.factorio.com/latest/LuaEntity.html">LuaEntity</a></span></span><span class="attribute-mode"> [RW]</span></td><td class="description"> The entity associated with this entity-preview or <code>nil</code> if no entity is associated.</td></tr><tr><td class="header"><span class="element-name"><a href="https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.switch_state">switch_state</a></span><span class="attribute-type"> :: <span class="param-type"><a href="https://lua-api.factorio.com/latest/Builtin-Types.html#string">string</a></span></span><span class="attribute-mode"> [RW]</span></td><td class="description"> The switch state (left, none, right) for this switch.</td></tr><tr><td class="header"><span class="element-name"><a href="https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.allow_none_state">allow_none_state</a></span><span class="attribute-type"> :: <span class="param-type"><a href="https://lua-api.factorio.com/latest/Builtin-Types.html#boolean">boolean</a></span></span><span class="attribute-mode"> [RW]</span></td><td class="description"> If the 'none' state is allowed for this switch.</td></tr><tr><td class="header"><span class="element-name"><a href="https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.left_label_caption">left_label_caption</a></span><span class="attribute-type"> :: <span class="param-type"><a href="https://lua-api.factorio.com/latest/Concepts.html#LocalisedString">LocalisedString</a></span></span><span class="attribute-mode"> [RW]</span></td><td class="description"> The text shown for the left switch label.</td></tr><tr><td class="header"><span class="element-name"><a href="https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.left_label_tooltip">left_label_tooltip</a></span><span class="attribute-type"> :: <span class="param-type"><a href="https://lua-api.factorio.com/latest/Concepts.html#LocalisedString">LocalisedString</a></span></span><span class="attribute-mode"> [RW]</span></td><td class="description"> The text shown for the left switch tooltip.</td></tr><tr><td class="header"><span class="element-name"><a href="https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.right_label_caption">right_label_caption</a></span><span class="attribute-type"> :: <span class="param-type"><a href="https://lua-api.factorio.com/latest/Concepts.html#LocalisedString">LocalisedString</a></span></span><span class="attribute-mode"> [RW]</span></td><td class="description"> The text shown for the right switch label.</td></tr><tr><td class="header"><span class="element-name"><a href="https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.right_label_tooltip">right_label_tooltip</a></span><span class="attribute-type"> :: <span class="param-type"><a href="https://lua-api.factorio.com/latest/Concepts.html#LocalisedString">LocalisedString</a></span></span><span class="attribute-mode"> [RW]</span></td><td class="description"> The text shown for the right switch tooltip.</td></tr><tr><td class="header"><span class="element-name"><a href="https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.operator%20[]">operator []</a></span><span class="attribute-type"> :: <span class="param-type"><a href="https://lua-api.factorio.com/latest/LuaGuiElement.html">LuaGuiElement</a></span></span><span class="attribute-mode"> [R]</span></td><td class="description"> The indexing operator.</td></tr><tr><td class="header"><span class="element-name"><a href="https://lua-api.factorio.com/latest/Common.html#Common.valid">valid</a></span><span class="attribute-type"> :: <span class="param-type"><a href="https://lua-api.factorio.com/latest/Builtin-Types.html#boolean">boolean</a></span></span><span class="attribute-mode"> [R]</span></td><td class="description">
Is this object valid?</td></tr><tr><td class="header"><span class="element-name"><a href="https://lua-api.factorio.com/latest/Common.html#Common.help">help</a>() → <span class="return-type"><span class="param-type"><a href="https://lua-api.factorio.com/latest/Builtin-Types.html#string">string</a></span></span></span></td><td class="description">
All methods, and properties that this object supports.</td></tr></tbody></table></div></div><div class="element" id="LuaGuiElement"><div class="element" id="LuaGuiElement.add"><div class="element-header"><span class="element-name">add{type=…, name=…, caption=…, tooltip=…, enabled=…, ignored_by_interaction=…, style=…} → <span class="return-type"><span class="param-type"><a href="https://lua-api.factorio.com/latest/LuaGuiElement.html">LuaGuiElement</a></span></span></span></div><div class="element-content"><p> Add a child element.</p><p> </p><p> </p><div class="detail"><div class="detail-header">Parameters</div><div class="detail-content"><div> Table with the following fields: <ul class="field-list"><li><span class="param-name">type</span> :: <span class="param-type"><a href="https://lua-api.factorio.com/latest/Builtin-Types.html#string">string</a></span>: The kind of the element to add. Has to be one of the above listed gui element types.</li><li><span class="param-name">name</span> :: <span class="param-type"><a href="https://lua-api.factorio.com/latest/Builtin-Types.html#string">string</a></span>: Name of the child element.</li><li><span class="param-name">caption</span> :: <span class="param-type"><a href="https://lua-api.factorio.com/latest/Concepts.html#LocalisedString">LocalisedString</a></span> <span class="opt"> (optional)</span>: 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.</li><li><span class="param-name">tooltip</span> :: <span class="param-type"><a href="https://lua-api.factorio.com/latest/Concepts.html#LocalisedString">LocalisedString</a></span> <span class="opt"> (optional)</span>: Tooltip of the child element.</li><li><span class="param-name">enabled</span> :: <span class="param-type"><a href="https://lua-api.factorio.com/latest/Builtin-Types.html#boolean">boolean</a></span> <span class="opt"> (optional)</span>: Whether the child element is enabled.</li><li><span class="param-name">ignored_by_interaction</span> :: <span class="param-type"><a href="https://lua-api.factorio.com/latest/Builtin-Types.html#boolean">boolean</a></span> <span class="opt"> (optional)</span>: Whether the child element is ignored by interaction.</li><li><span class="param-name">style</span> :: <span class="param-type"><a href="https://lua-api.factorio.com/latest/Builtin-Types.html#string">string</a></span> <span class="opt"> (optional)</span>: Style of the new element.</li><li> Other attributes may have to be specified, depending on <code>type</code><ul><li>button<ul class="field-list"><li><span class="param-name">mouse_button_filter</span> :: <span class="param-type"><a href="https://lua-api.factorio.com/latest/Concepts.html#MouseButtonFlags">MouseButtonFlags</a></span> <span class="opt"> (optional)</span>: Which mouse buttons the button responds to.</li></ul></li><li>flow<ul class="field-list"><li><span class="param-name">direction</span> :: <span class="param-type"><a href="https://lua-api.factorio.com/latest/Builtin-Types.html#string">string</a></span>: The initial direction of the flow's layout. See <a href="https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.direction">LuaGuiElement::direction</a>.</li></ul></li><li>frame<ul class="field-list"><li><span class="param-name">direction</span> :: <span class="param-type"><a href="https://lua-api.factorio.com/latest/Builtin-Types.html#string">string</a></span>: The initial direction of the frame's layout. See <a href="https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.direction">LuaGuiElement::direction</a>.</li></ul></li><li>table<ul class="field-list"><li><span class="param-name">column_count</span> :: <span class="param-type"><a href="https://lua-api.factorio.com/latest/Builtin-Types.html#uint">uint</a></span>: Number of columns.</li><li><span class="param-name">draw_vertical_lines</span> :: <span class="param-type"><a href="https://lua-api.factorio.com/latest/Builtin-Types.html#boolean">boolean</a></span> <span class="opt"> (optional)</span>: If the table should draw vertical grid lines. Defaults to <code>false</code> if not given.</li><li><span class="param-name">draw_horizontal_lines</span> :: <span class="param-type"><a href="https://lua-api.factorio.com/latest/Builtin-Types.html#boolean">boolean</a></span> <span class="opt"> (optional)</span>: If the table should draw horizontal grid lines. Defaults to <code>false</code> if not given.</li><li><span class="param-name">draw_horizontal_line_after_headers</span> :: <span class="param-type"><a href="https://lua-api.factorio.com/latest/Builtin-Types.html#boolean">boolean</a></span> <span class="opt"> (optional)</span>: If the table should draw a horizontal grid line after the headers. Defaults to <code>false</code> if not given.</li><li><span class="param-name">vertical_centering</span> :: <span class="param-type"><a href="https://lua-api.factorio.com/latest/Builtin-Types.html#boolean">boolean</a></span> <span class="opt"> (optional)</span>: Whether the fields of this table should be vertically centered. Defaults to <code>true</code> if not given.</li></ul></li><li>textfield<ul class="field-list"><li><span class="param-name">text</span> :: <span class="param-type"><a href="https://lua-api.factorio.com/latest/Builtin-Types.html#string">string</a></span> <span class="opt"> (optional)</span>: The initial text contained in the textfield.</li><li><span class="param-name">numeric</span> :: <span class="param-type"><a href="https://lua-api.factorio.com/latest/Builtin-Types.html#boolean">boolean</a></span> <span class="opt"> (optional)</span></li><li><span class="param-name">allow_decimal</span> :: <span class="param-type"><a href="https://lua-api.factorio.com/latest/Builtin-Types.html#boolean">boolean</a></span> <span class="opt"> (optional)</span></li><li><span class="param-name">allow_negative</span> :: <span class="param-type"><a href="https://lua-api.factorio.com/latest/Builtin-Types.html#boolean">boolean</a></span> <span class="opt"> (optional)</span></li><li><span class="param-name">is_password</span> :: <span class="param-type"><a href="https://lua-api.factorio.com/latest/Builtin-Types.html#boolean">boolean</a></span> <span class="opt"> (optional)</span></li><li><span class="param-name">lose_focus_on_confirm</span> :: <span class="param-type"><a href="https://lua-api.factorio.com/latest/Builtin-Types.html#boolean">boolean</a></span> <span class="opt"> (optional)</span></li><li><span class="param-name">clear_and_focus_on_right_click</span> :: <span class="param-type"><a href="https://lua-api.factorio.com/latest/Builtin-Types.html#boolean">boolean</a></span> <span class="opt"> (optional)</span></li></ul></li><li>progressbar<ul class="field-list"><li><span class="param-name">value</span> :: <span class="param-type"><a href="https://lua-api.factorio.com/latest/Builtin-Types.html#double">double</a></span> <span class="opt"> (optional)</span>: Initial value of the progressbar, in range [0, 1]. Defaults to 0 if not given.</li></ul></li><li>checkbox<ul class="field-list"><li><span class="param-name">state</span> :: <span class="param-type"><a href="https://lua-api.factorio.com/latest/Builtin-Types.html#boolean">boolean</a></span>: Whether the checkbox should be checked by default.</li></ul></li><li>radiobutton<ul class="field-list"><li><span class="param-name">state</span> :: <span class="param-type"><a href="https://lua-api.factorio.com/latest/Builtin-Types.html#boolean">boolean</a></span>: Whether the radiobutton should be checked by default.</li></ul></li><li>sprite-button<ul class="field-list"><li><span class="param-name">sprite</span> :: <span class="param-type"><a href="https://lua-api.factorio.com/latest/Concepts.html#SpritePath">SpritePath</a></span> <span class="opt"> (optional)</span>: Path to the image to display on the button.</li><li><span class="param-name">hovered_sprite</span> :: <span class="param-type"><a href="https://lua-api.factorio.com/latest/Concepts.html#SpritePath">SpritePath</a></span> <span class="opt"> (optional)</span>: Path to the image to display on the button when it is hovered.</li><li><span class="param-name">clicked_sprite</span> :: <span class="param-type"><a href="https://lua-api.factorio.com/latest/Concepts.html#SpritePath">SpritePath</a></span> <span class="opt"> (optional)</span>: Path to the image to display on the button when it is clicked.</li><li><span class="param-name">number</span> :: <span class="param-type"><a href="https://lua-api.factorio.com/latest/Builtin-Types.html#double">double</a></span> <span class="opt"> (optional)</span>: The number shown on the button.</li><li><span class="param-name">show_percent_for_small_numbers</span> :: <span class="param-type"><a href="https://lua-api.factorio.com/latest/Builtin-Types.html#boolean">boolean</a></span> <span class="opt"> (optional)</span>: Format small numbers as percentages. Defaults to <code>false</code> if not given.</li><li><span class="param-name">mouse_button_filter</span> :: <span class="param-type"><a href="https://lua-api.factorio.com/latest/Concepts.html#MouseButtonFlags">MouseButtonFlags</a></span> <span class="opt"> (optional)</span>: Which mouse buttons the button responds to.</li></ul></li><li>sprite<ul class="field-list"><li><span class="param-name">sprite</span> :: <span class="param-type"><a href="https://lua-api.factorio.com/latest/Concepts.html#SpritePath">SpritePath</a></span> <span class="opt"> (optional)</span>: Path to the image to display.</li></ul></li><li>scroll-pane<ul class="field-list"><li><span class="param-name">horizontal_scroll_policy</span> :: <span class="param-type"><a href="https://lua-api.factorio.com/latest/Builtin-Types.html#string">string</a></span> <span class="opt"> (optional)</span>: Policy of the horizontal scroll bar, possible values are "auto" (default), "never", "always", "auto-and-reserve-space".</li><li><span class="param-name">vertical_scroll_policy</span> :: <span class="param-type"><a href="https://lua-api.factorio.com/latest/Builtin-Types.html#string">string</a></span> <span class="opt"> (optional)</span>: Policy of the vertical scroll bar, possible values are "auto" (default), "never", "always", "auto-and-reserve-space".</li></ul></li><li>drop-down<ul class="field-list"><li><span class="param-name">items</span> :: <span class="param-type">array of <span class="param-type"><a href="https://lua-api.factorio.com/latest/Concepts.html#LocalisedString">LocalisedString</a></span></span> <span class="opt"> (optional)</span>: The initial items in the dropdown.</li><li><span class="param-name">selected_index</span> :: <span class="param-type"><a href="https://lua-api.factorio.com/latest/Builtin-Types.html#uint">uint</a></span> <span class="opt"> (optional)</span>: The initial selected index.</li></ul></li><li>line<ul class="field-list"><li><span class="param-name">direction</span> :: <span class="param-type"><a href="https://lua-api.factorio.com/latest/Builtin-Types.html#string">string</a></span>: The initial direction of the line.</li></ul></li><li>list-box<ul class="field-list"><li><span class="param-name">items</span> :: <span class="param-type">array of <span class="param-type"><a href="https://lua-api.factorio.com/latest/Concepts.html#LocalisedString">LocalisedString</a></span></span> <span class="opt"> (optional)</span>: The initial items in the listbox.</li><li><span class="param-name">selected_index</span> :: <span class="param-type"><a href="https://lua-api.factorio.com/latest/Builtin-Types.html#uint">uint</a></span> <span class="opt"> (optional)</span>: The initial selected index.</li></ul></li><li>camera<ul class="field-list"><li><span class="param-name">position</span> :: <span class="param-type"><a href="https://lua-api.factorio.com/latest/Concepts.html#Position">Position</a></span>: The position the camera centers on.</li><li><span class="param-name">surface_index</span> :: <span class="param-type"><a href="https://lua-api.factorio.com/latest/Builtin-Types.html#uint">uint</a></span> <span class="opt"> (optional)</span>: The surface the camera will render else if not given the players surface is used.</li><li><span class="param-name">zoom</span> :: <span class="param-type"><a href="https://lua-api.factorio.com/latest/Builtin-Types.html#double">double</a></span> <span class="opt"> (optional)</span>: The camera zoom - defaults to 0.75.</li></ul></li><li>choose-elem-button<ul class="field-list"><li><span class="param-name">elem_type</span> :: <span class="param-type"><a href="https://lua-api.factorio.com/latest/Builtin-Types.html#string">string</a></span>: The type of the button - one of the following values.</li><li><span class="param-name">item</span> :: <span class="param-type"><a href="https://lua-api.factorio.com/latest/Builtin-Types.html#string">string</a></span> <span class="opt"> (optional)</span>: If type is "item" - the default value for the button.</li><li><span class="param-name">tile</span> :: <span class="param-type"><a href="https://lua-api.factorio.com/latest/Builtin-Types.html#string">string</a></span> <span class="opt"> (optional)</span>: If type is "tile" - the default value for the button.</li><li><span class="param-name">entity</span> :: <span class="param-type"><a href="https://lua-api.factorio.com/latest/Builtin-Types.html#string">string</a></span> <span class="opt"> (optional)</span>: If type is "entity" - the default value for the button.</li><li><span class="param-name">signal</span> :: <span class="param-type"><a href="https://lua-api.factorio.com/latest/Concepts.html#SignalID">SignalID</a></span> <span class="opt"> (optional)</span>: If type is "signal" - the default value for the button.</li><li><span class="param-name">fluid</span> :: <span class="param-type"><a href="https://lua-api.factorio.com/latest/Builtin-Types.html#string">string</a></span> <span class="opt"> (optional)</span>: If type is "fluid" - the default value for the button.</li><li><span class="param-name">recipe</span> :: <span class="param-type"><a href="https://lua-api.factorio.com/latest/Builtin-Types.html#string">string</a></span> <span class="opt"> (optional)</span>: If type is "recipe" - the default value for the button.</li><li><span class="param-name">decorative</span> :: <span class="param-type"><a href="https://lua-api.factorio.com/latest/Builtin-Types.html#string">string</a></span> <span class="opt"> (optional)</span>: If type is "decorative" - the default value for the button.</li><li><span class="param-name">item-group</span> :: <span class="param-type"><a href="https://lua-api.factorio.com/latest/Builtin-Types.html#string">string</a></span> <span class="opt"> (optional)</span>: If type is "item-group" - the default value for the button.</li><li><span class="param-name">achievement</span> :: <span class="param-type"><a href="https://lua-api.factorio.com/latest/Builtin-Types.html#string">string</a></span> <span class="opt"> (optional)</span>: If type is "achievement" - the default value for the button.</li><li><span class="param-name">equipment</span> :: <span class="param-type"><a href="https://lua-api.factorio.com/latest/Builtin-Types.html#string">string</a></span> <span class="opt"> (optional)</span>: If type is "equipment" - the default value for the button.</li><li><span class="param-name">technology</span> :: <span class="param-type"><a href="https://lua-api.factorio.com/latest/Builtin-Types.html#string">string</a></span> <span class="opt"> (optional)</span>: If type is "technology" - the default value for the button.</li></ul></li><li>text-box<ul class="field-list"><li><span class="param-name">text</span> :: <span class="param-type"><a href="https://lua-api.factorio.com/latest/Builtin-Types.html#string">string</a></span> <span class="opt"> (optional)</span>: The initial text contained in the text-box.</li><li><span class="param-name">clear_and_focus_on_right_click</span> :: <span class="param-type"><a href="https://lua-api.factorio.com/latest/Builtin-Types.html#boolean">boolean</a></span> <span class="opt"> (optional)</span></li></ul></li><li>slider<ul class="field-list"><li><span class="param-name">minimum_value</span> :: <span class="param-type"><a href="https://lua-api.factorio.com/latest/Builtin-Types.html#double">double</a></span> <span class="opt"> (optional)</span>: The minimum value for the slider</li><li><span class="param-name">maximum_value</span> :: <span class="param-type"><a href="https://lua-api.factorio.com/latest/Builtin-Types.html#double">double</a></span> <span class="opt"> (optional)</span>: The maximum value for the slider</li><li><span class="param-name">value</span> :: <span class="param-type"><a href="https://lua-api.factorio.com/latest/Builtin-Types.html#double">double</a></span> <span class="opt"> (optional)</span>: The initial value for the slider</li><li><span class="param-name">value_step</span> :: <span class="param-type"><a href="https://lua-api.factorio.com/latest/Builtin-Types.html#double">double</a></span> <span class="opt"> (optional)</span>: The minimum value the slider can move</li><li><span class="param-name">discrete_slider</span> :: <span class="param-type"><a href="https://lua-api.factorio.com/latest/Builtin-Types.html#boolean">boolean</a></span> <span class="opt"> (optional)</span></li><li><span class="param-name">discrete_values</span> :: <span class="param-type"><a href="https://lua-api.factorio.com/latest/Builtin-Types.html#boolean">boolean</a></span> <span class="opt"> (optional)</span></li></ul></li><li>minimap<ul class="field-list"><li><span class="param-name">position</span> :: <span class="param-type"><a href="https://lua-api.factorio.com/latest/Concepts.html#Position">Position</a></span> <span class="opt"> (optional)</span>: The position the minimap centers on or if not given it will center on the player that owns this element.</li><li><span class="param-name">surface_index</span> :: <span class="param-type"><a href="https://lua-api.factorio.com/latest/Builtin-Types.html#uint">uint</a></span> <span class="opt"> (optional)</span>: The surface the camera will render else if not given the players surface is used.</li><li><span class="param-name">chart_player_index</span> :: <span class="param-type"><a href="https://lua-api.factorio.com/latest/Builtin-Types.html#uint">uint</a></span> <span class="opt"> (optional)</span>: The player index the map should use else if not set the player that owns this element is used.</li><li><span class="param-name">force</span> :: <span class="param-type"><a href="https://lua-api.factorio.com/latest/Builtin-Types.html#string">string</a></span> <span class="opt"> (optional)</span>: The force this minimap should use else if not given the players force that owns this element is used.</li><li><span class="param-name">zoom</span> :: <span class="param-type"><a href="https://lua-api.factorio.com/latest/Builtin-Types.html#double">double</a></span> <span class="opt"> (optional)</span>: The camera zoom - defaults to 0.75.</li></ul></li><li>tab<ul class="field-list"><li><span class="param-name">badge_text</span> :: <span class="param-type"><a href="https://lua-api.factorio.com/latest/Concepts.html#LocalisedString">LocalisedString</a></span> <span class="opt"> (optional)</span>: The text to display after the normal tab text (designed to work with numbers)</li></ul></li><li>switch<ul class="field-list"><li><span class="param-name">switch_state</span> :: <span class="param-type"><a href="https://lua-api.factorio.com/latest/Builtin-Types.html#string">string</a></span> <span class="opt"> (optional)</span>: 'left', 'right', or 'none'. If 'none' allow_none_state must be true.</li><li><span class="param-name">allow_none_state</span> :: <span class="param-type"><a href="https://lua-api.factorio.com/latest/Builtin-Types.html#boolean">boolean</a></span> <span class="opt"> (optional)</span></li><li><span class="param-name">left_label_caption</span> :: <span class="param-type"><a href="https://lua-api.factorio.com/latest/Concepts.html#LocalisedString">LocalisedString</a></span> <span class="opt"> (optional)</span></li><li><span class="param-name">left_label_tooltip</span> :: <span class="param-type"><a href="https://lua-api.factorio.com/latest/Concepts.html#LocalisedString">LocalisedString</a></span> <span class="opt"> (optional)</span></li><li><span class="param-name">right_label_caption</span> :: <span class="param-type"><a href="https://lua-api.factorio.com/latest/Concepts.html#LocalisedString">LocalisedString</a></span> <span class="opt"> (optional)</span></li><li><span class="param-name">right_label_tooltip</span> :: <span class="param-type"><a href="https://lua-api.factorio.com/latest/Concepts.html#LocalisedString">LocalisedString</a></span> <span class="opt"> (optional)</span></li></ul></li></ul></li></ul></div></div></div><div class="detail"><div class="detail-header">Return value</div><div class="detail-content"> The added GUI element.</div></div></div></div>
<div class="element" id="LuaGuiElement.clear"><div class="element-header"><span class="element-name">clear()</span></div><div class="element-content"><p> Remove children of this element. Any <a href="https://lua-api.factorio.com/latest/LuaGuiElement.html">LuaGuiElement</a> objects referring to the destroyed
elements become invalid after this operation.</p><p> </p><div class="example"><div class="example-header">Example</div>
<div class="block-code-container"><code class="block">game.player.gui.top.clear()</code></div>
</div></div></div>
<div class="element" id="LuaGuiElement.destroy"><div class="element-header"><span class="element-name">destroy()</span></div><div class="element-content"><p> Remove this element, along with its children. Any <a href="https://lua-api.factorio.com/latest/LuaGuiElement.html">LuaGuiElement</a> objects referring to the destroyed
elements become invalid after this operation.</p><p> </p><p> </p><div class="notes"><div class="note"><strong>Note: </strong> The top-level GUI elements -- <a href="https://lua-api.factorio.com/latest/LuaGui.html#LuaGui.top">LuaGui::top</a>, <a href="https://lua-api.factorio.com/latest/LuaGui.html#LuaGui.left">LuaGui::left</a>, <a href="https://lua-api.factorio.com/latest/LuaGui.html#LuaGui.center">LuaGui::center</a> -- can't
be destroyed.</div></div><div class="example"><div class="example-header">Example</div>
<div class="block-code-container"><code class="block">game.player.gui.top.greeting.destroy()</code></div>
</div></div></div>
<div class="element" id="LuaGuiElement.get_mod"><div class="element-header"><span class="element-name">get_mod() → <span class="return-type"><span class="param-type"><a href="https://lua-api.factorio.com/latest/Builtin-Types.html#string">string</a></span></span></span></div><div class="element-content"><p> The mod that owns this Gui element or <code>nil</code> if it's owned by the scenario script.
</p><p> </p><div class="notes"><div class="note"><strong>Note: </strong> This has a not-super-expensive but not free cost to get.</div></div></div></div>
<div class="element" id="LuaGuiElement.clear_items"><div class="element-header"><span class="element-name">clear_items()</span></div><div class="element-content"><p> Clears the items in this dropdown or listbox.
</p></div></div>
<div class="element" id="LuaGuiElement.get_item"><div class="element-header"><span class="element-name">get_item(index) → <span class="return-type"><span class="param-type"><a href="https://lua-api.factorio.com/latest/Concepts.html#LocalisedString">LocalisedString</a></span></span></span></div><div class="element-content"><p> Gets an item at the given index from this dropdown or listbox.
</p><p> </p><div class="detail"><div class="detail-header">Parameters</div><div class="detail-content"><div><span class="param-name">index</span> :: <span class="param-type"><a href="https://lua-api.factorio.com/latest/Builtin-Types.html#uint">uint</a></span>: The index to get.</div></div></div></div></div>
<div class="element" id="LuaGuiElement.set_item"><div class="element-header"><span class="element-name">set_item(index, LocalisedString)</span></div><div class="element-content"><p> Sets an item at the given index in this dropdown or listbox.
</p><p> </p><div class="detail"><div class="detail-header">Parameters</div><div class="detail-content"><div><span class="param-name">index</span> :: <span class="param-type"><a href="https://lua-api.factorio.com/latest/Builtin-Types.html#uint">uint</a></span>: The index</div><div><span class="param-name">LocalisedString</span>: The item.</div></div></div></div></div>
<div class="element" id="LuaGuiElement.add_item"><div class="element-header"><span class="element-name">add_item(LocalisedString, index)</span></div><div class="element-content"><p> Adds an item at the end or at the given index in this dropdown or listbox.
</p><p> </p><div class="detail"><div class="detail-header">Parameters</div><div class="detail-content"><div><span class="param-name">LocalisedString</span>: The item.</div><div><span class="param-name">index</span> :: <span class="param-type"><a href="https://lua-api.factorio.com/latest/Builtin-Types.html#uint">uint</a></span> <span class="opt"> (optional)</span>: The index</div></div></div></div></div>
<div class="element" id="LuaGuiElement.remove_item"><div class="element-header"><span class="element-name">remove_item(index)</span></div><div class="element-content"><p> Removes an item at the given index in this dropdown or listbox.
</p><div class="detail"><div class="detail-header">Parameters</div><div class="detail-content"><div><span class="param-name">index</span> :: <span class="param-type"><a href="https://lua-api.factorio.com/latest/Builtin-Types.html#uint">uint</a></span>: The index</div></div></div></div></div>
<div class="element" id="LuaGuiElement.get_slider_minimum"><div class="element-header"><span class="element-name">get_slider_minimum() → <span class="return-type"><span class="param-type"><a href="https://lua-api.factorio.com/latest/Builtin-Types.html#double">double</a></span></span></span></div><div class="element-content"><p> Gets this sliders minimum value.
</p></div></div>
<div class="element" id="LuaGuiElement.get_slider_maximum"><div class="element-header"><span class="element-name">get_slider_maximum() → <span class="return-type"><span class="param-type"><a href="https://lua-api.factorio.com/latest/Builtin-Types.html#double">double</a></span></span></span></div><div class="element-content"><p> Gets this sliders minimum value.
</p></div></div>
<div class="element" id="LuaGuiElement.set_slider_minimum_maximum"><div class="element-header"><span class="element-name">set_slider_minimum_maximum(minimum, maximum)</span></div><div class="element-content"><p> Sets this sliders minimum and maximum values.
</p><p> </p><p> </p><div class="detail"><div class="detail-header">Parameters</div><div class="detail-content"><div><span class="param-name">minimum</span> :: <span class="param-type"><a href="https://lua-api.factorio.com/latest/Builtin-Types.html#double">double</a></span></div><div><span class="param-name">maximum</span> :: <span class="param-type"><a href="https://lua-api.factorio.com/latest/Builtin-Types.html#double">double</a></span></div></div></div><div class="notes"><div class="note"><strong>Note: </strong> The minimum can't be >= the maximum.</div></div></div></div>
<div class="element" id="LuaGuiElement.get_slider_value_step"><div class="element-header"><span class="element-name">get_slider_value_step() → <span class="return-type"><span class="param-type"><a href="https://lua-api.factorio.com/latest/Builtin-Types.html#double">double</a></span></span></span></div><div class="element-content"><p> Gets the minimum distance the slider can move.
</p></div></div>
<div class="element" id="LuaGuiElement.get_slider_discrete_slider"><div class="element-header"><span class="element-name">get_slider_discrete_slider() → <span class="return-type"><span class="param-type"><a href="https://lua-api.factorio.com/latest/Builtin-Types.html#boolean">boolean</a></span></span></span></div><div class="element-content"><p> Gets if the slider only allows being moved to discrete positions.
</p></div></div>
<div class="element" id="LuaGuiElement.get_slider_discrete_values"><div class="element-header"><span class="element-name">get_slider_discrete_values() → <span class="return-type"><span class="param-type"><a href="https://lua-api.factorio.com/latest/Builtin-Types.html#boolean">boolean</a></span></span></span></div><div class="element-content"><p> Gets if the slider only allows being having discrete values.
</p></div></div>
<div class="element" id="LuaGuiElement.set_slider_value_step"><div class="element-header"><span class="element-name">set_slider_value_step(value)</span></div><div class="element-content"><p> The minimum distance the slider can move.
</p><p> </p><div class="detail"><div class="detail-header">Parameters</div><div class="detail-content"><div><span class="param-name">value</span> :: <span class="param-type"><a href="https://lua-api.factorio.com/latest/Builtin-Types.html#double">double</a></span></div></div></div><div class="notes"><div class="note"><strong>Note: </strong> can't be > (max - min)</div></div></div></div>
<div class="element" id="LuaGuiElement.set_slider_discrete_slider"><div class="element-header"><span class="element-name">set_slider_discrete_slider(value)</span></div><div class="element-content"><p> Sets if the slider only allows being moved to discrete positions.
</p><div class="detail"><div class="detail-header">Parameters</div><div class="detail-content"><div><span class="param-name">value</span> :: <span class="param-type"><a href="https://lua-api.factorio.com/latest/Builtin-Types.html#boolean">boolean</a></span></div></div></div></div></div>
<div class="element" id="LuaGuiElement.set_slider_discrete_values"><div class="element-header"><span class="element-name">set_slider_discrete_values(value)</span></div><div class="element-content"><p> Sets if the slider only allows being having discrete values.
</p><div class="detail"><div class="detail-header">Parameters</div><div class="detail-content"><div><span class="param-name">value</span> :: <span class="param-type"><a href="https://lua-api.factorio.com/latest/Builtin-Types.html#boolean">boolean</a></span></div></div></div></div></div>
<div class="element" id="LuaGuiElement.focus"><div class="element-header"><span class="element-name">focus()</span></div><div class="element-content"><p> Focuses this GUI element if possible.
</p></div></div>
<div class="element" id="LuaGuiElement.scroll_to_top"><div class="element-header"><span class="element-name">scroll_to_top()</span></div><div class="element-content"><p> Scrolls the scroll bar to the top.
</p><div class="detail"><em>Can only be used if this is scroll-pane or text-box</em></div></div></div>
<div class="element" id="LuaGuiElement.scroll_to_bottom"><div class="element-header"><span class="element-name">scroll_to_bottom()</span></div><div class="element-content"><p> Scrolls the scroll bar to the bottom.
</p><div class="detail"><em>Can only be used if this is scroll-pane or text-box</em></div></div></div>
<div class="element" id="LuaGuiElement.scroll_to_left"><div class="element-header"><span class="element-name">scroll_to_left()</span></div><div class="element-content"><p> Scrolls the scroll bar to the left.
</p><div class="detail"><em>Can only be used if this is scroll-pane or text-box</em></div></div></div>
<div class="element" id="LuaGuiElement.scroll_to_right"><div class="element-header"><span class="element-name">scroll_to_right()</span></div><div class="element-content"><p> Scrolls the scroll bar to the right.
</p><div class="detail"><em>Can only be used if this is scroll-pane or text-box</em></div></div></div>
<div class="element" id="LuaGuiElement.scroll_to_element"><div class="element-header"><span class="element-name">scroll_to_element(element, scroll_mode)</span></div><div class="element-content"><p> Scrolls the scroll bar such that the specified GUI element is visible to the player.
</p><p> </p><p> </p><div class="detail"><div class="detail-header">Parameters</div><div class="detail-content"><div><span class="param-name">element</span> :: <span class="param-type"><a href="https://lua-api.factorio.com/latest/LuaGuiElement.html">LuaGuiElement</a></span>: The element to scroll to.</div><div><span class="param-name">scroll_mode</span> :: <span class="param-type"><a href="https://lua-api.factorio.com/latest/Builtin-Types.html#string">string</a></span> <span class="opt"> (optional)</span>: Where the element should be positioned in the scroll-pane. Must be either: <code>"in-view"</code>, or <code>"top-third"</code>. Defaults to <code>"in-view"</code>.</div></div></div><div class="detail"><em>Can only be used if this is scroll-pane</em></div></div></div>
<div class="element" id="LuaGuiElement.select_all"><div class="element-header"><span class="element-name">select_all()</span></div><div class="element-content"><p> Select all text in the text box.
</p><div class="detail"><em>Can only be used if this is textfield or text-box</em></div></div></div>
<div class="element" id="LuaGuiElement.select"><div class="element-header"><span class="element-name">select(start, end)</span></div><div class="element-content"><p> Select a range of text in the text box.
</p><p> </p><p> </p><p> </p><p>
</p><div class="detail"><div class="detail-header">Parameters</div><div class="detail-content"><div><span class="param-name">start</span> :: <span class="param-type"><a href="https://lua-api.factorio.com/latest/Builtin-Types.html#int">int</a></span>: The index of the first character to select.</div><div><span class="param-name">end</span> :: <span class="param-type"><a href="https://lua-api.factorio.com/latest/Builtin-Types.html#int">int</a></span>: The index of the last character to select.</div></div></div><div class="example"><div class="example-header">Example</div>
Select the characters <code>amp</code> from <code>example</code>.
<div class="block-code-container"><code class="block">textbox.select(3, 5)</code></div>
</div><div class="example"><div class="example-header">Example</div>
Move the cursor to the start of the text box.
<div class="block-code-container"><code class="block">textbox.select(1, 0)</code></div>
</div><div class="detail"><em>Can only be used if this is textfield or text-box</em></div></div></div>
<div class="element" id="LuaGuiElement.add_tab"><div class="element-header"><span class="element-name">add_tab(tab, content)</span></div><div class="element-content"><p> Adds the given tab and content widgets to this tabbed pane as a new tab.
</p><p> </p><p> </p><div class="detail"><div class="detail-header">Parameters</div><div class="detail-content"><div><span class="param-name">tab</span> :: <span class="param-type"><a href="https://lua-api.factorio.com/latest/LuaGuiElement.html">LuaGuiElement</a></span>: The tab to add, must be a GUI element of type "tab".</div><div><span class="param-name">content</span> :: <span class="param-type"><a href="https://lua-api.factorio.com/latest/LuaGuiElement.html">LuaGuiElement</a></span>: The content to show when this tab is selected. Can be any type of GUI element.</div></div></div><div class="detail"><em>Can only be used if this is tabbed-pane</em></div></div></div>
<div class="element" id="LuaGuiElement.remove_tab"><div class="element-header"><span class="element-name">remove_tab(tab)</span></div><div class="element-content"><p> Removes the given tab and what ever it's associated content is from this tabbed pane.
</p><p> </p><p> </p><p> </p><div class="detail"><div class="detail-header">Parameters</div><div class="detail-content"><div><span class="param-name">tab</span> :: <span class="param-type"><a href="https://lua-api.factorio.com/latest/LuaGuiElement.html">LuaGuiElement</a></span>: The tab to remove. If <code>nil</code> all tabs are removed.</div></div></div><div class="notes"><div class="note"><strong>Note: </strong> Removing a tab does not destroy the tab or the tab contents. It just removes them from the view.</div><div class="note"><strong>Note: </strong> When removing tabs <a href="https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.selected_tab_index">LuaGuiElement::selected_tab_index</a> needs to be manually updated.</div></div><div class="detail"><em>Can only be used if this is tabbed-pane</em></div></div></div>
<div class="element" id="LuaGuiElement.force_auto_center"><div class="element-header"><span class="element-name">force_auto_center()</span></div><div class="element-content"><p> Forces this frame to re-auto-center. Only works on frames stored directly in <a href="https://lua-api.factorio.com/latest/LuaGui.html#LuaGui.screen">LuaGui::screen</a>.
</p><div class="detail"><em>Can only be used if this is frame</em></div></div></div><div class="element" id="LuaGuiElement.index"><div class="element-header"><span class="element-name">index</span><span class="attribute-type"> :: <span class="param-type"><a href="https://lua-api.factorio.com/latest/Builtin-Types.html#uint">uint</a></span></span><span class="attribute-mode"> [Read-only]</span></div><div class="element-content"><p> The unique index of this GUI element.
</p></div></div>
<div class="element" id="LuaGuiElement.gui"><div class="element-header"><span class="element-name">gui</span><span class="attribute-type"> :: <span class="param-type"><a href="https://lua-api.factorio.com/latest/LuaGui.html">LuaGui</a></span></span><span class="attribute-mode"> [Read-only]</span></div><div class="element-content"><p> </p><p> The GUI this element is a part of.
</p></div></div>
<div class="element" id="LuaGuiElement.parent"><div class="element-header"><span class="element-name">parent</span><span class="attribute-type"> :: <span class="param-type"><a href="https://lua-api.factorio.com/latest/LuaGuiElement.html">LuaGuiElement</a></span></span><span class="attribute-mode"> [Read-only]</span></div><div class="element-content"><p> </p><p> The direct parent of this element; <code>nil</code> if this is a top-level element.
</p></div></div>
<div class="element" id="LuaGuiElement.name"><div class="element-header"><span class="element-name">name</span><span class="attribute-type"> :: <span class="param-type"><a href="https://lua-api.factorio.com/latest/Builtin-Types.html#string">string</a></span></span><span class="attribute-mode"> [Read-only]</span></div><div class="element-content"><p> </p><p> The name of this element.</p><p> </p><div class="example"><div class="example-header">Example</div>
<div class="block-code-container"><code class="block">game.player.gui.top.greeting.name == "greeting"</code></div>
</div></div></div>
<div class="element" id="LuaGuiElement.caption"><div class="element-header"><span class="element-name">caption</span><span class="attribute-type"> :: <span class="param-type"><a href="https://lua-api.factorio.com/latest/Concepts.html#LocalisedString">LocalisedString</a></span></span><span class="attribute-mode"> [Read-Write]</span></div><div class="element-content"><p> </p><p>
The text displayed on the element. For frames, this is the "heading". For other elements, like buttons or
labels, this is the content.</p><p> </p><div class="notes"><div class="note"><strong>Note: </strong> 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.</div></div></div></div>
<div class="element" id="LuaGuiElement.value"><div class="element-header"><span class="element-name">value</span><span class="attribute-type"> :: <span class="param-type"><a href="https://lua-api.factorio.com/latest/Builtin-Types.html#double">double</a></span></span><span class="attribute-mode"> [Read-Write]</span></div><div class="element-content"><p> </p><p> How much this progress bar is filled. It is a value in range [0, 1].</p><p> </p><div class="detail"><em>Can only be used if this is progressbar</em></div></div></div>
<div class="element" id="LuaGuiElement.direction"><div class="element-header"><span class="element-name">direction</span><span class="attribute-type"> :: <span class="param-type"><a href="https://lua-api.factorio.com/latest/Builtin-Types.html#string">string</a></span></span><span class="attribute-mode"> [Read-only]</span></div><div class="element-content"><p> </p><p> Direction of the layout. May be either <code>"horizontal"</code> or <code>"vertical"</code>.</p><p> </p><div class="detail"><em>Can only be used if this is frame, flow, or line</em></div></div></div>
<div class="element" id="LuaGuiElement.style"><div class="element-header"><span class="element-name">style</span><span class="attribute-type"> :: <span class="param-type"><span class="param-type"><a href="https://lua-api.factorio.com/latest/LuaStyle.html">LuaStyle</a></span> or <span class="param-type"><a href="https://lua-api.factorio.com/latest/Builtin-Types.html#string">string</a></span></span></span><span class="attribute-mode"> [Read-Write]</span></div><div class="element-content"><p> </p><p> The style of this element. When read, this evaluates to a <a href="https://lua-api.factorio.com/latest/LuaStyle.html">LuaStyle</a>. For writing, it only accepts
a string that specifies the textual identifier (prototype name) of the desired style.
</p></div></div>
<div class="element" id="LuaGuiElement.visible"><div class="element-header"><span class="element-name">visible</span><span class="attribute-type"> :: <span class="param-type"><a href="https://lua-api.factorio.com/latest/Builtin-Types.html#boolean">boolean</a></span></span><span class="attribute-mode"> [Read-Write]</span></div><div class="element-content"><p> When not visible the GUI element is hidden completely and takes no space in the layout.
</p></div></div>
<div class="element" id="LuaGuiElement.text"><div class="element-header"><span class="element-name">text</span><span class="attribute-type"> :: <span class="param-type"><a href="https://lua-api.factorio.com/latest/Builtin-Types.html#string">string</a></span></span><span class="attribute-mode"> [Read-Write]</span></div><div class="element-content"><p> </p><p> The text contained in a textfield or text-box.
</p><div class="detail"><em>Can only be used if this is textfield or text-box</em></div></div></div>
<div class="element" id="LuaGuiElement.children_names"><div class="element-header"><span class="element-name">children_names</span><span class="attribute-type"> :: <span class="param-type">array of <span class="param-type"><a href="https://lua-api.factorio.com/latest/Builtin-Types.html#string">string</a></span></span></span><span class="attribute-mode"> [Read-only]</span></div><div class="element-content"><p> </p><p>
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.
</p></div></div>
<div class="element" id="LuaGuiElement.state"><div class="element-header"><span class="element-name">state</span><span class="attribute-type"> :: <span class="param-type"><a href="https://lua-api.factorio.com/latest/Builtin-Types.html#boolean">boolean</a></span></span><span class="attribute-mode"> [Read-Write]</span></div><div class="element-content"><p> </p><p> Is this checkbox or radiobutton checked?</p><p> </p><div class="detail"><em>Can only be used if this is CheckBox or RadioButton</em></div></div></div>
<div class="element" id="LuaGuiElement.player_index"><div class="element-header"><span class="element-name">player_index</span><span class="attribute-type"> :: <span class="param-type"><a href="https://lua-api.factorio.com/latest/Builtin-Types.html#uint">uint</a></span></span><span class="attribute-mode"> [Read-only]</span></div><div class="element-content"><p> </p><p> Index into <a href="https://lua-api.factorio.com/latest/LuaGameScript.html#LuaGameScript.players">LuaGameScript::players</a> specifying the player who owns this element.
</p></div></div>
<div class="element" id="LuaGuiElement.sprite"><div class="element-header"><span class="element-name">sprite</span><span class="attribute-type"> :: <span class="param-type"><a href="https://lua-api.factorio.com/latest/Concepts.html#SpritePath">SpritePath</a></span></span><span class="attribute-mode"> [Read-Write]</span></div><div class="element-content"><p> The image to display on this sprite-button or sprite in the default state.
</p></div></div>
<div class="element" id="LuaGuiElement.resize_to_sprite"><div class="element-header"><span class="element-name">resize_to_sprite</span><span class="attribute-type"> :: <span class="param-type"><a href="https://lua-api.factorio.com/latest/Builtin-Types.html#boolean">boolean</a></span></span><span class="attribute-mode"> [Read-Write]</span></div><div class="element-content"><p> Whether should the image widget resize its size according to the sprite in it (true by default)
</p></div></div>
<div class="element" id="LuaGuiElement.hovered_sprite"><div class="element-header"><span class="element-name">hovered_sprite</span><span class="attribute-type"> :: <span class="param-type"><a href="https://lua-api.factorio.com/latest/Concepts.html#SpritePath">SpritePath</a></span></span><span class="attribute-mode"> [Read-Write]</span></div><div class="element-content"><p> </p><p> The image to display on this sprite-button when it is hovered.
</p><div class="detail"><em>Can only be used if this is sprite-button</em></div></div></div>
<div class="element" id="LuaGuiElement.clicked_sprite"><div class="element-header"><span class="element-name">clicked_sprite</span><span class="attribute-type"> :: <span class="param-type"><a href="https://lua-api.factorio.com/latest/Concepts.html#SpritePath">SpritePath</a></span></span><span class="attribute-mode"> [Read-Write]</span></div><div class="element-content"><p> </p><p> The image to display on this sprite-button when it is clicked.
</p></div></div>
<div class="element" id="LuaGuiElement.tooltip"><div class="element-header"><span class="element-name">tooltip</span><span class="attribute-type"> :: <span class="param-type"><a href="https://lua-api.factorio.com/latest/Concepts.html#LocalisedString">LocalisedString</a></span></span><span class="attribute-mode"> [Read-Write]</span></div><div class="element-content"><p> </p></div></div>
<div class="element" id="LuaGuiElement.horizontal_scroll_policy"><div class="element-header"><span class="element-name">horizontal_scroll_policy</span><span class="attribute-type"> :: <span class="param-type"><a href="https://lua-api.factorio.com/latest/Builtin-Types.html#string">string</a></span></span><span class="attribute-mode"> [Read-Write]</span></div><div class="element-content"><p> Policy of the horizontal scroll bar, possible values are "auto" (default), "never", "always", "auto-and-reserve-space".
</p><p> </p><div class="detail"><em>Can only be used if this is scroll-pane</em></div></div></div>
<div class="element" id="LuaGuiElement.vertical_scroll_policy"><div class="element-header"><span class="element-name">vertical_scroll_policy</span><span class="attribute-type"> :: <span class="param-type"><a href="https://lua-api.factorio.com/latest/Builtin-Types.html#string">string</a></span></span><span class="attribute-mode"> [Read-Write]</span></div><div class="element-content"><p> Policy of the vertical scroll bar, possible values are "auto" (default), "never", "always", "auto-and-reserve-space".
</p><p> </p><div class="detail"><em>Can only be used if this is scroll-pane</em></div></div></div>
<div class="element" id="LuaGuiElement.type"><div class="element-header"><span class="element-name">type</span><span class="attribute-type"> :: <span class="param-type"><a href="https://lua-api.factorio.com/latest/Builtin-Types.html#string">string</a></span></span><span class="attribute-mode"> [Read-only]</span></div><div class="element-content"><p> The type of this GUI element.
</p></div></div>
<div class="element" id="LuaGuiElement.children"><div class="element-header"><span class="element-name">children</span><span class="attribute-type"> :: <span class="param-type">array of <span class="param-type"><a href="https://lua-api.factorio.com/latest/LuaGuiElement.html">LuaGuiElement</a></span></span></span><span class="attribute-mode"> [Read-only]</span></div><div class="element-content"><p> The children elements
</p></div></div>
<div class="element" id="LuaGuiElement.items"><div class="element-header"><span class="element-name">items</span><span class="attribute-type"> :: <span class="param-type">array of <span class="param-type"><a href="https://lua-api.factorio.com/latest/Concepts.html#LocalisedString">LocalisedString</a></span></span></span><span class="attribute-mode"> [Read-Write]</span></div><div class="element-content"><p> The items in this dropdown or listbox.
</p></div></div>
<div class="element" id="LuaGuiElement.selected_index"><div class="element-header"><span class="element-name">selected_index</span><span class="attribute-type"> :: <span class="param-type"><a href="https://lua-api.factorio.com/latest/Builtin-Types.html#uint">uint</a></span></span><span class="attribute-mode"> [Read-Write]</span></div><div class="element-content"><p> The selected index for this dropdown or listbox. 0 if none.
</p></div></div>
<div class="element" id="LuaGuiElement.number"><div class="element-header"><span class="element-name">number</span><span class="attribute-type"> :: <span class="param-type"><a href="https://lua-api.factorio.com/latest/Builtin-Types.html#double">double</a></span></span><span class="attribute-mode"> [Read-Write]</span></div><div class="element-content"><p> The number to be shown in the right-bottom corner of the sprite-button, or <code>nil</code> to show nothing.
</p></div></div>
<div class="element" id="LuaGuiElement.show_percent_for_small_numbers"><div class="element-header"><span class="element-name">show_percent_for_small_numbers</span><span class="attribute-type"> :: <span class="param-type"><a href="https://lua-api.factorio.com/latest/Builtin-Types.html#boolean">boolean</a></span></span><span class="attribute-mode"> [Read-Write]</span></div><div class="element-content"><p> 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.
</p></div></div>
<div class="element" id="LuaGuiElement.location"><div class="element-header"><span class="element-name">location</span><span class="attribute-type"> :: <span class="param-type"><a href="https://lua-api.factorio.com/latest/Concepts.html#GuiLocation">GuiLocation</a></span></span><span class="attribute-mode"> [Read-Write]</span></div><div class="element-content"><p> The location of this widget when stored in <a href="https://lua-api.factorio.com/latest/LuaGui.html#LuaGui.screen">LuaGui::screen</a> or <code>nil</code> if not not set or not in <a href="https://lua-api.factorio.com/latest/LuaGui.html#LuaGui.screen">LuaGui::screen</a>.
</p></div></div>
<div class="element" id="LuaGuiElement.auto_center"><div class="element-header"><span class="element-name">auto_center</span><span class="attribute-type"> :: <span class="param-type"><a href="https://lua-api.factorio.com/latest/Builtin-Types.html#boolean">boolean</a></span></span><span class="attribute-mode"> [Read-Write]</span></div><div class="element-content"><p> If this frame auto-centers on window resize when stored in <a href="https://lua-api.factorio.com/latest/LuaGui.html#LuaGui.screen">LuaGui::screen</a>.
</p><p> </p><div class="detail"><em>Can only be used if this is frame</em></div></div></div>
<div class="element" id="LuaGuiElement.position"><div class="element-header"><span class="element-name">position</span><span class="attribute-type"> :: <span class="param-type"><a href="https://lua-api.factorio.com/latest/Concepts.html#Position">Position</a></span></span><span class="attribute-mode"> [Read-Write]</span></div><div class="element-content"><p> The position this camera or minimap is focused on if any.
</p></div></div>
<div class="element" id="LuaGuiElement.surface_index"><div class="element-header"><span class="element-name">surface_index</span><span class="attribute-type"> :: <span class="param-type"><a href="https://lua-api.factorio.com/latest/Builtin-Types.html#uint">uint</a></span></span><span class="attribute-mode"> [Read-Write]</span></div><div class="element-content"><p> The surface index this camera or minimap is using.
</p></div></div>
<div class="element" id="LuaGuiElement.zoom"><div class="element-header"><span class="element-name">zoom</span><span class="attribute-type"> :: <span class="param-type"><a href="https://lua-api.factorio.com/latest/Builtin-Types.html#double">double</a></span></span><span class="attribute-mode"> [Read-Write]</span></div><div class="element-content"><p> The zoom this camera or minimap is using.
</p></div></div>
<div class="element" id="LuaGuiElement.minimap_player_index"><div class="element-header"><span class="element-name">minimap_player_index</span><span class="attribute-type"> :: <span class="param-type"><a href="https://lua-api.factorio.com/latest/Builtin-Types.html#uint">uint</a></span></span><span class="attribute-mode"> [Read-Write]</span></div><div class="element-content"><p> The player index this minimap is using.
</p><p> </p><div class="detail"><em>Can only be used if this is minimap</em></div></div></div>
<div class="element" id="LuaGuiElement.force"><div class="element-header"><span class="element-name">force</span><span class="attribute-type"> :: <span class="param-type"><a href="https://lua-api.factorio.com/latest/Builtin-Types.html#string">string</a></span></span><span class="attribute-mode"> [Read-Write]</span></div><div class="element-content"><p> The force this minimap is using or <code>nil</code> if no force is set.
</p></div></div>
<div class="element" id="LuaGuiElement.elem_type"><div class="element-header"><span class="element-name">elem_type</span><span class="attribute-type"> :: <span class="param-type"><a href="https://lua-api.factorio.com/latest/Builtin-Types.html#string">string</a></span></span><span class="attribute-mode"> [Read-only]</span></div><div class="element-content"><p> The elem type of this choose-elem-button.
</p><p> </p><div class="detail"><em>Can only be used if this is choose-elem-button</em></div></div></div>
<div class="element" id="LuaGuiElement.elem_value"><div class="element-header"><span class="element-name">elem_value</span><span class="attribute-type"> :: <span class="param-type"><span class="param-type"><a href="https://lua-api.factorio.com/latest/Builtin-Types.html#string">string</a></span> or <span class="param-type"><a href="https://lua-api.factorio.com/latest/Concepts.html#SignalID">SignalID</a></span></span></span><span class="attribute-mode"> [Read-Write]</span></div><div class="element-content"><p> The elem value of this choose-elem-button or <code>nil</code> if there is no value.
</p><p> </p><p> </p><div class="notes"><div class="note"><strong>Note: </strong> Types "item", "entity", and "tile" operate with strings. Type "signal" operates with <a href="https://lua-api.factorio.com/latest/Concepts.html#SignalID">SignalID</a>.</div></div><div class="detail"><em>Can only be used if this is choose-elem-button</em></div></div></div>
<div class="element" id="LuaGuiElement.selectable"><div class="element-header"><span class="element-name">selectable</span><span class="attribute-type"> :: <span class="param-type"><a href="https://lua-api.factorio.com/latest/Builtin-Types.html#boolean">boolean</a></span></span><span class="attribute-mode"> [Read-Write]</span></div><div class="element-content"><p> If the contents of this text-box are selectable.
</p><p> </p><div class="detail"><em>Can only be used if this is text-box</em></div></div></div>
<div class="element" id="LuaGuiElement.word_wrap"><div class="element-header"><span class="element-name">word_wrap</span><span class="attribute-type"> :: <span class="param-type"><a href="https://lua-api.factorio.com/latest/Builtin-Types.html#boolean">boolean</a></span></span><span class="attribute-mode"> [Read-Write]</span></div><div class="element-content"><p> If this text-box will word-wrap automatically.
</p><p> </p><div class="detail"><em>Can only be used if this is text-box</em></div></div></div>
<div class="element" id="LuaGuiElement.read_only"><div class="element-header"><span class="element-name">read_only</span><span class="attribute-type"> :: <span class="param-type"><a href="https://lua-api.factorio.com/latest/Builtin-Types.html#boolean">boolean</a></span></span><span class="attribute-mode"> [Read-Write]</span></div><div class="element-content"><p> If this text-box is read-only.
</p><p> </p><div class="detail"><em>Can only be used if this is text-box</em></div></div></div>
<div class="element" id="LuaGuiElement.enabled"><div class="element-header"><span class="element-name">enabled</span><span class="attribute-type"> :: <span class="param-type"><a href="https://lua-api.factorio.com/latest/Builtin-Types.html#boolean">boolean</a></span></span><span class="attribute-mode"> [Read-Write]</span></div><div class="element-content"><p> If this GUI element is enabled.
</p></div></div>
<div class="element" id="LuaGuiElement.ignored_by_interaction"><div class="element-header"><span class="element-name">ignored_by_interaction</span><span class="attribute-type"> :: <span class="param-type"><a href="https://lua-api.factorio.com/latest/Builtin-Types.html#boolean">boolean</a></span></span><span class="attribute-mode"> [Read-Write]</span></div><div class="element-content"><p> 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.
</p></div></div>
<div class="element" id="LuaGuiElement.locked"><div class="element-header"><span class="element-name">locked</span><span class="attribute-type"> :: <span class="param-type"><a href="https://lua-api.factorio.com/latest/Builtin-Types.html#boolean">boolean</a></span></span><span class="attribute-mode"> [Read-Write]</span></div><div class="element-content"><p> If this choose-elem-button can be changed by the player.
</p><p> </p><div class="detail"><em>Can only be used if this is choose-elem-button</em></div></div></div>
<div class="element" id="LuaGuiElement.draw_vertical_lines"><div class="element-header"><span class="element-name">draw_vertical_lines</span><span class="attribute-type"> :: <span class="param-type"><a href="https://lua-api.factorio.com/latest/Builtin-Types.html#boolean">boolean</a></span></span><span class="attribute-mode"> [Read-Write]</span></div><div class="element-content"><p> If this table should draw vertical grid lines.
</p><p> </p><div class="detail"><em>Can only be used if this is table</em></div></div></div>
<div class="element" id="LuaGuiElement.draw_horizontal_lines"><div class="element-header"><span class="element-name">draw_horizontal_lines</span><span class="attribute-type"> :: <span class="param-type"><a href="https://lua-api.factorio.com/latest/Builtin-Types.html#boolean">boolean</a></span></span><span class="attribute-mode"> [Read-Write]</span></div><div class="element-content"><p> If this table should draw horizontal grid lines.
</p><p> </p><div class="detail"><em>Can only be used if this is table</em></div></div></div>
<div class="element" id="LuaGuiElement.draw_horizontal_line_after_headers"><div class="element-header"><span class="element-name">draw_horizontal_line_after_headers</span><span class="attribute-type"> :: <span class="param-type"><a href="https://lua-api.factorio.com/latest/Builtin-Types.html#boolean">boolean</a></span></span><span class="attribute-mode"> [Read-Write]</span></div><div class="element-content"><p> If this table should draw a horizontal grid line after the headers.
</p><p> </p><div class="detail"><em>Can only be used if this is table</em></div></div></div>
<div class="element" id="LuaGuiElement.column_count"><div class="element-header"><span class="element-name">column_count</span><span class="attribute-type"> :: <span class="param-type"><a href="https://lua-api.factorio.com/latest/Builtin-Types.html#uint">uint</a></span></span><span class="attribute-mode"> [Read-only]</span></div><div class="element-content"><p> The number of columns in this table.
</p><p> </p><div class="detail"><em>Can only be used if this is table</em></div></div></div>
<div class="element" id="LuaGuiElement.vertical_centering"><div class="element-header"><span class="element-name">vertical_centering</span><span class="attribute-type"> :: <span class="param-type"><a href="https://lua-api.factorio.com/latest/Builtin-Types.html#boolean">boolean</a></span></span><span class="attribute-mode"> [Read-Write]</span></div><div class="element-content"><p> Whether the fields of this table should be vertically centered. This true by default and overrides <a href="https://lua-api.factorio.com/latest/LuaStyle.html#LuaStyle.column_alignments">LuaStyle::column_alignments</a>.
</p><p> </p><div class="detail"><em>Can only be used if this is table</em></div></div></div>
<div class="element" id="LuaGuiElement.slider_value"><div class="element-header"><span class="element-name">slider_value</span><span class="attribute-type"> :: <span class="param-type"><a href="https://lua-api.factorio.com/latest/Builtin-Types.html#double">double</a></span></span><span class="attribute-mode"> [Read-Write]</span></div><div class="element-content"><p> The value of this slider element.
</p><p> </p><div class="detail"><em>Can only be used if this is slider</em></div></div></div>
<div class="element" id="LuaGuiElement.mouse_button_filter"><div class="element-header"><span class="element-name">mouse_button_filter</span><span class="attribute-type"> :: <span class="param-type"><a href="https://lua-api.factorio.com/latest/Concepts.html#MouseButtonFlags">MouseButtonFlags</a></span></span><span class="attribute-mode"> [Read-Write]</span></div><div class="element-content"><p> The mouse button filters for this button or sprite-button.
</p></div></div>
<div class="element" id="LuaGuiElement.numeric"><div class="element-header"><span class="element-name">numeric</span><span class="attribute-type"> :: <span class="param-type"><a href="https://lua-api.factorio.com/latest/Builtin-Types.html#boolean">boolean</a></span></span><span class="attribute-mode"> [Read-Write]</span></div><div class="element-content"><p> If this text field only accepts numbers.
</p><p> </p><div class="detail"><em>Can only be used if this is textfield</em></div></div></div>
<div class="element" id="LuaGuiElement.allow_decimal"><div class="element-header"><span class="element-name">allow_decimal</span><span class="attribute-type"> :: <span class="param-type"><a href="https://lua-api.factorio.com/latest/Builtin-Types.html#boolean">boolean</a></span></span><span class="attribute-mode"> [Read-Write]</span></div><div class="element-content"><p> If this text field (when in numeric mode) allows decimal numbers.
</p><p> </p><div class="detail"><em>Can only be used if this is textfield</em></div></div></div>
<div class="element" id="LuaGuiElement.allow_negative"><div class="element-header"><span class="element-name">allow_negative</span><span class="attribute-type"> :: <span class="param-type"><a href="https://lua-api.factorio.com/latest/Builtin-Types.html#boolean">boolean</a></span></span><span class="attribute-mode"> [Read-Write]</span></div><div class="element-content"><p> If this text field (when in numeric mode) allows negative numbers.
</p><p> </p><div class="detail"><em>Can only be used if this is textfield</em></div></div></div>
<div class="element" id="LuaGuiElement.is_password"><div class="element-header"><span class="element-name">is_password</span><span class="attribute-type"> :: <span class="param-type"><a href="https://lua-api.factorio.com/latest/Builtin-Types.html#boolean">boolean</a></span></span><span class="attribute-mode"> [Read-Write]</span></div><div class="element-content"><p> If this text field displays as a password field (renders all characters as '*').
</p><p> </p><div class="detail"><em>Can only be used if this is textfield</em></div></div></div>
<div class="element" id="LuaGuiElement.lose_focus_on_confirm"><div class="element-header"><span class="element-name">lose_focus_on_confirm</span><span class="attribute-type"> :: <span class="param-type"><a href="https://lua-api.factorio.com/latest/Builtin-Types.html#boolean">boolean</a></span></span><span class="attribute-mode"> [Read-Write]</span></div><div class="element-content"><p> If this text field loses focus after <a href="https://lua-api.factorio.com/latest/defines.html#defines.events.on_gui_confirmed">defines.events.on_gui_confirmed</a> is fired.
</p><p> </p><div class="detail"><em>Can only be used if this is textfield</em></div></div></div>
<div class="element" id="LuaGuiElement.clear_and_focus_on_right_click"><div class="element-header"><span class="element-name">clear_and_focus_on_right_click</span><span class="attribute-type"> :: <span class="param-type"><a href="https://lua-api.factorio.com/latest/Builtin-Types.html#boolean">boolean</a></span></span><span class="attribute-mode"> [Read-Write]</span></div><div class="element-content"><p> </p><p> </p><div class="detail"><em>Can only be used if this is textfield or text-box</em></div></div></div>
<div class="element" id="LuaGuiElement.drag_target"><div class="element-header"><span class="element-name">drag_target</span><span class="attribute-type"> :: <span class="param-type"><a href="https://lua-api.factorio.com/latest/LuaGuiElement.html">LuaGuiElement</a></span></span><span class="attribute-mode"> [Read-Write]</span></div><div class="element-content"><p> The frame drag target for this flow, frame, label, table, or empty-widget.
</p><p> </p><p> </p><p> </p><div class="notes"><div class="note"><strong>Note: </strong> drag_target can only bet set to a frame stored directly in <a href="https://lua-api.factorio.com/latest/LuaGui.html#LuaGui.screen">LuaGui::screen</a> or <code>nil</code>.</div><div class="note"><strong>Note: </strong> drag_target can only be set on child elements in <a href="https://lua-api.factorio.com/latest/LuaGui.html#LuaGui.screen">LuaGui::screen</a>.</div><div class="note"><strong>Note: </strong> 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).</div></div></div></div>
<div class="element" id="LuaGuiElement.selected_tab_index"><div class="element-header"><span class="element-name">selected_tab_index</span><span class="attribute-type"> :: <span class="param-type"><a href="https://lua-api.factorio.com/latest/Builtin-Types.html#uint">uint</a></span></span><span class="attribute-mode"> [Read-Write]</span></div><div class="element-content"><p> The selected tab index or <code>nil</code> if no tab is selected.
</p><p> </p><div class="detail"><em>Can only be used if this is tabbed-pane</em></div></div></div>
<div class="element" id="LuaGuiElement.tabs"><div class="element-header"><span class="element-name">tabs</span><span class="attribute-type"> :: <span class="param-type">array of <span class="param-type">TabAndContent</span></span></span><span class="attribute-mode"> [Read-only]</span></div><div class="element-content"><p> The tabs and contents being shown in this tabbed-pane.
</p><p> Each TabAndContent is a table: </p><ul class="field-list"><li><span class="param-name">tab</span> :: <span class="param-type"><a href="https://lua-api.factorio.com/latest/LuaGuiElement.html">LuaGuiElement</a></span></li><li><span class="param-name">content</span> :: <span class="param-type"><a href="https://lua-api.factorio.com/latest/LuaGuiElement.html">LuaGuiElement</a></span></li></ul><p></p></div></div>
<div class="element" id="LuaGuiElement.entity"><div class="element-header"><span class="element-name">entity</span><span class="attribute-type"> :: <span class="param-type"><a href="https://lua-api.factorio.com/latest/LuaEntity.html">LuaEntity</a></span></span><span class="attribute-mode"> [Read-Write]</span></div><div class="element-content"><p> The entity associated with this entity-preview or <code>nil</code> if no entity is associated.
</p><p> </p><div class="detail"><em>Can only be used if this is entity-preview</em></div></div></div>
<div class="element" id="LuaGuiElement.switch_state"><div class="element-header"><span class="element-name">switch_state</span><span class="attribute-type"> :: <span class="param-type"><a href="https://lua-api.factorio.com/latest/Builtin-Types.html#string">string</a></span></span><span class="attribute-mode"> [Read-Write]</span></div><div class="element-content"><p> The switch state (left, none, right) for this switch.
</p><p> </p><p> </p><div class="notes"><div class="note"><strong>Note: </strong> If <a href="https://lua-api.factorio.com/latest/LuaGuiElement.html#LuaGuiElement.allow_none_state">LuaGuiElement::allow_none_state</a> is false this can't be set to 'none'.</div></div><div class="detail"><em>Can only be used if this is switch</em></div></div></div>
<div class="element" id="LuaGuiElement.allow_none_state"><div class="element-header"><span class="element-name">allow_none_state</span><span class="attribute-type"> :: <span class="param-type"><a href="https://lua-api.factorio.com/latest/Builtin-Types.html#boolean">boolean</a></span></span><span class="attribute-mode"> [Read-Write]</span></div><div class="element-content"><p> If the 'none' state is allowed for this switch.
</p><p> </p><p> </p><div class="notes"><div class="note"><strong>Note: </strong> This can't be set to false if the current switch_state is 'none'.</div></div><div class="detail"><em>Can only be used if this is switch</em></div></div></div>
<div class="element" id="LuaGuiElement.left_label_caption"><div class="element-header"><span class="element-name">left_label_caption</span><span class="attribute-type"> :: <span class="param-type"><a href="https://lua-api.factorio.com/latest/Concepts.html#LocalisedString">LocalisedString</a></span></span><span class="attribute-mode"> [Read-Write]</span></div><div class="element-content"><p> The text shown for the left switch label.
</p><p> </p><div class="detail"><em>Can only be used if this is switch</em></div></div></div>
<div class="element" id="LuaGuiElement.left_label_tooltip"><div class="element-header"><span class="element-name">left_label_tooltip</span><span class="attribute-type"> :: <span class="param-type"><a href="https://lua-api.factorio.com/latest/Concepts.html#LocalisedString">LocalisedString</a></span></span><span class="attribute-mode"> [Read-Write]</span></div><div class="element-content"><p> The text shown for the left switch tooltip.
</p><p> </p><div class="detail"><em>Can only be used if this is switch</em></div></div></div>
<div class="element" id="LuaGuiElement.right_label_caption"><div class="element-header"><span class="element-name">right_label_caption</span><span class="attribute-type"> :: <span class="param-type"><a href="https://lua-api.factorio.com/latest/Concepts.html#LocalisedString">LocalisedString</a></span></span><span class="attribute-mode"> [Read-Write]</span></div><div class="element-content"><p> The text shown for the right switch label.
</p><p> </p><div class="detail"><em>Can only be used if this is switch</em></div></div></div>
<div class="element" id="LuaGuiElement.right_label_tooltip"><div class="element-header"><span class="element-name">right_label_tooltip</span><span class="attribute-type"> :: <span class="param-type"><a href="https://lua-api.factorio.com/latest/Concepts.html#LocalisedString">LocalisedString</a></span></span><span class="attribute-mode"> [Read-Write]</span></div><div class="element-content"><p> The text shown for the right switch tooltip.
</p><p> </p><div class="detail"><em>Can only be used if this is switch</em></div></div></div>
<div class="element" id="LuaGuiElement.operator []"><div class="element-header"><span class="element-name">operator []</span><span class="attribute-type"> :: <span class="param-type"><a href="https://lua-api.factorio.com/latest/LuaGuiElement.html">LuaGuiElement</a></span></span><span class="attribute-mode"> [Read-only]</span></div><div class="element-content"><p> The indexing operator. Gets children by name.</p><p> </p><p> </p></div></div></div></body></html>