Navigation
These archived docs are for Phaser 2.4.4 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

destroy()

Frees the canvas up for use again.

Source code: pixi/renderers/canvas/utils/CanvasBuffer.js (Line 78)

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)