隐藏时使用Pygame鼠标 [英] Use Pygame mouse while hidden

查看:284
本文介绍了隐藏时使用Pygame鼠标的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有一种方法可以同时使用鼠标

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.

在其文档中找不到答案.

推荐答案

我通过使用不可见的光标解决了这个问题.

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))

这篇关于隐藏时使用Pygame鼠标的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆