Bitmap Animation API Released – Ginger

keyframeanimationWoot! I am so excited to be able to finally release this to the public. Panayoti from GamePoetry.com and I have been working hard on this for the past 9 months or so ( on and off ) This was originally sparked off by my reading of his request for help: Improving Performance With Animated Bitmaps. I said to myself, “Hey I’ve basically already done all of this!” So after talking over the vision of the animation system for a while I set out to create a robust and extensible API. It only took a day or so to get the bulk of it coded, however over the last few months we have been using it in projects so that we can test / refine it further. Finally it is to the point that we can both happily release it to you guys!

So without further delay, I now introduce you to Ginger :

Features :

  • Extremely fast and optimized animations
  • Set the rotation precision, and each frame is pre cached for speed
  • Attach an event dispatch to any frame of animation
  • Adjustable frame rate
  • Set your own offset for each frame of animation
  • Queue up multiple animations
  • Import Tile sheets and convert to an animation
  • *NEW – 9/10/09* Import MovieClips, Sprites, and Bitmaps and convert to an animation
Get Adobe Flash player

Download the example files from SVN here.
-or-
Download in .ZIP format here.

Future Plans

  • Create a real time loader for larger animation files
  • Optimizations to rotated animations
  • Tools for building animations using XML format
  • Tools for loading MovieClips / swfs – Done!
  • Easy integration with my game framework

1 Star2 Stars3 Stars4 Stars5 Stars (11 votes, average: 4.64 out of 5)
Loading ... Loading ...

9 Comments so far »

  1. Brett said

    am September 2 2009 @ 12:39 pm

    Glad to see your releasing some new stuff and I have looked over this newest code. However, I do have a suggestion change which I’d love to see in this code.

    You have the animation taking place by moving along a PNG based on each image of the PNG representing the next clip of animation. Basically using it as the bitmap data in your inputs. Problem I have with this is I have a number of images I have used that are being drawn by hand.

    Lets use my very simple example of where this becomes a problem for me. I have a bullet that is drawn from my ship as well as enemy ships. The bullet is a Sprite that draws itself differently depending on where it is shot from. Also, the bullet has an explosion animation which is different also based on where it is fired from. The differences are suttle and by using the graphics class off of the Sprite was easy to do. With this to get similar graphics I would have to create multiple bitmaps (pngs) for each version of the bullet along with frames for each explosion style.

    So, for rendering items on the screen I am already using a renderer class to handle this change in animation state and would like to incorporate the described changes with your animation player. I would think that the exact same behavior of your animation could be accomplished without requiring an actual bitmap but instead be wrapped around a simple Sprite. Basically abstracting it one level further to include a Sprite which could represent an image or could be extended to draw based on frame location.

    Basically, instead of the Animation class drawing the image you have a class that can draw an underlying bitmap based upon a strip as done here. Or could also draw based upon a frame as is done in a MovieClip (Flex nono) or something similar. Meaning that the frame actually advances and the location inside the bitmap is determined by the frame along with something else could use the frame to decide what to draw next.

    I hope this made sense and I really do like the stuff you are building and this is great for animating long pngs inside of something. The other place I am going with this is that alot of animation I do on things is just using effects, meaning applying filters that change over a certain period. This type of animation gives no leeway with that kind of strategy whether I am using an img or not.

  2. Tariq said

    am September 2 2009 @ 1:34 pm

    Nice job as always Colby! Great bitmap alternative to the MovieClip! And fast too.

  3. Colm said

    am September 3 2009 @ 4:31 am

    Nice work. Only had a brief browse through the src so far, but it looks like it follows the same ideology as what I’ve built myself (ie copypixels + caching of unique bitmapdatas). Will delve into it properly later on for much learnings.

    Thanks for releasing this!

  4. Flash Game Frameworks, Classes and Libraries | der hess said

    am September 5 2009 @ 2:06 am

    [...] Ginger – Bitmap Animation API [...]

  5. A Freelancer’s Flash Bash [5] | Freelance Flash Games News said

    am September 9 2009 @ 1:57 pm

    [...] is back and posting again with their Bitmap Animation API and article on Finite State Machines. This guy really knows his [...]

  6. Brett said

    am September 16 2009 @ 11:28 am

    Took a look at your newest changes even though haven’t played with it yet. Like the stuff you added for mc conversion and think it is great and gives exactly what I was asking for. Nice work and I must say I am very impressed with everything you put out. Keep up the beautiful work.

  7. Zack said

    am November 6 2009 @ 5:58 pm

    not exactly on the topic of ginger(very nicely done by the way) but while i was using the sound manager class included in your most recent svn the package was com.cheezworld – but it was in the folder com.cheezworld.utils. no biggie just felt that i should mention it.

  8. 12G: The Crab Attack Trilogy » Andy Moore said

    am December 10 2010 @ 11:50 pm

    [...] Performance Testing Posts (one, two, and three). I asked around and ended up finding the excellent Ginger bitmap animation API (It looks like the site is no longer updated and the download link is old – be sure to use [...]

  9. wanting252 said

    am February 26 2011 @ 11:06 pm

    Thank for your excellent work, but I don’t see any links for downloading the API ?

Comment RSS · TrackBack URI

Leave a comment

Name: (Required)

eMail: (Required)

Website:

Comment: