-
Notifications
You must be signed in to change notification settings - Fork 83
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
Show hide feature #136
Show hide feature #136
Conversation
…mplemented show()/hide() methods in UIContainer. Implemented a new class UILayeredUpdates inheriting from pygame.sprite. LayeredUpdates that omits UIElements with is_visible flag == False when drawing. Made UIManager use the new UILayeredUpdates class instead of pygame.sprite. LayeredUpdates. Changed method process_events() in UIManager to ignore UIElements with is_visible flag == False when checking MOUSEBUTTONDOWN events. Changed method update() to ignore UIElements with is_visible flag == False when checking hover events. Added tests for show / hide behaviour of UIElements and UIContainers.
… UIButton and UIImage.
…ner. Updated UIHorizontalScrollBar.
…UIToolTip and various windows that show()/hide() is unsupported for now. Merged new changes from upstream/master.
…ill transition to normal state. Started filling in the comments and docstrings.
Codecov Report
@@ Coverage Diff @@
## master #136 +/- ##
==========================================
- Coverage 95.12% 94.29% -0.84%
==========================================
Files 56 56
Lines 7426 7570 +144
==========================================
+ Hits 7064 7138 +74
- Misses 362 432 +70
Continue to review full report at Codecov.
|
Amazing! Huge thanks for the giant contribution. I'll merge this into master and see about adding a button somewhere in the general UI example project that toggles show and hide on and off. |
You're welcome, I hope everything works correctly and that it will be useful. I'd like to implement a couple more things:
So expect another pull request shortly. |
'show()' / 'hide()' methods and 'visible' argument of init() has been implemented for all UIElements and UIContainer.
I also implemented several tests and wrote some docstrings.