|
|
|
|
Reply From: |
splite |
Well,
its all about that texture.
996(px) ÷ 9 (frames) = 110.66 px (lets say 110 px for simplicity)
If i add line every 110 px (so frame every 110, 220, 330, 440, 550, 660, 770, 880, 990), you can clearly see whats wrong (dont mind last line cutting his face, thats that .66 px × 9 frames we ignored)
Maybe author of that spritesheet want it to look like walking without moving sprite (thats what you got ), idk. Dont think there is any technique to “multiplying offset every frame” and who know if that offset is distributed equally, i would scratch this idea.)
You have to pack that texture “more tightly” (draw lines as i did, resize texture to width ÷ frames = whole integer, but add at least two transparent pixels between sprites and one on every side of image*) or split it to multiple images and use AnimatedSprite.
Edit: or, you can use “region” and animate “region rectangle” property of your sprite (but i think repacking texture is little bit easier)
Edit2: *: so you will have padding and margin. Its becouse coord on textures is float2 between zero and one (lets say 0.123456789; 0.987654321) - which doesnt have to land exactly on pixel (lets say, texture is 90 px wide and you want pixel 33 → 33 ÷ 90 = 0.366666period…) and you got “half pixel” which, if neighbouring pixel is colored, will make artefacts on sides of your sprite, but thats heavy OT
Ah, so it really is a problem with the image, thanks. I’ll try adjusting it or just use AnimatedSprite. Thank you very much for your detailed answer!
You are welcome
splite | 2016-08-03 08:02