Hmm.
We have a nice property “panZ”
this is really strange, but when i inizialise this one as this._renderDisplay.panZ(-this._renderDisplay.height / (2 * Math.tan(Math.PI / 16))+100);
then it’s works with normal dragonbones animatoin as espected, but, when animation cycle has some manipulations like SwordsMan in animation #6 has, then we become this behavior with body scaling and something with some special elements (like blue fires on his back).
On this momments i can fix it with a crunch, applying viewPosition object directly on mesh inizialisation step. Something like this._renderDisplay.viewPosition.z = -this._renderDisplay.height / (2 * Math.tan(Math.PI / 16))+100;
I don’t sure its correct, and maby i need to come up with another way, but on this moment it’s looks good…
And so, I’ll play a little more with this thing, but it looks like the phaser is getting pretty good support for dragonbones in the face of this plugin.
OK, i found all i need, and it’s seems to be i will fix it all. This time mesh and textures has been fixed, i only need to rebuild bones inversion logic and that’s it.
If bone has negative X or Y properties, then we need to recalculate frame. Hmm… it’s can be in animation or just in a basis armature. Or in in all of it in diffirent combinations
OK, problematic…
If you change some bone parametr in animation (for example you trying change scale property to mirroring something), then we need detect it in each frame… this is a problem. I can’t see any event or something like this in the code.
And you have to detect all parents too, becuse when we change some parent, all chain going to change it’s self…
If you using mirror scaling on bones, in static poses or in animation, then Bone.prototype._updateGlobalTransformMatrix = function (isCache) {
have to be redesigned
So, this is a bad practic using bone scaling for mirroring your graphical elements at all. But this is a part of DragonBones functionality and it’s have to be implemented. This time i’m not sure i have time for that maby later.
First things is to change this part of this function
we can catch this.origin.scaleX<0 for bonesX or Y and then find the right scaling parameters but this is only theory and it’s possible that we have a better way.
* - A transform relative to the armature coordinate system.
* @see #updateGlobalTransform()
What for problem over there. When we have a bone with negative scaling
then we become a wrong calculation in armature coordinate system space.
OK, i make a CRUNCH again, and it’s seems to be it’s working. CRUNCH trying to catch negative scaled bones and then does nagative calculation for scaling
but we need a super hero to implement it correctly Maby i take a look on this problem later with a fresh eyes.
Phaser3DragonBonesFixMesh.zip (7.2 MB)
It’s have to be FIXED, i just found whats wrong, and installed a crunches to get Scale. Maby later i will found a solutions for some parts but not sure.
Anyway, you can only using this for MESH and normal animation with out negative scaling in animation.
3.55.2
parentContainer.displayList = null… hmm, seems to be something was changed in this version.
Hmm, in 3.55.2 mesh it’s just a image
For example - Dragon
First object is container and scene bellow…
Hey man, thank you for all your fixes! Your latest vesrion ( Phaser3DragonBonesFixMesh.zip) still seems to be working in Phaser 3.80.1, except for one thing, which is, unfortunately, crucial for my current project:
When I restart a scene (or switch to another one and then come back to the previous one), my armature/mesh disappears completely. It’s actually still there, just invisible. When I call armature.animation.reset(), it actually displays, but once I play my animation, it’s gone again.