Interface: IOffscreenRenderer
Renders the current scene through a camera into an offscreen buffer instead of the screen — thumbnails, previews, screenshots. Uses the same nodes and drawables as the on-screen frame (whatever the render systems last pushed), so the caller makes sure the scene has been rendered at least once in the state it wants captured. The camera's cullingMask selects what is drawn; its viewport fields are ignored (the buffer is the viewport).
Methods
RenderToCanvas()
ts
RenderToCanvas(
config,
width,
height
): HTMLCanvasElement | null;A new canvas of width × height pixels with the view drawn into it, or null when the backend can't render right now.
Parameters
| Parameter | Type |
|---|---|
config | CameraConfig |
width | number |
height | number |
Returns
HTMLCanvasElement | null
TextureToCanvas()
ts
TextureToCanvas(assetId): HTMLCanvasElement | null;A copy of a loaded texture asset's current pixels (a render texture's last pass, say), or null when it isn't loaded.
Parameters
| Parameter | Type |
|---|---|
assetId | string |
Returns
HTMLCanvasElement | null