Phaser API Documentation

  Version: 
Filter
This is a beta release of our new docs system. Found an issue?
Please tell us about it in the #📖-newdocs-feedback channel on the Phaser Discord
Namespace: Create
Phaser.Types.Create

Type Definitions

GenerateTextureCallback(canvas, context)
Focus
Focus

Parameters:

name type description
canvas HTMLCanvasElement

The HTML Canvas element to operate on.

context CanvasRenderingContext2D

The context of the HTML Canvas element.

Type:
function
Since: 3.0.0
Focus
Focus
GenerateTextureConfig
Focus
Focus
Properties:
name type arguments Default description
data array <optional> []

An array of data, where each row is a string of single values 0-9A-F, or the period character.

canvas HTMLCanvasElement <optional> null

The HTML Canvas to draw the texture to.

palette Phaser.Types.Create.Palette <optional> Arne16

The indexed palette that the data cell values map to.

pixelWidth number <optional> 1

The width of each 'pixel' in the generated texture.

pixelHeight number <optional> 1

The height of each 'pixel' in the generated texture.

resizeCanvas boolean <optional> true

Should the canvas be resized before the texture is drawn?

clearCanvas boolean <optional> true

Should the canvas be cleared before the texture is drawn?

preRender Phaser.Types.Create.GenerateTextureCallback <optional>

A callback to send the canvas to prior to the texture being drawn.

postRender Phaser.Types.Create.GenerateTextureCallback <optional>

A callback to send the canvas to after the texture has been drawn.

Type:
object
Since: 3.0.0
Focus
Focus
Palette
Focus
Focus
Properties:
name type description
0 string

Color value 1.

1 string

Color value 2.

2 string

Color value 3.

3 string

Color value 4.

4 string

Color value 5.

5 string

Color value 6.

6 string

Color value 7.

7 string

Color value 8.

8 string

Color value 9.

9 string

Color value 10.

A string

Color value 11.

B string

Color value 12.

C string

Color value 13.

D string

Color value 14.

E string

Color value 15.

F string

Color value 16.

Type:
object
Since: 3.0.0
Focus
Focus