画画工具
发表在每日签到帖
2020-05-16
是否精华
是
否
版块置顶:
是
否
代码如下: import pygame from pygame.locals import * sc=pygame.display.set_mode((700,460)) x,y=pygame.mouse.get_pos() isHold=False while True: for e in pygame.event.get(): if e.type==QUIT: pygame.quit() if e.type==MOUSEBUTTONDOWN: x,y=pygame.mouse.get_pos() isHold=True if e.type==MOUSEBUTTONUP: isHold=False if isHold: pygame.draw.line(sc,(255,255,255),(x,y),pygame.mouse.get_pos(),1) x,y=pygame.mouse.get_pos() pygame.display.update()