PIXI.utils.CanvasRenderTarget

class CanvasRenderTarget

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

Constructor


new PIXI.utils.CanvasRenderTarget(width: number, height: number, resolution: number) → {}
Parameters:
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>

PIXI.settings.RESOLUTION

The resolution / device pixel ratio of the canvas

Summary


Properties from CanvasRenderTarget

HTMLCanvasElement
canvas

The Canvas object that belongs to this CanvasRenderTarget.

CanvasRenderingContext2D
context

A CanvasRenderingContext2D object representing a two-dimensional rendering context.

number
height
number
resolution = 1
number
width

Methods from CanvasRenderTarget

Public Properties


canvas CanvasRenderTarget.ts:10
canvas: HTMLCanvasElement

The Canvas object that belongs to this CanvasRenderTarget.

context CanvasRenderTarget.ts:13
context: CanvasRenderingContext2D

A CanvasRenderingContext2D object representing a two-dimensional rendering context.

height CanvasRenderTarget.ts:80
height: number

The height of the canvas buffer in pixels.

resolution CanvasRenderTarget.ts:16
resolution: number = 1

The resolution / device pixel ratio of the canvas

width CanvasRenderTarget.ts:66
width: number

The width of the canvas buffer in pixels.

Public Methods


destroy CanvasRenderTarget.ts:59
destroy() → {void}

Destroys this canvas.

Returns:
Type Description
void
resize CanvasRenderTarget.ts:48
resize(desiredWidth: number, desiredHeight: number) → {void}

Resizes the canvas to the specified width and height.

Parameters:
Name Type Description
desiredWidth number

the desired width of the canvas

desiredHeight number

the desired height of the canvas

Returns:
Type Description
void

Powered by webdoc!