tove2d icon indicating copy to clipboard operation
tove2d copied to clipboard

Flipbook missing frame when first keyframe duration = 1

Open cpackard opened this issue 11 months ago • 2 comments

The Flipbook animation used in the Blob demo has a gap at the end of its animation where nothing is drawn, regardless of whether the Flipbook is looped or not.

I was able to hack around the issue either by changing the duration of svg2 to be > 1, or by changing the ending index of the frames initialization loop from duration - 1 to just duration, but I'm not sure if this will have other side effects -- is there a better way to fix this / some other reason the demo wouldn't be working as-is?

cpackard avatar Jan 19 '25 18:01 cpackard

Currently I unfortunately don't have time to work on this repo anymore. However, now that I'm looking at that code, it makes q lot of sense to me to change duration - 1 in https://github.com/poke1024/tove2d/blob/03cfef243ddb4131764253b29025e293ea3b702f/src/lua/animation.lua#L115 to duration, soease(j / duration) in https://github.com/poke1024/tove2d/blob/03cfef243ddb4131764253b29025e293ea3b702f/src/lua/animation.lua#L120 goes from 0 to 1.

poke1024 avatar Jan 21 '25 09:01 poke1024

Totally get it, I appreciate the confirmation either way.

cpackard avatar Jan 21 '25 23:01 cpackard