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

Showcase your libraries, tools and other projects that help your fellow love users.
8t
Prole
Posts: 8
Joined: Sat Sep 25, 2010 6:30 pm

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

Post by 8t »

So how do I make it work in my program? I downloaded AnAL, but Love wont use it.
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 »

Did you require it in your main.lua?
Denny
Prole
Posts: 2
Joined: Sat Oct 09, 2010 2:27 pm

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

Post by Denny »

First I'd like to thank you for the work on AnAL. I've been using it while trying to learn Löve and Lua. Today I stumbled upon a bug that has an easy fix.

At line 128-132

Code: Select all

--- Reset
-- Go back to the first frame.
function animation:reset()
    self:seek(0)
end
This doesn't work as you are using the value 0 when Lua starts with 1. Easy mistake when we're all used to start with 0. :rofl:
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 »

I guess that's what you get for porting code..
Denny
Prole
Posts: 2
Joined: Sat Oct 09, 2010 2:27 pm

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

Post by Denny »

Luckily it wasn't that bad. AnAL has helped me a lot so far so your work is really appreciated. :)
User avatar
TechnoCat
Inner party member
Posts: 1611
Joined: Thu Jul 30, 2009 12:31 am
Location: Milwaukee, WI
Contact:

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

Post by TechnoCat »

AnAL.lua:109

Code: Select all

function animation:addFrame(x, y, w, h, delay)
	local frame = love.graphics.newQuad(x, y, w, h, a.img:getWidth(), a.img:getHeight())
	table.insert(self.frames, frame)
	table.insert(self.delays, delay)
end
I think should be

Code: Select all

function animation:addFrame(x, y, w, h, delay)
	local frame = love.graphics.newQuad(x, y, w, h, self.img:getWidth(), self.img:getHeight())
	table.insert(self.frames, frame)
	table.insert(self.delays, delay)
end
Get those global a's out of here!
James_D.
Prole
Posts: 2
Joined: Wed Jun 22, 2011 10:34 am

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

Post by James_D. »

Or just change

Code: Select all

--- Reset
-- Go back to the first frame.
function animation:reset()
	self:seek(O)
end
to

Code: Select all

--- Reset
-- Go back to the first frame.
function animation:reset()
	self:seek(1)
end
I just fixed the same bug for myself
clepto
Prole
Posts: 35
Joined: Wed Jul 25, 2012 10:20 pm

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

Post by clepto »

how many arguments the anim:draw take?
User avatar
Petunien
Party member
Posts: 191
Joined: Fri Feb 03, 2012 8:02 pm
Location: South Tyrol (Italy)

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

Post by Petunien »

Code: Select all

animation:draw(x, y, angle, sx, sy, ox, oy)
There's a documentation: https://github.com/bartbes/love-misc-li ... /AnAL/docs

;)
"Docendo discimus" - Lucius Annaeus Seneca
clepto
Prole
Posts: 35
Joined: Wed Jul 25, 2012 10:20 pm

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

Post by clepto »

Thanks!
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest