Skip to content

Adobe Animate's texture atlases player for HaxeFlixel

License

Notifications You must be signed in to change notification settings

Dot-Stuff/flxanimate

Repository files navigation

FlxAnimate's logo, constituting of the HaxeFlixel logo sliced into pieces and then 4 arrows pointing where the parts should be to create a result.

FlxAnimate

FlxAnimate is an open source plugin focused on parsing spritesheets and implementing Texture Atlases exported by the computer animation program Adobe Animate (formerly known as Adobe Flash) on HaxeFlixel. More Information

It can be useful when you need to export spritesheets that are not supported by the game engine, such as Cocos 2D, Starling, Sparrow v1, among others. Not to mention the possibility to play efficiently Texture Atlases on runtime, while mimicking Animate's structure as much fidelity as possible.

Questions/Support

In case that you have any questions or problems about the project, you can contact CheemsAndFriends on:

     

(as cheemsnfriends)          (as @CheemsnFriendos)

Limitations

  • No support on symbols that require 3D transformation (See More)

TODO

  • Blend mode support for shader based blends.
  • Support on layer masks.
  • A wiki or website API related + samples to tweak on. Something similar as HaxeFlixel's demos and HaxeFlixel's API.

How to install?

1. Haxelib

The Haxe Library Manager (also known as Haxelib) is the manager that lets you use, download and upload libraries that are inside Haxe's ecosystem.

you can download it by typing haxelib install flxanimate on your terminal or command prompt.

2. Git

Git is an open-sourced version control system designed to handle every type of project in Github, in this case, FlxAnimate. You should check first of all if you have Git installed before typing haxelib git flxanimate https://github.com/Dot-Stuff/flxanimate on your terminal or command prompt.

How to use it?

There are two usages that you can apply to FlxAnimate: One is the Texture Atlas export and the Spritesheet export.

Texture Atlas

WARNING: This repository DOES NOT transform texture atlases into spritesheets! If you wish to use this, It's better to use Smokey555's repo.

In order to use FlxAnimate's texture atlas support, you will need to create a new instance of FlxAnimate, as you would do with FlxSprite.

var character:FlxAnimate = new FlxAnimate(X, Y, "Path/To/Atlas");

Path/To/Atlas has to be from the folder that you exported the atlas texture atlas with, not with any of the contents in there.

Example:

✅ Correct Path:

var ninja_girl:FlxAnimate = new FlxAnimate(X, Y, "assets/images/ninja-girl");

❎ Incorrect Path:

var ninja_girl:FlxAnimate = new FlxAnimate(X, Y, "assets/images/ninja-girl/Animation.json"); // This also applies with spritemaps!

Spritesheet

There are several formats that Adobe Animate offers to use for different kinds of uses, but mostly for storing animations without having to do big calculations, unlike Texture Atlases. To use a spritesheet with the format that Animate offers, you would need to type the name of the Spritesheet, excluding the version if it has several.

For example:

    var sprite:FlxSprite = new FlxSprite(X,Y);
    sprite.frames = FlxAnimateFrames.fromCocos2D(Path);