You should add a if statement inside of your for loop of the tiles checking if the mouse X / Y is inside of the tile, than adjust it properly:
1 2 3 4 5 6 7 8 9 10 11 12 13
| int tileSize = 32; int width = 400; int height = 400; for (int x = 0; x < width; x += tileSize) { for (int y = 0; y < height; y += tileSize) { if (Mouse.X >= x && Mouse.X <= x + width && Mouse.Y >= y && Mouse.Y <= y + height) { } else { } } } |
Hope it helps some mate, like you said you're using isometric tiles (I'm not familiar with isometric tiles), but I'm guessing you'd have to translate the coords
