function love.load()
image = love.graphics.newImage("assets/animations/Animation.png")
local g = anim8.newGrid(32, 32, image:getWidth(), image:getHeight())
animation = anim8.newAnimation(g('1-8', 1), 0.1)
end
function love.update(dt)
animation:update(dt)
end
function love.draw()
animation:draw(image, 100, 200)
end
I have copied the code from the Anim8 wiki, and i just can't get it to work... An answer would be appreciated
Note: If you were to look at the full Source that the code is very messy. I am just trying to make it work, nothing else.
Probably because your animation file is 62x30, which means there is not a single 32x32 subimage contained within. If I modify the size to 20x30, which seems to be the size of your frames, specify there's a 1-pixel padding and reduce the number of frames to 3, it works fine.
bartbes wrote:Probably because your animation file is 62x30, which means there is not a single 32x32 subimage contained within. If I modify the size to 20x30, which seems to be the size of your frames, specify there's a 1-pixel padding and reduce the number of frames to 3, it works fine.
Yes, i actually figured this out before the post was verified. But thanks anyways !