function showBrush(%tilePosition) { // get the data %tempData = TorqueDB.searchByInstanceWithClass("brush", "value", $gameData.brushSelection); %brushData = %tempData.contents[$DATA_FIELD]; %homeTile = %tilePosition; // clear away previous brush image $gameMap.map.getTileLayer($TILE_OVERLAY_LAYER).clearLayer(); // loop through the data pairs and set the tile(s) for (%pair = 0; %pair < getWordCount(%brushData) / 2; %pair++) { // get the pair %brushPair = getWord(%brushData, %pair * 2) SPC getWord(%brushData, (%pair * 2) + 1); // update the location %tilePosition = getWord(%homeTile, 0) + getWord(%brushPair, 0) SPC getWord(%homeTile, 1) + getWord(%brushPair, 1); // set the tile $gameMap.setMapTile($TILE_OVERLAY_LAYER, %tilePosition, highlightImageMap, 5, 0, $NO_DATA); } } // end showBrush