Manually add an item to the uploading queue.
Object to add to the queue
Instance of plugin for chaining.
Destroys the plugin, don't use after this.
Actually prepare items. This is handled outside of the tick because it will take a while and we do NOT want to block the current animation frame from rendering.
Adds hooks for finding items.
Function call that takes two parameters: item:*, queue:Array
function must return true
if it was able to add item to the queue.
Instance of plugin for chaining.
Adds hooks for uploading items.
Function call that takes two parameters: prepare:CanvasPrepare, item:*
and
function must return true
if it was able to handle upload of item.
Instance of plugin for chaining.
Handle tick update
Upload all the textures and graphics to the GPU.
-
Either the container or display object to search for items to upload, the items to upload themselves,
or the callback function, if items have been added using prepare.add
.
Generated using TypeDoc
The prepare plugin provides renderer-specific plugins for pre-rendering DisplayObjects. These plugins are useful for asynchronously preparing and uploading to the GPU assets, textures, graphics waiting to be displayed.
Do not instantiate this plugin directly. It is available from the
renderer.plugins
property. See {@link PIXI.CanvasRenderer#plugins} or {@link PIXI.Renderer#plugins}.// Create a new application const app = new PIXI.Application(); document.body.appendChild(app.view);
// Don't start rendering right away app.stop();
// create a display object const rect = new PIXI.Graphics() .beginFill(0x00ff00) .drawRect(40, 40, 200, 200);
// Add to the stage app.stage.addChild(rect);
// Don't start rendering until the graphic is uploaded to the GPU app.renderer.plugins.prepare.upload(app.stage, () => { app.start(); });
PIXI