Class: CanvasRenderTarget


Creates a Canvas element of the given size to be used as a target for rendering to.

new PIXI.utils.CanvasRenderTarget (width, height, resolution)

Name Type Attributes Default Description
width number

the width for the newly created canvas

height number

the height for the newly created canvas

resolution number <optional>

The resolution / device pixel ratio of the canvas


canvas HTMLCanvasElement

The Canvas object that belongs to this CanvasRenderTarget.

context CanvasRenderingContext2D

A CanvasRenderingContext2D object representing a two-dimensional rendering context.

height number

The height of the canvas buffer in pixels.

width number

The width of the canvas buffer in pixels.


destroy () void

Destroys this canvas.

resize (width, height) void

Resizes the canvas to the specified width and height.

Name Type Description
width number

the new width of the canvas

height number

the new height of the canvas