I am making a program with sprites. I have a "box" where the sprites is going to come inside and show only inside the "box". I have tried to find how to change layers and came to this documentation on pygame.sprites, but I can't understand the codes there for changing layers. Does anyone know how I can set the sprite in the middle of the layers instead of on the top?

有帮助吗?

解决方案

To change the layer of a Sprite, simply use the change_layer method:

change_layer()

changes the layer of the sprite

change_layer(sprite, new_layer) -> None

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top