私はすでにポケットモンスターゲームのように見えるように、Pygameウィンドウにテキストを配置するためのチュートリアルをいくつか見てきました。しかし、私は 'rect'形状に挿入するのではなく、ウィンドウにこれをまっすぐに実行することに問題があります。プログラムはエラーを表示せず、うまく動作しますが、テキストも画面に表示されません。Pygameポケモンのスタイルのテキスト表示
def display_text_animation(string): #Here is the function for animating the text
text = ''
for i in range(len(string)):
text += string[i]
text_surface = font.render(text, True, BLACK)
pygame.display.update()
pygame.time.wait(100)
def intro():
gameDisplay = displayBox()
progBg1 = pygame.image.load("introScr.png")
gameDisplay.blit(progBg1, (0,0))
display_text_animation('Hello World!') #here is where I call the text to appear.
どの部分が正確にテキストを表示していますか?私はどこにでも 'text 'を参照することはありません。 –
@Jerome Indefenzo申し訳ありません。私はレンダリング行を追加するのを忘れていました。私の悪い –
そう...それは今動作するのですか? –