Issue 51 * June 20, 2008

AnimationEngine 2.9
Code less, Move More

by Malte Brill

As promised in my last article I have news for you regarding animationEngine. The new release is here! For those of you that do not know the library yet, animationEngine lets you move stuff, check for collisions, handle geometric calculations and lots more cool things to make your multimedia sparkle. The library has been in use by hundreds of rev users for some years now and most importantly, over at derbrill and awesome mega mighty games, we use it ourselves. Every game we build relies on the library, but we also use it in business apps, to add some sizzle to user interfaces. If you happen to have read my last article, you already know that I took over a small game design studio. This not only took a lot of work from my shoulders in designing game concepts, but it also gave me the time to learn a few new tricks and do some 101 coding again. The result of that effort is available today through revSelect. animationEngine 2.9 is shipping today.

animationEngine 2.9 introduces two new easingFunctions, one new geometric function and a new moving Method. It requires Revolution 2.8 or higher. For those of you who have not upgraded yet, I really recommend you do, as Rev 2.9 is the most stable release in ages and it sports some new features that I did not want to miss in AE, hence the decision to make AE only compatible with a recent version of Revolution. Better performance and the ability to have private handlers speeds up some processes significantly.

Enough about my reasoning for system requirements though. What is in the update for you? Well, best see for yourself! Lets do some cool stuff. Head over to revSelect and download the trial version. Once you unpack the .zip file you will see a folder containing some stacks. Open Revolution. Open animationEngine.rev. In the messagebox type:

start using stack "animationEngine"

All the handlers, functions and properties animationEngine offers are available to your projects now. Next open the stack "ae29demo.rev" and click the Start button. Once you've recovered from shock, you might be interested to know how the demo works.

The most important change in AE 2.9 from the previous versions is the introduction of the new command aeMoveTo.

aeMoveTo lets you move controls from their current position to a specified destination in a given time. While this sounds a bit like the built in move command it has a lot of advantages over it. 

  1. It is less resource hungry
  2. It lets you move objects using easing effects
  3. Movement can be stopped at any time
  4. Destination can be changed at any time
  5. Movement is frame accurate

A simple call to aeMoveTo looks like this: Create a stack with two buttons. Position the first button at the topLeft of the card. In the script of the second button put:

on mouseUp
   aeMoveTo the long ID of button 1,the loc of this card,2000
end mouseUp

Switch to the browse tool and test it. Not impressive enough? You've seen that before, have you? Ok, try this:

on mouseUp
   aeMoveTo the long ID of button 1,20,20,2000,"inOut"
end mouseUp

Nice, eh? No need to write your own timers anymore. But there is more to it. What if you want to move more than one object, but keep the timing accurate? I left the script of the demo stack open for you to explore. It is all in the script of the button "Start". If you have any questions on how it works, make sure to drop by in the forums or ask on the use list. I'll be happy to explain more in detail.

That's it for now I guess... But before I pop out and get coding on the next version, there are a few things you might want to know. If you hold a current license of AE 2.x this is a free update for you. If you do not have a license yet, but want one you should hurry. The price for animationEngine will go up on July the 8th, so if you want to get a copy of the new animationEngine for the old price don't wait - grab your copy now!

Until next time,

Malte

Main Menu What's New