Global number of the texture batch, used by multi-texture renderers
Pixel height of the source of this texture
Pixel width of the source of this texture
Refresh check for isPowerOfTwo texture based on size
Utility function for BaseTexture|Texture cast
Destroys this texture.
Frees the texture and framebuffer from WebGL memory without destroying this texture object. This means you can still use the texture later which will upload it to GPU memory again.
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.
Handle errors with resources.
Error event emitted.
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 BaseRenderTexture.
The width to resize to.
The height to resize to.
Sets real size of baseTexture, preserves current resolution.
Full rendered width
Full rendered height
this
Changes resolution
res
this
Sets the resource if it wasn't set. Throws error if resource already present
that is managing this BaseTexture
this
Changes w/h/resolution. Texture becomes valid if width and height are greater than zero.
Visual width
Visual height
this
Changes style options of BaseTexture
this
Invalidates the object. Texture becomes valid if width and height are greater than zero.
Adds a BaseTexture to the global BaseTextureCache. This cache is shared across the whole PIXI object.
The BaseTexture to add to the cache.
The id that the BaseTexture will be stored against.
Helper function that creates a base texture based on the source you provide. The source can be - image url, image element, canvas element. If the source is an image url or an image element and not in the base texture cache, it will be created and loaded.
The source to create base texture from.
The new base texture.
Create a new BaseTexture 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
Remove a BaseTexture from the global BaseTextureCache.
id of a BaseTexture to be removed, or a BaseTexture instance itself.
The BaseTexture that was removed.
Generated using TypeDoc
A BaseRenderTexture 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 BaseRenderTexture should be preloaded otherwise black rectangles will be drawn instead.
A BaseRenderTexture takes a snapshot of any Display Object given to its render method. The position and rotation of the given Display Objects is ignored. For example:
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