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

熱點內容
小女孩煙熏妝圖片 瀏覽:893
面具紋身圖案大全圖片 瀏覽:372
那拉提女孩圖片 瀏覽:152
女生的小腿圖片 瀏覽:666
好看的耳飾品圖片大全 瀏覽:626
翻白眼圖片配什麼文字 瀏覽:423
如何把圖片加入到音樂中 瀏覽:463
男生頭像紫色背影圖片 瀏覽:217
可愛白色動漫圖片 瀏覽:180
獨立的小女孩圖片 瀏覽:82
個高衣服圖片 瀏覽:158
直中長發發型背影圖片 瀏覽:436
怎麼做手工頭飾圖片 瀏覽:77
簡單少女圖片大全 瀏覽:781
帥氣的動漫古風人物圖片男生 瀏覽:255
國畫可愛熊貓圖片大全集簡單 瀏覽:270
畫人的圖片女孩圖片簡單 瀏覽:613
女旗袍連衣裙圖片大全 瀏覽:376
白色長外套怎麼搭配圖片 瀏覽:104
男生喜歡胖的還是瘦的對比圖片 瀏覽:832