Add the UI demo: title menu, raw-CLAY options screen, HUD and dialog
examples/uidemo is the program the UI chapter quotes. Three screens, three ways of building an interface: the title screen is one akgl_UiMenu plus a heading label; the options screen is written in raw CLAY() declarations -- hover highlighting inside the declaration, clicks paired with the application's own press edge -- because the widgets are a convenience, not a boundary; and the play screen is two HUD labels and the one-call dialog over a checkerboard standing in for a game world. No tilemap, no actors, no physics: everything left on screen is the subject. Its route_event() is the documented call-order contract in the flesh -- UI first, consumed events stop there, then the current screen's keys -- and the screen routing is the focus model, stated rather than invented. The headless smoke run (example_uidemo, --frames 240 --demo) tours every path through the real event chain: a mouse click on the centred menu (the consumed path, landing on the middle row by symmetry), keyboard into and out of the options screen, the dialog opened and dismissed, and Quit confirmed from the menu. The run prints its score and settings so a pass can be read, not just counted. docs_game_figures gains a uidemo frame -- the play screen with the dialog up -- for the chapter to come. Co-Authored-By: Claude Code (Claude Fable 5, claude-fable-5) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KzBDV2fqgnUAcqCKqKvc71 Co-Authored-By: Andrew Kesterson <andrew@aklabs.net>
This commit is contained in:
@@ -861,7 +861,15 @@ if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/examples/CMakeLists.txt")
|
||||
--demo --frames 240
|
||||
--screenshot "${CMAKE_CURRENT_SOURCE_DIR}/docs/images/jrpg.png"
|
||||
--screenshot-frame 230
|
||||
DEPENDS sidescroller jrpg
|
||||
# Frame 100 of the UI demo's scripted tour is the play screen with the
|
||||
# dialog up and the score mid-count -- all three widgets in one frame.
|
||||
COMMAND ${CMAKE_COMMAND} -E env
|
||||
SDL_VIDEODRIVER=dummy SDL_RENDER_DRIVER=software SDL_AUDIODRIVER=dummy
|
||||
$<TARGET_FILE:uidemo>
|
||||
--demo --frames 240
|
||||
--screenshot "${CMAKE_CURRENT_SOURCE_DIR}/docs/images/uidemo.png"
|
||||
--screenshot-frame 100
|
||||
DEPENDS sidescroller jrpg uidemo
|
||||
COMMENT "Regenerating the tutorial figures in docs/images"
|
||||
VERBATIM
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user