Advertisement
Flame-Soulis

PiGlass Demo

Feb 7th, 2016
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.15 KB | None | 0 0
  1. import pygame, time
  2.  
  3. pygame.init()
  4. clock = pygame.time.Clock()
  5.  
  6. screen = pygame.display.set_mode((640,480),0,32)
  7. pygame.display.set_caption('Test')
  8.  
  9. font1 = pygame.font.SysFont("comicsansms", 128)
  10. font2 = pygame.font.SysFont("comicsansms", 72)
  11.  
  12. gameExit = False
  13. while not gameExit:
  14.     for event in pygame.event.get():
  15.         if event.type == pygame.QUIT:
  16.             gameExit = True
  17.  
  18.     #Drawing
  19.     screen.fill((0,0,0))
  20.     text = font1.render(time.strftime("%H:%M:%S", time.localtime()), True, (255,255,255))
  21.     screen.blit(text,
  22.         (320 - text.get_width() // 2, 240 - text.get_height() // 2))
  23.     text = font2.render(time.strftime("%b %d %Y", time.localtime()), True, (255,255,255))
  24.     screen.blit(text,
  25.         (320 - text.get_width() // 2, (240 - text.get_height() // 2)-text.get_height()))
  26.     pygame.draw.circle(screen, (255,255,255), (310,screen.get_height()-30),20,3)
  27.     pygame.draw.circle(screen, (255,255,255), (310-50,screen.get_height()-30),20,3)
  28.     pygame.draw.circle(screen, (255,255,255), (310+50,screen.get_height()-30),20,3)
  29.  
  30.     #Main Draw
  31.     pygame.display.update()
  32.     clock.tick(60)
  33.  
  34. pygame.quit()
  35. quit()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement