In the sample code attached, i start sprite animation and stop it by calling sprite:prepare(“run”) after 3 sec timeout. When timer fires, animation stops, but the sprite is not reset to the first frame. I think this is a bug. See the code attached.
[code]
local sprite = require(“sprite”)
local spriteSheet = sprite.newSpriteSheet(“greenman.png”, 128, 128)
local spriteSet = sprite.newSpriteSet(spriteSheet, 1, 15)
sprite.add(spriteSet, “run”, 1, 15, 1000, 0)
local instance = sprite.newSprite(spriteSet)
instance.x = 50
instance.y = 100
local function run()
instance:prepare(“run”)
instance:play()
– stop some time later
timer.performWithDelay(3000, function() instance:prepare(“run”) end)
end
Runtime:addEventListener(“tap”, function ()
run()
return true
end)
[/code] [import]uid: 75889 topic_id: 13170 reply_id: 313170[/import]