đšī¸đ¯âĄđ đđšī¸đ¯âĄđ đđšī¸đ¯âĄđ đđšī¸đ¯âĄđ đđšī¸đ¯âĄđ đ
pip uninstall pygame # (if previously installed, to avoid package conflicts)
pip install pygame-ce --upgrade
đšī¸đ¯âĄđ đđšī¸đ¯âĄđ đđšī¸đ¯âĄđ đđšī¸đ¯âĄđ đđšī¸đ¯âĄđ đ
Welcome to pygame-ce 2.5.6, our latest and greatest release. This release is the first to support Python 3.14 and PyPy 3.11 at launch, although wheels for both were retroactively added to the last release months ago. Additionally, PyPy 3.9 and PyPy 3.10 support was dropped, as they are end of life. This will be the last release with support for Python 3.9, which is fast approaching its own end of life date. The bundled SDL version was updated from 2.32.6 to 2.32.10.
This release was made possible by the work of 27 contributors who made 429 commits spanning across 106 PRs. Overall, 10,226 line additions and 5,343 line deletions were made across 226 files. Amazing! As always, we are grateful to everyone who made this release happen - from contributors, to people reporting issues, to PR reviewers. A big thanks also to those who helped the pygame-ce community whether that be making tutorials, helping people on forums, sharing cool things made with pygame-ce, or just talking about it online with other people. And thank you for reading the release notes and using pygame-ce! Let us know if we made any mistakes in these release notes so that we can correct them at the earliest.
Now, onto the release notes!
New API
- @Matiiss added the
area
kwarg tomask.to_surface
in #2670. @ankith26 followed up with a minor docs fix for it in #3484. Thearea
kwarg controls what portion of the mask instance is drawn to the surface. - @AntonisDevStuff added the
Color.from_hex
constructor in #3456. - @oddbookworm added
set_led
forJoystick
andController
objects in #3507. @aatle followed up with stubs improvements for it in #3524. This can be used to set or clear the colors of LEDs on joysticks and controllers. - @DickerDackel added
Renderer.coordinates_to_window
andRenderer.coordinates_from_window
to map renderer (logical) coordinates to window (pixel) coordinates and vice-versa in #3519. - @Matiiss added
Color.__bytes__
to support usages likebytes(Color(...))
in #3547. - @XFajk implemented
Line.project
in #3402. This gives an easy way to project a point onto a line with thegeometry
API. - @oddbookworm implemented
transform.pixelate
to support surface pixelation in #2354. - @robertpfeiffer added
transform.flood_fill
in #2840. This works like the paint bucket tool found in tools like GIMP and ASEprite; now you can apply it directly to pygame surfaces! - @bilhox implemented
(F)Rect.relcenter
in #3089 to get or set the center coordinates relative to the topleft coordinates. - @oddbookworm added
Sound.copy
(andSound.__copy__
forcopy.copy
support) in #3556. With this one can easily make copies ofSound
instances. - @mzivic7 added and @ankith26 improved the
width
argument ofdraw.aaline
in #3191 and #3510 respectively. Yes, this means that now you can draw thick lines that also look smooth with thedraw
module, how cool!
Enhancements
- New contributor @cherez added weak reference support to
Texture
in #3590 and tofreetype.Font
in #3596. - @pmp-p added Python 3.13 support to our emscripten builds in #3496. @ankith26 followed up with adding emscripten (pygbag + pyodide) support in the meson buildconfig in #3588 (with much appreciated help from @pmp-p and pyodide maintainer @ryanking13). As a result of these changes, we are back to supporting pyscript/pyodide after a brief period without support.
- @zoldalma999 moved mouse and key docs to stubs in #3441.
- @ankith26 fixed window event and key repeat handling in
sdl2-compat
in #3470. - @oddbookworm added freethreaded build status indicators to prompts in #3554.
Bugfixes
- @MyreMylar fixed unusual pitch handling in
Surface.premul_alpha
in #2882. - @ankith26 fixed ASAN issues in
Surface.scroll
in #3497. He also fixed ASCII scrap on mac/linux platforms and improved docs/tests in #3473.
Performance
- @aatle contributed lazy loading of
surfarray
andsndarray
, to avoid eager loading of NumPy. In testing, this reduced the import time of pygame-ce by half, from 200 ms to 100 ms. See #3249. - @Starbuck5 optimized
Vector
- number math by avoiding redundant checks in #3454. Benchmarks show 5% improvement. - @Starbuck5 optimized
Vector
creation by up to 30% by avoiding redundant checks in #3458. The optimization makes the most difference when passing in(x, y)
or(x, y, z)
as a tuple instead of as separate arguments. - @ankith26 optimized
(F)Rect.inflate(_ip)
to use theFASTCALL
calling convention, leading to a 25-30% improvement in #3518.
Docs and Types
- New contributors @wade-cheng, @tomatophu, @f4ni, @zepredos all made grammar fixes or typo fixes in the docs, in #3498, #3522, #3568, and #3566.
- New contributor @nachomaiz and @aatle improved type hints sprites in #3488 and #3525 respectively.
- @AntonisDevStuff and new contributor @Guedxx added README translations for Greek and Brazilian Portuguese respectively, in #3503 and #3582.
- @damusss and @Starbuck5 did a few cleanups in #3603, #3490, and #3607.
- @DickerDackel improved the docs for
Renderer.logical_size
in #3520. - @ankith26 improved the docs for
math.lerp
in #3523. - @ankith26 removed usage of deprecated
ByteString
type from the stubs, updated stubs to pass mypy stubcheck with latest mypy version, in #3600 and #3602.
SDL3 Porting
We've been working on SDL3 support for quite a while now, and have now largely moved from "let's get this compiling" to "let's get this actually working," which is satisfying. One large remaining blocker is audio support, as SDL3_mixer is very different from SDL2_mixer.
- @Starbuck5 got the Surface and freetype modules compiling on SDL3 in #3435 and #3574.
- @ankith26 got the display module compiling on SDL3 in #3428.
- @MightyJosip fixed SDL-init functions runtime behavior in #3509.
- @ankith26 and @Starbuck5 did lots of runtime fixes across the codebase in #3515, #3550, #3544, #3549, #3580, #3579, and #3573.
Maintenance
-
@MightyJosip refactored alphablit code to improve it in #3404 and ported
Texture
to C code in #3330. -
@aatle rewrote sprite collision functions to improve code quality in #3209.
-
@AntoineMamou improved rect tests by using literal values in #3190.
-
@zoldalma999 added stubs as dependencies to doc pages in #3534.
-
- Added PyPy 3.11 support in #3527.
- Refactored
base.c
code and introduced base header in #3486. - Updated Python versions in
run-ubuntu-checks
workflow, and fixed faulty refcounting in rect clipline in #3548. - Added a Coderabbit configuration file in #3564.
- Pinned astroid version below 4.0.0 to fix docs in #3598.
-
- Added conditional skips to platform specific tests and did other test improvements in #3476, #3471, #3575, #3474, and #3570.
- Improved CI structuring and skip logic in #3483 and #3489.
- Applied some minor bug fixes and enhancements to various modules (display, window, image, pixelarray, math) in #3591 and #3487.
-
@ankith26 and @damusss enhanced our meson buildconfig and developer tooling (
dev.py
) in #3500, #3493, #3495, and #3529. -
@Starbuck5 and @ankith26 kept SDL and other build dependencies updated in #3481, #3545, #3586, and #3443. They also managed pygame-ce releases in #3608, #3479, and #3619.
-
@dependabot kept our dependencies updated in #3608, #3599, #3594, #3593, #3584, #3583, #3569, #3561, #3559, #3558, #3557, #3552, #3551, #3540, #3526, #3505, and #3504.
New Contributors
- @wade-cheng made their first contribution in #3498.
- @nachomaiz made their first contribution in #3488.
- @tomatophu made their first contribution in #3522.
- @zepredos made their first contribution in #3566.
- @f4ni made their first contribution in #3568.
- @Guedxx made their first contribution in #3582.
- @cherez made their first contribution in #3590.
Full Changelog: 2.5.5...2.5.6