• Stars
    star
    198
  • Rank 190,701 (Top 4 %)
  • Language
    JavaScript
  • License
    MIT License
  • Created over 8 years ago
  • Updated 8 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

PixiJS runtime library for content from Adobe Animate CC

Pixi Animate

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

Build Status Dependency Status npm version

Running Content

Re-Export your .fla

Use this Animate CC plugin https://github.com/pixijs/animate-extension and follow this steps:

  1. Install the plugin
  2. Open your old .fla file
  3. Convert to PixiJS Animate (from the File menu), creating a new .fla file
  4. From that new .fla file go to publishing settings (from the File menu)
  5. Select the V2 format on the first dropdown
  6. Export your project, you should have a .js file and some folders with it.

Only things added to the stage will be exported!

Installing Library

To run content exported with Pixi Animate, you must load the JavaScript library within your project. You can install using NPM or your package manager of choice:

NPM

npm install @pixi/animate

Dependencies

PixiJS @pixi/animate
v5.x - v6.x v2.x
v7.x v3.x

Documentation

https://pixijs.io/animate/

Breaking changes from v2.x to v3.x

  • Compatibility with PixiJS v7
  • This means the library now uses Assets to download anything needed.
  • Removed V1 export compatibility. Only V2 exports are now compatible.
  • Removed tests for V1 assets

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/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 build, 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 - animate-upgrade (see bin/assetConversion.js for the source).

  • CommonJS export: npx 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: npx 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: npx 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 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: npx animate-type-assets path/to/myFile.js path/to/my2ndFile.js

Considerations & Limitations in Animate

While we now support publishing tweens from Animate, there are some things to take into account to ensure that you get the smallest, most efficient asset size possible.

Tweens

  • Only classic tweens are supported at this time, not motion tweens (those are converted to keyframes automatically).
  • Tweens that only affect color (alpha, tint, color adjustment) can't be detected during publishing, but will be included if your tween also affects the transformation (position, scale, rotation/skew).
  • Custom ease curves are not supported at this time, only the default selection of eases.

Considerations with Graphics

In order to maintain an accurate export, Animate creates a unique Graphic (MovieClip in the runtime) instance for each usage in your library of anything that is a Graphic on the timeline. This has a few effects:

  • Tweens inside Graphics won't be exported, but instead converted to keyframes.
  • When a Graphic is interrupted on the timeline, each use will be a different instance in the export, causing a little bloat.

In order to minimize your asset size, there are a few things that you can do:

  • Do all of your tweening at as high a level as you can manage, in something that is a MovieClip on the timeline.
  • Use one Graphic per layer, and don't have blank keyframes between uses of it or mix & match Graphic instances on the same layer.
  • If a Graphic is just a single frame, or is always animating through its full timeline, make it a MovieClip on the timeline instead.

License

Copyright (c) 2016 Jibo, Inc.

Released under the MIT License.

More Repositories

1

pixijs

The HTML5 Creation Engine: Create beautiful digital content with the fastest, most flexible 2D WebGL renderer.
TypeScript
42,668
star
2

pixi-react

Write PIXI apps using React declarative style
JavaScript
2,167
star
3

filters

Collection of community-authored custom display filters for PixiJS
TypeScript
886
star
4

particle-emitter

A particle system for PixiJS
TypeScript
777
star
5

spine

Pixi.js plugin that enables Spine support.
TypeScript
538
star
6

examples

Rendering examples using PixiJS and related plugins
JavaScript
469
star
7

sound

WebAudio API playback library, with filters. Modern audio playback for modern browsers.
TypeScript
376
star
8

pixi-ui

Provide a definitive user experience in your PixiJS application without any frontend library!
JavaScript
299
star
9

tilemap

Rectangular tilemap implementation for PixiJS
TypeScript
275
star
10

pixi-typescript

Typescript definitions for Pixi.js
TypeScript
238
star
11

layers

Separate the z-hierarchy of your scene tree from its canonical structure.
TypeScript
220
star
12

lights

Adds dynamic lighting via deferred shading to PixiJS
TypeScript
191
star
13

open-games

TypeScript
190
star
14

pixi-projection

TypeScript
186
star
15

pixi-haxe

Externs of Pixi.js for Haxe
Haxe
179
star
16

graphics-smooth

Drop-in replacement for Graphics but with anti-aliasing
TypeScript
151
star
17

ui

Commonly used UI components for PixiJS
TypeScript
149
star
18

animate-extension

Custom Platform Plugin for Adobe Animate CC (Formerly Adobe Flash CC) - to export animation for the PixiJS renderer
C++
124
star
19

pixi-heaven

PIXI.js advanced color modes, sprites, meshes
TypeScript
115
star
20

pixi-compressed-textures

Compressed textures and retina support for pixijs. Loader can choose textures depends on platform and rendering mode.
TypeScript
92
star
21

pixi-native

A native version of pixi
Kotlin
85
star
22

pixi-gl-core

A set of tidy little pixi objects that make working with WebGL simpler
JavaScript
83
star
23

assetpack

TypeScript
77
star
24

pixi-extra-filters

[deprecated] Please see https://github.com/pixijs/pixi-filters
JavaScript
66
star
25

pixi-particles-editor

PIXI-based particle editor
JavaScript
65
star
26

picture

A plugin that includes a sprite renderer that reduces border artifacts and 3 blend mode implementations for WebGL
TypeScript
61
star
27

layout

Library for arranging/resizing pixiJS rendered elements basing on css like configs
TypeScript
53
star
28

html-text

Multi-Style Text Rendering Plugin for PixiJS
TypeScript
38
star
29

gif

Plugin to support playback of animated GIF images in PixiJS.
TypeScript
35
star
30

pixi-jsdoc-template

PixiJS Flavored JSDoc Template
JavaScript
30
star
31

extension-boilerplate

Pixi.js example renderer plugin. Clamps textures to reduce border artifacts.
TypeScript
30
star
32

pixijs.com

JavaScript
30
star
33

pixi-text-style

PIXI.TextStyle Generator
JavaScript
30
star
34

floss

Unit-testing for those hard to reach places
TypeScript
28
star
35

storybook

TypeScript
27
star
36

node

Run PixiJS but in Node.js environments, no browser required!
TypeScript
25
star
37

bunny-mark

Simulation for performance testing PIXI releases
JavaScript
20
star
38

devtools

TypeScript
18
star
39

batch

PixiJS batch rendering plugin library
TypeScript
17
star
40

pixify

Browserify bundle process for PIXI libraries
JavaScript
16
star
41

guides

PixiJS User Guides
SCSS
12
star
42

customize

Customize the list of packages to use for PixiJS v5
TypeScript
11
star
43

animate-examples

Document Examples for testing PixiAnimate publishing
10
star
44

docs

API Documentation container
HTML
9
star
45

examples-v4

Rendering examples using PixiJS v4 and related plugins
JavaScript
9
star
46

spine-v8

TypeScript
9
star
47

extension-scripts

Build-time scripts for setting up extensions
JavaScript
6
star
48

pixi-closure-compiler

closure compiler externs for pixijs
JavaScript
6
star
49

eslint-config

ESLint config for pixi.js plugin/integration libraries
JavaScript
5
star
50

webdoc-template

PixiJS template ported to webdoc
TypeScript
4
star
51

generator-pixi-plugin

A Yeoman generator for creating pixi.js plugins.
JavaScript
4
star
52

bundler

Bundle all release into a single package
JavaScript
3
star
53

pixi-animate-tests-tool

Used to generate unit tests solutions for PixiAnimate
JavaScript
3
star
54

legacy.pixijs.com

SCSS
3
star
55

examples-v5

Rendering examples using PixiJS and related plugins
JavaScript
2
star
56

webworker-plugins

TypeScript
1
star
57

examples-v7

JavaScript
1
star