美文网首页
2018-07-27 day-10作业

2018-07-27 day-10作业

作者: BIGBOSS_93d6 | 来源:发表于2018-07-27 20:20 被阅读0次

    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作业

          本文链接:https://www.haomeiwen.com/subject/rtzgmftx.html