Flame-Soulis icon

PiGlass Demo

Flame-Soulis | PRO | 02/07/16 06:42:58 AM UTC | 0 ⭐ | 312 👁️ | Never ⏰ | []
Python |

1.15 KB

|

None

|

0 👍

/

0 👎

import pygame, time
 
pygame.init()
clock = pygame.time.Clock()
 
screen = pygame.display.set_mode((640,480),0,32)
pygame.display.set_caption('Test')
 
font1 = pygame.font.SysFont("comicsansms", 128)
font2 = pygame.font.SysFont("comicsansms", 72)
 
gameExit = False
while not gameExit:
    for event in pygame.event.get():
        if event.type == pygame.QUIT:
            gameExit = True
 
    #Drawing
    screen.fill((0,0,0))
    text = font1.render(time.strftime("%H:%M:%S", time.localtime()), True, (255,255,255))
    screen.blit(text,
        (320 - text.get_width() // 2, 240 - text.get_height() // 2))
    text = font2.render(time.strftime("%b %d %Y", time.localtime()), True, (255,255,255))
    screen.blit(text,
        (320 - text.get_width() // 2, (240 - text.get_height() // 2)-text.get_height()))
    pygame.draw.circle(screen, (255,255,255), (310,screen.get_height()-30),20,3)
    pygame.draw.circle(screen, (255,255,255), (310-50,screen.get_height()-30),20,3)
    pygame.draw.circle(screen, (255,255,255), (310+50,screen.get_height()-30),20,3)
 
    #Main Draw
    pygame.display.update()
    clock.tick(60)
 
pygame.quit()
quit()

Comments

  •  icon
    01/01/70 12:00:00 AM UTC
    Plain Text |

    0 B

    |

    👍

    /

    👎