Skip to main content
Version: Phaser v4.0.0-rc.6

Types.Textures

CaptureConfig

<static> CaptureConfig

Configuration object for the DynamicTexture.capture method.

nametypeoptionaldefaultdescription
transform'local' | 'world'Phaser.GameObjects.Components.TransformMatrixYes"'world'"
cameraPhaser.Cameras.Scene2D.CameraYesThe Camera to use when rendering the GameObject to the DynamicTexture. If not specified, uses the DynamicTexture's own camera.
xnumberYesThe x position.
ynumberYesThe y position.
alphanumberYesThe alpha value.
tintnumberYesThe tint color value. WebGL only.
anglenumberYesThe angle in degrees. Rotation takes place around its origin. If angle is non-zero, rotation is ignored.
rotationnumberYesThe rotation in radians. Rotation takes place around its origin.
scalenumberYesSets both the horizontal and vertical scale with a single value.
scaleXnumberYesSet the horizontal scale. Overrides the scale property, if provided.
scaleYnumberYesSet the vertical scale. Overrides the scale property, if provided.
originXnumberYesThe horizontal origin. 0 is the left, 0.5 is the center and 1 is the right.
originYnumberYesThe vertical origin. 0 is the top, 0.5 is the center and 1 is the bottom.
blendModestring | Phaser.BlendModesnumberYes

Type: object

Member of: Phaser.Types.Textures

Source: src/textures/typedefs/CaptureConfig.js#L1
Since: 4.0.0


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


RepeatConfig

<static> RepeatConfig

Configuration options for the DynamicTexture.repeat method.

nametypeoptionaldefaultdescription
tilePositionXnumberYes0The horizontal scroll position of the texture.
tilePositionYnumberYes0The vertical scroll position of the texture.
tileRotationnumberYes0The rotation of the texture.
tileScaleXnumberYes1The horizontal scale of the texture.
tileScaleYnumberYes1The vertical scale of the texture.

Type: object

Member of: Phaser.Types.Textures

Source: src/textures/typedefs/RepeatConfig.js#L1
Since: 4.0.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

Configuration object for the DynamicTexture.stamp method.

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. If angle is non-zero, rotation is ignored.
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

Type: object

Member of: Phaser.Types.Textures

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