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)