Phaser API Documentation

  Version: 
Filter
Namespace: Textures
Phaser.Types.Textures

Type Definitions

PixelConfig
Focus
Focus

Description:

An object containing the position and color data for a single pixel in a CanvasTexture.

Properties:
name type description
x number

The x-coordinate of the pixel.

y number

The y-coordinate of the pixel.

color number

The color of the pixel, not including the alpha channel.

alpha number

The alpha of the pixel, between 0 and 1.

Type:
object
Since: 3.16.0
Focus
Focus
SpriteSheetConfig
Focus
Focus
Properties:
name type arguments Default description
frameWidth number

The fixed width of each frame.

frameHeight number <optional>

The fixed height of each frame. If not set it will use the frameWidth as the height.

startFrame number <optional> 0

Skip a number of frames. Useful when there are multiple sprite sheets in one Texture.

endFrame number <optional> -1

The total number of frames to extract from the Sprite Sheet. The default value of -1 means "extract all frames".

margin number <optional> 0

If the frames have been drawn with a margin, specify the amount here.

spacing number <optional> 0

If the frames have been drawn with spacing between them, specify the amount here.

Type:
object
Since: 3.0.0
Focus
Focus
SpriteSheetFromAtlasConfig
Focus
Focus
Properties:
name type arguments Default description
atlas string

The key of the Texture Atlas in which this Sprite Sheet can be found.

frame string

The key of the Texture Atlas Frame in which this Sprite Sheet can be found.

frameWidth number

The fixed width of each frame.

frameHeight number <optional>

The fixed height of each frame. If not set it will use the frameWidth as the height.

startFrame number <optional> 0

Skip a number of frames. Useful when there are multiple sprite sheets in one Texture.

endFrame number <optional> -1

The total number of frames to extract from the Sprite Sheet. The default value of -1 means "extract all frames".

margin number <optional> 0

If the frames have been drawn with a margin, specify the amount here.

spacing number <optional> 0

If the frames have been drawn with spacing between them, specify the amount here.

Type:
object
Focus
Focus