godotengine / godot-proposals

Godot Improvement Proposals (GIPs)
MIT License
1.15k stars 97 forks source link

Add animation support from Sprite to TextureRect #1999

Open trommlbomml opened 3 years ago

trommlbomml commented 3 years ago

Describe the project you are working on

Pixel-Art oriented 2.5 Game.

Describe the problem or limitation you are having in your project

Animate Texture Rect controls with spritesheets.

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

The TextureRect control would be extended to have the "Animation" section properties of sprite, which are:

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

For ideal I would expect you can simply take the logic from the Sprite node and take it over 1:1 to the TextureRect node.

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

You can workaround it by manually resizing the sprite and repositioning it, but I think that is a task of a UI control and not the user.

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

Because you would make the TextureRect more usable and flexible.

KoBeWi commented 3 years ago

You can workaround it by manually resizing the sprite and repositioning it, but I think that is a task of a UI control and not the user.

You can make a script that does this automatically for you. Then put the Sprite as a child of Control node.

trommlbomml commented 3 years ago

with the same flexibility as anchors? I am not convinced that this should be reinvented by users.

Zaya6 commented 3 years ago

I've been wondering why sprite animation hasn't been supported by the GUI for some time now.

jusw85 commented 3 years ago

Related #1754

torontocaper commented 1 year ago

Just stopping by to say I would be in favour of this! I'm not much of a programmer but I'd be happy to help with the implementation however I can.

Calinou commented 1 year ago

@torontocaper Please don't bump issues without contributing significant new information. Use the :+1: reaction button on the first post instead.