2018-07-27 day-10作业

2018-07-27  本文已影响0人  BIGBOSS_93d6

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()

上一篇下一篇

猜你喜欢

热点阅读