I was wondering if it is possible to display text from a txt file onto a pygame screen. I am working on a game, and I am attempting to display the instructions from a text file in my game.
Here is what I did below:
def instructions():
instructText = instructionsFont.render(gameInstructions.txt, True, WHITE)
screen.blit(instructText, ((400 - (instructText.get_width()/2)),(300 - (instructText.get_height()/2))))
However I get the error:
line 356, in instructions
instructText = instructionsFont.render(pongInstructions.txt, True, WHITE)
NameError: name 'pongInstructions' is not defined
My attempt however, is all trial and error because I am actually unsure of how to do this... Any help is greatly appreciated!