bringToFront method
void
bringToFront(
[ - int? obj
])
Implementation
void bringToFront([int? obj]){
if(obj != null){
levelInfo[selectedLevel].objects[obj].layer++;
}
else if(objectTappedOn.isNotEmpty){
for(int i = 0; i < objectTappedOn.length; i++){
levelInfo[selectedLevel].objects[objectTappedOn[i].objectLocation].layer++;
}
updateMinMap = true;
}
levelInfo[selectedLevel].objects.sort((Object a, Object b){
final int az = a.layer;
final int bz = b.layer;
//return (az-bz).round();
if (bz > az) return -1;
if (bz < az) return 1;
return 0;
});
update();
}