Jump to content
  • Advertisement


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


Is point within Tile?

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

Ok I think I can finally get this to work. I have a tile which is 68pixels wide by 33 pixels tall. A few weeks ago someone or some people had some formulas to check if a point was within isometric tiles. Someone showed a formula for a 48x48 tile and a formula for 32 x 32 tile. Can anyone create a formula for this tile: If not I''m fine with doing it with a ploygon test, but they said a formula would be MUCH quicker. (I appreciate speed. Especially in a games!) Thanks, Ben

Share this post

Link to post
Share on other sites
There is a very easy way to do this for any isometric tile without the use of formulas and complex mathematical types.

This is done with the use of a mouse map.A mouse map is a bitmap that looks like this:

You just have to determine on which color your mouse is pointing at.If it is white then you are ON the tile.If another color then you are on another tile.

For more information check TANSTAAFL''s tutorial:
Isometric ''n'' Hexagonal Maps Part I here in GameDev.


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!