Page 1 of 8

Animations And LÖVE (AnAL) - The animations replacement lib

Posted: Sun Sep 13, 2009 7:12 am
by bartbes
Since it appears everybody has moved to the pre-release builds in attempts to port their projects, I figured I might as well post AnAL now.

What does AnAL do? It replaces the removed Animations functionality in LÖVE 0.6.0
Do I need code changes? Yes, a little, let me list the 2 (!) changes:
  • newAnimation instead of love.graphics.newAnimation
  • anim:draw() instead of love.graphics.draw(anim)
If you don't want to change this and keep old behavior, add this code before you require the file:

Code: Select all

Animations_legacy_support = true
However, notice this does change love.graphics.draw behavior, it now calls the draw field if it exists when there is a table passed to love.graphics.draw.

You can find it in my love-misc-libs repo on github.
Enough talking, here it is:
AnAL.zip
Version 1.5
01102010
(8.14 KiB) Downloaded 2883 times
^-- contains docs!
animation.lua
Version 1.1
September 19th 2009
(3.72 KiB) Downloaded 1011 times

Re: Animations And LÖVE (AnAL) - The animations replacement lib

Posted: Sun Sep 13, 2009 12:41 pm
by kalle2990
Nice work! :ultrahappy:
I might change some new 0.6.0 functions so they behave like the 0.5.0 ones, the most stuff is alot less complicated than this (even if this isn't too complicated to understand).
A little question, shouldn't :stop() be called :pause() instead, because that's what it does. To really stop you have to use :stop() :reset() but I guess the original animate doesn't reset on stop.

Re: Animations And LÖVE (AnAL) - The animations replacement lib

Posted: Sun Sep 13, 2009 6:46 pm
by bartbes
The goal was to replicate the old animations as closely as possible, to minimize porting difficulty.

Re: Animations And LÖVE (AnAL) - The animations replacement lib

Posted: Sun Sep 13, 2009 11:09 pm
by paclito
god work men!!!

Perhaps you can add an event when animation reaches end? It can help in some cases and perhaps you can add some exampes of usage isn't?

Re: Animations And LÖVE (AnAL) - The animations replacement lib

Posted: Mon Sep 14, 2009 1:23 am
by osgeld
cant wait to try it (since both my os's seem to be on the 0.6 borked list, ubuntu and windows XP64)

Re: Animations And LÖVE (AnAL) - The animations replacement lib

Posted: Mon Sep 14, 2009 5:56 am
by bartbes
It should be fine on ubuntu, or any linux for that matter, I run it on ubuntu!

Re: Animations And LÖVE (AnAL) - The animations replacement lib

Posted: Mon Sep 14, 2009 10:26 am
by napco
Nice work! Maybe i'll start using animations too when i'll upgrade to 6.0 (i don't like to use separate files for every character direction)... By the way, don't you think the name AnAL is a bit... ambiguous? ^^

Re: Animations And LÖVE (AnAL) - The animations replacement lib

Posted: Mon Sep 14, 2009 1:49 pm
by osgeld
bartbes wrote:It should be fine on ubuntu, or any linux for that matter, I run it on ubuntu!
http://love2d.org/forum/viewtopic.php?f ... t=50#p9402

waiting on this magic build that works :)

Re: Animations And LÖVE (AnAL) - The animations replacement lib

Posted: Mon Sep 14, 2009 2:24 pm
by bartbes
I hoped it was fixed in yesterday's build?

Re: Animations And LÖVE (AnAL) - The animations replacement lib

Posted: Mon Sep 14, 2009 2:42 pm
by osgeld
Ah didnt see that, Ill check when I get home