Expand description
frame-png: renders a frame of a game in the test Harness to a PNG
without a window, for looking at a skin, a picture or a mockup. Never a
gate: snapshots stay text.
The command plays a Script of keys, controller buttons, actions by
name and waits in the game’s Harness (shuyi_platform::script‘s, the one
the live link and the capture plans play), which the game’s GameTools::frame starts with
the game’s own options, and writes the picture the game paints of it.
A game paints a frame with Painter, or, for a one-bit screen, with
the one-bit renderer and one_bit_picture. With --target <id>, a
target whose display is black and white gets the picture its device
shows (GameTools::frame_one_bit: the frame drawn in its roles’
patterns, ADR-0008 §4). With --debug <channels>, the debug view’s
channels are on from the start (a Step::Debug first in the script,
ADR-0085): the picture shows what a person sees with the view on.
Painter decodes a game’s font atlas and images from PNG and paints
with the raster, shuyi_ui::frame::raster: the reference picture of a
frame, which shuyi-app must match. Its module docs say what it draws.
Structs§
- Image
- An image’s pixels: four bytes each (red, green, blue, alpha), row by row from the top.
- Options
- The command’s arguments.
- Painter
- The raster’s
raster::Painter, with its font atlas and images decoded from PNG files, ready to render any number of frames (each image is decoded once). - Script
- Steps played in order.
- Shot
- What a game shows of a frame. Build it with
Shot::new(ADR-0039).
Enums§
- Step
- One step of a script, played in the order written.
Constants§
- MAX_
SCALE - Largest
--scale.
Functions§
- check
- Whether the Harness can play every step of
script: each step (Script::check), and waits of at mostMAX_WAITseconds. An error names the step. - decode_
image - Decodes PNG file
png. - one_
bit_ picture frameas a black and white picture, each pixelscale×scale.- parse_
args - Parses
frame-png’s arguments, the game’soptionsamong them, checking key and button names and waits up front (check) so a typo is an error, not a Harness panic. - parse_
step - Reads the script flag
flagwith its valuevalue, if it is one:--keys(or--script),--pad,--act,--waitor--crank. A step no player can play (Step::check) is an error, not a panic later. The longest wait is the player’s to check (the Harness’s withcheck), and an action’s name is looked up in the game’s keymap. - run
- Runs the command: the game plays the script and paints the frame, as
the display of
target(the profile ofOptions::target) shows it, which is written underroot(ifoutis relative); returns what to print. - usage
- The usage text, with
commandas the tool’s name and the game’s own options and notes.