Skip to content

Releases: pygame/pygame

2.1.0.dev2 - kick the wheels pre-release

07 Nov 09:49
Compare
Choose a tag to compare

This is a quick pre-release, which mainly contains python 2 and SDL 1 removal.

Please kick the wheels? Changes are very minimal over 2.0.3, except for python2 and SDL1 removal.

2.0.3 - the many many manylinux M1 && good bye SDL1 goodbye py2 release

31 Oct 18:58
Compare
Choose a tag to compare

🍂🍊🌰🥮🥧🌆🌇🔥🎃🎑🏮🍂🍊🍂🥮🌰🎃🥮
🥮 python3 -m pip install pygame==2.0.3
🍊🍂🥮🌰🥧🌇🔥🌆🎃🏮🍂🍊🏮🍂🥮🌰🥧🥮

Goodbye python 2, goodbye SDL 1.

Firstly, everyone raise their glasses for python 2. This will (probably) be our last python 2 supporting release. From your weird unicode, to your print statement that didn't need (). We will miss you, but we will always remember you.

Secondly, raise a second glass (at the same time!) for SDL1. Oh, SDL 1.2.x how great it was to know you and use you on dead platforms like BeOS and DOS, with your now exotic features like cdrom support. So many pixels, so many sound waves. You stuck around with us several years after retirement, and for that we thank you. SDL 1, take your gold watch and enjoy your retro computing nostalgia after-life.

The python 2 wheels will still be there, and you can still use SDL1 through the pygame 1.9.6 wheels if you need. But it's time for us to move on.

You can stop raising your glasses now. Onto the goodies!

Here we go...

There's lots of build improvements in here, including support for M1 macs and much better linux support (fullscreen and multi touch is working!). There's some regression fixes including on pygame.time.set_timer and when compiling from source on older linux distros. New in here is a loops keyword argument has been added to mixer.music.queue. The Camera module got some further improvements removing some unused legacy code and some code cleanups.

One very cool highlight is that are UCS4 unicode (including emoji) rendering is working. Rendering emoji and some other human languages is now possible!

We now have much better error newbie friendly messages for image/resource loading issues. Which should help people when they make typos or path issues when loading images. This is a common problem for newbies, so it's a really nice improvement.

A bunch of difficult bugs were fixed, and python 3.10 wheels for manylinux (which were accidentally forgotten in the 2.0.2 release). There were also some docs improvements for the new Cursor class and get_desktop_sizes function as well as some type improvements for the experimental _sdl2 modules.

On mac and linux we are using libjpegturbo, so on those platforms jpeg loading should be smoking fast. Additionally lots of our dependencies on mac and linux have been improved (and they share the same build scripts now). Things like fluidsynth being actually compiled in and support for the opus sound files being compiled in properly.

What's Changed

Here's what we have in this release for you in a bit more detail. If you want ALL the details please scroll to the bottom to see the full commits and code diffs.

New Contributors

Thanks all

Thanks to all for reporting issues, doing reviews and helping out in other ways than code contributions. Especially issue reporters, wiki editors, discord mods/folk, redditors, patreons, and such like.

As all releases, this one too would not have been possible without support from the community, from people submitting issues, to people making PRs for all kinds of improvements, from typo fixes, to fixing complex segfaults in C code, every contribution matters a lot!

Special thanks are in order with with this release. For help with last minute testing by /dev/mario, @pkulev, @solozobov, @interstellartaurus, fxbeta and @kajott. Thanks!

python3 -m pip install pygame==2.0.3


2.0.3.dev6

31 Oct 12:46
Compare
Choose a tag to compare
2.0.3.dev6 Pre-release
Pre-release

Another quick dev pre-release. python3 -m pip install pygame==2.0.3.dev6

What's Changed

Mainly this release fixes some issues with MacOS M1 based arm64 computers,
but also some issues with manylinux binary wheels for linux users.

We would appreciate feedback from M1 users, and linux users particularly.

python3 -m pip install pygame==2.0.3.dev6

# run an example game
python3 -m pygame.examples.aliens
# run the full test suite
python3 -m pygame.tests

Please report your successes or failures with the release here: #2807

Or chat to us in the #contributing discord, or send an email.


Thanks all

Thanks to all for reporting issues, doing reviews and helping out in other ways.
Especially issue reporters, wiki editors, discord mods/folk, redditors, patreons, and such like.


2.0.3.dev4 - let's merge em in?

24 Oct 17:06
Compare
Choose a tag to compare
Pre-release

Pygame 2.0.3.dev4

Another quick dev pre-release. pip install pygame==2.0.3.dev4

What's Changed

This release we've been trying to merge in many PRs which have been taking a long time. But some highlights are UCS4 unicode (including emoji) rendering is working, much better error newbie friendly messages for image/resource loading issues, a bunch of difficult bugs were fixed, and python 3.10 wheels for manylinux (which were accidentally forgotten in the 2.0.2 release). There were also some docs improvements for the new Cursor class and get_desktop_sizes function as well as some type improvements for the experimental _sdl2 modules.

We'll have proper detailed release notes for the real 2.0.3 release.

New Contributors

Thanks all

Thanks to all for reporting issues, doing reviews and helping out in other ways.

We have a pygame 2.0.3 milestone tracking the rest of the work that's most likely going to go into it. The Mac arm64 support had some good progress, and there are some manylinux improvements to help with some linux issues. Hopefully some of that will make it into the release.

Please test, and if you notice anything please raise an issue so we can have a look.
Would be much appreciated :)


2.0.3.dev2

16 Oct 16:55
Compare
Choose a tag to compare
2.0.3.dev2 Pre-release
Pre-release

Pygame 2.0.3.dev2

A quick dev pre-release, because we can do quicker dev releases now. There's a few build improvements in here, and also a regression fix on pygame.time.set_timer and a loops keyword argument added to mixer.music.queue.

pip install pygame==2.0.3.dev2

#2768 mac build improvements by @jmroot
#2673 Remove redundant python includes, fix compiler warnings on re-exported symbols by @ankith26
#2762 GH Actions make /usr/local cache for mac deps, greatly speeding up mac CI builds by @ankith26
#2769 Fix regression in set_timer, old events not removed, by @ankith26
#2770 Added loops option for mixer.music.queue, by @thorhunter1

Thanks to all for reporting issues, doing reviews and helping out in other ways.

We have a pygame 2.0.3 milestone tracking the rest of the work that's most likely going to go into it.


2.0.2 - O2 release

10 Oct 11:21
Compare
Choose a tag to compare

Pygame 2.0.2 - O2 release

Hello everyone! 2.0.2 is finally here!

🔷🔬 💧📘💙🌌❄️💎 🔷🔬 💧📘💙🌌❄️💎
🟦 pip install pygame --upgrade
🌌❄️💎🔷 🔬 💧📘💙🌌❄️💎 🔷🔬 💧📘💙

How do you summarize over 10 months of development, with over 40 contributors contributing 1000s of lines of fixes and enhancements? If you're interested in seeing the changes in more detail, you can check out the release notes for the 2.0.2.dev2 and 2.0.2.dev4 pre-releases. Below is a summary of some highlights.

2.0.2 release greatest hits

  • Rumble support for Joysticks and Controllers
  • Python 3.10 support
  • MacOS 10.9- MacOS 10.13 support for the first time in the 2.x series (intel chips)
  • SDL 2.0.14 -> SDL 2.0.16
  • MP3 music support for Mac and Linux (Windows already had it)
  • Lots of work refining the type hints.
  • Documentation improvements galore, and the documentation build system was updated.
  • Native webcam support for Windows

And many more bugfixes and enhancements to improve the pygame experience.


2.0.2.dev4

09 Oct 14:12
Compare
Choose a tag to compare
2.0.2.dev4 Pre-release
Pre-release

Pygame 2.0.2.dev4

python3 -m pip install pygame==2.0.2.dev4 --pre

pygame

The previous pre-release 2.0.2.dev2 was aimed to test whether our new build machinery for releasing pygame worked. And it worked great, except on Mac. Now mac wheels are hopefully fixed in this pre-release. In fact, we now have Mac wheels that support down to MacOS 10.9, unlike previous 2.x releases, that only supported 10.13 and above.

Apart from that there's a bunch of other nice stuff in here too. Including python 3.10 support, a new Windows camera module, support for rumble controllers/joysticks, support for building on windows with MSYS2 (gcc and friends for windows), and significant documentation improvements and even a new SVG/vector version of the logo (as you can see above).

Hopefully this will be the last pre release. Next up we can do the real 2.0.2 release...
Unless people find some serious issues when testing this one?

Docs + Type Hints + Examples

@rethanon fixed up some type hint and documentation errors in #2697 and #2717.

@rethanon fixed up the playmus examples, and added a good note to the mixer.music docs in #2745. @rethanon continued tidying the music docs in #2751.

@vnmabus enhanced the type hints by moving to use Sequence in places. (#2682)

New contributor @Mega-JC made some beautiful upscaled logos for us in #2704. I mean, just check out the README now 😍.

@bydariogamer spruced up the docs in #2715.

@Grimmys made it much easier to generate the documentation locally in #2714. No need to install build tools now!

@Grimmys got us up to date with our docs build tooling. We can now generate the docs on Sphinx 4.0. (#2666)

@Starbuck5 wrote a docs README for new contributors in #2667.

Bug Fixes

@ankith26 fixed a regression where a few modules would return True instead of None on init() and quit(). (#2719)

@MightyJosip fixed a bug where rotating a Surface with no width or no height (or both) would cause a segmentation fault. (#2725)

@njbradley, @Starbuck5, and @illume collaborated to get mp3 support for mixer.music on Linux. (#2712)

@zaphodikus Fixed broken unicode len checking in examples/textinput.py #2567

Devops

@bydariogamer simplified the implementations of surfarray and sndarray in #2708.

@ankith26 improved our Github Actions system significantly, also allowing us to generate Python 3.10 wheels on Mac and Windows. (#2605)

@illume fixed an issue with downloading the jpeg library on windows. (#2743)

@illume added python 3.10 builds to appveyor in #2757.

Many thanks to @illume, assisted by @ankith26, for fixing the mac dependency situation that was the primary release blocker for this release. (#2742). Mac builds should support MP3 music now!

New contributor @Pycryptor10 made sure the metadata in setup.cfg reflects that we support Python 3.10. (#2753)

Many thanks to new contributor @dciabrin, who added support for MSYS2 windows builds. (#2592)

Thanks to @Starbuck5, @ankith26, and @illume for coordinating the 2.0.2.dev4 pre-release.

Additions

@Starbuck5 added a namehint argument to music.queue. (#2750)

@Starbuck5 added built in webcam support for Windows to the pygame.camera module. (#2630)

@zoldalma999 added rumble support to the joystick and controller modules. #2741


2.0.2.dev2

22 Aug 09:50
Compare
Choose a tag to compare
2.0.2.dev2 Pre-release
Pre-release

Pygame 2.0.2.dev2 - Drumroll release

💐💐😉😊💐💐
☕ Cheer Up! 🍵
🍂 ✨ )) ✨ 🍂
🍂┃ (( * ┣┓ 🍂 we have a python3 -m pip install pygame==2.0.2.dev2
🍂┃*💗 ┣┛ 🍂
🍂┗━━┛ 🍂
🎂 For YOU 🍰
💐💐😌😊💐💐

Hello internet strangers. We’re back with a new release, packed with tons of mundane bug fixes and unexciting improvements! It’s been a while since the last release, but in that time pygame development has been moving ahead. This release, 36 contributors (25 new ones!) contributed over 75 pull requests. Since 2.0.1, over 200 files were edited, with more than 16,000 lines added, and more than 7,000 lines deleted.

This is a development pre-release, so we can test out new release machinery. Probably we will do a couple more dev pre-releases, but we hope to have a full 2.0.2 release soon. There's a bunch of PRs still open that we want to help resolve and merge in before that.

                    So grab a beverage, 
                    and doom scroll our release notes,
                    we prepared just for you,
                   (&& those other interweb weirdos)

Bug Fixes 🐛

Artisanal source code like ours has the best intentions, but there's nothing like computers to bamboozle our best efforts.
It used to be actual bugs climbing inside the pipe organs programmed to play and the looms programmed to weave, but these days that excuse doesn't really work. Our bad.

Bugs in this 1910 Jacquard loom would be actual bugs

New contributor @mhollands fixed an issue where arcs wouldn’t fully draw in #2480
arc drawing image

(See more the video at https://www.youtube.com/watch?v=1PBd3VJrfDw if you're interested)

@ankith26 fixed

  • the init systems to prevent bugs from init-quit-init (#2428)
  • an error handling bug in pixelarray in #2444
  • the pygame default font would break when packaged with PyInstaller (#2604)

@Starbuck5 fixed:

  • 20 second load times for SysFont on Mac, and also gave Windows SysFont some love (#2594, #2640).
  • A bug where freetype would think coordinates of -1 represented an error was fixed in #2576.
  • A rare segfault in mixer.pre_init() on Mac, in #2494
  • Where window size couldn't be reduced after leaving SCALED mode on Windows (#2587)
  • Exiting fullscreen would put your window at (0, 0) in #2460
  • A failure in display.set_gamma() in #2524
  • The pygame.scrap module building properly on Mac and Windows (#2499, #2495).

@MightyJosip fixed duplicate entries in display.list_modes() in #2470

@robertpfeiffer fixed

  • IME placement in SCALED mode in #2451
  • A rare bug where Color.hsva would return invalid values in #2467

Sysfont fixes

One module in particular has come a long way in this release — sysfont. Thanks to @Starbuck5

As well as working better on windows and mac... Before, if you requested "Cambria," pygame would silently give out Cambria bold.
before

Now, Cambria is Cambria
after

(Of course you can still request bold from SysFont and it will hook you up, at least for Cambria)

New Features ✨

@dr0id added

  • vector projection to the Vector2 and Vector3 classes in #2510
  • a “touch” attribute to all mouse events in #2514

projected = v3.project(v3) This is useful for collision detection in finding the components in a certain direction (e.g. in direction of the wall). For a more detailed explanation see Wikipedia <https://en.wikipedia.org/wiki/Vector_projection>_.

The .touch attribute is for events that were generated by a touch input device, and not a real mouse. You might want to ignore such events, if your application already handles finger events.

@robertpfeiffer added an exclude argument to pygame.event.get(), allowing inverse filtering, in #2512, with a test in #2546.

@MyreMylar worked on

  • changing mixer.set_reserved() to return the number of channels actually reserved in #2490
  • adding an actual implementation to the force parameter of mixer.find_channel() in #2491 Before it simply wasn't implemented, only documented.

@Starbuck5 added

  • a namehint argument to mixer.music.load() for easier loading of music from file-like objects. (#2497)
  • Vector2 support to the transform, display, and Mask modules, as well as keyword argument support to the transform and Mask modules (#2536, #2557, #2581)

Internal / Portability

New contributor @Muxelmann fixed the path to homebrew in #2636, fixing some pygame issues on M1 Mac!

New contributor @odidev and @illume added aarch64 wheel build support, along with a docker file, and github actions tests for it in #2610 and #2675

New contributor @fniephaus made a compatibility fix for GraalPython in #2580

@MyreMylar updated the sse2neon header to make it build alpha blitter on arm in #2425

@ankith26 and @illume added github actions, disabled travis builds except arm64 in #2507 and #2600. This was crucial to keep pygame development functional after the shutdown of travis-ci.org.

@Pierre-Sassoulas used their pylint expertise to keep pygame’s code base clean and functional in #2509, #2579, and #2634.

@Starbuck5 added Python 3.10 support in #2586, updated functions to return bools rather than ints in #2534, and moved to SDL 2.0.16 on Windows in #2670.

@illume moved to SDL 2.0.16 on Linux, as well as many other dependency updates, in #2676

Docs

                                       _________________________
                                     =(__    ___       __     __)=
                                       |                       |
                                       |                       |
                                       | python -m pygame.docs |
                                       |                       |
                                       | A large number        |
                                       | documentation fixes   |
                                       | were made in this     |
                                       | release.              |
                                       |                       |
                                       |__    ___   __    _____|
                                     =(_________________________)=

@llindstrom, @Pierre-Sassoulas, and @Starbuck5 corrected incorrection information in: #2485, #2582, #2654. @robertpfeiffer added to the TEXTINPUT documentation in #2456.

New contributors @SplatRT, @bambalamm, @Deek80, @NKID00, @MaukWM, and @shawnbyday all cleaned up the documentation with grammar and typo fixes, in: #2431, #2437, #2519, #2555, #2583, #2644. @Starbuck5 contributed to this worthy goal in #2590

New contributor @Grimmys and @Starbuck5 worked on the documentation build system, upgrading it from Sphinx 1 to Sphinx 3, hiding the obsolete Overlay and cdrom modules from the top bar, and adding the --fullgeneration flag to setup.py docs. #2513, #2511, #2617, #2624.

New contributor @Taffer added a page to showcase all of pygame’s named colors, in #2559. When it is live, it will be at https://www.pygame.org/docs/ref/color_list.html.

New contributor @kaiec noticed that SDL_Image, pygame’s image loading backend, supports more than we had documented, so updated the documentation accordingly, in #2619. (We support WebP and SVG, who knew?) New contributor @duthades continued this by adding tests for the new image formats in #2656.

Finally, new contributor @ayushbisht2001 added a nice logo to the README in #2441, sprucing it up nicely.

Type Hints

Typehints got some neat updates in this release as well, so that you can code with pygame in your favourite IDE and you get that sweet auto-correct/autocomplete and type-checking to catch bugs even before they are reported!

New contributor @jakebailey made tons of good typehint fixes in #2537, the most important ones being, correctly exporting submodules in a way that typehints are recognized for the submodules, and generic types used in annotations being fixed to include the missing type params, among other fixes.

New contributors:

@MyreMylar Add str and RGBA tuple types to freetype/font type hints in #2462, and Correct blits typehint sequence arg to cover blit inputs in #2482

@ankith26 and @zoldalma999 overhauled many incorrect uses of Optional in #2678

Examples

New contributor @jonozw added a needed pg.quit() for IDLE compatibility in the stars example (#2560). Many other examples needed this too, so another expeditious new contributor (@AnudeepGunukula) swept through and made sure it was on every example in #2643.

@MightyJosip fixed a crash in the mask example in #2606.

New contributor @mljli improved the aliens example in #2608, new contributor @njbradley improved the font_viewer example in #2655 (it’s cool check it out), and @Starbuck5 overhauled the chimp example in #2651.

Experimental super secret _sdl2 thi...

Read more

2.0.1 - The Age Of Aquarius release

24 Dec 14:26
Compare
Choose a tag to compare

🌺🌻🌹🥀🌷🌼🌸💐💮🌺🌻🌹🥀🌷🌼🌸💐💮🌺🌻
🌼🌸 python3 -m pip install pygame==2.0.1
🌺🌻🌹🥀🌷🌼🌸💐💮🌺🌻🌹🥀🌷🌼🌸💐💮🌺🌻

The Age Of Aquarius,
the northern Winter Solstice, 
and the southern Summer Solstice bring us...
a new pygame to play with :)

This is a bug fix release, with a bunch of features and optimizations thrown in for good measure. Thank you to the people reporting issues related to pygame 1 compatibility. Some of them will take a bit longer to discuss, work through, and find solutions. We say goodbye to Travis the CI that served us well. We said goodbye to the pygame discord that had grown too big, only for a few more to have sprouted up in its place. We said hello to the patreon.com/pygame and we took a breather for a little bit.

Enough bla bla bla... what's new?

Backwards compatibility fixes

Firstly, a few backwards compatibility fixes have been made.

Dan Lawrence @MyreMylar worked some more on the alpha blitter so it's more compatible.

  • Change opaque surface test to use SDL_ISPIXELFORMAT_ALPHA() macro #2269

René Dudfield (@illume) worked on making some old audio driver and video driver names that had been renamed work in backwards compatible env vars, SDL_VIDEODRIVER=windib, SDL_AUDIODRIVER=pulse or dsound #2292

Major event refactor

Ankith (@ankith26) did a major event refactor in #2357 #2404 #2416 and #2398 This not only cleaned up the event processing code, but fixed a bunch of issues an introduced some new features making event processing more comfy along the way.

  • #1236 unicode keydown field does not appear occasionally
  • #1238 posting keydown events fills the all fields.
  • #1524 Unicode property not returned on KEYUP event
  • #1550 time.set_timer accept event object
  • #2146 Segfault in pygame.event.post() fixed
  • #2214 WINDOWEVENT API upgrade
  • #2319 event.get(type) does not return a list of all events posted
  • #2347 pygame.time.set_timer() accepts loops param
  • #2378 unicode keydown field working when mashing 4 keys at once

Here's a graph to treat your eyes, on an event benchmark where getting lots of events has been sped up a lot. As you can see, its a 7 times speed up. There are also less peaks in there, due to less thread locking on the event queue and using batching API calls.

Figure_1

New contributors

Thanks to @bwright8 for adding a unit test for image.load_basic() #2307 and also for adding some Surface.convert tests in #2368.

@kristofszentes made a unit test for image.load_extended() in #2324

Paul m. p. P. (@pmp-p) fixed typo in windib driver handler condition #2342

The Dog Lulu (@Iamsoto) updated the TYPE_HEAD macro to use a newer API #2363

@aminouhammou added a unit test for display.gl_get_attribute() #2375

Tom Fryers (@TomFryers) Capitalised "Python" in the import message. #2389

Pierre Sassoulas (@Pierre-Sassoulas) has been working on some code quality fixes using the pylint tool (and apart from these merged PRs working on setting up other code quality tools and a pre-commit checker).

  • Add parentheses to print so it works in py2 and py3 #2284
  • Merge some comparisons in lists for simplicity #2290
  • Change range(len(x)) to enumerate(x) when applicable #2291
  • Temporarily skip test_sound_args on windows and Appveyor #2371

Color.update() and Rect.update()

@zoldalma999 (who recently joined the pygame team on github after contributing several high quality patches to pygame) worked on a proposal by David Lönnhager (@dlon) to add Color.update and Rect.update #2277

Vectors already have an update() method. Now Color, and Rect do too :)

>>> c = pygame.Color(0, 0, 0)
>>> c2 = pygame.Color(1, 2, 3, 4)
>>> c
(0, 0, 0, 255)
>>> c.update(c2)
>>> c
(1, 2, 3, 4)

>>> rect = pygame.Rect(0, 0, 1, 1)
>>> rect.update(1, 2, 3, 4)
>>> rect
<rect(1, 2, 3, 4)>
>>> rect = pygame.Rect(0, 0, 1, 1)
>>> rect2 = pygame.Rect(1, 2, 3, 4)
>>> rect.update(rect2)
>>> rect
<rect(1, 2, 3, 4)>

@zoldalma999 also worked on:

  • the "edit on github" link in the docs was fixed to now point to main branch. #2318
  • document that sprite groups are ordered in python 3.6 and above #2336
  • Remove unittest skip from freetype_Font_render_to_mono #2351
  • Fix render_to returning unpositioned rect #2410

René Dudfield (@illume) was hacking on some things like these:

  • Fixing some sysfont test failures #2354
  • docs, tests and types for pathlib support #2387
  • fix for a gl crash #2394
  • SDL 2.0.14, and manylinux improvements (pulseaudio and other deps) #2395
  • Fix and skip test failures #2415

SDL 2.0.14

libsdl is a library pygame is built on. It had a new release after almost 9 months of development. The 2.0.14 release notes detail things a little bit. More than 9 months worth of effort is a bit much to explain.

There's been a number of bugs fixed we reported in the pygame 2 series. One of which was pygame.display.update() updating the whole screen on windows. So, now 'dirty rect drawing' is faster again on windows. From the list you'll notice a lot of work went into joystick and game controller improvements. Including support for more than 4 xbox controllers at once on windows. But linux, android, mac, and even freebsd got joystick improvements. On linux the Kernel Mode Setting (KMSDRM) video driver was improved a lot. For retro computing fans, the OS2 port got a lot of love. Lots of portability things were improved, like fixing compilation for M1 CPUs, improving the build system. Raspberry Pi support has been improved, as have most video drivers for other platforms.

Xbox One port

Victor Lopez started on an Xbox one port, and has had some success.

I can confirm Xbox One is able to run the aliens sample with joystick support, audio and sprites, it needs, however, heavy testing.

These are the relevant repositories:

pathlib support for image, sound, and font loading.

pathlib is an object oriented way of doing path handling in python 3 (there's also a backport to python2). Before pygame didn't handle these objects in resource loading functions for image and sound loading. Now it does pathlib!

        path = pathlib.Path('.') / "data" / "house_lo.wav"
        sound1 = mixer.Sound(path)

Thanks to @ankith26 in #2366 and René Dudfield (@illume) in #2387 .

Cursor object API

@Starbuck5 worked on a new Cursor object in #2331

Now you can add system cursors, and color cursors out of surfaces along with the other ones you could draw with ascii art.

box = pygame.cursors.Cursor((10,10), pygame.Surface((20,20)))
pg.mouse.set_cursor(box)

pg.mouse.set_cursor(pg.SYSTEM_CURSOR_NO)
pg.mouse.get_cursor()
>>> <Cursor(type: system, constant: SYSTEM_CURSOR_NO)>

@Starbuck5

  • added a link to patreon on github in #2362
  • Improved the README.rst by clarifying, restructuring and improving links. #2396
  • Cleaned up 'import pygame._view' in packager_imports by removing it. #2384
  • Docs build fixes + home for the Korean tutorial #2420

@Starbuck5 added a deprecation warning for mouse.set_system_cursor() #2397 after a long discussion and research with a number of us on if we should have deprecation warnings anyway?.

pygame.draw.rect fixes.

Another project @Starbuck5 worked on was fixing some draw.rect issues in PR #2406 found by @gummbum and @dr0id

This script by @dr0id made it much easier to spot the problems.
2359-ex3

@galexandreg worked on text_input documentation improvements on by default, needed for pygame.TEXTINPUT #2333

@robertpfeiffer made a few fixes to issues with android support. Added K_AC_BACK key constant, fixed data_file pruning and "STRIPPED" install #2311

Ankith @ankith26 merged these ones in (whilst also looking at some difficult event posting issues, and cleaning up some image loading code).

  • Unittests for event module #2283
  • Delete obsolete test/util files #2303
  • Documented pygame.image load_basic, load_extended, save_extended. image.c code cleanups. #2270
  • Pathlib support for most pygame functions #2366
  • Drop PyLong_FromUnicode, removed in python 3.10 #2385
  • little music doc fix #2414

@mcpalmer1980 Added experimental relative mouse motion support to video.Window in #2392 They have also been using the experimental _sdl2 features quite a lot and coming up with some good improvements and discussions on that (including a new package!).

Dan Lawrence ( @MyreMylar ) was on a coding rampage and made a number of improvements:

  • mixer.music.get_busy() return False when the music is paused #2295
  • Small improvement to the get_locks() test #2281
  • Interactive test for touch.get_finger() #2279
  • Removed the link to the closed Discord server from GitHub #2296 😢
  • pygame.midi pass the output buffersize down to portmidi #2272
  • interactive test for set_gamma_ramp() #2278
  • Rejiged the alpha blitter path logic to cover issue on mac #2345
  • Account for mixer.init()/pre_init() returning more channels than asked #2372
  • Fix typo in image.frombuffer() type hint #2383

Many many special Thanks go to

Read more

pygame 2.0 - the happy dance birthday release

28 Oct 17:45
Compare
Choose a tag to compare

The 28th of October 2020 is the pygame 2.0 release date, because pygame turns 20 years of age.


 ,--.
|  oo|
|  ~~| o  o  o  o  o  o  o  o  o  o  o  o  o
|/\/\|
       python3 -m pip install pygame==2.0.0

What's the best feature of pygame 2? Maybe it's "backwards compatibility". For many, many apps pygame 2 is backwards compatible. Have an pygame app from the year 2000? It will probably work. We still have some known issues and open backwards compatibility issues(see below), but a lot of things work just as they did before. Yes, we still have python 2 support.

How does one summarize the 3306 changes since we started the pygame 2 series in July of 2018 based on patches going back to 2012 and even earlier?

  • Support for Metal, Direct 3d, Vulkan, OpenGL 3.0+ in various profiles (core, compatibility, debug, robust, etc), OpenGL ES, and other modern hardware accelerated video APIs across many platforms.
  • SSE2/Neon assembly image drawing. Much faster drawing routines, image loading, and alpha blending.
  • Type Hints, for code completion (and to help you make the squiggly lines disappear) in editors and IDEs.
  • Code cleanup, using lots of code robustness tools like static analyzers, and automated CI/CD. We've been able to help dozens of people new to community projects contribute. We have lots of work to go on code quality, but we're currently the highest rated Python and highest rate C large project on LGTM.
  • Many, many bug fixes including in our pygame.draw routines, pygame.math(for vectors), and pygame.mask for pixel perfect collision detection.
  • better support for PyPy (the fast JIT based implementation of python). See our milestone Are we pypy yet? No. for our progress on making PyPy the best python for games.
  • libsdl version 2 support. Technically pygame 2.0 still works with SDL 1, but we recommend SDL2 which is vastly improved over SDL1 for most use cases. Probably we will remove SDL 1 support starting pygame 2.1.
  • Touch support (multitouch, gestures, etc)
  • Audio input support (make games with your microphone!).
  • Message alert boxes (Press OK, or Cancel).
  • Better keyboard support. Proper unicode input and IME support.
  • Much improved game controller support.
  • Better image and audio format support. Including: webp, 32bit wav files, and much more reliable mp3 support.
  • Multiple display support, and multiple window support (multi window support is still experimental, more will come in pygame 2.1).
  • Android support through python for android (fork of pygame subset for android). Better documentation, and better support will come in future releases.
  • to make distributing your apps easier, a built in "pyinstaller hook"and compatibility with cxfreeze.
  • binary "wheels" on many platforms and versions of python from the old python 2.7 - to the latest python 3.9 (and with pypy!).
  • lots of quality of life improvements like Surface.fill('black') instead of Surface.fill(pygame.Color(0, 0, 0)). Also keywords are supported for many more function arguments. You can draw rounded corners on rects.
  • plenty of new examples, like python3 -m pygame.examples.font_viewer, and python3 -m pygame.examples.music_drop_fade. Additionally the example source code has been cleaned up a lot to follow a more current python style.
  • Hundreds of documentation improvements, include a new Korean tutorial.
  • a special SCALED mode which takes low pixel games and automatically translates them to a larger window. Imagine your 320x200 resolution game of glorious pixel art... on modern screens that would be a very tiny windows. Now with SCALED it shows up big on a Full HD screen, or even a 4K/8K screen and the translation of mouse coordinates and up-scaling of pixels is done for you (hardware accelerated of course).

That was a summary of some of the goodies in pygame 2. We will be releasing more articles and tutorials on new features as time goes on. You can also look at the previous release notes for more info (see end of this post).

thank you 🎉

Probably one of the better realizations thinking about pygame on its 20th birthday is that there is a much larger group of people who have contributed to crafting pygame in recent years. Some have moved onto other things like jobs, family or writing cookbooks in the Canadian wilderness. Much respect for volunteering time to a community project like pygame.

Firstly thanks to the pygame team members who contributed to the pygame 2 series, new and old...

David Lönnhager (@dlon) | René Dudfield (@illume) | Charles (@charlesej) | Dan Lawrence (@MyreMylar) | Ankith (@ankith26) | Niels Thykier (@nthykier) | Lenard Lindstrom (@llindstrom) | Sigurður Sveinn Halldórsson (@siggisv) | @robertpfeiffer | Josip Komljenović (@MightyJosip) | Travis Chang (@Reminisque) | xFly_Dragon (@husano896) | Adam Andrews (@adamandrews1) | (@galexandreg) | Thiago Jobson (@thiagojobson) | (@mcpalmer1980) | @charlesoblack | Daniel Pope (@lordmauve) | Thomas Kluyver (@takluyver) | @e1000 | Andy Nguyen (@anguye13) | @Starbuck5 | Ian Mallett (@imallett)

Equally important thank you go out to all the other contributors, some of which contributed to a community project for the first time.

Pedro de la Peña @pedrodelapena | @lkito | @khuang0312 | @tsadama | @Bottersnike | @alphaCTzo7G | Amos Bastian (@amosbastian) | Andrey Lopukhov (@AndreyX86) | Augusto Noronha (@augusto2112) | Bernardo Sulzbach (@bernardosulzbach) | (@Bottersnike) | Cai Q.T. (@CAIQT) | (@Cerealdragon) | (@ChrisWeissNike) | (@cmtrapp02) | Daniel Molina (@daniel-molina) | David Caughell (@DavidCaughell) | (@dr0id) | burmer (@dtschirmer) | (@IchMageBaume) | (@LambdaGoblin) | François Magimel (@Linkid) | (@LiquidFenrir) | Mark Hurley (@markph0204) | Marius Gedminas (@mgedmin) | (@metulburr) | Michael Farrell (@micolous) | Dominik George (@Natureshadow) | Nik (@nikolas) | Nunu-Willump (@Nunu-Willump) | (@pleboulanger) | Rebecca Chen (@rchen152) | (@robertpfeiffer) | Sett (@sw00) | @seenemikk | Nguyễn Gia Phong (@McSinyx)| Sebastian Henz | @BastiHz | Alice Lia Stapleton (@slimelia)

raphacosta27 (@raphacosta27) | Bill (@AdditionalPylons) | Gabriel Moreira (@gabsmoreira) | zoldalma999 (@zoldalma999) | amipy (@amipy) | DGMcKenney (@DGMcKenney) | Grigoris Tsopouridis ((@gtsopus)) | Ilia Gogotchuri (@Gogotchuri) | Jim Quach (@jiquach) | Aaron Li (@AaronLi) | Clark Seanor (@cruxicheiros) | K Duggan (@kduggan15) | Michał Górny (@mgorny) | Clark Seanor (@cruxicheiros) | jtoloff (@jtoloff) | 41aaronb (@41aaronb) | Prasanna Venkatesh (@hanzohasashi33) | zoldalma999 (@zoldalma999) | Nihal Mittal (@codescientist703) | leopoldwe (@leopoldwe) | Scott Noyes (@snoyes)

Vicente González Ruiz (@vicente-gonzalez-ruiz)| Douglas (@douglas-cpp) | wuzh07 (@wuzh07) | Gerardo Antonio Hagad (@ginohagad) | Evan Kanter (@evank28) | Inada Naoki (@methane) | Jani Tiainen (@jtiaicomparison) | Christian Clauss (@cclauss) | Gosha Zacharov (@Gosha) | Steven Chua (@Graphcalibur) | K Duggan (@kduggan15) | PeanutbutterWarrior (@PeanutbutterWarrior) | Nachiket Naganure (@NachiketUN) | Pierre Haou (@pierrehaou) | Daniel Gillet (@dangillet) | Stefano Rivera (@stefanor) | Andre Miras (@AndreMiras) | glennmackintosh (@glennmackintosh) | Vilhelm Prytz (@vilhelmprytz) | DotMars (@dotmars) | Gabriel Duque (@zuh0) | Mark Hurley (@markph0204) | Henrik Petersson (@hnrkcode) | Grigoriy (@flaambe) | Matt Sheppard (@mampersat) | s0lst1ce (@s0lst1ce) | Norman Packard (@nhpackard) | peanutbutterandcrackers (@peanutbutterandcrackers)

A special thanks to all the people who help out others. From making videos, to answering questions, to writing guides (and even whole books). MyreMylar, MichaelCPalmer, jtiai, claudeb, DaFluffyPotato, Rabbid76, The Big Kahuna, sloth, Kingsley, ... and lots of other people. Thanks to the mods on forums, chat rooms and Q&A sites. Special thanks to Zireael07 for cheering on pull requests that people make 🎉 Thanks to people adding support and integration to libraries and tools like pgzero(lordmauve and co), Mu Editor (Nicholas and team), and pymunk (Victor Blomqvist). Very many people have contributed by reporting issues. This is fantastic help for people 👏 👏 👏 Without these issue reports and help in testing bugs and new features many parts simply wouldn't work. Thanks to the SDL folk, to the fluidsynth crew, to numpy devs (Matti and co), python for android, pypy project, and the python community at large. Thanks to the folks running game jams like ludumdare(Mike), pyweek(lordmauve), and alakajam. Thanks to renpytom for pygame subset for android and pygame_sdl2, thanks to Marcus von Appen for pysdl2. Thanks to people sharing your work with others on the pygame website, or on places like the pygame reddit, discord, or youtube. Thanks to the kind folk who work on packaging pygame from Debian, Ubuntu, Arch, FreeBSD, and piwheels (@bennuttall). Thanks for the people teaching and learning with pygame all over the world. Last but not least... a very special thanks to everyone we've missed that should be listed here.

Really. Thank you (you). Thanks.

Known issues

We have an up to date list of issues marked with the Compatibility Python 2 label. These are compatibility issues where something worked in pygame 1, but doesn't work in pygame 2.

At the time of writing this included:

  • the pygame.cdrom package not being there (mainly because it isn't in SDL2 anymore).
  • pygame.scrap is only working with text, not images (needs some porting and testing done).
  • pygame.event.post is having issues with some event types.
  • pygame.display.set_palette i...
Read more