Phaser API Documentation

  Version: 
<static> create2D(parent, [width], [height])

Description:

Creates a new Canvas DOM element, or pulls one from the pool if free.

Parameters:

name type arguments Default description
parent *

The parent of the Canvas object.

width number <optional> 1

The width of the Canvas.

height number <optional> 1

The height of the Canvas.

Returns:
Description:

The created canvas.

Type:
  • HTMLCanvasElement
Examples:
Since: 3.0.0