A library for bridging CreateJS animations from Flash for use in Pixi.js. Publish Flash content like you normally would for CreateJS (with an HTML5 Canvas document), but export for Pixi.js instead. While there are some known issues with this approach, it produces fast animation playback for WebGL and is superior to using Flash's WebGL document.
The animation in these games has been created and exported with PixiFlash.
Animated examples are from Fizzy's Lunch Lab and used with permission from Lunch Lab, LLC
Install the post-publish tool by running tools/install.jsfl. This provides some error checking when publishing for PIXI Flash, including error checking images and symbol namespaces.
To run content exported with PixiFlash, you must load the JavaScript library within your project. You can install using Bower or NPM:
bower install pixi-flash
npm install pixi-flash
Here's a example using PIXI where the images were assembled using TexturePacker. See the example folder for an example which uses the Flash SpriteSheet exporting.
var renderer = new PIXI.autoDetectRenderer(800, 500);
var stage = new PIXI.Container();
// Load the atlas for the character
var loader = new PIXI.loaders.Loader();
// This atlas is created with TexturePacker from the
// output individual images from Flash publishing
loader.add('CharacterAtlas',"CharacterAtlas.json");
loader.once('complete',function(loader, resources)
{
// Assign the atlas to global images in pixiflash_images
pixiflash.utils.addImages(resources.CharacterAtlas);
// Create the character, all library symbols live
// on the pixiflash_lib window object
var character = new pixiflash_lib.Character();
character.framerate = 30;
character.play();
// Add to stage
stage.addChild(character);
});
loader.load();
// Normal render
update();
function update()
{
requestAnimationFrame(update);
renderer.render(stage);
}
Copyright (c) 2015 CloudKid
Released under the MIT License.