Version 0.5.7
Version 0.5.7 - Hiding and better pygame 2 support
Major Features
...............................
-
show() & hide() feature added to all elements. Allows you to temporarily hide and show a UIElement or UIWindow rather than having to kill() and recreate it each time when you want it out of sight for a bit. This feature was contributed by @ylenard so all thanks goes to them.
-
switch to using premultiplied alpha blending for pygame 2 - For a long while now features like rounded corners have not worked correctly with pygame 2. Thanks to some recent improvements in the latest version of pygame 2.0.0.dev10 pygame_gui has been able to switch to using pre-multiplied alpha blending when dev10 is also installed. This resolves all the visual issues with rounded corners and I think runs a teeny bit faster too.
Minor features
...............................
- enable() & disable() have been added to many more elements and windows - Maybe all of them now, even where it doesn't really make sense. Disable things to your heart's content.
- focus sets - This is a new concept I'm trialling in the UI to indicate a group of elements that together constitute a thing that should all have interaction focus at the same time. So far it's working fairly well and has made it easy to extend pygame 2's scrollwheel functionality so that you should now scroll the content of what you are hovering with the wheel (at least in most cases). In the future this idea may make it easier to handle keyboard only input and input via controllers.
- class IDs for UIElement objects - UIelement objects could always have an Object ID, but those were designed to be unique specifiers for events as well as theming and sometimes you want to pick out a specific group of elements for theming that all already have unique object IDs. Enter class IDs, there is a new datatype 'ObjectID' that you can pass when you create an element and it lets you set two string IDs, the old unique
object_id
and the newclass_id
. Once you have some objects sharing aclass_id
you can theme theme in a theme file theming block the same way you would with an object ID. It's also worth noting here that you can load multiple theme files into a single UIManager if you want to organise your theme data some more.
Dropped compatibility
..............................................
- No longer supporting pygame 1.9.3 & pygame 1.9.4 - Keeping up with the bugs in these old versions of pygame was holding back the GUI so I made the decision to drop support in this version. If you are still using pygame 1.9.3 or 1.9.4, my apologies.
Bug Fixes & Other Changes
.........................................................
- Switched to using a custom Sprite and SpriteGroup class as base for UI elements* - previously I was using the pygame classes but after getting up close and personal with them recently I realised that the existing sprite base was doing things that we weren't using and that a slimmed down sprite could speed things up. In my tests on windows this has made the draw loop about 10% faster.
- A series of fixes to the drop down menus - they should now not break when they would have overlapped previously and correctly set the height of the background when the height of a list item is set to a custom value. Thanks to all the people who submitted bugs with these.
- fixed a bunch of LGTM alerts - gotta have that A+ rating.
Further thanks
.............................
- Thanks once again to @ylenard for all their hard work put into this release.
- Thank you to everyone who reported issues in the GUI this time around. If you don't report 'em, we can't fix 'em.