Class ScreenshotTools
Hierarchy
- ScreenshotTools
Index
Methods
Static Create ScreenshotSearch playground for CreateScreenshot
-
Captures a screenshot of the current rendering
Parameters
-
engine: Engine
defines the rendering engine
-
camera: Camera
defines the source camera
-
size: IScreenshotSize | number
This parameter can be set to a single number or to an object with the following (optional) properties: precision, width, height. If a single number is passed, it will be used for both width and height. If an object is passed, the screenshot size will be derived from the parameters. The precision property is a multiplier allowing rendering at a higher or lower resolution
-
Optional successCallback: (data: string) => void
defines the callback receives a single parameter which contains the screenshot as a string of base64-encoded characters. This string can be assigned to the src parameter of an to display it
-
-
Parameters
-
data: string
Returns void
-
-
-
-
Optional mimeType: string
defines the MIME type of the screenshot image (default: image/png). Check your browser for supported MIME types
-
Optional forceDownload: boolean
force the system to download the image even if a successCallback is provided
Returns void
-
Static Create Screenshot AsyncSearch playground for CreateScreenshotAsync
-
Captures a screenshot of the current rendering
Parameters
-
engine: Engine
defines the rendering engine
-
camera: Camera
defines the source camera
-
size: any
This parameter can be set to a single number or to an object with the following (optional) properties: precision, width, height. If a single number is passed, it will be used for both width and height. If an object is passed, the screenshot size will be derived from the parameters. The precision property is a multiplier allowing rendering at a higher or lower resolution
-
Optional mimeType: string
defines the MIME type of the screenshot image (default: image/png). Check your browser for supported MIME types
Returns Promise<string>
screenshot as a string of base64-encoded characters. This string can be assigned to the src parameter of an to display it
-
Static Create Screenshot Using Render TargetSearch playground for CreateScreenshotUsingRenderTarget
-
Generates an image screenshot from the specified camera.
Parameters
-
engine: Engine
The engine to use for rendering
-
camera: Camera
The camera to use for rendering
-
size: IScreenshotSize | number
This parameter can be set to a single number or to an object with the following (optional) properties: precision, width, height. If a single number is passed, it will be used for both width and height. If an object is passed, the screenshot size will be derived from the parameters. The precision property is a multiplier allowing rendering at a higher or lower resolution
-
Optional successCallback: (data: string) => void
The callback receives a single parameter which contains the screenshot as a string of base64-encoded characters. This string can be assigned to the src parameter of an to display it
-
-
Parameters
-
data: string
Returns void
-
-
-
-
Optional mimeType: string
The MIME type of the screenshot image (default: image/png). Check your browser for supported MIME types
-
Optional samples: number
Texture samples (default: 1)
-
Optional antialiasing: boolean
Whether antialiasing should be turned on or not (default: false)
-
Optional fileName: string
A name for for the downloaded file.
-
Optional renderSprites: boolean
Whether the sprites should be rendered or not (default: false)
-
Optional enableStencilBuffer: boolean
Whether the stencil buffer should be enabled or not (default: false)
Returns void
-
Static Create Screenshot Using Render Target AsyncSearch playground for CreateScreenshotUsingRenderTargetAsync
-
Generates an image screenshot from the specified camera.
Parameters
-
engine: Engine
The engine to use for rendering
-
camera: Camera
The camera to use for rendering
-
size: any
This parameter can be set to a single number or to an object with the following (optional) properties: precision, width, height. If a single number is passed, it will be used for both width and height. If an object is passed, the screenshot size will be derived from the parameters. The precision property is a multiplier allowing rendering at a higher or lower resolution
-
Optional mimeType: string
The MIME type of the screenshot image (default: image/png). Check your browser for supported MIME types
-
Optional samples: number
Texture samples (default: 1)
-
Optional antialiasing: boolean
Whether antialiasing should be turned on or not (default: false)
-
Optional fileName: string
A name for for the downloaded file.
-
Optional renderSprites: boolean
Whether the sprites should be rendered or not (default: false)
Returns Promise<string>
screenshot as a string of base64-encoded characters. This string can be assigned to the src parameter of an to display it
-
Static Create Screenshot With Resize AsyncSearch playground for CreateScreenshotWithResizeAsync
-
Captures a screenshot of the current rendering for a specific size. This will render the entire canvas but will generate a blink (due to canvas resize)
Parameters
-
engine: Engine
defines the rendering engine
-
camera: Camera
defines the source camera
-
width: number
defines the expected width
-
height: number
defines the expected height
-
Optional mimeType: string
defines the MIME type of the screenshot image (default: image/png). Check your browser for supported MIME types
Returns Promise<void>
screenshot as a string of base64-encoded characters. This string can be assigned to the src parameter of an to display it
-
Class containing a set of static utilities functions for screenshots