Code: Select all
function love.load()
runningbunny=love.image.newImageData("NPCs\/BunnyRunning.png")
frames={}
for i = 1,runningbunny:getWidth()/32 do
frames[i]=love.image.newImageData(32,32):paste(runningbunny,0,0,(i-1)*32,0,32,32)
end
end
function love.draw()
for i = 1,#frames do
love.graphics.draw(frames[i],0,0)
love.graphics.print(i,0,32)
love.timer.sleep(10)
end
love.timer.sleep(10)
end
I want it to split an image into 32x32 pictures. on the X axis only, and then animate them in a loop.
Thanks!