Skip to content

Activate/Deactivate UI Elements #5360

@undersquire

Description

@undersquire

What problem does this solve or what need does it fill?

In my game right now, I want to be able to deactivate UI components when closing a menu, and re-activate them when I show that menu. Right now the only way to achieve this is to completely despawn the entities of this menu, which is a bit inconvenient as I have to completely reconstruct this menu when respawning it.

I originally had the impression that making a UI element invisible (via Visibility component) would disable the the ability to interact with the UI element.

What solution would you like?

I was thinking either making the Visible component control the active state of a UI element, or having a separate component UIState or something.

What alternative(s) have you considered?

I've had discussions on the discord before about a possible universal "entity de-activation" system via multiple worlds (when this is implemented). This could work by moving an entity into another inactive world and moving them back when you need to "re-activate" it.

Metadata

Metadata

Labels

A-UIGraphical user interfaces, styles, layouts, and widgetsC-BugAn unexpected or incorrect behaviorC-UsabilityA targeted quality-of-life change that makes Bevy easier to use

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions