pixijs / spine

Pixi.js plugin that enables Spine support.
Other
561 stars 217 forks source link

Add pause and resume methods for Spine. #16

Closed englercj closed 8 years ago

englercj commented 9 years ago

Cross posting GoodBoyDigital/pixi.js#763.

ghost commented 9 years ago

Not sure, however...

Currently this is done by clearing current tracks (pause) and then setting the previous state back (resume).

However there's probably a method to actually remove the animations play state as it's associated with the requestAnimationFrame (Pixi v3).

JaredSartin commented 8 years ago

Any further notes on this? I want to pause my game and stop all motion, but don't want to iterate all entities and clear tracks/start animations every time I pause and resume.

ivanpopelyshev commented 8 years ago

I can implement that. You want to stop all spine animations, right?

JaredSartin commented 8 years ago

I would love to "stop" them and resume them, mid animation.

ivanpopelyshev commented 8 years ago

you can iterate and set "autoUpdate" to false for all of them. I'll add global autoUpdate flag

ivanpopelyshev commented 8 years ago

@JaredSartin can you build new version locally and test it, please? :)

//stop it
PIXI.spine.Spine.globalAutoUpdate = false;
//resume
PIXI.spine.Spine.globalAutoUpdate = true;
JaredSartin commented 8 years ago

From what I can tell - it works! Animations pause when I turn off autoupdate.

On Tue, Dec 15, 2015 at 1:04 PM Ivan Popelyshev notifications@github.com wrote:

@JaredSartin https://github.com/JaredSartin can you build new version locally and test it, please? :)

— Reply to this email directly or view it on GitHub https://github.com/pixijs/pixi-spine/issues/16#issuecomment-164896099.

Jared Sartin Mobile (269) 364-1735 | Twitter @JaredSartin http://twitter.com/JaredSartin Website http://jared.sart.in/

ivanpopelyshev commented 8 years ago

Nice! Then I can close it. Will reopen if something goes wrong.

antag0n1st commented 2 months ago

Its 2024 , the only way to pause this that I found is this: import * as SpineRuntime from 'pixi-spine'; and then to pause modify this: SpineRuntime.settings.GLOBAL_AUTO_UPDATE = false;