Children of entity doesn't inherit z or opacity
Hi, maybe i am wrong, but it is common, that child "inherits" props from parent... For now, it is "z" and "opacity" but i think, it is more. "scale" for example works well...
Steps to Reproduce
let a = new ex.Actor({ pos: ex.vec(100, 100), z: 999 }); // z is important here
a.graphics.use(new ex.Rectangle({ width: 100, height: 100, color: ex.Color.Blue }));
let b = new ex.Actor({ pos: ex.vec(20, 20) });
b.graphics.use(new ex.Rectangle({ width: 100, height: 100, color: ex.Color.Orange })); // z not inherits
a.addChild(b);
this.add(a);
Expected Result
orange rectangle over blue
Actual Result
blue is over orange rectangle
Environment
Engine Version: 0.30.0-alpha.1053+29fef3b
Current Workaround
b.z=a.z
@spustlik I have good news, we've made it so that z is inherited in the latest alpha build! Currently unreleased as of yet.
You can check out the PR here #3070 try the slightly newer alpha 0.30.0-alpha.1066+a8e5082
@spustlik Is the desire to also inherit opacity from the parent?
Yes please, i think it is usually expected
It also came up in the discord that it might be useful for tint to also do this
This issue hasn't had any recent activity lately and is being marked as stale automatically.
@spustlik Children now inherit opacity should be deployed in alpha soon!