godotengine / godot-proposals

Godot Improvement Proposals (GIPs)
MIT License
1.12k stars 69 forks source link

Cropping and Offset fields for single Animations or Frames of Animations in the SpriteFrames Resource #2060

Open your-sudden-death opened 3 years ago

your-sudden-death commented 3 years ago

Describe the project you are working on

I am working on a small 2D platformer game in pixelart style with Animations composed of Frames as png files

Describe the problem or limitation you are having in your project

When using the SpriteFrames Resource to add animations to my main character I cannot specify any offset or cropping for one animation or one frame. To crop or offset the frame I have to go to a program like GIMP for each frame and do it manually

Describe the feature / enhancement and how it helps to overcome the problem or limitation

Having separate fields for Offset and Cropping in the SpriteFrames dock will make importing Animations that are not cropped/offset perfectly much easier

Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams

In the SpriteFrames dock there should be editing possibilities for these values, for example beside the "FPS" option or in the inspector

If this enhancement will not be used often, can it be worked around with a few lines of script?

Not really, this would be implemented as a core editor functionality, however it is entirely optional to use, because if the values are left in the default state (no cropping, no offset) they do not affect the outcome in any way

Is there a reason why this should be core and not an add-on in the asset library?

Changes to core editor nodes/systems like the SpriteFrames and the AnimatedSprite are a bit impractical for addons to tweak.

Reference

I am going to reference the original request in the main repo's issues here for further information and convenience: Reference

golddotasksquestions commented 3 years ago

Note you can easily set an offset using AnimationPlayer+Sprite instead of AnimatedSprite. AnimatedSprite is really basic in it's features. I would recommend anyone who wants full control over their animation to use AnimationPlayer + Sprite instead.

your-sudden-death commented 3 years ago

@golddotasksquestions That is correct, however having basic features like crop/offset for a whole animation makes quick animations via bulk import and then bulk tuning easier. Most of the time all frames of an animation are off by a few pixels or have some extra blank pixels on the bottom in the same way, so having the possibility to quickly fix those imperfections.

baidwwy commented 1 year ago

Please support Sprite2d in 4.x SpriteFrames