pypi pygame-ce 2.5.6

10 hours ago

đŸ•šī¸đŸŽ¯âšĄđŸ…đŸ“™đŸ•šī¸đŸŽ¯âšĄđŸ…đŸ“™đŸ•šī¸đŸŽ¯âšĄđŸ…đŸ“™đŸ•šī¸đŸŽ¯âšĄđŸ…đŸ“™đŸ•šī¸đŸŽ¯âšĄđŸ…đŸ“™

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 to mask.to_surface in #2670. @ankith26 followed up with a minor docs fix for it in #3484. The area 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 for Joystick and Controller 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 and Renderer.coordinates_from_window to map renderer (logical) coordinates to window (pixel) coordinates and vice-versa in #3519.
  • @Matiiss added Color.__bytes__ to support usages like bytes(Color(...)) in #3547.
  • @XFajk implemented Line.project in #3402. This gives an easy way to project a point onto a line with the geometry 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 (and Sound.__copy__ for copy.copy support) in #3556. With this one can easily make copies of Sound instances.
  • @mzivic7 added and @ankith26 improved the width argument of draw.aaline in #3191 and #3510 respectively. Yes, this means that now you can draw thick lines that also look smooth with the draw module, how cool!

Enhancements

  • New contributor @cherez added weak reference support to Texture in #3590 and to freetype.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 and sndarray, 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 the FASTCALL calling convention, leading to a 25-30% improvement in #3518.

Docs and Types

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.

Maintenance

New Contributors

Full Changelog: 2.5.5...2.5.6

Don't miss a new pygame-ce release

NewReleases is sending notifications on new releases.