导航:首页 > 图片大全 > 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的柱状图变成图片 浏览:752
动漫森女图片 浏览:403
汉服图片衣服纸样 浏览:748
最美女杀手安娜图片 浏览:745
ppt如何让图片背景去掉 浏览:736
披发发型图片优雅 浏览:381
word组合图形和图片 浏览:598
男生专用聊天背景图片黑色 浏览:468
织语毛巾价格图片 浏览:818
漂亮可爱宝可梦图片 浏览:920
小女孩高冷图片 浏览:785
绒线钩衣服的花样图片 浏览:946
张敬轩发型图片 浏览:659
word在表格中插入图片如何布满 浏览:660
短脸蛋发型图片 浏览:851
土酒价格图片 浏览:765
纯色简约黑衣服图片 浏览:625
人心不简单图片大全 浏览:810
想你了男生图片动漫 浏览:129
脸长男适合的发型图片 浏览:939