Replies: 1 comment
-
nvm think this is a duplicate of #3971 and #3986 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Unity has a really useful feature called Sorting Layers, shown here: https://docs.unity3d.com/Manual/class-TagManager.html#SortingLayers
Which lets you set sprites to be on a specific layer and render over any sorting layer below them, and under any layer above them, in addition to being able to set the z index for that specific layer. This would be great to have in godot since in 2d games you often want to have a scene with sprites that will render above or below all other sprites of a certain type in the game, like shadows should always be under characters
Right now I have to keep a text file with a list of hard coded z indexes for all my sprites. For example in my game Theyest Thou this is what my layer file looks like:
dialog ui 100
walls 50
sparks/bullets/muzzle flashes 46
wall shadows 45
explosions 42
weapons in air/vfx 40
grenades 37
characters, weapons in hands 35
weapons on ground 30
wall edges 25
balcony railings 20
balcony 15
dead bodies 12
pickups, destroyed wall 11
balcony railing shadows and base shadows 10
blood 5
floor 0
back buffer -1
forest shadows -2
forest -3 <
I have to leave large buffers between indexes as well since I have no idea what might get added between them later. It would be really nice to have an easy way to handle this in editor with actually layer names instead of a numbered z index.
Beta Was this translation helpful? Give feedback.
All reactions