GUIs
Palladium lets you build entire custom screens from JSON, no code required. A screen is defined by a layout that describes its size and background, and a list of components (text, buttons, images, your player model, ...) placed inside it. The power screen you see when pressing the powers key is built with this exact system, so everything described here also applies to customizing power screens.
Screens are client-side asset files. Create a JSON file at:
assets/<namespace>/palladium/screens/<id>.json
For example, assets/mypack/palladium/screens/starter.json defines the screen mypack:starter.
The system is split into three building blocks, each with its own page:
- Layouts define the overall frame: size, padding, background, and which components it contains. The screen file itself is a layout.
- Components are the individual elements inside a layout. Every component shares a common set of properties for positioning, tooltips, visibility, and click actions.
- Backgrounds fill the area behind a layout (or behind the power tree), from simple repeating textures to sprites.
A minimal screen file looks like this:
{
"width": 200,
"height": 100,
"components": [
{
"type": "palladium:text",
"text": "Hello!",
"properties": {
"alignment": "top_center"
}
}
]
}
See the Examples page for complete setups.
Opening Screens
A screen file on its own does nothing; something has to open it. There are three ways:
The /palladium screen Command
/palladium screen <id> [players]
Opens the screen for yourself or the given players. Requires gamemaster permissions. Useful for testing while building a screen, and for triggering screens from functions or command blocks.
Dialog and Button Actions
Palladium registers the custom action type palladium:open_screen, which works in vanilla dialogs as well as in the action property of button components:
"action": {
"type": "palladium:open_screen",
"screen": "mypack:other_screen"
}
| Field | Type | Required | Description |
|---|---|---|---|
screen | ID | Yes | The screen to open. |
This also means screens can open other screens, which lets you build multi-page menus out of several screen files.
There is a second custom action, palladium:open_customization_screen, which opens the player customization screen instead. Its optional category field jumps straight to a specific customization category.
Power Screens
Every power has a screen field pointing to a layout ID (see Powers). It defaults to palladium:power/default, the built-in power screen with the power's name at the top and the ability tree below. By pointing it to your own screen file, you can fully redesign what players see when they open that power:
"screen": "mypack:my_power_screen"
When a player has several powers, each power's layout is shown as a tab of the same screen.