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

熱點內容
心痛女孩子的動態圖片 瀏覽:337
女孩白色內內圖片 瀏覽:330
入冬早上好文字圖片 瀏覽:685
帥氣男生換裝圖片 瀏覽:305
短發面條卷發型圖片 瀏覽:1083
可愛小孩子圖片賣萌 瀏覽:712
花的圖畫手繪簡單圖片 瀏覽:876
動漫公主服裝圖片大全圖片大全 瀏覽:277
動漫繪畫作品圖片 瀏覽:195
小女孩幾幾的現狀圖片 瀏覽:442
櫻花圖片動漫圖 瀏覽:799
成熟潮男搭配衣服圖片 瀏覽:248
動漫人物圖片大全黑白 瀏覽:1163
最多動漫圖片 瀏覽:914
小鳥衣服圖片大全可愛 瀏覽:585
手擋太陽的圖片女生 瀏覽:649
男女生圖片背影圖片 瀏覽:1203
想太多心會累文字圖片 瀏覽:510
簡單動漫圖片教程視頻 瀏覽:694
女孩發育圖片視頻 瀏覽:692