phaserjs / phaser

Phaser is a fun, free and fast 2D game framework for making HTML5 games for desktop and mobile web browsers, supporting Canvas and WebGL rendering.
https://phaser.io
MIT License
37.16k stars 7.1k forks source link

Phaser 3 Spine and Scaling #4114

Closed shibekin69 closed 5 years ago

shibekin69 commented 6 years ago

Hi Rich,

I read the latest newletter and am thrilled to hear about Phaser 3's Spine moving forward. There was something that mentioned about scaling and its inherent complexity. I just wanted to mention that there are specific use cases for Spine in games to consider. This is what I encountered:

I'm stuck with Spine Essentials and PhaserCE + the old Phaser Spine plugin. To simulate breathing, I scale the main body or maybe the torso, while disabling the Scale inherit on certain parts like the thighs, arms, and neck. Curiously, the old Phaser Spine puts the Spine object in a group, and this means I scale the group from Phaser's side, scaling the entire object as expected. Rotating the object resulted in something that was expected as well. This is good for scenes that repeat, like a cinematic scene where the group rotation and scaling is used for setting the scene.

Now, looking at the newer Phaser Spine plugin for PhaserCE that integrates Spine-TS, the Spine object uses the sprite object. Rotating and scaling the sprite object results in directly transforming the root bone of the Spine animation. This is good for maybe sidescrollers or something, but if I were relying on the group-scale like features as mentioned above, this is a deal breaker.

Can we have the two kinds of scaling available side-by-side as mentioned here?

--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/64793099-phaser-3-spine-and-scaling?utm_campaign=plugin&utm_content=tracker%2F283654&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F283654&utm_medium=issues&utm_source=github).
photonstorm commented 5 years ago

In the new Spine plugin for 3.19 you have two choices: You can either scale the object directly, which is the same as scaling the Skeleton in the Spine API, so it will impact all bones from the root and down. Or, you can target a specific Bone and scale just that. Which should provide both options you need.