godot-proposals
godot-proposals copied to clipboard
Make "Show Behind Parent" CanvasItem property inherit from its parent node
Describe the project you are working on
NoGame-APP
Describe the problem or limitation you are having in your project
Look, i want the ArmL was child of Body, so I add it to the Body i want ArmL behind Body, so I set ArmL's Show behind parent to true. it OK.
and now, I want ForeArmL was a child of ArmL and behind Body too. there was 2 way:
- set the ForeArmL's zindex to -1 --> It will cause other sprite that zindex==0 draw middle of the Player.
- use the remote transform node --> Yes, it work, but IMO inherit
show behind parentwas a better way.
Describe the feature / enhancement and how it helps to overcome the problem or limitation
Use remote transform node, it has 2 point I don't like:
- it broken my sprites's tree relationship. not better make sense.
- if i have much sprite, it need add much remote transform nodes.
Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams
let propety show behind parent was inherit. it mean:
if I set ArmL's show behind parent, because ForeArmL was a child of ArmL, so ArmL and ForeArmL will behind Body.
treat ArmL and it children as a whole.
For me, most situation was need this feature.
If this enhancement will not be used often, can it be worked around with a few lines of script?
No, I need remote transform node to do this.
Is there a reason why this should be core and not an add-on in the asset library?
It should be core.
This would be opt-in I assume? A new option? Otherwise this would break compatibility
Look, i want the ArmL was child of Body, so I add it to the Body i want ArmL behind Body, so I set ArmL's Show behind parent to true. it OK.
and now, I want ForeArmL was a child of ArmL and behind Body too.
Seems like there's some misconception in here, as CanvasItem.show_behind_parent already does affect the rendering order of the given CanvasItem and its whole subtree (its children, childrens' children, etc.; respecting other settings like z_index etc.).
So assuming that Body, ArmL and ForeArmL in the example above have default settings like z_index, y_sort_enabled , top_level, then setting ArmL.show_behind_parent = true will already make ForeArmL be drawn behind the Body.
| Setup | Order |
|---|---|
all default settings |
1. Hip2. Body3. ArmL4. ForeArmL |
| as above + ArmL.show_behind_parent = true |
1. Hip2. ArmL3. ForeArmL4. Body |
I guess what you actually want is for it to be drawn also behind the Hip? :thinking:
Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams
let propety
show behind parentwas inherit. it mean: if I set ArmL'sshow behind parent, because ForeArmL was a child of ArmL, so ArmL and ForeArmL will behind Body. treat ArmL and it children as a whole.
So AFAICT it already works like that, thus not sure what change is actually being proposed in here. :upside_down_face:
@kleonc Oh, Sorry, My fault. yes, it was work fine that I want.
I guess what you actually want is for it to be drawn also behind the
Hip? 🤔
Yes, I want this, i'm not notice the hip. i look it wrong with body, sorray again. thanks again.
