1.3.5 • Published 3 years ago

pixi-animate v1.3.5

Weekly downloads
147
License
MIT
Repository
github
Last release
3 years ago

PIXI Animate

A plugin for Pixi.js which provides a runtime for content export using PixiAnimate Extension.

Build Status Dependency Status npm version

Running Content

Installing Library

To run content exported with PixiAnimate, you must load the JavaScript library within your project. You can install using Bower or NPM:

NPM

npm install pixi-animate

Dependencies

Documentation

https://pixijs.io/pixi-animate/

Breaking Changes from v1.3

  • DisplayObject, Container, Graphics, Sprite, and Text from PIXI are no longer modified. Instead, subclasses are provided from the library with the same names (or on the PIXI.animate namespace).
  • static extend() and e() methods no longer exist on the display object classes.
  • On Graphics, c() is no longer the shorthand for closePath(); instead, use cp().
  • On Graphics, drawHole() and h() no longer exist. Instead of making the previous shape a hole, use beginHole() (bh()) before drawing a hole and endHole() (eh()) when it is complete.
  • ShapesCache no longer exists.
  • The SymbolLoader plugin no longer exists, so individual images are no longer added to PIXI's global texture cache by resource name, and shape assets are no longer added to a global shape cache.

Using the legacy bundle file dist/pixi-animate-legacy.js (requires PIXI namespace to be set up) will restore the removed functionality so that assets published for the previous version of PixiAnimate will work correctly.

Changes that the legacy build doesn't account for:

  • load() no longer has so many variants allowed. Instead, the first argument is always the scene that you want to load, followed by either a callback or an options object. If using the legacy shim, pass in the constructor for the main scene MovieClip, as you did in v1.
  • createInstance now defaults to false, instead of true, when calling load().

Asset changes

The expected asset format is now a module based asset that uses ES6 classes, for use with require() (publish for CommonJS) or import() (publish for ES6). A script has been provided to update v1 assets to the new format - pixi-animate-upgrade (see bin/assetConversion.js for the source).

  • CommonJS export: npm run pixi-animate-upgrade path/to/myFile.js path/to/my2ndFile.js
    • Asset object is the main, and only, export.
    • Example: const asset = require('./myAsset');
  • ES6 export: npm run pixi-animate-upgrade -e path/to/myFile.js path/to/my2ndFile.js
    • Asset object is the default, and only, export.
    • Example: import asset from './myAsset' or const asset = await import('./myAsset');
  • ES6 autorun export: npm run pixi-animate-upgrade -a path/to/myFile.js path/to/my2ndFile.js
    • Asset automatically imports 'pixi-animate' and runs setup(). Individual library items are exported by name in addition to the default export.
    • Example: import asset, {MyScene} from './myAsset'

Note that this script will do its best to update graphics paths (*.shapes.json files), but you should confirm that they were properly updated (closePath & hole changes).

If you want to have a Typescript declaration specific to an individual asset file, use the pixi-animate-type-assets script to generate a .d.ts file. This script will work on any of the 3 variants of the current asset format. Example: npm run pixi-animate-type-assets path/to/myFile.js path/to/my2ndFile.js

Typescript

You can use require to get the namespace for PixiAnimate:

import animate = require('pixi-animate');

let myMC:animate.MovieClip = new animate.MovieClip();

Or use a triple slash reference for using the PIXI.animate namespace:

// Note: Must also include the pixi.js typings globally!
/// <reference path="node_modules/pixi-animate/dist/pixi-animate-ambient.d.ts" />
// In your HTML:
// <script src="node_modules/pixi-animate/dist/pixi-animate.d.ts"></script>

let myMC:PIXI.animate.MovieClip = new PIXI.animate.MovieClip();

License

Copyright (c) 2016 Jibo, Inc.

Released under the MIT License.

2.0.0-rc12

3 years ago

2.0.0-rc11

3 years ago

2.0.0-rc10

3 years ago

2.0.0-rc9

3 years ago

2.0.0-rc8

3 years ago

2.0.0-rc7

3 years ago

2.0.0-rc6

3 years ago

2.0.0-rc5

4 years ago

2.0.0-rc4

4 years ago

2.0.0-rc3

4 years ago

2.0.0-rc2

4 years ago

2.0.0-rc1

4 years ago

1.3.5

5 years ago

1.3.4

5 years ago

1.3.3

6 years ago

1.3.2

7 years ago

1.3.1

7 years ago

1.3.0

7 years ago

1.1.2

7 years ago

1.1.1

7 years ago

1.1.0

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago

0.7.4

7 years ago

0.7.3

8 years ago

0.7.2

8 years ago

0.7.1

8 years ago

0.7.0

8 years ago

0.6.2

8 years ago

0.6.1

8 years ago

0.6.0

8 years ago

0.5.6

8 years ago

0.5.5

8 years ago

0.5.4

8 years ago

0.5.3

8 years ago

0.5.2

8 years ago

0.5.2-alpha

8 years ago

0.5.1

8 years ago

0.5.0

8 years ago

0.4.2

8 years ago

0.4.1

8 years ago

0.4.0

8 years ago

0.3.14

8 years ago

0.3.13

8 years ago

0.3.12

8 years ago

0.3.11

8 years ago

0.3.10

8 years ago

0.3.9

8 years ago