所以我尝试使用pygame开发一个游戏。我希望光标图像位于顶层。我试过这个:
pygame.sprite.LayeredUpdates.move_to_front(cursor_img).
但它给了我一个错误:
Traceback (most recent call last):
File "C:/Users/Administrator/PycharmProjects/PythonProjects/pythonProjects/game/main.py", line 50, in <module>
pygame.sprite.LayeredUpdates.move_to_front(cursor_img)
TypeError: move_to_front() missing 1 required positional argument: 'sprite'
我想它也希望我通过“自我”论证,但我不知道该通过什么。 有什么帮助吗?谢谢
^{} 是管理^{} 对象的组对象。} 是一个Method Objects。} 对象:
^{
pygame.sprite.LayeredUpdates.move_to_front
的参数必须是组中包含的^{因此,您必须创建一个组
包含^{} 对象的。在下面的} 对象:
my_sprite
中有一个^{然后,可以将精灵与层关联,并将层置于最前面:
最简单的例子:
相关问题 更多 >
编程相关推荐