1

I'm trying to make box that displays information about objects, and be able to be moved around. Its a click play and watch what happens kind of game so nothing is going on in the background while you move this information box around. I'm trying to find a way to not have to keep redrawing all of the stuff in the background while I'm moving this box. Is there any way to do this, or do I have to continue updating whats behind. I'm kind of new to pygame but have tried the pygame.surface.Surface but I think I used it wrong and it didn't work.

Thanks :D

Champ
  • 11
  • 1
  • It's your program, you can make it work any way you like. But it's common to repaint the screen from the background through to the foreground every frame. If the background and info-box position is static (while being viewed), you could have a separate event-loop that just waits for the box to be closed. But if you want to move the box during view, then it starts to be an animation, and you need to repaint the background from where it moved. What do you mean "able to me moved around"? Moved in real-time? Opens, then closes, opens again somewhere else? – Kingsley Jun 19 '20 at 02:41

1 Answers1

1

You can pass parameters in the pygame.display.update() function to only update a certain portion of the screen: How do I pass a rect into pygame.display.update() to update a specific area of the window?

Pzet
  • 470
  • 2
  • 4
  • 11