Game UI
Build a 2D game HUD
This walkthrough builds the HUD of a side-scrolling platformer at 1920 × 1080: hearts and an energy bar, two counters, a level banner, an ability strip with cooldowns, and controller hints. Each cluster is pinned to its own corner, so the HUD holds at other screen shapes, and its labels shrink to fit longer words.

The level behind it is a few flat shapes: a gradient sky, two hills, a ground strip, two ledges and a hero. It stands in for the game so that you judge the HUD against something. It is not exported.
1. The screen#
Press F and choose 1080p. The frame is 1920 × 1080 with a title-safe area 96 in from the sides and 54 from the top and bottom. Every cluster below sits on that inset: left edges at x 96, right edges at x 1824, tops at y 54, bottoms at y 1026.
Use one face for the whole HUD. This one is Space Grotesk, which comes with Nox: Bold for numbers, Semibold for labels. Use one plate behind text that sits over the level: #0B0F24 at 72%, with a 2 inside stroke of white at 15%.
2. Hearts and energy, top left#
Make a frame named Vitals at x 96, y 54, 248 × 76, with no fill.
- Hearts: five, each 40 × 40, 48 apart. Full is
#FF5D73. Empty is white at 22%, so a lost heart leaves its place visible. - Energy: a track 208 × 14 with a 7 radius, white at 18%, at y 55. Over it the fill, the same height, with a gradient from
#5CE1E6to#3DCB97. Its width is the value: 146 of 208 is 70%. A small bolt at its left names it.
Vitals keeps the default pin, Left and Top.
3. Counters, top right#
Make a frame named Counters at x 1524, y 54, 300 × 48. In it, two plates with a 24 radius: gems, 132 wide, and coins, 152 wide, 16 apart. Each holds an icon 28 across at its left and a number at 24, Bold, aligned right.
Give each number a box of its own, with a width and a height, and align it right. A number that grows from 12 to 1 280 then grows leftward inside its plate and never moves the icon.
Pin Counters Right and Top.
4. The level banner, top center#
A plate 420 × 56 at x 750, y 54, with a 28 radius. In it the level's name at 24, Bold, letter spacing 1.5, centered in a box 372 × 32. Pin the banner Center and Top.
5. The ability strip, bottom center#
Make a frame named Abilities at x 744, y 918, 432 × 108. In it, four slots 96 × 96, 16 apart, with a 22 radius, each set to clip its content.
- Ready: the icon at full strength, 44 across. The slot the player has in hand gets a 3 stroke of
#5CE1E6. - On cooldown: the icon at 22% opacity. Over it an ellipse 144 across, centered on the slot, white at 17%, drawn as an arc that begins at twelve o'clock. Its sweep is the time left: for a 6 second cooldown, 60 degrees a second. Over that, the seconds left at 36, Bold.
- The hint: a light badge 40 × 26 with an 8 radius, straddling the slot's bottom edge, with the trigger's name at 14: LB, RB, LT, RT.
To draw the cooldown by hand, draw an ellipse and select it with the Move tool (V). A small square handle sits inside its edge at three o'clock, once the ellipse is 48 points or more across on screen. Pull it round and that much of the ellipse is drawn.
Pin Abilities Center and Bottom.
6. Hints and the goal, bottom corners#
Bottom right, a frame named Hints at x 1524, y 978, 300 × 48: a circle 40 across with the button's letter at 20, Bold, then its action at 22, Semibold. A is #3DCB97, X is #6FA8FF, each with a dark letter. Pin it Right and Bottom.
Bottom left, a plate 380 × 48 at x 96, y 978, with the current goal at 20. Pin it Left and Bottom.
Draw controller glyphs as your own shapes, or bring in the platform holder's official glyphs from the project. Nox comes with no icon set. See Bring in your own icons.
7. Pins, so it holds at other sizes#
- Select a cluster, such as Counters.
- In the inspector, under Pins, set H to Right and V to Top.
- Do the same for each cluster with the values above.
- Select the HUD frame and change W to 1440. Each cluster keeps its distance from its own edge.


Pins hold place, not size. At 1440 × 1080 and 2560 × 1080 the HUD is the same size on a screen of the same height, which is what you want. For a screen with more pixels, such as 3840 × 2160, scale the whole frame: Arrange › Scale…, or the scale property with 2. Everything in it scales as a picture does, strokes, radii and font sizes included.
Describe the clusters and where each holds. One create_nodes call can build a cluster with its pin. To check another size without changing the document, the agent calls render_preview with a width and height.
On the HUD frame, add a counters cluster at the top right, on the title-safe
inset: gems (12) and coins (1 280). Pin it right and top. Then show me the
HUD at 1440 × 1080.
The agent calls create_nodes with:
{
"parent": "3:2",
"nodes": [
{
"kind": "frame", "name": "Counters",
"x": 1524, "y": 54, "width": 300, "height": 48,
"fills": [],
"pin": { "horizontal": "right", "vertical": "top" },
"children": [
{
"kind": "frame", "name": "Gems",
"x": 0, "y": 0, "width": 132, "height": 48,
"corner_radius": 24, "fills": ["#0B0F24B8"],
"stroke": "#FFFFFF26", "stroke_width": 2, "stroke_align": "inside",
"children": [
{ "kind": "path", "name": "Gem", "x": 14, "y": 10,
"path": "M7 3.5 L21 3.5 L25.7 10.5 L14 24.5 L2.3 10.5 Z",
"fills": ["#5CE1E6"] },
{ "kind": "text", "name": "Count", "text": "12",
"x": 50, "y": 8, "width": 64, "height": 32,
"font_family": "Space Grotesk", "font_size": 24, "font_weight": 700,
"text_align": "right", "fills": ["#FFFFFF"], "text_fit": 14 }
]
}
]
}
]
}
and then render_preview with:
{ "node": "3:2", "width": 1440, "height": 1080 }8. Text that shrinks to fit#
A level's name in German or a nine-digit score is longer than the one you designed with. A label with Shrink to fit is shown smaller, in half units, until its lines fit its box, and never smaller than the least size you give.

- Select the label. Give it a width and a height of its own: here 372 × 32.
- In the inspector, under Text, open More.
- In Shrink to fit, least, type 14.
Through the tools it is text_fit. This call to update_nodes sets it on the banner's label:
{
"changes": [
{ "id": "3:31", "text_fit": 14 }
]
}
The label's own size stays 24: only how it is shown changes. Set a least size you can still read from across a room, 14 at the smallest on a 1080p screen. What does not fit even then runs past its box, unless you also turn on the cut, which ends it in an ellipsis.
9. Finish#
- Show the safe bands with View › Safe Areas and look at all four corners.
- Run a check. Open the command field with ⌘K and find Check design, or ask an agent to run
check_designon the frame. It reports text that is hard to read against what is behind it, and layers cut off by their frame. - Export the clusters, not the screen: see Export for a game engine.