Question

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?

Was it helpful?

Solution

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

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top