2.1.4
pygame-ce 2.1.4
# if you're switching over from pygame/pygame,
# remove it first to avoid conflicting namespace
pip uninstall pygame
pip install pygame-ce==2.1.4
Welcome, all! This release contains all the changes in the main branch of pygame/pygame from October through early February, mainly written by pygame-ce contributors, and of course all the pygame-ce progress in the past month!
Thank you to the community for all the support since the last release!
Because this contains so many months of changes, the release notes are quite long, so prepare yourself before reading further :).
What's Changed
Enhancements
-
@Starbuck5 and @oddbookworm worked on features to make font rendering better than ever before!
- Multiline text! You can set a pixel limit and do automatic line wrapping, and you can align text left/right/center. Additionally,
Font.render
will respect explicit newlines in the text. #1898 - Internationalization! We can now render non-latin alphabets much better with new
Font.set_script(...)
andFont.set_direction(...)
methods. For example, to render Arabic, you'd load a font that supports Arabic,Font.set_script("Arab")
, andFont.set_direction(pygame.DIRECTION_RTL)
. #1956, upstream #3330
- Multiline text! You can set a pixel limit and do automatic line wrapping, and you can align text left/right/center. Additionally,
-
@Matiiss added
pygame.mixer.music.get_metadata()
to potentially grab title/album/artist/copyright metadata from music files. #8 -
@ScriptLineStudios added
transform.grayscale
andColor.grayscale
(in case you're feeling gray). #1907 -
@itzpr3d4t0r dug into the source to optimize overhead on
mouse.get_pos()
,mouse.get_rel()
,Rect.colliderect()
,Rect.collidepoint()
,Rect.collidelist()
,Rect.collidelistall()
. These functions don't usually bottleneck people's code, but regardless, a 30-40% speedup on them is a cool thing to have. upstream #3424, upstream #3322, #1832, #1905 -
@PurityLake optimized blit mode code, achieving a 15-20% speedup while using blit blend modes for computers without AVX2 support. upstream #3370
-
@MightyJosip optimized pygame.draw.circle's with width (I saw a 300% performance boost in one case). upstream #3550
-
@itzpr3d4t0r added
Surface.fblits()
, which achieves faster speeds thanblits
by being slightly less flexible about input, as well as being highly optimized code itself. #1831, #1965 -
@Matiiss added
__round__()
method for pygame.Vector(2/3). upstream #3559 -
@avaxar implemented
pitch
argument forpygame.image.frombuffer
,pygame.image.from(string|bytes)
. #1863 -
@Matiiss replaced an unclear hardcoded error message with the value of
SDL_GetError()
. upstream #3641 -
@yunline add
IS_CE
constant to test for running on pygame-ce, i.e.if getattr(pygame, "IS_CE", False): print("Running pygame CE")
. #1900 -
@yunline added a "window" attribute DROPFILE and DROPTEXT events. upstream #3568
-
@oddbookworm made every dependency version getter work the same way, and return linked version vs compiled version. upstream #3379 and upstream #3567
-
@PurityLake added aliases to common objects. E.g.
pygame.Joystick(...)
instead ofpygame.joystick.Joystick(...)
,pygame.Font(...)
,pygame.Clock(...)
,pygame.Event(...)
,pygame.Channel(...)
. #1854 -
@oddbookworm added a debug method to print out tons of pygame details. #2
-
@avaxar implement
draw_triangle
anddraw_quad
inpygame._sdl2
. #1876 -
@MyreMylar added a way to premultiply a Surface's alpha, starting on a track towards optimized alpha blits via premultiplication. upstream #3276
Bugfixes
-
@ankith26 fixed the "MacOS font rendering bug" that shall live in infamy-- where MacOS < 12 macs couldn't render fonts at all. #1922
-
@zoldalma999 made sure updating a Texture with a Surface takes into account pixel format. upstream #3548
-
@ankith26 fixed a regression where
camera.list_cameras()
would be empty on Linux. upstream #3594 -
@ankith26 fixed several memory leaks in the math module. upstream #3590
-
@oddbookworm fixed potential segfaults in
PixelArray
,Surface
,draw
, andtransform
. upstream #3666, #1940 -
@ankith26 fixed a bizarre bug where fast mouse scrolls would have a bogus
.button
attribute. upstream #3642 -
@yunline fixed reversed
Window.borderless
in the _sdl2 module. #1869 -
@Temmie3754 ensured toggle_fullscreen works for maximized window. #4
Deprecations, Potential Breaking Changes, and Removals
-
Python 3.6 support has been dropped. Thanks @yunline for implementing that in #1896 and #1936
-
pygame.display
"gamma" functionality has been deprecated as it has been removed in the upcoming SDL3. Thanks @SSS-Says-Snek for implementing that in upstream #3622 -
pgScancodeWrapper
now raisesTypeError
when you attempt to iterate over it, since iterating it is a footgun. Thanks to @PurityLake for implementing that in #1855
Docs, Examples, and Types
-
@pgattic, @winterhazel, @CodeMaster7000, @chimosky, and @IlmastroStefanuzzo fixed typos and grammar mistakes. upstream #3554, upstream #3562, upstream #3625, upstream #3694, #1879
-
@Matiiss and @novialriptide polished up
PixelArray
andmath
docs. upstream #3544, upstream #3581, upstream #3574. -
@Linkid fixed several links in the docs. upstream #3549
-
@zoldalma999 documented
SDL_JOYSTICK_ALLOW_BACKGROUND_EVENTS
. upstream #3546 -
@Starbuck5 added a pygame quickstart section to docs front page. upstream #3541
-
@SmashedFrenzy16 updated README to replace a list with a table. upstream #3638
-
@novialriptide, @yunline, @PurityLake, and @khiaxeng worked on enhancements throughout the docs. upstream #3684, upstream #3558, #1916, #1920, #1964
-
@pycoinfu overhauled the "stars" example. #1909
-
@ankith26, @Matiiss, and @yunline fixed typestub related errors in upstream #3395, #1885, #1
Cleanups and Robustness
-
@yunline, @MyreMylar, @Koswu, and @Starbuck5 removed unused and obsolete code from the codebase. #1895, #1904, upstream #3563, upstream #3553, upstream #3618 , upstream #3617
-
@ankith26 and @Starbuck5 worked to make the SIMD code (low level code for blitting) simpler and emit better warnings. upstream #3501, upstream #3588
-
@ankith26 worked to make the key compat table more robust. upstream #3426
-
@MyreMylar, @Matiis, @itzpr3d4t0r, @Starbuck5, and @TheVroum worked to simplify and spruce up code throughout the codebase. upstream #3530, #15, upstream #3655, upstream #3633, #1938, upstream #3577, upstream #3620, upstream #3595
-
@avaxar changed
pygame.time
to useSDL_GetTicks64
when possible, which stopspygame.time
from having a 32 bit rolloverdaysinto program runtime. #1873
Operations
-
@ankith26, @MyreMylar, @Starbuck5, @yunline, and @novialriptide all helped keep the CI running and up to date and passing, which is hugely important. Special kudos to @ankith26 and @MyreMylar for their amount of work on this. upstream #3611, upstream #3647, upstream #3698, upstream #3695, #790, #1838, #1849, #1852, #1882, #1888, #1867, #1891, #1899, #1901, #1946
-
@cgohlke Fixed build errors on win_arm64. upstream #3583
-
@Starbuck5, @oddbookworm, @Mega-JC, @Matiiss, @gresm, and @novialriptide all helped get pygame-ce set up as its own independent project. #6, #7, #13, #10, #1921, #1914, #1858, #1865, #1871
-
@MyreMylar added a CODEOWNERS file to set up our review structure. #14
-
@pmp-p continued work on improving pygame wasm CI, and making runtime behavior more optimal. upstream #3593, #1861, #1948
-
@novialriptide renamed a folder, and @Starbuck5 added a folder to the gitignore, #1925, upstream #3587
-
@Ritikkhulbe, @novialriptide, and @oddbookworm made sure our README badges were in tip-top shape. #1893, upstream #3599, #1880, #1872
New Contributors
- @pgattic made their first contribution upstream in #3554
- @winterhazel made their first contribution upstream in #3562
- @Koswu made their first contribution upstream in #3563
- @yunline made their first contribution upstream in #3568
- @CodeMaster7000 made their first contribution upstream in #3625
- @SmashedFrenzy16 made their first contribution upstream in #3638
- @TheVroum made their first contribution upstream in #3595
- @chimosky made their first contribution upstream in #3694
- @IlmastroStefanuzzo made their first contribution in #1879
- @Ritikkhulbe made their first contribution in #1893
@khiaxeng made their first contribution in #1964
Full Changelog: 2.1.3...2.1.4.dev2
And finally...
It is time to officially open contributor nominations for the Pygame Community Edition "Steering Council" who will guide the Community Edition of pygame for the next year. The steering council concept is modelled after the similar governance structure for Python itself, and the structure of other large, community driven, open source projects. You can read more about the steering council here. If you are an official contributor and want to nominate yourself for election then send an email to [email protected] and you'll be added to the candidates list.
Due to the small size of the electorate this year, nominations will be open only for a week from this release and then we will do the voting after that for a week, or until everyone has had a chance to vote. Voting will be done via the Helios Voting platform.