I've noticed PositionToTileX & PositionToTileY seem to return the same value no matter what. Is this a redundancy? Is there any reason for both expressions? Am I missing something?
I saw this bug report:
But it seems to have been kind of overlooked since the OP sorta had the usage confused.
EDIT: Here's a capx
[attachment=0:5i4evlx5][/attachment:5i4evlx5]
tilemap.PositionToTileX(mouse.x) & " | " & tilemap.positiontotileY(mouse.y)
??
I set them both to x and both to y to show they're the same. you can set one to x and the other to y and then reverse it. still the same..
I don't get it?
okay. I moved my tilemap from 0,0 and got different returning values..
But if anyone can explain this to me, I've got my head all muddled up trying to figure it out, heh..
Develop games in your browser. Powerful, performant & highly capable.
The tiles are on a grid. tilemap.PositionToTileX(mouse.x) gets the Column, and tilemap.positiontotileY(mouse.y) gets the Row.
So 0,0 is the first tile 1,0 is the next tile to the right, 0,1 is the tile below 0,0. Like a spreadsheet or an array.
blackhornet Thanks. I realize that.
Anyhow, I get it now. I guess I was just having a hard time seeing why they were returning the same values. Gets kinda heavy and multidimensional to think about with both mouse values and both tile values.. Sleep might help.. G'night!