Classes
Namespaces
Members
-
Event emitter for all sound events. This emits a single
play
event which contains the alias, loop and MovieClip which is playing the sound.Example
PIXI.animate.sound.on('play', (alias, loop, context) => { // custom handle sounds being played // where 'alias' is the ID in stage assets });
Methods
-
PIXI.animate.load (options)PIXI.loaders.Loader static
-
Load the stage class and preload any assets
Name Type Description options
Object Options for loading.
Name Type Description stage
function Reference to the stage class
Name Type Description assets
Object optional Assets used to preload
parent
PIXI.Container The Container to auto-add the stage to.
basePath
String optional Base root directory
createInstance
boolean optional enable or disable automatic instantiation of stage
Returns:
Type Description PIXI.loaders.Loader instance of PIXI resource loader -
PIXI.animate.load (StageRef, complete)PIXI.loaders.Loader static
-
Load the stage class and preload any assets
let renderer = new PIXI.autoDetectRenderer(1280, 720); let stage = new PIXI.Container(); PIXI.animate.load(lib.MyStage, function(instance){ stage.addChild(instance); }); function update() { renderer.render(stage); update(); } update();
Name Type Description StageRef
function Reference to the stage class.
Name Type Description assets
Object optional Assets used to preload.
complete
function The callback function when complete.
Returns:
Type Description PIXI.loaders.Loader instance of PIXI resource loader -
PIXI.animate.load (StageRef, parent, basePath)PIXI.loaders.Loader static
-
Load the stage class and preload any assets
let renderer = new PIXI.autoDetectRenderer(1280, 720); let stage = new PIXI.Container(); PIXI.animate.load(lib.MyStage, stage); function update() { renderer.render(stage); update(); } update();
Name Type Description StageRef
function Reference to the stage class.
Name Type Description assets
Object optional Assets used to preload.
parent
PIXI.Container The Container to auto-add the stage to.
basePath
String optional Base root directory
Returns:
Type Description PIXI.loaders.Loader instance of PIXI resource loader -
PIXI.animate.load (StageRef, parent, complete, basePath, loader, metadata)PIXI.loaders.Loader static
-
Load the stage class and preload any assets
let basePath = "file:/path/to/assets"; let renderer = new PIXI.autoDetectRenderer(1280, 720); let extensions = PIXI.compressedTextures.detectExtensions(renderer); let loader = new PIXI.loaders.Loader(); // this is an example of setting up a pre loader plugin to handle compressed textures in this case loader.pre(PIXI.compressedTextures.extensionChooser(extensions)); // specify metadata this way if you want to provide a default loading strategy for all assets listed in the PIXI animation let metadata = { default: { metadata: { imageMetadata: { choice: [".crn"] } } } }; // specify metadata this way if you want to provide a specific loading strategy for a certain asset listed inside the PIXI animation library let metadata = { MyStage_atlas_1: { metadata: { imageMetadata: { choice: [".crn"] } } } }; let stage = new PIXI.Container(); PIXI.animate.load(lib.MyStage, stage, ()=>{}, basePath, loader, metadata); function update() { renderer.render(stage); update(); } update();
Name Type Description StageRef
function Reference to the stage class.
Name Type Description assets
Object optional Assets used to preload.
parent
PIXI.Container The Container to auto-add the stage to.
complete
function optional The callback function when complete.
basePath
String optional Base root directory
loader
PIXI.loaders.Loader optional A Pixi loader object
metadata
Object optional A metadata object for the asset being loaded
Returns:
Type Description PIXI.loaders.Loader instance of PIXI resource loader