azerion / phaser-spine

A plugin for Phaser 2 that adds Spine support
MIT License
121 stars 57 forks source link

[Spine-TS] Scale property doesn't work #78

Open shibekin69 opened 6 years ago

shibekin69 commented 6 years ago

Yeah, just like the alpha and the rotation, scale doesn't work when applied to the container group.

spineObjContainer.scale.x = 0.6 <-- Doesn't work spineObjContainer.children[0].scale.x = 0.6 <-- works

My work around earlier was to do the latter, but since this spine positioning problem isn't solved yet, this complicates things since scaling the spine object itself makes the positioning unpredictable when I use it with the group.

EDIT: See issue #72, edit comment. I got rid of trying to set 0 to the spine object's [x,y,centerX, centerY], and just cancel out the root bone's position to bring it to 0,0. Scaling the children seems to work and is predictable. But the container group's scale property doesn't work on the spine object.

shibekin69 commented 6 years ago

I tried doing a negative scale with the latest spine-ts-position:

spineObjContainer.children[0].scale.x = -0.6

It's horrible. lol. Image is flipped upside down with all the bones and attachments messed up. I've yet to try a negative scale within spine itself and see what happens.

EDIT: Ok, negative scaling of bones (at least the root bone from what I've tested) within spine seems to work fine. Just the negative scaling using Phaser is weird.

shibekin69 commented 6 years ago

@AleBles

Just reporting that scale doesn't work on WebGL:

spineObjContainer.scale.x = 0.6 <-- Doesn't work spineObjContainer.children[0].scale.x = 0.6 <-- Doesn't work

I was going to test out the position if it's fixed already, but I encountered this first.