Skip to content

2.1.4

Compare
Choose a tag to compare
@github-actions github-actions released this 05 Mar 06:58

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(...) and Font.set_direction(...) methods. For example, to render Arabic, you'd load a font that supports Arabic, Font.set_script("Arab"), and Font.set_direction(pygame.DIRECTION_RTL). #1956, upstream #3330
  • @Matiiss added pygame.mixer.music.get_metadata() to potentially grab title/album/artist/copyright metadata from music files. #8

  • @ScriptLineStudios added transform.grayscale and Color.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 than blits 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 for pygame.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 of pygame.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 and draw_quad in pygame._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

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 raises TypeError 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

Cleanups and Robustness

Operations

New Contributors

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 danintheshed@gmail.com 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.