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
Animation
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
-
- Prole
- Posts: 14
- Joined: Sun Nov 22, 2009 12:42 am
-
- Prole
- Posts: 14
- Joined: Sun Nov 22, 2009 12:42 am
Re: Animation
nvm got it working
Re: Animation
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
Hello, I am not dead.
Who is online
Users browsing this forum: Bing [Bot] and 8 guests