I'm trying to get touch positions in a MonoGame I'm running on a windows Phone 8 device and debugging through Visual Studio 2012.
This is my update method:
public override void Update(Microsoft.Xna.Framework.GameTime time)
{
if (_StateIsActive) // for pausing game
{
base.Update(time);
TouchCollection touchCollection = TouchPanel.GetState();
foreach (TouchLocation tl in touchCollection)
{
if ((tl.State == TouchLocationState.Pressed)
|| (tl.State == TouchLocationState.Moved))
{
Debug.WriteLine(tl.Position.ToString());
}
}
}
}
When I touch the screen all I get in the output is:
{X:INF Y:INF}
What am I doing wrong?
EDIT: I tried to do what has been done in this thread, but it wont work as I only get the INF value. MonoGame reading touch gestures