Panel
A filled rectangle: a menu plate, a HUD backing, or a plain picture with a texture instead of a flat colour. Give it a nine-slice border so the corners hold their size while the middle stretches, or tile the texture across it.
On this page
Add it
+ Add node → Panel, Image, Button, Menu Button, Toggle, Dropdown, Text Entry, Scrollbar, Modal, Virtual Stick, Virtual Button creates a node with it already on. Already have a node for it? Add component → PanelComponent.
From a script
A script on the same node writes these fields by name. PanelComponent is the name to pass.
rgs
set_colour("PanelComponent", "color", vec4(0.0, 0.0, 0.0, 0.5));
set_number("PanelComponent", "border", 0.0);
set_colour("PanelComponent", "uv", vec4(0.0, 0.0, 1.0, 1.0));
set_text("PanelComponent", "region_name", "");
set_point("PanelComponent", "tile", vec2(1.0, 1.0)); Fields
| Field | Script name | Kind | Default | What it does |
|---|---|---|---|---|
| Color | color | colour | #000000, 50% opaque | Fill colour, including how see-through it is. |
| Texture | texture | asset | none | Texture to draw instead of a flat colour. |
| Border | border | number, at least 0 | 0 | Width of the nine-slice border. Zero stretches the texture instead. |
| UV Rect | uv | number | (0, 0, 1, 1) | Part of the texture to use, as its left, top, right and bottom edges, each a fraction from 0 to 1. |
| Atlas Region | region_name | text | empty | Named area within the texture to draw instead of the UV Rect; empty uses the UV Rect. |
| Tile | tile | two numbers (x, y), at least 0 | (1, 1) | How many times the texture repeats. |