Version 0.7.0
Released May 17th, 2025
Breaking Changes
positionandsizeattributes removed fromUIelements - Use internalrectinstead.UIelement changes:- Had
set_pixel_position,set_pixel_size,set_scaled_position, andset_scaled_sizereplaced withset_pixel_transformandset_scaled_transform:Button,Frame,CheckboxInput, andTextInput.
- Had
checkedColoranduncheckedColorconstructor parameters forCheckboxInputrenamed tochecked_colorandunchecked_colorto comply with convention.textColorandyFlippedconstructor parameters forTextInputrenamed totext_colorandy_flippedto comply with convention.Buttonchanges:sceneparameter now required - New first positional argument.check_clickandcheck_hoverremoved -Scenewill handle these automatically.
CheckboxInputchanges:sceneparameter now required - New first positional argument.check_clickremoved -Scenewill handle these automatically.
TextInputchanges:sceneparameter now required - New first positional argument.check_clickandcheck_keyremoved -Scenewill handle these automatically.
ColorRGBandColorRGBAfrom_tuplerenamed tofrom_iterable.Scene.__init__should no longer be manually defined (as we are removing old boilerplate likesuper()). Useon_initinstead.Scene.on_initnow allows**kwargsto be passed fromEngine.set_scene.
Additions
Sceneon_renderandon_updatemethods are no longer abstract - their implementation is again optional.UIelementrectattributes are now no longer only readable properties - they can be directly written (Also allows future tweening, if implemented).ColorRGBandColorRGBA:format()now supported for other color representation conversions.- Get and set now supported via indices, i.e.
color[0]orcolor[1] = .... - Now hashable, so inserting into
sets are supported. - Supports iterations and being iterated over.
- New
.copy()method. - New
.to_numpy()conversion. - New
.hex()color representation. - New
.int()color representation.
ColorRGB:- Now supports comparisons with other
ColorRGBobjects or3-length iterables. - New
.hsl()color representation. - New
.hsv()color representation.
- Now supports comparisons with other
ColorRGBA:- Now supports comparisons with other
ColorRGBAobjects or4-length iterables. - New
.hsla()color representation. - New
.hsva()color representation.
- Now supports comparisons with other
Tween:ColorRGB/Anow supported.
- New
FPS/delta_timeframework.Pygame's internal timing is unreliable. __slots__to all instantiable classes to decrease object memory and increase lookup speed (~10%increase in FPS).
Fixes
- Docstrings and type annotations for
UIelements withset_scaled_sizecalled forIntVector2rather thanFloatVector2. Sceneevent handler forWINDOWRESIZEDevent was dispatching anIntVector2generated from non-existentsizeevent attribute, rather thanxandy.- Various docstring and type annotation fixes - Improved/clarified annotation types.
- Dropped support for
Engine.set_backgroundtaking aColorRGBAobject, asPygamedoesn't support window alpha values - Theavalue is now dropped. - Minor performance tweaks in heavily-executed loops and function calls.
Engine.set_update_intervalexpectedIntervalin the internal logic, but never accounted for when anintorfloatwas passed.