Name | Type | Description |
---|---|---|
renderer |
PIXI.AbstractRenderer |
A reference to the current renderer |
Example
// Create a sprite
const sprite = PIXI.Sprite.from('something.png');
// Load object into GPU
app.renderer.plugins.prepare.upload(sprite, () => {
//Texture(s) has been uploaded to GPU
app.stage.addChild(sprite);
})
Members
limiter PIXI.CountLimiter | PIXI.TimeLimiter
The limiter to be used to control how quickly items are prepared.
renderer PIXI.AbstractRenderer protected
Reference to the renderer.
The only real difference between CanvasPrepare and Prepare is what they pass to upload hooks. That different parameter is stored here.
Methods
Manually add an item to the uploading queue.
Name | Type | Description |
---|---|---|
item |
PIXI.DisplayObject | PIXI.Container | PIXI.BaseTexture | PIXI.Texture | PIXI.Graphics | PIXI.Text | unknown |
Object to add to the queue |
Returns:
Type | Description |
---|---|
this | Instance of plugin for chaining. |
Destroys the plugin, don't use after this.
Adds hooks for finding items.
Name | Type | Description |
---|---|---|
addHook |
Function |
Function call that takes two parameters: |
Returns:
Type | Description |
---|---|
this | Instance of plugin for chaining. |
Adds hooks for uploading items.
Name | Type | Description |
---|---|---|
uploadHook |
Function |
Function call that takes two parameters: |
Returns:
Type | Description |
---|---|
this | Instance of plugin for chaining. |
Upload all the textures and graphics to the GPU.
Name | Type | Attributes | Description |
---|---|---|---|
item |
Function | PIXI.DisplayObject | PIXI.Container | PIXI.BaseTexture | PIXI.Texture | PIXI.Graphics | PIXI.Text |
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 |
|
done |
Function |
<optional> |
Optional callback when all queued uploads have completed |