Jump to content
• Advertisement

#### Archived

This topic is now archived and is closed to further replies.

# Help with mouse position

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

I am so said because i have already spend 4 days on my mouse position detection blah blah how ya can call it Maybe someone can help me I want to get a box image of 64x32 over a piece of ground it is isometric /\/\/\ \/\/\/ /\/\/\ \/\/\/ but i dono how to do this because of my mouse x and y cord''s i can''t get any sense out of it. only what it has to calculate the x and the y cord. if it is in the section. maybe this is alittle bit hard to understand but i dono how to explain it hope ya guys can help me

#### Share this post

##### Share on other sites
Advertisement
Assuming my web server is working, go here:

http://eberwein.dyndns.org/fantasyfootball/iso/mousetoiso.htm

This is a little tutorial that I''ve written.

Grimbo

#### Share this post

##### Share on other sites
I do mouse routines like this:

  int SelectedTileX,SelectedTileY;POINT MPOS;GetCursorPos(&MPOS)SelectedTileX = MPOS.x/64;SelectedTileY = MPOS.y/32;

This worked because SelectedTileX & Y are integers.

/MindWipe

"If it doesn''t fit, force it; if it breaks, it needed replacement anyway."

#### Share this post

##### Share on other sites
In Isometric game programming with directX7.0
Page 325
There are a good way to do it!

#### Share this post

##### Share on other sites
Here is some advice....
Well if your tile sizes are static and don't vary or change you can use the methods mentioned above but if you want to be able to support multiple sized tiles and dynamic changes on tile sizes you could use the polygon based method...

Create array of tiles and their positions when mouse is pressed at some point of the map and after that go through the tiles using some PointInPoly algo... This is very fast when you just generate the array for tiles currently visible... This makes future changes example changing from 2d to 3d isometric engine easy.

Edited by - Pexi on April 26, 2001 2:55:19 AM

#### Share this post

##### Share on other sites

• Advertisement
• Advertisement

• ### Popular Contributors

1. 1
2. 2
Rutin
24
3. 3
4. 4
JoeJ
19
5. 5
• Advertisement

• 14
• 26
• 11
• 11
• 9
• ### Forum Statistics

• Total Topics
631771
• Total Posts
3002253
×

## 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!