Build a small HUD with known measurements
Use the following as a starting arrangement, not a required template. Begin with a transparent 1280 by 720 HUD. These elements use top-left unless another anchor is specified.
| Element | Type | X, Y | Width, Height |
|---|---|---|---|
| objective_label | Label | 20, 18 | 850, 48 |
| menu_button | Button | top-right: -20, 18 | 180, 48 |
| bottom_panel | Panel | 20, 580 | 1240, 120 |
| look_button | Button | 40, 602 | 115, 76 |
| use_button | Button | 170, 602 | 115, 76 |
| item_image | Image | 312, 599 | 80, 80 |
| score_label | Label | 420, 615 | 260, 46 |
| point_button | Button | 850, 610 | 170, 55 |
Set the panel's Z Index to 0 and the controls above it to 1. Give the buttons the texts Look, Use, Menu and Add a point. Use Text & Content to set the label text; the dynamic values are connected in Chapter 8.
Figure 9. The lower part of the example HUD during play. The panel supplies the backing; the controls remain separate elements.
Why the panel goes behind the controls#
A panel is useful for a shared background. Ordinary controls are not automatically children of that panel just because they overlap it. Use their own positions, and group them when you want to move the arrangement together.
Keep Preview off while building the layout. If a click operates a control instead of selecting or dragging it, switch back to editing mode.
