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

熱點內容
心痛女孩子的動態圖片 瀏覽:48
女孩白色內內圖片 瀏覽:71
入冬早上好文字圖片 瀏覽:516
帥氣男生換裝圖片 瀏覽:109
短發面條卷發型圖片 瀏覽:900
可愛小孩子圖片賣萌 瀏覽:538
花的圖畫手繪簡單圖片 瀏覽:663
動漫公主服裝圖片大全圖片大全 瀏覽:62
動漫繪畫作品圖片 瀏覽:34
小女孩幾幾的現狀圖片 瀏覽:154
櫻花圖片動漫圖 瀏覽:647
成熟潮男搭配衣服圖片 瀏覽:63
動漫人物圖片大全黑白 瀏覽:985
最多動漫圖片 瀏覽:744
小鳥衣服圖片大全可愛 瀏覽:416
手擋太陽的圖片女生 瀏覽:455
男女生圖片背影圖片 瀏覽:985
想太多心會累文字圖片 瀏覽:334
簡單動漫圖片教程視頻 瀏覽:520
女孩發育圖片視頻 瀏覽:521