我执行了以下代码
def draw():
screen.draw.text("hello", topleft=(10 , 10))
但是我得到的输出只是 5 个白色 block 而不是 hello enter image description here
最佳答案
最小Pygame Zero脚本如下所示:
import pgzrun
def draw():
screen.clear()
screen.draw.text("hello", topleft = (10, 10))
pgzrun.go()
您必须调用pgzrun.go()
在 draw
的定义之后功能。
关于python - 我写了一行在 pygamezero 中显示 hello,但它显示白色 block 而不是文本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/69723084/