2018-07-27 day-10作业

pygame的用法

import pygame
pygame.init()
screen=pygame.display.set_mode((600,600))
screen.fill((255,255,255))
from math import pi
pygame.draw.line(screen,(0,0,0),(250,300),(350,300),5)
pygame.draw.line(screen,(0,0,0),(300,250),(300,350),5)
pygame.draw.line(screen,(0,0,0),(250,450),(300,350),5)
pygame.draw.line(screen,(0,0,0),(350,450),(300,350),5)
pygame.draw.line(screen,(255,0,0),(280,210),(295,210),3)
pygame.draw.line(screen,(255,0,0),(305,210),(320,210),3)
pygame.draw.arc(screen,(255,0,0),(280,220,40,20),pi,pi*2,3)
pygame.draw.circle(screen,(0,0,0),(300,220),30,5)
image=pygame.image.load('./font/dilireba.jpeg')
image2=pygame.transform.rotozoom(image,0,0.2)
screen.blit(image2,(0,0))
font=pygame.font.Font('./font/aa.ttf',30)
surface=font.render('迪丽热巴真漂亮',True,(0,0,255))
screen.blit(surface,(100,500))
pygame.display.flip()

while True:
    for event in pygame.event.get():
        if event.type==pygame.QUIT:
            exit()

你可能感兴趣的:(2018-07-27 day-10作业)