Pygame

Latest version: v2.5.2

Safety actively analyzes 631178 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 7 of 10

2.0.0.dev16

Not secure
The 28<sup>th</sup> of October 2020 will be the [pygame](https://pygame.org/wiki/about) 2.0 release date, because pygame turns 20 years of age. Save the date (maybe we'll do something)!

We reached two important milestones with this pre-release. Firstly the old game 'solarwolf' is working fine with no known issues on pygame 2. The second stone we passed by on the road to [PyPy](https://www.pypy.org/) goodness is that we are releasing binary wheels for PyPy on mac, windows, and linux. PyPy is a different implementation of python that is highly compatible and can be extremely fast.

Here's a little [youtube video of solarwolf on PyPy and SDL2](http://www.youtube.com/watch?v=j8EWruyKYZc)...
[![solarwolf on SDL2 and pypy](http://img.youtube.com/vi/j8EWruyKYZc/0.jpg)](http://www.youtube.com/watch?v=j8EWruyKYZc "solarwolf on pypy and SDL2")

> If you watched the video to the end, you'll note there's a crash. We still have some way to go before everything in pygame is working with PyPy. "solarwolf" using cpython and pygame 2 is running deliciously and glitch free.


Critical backwards compatibility fixes for pygame 2

First up, some 'critical' improvements that have been made to pygame. 'critical' labeled issues are ones are backwards incompatible issues stopping a pygame 2 release.


Dan Lawrence MyreMylar
- [Making RLE flags & RLE behaviour more consistent between pygame 1 and pygame 2](https://github.com/pygame/pygame/pull/2189), so that a lot more types of surfaces draw correctly and that "solarwolf" works really nicely.

Ankith ankith26
- [Fix repeated VIDEOEXPOSE events](https://github.com/pygame/pygame/pull/2161), so apps do not get dozens of extra nonsensical VIDEOEXPOSE events on Windows.

René Dudfield illume
- [Added portmidi package for conan MacOS](https://github.com/pygame/pygame/pull/2187) so that pygame.midi works on MacOS again.
- [Set icon on macos like the other platforms with SDL2](https://github.com/pygame/pygame/pull/2194), so the default icon is there again for MacOS.



bugs, worms, shiny-shiny, and such

Dan Lawrence MyreMylar
- [Missing mouse_doc.h file](https://github.com/pygame/pygame/pull/2179)
- [Fix for missed braces in get_flags()](https://github.com/pygame/pygame/pull/2182)
- [Adding a premul_alpha helper method to Color class](https://github.com/pygame/pygame/pull/2142)
- [One of the math.c functions still used deprecated UTF functions](https://github.com/pygame/pygame/pull/2209)

René Dudfield illume
- [Test that pygame with SDL2 blit gives same results as SDL1 blit](https://github.com/pygame/pygame/pull/2192)
- [CI speedups](https://github.com/pygame/pygame/pull/2196)
- [Skip a lot of failing tests on pypy, build pypy wheels on mac+travis](https://github.com/pygame/pygame/pull/2204)
- [pypy and manylinux2010](https://github.com/pygame/pygame/pull/2212) because PyPy needs manylinux2010, an old PR from takluyver was resurrected and changed a bit so we can use manylinux2010.

robertpfeiffer
- [Add Setup.Android.SDL2.in, and default icons to STRIPPED build](https://github.com/pygame/pygame/pull/2203) is an improvement for better Android support.

Starbuck5
- [Fix docs build failure on Sphinx 3](https://github.com/pygame/pygame/pull/2206), so we can use the current version of the Sphinx documentation tool.

Josip Komljenović MightyJosip
- [Type hints for Vector swizzles & sprite groups](https://github.com/pygame/pygame/pull/2200)
- [draw.line fix with thick lines. More of the line was clipped off on screen borders than expected](https://github.com/pygame/pygame/pull/2199) is a fix for an issue siggisv found with line drawing.

Sigurður Sveinn Halldórsson siggisv
- [Document expected behavior of draw.aaline()](https://github.com/pygame/pygame/pull/2190)

Ankith ankith26
- [Doc improvements for WINDOWEVENT, MOUSEWHEEL, event and misc](https://github.com/pygame/pygame/pull/2149)



This time 4 'critical' backwards compatibility issues were fixed since the last release.

---

- [6 open 'critical' issues](https://github.com/pygame/pygame/issues?q=is%3Aissue+is%3Aopen+label%3Acritical) (backwards compatibility issues reported by people), and 35 closed (last release: 7 open, 32 closed).
- [merged PRs](https://github.com/pygame/pygame/pulls?q=is%3Apr+is%3Aclosed+merged%3A2020-10-12..2020-10-20+sort%3Aupdated-desc+)
- [2090 Commits since 1.9.6 stable release](https://github.com/pygame/pygame/compare/1.9.6...2.0.0.dev16)
- [80 Commits since 2.0.0.dev14 pre release](https://github.com/pygame/pygame/compare/2.0.0.dev14...2.0.0.dev16)

2.0.0.dev14

Not secure
![dreamlines](https://user-images.githubusercontent.com/9541/95693255-b08ba180-0c2b-11eb-924c-244a91996dd5.png)
-- <small>*Players, only love you when they're playing*</small>


With a very tiny little bit of discussion it was sort of decided that the 28<sup>th</sup> of October 2020 will be the [pygame](https://pygame.org/wiki/about) 2.0 release date, because pygame turns 20.




Critical backwards compatibility fixes for pygame 2

First up, some 'critical' improvements that have been made to pygame. 'critical' labeled issues are ones are backwards incompatible issues stopping a pygame 2 release.

Thanks to Dan Lawrence MyreMylar for [Adding a num_buttons parameter to mouse.get_pressed()](https://github.com/pygame/pygame/pull/2127). This was a backwards compatibility issue, because it used to return 3 elements. Now it returns 3 elements again by default and you can request 5 if you want. Another critical issue fixed by MyreMylar was [a problem with key events being reordered on windows](https://github.com/pygame/pygame/pull/2155).

But wait... there's more. Another backwards compatibility fix by MyreMylar is the "[Backwards compatibility for get_flags() in SDL2](https://github.com/pygame/pygame/pull/2156)" PR, which has stopped some games handling full screen mode properly.


Sigurður Sveinn Halldórsson siggisv fixed a problem with how pygame.draw.aaline didn't look as before.
- [Fix draw.aaline not always solid, and other problems](https://github.com/pygame/pygame/pull/2126)

Now the anti aliased lines look (and smell) awesome.
![13](https://user-images.githubusercontent.com/29337110/95656922-b1301500-0b11-11eb-9582-0bc8d7bd68e6.png)



bugs, worms, shiny-shiny, and such

Ankith ankith26
- Some [mouse cursors](https://github.com/pygame/pygame/pull/2114) [documentation improvements](https://github.com/pygame/pygame/pull/2115/files)
- [Fix pyinstaller issues with pygame.font.Font](https://github.com/pygame/pygame/pull/2133)
- [Document some undocumented pygame.image functions](https://github.com/pygame/pygame/pull/2130)
- [Update pygame.version.rev docs](https://github.com/pygame/pygame/pull/2123)
- [Adding windowevent constants](https://github.com/pygame/pygame/pull/2157)
- [Fixes pygame.display failing unit tests on raspberry pi](https://github.com/pygame/pygame/pull/2153)
- [Remove ancient file kept for python v2.4 compatibility](https://github.com/pygame/pygame/pull/2159)


Josip Komljenović MightyJosip
- [Improved the speed of pygame.draw.line()](https://github.com/pygame/pygame/pull/2151)
- [A few more type hint fixes](https://github.com/pygame/pygame/pull/2158)

Dan Lawrence MyreMylar
- [GitHub issue templates: New style](https://github.com/pygame/pygame/pull/2073) [Part 2](https://github.com/pygame/pygame/pull/2141)
- [doc header file regen](https://github.com/pygame/pygame/pull/2148)
- [Changed display.set_palette() test to test correct function](https://github.com/pygame/pygame/pull/2160)

Adam Andrews adamandrews1
- Code cleanup [Removed PG_ENABLE_NEWBUF](https://github.com/pygame/pygame/pull/2083)

Starbuck5
- [Python3 needs __bool__ instead of __nonzero__](https://github.com/pygame/pygame/pull/2112)
- [timeout option added to event.wait()](https://github.com/pygame/pygame/pull/2140) which is useful if you only want your app to wake up when something happens and also at least every 1 second or so.


René Dudfield illume
- [Python 3.9 binary wheels](https://github.com/pygame/pygame/pull/2163) (which is a new release of python).
- [Test sdist on CI](https://github.com/pygame/pygame/pull/2137)
- [Disable timing based tests on mac CI, because issues](https://github.com/pygame/pygame/pull/2139)


Nguyễn Gia Phong McSinyx
- [Fix mouse.pyiset_system_cursor type hints](https://github.com/pygame/pygame/pull/2103)
- [py.typed for mypy, fix pygame._sdl2 importing touch module type hints](https://github.com/pygame/pygame/pull/2104)
- [Clean up README and source distribution](https://github.com/pygame/pygame/pull/2105)



Special thanks to the new contributors

seenemikk
- [unit test for surface.get_masks()](https://github.com/pygame/pygame/pull/2111)

Sebastian Henz BastiHz
- [Fix typo in freetype.rst](https://github.com/pygame/pygame/pull/2119)

Alice Lia Stapleton slimelia
- [unit test: display.get_wm_info()](https://github.com/pygame/pygame/pull/2124)


This time 4 'critical' backwards compatibility issues were fixed since the last release.

---

- [7 open 'critical' issues](https://github.com/pygame/pygame/issues?q=is%3Aissue+is%3Aopen+label%3Acritical) (backwards compatibility issues reported by people), and 32 closed (last release: 9 open, 28 closed).
- [merged PRs](https://github.com/pygame/pygame/pulls?q=is%3Apr+is%3Aclosed+merged%3A2020-09-20..2020-10-12+sort%3Aupdated-desc+)
- [2008 Commits since 1.9.6 stable release](https://github.com/pygame/pygame/compare/1.9.6...2.0.0.dev14)
- [118 Commits since 2.0.0.dev12 pre release](https://github.com/pygame/pygame/compare/2.0.0.dev12...2.0.0.dev14)

2.0.0.dev12

Not secure

2.0.0.dev10

css
,--.
| oo|
| ~~| o o o o o o o o o o o
|/\/\|
pip install pygame==2.0.0.dev10


We only released 2.0.0.dev8 24 days ago. However, the last few weeks have been quite productive!
It's as if we were all trapped inside for some reason.

First up, the ['critical' window resizing](https://github.com/pygame/pygame/pull/1705) bugfix thanks to robertpfeiffer but also to nthykier. This is another step towards a backwards compatible pygame 2 release. Another 'critical' bug (backwards compatibility bugs that block a pygame 2 release from happening) that got a fix is the `pygame.display.update()` call on windows. [A patch has been merged into SDL](https://github.com/pygame/pygame/issues/251) so this should be fixed in pygame soon.

Community help

A special thanks to all the people who help out others. From making videos, to answering questions, to writing guides. MyreMylar, MichaelCPalmer, jtiai, claudeb, DaFluffyPotato, Rabbid76, The Big Kahuna, sloth, Kingsley, ... and lots of other people.

Type hints, and lint tools

The last pygame pre-release(2.0.0.dev8) shipped with Type hints, and now [Type hints have been refined](https://github.com/pygame/pygame/pull/1696) (not like oil, but more like an expensive fermented vegan cheese). Thanks to Josip Komljenović aka MightyJosip

- [Some type hint and examples fixes](https://github.com/pygame/pygame/pull/1817)
- [Font type hints - use bool instead of int](https://github.com/pygame/pygame/pull/1833)
- [Add an __all__ variable to constants.c](https://github.com/pygame/pygame/pull/1733) MyreMylar This is useful for fixing static analysis tools like pylint and LGTM. The `__all__` variable in a module is for telling python which variables are to be exported.


Documentation and tutorials


css
_________________________
=(__ ___ __ __)=
| |
| |
| python -m pygame.docs |
| |
| The type hints were a |
| major part of the doc |
| work in this release. |
| Some examples got an |
| update too. |
|__ ___ __ _____|
=(_________________________)=


- [pygame.examples.glcube has been updated](https://github.com/pygame/pygame/pull/1730) to use 'modern' OpenGL API thanks to MyreMylar but also to robertpfeiffer, illume and imallett.
- [Fix grammar in rect docs](https://github.com/pygame/pygame/pull/1836) Scott Noyes snoyes


an amazing assortment of ammendments

And now have [an ARM64 build for testing pygame](https://github.com/pygame/pygame/pull/1717) on Travis CI (who provide it to us for free thanks!). Additionally a few bugs on the release process were fixed. Hopefully this will help us keep things working nicely on ARM platforms like the raspberry PI.

- [Add Aarch64 linux library directory to config_unix.py](https://github.com/pygame/pygame/pull/1828) MyreMylar

Thanks to galexandreg [Surface.blit can now take **very** large rects](https://github.com/pygame/pygame/pull/1869) for the area argument. Which is very useful in open world games that could have huge sizes of surfaces. With SDL1 supporting only smaller rects and surfaces, it used to be limited to a 16bit number.

[SCALED](https://github.com/pygame/pygame/pull/1704) is a feature for scaling up low resolution game screens to large size screens - like 4k monitors or high resolution phone screens. This received some code cleanups and documentation. Thanks to robertpfeiffer, and to nthykier and MyreMylar for help reviewing/testing.

[pygame using SDL1](https://github.com/pygame/pygame/pull/1719) [is building](https://github.com/pygame/pygame/pull/1842) [and passing tests again](https://github.com/pygame/pygame/pull/1832) thanks to MyreMylar and illume. We stopped testing with SDL1 some time ago, whilst still sort of supporting it theoretically... but then bitrot set in and a few things stopped working again. Why do we want to keep doing this? It's useful for backwards compatibility testing. Additionally SDL1 is still better in a few tiny ways - the main one being on some ancient embedded linux platforms.

- [Updates SDL1 overlay example so it works with py3 as well as py2](https://github.com/pygame/pygame/pull/1856) MyreMylar

As part of a code robustness adventure of fixing... [surface.blits was fixed](https://github.com/pygame/pygame/pull/1716) for low memory situations where thanks to nthykier.

[Add support for controlling screensaver state](https://github.com/pygame/pygame/pull/1734) by nthykier and continued on in https://github.com/pygame/pygame/pull/1843 allows changing the behaviour of pygame with regards to screensavers. By default pygame disables screensavers, which is good for games because you don't want a screensaver kicking in midway through a cut-scene. But some apps don't need this behaviour. So pygame.display.set_allow_screensaver(True)


camera

javascript
___
__()}|=| |] pygame.camera
( \/ |___|
| /|\
/| / | \




The [pygame.camera on windows got some fixes](https://github.com/pygame/pygame/pull/1775) so that it works well on SDL2 with the VideoCapture module. In the process MyreMylar made some improvements to [pygame.image.frombuffer](https://www.pygame.org/docs/ref/image.html#pygame.image.frombuffer) - the function used to quickly share large buffers of data with pygame and other modules.


Mask

js
▓▓
░░ ▓▓██▒▒ ▒▒▒▒░░
░░░░ ░░▒▒░░░░ ▒▒▓▓████░░ ▓▓▓▓▒▒
▒▒▒▒▒▒▒▒▒▒▒▒▒▒░░▒▒▓▓▓▓████▓▓░░▒▒▓▓▓▓▒▒▒▒
░░▒▒▒▒▒▒▓▓▒▒▒▒▒▒▒▒▓▓▓▓▓▓████▓▓▓▓▓▓▓▓▓▓▒▒▒▒░░
▒▒░░▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▓▓▓▓██████▓▓▓▓▓▓▒▒▒▒▒▒▒▒ ░░
██▒▒▒▒▒▒▒▒▒▒▒▒▒▒▓▓▓▓▓▓▓▓▓▓▓▓████▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▒▒
▒▒▓▓▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▓▓▓▓▓▓████▓▓▓▓██▓▓▒▒▒▒░░▓▓▓▓▓▓▓▓▓▓▓▓▓▓
▒▒▒▒ ░░▒▒▓▓▓▓██▓▓▓▓▓▓ ▓▓▓▓▓▓▓▓▒▒░░
▒▒▒▒▓▓ ░░▒▒▓▓██▓▓▓▓ ▒▒▓▓▓▓▓▓▒▒
░░▓▓▒▒▒▒ ▒▒▒▒██▓▓▒▒ ▒▒▒▒▓▓▓▓▓▓
▒▒▒▒▒▒▓▓▓▓▓▓▓▓▓▓▓▓▓▓▒▒██▓▓▒▒▒▒▒▒▒▒▒▒▒▒▓▓▒▒▓▓▒▒
░░▒▒▓▓▓▓▒▒▒▒▓▓▓▓▒▒▓▓▒▒██▒▒▓▓▒▒▓▓▒▒▓▓▓▓▒▒▓▓▓▓
░░▒▒▓▓▓▓▓▓▓▓▒▒▓▓▓▓▒▒██▓▓▓▓▓▓▓▓▓▓▓▓▒▒▒▒▒▒

pygame.Mask -- when 1 bit is enough



[Mask.to_surface](https://www.pygame.org/docs/ref/mask.html#pygame.mask.Mask.to_surface) is a way to draw 1bit Mask objects to surfaces. 1bit surfaces are great because they can be processed up to 32x faster than Surfaces with a large color depth(since Surfaces use up to 32bits per pixel). Great for pixel perfect collision detection in particular. Mask.to_surface is already useful, but Charles (aka charlesej) has been working on preparing to implement the `area` keyword as seen in Surface.blit.

This could be interesting to those people interested in doing deformable terrain.

- [Add fuzzy color support for Mask.to_surface](https://github.com/pygame/pygame/pull/1747)
- [Add/update Mask.to_surface tests](https://github.com/pygame/pygame/pull/1772)
- [Add Mask.to_surface area tests](https://github.com/pygame/pygame/pull/1854)
- [Fix typo in mask type stub](https://github.com/pygame/pygame/pull/1771) charlesej



good first issue

'goodfirstissue' is a label applied to issues which would be good for someone who wants to try contributing to a Free, Open Source, or community project (like pygame).

Dan Lawrence (aka MyreMylar) has been hard at work preparing almost 100 "good first issue"s for people to do.

Here are some of the first time contributors:

- [Added tests for mouse.set_pos()](https://github.com/pygame/pygame/pull/1824) Steven Chua aka Graphcalibur
- [Adds Surface.get_height test](https://github.com/pygame/pygame/pull/1829) K Duggan aka kduggan15
- [Add Surface.get_size test](https://github.com/pygame/pygame/pull/1822) PeanutbutterWarrior
- [Surface.get_locked test](https://github.com/pygame/pygame/pull/1826) PeanutbutterWarrior
- [Add joystick.get_init test](https://github.com/pygame/pygame/pull/1848) PeanutbutterWarrior
- [test for surface.get_offset](https://github.com/pygame/pygame/pull/1859) Nachiket Naganure aka NachiketUN
- [unit test for surface.get_clip()](https://github.com/pygame/pygame/pull/1860) Pierre Haou aka pierrehaou


Daniel Gillet (aka dangillet) worked on making [saving images to BytesIO/StringIO](https://github.com/pygame/pygame/pull/1858) work.

Thanks to kbanger on discord for looking into this "[ljpeg and lpng missing in Setup.SDL2.in](https://github.com/pygame/pygame/pull/1870)" issue, and also for working on updating the pygame buildroot package.


Fonts matter (don't they?)

Font [got a touch of modernization applied to it](https://github.com/pygame/pygame/pull/1862). `font.bold = True`, `font.underline = True` and `font.italics = True` are now things... rather than having to do a `font.set_bold(True)`. Now the freetype Font object has a ['bgcolor' attribute](https://github.com/pygame/pygame/pull/1735) to mirror existing 'fgcolor' one. [ftfont.Font: Fix NameError when resolution is 0](https://github.com/pygame/pygame/pull/1840) Thanks to Niels Thykier, aka nthykier

[SysFont](https://www.pygame.org/docs/ref/font.html?highlight=sysfont#pygame.font.SysFont) is used to load fonts which are already installed on users systems. It's historically been complex and often not working so well. Not anymore! MyreMylar made some first steps at [adding sysfont tests, and updating the font lists for windows and ubuntu](https://github.com/pygame/pygame/pull/1739). Then illume noticed some of those new tests failing on MacOS, because [`sysfont._add_font_paths` was adding ttf to 'simple font names'](https://github.com/pygame/pygame/pull/1849). So now it's working better on the Mac too.


Optimizations

[Adds MMX, SSE2 & Arm NEON optimised versions of blit_blend_premultiplied()](https://github.com/pygame/pygame/pull/1711) MyreMylar
[Some tweaks to the pre-multiply alpha blending](https://github.com/pygame/pygame/pull/1834)

[Add a SSE4.2 optimized version of image_tostring for some 32bit surfaces ](https://github.com/pygame/pygame/pull/1715) nthykier

[MSVC compiler optimisation hinting, 1% smaller pygame on windows](https://github.com/pygame/pygame/pull/1816) MyreMylar

Faster methods for [drawing filled rects and circles](https://github.com/pygame/pygame/pull/1670) of all kinds, care of robertpfeiffer

As a small speed up [Surface.blits](https://www.pygame.org/docs/ref/surface.html?highlight=surface%20blits#pygame.Surface.blits) was used in the [pygame.sprite](http://www.pygame.org/docs/ref/sprite.html) module to [speed it up a little bit](https://github.com/pygame/pygame/pull/1724).


Bug fixes and Cleanups

The static code analysis tool by microsoft "/analyze" is now being used. Thanks to Dan Lawrence, aka MyreMylar https://github.com/pygame/pygame/issues/1328

[setup: Error out on unused-value warnings with -pygame-ci](https://github.com/pygame/pygame/pull/1838) nthykier

[Clean up incompatible pointer casts and add a -Werror for it in the CI builds](https://github.com/pygame/pygame/pull/1844) nthykier

[Add pgRect_Normalize to C API](https://github.com/pygame/pygame/pull/1753)

PeanutbutterWarrior noticed that not all of the modules returned a boolean, sometimes they returned an int Then MyreMylar stepped up and made a PR to [Always return bool from get_init() instead of sometimes returning int](https://github.com/pygame/pygame/pull/1851)

[Reject attempts to delete attributes in that cannot be deleted](https://github.com/pygame/pygame/pull/1841) nthykier

python
>>> import pygame
>>> c = pygame.color.Color('black')
>>> del c.a
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: Cannot delete attribute a


[Freetype font int casting fix](https://github.com/pygame/pygame/pull/1855) Dan Lawrence (aka MyreMylar)


In MacOS we had a problem where [Default SDL render driver back to opengl](https://github.com/pygame/pygame/issues/1725) from the metal renderer. This had to do with a problem with our new [conan based dependency compilation on MacOS](https://github.com/pygame/pygame/pull/1864). Hopefully that's fixed now.


Issue gardening


css
********
****************
*******************
********************
******************** wWWWw wWWWw
\\ // ******** vVVVv (___) wWWWw (___) vVVVv
\\\// ******* (___) ~Y~ (___) vVVVv ~Y~ (___)
\\\//// ~Y~ \| ~Y~ (___) |/ ~Y~
|||// \| \ |/ \| / \~Y~/ \| \ |/
||||| \\|// \\|// \\|/// \\|// \\|// \\\|///
,,,,,,,,,,,//||||\,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;



This time 2 'critical' backwards compatibility issues were fixed since the last release. Also plenty of work went into looking at the alpha blit issue, and the color key issues.

MyreMylar made a great effort creating some good first issues, but also continued to go through a lot of older issues seeing if they could reproduce them, and asking questions of the original reporter, and also fixing a few here and there. As a result our issue garden is doing pretty well.


---

- [8 open 'critical' issues](https://github.com/pygame/pygame/issues?q=is%3Aissue+is%3Aopen+label%3Acritical) (backwards compatibility issues reported by people), and 24 closed (last release: 16 open, 22 closed).
- [merged PRs](https://github.com/pygame/pygame/pulls?q=is%3Apr+is%3Aclosed)
- [1442 Commits since 1.9.6 stable release](https://github.com/pygame/pygame/compare/1.9.6...2.0.0.dev10)
- [276 Commits since 2.0.0.dev8 pre release](https://github.com/pygame/pygame/compare/2.0.0.dev8...2.0.0.dev10)

2.0.0.dev8

🌺🌻🌹🥀🌷🌼🌸💐💮🌺🌻🌹🥀🌷🌼🌸💐💮🌺🌻

One year ago today on the 5th of May 2019 we released the first development release of the pygame 2 series. So today is our anniversary of sorts. 🎉


Type hints for better editor support.

Type hints are now installed thanks to MightyJosip https://github.com/pygame/pygame/pull/1685 This lets static type checkers do TAB completion and check your function inputs and outputs. Giving an altogether nicer experience when programming with pygame.

Color arguments are fuzzy wuzzy human friendlier

Thanks to new pygame team member nthykier in https://github.com/pygame/pygame/pull/1676
there is now support for writing colors in an easier way.

python

surf.fill('black') surf.fill(pygame.Color('black'))
surf.fill('FFEECCF0') surf.fill(pygame.Color('FFEECCF0'))


Drawing improvements, and rounded corners.

Drawing improvements including more correct AND faster circle drawing, rounded rects. Thanks to charlesej MightyJosip and robertpfeiffer. https://github.com/pygame/pygame/pull/1503

python

Draw a rectangle with rounded corners
pygame.draw.rect(screen, GREEN, [115, 210, 70, 40], 10, border_radius=15)
pygame.draw.rect(screen, RED, [135, 260, 50, 30], 0, border_radius=10, border_top_left_radius=0,
border_bottom_right_radius=15)

Draw only one circle quadrant
pygame.draw.circle(screen, BLUE, [250, 250], 40, 0, draw_top_right=True)
pygame.draw.circle(screen, RED, [250, 250], 40, 30, draw_top_left=True)
pygame.draw.circle(screen, GREEN, [250, 250], 40, 20, draw_bottom_left=True)
pygame.draw.circle(screen, BLACK, [250, 250], 40, 10, draw_bottom_right=True)



- Drawing an empty string now returns a zero sized surface and rect, before it was 1 pixel wide and the height of the font. https://github.com/pygame/pygame/pull/1488 Thanks to the MightyJosip
- Additionally, zero sized rects do not collide with anything anymore - thanks to thiagojobson and charlesej https://github.com/pygame/pygame/pull/1226
- [Fix drawing ellipses with width values > 1](https://github.com/pygame/pygame/pull/1577) charlesej
- [draw.c code refactoring and cleanup](https://github.com/pygame/pygame/pull/1552) MightyJosip
- [Declare UTF-8 encoding in draw_py](https://github.com/pygame/pygame/pull/1542) stefanor


pygame recipe added to Python-For-Android

Thanks to AndreMiras, robertpfeiffer and others there is a pygame recipe in python-for-android https://github.com/kivy/python-for-android/pull/2164 which is a python for android distribution.


Documentation and tutorials

Lots of little fixes, and even a whole new tutorial were made in this release. When someone takes the time to fix a little problem in the documentation that can help many people in the future from getting lost themselves.

- A new tutorial in Korean (and english) https://github.com/pygame/pygame/pull/1512 from first time contributor rumia0601
- Thanks to first time contributor glennmackintosh for fixing the docs for KMOD_MODE https://github.com/pygame/pygame/pull/1657
- [pygame.cursors.compile doc fix](https://github.com/pygame/pygame/pull/1689) thanks to MyreMylar
- Thanks to w-hat for the doc cleanups https://github.com/pygame/pygame/pull/1687.
Starbuck5 [Fixed a typo in gfxdraw doc](https://github.com/pygame/pygame/pull/1564)
- [Use an explicit encoding in the documentation headers writer](https://github.com/pygame/pygame/pull/1544) stefanor and Dominik George.
- [Fix documentation for Vector3's rotate methods](https://github.com/pygame/pygame/pull/1555) charlesej
- [Fix a number of spelling mistakes](https://github.com/pygame/pygame/pull/1543) stefanor
- [Fix incorrect comments in draw module example](https://github.com/pygame/pygame/pull/1538) Starbuck5
- Thanks vilhelmprytz for [a little doc fix](https://github.com/pygame/pygame/pull/1473) :)
- [pygame.music.play() looping docs consistent with pygame and SDL behaviour](https://github.com/pygame/pygame/pull/1693) MyreMylar
- [Document BLEND_PREMULTIPLIED Surface.blit flag](https://github.com/pygame/pygame/pull/1706) MyreMylar
- [Correction pygame.sprite.LayeredUpdates _layer attribute name](https://github.com/pygame/pygame/pull/1708) glennmackintosh


Optimizations

- [Speed up `pygame.image.fromstring`](https://github.com/pygame/pygame/pull/1650) nthykier
- Load time on windows and linux improved due to avoiding loading element tree.
- SDL 2.0.12 includes assembler optimizations for many blit drawing functions for ARM platforms like Raspberry Pi.
- The [assembler optimized scale function was enabled again](https://github.com/pygame/pygame/pull/1546) thanks stefanor
- The [draw bounds tests were sped up](https://github.com/pygame/pygame/pull/1571) charlesej
- circle drawing was sped up again, and is more correct.


new feature pygame.key.key_code

There's now a function to return the [key code from the name of a key](https://github.com/pygame/pygame/pull/1694).

Thanks to MyreMylar for digging into C code to implement, document and test this feature.

python
>>> pygame.key.key_code("return") == pygame.K_RETURN
True
>>> pygame.key.key_code("0") == pygame.K_0
True
>>> pygame.key.key_code("space") == pygame.K_SPACE
True


Bug fixes and Cleanups

Lots of bug fixes and cleanups continued to happen in the pygame code base.
We reached a milestone of turning lots of compiler warnings into errors for our linux builds.
In our C/C++ code we are now at zero alerts with LGTM, and only 10 left in our python code.

- Fixed some [potential memory leaks](https://github.com/pygame/pygame/pull/1632) in low memory conditions.
- Cleanups continued including [various cppchecker](https://github.com/pygame/pygame/pull/1497) [fixes](https://github.com/pygame/pygame/pull/1501) Some [LGTM bug fixes](https://github.com/pygame/pygame/pull/1590) were made too. Thanks to charlesej
- The [Mask.to_surface](https://github.com/pygame/pygame/pull/1588) method got a lot of tests, so did [the](https://github.com/pygame/pygame/pull/1585) [PixelArray.compare](https://github.com/pygame/pygame/pull/1583) method.
- The [playmus](https://github.com/pygame/pygame/pull/1579) example was fixed, thanks to flaambe Also the - [setmodescale](https://github.com/pygame/pygame/pull/1578) example fixed thanks to galexandreg
- [Fixed rect collision with negative size and image.frombuffer not working with ARGB](https://github.com/pygame/pygame/pull/1576) MightyJosip
- [Fix Python syntax warning](https://github.com/pygame/pygame/pull/1566) charlesej
- [midi: fix midi_to_ansi_note](https://github.com/pygame/pygame/pull/1561) zuh0
- [Close file handle fixed in MacOS](https://github.com/pygame/pygame/pull/1527) markph0204
- [Fix memory leak in pygame.font.Font.metrics](https://github.com/pygame/pygame/pull/1470) charlesej
- [OpenGL screen size from set_mode as requested.](https://github.com/pygame/pygame/pull/1482) illume
- [fix set_controls in _camera.c on python 3.8](https://github.com/pygame/pygame/pull/1484) robertpfeiffer
- Thanks to first time contributor DotMars for making [image.load throw FileNotFoundError](https://github.com/pygame/pygame/pull/1660) instead of the generic pygame.error when the file does not exist.


Dependencies updated

pygame uses a whole lot of different pieces of software to do a lot of the heavy lifting.

- There's a new [conan](https://conan.io/) based build system. Conan is a cross platform C/C++ package manager written in python. It's replaced our homebrew based build system for Mac, but may potentially be an option for other platforms too.
- [Windows dependencies were updated](https://github.com/pygame/pygame/pull/1629): SDL 2.0.12, SDL_ttf 2.0.15, and jpeg 9d. The [Windows dependency downloader: replaced requests with urllib](https://github.com/pygame/pygame/pull/1493), so that it can be used by people without first installing the requests module.
- The linux ['manylinux' build dependencies were updated](https://github.com/pygame/pygame/pull/1641). freetype-2.10.1, libpng-1.6.37, libwebp-1.1.0, mpg123-1.25.13, libogg-1.3.4, SDL2-2.0.12.
- [Portmidi is skipped on Debian GNU/kFreeBSD and GNU/Hurd too](https://github.com/pygame/pygame/pull/1545) thanks to stefanor and Debian folk.


Development improvements

Along with the typehints for most pygame functions (which I've already mentioned above) there were some improvements for people developing pygame itself.

Many compiler errors now cause the CI system to fail if present. Thanks again to charlesej for many fixes https://github.com/pygame/pygame/pull/1634 and to nthykier for making our CI bots fail for more warnings https://github.com/pygame/pygame/pull/1652

Previous pygame header files for C extensions using pygame were not installed. Now they are thanks to robertpfeiffer https://github.com/pygame/pygame/pull/1662

Some [depreciation warnings](https://github.com/pygame/pygame/pull/1627) from python 3.8 were fixed.

Community help

A special thanks to all the people who help out others. claudeb, DaFluffyPotato, MyreMylar, MichaelCPalmer, jtiai, Rabbid76, The Big Kahuna, sloth, Kingsley, ... Also a big thanks to the people who run community spaces and events like lordmauve who runs pyweek, and the /r/pygame community members.


Issues

MyreMylar in particular went above and beyond investigating lots of old pygame issues, and closing many. Some of them several years old.

I'm happy that 4 'critical' backwards compatibility issues were fixed since the last release. If you notice a backwards compatibility issue with the pygame 2 series please let us know with a delicious issue report. Nom nom nom 🍕

---

- [16 open 'critical' issues](https://github.com/pygame/pygame/issues?q=is%3Aissue+is%3Aopen+label%3Acritical) (backwards compatibility issues reported by people), and 22 closed (last release: 13 open, 18 closed).
- [merged PRs](https://github.com/pygame/pygame/pulls?q=is%3Apr+is%3Aclosed)
- [1166 Commits since 1.9.6 stable release](https://github.com/pygame/pygame/compare/1.9.6...2.0.0.dev8)
- [269 Commits since 2.0.0.dev6 pre release](https://github.com/pygame/pygame/compare/2.0.0.dev6...2.0.0.dev8)

2.0.0.dev6

🌺🌻🌹🥀🌷🌼🌸💐💮🌺🌻🌹🥀🌷🌼🌸💐💮🌺🌻

Python 3.8 support. For pygame 2 anyway. Decided not to do it for pygame 1.9.6, and to instead try and fix a few more of those 'critical' blocker issues (current [critical issue count](https://github.com/pygame/pygame/issues?q=is%3Aissue+is%3Aopen+label%3Acritical) is lucky 13).

Virtual Mouse mode with relative mouse movements was fixed to how it was in pygame 1.9.x - thanks to new committer mcpalmer1980. Who also added a new pygame.music.fadein() function, plus examples!

Support for old SDL1 SDL_VIDEO_WINDOW_POS and SDL_VIDEO_CENTERED environment variables which were removed in SDL2.

The Great Examples Cleanup of October 2019 is complete.
All of the examples were tidied up. Extra documentation was added, and things clarified. Thanks to new committer Starbuck5 for their work on examples/eventlist.py. There's now 43 example files!! Cleanups like removing usage of `from pygame.locals import *`, which is kind of cool... but also not considered good practice in the wider python community. Also the examples are now formatted with the python code for-matter. Additionally two interesting AND EDUCATIONAL new examples: music_drop_fade.py, and font_viewer.py were contributed by mcpalmer1980

bash
python3 -m pygame.examples.font_viewer
python3 -m pygame.examples.music_drop_fade


Cleanliness brings us joy

As part of the continuing ~~code~~prose cleanups of the pygame ~~code~~prose-base, we are now warning free on the clang C compiler on MacOS. Additionally warnings are now errors on the clang compiler when the robots check our code for us. We are also very close to zero warnings on different gcc versions, and Microsoft Visual C compiler too. We reached a new milestone with the 'LGTM' static analyzer. It now gives pygame an "A+" for both the python code, and the C code - meaning pygame is within the top 5% of projects with those languages. LGTM now checks new pull requests automatically, and helps us find some issues on pull requests. The Coverity static analyzer rates pygame source code as having less defects than high quality code bases like the Linux kernel, OpenSSL, and libcurl. Strangely (to me) pygame is regularly trending on github as a C project. A lot of the cleanups were done by charlesej, so thanks a lot for that! Oh, and a warning... please don't look at our setup.py file!!!! It's still scary AF. We have over 45,000 lines of python in pygame, and 350,000 lines of C... and a lot of that needs some attention.

Some developer improvements include verbose mode to our test runner (`python3 -m pygame.tests -v`), and the mechanism to share functions and data in our C API has been documented. See the [Hacking developer guide](https://www.pygame.org/wiki/Hacking).

Want to collide between a rect and a line?

Well, charlesej has you covered with the new `Rect.clipline()`. This can also tell you where a line clips with a Rect. It was great to see the discussion on this as different people talked about API trade offs, and together came up with a very nice API. Thanks to mcpalmer1980 for the discussion on the design, and also to thiagojobson (who is now part of the pygame team on github! 🎈 🎉 ).

First time committer hnrkcode fixed how comments are displayed on the website. Also thanks to 0101011 for a doc fix. Speaking of new committers, galexandreg helped out fixing the pygame.mixer.Sound.get_num_channels() function to return a correct result in some cases (the sound stuff got a number of fixes this release!)

robertpfeiffer did some more work on the SCALED feature, after a patch from lordmauve enabling use of it with OpenGL apps.

Thanks to TravisCI who have allowed us to try out their alpha ARM64 support. We don't have pygame building on it yet, but hopefully soon it can join our other ROBOT builders like the power pc one.

In distro packaging news, FreeBSD now has pygame 1.9.6. Which is great, because it stuck around at 1.8.x for many years now. Thanks to Wen, and Nathan in maintaining it there. See the giant list of [119 pygame packages](https://repology.org/project/python:pygame/versions) in different distros. No one seems to have packaged a pre-release of pygame 2 yet.

Cheers to the folks in the discord chat helping people out, chatting and sharing project updates on things. Especially to claudeb, and blubberquark.

All the regressions that were reported in issues for the 2.0.0.dev4 release have been fixed. Including one circle drawing regression fix by MightyJosip, who also fixed a long lasting 'thick line' pygame.draw issue. Both very tricky ones! Also thanks to some very detailed unit tests that were written by charlesej for the draw module that let us verify the drawing algorithms.

I'm happy that 5 'critical' backwards compatibility issues were fixed since the last release. If you notice a backwards compatibility issue with the pygame 2 series please let us know with a delicious issue report. Nom nom nom 🍕

---

- [13 open 'critical' issues](https://github.com/pygame/pygame/issues?q=is%3Aissue+is%3Aopen+label%3Acritical) (backwards compatibility issues reported by people), and 18 closed.
- [merged PRs](https://github.com/pygame/pygame/pulls?q=is%3Apr+is%3Aclosed)
- [885 Commits since 1.9.6 stable release](https://github.com/pygame/pygame/compare/1.9.6...2.0.0.dev6)
- [172 Commits since 2.0.0.dev4 pre release](https://github.com/pygame/pygame/compare/2.0.0.dev4...2.0.0.dev6)

ps. Why dev6 instead of dev5? This time 2.0.0.dev5 was the version given to the git repo. So we can tell if someone is compiling pygame from source in bug reports. The git repo pygame will become 2.0.0.dev7, and when released it will be 2.0.0.dev8. This is how libsdl are doing things now too, and it's a good idea.
🤖 is coming. Happy hacking!

Page 7 of 10

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.