Use Pygame mouse while hidden

五迷三道 提交于 2020-01-07 02:29:08

问题


Is there a way to use the mouse while,

pygame.mouse.set_visible(False)

is activated. Currently mouse only returns the bottom-right coordinate when tried to be used. Being able to get correct coordinates while mouse is hidden is required.

Could not find an answer at their documentation.


回答1:


I solved the problem by using an invisible cursor.

pygame.mouse.set_cursor((8,8),(0,0),(0,0,0,0,0,0,0,0),(0,0,0,0,0,0,0,0))


来源:https://stackoverflow.com/questions/40627934/use-pygame-mouse-while-hidden

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!