Skip to main content
Version: 26.1+

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:

assets/mypack/palladium/screens/my_screen.json
{
"width": 200,
"height": 120
}
assets/mypack/palladium/screens/my_screen.json
{
"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:

assets/mypack/palladium/screens/status_box.json
{
"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

ID: palladium:power/default
The default layout for power screens
KeyTypeDescriptionRequiredFallback
widthInteger (> 0)Width of this layout256
heightInteger (> 0)Height of this layout196
backgroundUI BackgroundThe background that is drawn for the power tree."minecraft:textures/block/red_wool.png"
display_typeauto
tree
list
How the abilities are displayed. "auto" uses a tree if the abilities are connected to each other, otherwise a list.auto

Multi Column Layout

ID: palladium:multi_column
Used for using multiple layouts next to each other horizontally.
KeyTypeDescriptionRequiredFallback
layoutsUI LayoutsList of UI layouts./
gapInteger (>= 0)Gap between each layout.0
alignmenttop_left
top_center
top_right
middle_left
center
middle_right
bottom_left
bottom_center
bottom_right
Where on the screen the layout is placed.center

Simple

ID: palladium:simple
Used for simple layouts.
KeyTypeDescriptionRequiredFallback
widthInteger (> 0)Width of this layout. If left out, it spans the full available width (the whole screen).full width
heightInteger (> 0)Height of this layout. If left out, it spans the full available height (the whole screen).full height
alignmenttop_left
top_center
top_right
middle_left
center
middle_right
bottom_left
bottom_center
bottom_right
Where on the screen the layout is placed.center
paddingUI PaddingPadding for each side of the layout0
backgroundUI BackgroundThe background that is drawn for the layout.{"sprite":"palladium:background/default","type":"palladium:sprite"}
widgetsUI WidgetsList of UI widgets/