   Pixel to hex coordinates
This was already asked before, but the solution provided relied on a bitwise operator (I'm using Lua) and the coordinate system used isn't the same as mine anyway. I also found this article but I couldn't identify some of the constants being used and I wasn't sure whether or not it was assuming a top-down view of the hexes, where my own hexes are viewed at a slant.My hexes are 64x32, with the sloping part being 16 pixels wide. The y value increases as you go south, and the x value increases as you go southeast.My hex gridP.S. I can't seem to embed images into my post properly. Are those not allowed in this forum?   
  I don't want to be rude, but I can't resist to ask, have you tried to solve it for yourself? I mean it's not so hard. A lot of work, but a piece of paper a pen and maybe 1 or 2 hours of work would suffice.Some ideas:First, calculate the index_x (first) index. It's pretty simply based on the layout in the image.then, you can calculate the index_y (second) index by offsetting the mouse y coordinate with index_x*b/2. (it's sign depends on your mouse CS).This approximation is enough in many cases. This idea should be enough for you to work it out.PS. read forum faq: the toolbar like stuff above the private message indicator.   ;  This article does a good job explaining the math; but once you understand it you'll have to rotate the math. http://www.sgtconker.com/2009/12/article-hexagonal-coordinates/   ;  I don't suggest that kind of selection, since your task is much simpler (the way indexing is now)   