How to remove/replace text in pygame

前端 未结 3 1448
一个人的身影
一个人的身影 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:35

    You could also overwrite your text.
    Like this:

    label = myfont.render("Text", 0, (255,255,0))
    screen.blit(label, (100, 100))
    if x: //Parameter you check before overwrite
        label = myfont.render("Text", 0, BACKGROUND_COLOR)
        screen.blit(label, (100, 100))
    

提交回复
热议问题