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

Showcase your libraries, tools and other projects that help your fellow love users.
User avatar
bartbes
Sex machine
Posts: 4946
Joined: Fri Aug 29, 2008 10:35 am
Location: The Netherlands
Contact:

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

Post by bartbes »

Reuploaded.
User avatar
Lap
Party member
Posts: 256
Joined: Fri Apr 30, 2010 3:46 pm

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

Post by Lap »

I edited my personal copy to have a new arg and a couple of functions that I think would be pretty useful here.

The new arg is a number that tells the animation how many times it should play before stopping and calling an onStop() function. You can also return how many loops the animation has played through.

In my game I make the onStop() function destroy the animation and remove it from the animation table I have. I can think of some other nifty uses that would save you from needing to make separate timer functions.

Adding mode to the newanimation args is also nice.
User avatar
bartbes
Sex machine
Posts: 4946
Joined: Fri Aug 29, 2008 10:35 am
Location: The Netherlands
Contact:

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

Post by bartbes »

As I said before, this lib is here to provide legacy support for animations.
User avatar
Elvashi
Prole
Posts: 45
Joined: Sat Jul 04, 2009 9:17 am
Location: Australia

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

Post by Elvashi »

bartbes wrote:As I said before, this lib is here to provide legacy support for animations.
IOW, if you are using this for new projects, you are doing it wrong.
"We could make a program for doing this for you, but that is for the LÖVE IDE, planned to be released in March 2142." ~mike
Networking with UDP uLove Proposal CCG: Gangrene
User avatar
Lap
Party member
Posts: 256
Joined: Fri Apr 30, 2010 3:46 pm

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

Post by Lap »

What's a better alternative? The only thing I could think of doing differently is using spritebatches.
User avatar
Robin
The Omniscient
Posts: 6506
Joined: Fri Feb 20, 2009 4:29 pm
Location: The Netherlands
Contact:

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

Post by Robin »

Lap wrote:What's a better alternative? The only thing I could think of doing differently is using spritebatches.
No spritebatches, quads (AnAL uses quads internally). They are like the animations of old, only far more powerful.
Help us help you: attach a .love.
User avatar
Lap
Party member
Posts: 256
Joined: Fri Apr 30, 2010 3:46 pm

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

Post by Lap »

I know AnAL doesn't use spritebatches. I wasn't asking if it did. I'm at a loss for why I wouldn't want to use this for new projects and was wondering how different you could even make another animation library.

Side question- Does anyone know at about how many draws of the same image it becomes worthwhile to switch to spritebatches?
User avatar
Robin
The Omniscient
Posts: 6506
Joined: Fri Feb 20, 2009 4:29 pm
Location: The Netherlands
Contact:

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

Post by Robin »

Lap wrote:I know AnAL doesn't use spritebatches. I wasn't asking if it did.
I knew that's not what you meant, and that's not what I said either.

You can't use SpriteBatches for this, but you can use Quads. I proved I was right by saying that AnAL uses Quads. ;)
Lap wrote:I'm at a loss for why I wouldn't want to use this for new projects and was wondering how different you could even make another animation library.
Because Quads are much more powerful than the old animation library. And I have my own animations in Tribe.
Lap wrote:Side question- Does anyone know at about how many draws of the same image it becomes worthwhile to switch to spritebatches?
No, but in general it is: the more things stay the same, the better suited SpriteBatches are (which rules them out for animations).
Help us help you: attach a .love.
User avatar
Lap
Party member
Posts: 256
Joined: Fri Apr 30, 2010 3:46 pm

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

Post by Lap »

Robin wrote: You can't use SpriteBatches for this, but you can use Quads. I proved I was right by saying that AnAL uses Quads. ;)
I can easily use spritebatches to make a similar animation system, it would just be slower under most situations. AnAL using quads doesn't prove anything besides the fact that AnAL uses quads, which we already knew.

The question is, why wouldn't I want to use AnAL? If we agree that quads are the best way to do animations and AnAL uses quads what's the problem here?
User avatar
Robin
The Omniscient
Posts: 6506
Joined: Fri Feb 20, 2009 4:29 pm
Location: The Netherlands
Contact:

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

Post by Robin »

Chill, dude.
Lap wrote:I can easily use spritebatches to make a similar animation system, it would just be slower under most situations.
I didn't mean it is completely impossible, just that it just plain wrong, like using binary strings to represent numbers.
Lap wrote:AnAL using quads doesn't prove anything besides the fact that AnAL uses quads, which we already knew.
It proves that Quads can be used, and that was my point.
Lap wrote:The question is, why wouldn't I want to use AnAL? If we agree that quads are the best way to do animations and AnAL uses quads what's the problem here?
Because it is inherently less powerful than using Quads. Sure, you can use AnAL, but it probably won't be supported, and you'll need to work around the limitations of the legacy Animation system.
Help us help you: attach a .love.
Post Reply

Who is online

Users browsing this forum: No registered users and 34 guests