Jump to content

  • Log In with Google      Sign In   
  • Create Account


Hexagonal tile highlighting/picking


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
2 replies to this topic

#1 wraith811   Members   -  Reputation: 125

Like
0Likes
Like

Posted 01 January 2013 - 09:53 PM

I've been trying to learn how to highlight a hexagon when the cursor is over a hexagonal tile. I've read several articles that explain it using a "mouse map" texture image that helps to determine if the cursor/mouse is within a hexagon on a tile map. However, I can't seem to get it to work. I originally tried using the tutorial from Kurt Jaeger's xna resources but its mainly for isometric tiles. I then found an explaination on gamedev.net but my puny brain can't seem to comprehend it. If someone could help explain this concept of using a "mouse map" or maybe an easier method would be great. Unfortunately, it won't let me upload my solution.  If you need to see my project, let me know a way of posting it.  Thanks.

 

I forgot to mention, this is in XNA 4.0


Edited by wraith811, 01 January 2013 - 10:04 PM.


Sponsor:

#2 Tom KQT   Members   -  Reputation: 1541

Like
2Likes
Like

Posted 02 January 2013 - 05:46 AM

Are we talking about 3D or 2D?

By 2D I mean that you see the tiles as exact hexagons on the screen. If it is the case then it's just some relatively simply maths, as can be seen for example here http://gdreflections.com/2011/02/hexagonal-grid-math.html



#3 wraith811   Members   -  Reputation: 125

Like
0Likes
Like

Posted 02 January 2013 - 10:29 AM

Tom KQT,

 

Thank you for your help.  Yes, it is 2D.  I'll take a look at the article.  My only concern is that my hexagons are 2d texture images so the math may not work quite as well as with a 2d primitive using math to display it.  The other flip side is that I'm inexperienced at applying some of the math concepts to xna.  If all else fails, I may just use a simple circle or rectangle check and leave it at that.


Edited by wraith811, 02 January 2013 - 10:41 AM.





Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS