Jump to content
  • Advertisement
Sign in to follow this  
slynk

Mouse Troubles

This topic is 2776 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

So I'm attempting to make a tile editor, which I've done before in other languages but I'm having troubles getting the mouse position...

I have 2 XNA sections on the screen. The map area and the tileset area. I can accurately get the mouse position of the tile area but not the map area. The position on the map area is always random and often negative.

I use the same method for both:

//Works
System.Drawing.Point pos = this.tileArea.PointToClient(System.Windows.Forms.Control.MousePosition);

//Doesn't Work
System.Drawing.Point pos = this.mapArea.PointToClient(System.Windows.Forms.Control.MousePosition);



Any clue what the problem is?

Share this post


Link to post
Share on other sites
Advertisement
No clue what the problem was but I worked around it by using XNA's method of getting the mouse position, then using this.PointToClient() to convert it, then subtracting the location of the panel containing the XNA render section. : /

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!