Skip to main content
Version: Phaser v3.88.2

Types.Create

GenerateTextureCallback

<static> GenerateTextureCallback

Type: function

Member of: Phaser.Types.Create

Source: src/create/typedefs/GenerateTextureConfig.js#L1
Since: 3.0.0


GenerateTextureConfig

<static> GenerateTextureConfig

nametypeoptionaldefaultdescription
dataarrayYes"[]"An array of data, where each row is a string of single values 0-9A-F, or the period character.
canvasHTMLCanvasElementYesnullThe HTML Canvas to draw the texture to.
palettePhaser.Types.Create.PaletteYes"Arne16"The indexed palette that the data cell values map to.
pixelWidthnumberYes1The width of each 'pixel' in the generated texture.
pixelHeightnumberYes1The height of each 'pixel' in the generated texture.
resizeCanvasbooleanYestrueShould the canvas be resized before the texture is drawn?
clearCanvasbooleanYestrueShould the canvas be cleared before the texture is drawn?
preRenderPhaser.Types.Create.GenerateTextureCallbackYesA callback to send the canvas to prior to the texture being drawn.
postRenderPhaser.Types.Create.GenerateTextureCallbackYesA callback to send the canvas to after the texture has been drawn.

Type: object

Member of: Phaser.Types.Create

Source: src/create/typedefs/GenerateTextureConfig.js#L9
Since: 3.0.0


Palette

<static> Palette

nametypeoptionaldescription
0stringNoColor value 1.
1stringNoColor value 2.
2stringNoColor value 3.
3stringNoColor value 4.
4stringNoColor value 5.
5stringNoColor value 6.
6stringNoColor value 7.
7stringNoColor value 8.
8stringNoColor value 9.
9stringNoColor value 10.
AstringNoColor value 11.
BstringNoColor value 12.
CstringNoColor value 13.
DstringNoColor value 14.
EstringNoColor value 15.
FstringNoColor value 16.

Type: object

Member of: Phaser.Types.Create

Source: src/create/typedefs/Palette.js#L1
Since: 3.0.0