导航:首页 > 图片大全 > python如何让图片跟着鼠标移动

python如何让图片跟着鼠标移动

发布时间:2024-03-26 05:03:18

1. python 获取鼠标在图片上的坐标

下pygame mole,然后


importpygame
pygame.init()
screen=pygame.display.set_mode([100,100])##sizeofwindow
your_image=pygame.image.load("your_image_name.png")##imagemustbeinthesamefolder,elsepathmustbespecified
while1:
screen.blit(your_image,[0,0])##posofyourimageonthewindow
foreventinpygame.event.get():
ifevent.type==pygame.QUIT:
exit()

position=pygame.mouse.get_pos()##positionofmouseonwindow
printposition
pygame.display.set_caption(str(position))##makeitthetitleofthewindow
pygame.display.flip()
阅读全文

与python如何让图片跟着鼠标移动相关的资料

热点内容
怎么把word的柱状图变成图片 浏览:753
动漫森女图片 浏览:404
汉服图片衣服纸样 浏览:749
最美女杀手安娜图片 浏览:746
ppt如何让图片背景去掉 浏览:737
披发发型图片优雅 浏览:383
word组合图形和图片 浏览:602
男生专用聊天背景图片黑色 浏览:473
织语毛巾价格图片 浏览:821
漂亮可爱宝可梦图片 浏览:923
小女孩高冷图片 浏览:787
绒线钩衣服的花样图片 浏览:948
张敬轩发型图片 浏览:662
word在表格中插入图片如何布满 浏览:663
短脸蛋发型图片 浏览:855
土酒价格图片 浏览:766
纯色简约黑衣服图片 浏览:628
人心不简单图片大全 浏览:813
想你了男生图片动漫 浏览:133
脸长男适合的发型图片 浏览:941