我对 pygame 几乎一无所知,我正在尝试通过弄乱示例来学习。我也在阅读文档并可能尝试一些教程。
我有 javascript 和processing.js 背景,这是我在可汗学院的计算机科学部分学到的。
无论如何,在表面对象的文档(我下载的 pdf 的第 4 页)中,它说“对于普通软件表面,0 可以用于标志。”因此,作为我的第一个实验,我将示例 aacircle.py 中的 pygame.SRCALPHA 更改为 0 并对其进行了测试。屏幕从带有黑色圆圈的红色背景变成了纯黑色。为什么?
最佳答案
我建议您查看 pygame documentation on surfaces :
The pixel format can be controlled by passing the bit depth or an existing Surface. The flags argument is a bitmask of additional features for the surface. You can pass any combination of these flags:
HWSURFACE, creates the image in video memory
SRCALPHA, the pixel format will include a per-pixel alpha
关于pygame - 什么是旗帜? pygame.SRCALPHA 标志的用途是什么(我在示例 aacircle.py 中遇到过该标志)?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30879474/