用户:是时候展现真正的实力了_加油查看:0 回复:3 评论:0 创建时间:2019-08-02T16:22:46
【作品展示】

【作品介绍】
这是一个pygame做的绘制程序,时间问题,乱选了张图片
【作品源代码】
import pygame
pygame.init()
screen = pygame.display.set_mode([800,600])
pygame.display.set_caption("Click and drag to draw")
keep_going = True
YELLOW = (255,255,0)
radius = 15
mousedown = False
while keep_going:
for event in pygame.event.get():
if (event.type == pygame.QUIT):
keep_going = False
if (event.type == pygame.MOUSEBUTTONDOWN):
mousedown = True
if (event.type == pygame.MOUSEBUTTONUP):
mousedown = False
if mousedown:
spot = pygame.mouse.get_pos()
pygame.draw.circle(screen, YELLOW, spot, radius)
pygame.display.update()
pygame.quit()
【提示】
部分含有Python第三方库相关内容的作品,在海龟编辑器网页端无法运行哦!如遇到这种情况,可以打开下面的链接,下载海龟编辑器客户端:
https://python.codemao.cn