godotengine / godot-proposals

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

Sprite Overlays #608

Closed SpyrexDE closed 2 years ago

SpyrexDE commented 4 years ago

Describe the project you are working on:

I am working on a pixel-art top-down shooter with focus on animations.

Describe the problem or limitation you are having in your project:

I want to make sprite overlay animations. But Godot is only able to do that using shaders, what realy is a pity.

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

There could be a feature for that like how it is in GameMaker: (https://www.youtube.com/watch?v=ZrvKmDpVP6I) or maybe a "Sprite Overlay"-Node. I would prefer the second option.

Describe how your proposal will work, with code, pseudocode, mockups, and/or diagrams:

The "Sprite Overlay"-node could be a node you can put as a child on a Sprite-Node. It inherits from the normal sprite node and there could be some extra options I don't know at the moment because I am extremely new to programming.

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

I saw a lot of Indiegames using sprite overlays. But depending on the engine they are used more often because there is a feature like this. It would help a lot of people to develop their games. I already asked for a sloution on reddit(https://www.reddit.com/r/godot/comments/flshso/is_there_a_way_to_create_sprite_overlays_in_godot/) but only received a way to do that with shaders. And when you do it in that way you are not able to animate the sprite overlay.

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

Because it is an elemental feature you can use in nearly every game. In addition to that you can include it into the node/scene-system what effect, that you can put overlays on overlays, animate/tween them or get the input the overlays received.

Jummit commented 4 years ago

I think this could be a blend mode of CanvasItemMaterial.

EDIT: Maybe not directly a blend mode, because those are specifically chosen because they are very fast. An option like "add onto parent" in CanvasItem would be better.

Xrayez commented 4 years ago

I think this could be a blend mode of CanvasItemMaterial.

Related proposal: #470.

Also it seems like people are coming from GameMaker and Construct background.

ghost commented 4 years ago

Not exactly sure, but isn't this masking? Would be great to have built-in, I agree, would save a lot of time.

Calinou commented 2 years ago

EDIT: Maybe not directly a blend mode, because those are specifically chosen because they are very fast. An option like "add onto parent" in CanvasItem would be better.

This now exists as the CanvasGroup node in the master branch. CanvasItem clipping can also be achieved using the relevant property in CanvasItem in master, closing.