[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[pygame] display.update



Hello everyone,

Strange problem that is probably something to do with RenderUpdates or
something.

My game has game sprites and then, overlayed on the screen, some menu
sprites (buttons, etc). Except I find that when I add a large game
sprite, the menu sprites are underneath the game sprite.

This is the code (simplified):

RectsToUpdate = []
gameSprites.update()
RectsToUpdate.extend(gameSprites.draw(.screen))

menuSprites.update()
RectsToUpdate.extend(menuSprites.draw(.screen))

pygame.display.update(RectsToUpdate)
clock.tick(framerate) 
gameSprites.clear(screen, background)
menuSprites.clear(screen, background)


As far as I can tell, since menuSprites.update() occurs after the
gameSprite.update(), the menu sprites should be "on top". Any
suggestions?

Thanks,
Luke