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