How to remove/replace text in pygame

前端 未结 3 1444
一个人的身影
一个人的身影 2020-12-10 14:53

I\'m fairly new to pygame and ive hit my first stump which I cannot find an answer for..

After blitting text, then changing the string for the same variable, the gam

3条回答
  •  隐瞒了意图╮
    2020-12-10 15:55

    There can be an other solution, even if it's not very different. The previous answer erases all the screen, but you can erase just your text. If it's written on an image, you will replace just a part of the image, by getting the text size and blitting the corresponding image part (pygame.surface.subsurface function). Or if it's not, you can just fill a part of the screen. In this case you will just erase your text.

提交回复
热议问题