Saturday, 30 March 2013

Captain's Log Stardate 5

BREAKTHROUGH!

After much searching online, and a long time getting annoyed that some of my code wasn't working (and wondering if the mouse input works on the emulator for windows phone) I have finally found some sample code online to help me with my touch input:

foreach (TouchLocation location in TouchPanel.GetState())
             {
                 Rectangle hitbox = new Rectangle(200, 200, 50, 50);
                 if (hitbox.Contains((int)location.Position.X, (int)location.Position.Y))
                 {
                     t1.Highlight = true;
                 }
              }

THIS!.... took me a long time to find, but means I can move on now and try get my game finished!

No comments:

Post a Comment