Changing map tiles
by Drew -Gaiiden- Sikora · in Torque Game Builder · 02/28/2005 (2:21 pm) · 3 replies
Is there any way you can change a given map tile in the game? I can't find anything in the fxTileMap2D reference section that looks like it returns the object of a particular tile for modification.
#2
02/28/2005 (2:52 pm)
Thx Melv, I actually just found it myself, sry to trouble ya! :) I was looking for a function that gave you direct access to the individual tile, sorta like how fxTileMap2D gives you access to fxTileLayer2D, so I didn't look to closely at setStaticTile. My bad! Must read docs more carefully! :P
Associate Melv May
As a rough guide, you use the fxTileMap2D to get access to the layers. It's here that you add, remove and generally manipulate layers. It's here you can ask for a layer object using the above function.
With the layer (fxTileLayer2D) object you can then set tiles, collisions, all sorts of stuff.
Assuming you've got a tilemap with a single layer, you'd use something like the following to get the layer and set the tile (0,0) to a static image:-
Look-up the fxTileLayer2D object to see what you can do with it in the reference document.
Expect more documents in the near future for stuff like this.
Hope this helps,
- Melv.