Whether the texture re-renders every frame; ContainerSourceOptions#autoUpdate has the details
Sets whether the texture re-renders every frame
true to re-render every frame.
The colour ContainerSourceOptions#clearColor describes; set it or change this one in place, then render again
Sets the colour the next render clears to
Any ColorSource, such as 'black'.
The ContainerSource behind this texture
The renderer kept for ContainerTexture#render calls with no argument, or null
Sets the kept renderer
A renderer, or null to release it.
The capture matrix ContainerSourceOptions#transform describes; change it or assign a new one, then render again
Sets the capture matrix, copying value
The new capture matrix.
Destroys this texture, and optionally its source and its container
As with pixi's Texture#destroy, destroy() leaves the ContainerSource alive,
since other textures may share it, and with ContainerTexture#autoUpdate on, still
rendering every frame. destroy(true) frees the source too. The container is yours unless you
pass { container: true }, which destroys it with its children and frees the source.
true also frees the source; an object picks source and container separately.
Optionalcontainer?: booleanAlso destroy the 2D container and its children, which frees the source too
Optionalsource?: booleanAlso free the ContainerSource and its render target
Draws the container into this texture
Call it before you render your scene, never from code that runs during a render. A renderer passed here is kept for later calls with no argument; with none passed or kept, it warns and draws nothing.
Optionalrenderer: Renderer
Renderer to draw with, kept for later calls; omit to use the kept one.
Swaps the Container this texture renders, keeping its render target and size
A container other than the current one leaves its parent, the old one is left detached, and the old picture stays until the next ContainerTexture#render.
The new container to render.
A Texture that shows a live 2D PixiJS Container
Use it in any material texture slot, on any geometry. To make several textures over one container, build a ContainerSource and create
Textures from it.Unless autoUpdate is on, nothing redraws it. Call ContainerTexture#render after setup and after each change, before you render your scene, or keep a renderer and set
autoUpdatefor animated content. Until its first render it's transparent black; arendereroption renders it once as it's made, unless firstRender isfalse.In an opaque material, the parts the container leaves empty draw black; clearColor says how to keep their edges smooth.
The picture is stored the other way up from an image texture. It shows upright where
vgrows upward, as on a default PlaneGeometry or a CubeGeometry's sides, and upside down where an image shows upright, as on a SphereGeometry, a plane withflipV, a loaded model or a 2DSprite. On a sprite,sprite.scale.y = -1withsprite.anchor.y = 1turns it over in place.Example