import pygame
from pygame.locals import *
import sys
pygame.init() # Pygameの初期化
sc = pygame.display.set_mode((500, 500)) # 大きさ400*300の画面を生成
pygame.display.set_caption("練習3") # タイトルバーに表示する文字
font = pygame.font.Font(None, 55)
while (1):
sc.fill((0,100,0)) # 画面を黒色(#000000)に塗りつぶし
text = font.render("TEST", True, (255,255,255)) # 描画する文字列の設定
sc.blit(text, [20, 100])
pygame.display.update() # 画面を更新
for event in pygame.event.get():
if event.type == QUIT: # 閉じるボタンが押されたら終了
pygame.quit() # Pygameの終了(画面閉じられる)
sys.exit()
最終更新:2018年01月20日 09:14