Mouse Troubles

Started by
0 comments, last by slynk 13 years, 4 months ago
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:

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


Any clue what the problem is?
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. : /

This topic is closed to new replies.

Advertisement