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

熱點內容
海青最新短發發型圖片 瀏覽:904
各種美食吃貨文字圖片 瀏覽:31
小羊當兵發型圖片 瀏覽:842
ps怎麼把圖片平均分成 瀏覽:828
我姓程的文字圖片 瀏覽:384
高端實木腳線圖片帶文字說說 瀏覽:871
舊瓶子做衣服圖片大全 瀏覽:894
簡筆畫畫春天的衣服圖片 瀏覽:380
高冷帥氣男生圖片 瀏覽:45
ps圖片怎麼轉換格式 瀏覽:414
蝴蝶簡單簡筆畫圖片大全 瀏覽:195
法國幣圖片及價格 瀏覽:754
天貓店鋪圖片怎麼保護 瀏覽:107
柏樹盆景及價格圖片 瀏覽:399
圖片男生頭發35 瀏覽:487
發型圖片流行女 瀏覽:941
背包搭配什麼衣服圖片 瀏覽:438
word中插入圖片怎麼布滿全局 瀏覽:179
黃金戒指圖片及價格 瀏覽:264
紳寶x25價格及圖片 瀏覽:397