2017-02-04 72 views
1

我遇到了困难,因为接触卡住,永远不会消失。MonoGame保持着古老的风格

我做了一个测试程序,当触摸(在这种情况下,使用TouchPanel.EnableMouseTouchPoint = true的鼠标按钮)被按住,然后在光标不在窗口中时释放。接触点会卡住并继续存在。这样做,你可以建立一大堆旧的不存在的触摸。

相关代码:

TouchCollection touches; 

然后在初始化:

TouchPanel.EnableMouseTouchPoint = true; 

更新:

touches = TouchPanel.GetState(); 
在抽奖

则:

spriteBatch.Begin(); 
for (int i = 0; i < touches.Count; i++) 
{ 
    spriteBatch.Draw(debugPoint, touches[i].Position); 
}  
spriteBatch.End(); 

我试过这个与VisualStudio 2015,monogame 3.5 & 3.6。

回答