[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [pygame] Re: overlayed text
> > your problem here is that your are blitting the text _after_ you
> > update the display. swap those last two lines around.
> i put in the update _after_ it didnt work 6 times ;)
hmm, well perhaps try to determine where your code differs from my
little attached example? hopefully this helps.
"""example of text on white"""
message = "Press any key to exit."
textcolor = 200, 0, 0
backcolor = 255, 255, 255
from pygame.locals import *
screen = pygame.display.set_mode((640, 480))
tophalf = screen.get_rect()
tophalf.height = tophalf.centery
font = pygame.font.Font(None, 40)
text = font.render(message, 1, textcolor)
screen.blit(text, (40, 40))
while pygame.event.wait().type not in (QUIT, KEYDOWN): pass
if __name__ == '__main__': main()