Navigation
These archived docs are for Phaser 2.2.2 Phaser 3 docs can be found on newdocs.phaser.io.
Phaser CE docs can be found on the Phaser CE Documentation site.

Constructor

PIXI. CanvasBuffer

new CanvasBuffer(width, height)

Creates a Canvas element of the given size.

Parameters
Name Type Description
width Number

the width for the newly created canvas

height Number

the height for the newly created canvas

Source code: pixi/renderers/canvas/utils/CanvasBuffer.js, line 5

Public Properties

canvas :HTMLCanvasElement

The Canvas object that belongs to this CanvasBuffer.

Source code: pixi/renderers/canvas/utils/CanvasBuffer.js, line 31

context :CanvasRenderingContext2D

A CanvasRenderingContext2D object representing a two-dimensional rendering context.

Source code: pixi/renderers/canvas/utils/CanvasBuffer.js, line 39

height : number

The height of the Canvas in pixels.

Source code: pixi/renderers/canvas/utils/CanvasBuffer.js, line 23

width : number

The width of the Canvas in pixels.

Source code: pixi/renderers/canvas/utils/CanvasBuffer.js, line 15

Public Methods

resize(width, height)

Resizes the canvas to the specified width and height.

Parameters
Name Type Description
width Number

the new width of the canvas

height Number

the new height of the canvas

Source code: pixi/renderers/canvas/utils/CanvasBuffer.js, line 65