The base texture object that this texture uses
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.
Shortcut to this.baseTexture.framebuffer
, saves baseTexture cast.
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.
Resizes the RenderTexture.
The width to resize to.
The height to resize to.
Changes the resolution of baseTexture, but does not change framebuffer size.
The new resolution to apply to RenderTexture
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
Use the object-based construction instead.
A short hand way of creating a render texture.
The new render texture
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 RenderTexture is a special texture that allows any PixiJS display object to be rendered to it.
Hint: All DisplayObjects (i.e. Sprites) that render to a RenderTexture should be preloaded otherwise black rectangles will be drawn instead.
Hint-2: The actual memory allocation will happen on first render. You shouldn't create renderTextures each frame just to delete them after, try to reuse them.
A RenderTexture takes a snapshot of any Display Object given to its render method. For example:
Note that you should not create a new renderer, but reuse the same one as the rest of the application.
The Sprite in this case will be rendered using its local transform. To render this sprite at 0,0 you can clear the transform
PIXI