Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Child spines don't inherit parent container's alpha #5853

Closed
spayton opened this issue Oct 2, 2021 · 2 comments · Fixed by #6023
Closed

Child spines don't inherit parent container's alpha #5853

spayton opened this issue Oct 2, 2021 · 2 comments · Fixed by #6023
Labels
🐛 Spine An issue arising from the Spine runtime

Comments

@spayton
Copy link
Contributor

spayton commented Oct 2, 2021

  • Phaser Version: 3.55.2+

Description

The child spines of a regular container do not use the parent's alpha, but child spines of a spineContainer do.

Example Test Code

Running example here https://jsfiddle.net/stupot/scojxkn8/26/

The example will open using a regular container, with 2 spines in it. The container alpha is set to 0.2, but the spines appear solid.

Change value in line 63 to change container type. Setting it to 1 will use a spineContainer and the spines will now appear semi-transparent, as expected.

I would expect the spines to use the parent alpha regardless of which container type is used, in the same was positio/rotation/visible are honoured.

@photonstorm photonstorm added the 🐛 Spine An issue arising from the Spine runtime label Oct 4, 2021
@spayton
Copy link
Contributor Author

spayton commented Feb 24, 2022

The render call in Phaser.GameObjects.Container#renderWebGL doesn't pass the container. Just addng that parameter seems to fix it, though not fully tested.

The line

child.renderWebGL(renderer, child, camera, transformMatrix);

should be

child.renderWebGL(renderer, child, camera, transformMatrix, container);

@photonstorm
Copy link
Collaborator

Thanks for opening this issue, and for submitting a PR to fix it. We have merged your PR into the master branch and attributed the work to you in the Change Log. If you need to tweak the code for whatever reason please submit a new PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 Spine An issue arising from the Spine runtime
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants