Archived

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

NiDoRaN

Help with mouse position

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


Link to post
Share on other sites
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


Link to 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


Link to 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


Link to post
Share on other sites