Advanced
Options for the texture
Optional
Readonly
defaultAnchor point that is used as default if sprite is created with this texture.
Changing the defaultAnchor
at a later point of time will not update Sprite's anchor point.
Optional
Readonly
defaultDefault width of the non-scalable border that is used if 9-slice plane is created with this texture.
Readonly
destroyedHas the texture been destroyed?
Set to true if you plan on modifying the uvs of this texture. When this is the case, sprites and other objects using the texture will make sure to listen for changes to the uvs and update their vertices accordingly.
Readonly
frameThis is the area of the BaseTexture image to actually copy to the Canvas / WebGL when rendering, irrespective of the actual frame size or placement (which can be influenced by trimmed texture atlases)
Readonly
isis it a texture? yes! used for type checking
Optional
labellabel used for debugging
Does this Texture have any frame data assigned to it?
This mode is enabled automatically if no frame was passed inside constructor.
In this mode texture is subscribed to baseTexture events, and fires update
on any change.
Beware, after loading or resize of baseTexture event can fired two times! If you want more control, subscribe on baseTexture itself.
Readonly
origThis is the area of original texture, before it was put in atlas.
Readonly
rotateIndicates whether the texture is rotated inside the atlas set to 2 to compensate for texture packer rotation set to 6 to compensate for spine packer rotation can be used to rotate or mirror sprites See groupD8 for explanation
Readonly
trimThis is the trimmed area of original texture, before it was put in atlas
Please call updateUvs()
after you change coordinates of trim
manually.
Readonly
uidunique id for this texture
Readonly
uvsA uvs object based on the given frame and the texture source
Static
EMPTYan Empty Texture used internally by the engine
Static
fromHelper function that creates a returns Texture based on the source you provide. The source should be loaded and ready to go. If not its best to grab the asset using Assets.
String or Source to create texture from
Optional
skipCache: booleanSkip adding the texture to the cache
The texture based on the Id provided
Static
WHITEa White texture used internally by the engine
The height of the Texture in pixels.
the underlying source of the texture (equivalent of baseTexture in v7)
returns a TextureMatrix instance for this texture. By default, that object is not created because its heavy.
The width of the Texture in pixels.
Destroys this texture
Destroy the source when the texture is destroyed.
Resizes the render texture.
The new width of the render texture.
The new height of the render texture.
Optional
resolution: numberThe new resolution of the render texture.
This texture.
Call this if you have modified the texture outside
of the constructor.
If you have modified this texture's source, you must separately call texture.source.update()
to see those changes.
Call this function when you have modified the frame of this texture.
Static
create
A render texture, extends
Texture
.See
Texture