Layouts
A layout is the top-level object of a screen file. It defines the size of the screen, what is drawn behind it, and which widgets it contains.
Like most Palladium systems, layouts are typed: the type field decides which layout implementation is used. As a shortcut, you can leave out the type field entirely, in which case the file is read as a palladium:simple layout. These two files are identical:
{
"width": 200,
"height": 120
}
{
"type": "palladium:simple",
"width": 200,
"height": 120
}
Auto Size
width and height of the simple layout are optional, and each can be omitted independently. An omitted dimension spans the full available space: the whole screen when opened as a screen or rendered as a HUD overlay. A file with neither is a fullscreen canvas, which is the usual choice for HUDs; a layout with only "height": 100 becomes a full-width strip centered vertically.
Layouts without a fixed size should not be used as columns inside a palladium:multi_column layout, since the column arrangement needs concrete widths.
Alignment
The alignment field controls where on the screen the layout is placed, both when opened as a screen and when rendered as a HUD overlay. It accepts the same nine anchor values as widget alignment and defaults to center:
{
"width": 120,
"height": 40,
"alignment": "bottom_right",
"widgets": [ ... ]
}
Alignment only matters for layouts with a fixed size on at least one axis; a fully auto-sized layout covers the whole screen anyway. Both the simple and the multi column layout support the field.
Padding
The padding field of the simple layout insets the area that widgets are placed in. Widget positions and alignments are relative to this padded area, not the full layout, so the padding keeps widgets off the background's border.
Padding is either a single number for all four sides or an object with per-side values:
"padding": 7
"padding": {
"top": 10,
"bottom": 4,
"left": 7,
"right": 7
}
Sides left out of the object default to 0. The simple layout's default padding is 7 on all sides, which matches the border width of the default background sprite.
Nesting
The palladium:multi_column layout places several layouts side by side, which is the main tool for building wider, structured screens. Each column is itself a full layout with its own background, padding and widgets. Columns can nest further, though a single level is usually enough.
The total size is calculated automatically: the width is the sum of all column widths (plus gaps), the height is the height of the tallest column.
Layout Types
Default Power Layout
palladium:power/default- Settings
| Key | Type | Description | Required | Fallback |
|---|---|---|---|---|
width | Integer (> 0) | Width of this layout | 256 | |
height | Integer (> 0) | Height of this layout | 196 | |
background | UI Background | The background that is drawn for the power tree. | "minecraft:textures/block/red_wool.png" | |
display_type | autotreelist | How the abilities are displayed. "auto" uses a tree if the abilities are connected to each other, otherwise a list. | auto |
Multi Column Layout
palladium:multi_column- Settings
| Key | Type | Description | Required | Fallback |
|---|---|---|---|---|
layouts | UI Layouts | List of UI layouts. | / | |
gap | Integer (>= 0) | Gap between each layout. | 0 | |
alignment | top_lefttop_centertop_rightmiddle_leftcentermiddle_rightbottom_leftbottom_centerbottom_right | Where on the screen the layout is placed. | center |
Simple
palladium:simple- Settings
| Key | Type | Description | Required | Fallback |
|---|---|---|---|---|
width | Integer (> 0) | Width of this layout. If left out, it spans the full available width (the whole screen). | full width | |
height | Integer (> 0) | Height of this layout. If left out, it spans the full available height (the whole screen). | full height | |
alignment | top_lefttop_centertop_rightmiddle_leftcentermiddle_rightbottom_leftbottom_centerbottom_right | Where on the screen the layout is placed. | center | |
padding | UI Padding | Padding for each side of the layout | 0 | |
background | UI Background | The background that is drawn for the layout. | {"sprite":"palladium:background/default","type":"palladium:sprite"} | |
widgets | UI Widgets | List of UI widgets | / |