Animate on screen elements, where to start?


Hi, does anybody knows of a LUA script to look at to copy some animation routines or idea about generic animation engine?
At the moment we could skip working with matrices, and just work with screen coordinates and alpha for fading.
Basically we have to move around rectangles (no rotation) and make them fade to alpha zero.

We have developed a custom page/cover flow with nice animations but it’s a bit of a mess, and is not generic enough.



Hi, for everyone curious, I’ve rolled out ina couple of hours a custom solution (sic!).

I simply animate, based on the classical t parameter, various properties of images that I draw on screen.

Once I decide to start an animation, I add a simple lua struct to a global animation array.

Each struct holds an image struct(coordinates and alpha and an image pointer), plus 5 animation values:

value //the name of the property of the image to animate. Can be any value in the image struct
from //the value to start animating from 
to //the end value of animation
steps //the total number of frames it takes
counter = 0 // this holds the animation counter. 

At each render pass counter is incremented, then the corresponding value is interpolated (now linearly) from from to to by counter/steps. Once counter == steps the animation finishes and is removed from the animation array.

Feel free to ask more.


I also rolled my own for our convention schedules. This especially shows up in the EventList modules. I’m looking to transition to flux though, but I think I’m going to have to rewrite a bunch of code. I’m hoping the end result might be cleaner.

1 Like

The older has some code for animations. But it’s not optimal. It’s really an interesting problem to solve. I’ll probably take another attempt at solving it in a more generic way soon.


A Lua module that could run on both the desktop and RPi versions would be pretty cool. :slight_smile: