Defining and selecting an area from an image

Posted by meth0d_ on Game Development See other posts from Game Development or by meth0d_
Published on 2012-02-17T06:41:47Z Indexed on 2012/03/18 18:24 UTC
Read the original article Hit count: 231

Filed under:

I want to create a game, where the world is loaded from an image file, much like Paradox Interactive does it for their games. If I have this image:

Then the red, green, blue, cyan, magenta, white, black and grey should be different provinces. I know how to loop through them, and check if it's a new province, the problem is that I don't know how to define the region of the province for selection: I don't know how I can load in data, to make sure you can click anywhere on that province, and make sure it gets selected.

© Game Development or respective owner

Related posts about c++