You are an experienced programmer and have a problem with the engine, shaders, or advanced effects? Here you'll get answers. No questions about C++ programming or topics which are answered in the tutorials!
in my 2d iso strategy game i want to select a tile by mouse. thats almost works fine but the tiles overlap (in most cases only the transparent areas overlap). Now my question: How can I find out to which texture a pixel, that i get from the cursor position, belongs?
I don't know the answer to your question but what I do know is a place you might find it. www.GameDev.net has a good selection of articles about 2D isometric games in their reference section, you could do a lot worse than read your way through them.
Take a look at the API. There are some functions, one is called something like "getRayFrom2DCursor" or something like that, and that shoots a 3d line into the world starting from the 2d co-ordinates of the mouse cursor.
Take a look, because it's entirely possible that the function you need is already in the API.
"The reputation of a thousand years may be determined by the conduct of one hour."
-Japanese Proverb
it's a 2d game......and I use draw2dImage() to draw the tiles.
before i started this thread i had looked for a function in the API.....but there is no, neither for ITexture nor the cursor control....
1. the tile-images overlap. There ist a part of the images which is transparent and that part overlaps with other transparent ones.
2. I got the 2 position of the cursor by using a fuction of a ICursorControl instance.
3. the problem is that i don't know to which image the position belongs.
StuColliers tip isn't useful because i got the 2d coordinates of every image - but only the coordinates of the left upper corner.
Every tile got the same size - they look like this tile.
And i know the size of every tile for sure - the problem is the overlapping transparent area. in the picture the black background is transparent.