Skip to main content
Version: Phaser v3.88.2

Types.Textures

CompressedTextureData

<static> CompressedTextureData

An object containing the dimensions and mipmap data for a Compressed Texture.

nametypeoptionaldescription
compressedbooleanNoIs this a compressed texture?
generateMipmapbooleanNoShould this texture have mipmaps generated?
widthnumberNoThe width of the maximum size of the texture.
heightnumberNoThe height of the maximum size of the texture.
internalFormatGLenumNoThe WebGL internal texture format.
mipmapsArray.<Phaser.Types.Textures.MipmapType>NoAn array of MipmapType objects.

Type: object

Member of: Phaser.Types.Textures

Source: src/textures/typedefs/CompressedTextureData.js#L1
Since: 3.60.0


MipmapType

<static> MipmapType

A Mipmap Data entry for a Compressed Texture.

nametypeoptionaldescription
widthnumberNoThe width of this level of the mipmap.
heightnumberNoThe height of this level of the mipmap.
dataUint8ArrayNoThe decoded pixel data.

Type: object

Member of: Phaser.Types.Textures

Source: src/textures/typedefs/MipmapType.js#L1
Since: 3.60.0


PixelConfig

<static> PixelConfig

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

nametypeoptionaldescription
xnumberNoThe x-coordinate of the pixel.
ynumberNoThe y-coordinate of the pixel.
colornumberNoThe color of the pixel, not including the alpha channel.
alphanumberNoThe alpha of the pixel, between 0 and 1.

Type: object

Member of: Phaser.Types.Textures

Source: src/textures/typedefs/PixelConfig.js#L1
Since: 3.16.0


SpriteSheetConfig

<static> SpriteSheetConfig

nametypeoptionaldefaultdescription
frameWidthnumberNoThe fixed width of each frame.
frameHeightnumberYesThe fixed height of each frame. If not set it will use the frameWidth as the height.
startFramenumberYes0Skip a number of frames. Useful when there are multiple sprite sheets in one Texture.
endFramenumberYes-1The total number of frames to extract from the Sprite Sheet. The default value of -1 means "extract all frames".
marginnumberYes0If the frames have been drawn with a margin, specify the amount here.
spacingnumberYes0If the frames have been drawn with spacing between them, specify the amount here.

Type: object

Member of: Phaser.Types.Textures

Source: src/textures/typedefs/SpriteSheetConfig.js#L1
Since: 3.0.0


SpriteSheetFromAtlasConfig

<static> SpriteSheetFromAtlasConfig

nametypeoptionaldefaultdescription
atlasstringNoThe key of the Texture Atlas in which this Sprite Sheet can be found.
framestringNoThe key of the Texture Atlas Frame in which this Sprite Sheet can be found.
frameWidthnumberNoThe fixed width of each frame.
frameHeightnumberYesThe fixed height of each frame. If not set it will use the frameWidth as the height.
startFramenumberYes0Skip a number of frames. Useful when there are multiple sprite sheets in one Texture.
endFramenumberYes-1The total number of frames to extract from the Sprite Sheet. The default value of -1 means "extract all frames".
marginnumberYes0If the frames have been drawn with a margin, specify the amount here.
spacingnumberYes0If the frames have been drawn with spacing between them, specify the amount here.

Type: object

Member of: Phaser.Types.Textures

Source: src/textures/typedefs/SpriteSheetFromAtlasConfig.js#L1
Since: 3.0.0


StampConfig

<static> StampConfig

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

nametypeoptionaldefaultdescription
alphanumberYes1The alpha value used by the stamp.
tintnumberYes"0xffffff"The tint color value used by the stamp. WebGL only.
anglenumberYes0The angle of the stamp in degrees. Rotation takes place around its origin.
rotationnumberYes0The rotation of the stamp in radians. Rotation takes place around its origin.
scalenumberYes1Sets both the horizontal and vertical scale of the stamp with a single value.
scaleXnumberYes1Set the horizontal scale of the stamp. Overrides the scale property, if provided.
scaleYnumberYes1Set the vertical scale of the stamp. Overrides the scale property, if provided.
originXnumberYes0.5The horizontal origin of the stamp. 0 is the left, 0.5 is the center and 1 is the right.
originYnumberYes0.5The vertical origin of the stamp. 0 is the top, 0.5 is the center and 1 is the bottom.
blendModestring | Phaser.BlendModesnumberYes0
erasebooleanYesfalseErase this stamp from the texture?
skipBatchbooleanYesfalseSkip beginning and ending a batch with this call. Use if this is part of a bigger batched draw.

Type: object

Member of: Phaser.Types.Textures

Source: src/textures/typedefs/StampConfig.js#L1
Since: 3.60.0