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) → {}
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 |
The Canvas object that belongs to this CanvasRenderTarget. |
CanvasRenderingContext2D |
A CanvasRenderingContext2D object representing a two-dimensional rendering context. |
number |
|
number |
|
number |
|
Methods from CanvasRenderTarget
void |
Destroys this canvas. |
void |
|
Public Properties
canvas: HTMLCanvasElement
The Canvas object that belongs to this CanvasRenderTarget.
context: CanvasRenderingContext2D
A CanvasRenderingContext2D object representing a two-dimensional rendering context.
resolution: number = 1
The resolution / device pixel ratio of the canvas
Public Methods
destroy() → {void}
Destroys this canvas.
Type | Description |
---|---|
void |
resize(desiredWidth: number, desiredHeight: number) → {void}
Resizes the canvas to the specified width and height.
Name | Type | Description |
---|---|---|
desiredWidth | number |
the desired width of the canvas |
desiredHeight | number |
the desired height of the canvas |
Type | Description |
---|---|
void |