-1

No text is showing up on my screen when this is ran, I've tried diffrent methods and everything. My images are loading before the text, and there is an update function

global font
global S
Seconds = 5
Black = (0,0,0)
White = (255,255,255)
#Story Text
Story = []
Story.append("You're Going To Try And Turn It Into a Trading Hub.")    
Story.append("There Isn't Anyone There, It's Yours Now.")
Story.append('You Go In Hoping For No One To Be There.')
Story.append('You Stumble Upon a Vacant Trading Station.')

#Display Story Text
if S > -1:
    startingtext = font.render(Story[S], True, White)
    startingtextRect = startingtext.get_rect()
    startingtextRect.center = (137 // 2, 78 // 3)
    window.blit(startingtext, startingtextRect) 
    if S > 0:
        if Wait == (Seconds * 1):
            S = 2
        elif Wait == (Seconds * 2):
            S = 1
        elif Wait == (Seconds * 3):
            S = 0
        elif Wait == (Seconds * 4):
            S = -1
  

S equals 3 by the way, and the font does work.

1 Answers1

0

The Game Loop was:

Image()
Update()
Text()

Update need to be last

  • @TomServo this implies that the answer was placing the `Text()` function before the `Update()` function, the latter causes a screen redraw. In the original order, only the image is shown, the text is never updated to the screen and is then overwritten by the next call to `Image()`. – import random Nov 03 '22 at 02:54