【发布时间】:2016-04-07 20:55:41
【问题描述】:
在 XNA(MonoGame、FNA)中使用鼠标控件时,我使用如下方法:
public static bool IsMouseClickedLeft()
{
// No clicks if game is not the active application
if (Game.IsActive == false) return false;
if (mouseState.LeftButton == ButtonState.Pressed) return true;
return false;
}
但是,在窗口模式(如果不是全屏)下,即使游戏窗口被其他窗口覆盖或部分覆盖,例如鼠标点击(和鼠标移动)也会被识别和处理。浏览器或 Windows 文件资源管理器。如何确保只识别鼠标点击游戏窗口的可见(未覆盖)部分。
【问题讨论】:
标签: c# user-controls xna mouse mouseover