mirror of
https://github.com/AlexMacocian/MonoGame.Extended.git
synced 2026-07-25 08:22:15 +00:00
added the ability to change the tiles collection at runtime
This commit is contained in:
@@ -219,7 +219,7 @@ namespace MonoGame.Extended.Tiled
|
||||
var tileHeight = map.TileHeight;
|
||||
|
||||
var tileCount = reader.ReadInt32();
|
||||
var tiles = new TiledMapTile[width * height];
|
||||
var layer = new TiledMapTileLayer(name, width, height, tileWidth, tileHeight, offset, opacity, isVisible);
|
||||
|
||||
for (var i = 0; i < tileCount; i++)
|
||||
{
|
||||
@@ -227,10 +227,10 @@ namespace MonoGame.Extended.Tiled
|
||||
var x = reader.ReadUInt16();
|
||||
var y = reader.ReadUInt16();
|
||||
|
||||
tiles[x + y * width] = new TiledMapTile(globalTileIdentifierWithFlags, x, y);
|
||||
layer.Tiles[x + y * width] = new TiledMapTile(globalTileIdentifierWithFlags, x, y);
|
||||
}
|
||||
|
||||
return new TiledMapTileLayer(name, width, height, tileWidth, tileHeight, tiles, offset, opacity, isVisible);
|
||||
return layer;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user