Factorio.com|Forums|Wiki|Mod Portal|API Docs

# Factorio Runtime Docs Version 2.0.77

# GuiAnchor - Runtime Docs

## GuiAnchor :: table

#### Table fields

gui | :: defines.relative_gui_type |
position | :: defines.relative_gui_position |
type | :: string? | If provided, only anchors the GUI element when the opened things type matches the type.
If provided, only anchors the GUI element when the opened things type matches the type.
name | :: string? | If provided, only anchors the GUI element when the opened thing matches the name. `name` takes precedence over `names`.
If provided, only anchors the GUI element when the opened thing matches the name. `name` takes precedence over `names`.
names | :: array[string]? | If provided, only anchors the GUI element when the opened thing matches one of the names. When reading an anchor, `names` is always populated.
If provided, only anchors the GUI element when the opened thing matches one of the names. When reading an anchor, `names` is always populated.
ghost_mode | :: `"both"` or `"only_ghosts"` or `"only_real"`? | Defaults to `"only_real"`.
Defaults to `"only_real"`.

Concept used in

- LuaGuiElement::add()
- LuaGuiElement::anchor