Tiles In Terrain

Blitz3D Forums/Blitz3D Programming/Tiles In Terrain

EmerGki(Posted 2006) [#1]
How I know what tile of terrain I'm with the mouse?


Jams(Posted 2006) [#2]
can you be more specific?


EmerGki(Posted 2006) [#3]
Yeah!, I'll Try!

With the camerapick, I want to know what tile of terrain is picked by mouse.


Jams(Posted 2006) [#4]
is this a Blitz terrain entity, or your own custom tile grid terrain?


octothorpe(Posted 2006) [#5]
You probably want to subtract the position of the corner of your terrain (whichever corner you consider to be (0,0)) from (PickedX(), PickedY()), then divide by the size of each grid tile, rounding down. This gets a lot more fun if you've rotated the grid!


EmerGki(Posted 2006) [#6]
=D Thanks, I'll try this =D.