playcanvas / playcanvas/engine
Element component enable/disable before first initialize leads to element being drawn all over the screen.
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 16.8k
- Forks
- 2k
- Avg merge
- 4h 32m
- Merged PRs (30d)
- 222
Description
Project: https://playcanvas.com/project/810589/overview/uibug
Description
It is a weird bug, that I have encountered various times working with UI systems, which was difficult to narrow down.
Launch a project, and see a white screen, while the entity with the element component is disabled at that moment. It should not be rendered at all.
Steps to Reproduce
- Have a 2D Screen
- Add entity with an image element
- Disable that entity
- Enable that entity post-launch, but disable straight away in initialize script attached to that entity.
Issue:
That whole image is now drawn over the whole screen, even when it is being disabled.
This has bitten me and other devs many times and is hard to figure out why it is happening in complex scenarios.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
No source file or test is named. Start by reproducing the behavior in the linked PlayCanvas project using the listed screen, image element, and initialize steps, then trace the element component's enable/disable and rendering lifecycle. Done means a component disabled in initialize is not drawn, including when it was enabled after launch.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- game-dev
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100