Current packing method makes a grid of sprites with the size of the biggest sprite. I originally made it this way because I assumed that sprite centers had to be the same for sprites in the same animation.
It should be okay to pack tighter if we save the offset between original sprite center and packed sprite center, for each individual sprite. Then load those offsets during runtime and apply offsets in a function connected to AnimatedSprite2D's frame_changed() signal.
Since tigther packing will not be grid-based, scripts will also need to generate/consume information about where each spritesheet is located in the spritesheet.
Scripts/PackSpriteSheet.gd generates packed spritesheets and metadata.
Scenes/CreepSprite.gd consumes packed spritesheets and metadata.
To reduce size on disk and VRAM usage.
Current packing method makes a grid of sprites with the size of the biggest sprite. I originally made it this way because I assumed that sprite centers had to be the same for sprites in the same animation.
It should be okay to pack tighter if we save the offset between original sprite center and packed sprite center, for each individual sprite. Then load those offsets during runtime and apply offsets in a function connected to AnimatedSprite2D's frame_changed() signal.
Since tigther packing will not be grid-based, scripts will also need to generate/consume information about where each spritesheet is located in the spritesheet.
Scripts/PackSpriteSheet.gd
generates packed spritesheets and metadata.Scenes/CreepSprite.gd
consumes packed spritesheets and metadata.