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

熱點內容
心痛女孩子的動態圖片 瀏覽:418
女孩白色內內圖片 瀏覽:407
入冬早上好文字圖片 瀏覽:758
帥氣男生換裝圖片 瀏覽:377
短發面條卷發型圖片 瀏覽:1159
可愛小孩子圖片賣萌 瀏覽:782
花的圖畫手繪簡單圖片 瀏覽:927
動漫公主服裝圖片大全圖片大全 瀏覽:333
動漫繪畫作品圖片 瀏覽:270
小女孩幾幾的現狀圖片 瀏覽:502
櫻花圖片動漫圖 瀏覽:872
成熟潮男搭配衣服圖片 瀏覽:306
動漫人物圖片大全黑白 瀏覽:1217
最多動漫圖片 瀏覽:986
小鳥衣服圖片大全可愛 瀏覽:643
手擋太陽的圖片女生 瀏覽:724
男女生圖片背影圖片 瀏覽:1283
想太多心會累文字圖片 瀏覽:570
簡單動漫圖片教程視頻 瀏覽:751
女孩發育圖片視頻 瀏覽:766