Classes
Namespaces
Members
-
Event emitter for all sound events. This emits a single
playevent 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 optionsObject Options for loading.
Name Type Description stagefunction Reference to the stage class
Name Type Description assetsObject optional Assets used to preload
parentPIXI.Container The Container to auto-add the stage to.
basePathString optional Base root directory
createInstanceboolean 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 StageReffunction Reference to the stage class.
Name Type Description assetsObject optional Assets used to preload.
completefunction 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 StageReffunction Reference to the stage class.
Name Type Description assetsObject optional Assets used to preload.
parentPIXI.Container The Container to auto-add the stage to.
basePathString 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 StageReffunction Reference to the stage class.
Name Type Description assetsObject optional Assets used to preload.
parentPIXI.Container The Container to auto-add the stage to.
completefunction optional The callback function when complete.
basePathString optional Base root directory
loaderPIXI.loaders.Loader optional A Pixi loader object
metadataObject optional A metadata object for the asset being loaded
Returns:
Type Description PIXI.loaders.Loader instance of PIXI resource loader