Class: CanvasBuffer

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:
src/pixi/renderers/canvas/utils/CanvasBuffer.js line 13

Members

canvas : HTMLCanvasElement

The Canvas object that belongs to this CanvasBuffer.

Type:
  • HTMLCanvasElement
Source:
src/pixi/renderers/canvas/utils/CanvasBuffer.js line 37

context : CanvasRenderingContext2D

A CanvasRenderingContext2D object representing a two-dimensional rendering context.

Type:
  • CanvasRenderingContext2D
Source:
src/pixi/renderers/canvas/utils/CanvasBuffer.js line 45

height : Number

The height of the Canvas in pixels.

Type:
  • Number
Source:
src/pixi/renderers/canvas/utils/CanvasBuffer.js line 29

width : Number

The width of the Canvas in pixels.

Type:
  • Number
Source:
src/pixi/renderers/canvas/utils/CanvasBuffer.js line 21

Methods

destroy()

Frees the canvas up for use again.

Source:
src/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:
src/pixi/renderers/canvas/utils/CanvasBuffer.js line 65

phaser-ce@2.20.0 is on GitHub and NPM

Documentation generated by JSDoc 3.6.7 on 2022-12-10 using Tomorrow.