How to use animation sequences with texture atlases and shifting anchor points

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By curkas

I’m trying to wrap my head around the general approach to using animated sequences via the use of atlases. The issue being that as the frames are cropped, when animations play, they shift about as the size constantly changes, relative to the anchor point.

My confusion is that I can’t be the first person to have to deal with this, but I can’t think of a way that isn’t overly convoluted to define a custom point that is relative to all resources on an atlas.

Perhaps I’m not even looking for something Godot specific. I just want to understand what a typical workflow for people using animation sequences with an atlas, as opposed to a tilesheet that just has fixed frame sizes (so the anchor point problem isn’t an issue)

I would appreciate any help or discussion!

:bust_in_silhouette: Reply From: rakkarage

how are they being trimmed? unless you or something is keeping track of those offsets it is hard to put the animation back together again…

but there is an sprite atlas editor in godot… if you dont trim them yourself and let godot trim them and group them all together into a sprite sheet or atlas or whatever it is called i know (think) it is possible in godot 4 idk about 3

and if that does not work here is a third party atlas maker that works with godot

but again step1 is not cropping yourself but letting tool calculate the offsets needed to pack and unpack

i think

GitHub - KoBeWi/Godot-Spritesheet-Generator: A simple spritesheet generator addon that will also crop your frames.

It’s easy to crop an image, but each frame has a different size and after you crop them all, your spritesheet will be a mess. My generator finds a “globally minimal size”, so that frames are cropped, but don’t “jump” when put into a spritesheet.

rakkarage | 2022-02-08 20:10

rakkarage | 2022-02-14 05:41