The base texture object that this texture uses.
Optional
frame: RectangleThe rectangle frame of the texture to show.
This 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)
The base texture that this texture uses.
Anchor 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.
{0,0}
Optional
defaultDefault width of the non-scalable border that is used if 9-slice plane is created with this texture.
7.2.0
PIXI.NineSlicePlane
Readonly
destroyedHas the texture been destroyed?
Readonly
filterStores sourceFrame
when this texture is inside current filter stack.
You can read it inside filters.
The key for pooled texture of FilterSystem.
PIXI.RenderTexturePool
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.
Any assignment of frame
switches off noFrame
mode.
texture.on('update', () => {});
This is the area of original texture, before it was put in atlas.
The ids under which this Texture has been added to the texture cache. This is automatically set as long as Texture.addToCache is used, but may not be set if a Texture is added directly to the TextureCache array.
This is the trimmed area of original texture, before it was put in atlas
Please call updateUvs()
after you change coordinates of trim
manually.
Default TextureMatrix instance for this texture. By default, that object is not created because its heavy.
This will let the renderer know if the texture is valid. If it's not then it cannot be rendered.
Static
prefixedShortcut to this.baseTexture.framebuffer
, saves baseTexture cast.
The height of the Texture in pixels.
Shortcut to this.framebuffer.multisample
.
PIXI.MSAA_QUALITY.NONE
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
The width of the Texture in pixels.
Static
EMPTYStatic
WHITEA white texture of 16x16 size, used for graphics and other things Can not be destroyed.
Utility function for BaseTexture|Texture cast.
Resizes the RenderTexture.
The desired width to resize to.
The desired height to resize to.
Optional
resizeBaseTexture: booleanShould the baseTexture.width and height values be resized as well?
Static
addStatic
createA short hand way of creating a render texture.
Optional
options: IBaseTextureOptions<any>Options
The new render texture
Static
fromHelper 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 or array of sources to create texture from
Optional
options: IBaseTextureOptions<RO>See PIXI.BaseTexture's constructor for options.
Optional
strict: booleanEnforce strict-mode, see PIXI.settings.STRICT_TEXTURE_CACHE.
The newly created texture
Static
fromCreate a new Texture with a BufferResource from a typed array.
The optional array to use. If no data is provided, a new Float32Array is created.
Width of the resource
Height of the resource
Optional
options: IBaseTextureOptions<IBufferResourceOptions>See PIXI.BaseTexture's constructor for options. Default properties are different from the constructor's defaults.
Static
fromCreate a texture from a source and add to the cache.
The input source.
File name of texture, for cache and resolving resolution.
Optional
name: stringHuman readable name for the texture cache. If no name is
specified, only imageUrl
will be used as the cache ID.
Optional
options: IBaseTextureOptions<any>Static
fromURLUseful 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 or array of URLs to load.
Optional
options: IBaseTextureOptions<RO>Optional options to include
Static
removeGenerated 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:
Example
Memberof
PIXI