Search code examples
pygamepygame-surface

How can I draw things in the foreground with pygame?


How can I draw things in the foreground with pygame? With things I mean a text that I draw with .blit. Because I have a floor that hides the text I want to show How could I fix that?


Solution

  • blit draw one image onto another. Therefore you must draw the text after the floor:

    screen.blit(floor, floor_pos)
    screen.blit(text, text_pos)