Animation

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
Kevin Tillman
Prole
Posts: 14
Joined: Sun Nov 22, 2009 12:42 am

Animation

Post by Kevin Tillman »

Hi all, I have searched the forums on animating my spritesheet with the new version of love. How is animation being handled? I remember in the old version that I used, there was a call to love.graphics.newAnimation(). Is animation now being handled by the SpriteBatch? Im anxious to continue working on my action rpg XD.


Thanks all
User avatar
TechnoCat
Inner party member
Posts: 1611
Joined: Thu Jul 30, 2009 12:31 am
Location: Milwaukee, WI
Contact:

Re: Animation

Post by TechnoCat »

Kevin Tillman
Prole
Posts: 14
Joined: Sun Nov 22, 2009 12:42 am

Re: Animation

Post by Kevin Tillman »

thanks TechnoCat
Kevin Tillman
Prole
Posts: 14
Joined: Sun Nov 22, 2009 12:42 am

Re: Animation

Post by Kevin Tillman »

the link to animation.Lua is broken, so what to do?

nvm got it working
User avatar
zac352
Party member
Posts: 496
Joined: Sat Aug 28, 2010 8:13 pm
Location: In your head.
Contact:

Re: Animation

Post by zac352 »

Kevin Tillman wrote:Hi all, I have searched the forums on animating my spritesheet with the new version of love. How is animation being handled? I remember in the old version that I used, there was a call to love.graphics.newAnimation(). Is animation now being handled by the SpriteBatch? Im anxious to continue working on my action rpg XD.


Thanks all

Code: Select all

images={"img1.png","img2.png","img3.png"}
local i={}
for _,v in pairs(images) do
table.insert(i,love.graphics.newImage(v))
end
function drawanim(x,y,rot,sx,sy,ox,oy)
local t=math.floor((love.timer.getTime()*1000/(1/#images))%#images)
love.graphics.draw(i[t],x,y,rot,sx,sy,ox,oy)
end
Is this what you're looking for? :P
Hello, I am not dead.
Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 8 guests