Skip to content

Components

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

FieldScript nameKindDefaultWhat it does
Colorcolorcolour#000000, 50% opaqueFill colour, including how see-through it is.
TexturetextureassetnoneTexture to draw instead of a flat colour.
Borderbordernumber, at least 00Width of the nine-slice border. Zero stretches the texture instead.
UV Rectuvnumber(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 Regionregion_nametextemptyNamed area within the texture to draw instead of the UV Rect; empty uses the UV Rect.
Tiletiletwo numbers (x, y), at least 0(1, 1)How many times the texture repeats.