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

How can I disable a widget? #217

Open
PowerOfCreation opened this issue Feb 26, 2023 · 1 comment
Open

How can I disable a widget? #217

PowerOfCreation opened this issue Feb 26, 2023 · 1 comment

Comments

@PowerOfCreation
Copy link

PowerOfCreation commented Feb 26, 2023

Is it possible to disable a widget? Say I have a pause screen and I want to show it only sometimes. I made this functionality possible with a custom ButtonWidget to disable user interaction and by turning off the ui camera, but getting that to work was very painful and I wonder if there is a proper way. Also my current approach will make the entire UI invisible instead of only a specific widget.

@StarArawn
Copy link
Owner

Widgets can be "disabled" by not rendering them. Please look at the conditional example here:
https://github.com/StarArawn/kayak_ui/blob/main/examples/conditional_widget.rs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants