Skip to content

Version 0.6.0

Compare
Choose a tag to compare
@MyreMylar MyreMylar released this 31 Dec 18:29
· 854 commits to main since this release
9664f4d

Version 0.6.0 - The text update πŸŽ† πŸŽ† πŸŽ†

Upgrade with: pip install pygame_gui -U

The focus of this update was on everything to do with text in the GUI. The full change list is below, but tools to assist with localization is the big new feature.

If anyone out there speaks French, Italian, German, Spanish, Portuguese, Indonesian, Russian, Chinese or Japanese and would like to help, then the new default translation files are located here and were translated largely through the not-super-reliable google translate. If you have any improvements to suggest to them, pull requests and issues are welcome!

As there were a lot of changes in this update I'm expecting a commensurate amount of bugs, so please as you find them report them over on the Github issue tracker and I'll try to put out a patch early in 2022 with anything that gets found.

Dropped compatibility & Breaking changes
..............................................

  • Dropped support for Pygame 1 - Pygame 2 has been out for some time now and switching fully to Pygame 2 (Pygame 2.0.1 is the new lowest supported version) allows the library to adopt its new features and remove some old compatibility hacks.
  • Dropped support for Python 3.5 - Python 3.5 has been end-of-life for some time. Removing support for it allows the library to use 3.6 onwards features like f strings. This is following pygame 2 also dropping 3.5 (and earlier) support.
  • Simplified UI events - New events are generated with 'type' set to the previous 'user_type' values. This makes event processing code simpler. Old events will continue to exist until 0.8.0 but please move to the new style of events as they are the only ones that will get new attributes, new events added in 0.6.0 are only in the new style.

Major Features
...............................

  • Localization Support - There is now some basic support for switching the language of the GUI to one of ten supported languages.
  • New Console Window - A new default GUI element that provides support for text shell/console type user interaction.
  • Rewritten & unified text backend - The text displaying and laying out portions of the GUI have all been massively changed and all the GUI elements now all share common code. This makes it easier to add new features to the text, and also have them work everywhere.

Minor features
...............................

  • UIButtons & UILabels can now scale based off their text - passing in -1 for a dimension will cause that dimension to be set based on the height or width of the element's text.
  • More default options to allow only certain characters in UITextLine - 'alpha_numeric' was added as an option for the latin alphabet. The underlying system was adjusted to allow for localised versions of these character sets, but these do not yet exist.
  • set_text_hidden() added to UITextLine - To enable a 'password' style entry line.
  • text shadow theming options added to UIButton - Previously these were only on the UILabel.
  • tag images can now be added to to a UITextBox - Makes it easier to wrap text around images and have inline images in text (colourful emoji?)
  • get_relative_mouse_pos() added to UIWindow - gets a mouse position relative to the UIWindow you call it from.
  • UISlider now moves in customisable fixed increments when clicking arrow button - Makes it easier to have precise sliders.
  • UIButton events can now be produced by any mouse button - new 'mouse_button' attribute on button events & 'generate_click_events_from' parameter to UIButton.
  • UIDropDown open/close drop down button width added as theming option - Called 'open_button_width'.
  • Text alignment theming options for UITextBox & UILabel - See their theming pages for details.
  • Improved text effects - Effects can now be applied to tagged chunks of text in a text box, some effects can also be applied to UILabels. There are parameters for effects, and an event fired when an effect finishes.

Bug Fixes & Other Changes
.........................................................

  • PyInstaller should work correctly with pygame_gui - A 'hook' file has been added to scoop up the default data for pygame_gui, and documentation added on using Pyinstaller & Nuitka with the library. See issue #166
  • Fixed issue with window resolution changes - Thanks to @lonelycorn issue #215

  • tag fixed to produce blank lines
    - See issue #217
  • Fixed missing type cast in UIFileDialog - Thanks to @GUI-GUY issue #207
  • Fixed issues with adding lines to bottom of UITextBox - Demonstrated in new UIConsoleWindow window. See issues issue #69 and issue #78
  • Fixed issues with positioning UIDropDown inside container - See issues issue #179 and issue #153
  • Improved scaling support - I still don't have the hardware to test this properly, but thanks to @jlaumonier, see issue #210 it should work a bit better.
  • Fixed html link click events firing multiple times in some circumstances - Thanks to @RedFlames for finding and fixing this. See issue #206
  • Various documentation improvements and updates - Thanks to everyone who pointed out things they didn't understand on GitHub, in Discord or in person. I've tried to make things clearer wherever I can. Keep letting me know when you get stuck!

Further thanks & Pull Requests
..............................

While I was very slowly rebuilding the text back end for 0.6.0 the library also received several pull requests that
will now make their way into the released version. After 1.0.0, when I (@MyreMylar) finish my main work on it, pull
requests like this will be the main way the library changes from version to version.

For now I'm putting them in their own section of this changes document to highlight them (unless there is a pull request
that adds a big feature that is going up top as well)

  • Fixed redundant redrawing of UITextEntryLine() - Thanks to @glipR, see #178
  • Fixed double clicking folder in UIFileDialog - Thanks to @glipR, see #197
  • Fixed hiding & showing disabled buttons - Thanks to @xirsoi, see pull #185
  • Fixed grammatical errors in index.rst - Thanks to @nonoesimposible, see #208
  • Added ability to set default values for UISelectionList - Thanks to @teaguejt, see #213
  • Fix invalid URL for game project examples - Thanks to @Grimmys, see #216

Known Issues
...........................

  • There is a bug with placing some varieties of img tags next to each other that I still need to track down. for 0.6.1

Thanks for reading!