Hi,
I have created a simple example of a bug I think I found when using newSpriteMultiSet with sheets of 20 and 9 frames. whenever I switch between 20 and 9 frame animation, theres a tearing of a few frames. howevet changing the delay between sequences in my example to above 1000ms eliminates the issue.
If I replace the 20 sheet animation with a 9 sheet one, the tearing goes away.
Is this me using animations via sprites incorrectly?
[lua]display.setStatusBar( display.HiddenStatusBar )
require(“sprite”)
local idleSESheet = sprite.newSpriteSheet( “skeleton_idle_southeast.png”, 128, 128 )
local walkSESheet = sprite.newSpriteSheet( “skeleton_walk_southeast.png”, 128, 128 )
local spriteSet = sprite.newSpriteMultiSet(
{
{ sheet = idleSESheet, frames = { 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20 } },
{ sheet = walkSESheet, frames = { 1,2,3,4,5,6,7,8,9 } },
}
)
sprite.add(spriteSet, “idle-southeast”, 1, 20, 1000, 0)
sprite.add(spriteSet, “walk-southeast”, 21, 9, 1000, 0)
anim = sprite.newSprite( spriteSet )
anim.x = (200); anim.y = (300);
anim.x = 200
anim.y = 200
print(anim.sequence)
function switch()
if anim.sequence == “walk-southeast” then
anim:prepare( “idle-southeast” )
anim:play()
else
anim:prepare( “walk-southeast” )
anim:play()
end
end
– switching delay interval above 1000ms ( the animation time ) can sometimes eliminate the issue…
timer.performWithDelay( 1000, switch, 0)[/lua]
http://dl.dropbox.com/u/14594384/animation_bug.zip
Kegan [import]uid: 58115 topic_id: 10505 reply_id: 310505[/import]