The base texture source to create the texture from
The frame specifies the region of the base texture that this texture uses.
Please call updateUvs()
after you change coordinates of frame
manually.
The frame specifies the region of the base texture that this texture uses.
Please call updateUvs()
after you change coordinates of frame
manually.
The height of the Texture in pixels.
Returns resolution of baseTexture
Indicates 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 PIXI.groupD8 for explanation
Indicates 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 PIXI.groupD8 for explanation
The width of the Texture in pixels.
Utility function for BaseTexture|Texture cast
Destroys this texture
Calls each of the listeners registered for a given event.
Return an array listing the events for which the emitter has registered listeners.
Return the number of listeners listening to a given event.
Return the listeners registered for a given event.
Add a listener for a given event.
Called when the base texture is updated
The base texture.
Add a one-time listener for a given event.
Remove all listeners, or those of the specified event.
Remove the listeners of a given event.
Updates this texture on the gpu.
Calls the TextureResource update.
If you adjusted frame
manually, please call updateUvs()
instead.
Updates the internal WebGL UV cache. Use it after you change frame
or trim
of the texture.
Call it after changing the frame
Helper function that creates a new Texture based on the source you provide. The source can be - frame id, image url, video url, canvas element, video element, base texture
- Source to create texture from
The newly created texture
Create a new Texture with a BufferResource from a Float32Array. RGBA values are floats from 0 to 1.
The optional array to use, if no data is provided, a new Float32Array is created.
Width of the resource
Height of the resource
The resulting new BaseTexture
Create a texture from a source and add to the cache.
The input source.
File name of texture, for cache and resolving resolution.
Output texture
Useful for loading textures via URLs. Use instead of Texture.from
because
it does a better job of handling failed URLs more effectively. This also ignores
PIXI.settings.STRICT_TEXTURE_CACHE
. Works for Videos, SVGs, Images.
The remote URL to load.
A Promise that resolves to a Texture.
Generated using TypeDoc
A texture stores the information that represents an image or part of an image.
It cannot be added to the display list directly; instead use it as the texture for a Sprite. If no frame is provided for a texture, then the whole image is used.
You can directly create a texture from an image and then reuse it multiple times like this :
If you didnt pass the texture frame to constructor, it enables
noFrame
mode: it subscribes on baseTexture events, it automatically resizes at the same time as baseTexture.Textures made from SVGs, loaded or not, cannot be used before the file finishes processing. You can check for this by checking the sprite's _textureID property.
You can use a ticker or rAF to ensure your sprites load the finished textures after processing. See issue #3068.
PIXI