t2dTileLayer VS t2dTileMap - What's the difference?
by Richard Skala · in Torque Game Builder · 12/16/2009 (10:11 pm) · 3 replies
I'm trying to understand Tile Maps in TGB, but the information about them is sparse. What is the difference between a t2dTileLayer and a t2dTileMap?
A t2dTileLayer is what is created in TGB using Tile Map->'newLayer.lyr', correct? If so, then in what form does a t2dTileMap take in TGB, if any?
Thanks.
A t2dTileLayer is what is created in TGB using Tile Map->'newLayer.lyr', correct? If so, then in what form does a t2dTileMap take in TGB, if any?
Thanks.
About the author
Founded in 2009, Pixel Vandals Inc. is focused on bringing fun, fresh, and new ideas to the iPhone. www.pixelvandals.com www.pixelvandals.com/vineking
#2
Sorry if these seem like trivial questions, but I can't find any concrete information about them. I see in the BehaviorShooter tutorial files (located in game\data\tilemaps) there is: scroller.map and skytutorial.map, but I don't see any references to them in the scripts or TGB. How were they created, and what might they be used for?
12/17/2009 (2:55 am)
Thanks for that description. So, how is a t2dTileMap created through TGB? Or is it primarily a script-only thing? Sorry if these seem like trivial questions, but I can't find any concrete information about them. I see in the BehaviorShooter tutorial files (located in game\data\tilemaps) there is: scroller.map and skytutorial.map, but I don't see any references to them in the scripts or TGB. How were they created, and what might they be used for?
#3
Immediately after a t2dSceneGraph is new'd up, it creates a t2dTileMap. This is assigned as it's "globalTileMap".
To access it, you simply need to call "<yourScene>.getGlobalTileMap();"
I find it very rare that you really need to access the tile map. The tile layers have functions (like load/save) which get it all worked out in the end.
12/17/2009 (4:13 am)
It's a little awkward, so hang on!Immediately after a t2dSceneGraph is new'd up, it creates a t2dTileMap. This is assigned as it's "globalTileMap".
To access it, you simply need to call "<yourScene>.getGlobalTileMap();"
I find it very rare that you really need to access the tile map. The tile layers have functions (like load/save) which get it all worked out in the end.
Associate William Lee Sims
Machine Code Games
The t2dTileLayers are the collection of little squares. The t2dTileMap is a collection t2dTileLayers.