v2.0.0-rc1
Pre-release
Pre-release
·
61 commits
to ts-and-v5-rewrite
since this release
First release candidate for version 2
Breaking changes:
- Dropped support for PixiJS v4, now supports v5
- The
PIXI.animatenamespace is no longer added to the window (and thePIXInamespace is no longer required). If you would like to use the namespace, use the IIFE build located inpixi-animate/dist/pixi-animate.js.- The ambient type declarations to describe that namespace are now in
pixi-animate/dist/pixi-animate-ambient.d.ts
- The ambient type declarations to describe that namespace are now in
- Instead of mixing into the PixiJS display object classes, subclasses are now provided in the library for the added and shorthand methods (
PIXI.animate.Container, etc). Graphics.c()is no longer a shorthand forclosePath()(it overrode thesetColorTransform()shorthand). Instead, the shorthand iscp().- Because PixiJS Graphics class has lost its
addHole()method, there is no longer anh()shorthand either. Instead, thebeginHole()andendHole()methods are supported withbh()andeh()shorthands. - The
SymbolLoaderplugin forLoaderno 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. - The global
ShapesCacheobject has been dropped from the pixi-animate API. 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.createInstancenow defaults to false, instead of true, when callingload().
- The expected asset format is now a contained module (
require()orimport()) based one where you must call a setup function and provide a reference to the pixi-animate library.- To use v1 assets, you can include the
pixi-animate/v1-asset-shim.jsfile in your project, which will update thePIXIandPIXI.animatenamespaces with the appropriate changes so that old assets will work (you will have to ensure that thePIXIandPIXI.animatenamespaces are set up correctly). You may have to use the pixijs-legacy build, the shim in combination with the standard build hasn't been tested. - If you want to update to the new asset format, a node script is provided to replace v1 assets with their v2 equivalent:
pixi-animate/scripts/assetConversion.js. See the readme for usage.- In this release, the script does not update graphics shape data for the closePath/hole changes mentioned above - you'll have to do that manually.
- To use v1 assets, you can include the
Other changes
- Source code is now written in Typescript, so type declarations are built automatically.