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 components 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
}
Padding
The padding field of the simple layout insets the area that components are placed in. Component positions and alignments are relative to this padded area, not the full layout, so the padding keeps components 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 components. 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" |
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 |
Simple
palladium:simple- Settings
| Key | Type | Description | Required | Fallback |
|---|---|---|---|---|
width | Integer (> 0) | Width of this layout | / | |
height | Integer (> 0) | Height of this layout | / | |
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"} | |
components | UI Components | List of UI components | / |