Let's say I have a tilemap as my map at runtime with 3 columns and 3 rows. Trees, grass, whatever...doesn't matter.
I want to click on 1 particular tile at runtime and identify which index value it is. Not which tile in the tilemap tiles it is but whether I clicked on tile 1 through 9 that is laid out at run time. Not the value of this:
Also, this is not what I am after either (I mean it gets me really close but not close enough to what I want):
Tilemap2.PositionToTileX(Mouse.X),Tilemap2.PositionToTileX(Mouse.Y) as this returns the column and row such as 1,2 meaning the second column, and third row based on the 0-index.
What I want is to return 8. Because then I can have an array for the tiles and just feed data to match the tile. I guess another way to look at it is there a way to take that 1,2 example above and translate it to a single value returned? Right now I am having to use it as the image below but it seems wrong to run it this way. I would then have two arrays, one for the X and one for the Y and then have to evaluate them together. It seems inefficient but I'm still learning so I don't know. I feel like I am just missing some method to the object that converts that column and row nicely into a unique number.