Flixel Forums

development => releases => Topic started by: stalem on Thu, Jan 30, 2014

Title: FlxAdvSprite - FlxSprite with animation AND rotation
Post by: stalem on Thu, Jan 30, 2014
Hello fellow flixels!

I am here today to announce FlxAdvSprite!
This class, which is a derivative of the works of Simon Rozner (http://gameonaut.com/wordpress/2011/11/flixel-demo-creating-animated-and-rotated-sprites-from-an-un-rotated-animated-images/), allows for both animation and baked rotation.

Usage
Using FlxAdvSprite is pretty much just like using any regular FlxSprite, except you need to provide number of rotations to create when instantiating it.

Code: [Select]
var _mySprite : FlxAdvSprite = new FlxAdvSprite( SimpleGraphic, 360, _xpos, _ypos);
After that you can use it just like a regular FlxSprite, e.g. addAnimation(), play(), angle etc.

Get it!
I've attached the source .as file with this post so you should be able to download it from there. Otherwise, you can download it from the github repository (https://github.com/macrohaul/flixel/blob/dev/src/org/flixel/FlxAdvSprite.as).
Title: Re: FlxAdvSprite - FlxSprite with animation AND rotation
Post by: paala on Tue, Feb 4, 2014
Great!
Title: Re: FlxAdvSprite - FlxSprite with animation AND rotation
Post by: FlowerInMyHeart on Wed, Sep 3, 2014
Great I was hoping this would come over from the old Wiki