screenshot.capture
Overview
- Requests an engine screenshot and returns the exact absolute path, directory and filename the engine will write to. The path is authoritative, not a guess: the engine resolves the final filename at request time. OFFSCREEN-SAFE: this is a GPU read-back of the game's own render target, not a desktop grab, so it works while the game window is fully covered by other windows, unfocused, or moved off-screen — you do not need to bring the game to the foreground. SLOW AND DELAYED: nothing is on disk when this command returns. The file is only written when the engine renders and presents its next frame, so expect at least one frame of latency, and much longer (seconds) while a loading screen is up, while the window is minimised, or when the game thread is blocked by a map load. Poll screenshot.get_last until saved == true before reading the file. Only one request can be pending engine-wide; this fails if one is already in flight, or if Photo Mode currently owns the capture delegate (in that case the engine would write no file at all). Call system.get_paths for the directory these files land in.
Metadata
| Field | Value |
|---|---|
| Display | Capture Screenshot |
| Category | screenshot |
| Access | Public |
| Scope | B1Standalone |
| Tags | Experimental |
| Aliases | — |
Parameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
| filename | string | no | — | Optional target name. A bare name (no slash) lands in the engine screenshot directory reported by system.get_paths as screenshot_dir; a name containing a slash is used as the path as-is. The .png extension is added automatically. Defaults to 'ScreenShot'. |
| show_ui | bool | no | true | true (default): capture the whole window including the game UI via the Slate widget tree. false: capture only the 3D scene viewport, with UI and on-screen debug messages suppressed. |
| unique_suffix | bool | no | true | true (default): append an auto-incrementing index so an existing file is never overwritten. false: write exactly the given filename, overwriting any existing file. |
Usage
await inzoi.cli.execute('screenshot.capture', {
filename: '', // optional
show_ui: true, // optional
unique_suffix: true, // optional
});