Ejemplo n.º 1
0
        internal void InitializeTiles()
        {
            Tiles = new Dictionary<uint, TmxTilesetTile>();

            uint gid = FirstGid;
            for (int y = 0; y < ImageHeight; y += TileHeight + Spacing + Margin)
            {
                for (int x = 0; x < ImageWidth; x += TileWidth + Spacing + Margin)
                {
                    var tile = new TmxTilesetTile();
                    Tiles.Add(gid, tile);

                    tile.SubRectangle = new Rectangle(x, y, TileWidth, TileHeight);
                    tile.Tileset = this;

                    ++gid;
                }
            }
        }
Ejemplo n.º 2
0
        internal void InitializeTiles()
        {
            Tiles = new Dictionary <uint, TmxTilesetTile>();

            uint gid = FirstGid;

            for (int y = 0; y < ImageHeight; y += TileHeight + Spacing + Margin)
            {
                for (int x = 0; x < ImageWidth; x += TileWidth + Spacing + Margin)
                {
                    var tile = new TmxTilesetTile();
                    Tiles.Add(gid, tile);

                    tile.SubRectangle = new Rectangle(x, y, TileWidth, TileHeight);
                    tile.Tileset      = this;

                    ++gid;
                }
            }
        }