   Click maps...how to?
  Hello everyone!I have a rather unusual task (or...not really?).I'm writing the game based on a world map. And I need to implement the 'click maps' functionality into it. Sorry for the awkward name, I just don't really know what else to call it.Basically, it's the same as 'image map' thing in HTML. You know, where you define a clickable region by writing a series of coordinates and when the user clicks it, he will get transfered to some other page.So, in a few words, I need to find out if a specific point belongs to (is inside) a specific shape. The shapes will be defined by vectors and will vary a lot, so the algorithm have got to be flexible.I'm pretty sure there already is something similar to what I need...an algorithm, formula, source code etc. I just really don't know where to look.So if anyone could point me to it, I would appreciate it a lot!   
  [google] for "point in polygon test" [google]the first hit was Determining if a point lies on the interior of a polygon.Hope this helps.   ;  Oh god, you're my saviour! Thanks a bunch, that's exactly what I was looking for ;)   ;  If the map isnt too large in size and you can spare the memory, you could have a hidden map of the same dimensions  (or some by some divisor fraction) which you would have each 'pixel' region  a different color/ordinal.  You would then take the click point XY and do a lookup on the corresponding point on your hidden map and convert the pixel location into an index which would be that of the areas you defined.   You would build the hidden map by taking your original one in a graphics editor (even MSPaint) and mapping out your desired set of areas (on color each) in the corresponding position they match on the real map.;  This might be a solution...although I'm not sure if it would be more efficient.But thanks for the idea anyway, you've certainly got the point!   