core.engine.screenshot
Client
Captures a screenshot and saves it to the specified path
Syntax
local result = core.engine.screenshot(path)Prefix the path with :resourcename to save screenshots into another running resource.
- Local path — resolves relative to the current resource's directory.
- Cross-resource path — prefix with
:resourcenameto resolve relative to another running resource's directory. - Example —
:resource_a/screenshots/capture.pngsavesscreenshots/capture.pnginsideresource_a.
Parameters
| Type | Name | Description |
|---|---|---|
string | path | Destination file path to save the screenshot |
Returns
| Type | Name | Description |
|---|---|---|
bool | result | true on successful capture, false otherwise |
Examples
core.engine.screenshot("screenshots/capture.png")core.engine.screenshot("screenshots/capture_" .. core.engine.get_timestamp_tag() .. ".png")