Game Development Community

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?

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);

#1
04/01/2007 (7:38 pm)
I don't know what's going wrong, but I made a possibly related post in the bugs/feedback forum regarding an issue I'm having in which tilemaps don't seem to be able to be created at all in TGBX:

http://www.garagegames.com/mg/forums/result.thread.php?qt=59991
#2
04/02/2007 (4:35 pm)
**Solution**

Check my post below regarding TGBX and tilemaps not showing

http://www.garagegames.com/mg/forums/result.thread.php?qt=59991
#3
04/03/2007 (6:06 pm)
Thanks, that fixes the TGBX issue.