Excalibur icon indicating copy to clipboard operation
Excalibur copied to clipboard

Children of entity doesn't inherit z or opacity

Open spustlik opened this issue 1 year ago • 4 comments

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 avatar May 30 '24 14:05 spustlik

@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

eonarheim avatar Jun 01 '24 02:06 eonarheim

@spustlik Is the desire to also inherit opacity from the parent?

eonarheim avatar Jun 01 '24 13:06 eonarheim

Yes please, i think it is usually expected

spustlik avatar Jun 03 '24 12:06 spustlik

It also came up in the discord that it might be useful for tint to also do this

eonarheim avatar Jul 02 '24 00:07 eonarheim

This issue hasn't had any recent activity lately and is being marked as stale automatically.

github-actions[bot] avatar Sep 01 '24 00:09 github-actions[bot]

@spustlik Children now inherit opacity should be deployed in alpha soon!

eonarheim avatar Sep 12 '24 01:09 eonarheim