UI module

write_screenshot

procedure · 1 overloadsince 0.31.0Source

Draw the UI's last frame offscreen and write it to path as a PNG. Needs a GPU; build the UI with system_fonts for readable text. Returns false when there is no adapter or the file cannot be written.

write_screenshot :: (ui: *UI_State, path: string) -> bool

Draw the UI's last frame offscreen and write it to path as a PNG. Needs a GPU; build the UI with system_fonts for readable text. Returns false when there is no adapter or the file cannot be written.

Parameters

ui: *UI_State
the UI whose last frame to draw.
path: string
where to write the PNG.

Returns

bool

See also