OpenBeta 1.0.4 and TileLayers?
by Mark Vicuna · in Torque X 2D · 04/01/2007 (2:47 pm) · 3 replies
Hi,
So Tile Layers have changed a bit in 1.0.4. I've managed to deal with all the changes, But my tiles won't render. They cause collisions, but they dont render. If I create a static sprite using the material they are using the sprite renders.
Can anyone think of what I'm missing?
So Tile Layers have changed a bit in 1.0.4. I've managed to deal with all the changes, But my tiles won't render. They cause collisions, but they dont render. If I create a static sprite using the material they are using the sprite renders.
Can anyone think of what I'm missing?
T2DTileLayer baseLayer = new T2DTileLayer();
baseLayer.Name = "floorTiles";
baseLayer.Layer = 1;
baseLayer.MapSize = new Vector2(550, 550);
baseLayer.Size = baseLayer.MapSize * 3;
baseLayer.TileSize = new Vector2(3, 3);
baseLayer.Position = new Vector2(0, 0);
baseLayer.VisibilityLevel = 1;
baseLayer.Visible = true;
baseLayer.SortPoint = new Vector2(0, 0);
baseLayer.CollisionsEnabled = true;
String defs = "";
baseLayer.TileDefinitions = defs;
T2DTileType tile1 = new T2DTileType();
tile1.Material = (DefaultEffect)TorqueObjectDatabase.Instance.FindObject("GGLogoMaterial");
tile1.Name = "tile0";
tile1.CollisionsEnabled = false;
baseLayer.TileTypes.Add(tile1);
baseLayer.DefaultTileType = tile1;
TorqueObjectDatabase.Instance.Register(baseLayer);About the author
Torque Owner Michael Vargas
http://www.garagegames.com/mg/forums/result.thread.php?qt=59991