Skip to content

Documentation / spryte / RenderTarget

Class: RenderTarget ​

Defined in: target.ts:8

An offscreen image you draw into with draw.into(target, fn) and then draw like any image: post-processing, cached static layers, minimaps, trails. Size is in pixels.

On WebGL2 the contents live on the GPU and are lost if the context is lost: redraw them when draw.contextLost turns false again, or redraw every frame.

Constructors ​

Constructor ​

new RenderTarget(width, height): RenderTarget

Defined in: target.ts:9

Parameters ​

width ​

number

height ​

number

Returns ​

RenderTarget

Properties ​

height ​

readonly height: number

Defined in: target.ts:11


width ​

readonly width: number

Defined in: target.ts:10