UI Fundamentals
Adding UI to your game requires writing code, but with the help of AI it's substantially easier to make sophisticated interactive UIs
Step 1: Create a UI Entry Point
Player :: class : Player_Base {
ao_late_update :: method(dt: float) {
if this->is_local_or_server() {
draw_ui(this);
}
}
}Step 2: Start From a Screen Rect
draw_ui :: proc(player: Player) {
screen := UI.get_safe_screen_rect();
// A simple centered panel
panel := screen->center_rect()->grow(120, 200, 120, 200);
UI.quad(panel, core_globals.white_sprite, {0, 0, 0, 0.7});
}Step 3: Use Cut For Layout
Step 4: Add Text
Step 5: Add Buttons
Step 6: Build a Dialog
Last updated