My question is all I want to do is display text on the screen in pygame. If someone known how to do this please tell me!
My code
import time
import pygame
from pygame.locals import *
pygame.init
blue = (0,0,255)
WINDOW_WIDTH = 500
WINDOW_HEIGHT = 500
WINDOW = pygame.display.set_mode((WINDOW_WIDTH,WINDOW_HEIGHT))
pygame.display.set_caption("Text")
while True:
for event in pygame.event.get():
if event.type == QUIT:
pygame.quit
exit()
font = pygame.font.SysFont(None, 25)
def show_text(msg,color):
text = font.render(msg,True,color)
WINDOW.blit(text,[WINDOW_WIDTH/2,WIDTH_HEIGHT/2])
show_text("This is a message!", blue)
pygame.display.update()
I want to just make text that says "This is a message!". That is all