Skip to Content
Foundry Apparatus

Panels and Buttons

Available since 0.1.0

Screens beyond one window. Extra panels beside or over the main one, buttons that open them, storage names and colors.

Everything on this page is already accepted and checked by the validator, so you can write it today. The game draws it starting with the next release; until then it reports FA-COMPAT-006 (accepted, not active yet) and shows the screen without it. The title position already works.

A screen starts as one window. Panels let you add more: a side panel that is always visible, a panel that slides open with a button, a strip of buttons beside the window. You decide their size, where they go and what is in them.

Storage names and colors

storage_styles gives each storage the name and color players see on the screen, in tooltips and in the side panel:

"storage_styles": {
  "water_in": {
    "name": "Water",
    "color": "#3bc9db"
  },
  "output": {
    "name": "Output",
    "color": "#9775fa"
  }
}

Colors use the #RRGGBB format. Because they live in the screen file, you can change them with /reload.

Panels

Each entry of panels is one extra panel, with its own widgets:

"panels": [
  {
    "id": "upgrades",
    "show": "toggle",
    "placement": "right",
    "width": 80,
    "height": 80,
    "widgets": [
      {
        "id": "upgrade_info",
        "type": "foundry_apparatus:status_indicator",
        "x": 8,
        "y": 8,
        "width": 8,
        "height": 8
      }
    ]
  }
]
  • show is always (the panel is always there) or toggle (a button opens and closes it).
  • Widget positions are counted from the top-left corner of the panel.

Easy mode: pick a placement

placement puts the panel in a ready-made spot:

ValueWhere the panel goes
leftOutside the window, on the left.
rightOutside the window, on the right.
inventoryOver the player inventory area.
contentOver the machine area, above the inventory.

left and right panels need a width and a height. inventory and content panels take the size of the area they cover, so leave width and height out.

Advanced mode: anchor it yourself

For full control, use anchor instead of placement. It attaches the panel to a side of the main window, or of another panel, with an exact offset:

{
  "id": "output_column",
  "show": "always",
  "width": 26,
  "height": 60,
  "anchor": {
    "to": "main",
    "side": "right",
    "x": 2,
    "y": 16,
    "align": "start"
  }
}
  • to is main or the id of another panel.
  • side is the side to attach to: left, right, top, bottom or inside.
  • x and y move the panel from there, in pixels.
  • align lines it up with the start, center or end of that side.

A panel has either placement or anchor, never both. Panels cannot be anchored in a circle (A to B and B to A): the validator tells you if they are.

Buttons

Buttons are widgets, so you can put them anywhere: in the main window or in any panel.

foundry_apparatus:panel_button opens and closes a toggle panel:

{
  "id": "open_upgrades",
  "type": "foundry_apparatus:panel_button",
  "x": 156,
  "y": 4,
  "width": 16,
  "height": 16,
  "params": {
    "panel": "upgrades"
  }
}

params can also give the button an icon (a texture id) and a tooltip.

foundry_apparatus:side_config_button opens a panel that holds a side configuration widget, already set to one storage. target_binding is the storage and params.panel the panel to open:

{
  "id": "water_sides",
  "type": "foundry_apparatus:side_config_button",
  "x": 4,
  "y": 4,
  "width": 16,
  "height": 16,
  "target_binding": "water_in",
  "params": {
    "panel": "sides"
  }
}

The panel it opens contains a foundry_apparatus:side_config_panel widget:

{
  "id": "sides",
  "show": "toggle",
  "placement": "content",
  "widgets": [
    {
      "id": "faces",
      "type": "foundry_apparatus:side_config_panel",
      "x": 50,
      "y": 6,
      "width": 76,
      "height": 64
    }
  ]
}

Put one side_config_button per storage (each with its storage's color from storage_styles) and you have a side configuration like Industrial Foregoing or Mekanism.

The automatic side tab

When a machine lets players configure its sides, the screen gets a side tab by itself. If you build your own buttons and panels for that, turn the automatic one off:

"auto_side_config": false

What is next

Every field of panels, buttons and styles is listed in the GUI reference.

On this page