• Advertisement
Sign in to follow this  

Mouse Troubles

This topic is 2687 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