導航:首頁 > 圖片大全 > 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如何讓圖片跟著滑鼠移動相關的資料

熱點內容
心痛女孩子的動態圖片 瀏覽:827
女孩白色內內圖片 瀏覽:821
入冬早上好文字圖片 瀏覽:1121
帥氣男生換裝圖片 瀏覽:740
短發面條卷發型圖片 瀏覽:1519
可愛小孩子圖片賣萌 瀏覽:1136
花的圖畫手繪簡單圖片 瀏覽:1375
動漫公主服裝圖片大全圖片大全 瀏覽:685
動漫繪畫作品圖片 瀏覽:686
小女孩幾幾的現狀圖片 瀏覽:875
櫻花圖片動漫圖 瀏覽:1250
成熟潮男搭配衣服圖片 瀏覽:643
動漫人物圖片大全黑白 瀏覽:1567
最多動漫圖片 瀏覽:1326
小鳥衣服圖片大全可愛 瀏覽:1004
手擋太陽的圖片女生 瀏覽:1122
男女生圖片背影圖片 瀏覽:1658
想太多心會累文字圖片 瀏覽:901
簡單動漫圖片教程視頻 瀏覽:1105
女孩發育圖片視頻 瀏覽:1139