setTileData method
Changes the Gid of the corresponding layer at the given position, if different
Implementation
void setTileData({
required int layerId,
required int x,
required int y,
required Gid gid,
}) {
final layer = map.layers[layerId];
if (layer is TileLayer) {
final td = layer.tileData;
if (td != null) {
if (td[y][x].tile != gid.tile ||
td[y][x].flips.horizontally != gid.flips.horizontally ||
td[y][x].flips.vertically != gid.flips.vertically ||
td[y][x].flips.diagonally != gid.flips.diagonally) {
td[y][x] = gid;
_refreshCache();
}
}
}
}