From 674c637adc5aefa890aa0a6c864e9f9da8e89b0f Mon Sep 17 00:00:00 2001 From: Maddogmaycry Date: Sat, 17 Oct 2020 09:56:45 +0200 Subject: [PATCH 1/2] Phaser 3 Slots draw ordering FIX Slots does'nt changes thier positions through animation states. --- Phaser/3.x/out/dragonBones.js | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/Phaser/3.x/out/dragonBones.js b/Phaser/3.x/out/dragonBones.js index 73c3a699..aa97e06a 100644 --- a/Phaser/3.x/out/dragonBones.js +++ b/Phaser/3.x/out/dragonBones.js @@ -15513,11 +15513,22 @@ var dragonBones; // can't use this._armature.display.remove here, perphaps this._renderDisplay is a child of armature. this._renderDisplay.parentContainer.remove(this._renderDisplay); }; - Slot.prototype._updateZOrder = function () { - if (this._renderDisplay.depth === this._zOrder) + + //Draw ordering fix by MadDogMayCry + Slot.prototype._updateZOrder=function(){ + if (this._renderDisplay.depth === this._zOrder){ return; - this._renderDisplay.setDepth(this._zOrder); + } + // Debug + // var newPos=this._zOrder; + // var name=this.name; + // var oldPos=this.slotData.zOrder; + // var thisSlot=this._armature._slots[oldPos].display; + // var thisSlotName=this._armature._slots[oldPos].name; + // console.log(name+" "+oldPos+" -> "+newPos+" | "+oldPos+" <- "+newPos+" "+thisSlotName); + this.armature.display.moveTo(this._armature._slots[this._zOrder].display,this._zOrder); }; + Slot.prototype._updateVisible = function () { this._renderDisplay.setVisible(this._parent.visible && this._visible); }; From 7275b5da13fae7adc99d1a1f1fccba4e9f4d7619 Mon Sep 17 00:00:00 2001 From: Maddogmaycry Date: Wed, 21 Oct 2020 11:31:01 +0200 Subject: [PATCH 2/2] Update dragonBones.js --- Phaser/3.x/out/dragonBones.js | 22 +++++++--------------- 1 file changed, 7 insertions(+), 15 deletions(-) diff --git a/Phaser/3.x/out/dragonBones.js b/Phaser/3.x/out/dragonBones.js index aa97e06a..7f5fcfa8 100644 --- a/Phaser/3.x/out/dragonBones.js +++ b/Phaser/3.x/out/dragonBones.js @@ -15512,21 +15512,13 @@ var dragonBones; Slot.prototype._removeDisplay = function () { // can't use this._armature.display.remove here, perphaps this._renderDisplay is a child of armature. this._renderDisplay.parentContainer.remove(this._renderDisplay); - }; - - //Draw ordering fix by MadDogMayCry - Slot.prototype._updateZOrder=function(){ - if (this._renderDisplay.depth === this._zOrder){ - return; - } - // Debug - // var newPos=this._zOrder; - // var name=this.name; - // var oldPos=this.slotData.zOrder; - // var thisSlot=this._armature._slots[oldPos].display; - // var thisSlotName=this._armature._slots[oldPos].name; - // console.log(name+" "+oldPos+" -> "+newPos+" | "+oldPos+" <- "+newPos+" "+thisSlotName); - this.armature.display.moveTo(this._armature._slots[this._zOrder].display,this._zOrder); + }; + Slot.prototype._updateZOrder=function(){ + if (this._renderDisplay.depth === this._zOrder){ + return; + } + //Fixed by MadDogMayCry + this.armature.display.moveTo(this._armature._slots[this._zOrder].display,this._zOrder); }; Slot.prototype._updateVisible = function () {