Hi, I’m trying to render a sprite above another sprite. I need to do that dynamically in my code but this logic is not working.
I’m enabling random 2D trees and the new enabled tree should be behind the already enabled trees.
this.drawOrderIndex–;
disabledTrees[i].sprite.drawOrder = this.drawOrderIndex;
disabledTrees[i].reparent(this.parentObj,0);
Can someone help me, please?
Thanks in advance