Advertisement
cookertron

Labros Zabi - Text Output

Mar 27th, 2022
1,091
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.46 KB | None | 0 0
  1. import pygame
  2.  
  3. WHITE = 0xffffff
  4. BLACK = 0x000000
  5.  
  6. pygame.init()
  7. PDR = pygame.Rect(0, 0, 800, 600)
  8. PDS = pygame.display.set_mode(PDR.size)
  9. FONT = pygame.font.SysFont("arial", 10)
  10.  
  11. surface = FONT.render("This is a test", False, WHITE)
  12. PDS.blit(surface, (0, 0))
  13.  
  14. pygame.display.update()
  15.  
  16. exit_demo = False
  17. while not exit_demo:
  18.     for e in pygame.event.get():
  19.         if e.type == pygame.KEYUP:
  20.             if e.key == pygame.K_ESCAPE: exit_demo = True
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement