I see from the comment in IgeTextureMap from the function negate, it state that this function will take another map and removes any data from this map where data already exits.
Code: Select all
/**
* Takes another map and removes any data from this map where data already
* exists in the other.
* @param {IgeTileMap2d} entity The other map to read map data from.
* @return {*}
*/
negate: function (entity) {
if (entity !== undefined) {
var x, y,
entityMapData = entity.map._mapData,
thisMapData = this.map._mapData;
for (y in entityMapData) {
if (entityMapData.hasOwnProperty(y)) {
for (x in entityMapData[y]) {
if (entityMapData[y].hasOwnProperty(x)) {
if (thisMapData[y] && thisMapData[y][x]) {
// This map has data in the same place as the passed
// entity's map so remove this map's data
delete thisMapData[y][x];
}
}
}
}
}
}
return this;
},
Regards,
Zachz