I have a computer game I’m working on, and I’m wanting to give the user an option to turn off alpha compositing for speed purposes. Rather than doing checks everywhere, does Pygame have a global option to say “Don’t use alpha” such that it would just ignore all my calls to set_alpha and the likes?
Share
Considering the pygame docs I would say “no, there is no global way to disable alpha”.
However there are at least two ‘local’ ways to do it:
First would be to subclass pygame.Surface and provide your own implementation of set_alpha
which in turn could honor your global alpha settings.
Second one is a bit more tricky as it depends on the pixel-format in use.
To quote the pygame docs:
With this you could provide two sets of textures:
Hope this will help!