08/06/05 02:22:14
#!/usr/bin/env python
# -*- coding:utf-8 -*-
import pygame
from pygame.locals import *
pygame.init()
screen = pygame.display.set_mode((100, 100))
pygame.display.set_caption('Hello pygame')
fp = open(u'みかちゃん-P.ttf', 'rb')
font = pygame.font.Font(fp, 24)
text = font.render(u'Hello World!', True, (255, 0, 0))
text2 = font.render(u'Hello World!', True, (0, 255, 0))
fp.close()
while True:
screen.blit(text, (0, 0))
screen.blit(text2, (0, 60))
pygame.display.flip()
for event in pygame.event.get():
if event.type == QUIT or (event.type == KEYDOWN and event.key == K_ESCAPE):
break