文字重叠?

问题描述

我是 Python 初学者,需要帮助。 我正在尝试渲染一些文本,它们似乎重叠。 女孩要说些什么,其他文字应该消失。 我的代码

import pygame
import time
screen = pygame.display.get_surface()
pygame.init()
from pygame.locals import *
white = pygame.color.Color('#ffffff')
font = pygame.font.Font(None,40)
text = font.render('hello! I am the witch of the valley.',False,white)
text2 = font.render('i will help you through your python journey.',white)
def message_to_screen(msg,color):
    screen_text = Font.render(msg,True,color)

screen_width =  900
screen_height = 800
window = pygame.display.set_mode((screen_width,screen_height))
screen = pygame.display.set_mode((screen_width,screen_height))

BG1 = pygame.image.load("background.jpg").convert()
witch = pygame.image.load("witch.png").convert_alpha()

while True:
    screen.blit(BG1,(0,0))

    screen.blit(witch,100))

    pygame.display.update()


    run = True
    while run:
        window.blit(text,0))
        pygame.display.flip()
        time.sleep(3)
        text.putalpha
        text.save(dest)
        pygame.display.update()
        window.blit(text2,0))
        for event in pygame.event.get():
            if event.type == pygame.QUIT:
                run = False
pygame.quit()


解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)