Here's a demo:
Code: Select all
local k = require "katsudo"
function love.load()
gr = love.graphics
gr.setBackgroundColor(1, 1, 1)
local imgDir = "imgs/tc.png"
-- 18 frames of 30x55 at 25 FPS:
tc = k.new(imgDir, 30, 55, 18, 0.04)
tc2 = k.new(imgDir, 30, 55, 18, 0.04, "rough")
tc3 = k.new(imgDir, 30, 55, 18, 0.04):rewind()
tc4 = k.new(imgDir, 30, 55, 18, 0.04):once()
end
function love.update(dt)
k.update(dt)
end
function love.draw()
tc:draw (50, 50, 0, 5, 5)
tc2:draw(200, 50, 0, 5, 5)
tc3:draw(350, 50, 0, 5, 5)
tc4:draw(500, 50, 0, 5, 5)
end
(the last one is played once and then it stops)
Here's my repo: https://github.com/tavuntu
Tested just in LÖVE 0.10.1, please let me know your thoughts and thanks!
EDIT: it still works in 0.10.2
EDIT2: it still works in 11.0