Skip to content

Add a overlays.setVisible(name, visible) API #3853

@lea108

Description

@lea108

Problem to solve

In some scenarios it is desired to just describe for each overlay the conditions when it should be visible or not directly to a setter rather than having to conditionally call add/remove.

For example like this:

game.overlays.setVisible("hud", game.gameState.level > 0 && !game.gameState.paused);

instead of:

if (game.gameState.level > 0 && !game.gameState.paused) {
  game.overlays.add("hud");
} else {
  game.overlays.remove("hud");
}

Proposal

Add a new member function setVisible to OverlayManager.

More information

flame version: 1.36.0

Other

  • Are you interested in working on a PR for this?

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions