查看鼠标单击是否已处理
我目前正在制作一个异想天开的 iPhone 应用程序,它允许您将 Windows 光标更改为由 iPhone 控制的太空飞船(简单旋转等),目前我已经处理了移动和点击,但是我想添加其他功能,例如您可以在屏幕上射击的子弹,子弹会移动直到死亡或按下按钮,然后单击按钮。我有两个问题:
第一个问题:是否有任何方法来检测鼠标当前是否位于某个可点击的按钮上?或者有什么方法可以查看鼠标事件是否被处理?
问题二:有没有办法用小子弹覆盖屏幕? (也许是小的 [3,3] 子窗口之类的?)
更多信息:
客户端程序将采用 C++ 编写
SDL 或 SFML 可能是图形库,如果有必要的话(winAPI 应该没问题)
I'm currently making a whimsical iPhone app that will allow you to change your windows cursor into a space ship controlled by the iPhone (simple rotation and such), and currently I have the movement and clicking handled, however I'd like to add additional features, such as bullets that you can shoot around the screen which will move until they die or hit a button, which will then be clicked. And I have two questions:
Question number one: Is there any way to detect if the mouse is currently over some click-able button? OR is there any way to see if a mouse event was handled?
Question number two: Is there any way to overlay the screen with small bullets? (perhaps small [3,3] child windows or something?)
Further Information:
The client program will be in c++
SDL or SFML will likely be the graphics libs, if any are necessary (winAPI should be fine)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
最可靠的途径是 Microsoft Active Accessibility 界面。许多帮助视障人士的工具需要回答“这是一个按钮吗?”的问题,而 MSAA 回答了这个问题。
在 Windows 环境中覆盖屏幕很简单;只需创建一个窗口:)。它可以是部分透明的,因此您不限于矩形子弹。
The most reliable route would be the Microsoft Active Accessibility interface. Many tools to help visually impaired people need to answer the question "Is this a button?", and MSAA answers that question.
Overlaying the screen is trvial in a Windows environment; just create a window :). It can be partially transparent, so you're not restricted to rectangular bullets.