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 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:

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
}

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

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"

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

Simple

ID: palladium:simple
Used for simple layouts.
KeyTypeDescriptionRequiredFallback
widthInteger (> 0)Width of this layout/
heightInteger (> 0)Height of this layout/
paddingUI PaddingPadding for each side of the layout0
backgroundUI BackgroundThe background that is drawn for the layout.{"sprite":"palladium:background/default","type":"palladium:sprite"}
componentsUI ComponentsList of UI components/