1

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

Community
  • 1
  • 1
JensB
  • 6,663
  • 2
  • 55
  • 94

1 Answers1

1

The answer seems to be that there is a bug in this version of Mono Game (3.0.1.0) related to this and that it will be fixed with a new release within the next few days.

Source: #MonoGame channel on IRC and their forums.

JensB
  • 6,663
  • 2
  • 55
  • 94