Jump to content
  • Advertisement


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

Link to post
Share on other sites
Assuming my web server is working, go here:


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


Share this post

Link to post
Share on other sites
I do mouse routines like this:


int SelectedTileX,SelectedTileY;


SelectedTileX = MPOS.x/64;
SelectedTileY = MPOS.y/32;

This worked because SelectedTileX & Y are integers.


"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

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