sinol Posted August 27, 2015 Share Posted August 27, 2015 Hi guys, i'm using pixi.js (ver 3.0.7) with plugin pixi-spine.js (version 2.1), everything works fine but when I tried this:var test = new PIXI.spine.Spine(res.spine.spineData);test.animationSpeed = 2;it doen't work. I was wondering if the API has been changed....hmm,anyone knows how to speed up/down the animation speed (or maybe frame rate) of an instance of the PIXI.spine.Spine? Hope you guys can give me a hand,it would be great help Quote Link to comment Share on other sites More sharing options...
sinol Posted August 28, 2015 Author Share Posted August 28, 2015 hmm...I have solved the problem myself.... I modified the code in pixi-spine.js and add animationSpeed property to it's spine.AnimationState.prototype Here is the code : spine.AnimationState.prototype = { onStart: null, onEnd: null, onComplete: null, onEvent: null, timeScale: 1,animationSpeed : 1, update: function (delta) { delta *= this.timeScale; for (var i = 0; i < this.tracks.length; i++) { var current = this.tracks; if (!current) continue; current.time += delta * current.timeScale * this.animationSpeed; The red color code is what I added to it. If anyone met the same problem like me, you can simply modify the code in Pixi-spine.js. Hope the author can take a look Now you can use :var test = new PIXI.spine.Spine(res.spine.spineData);test.state.animationSpeed = 2; Quote Link to comment Share on other sites More sharing options...
palanolho Posted June 26, 2018 Share Posted June 26, 2018 hi, Is this going to go into a pixi-spine release ? Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted June 26, 2018 Share Posted June 26, 2018 Look closer, there's already "timeScale" in the code: https://github.com/pixijs/pixi-spine/blob/master/src/core/AnimationState.ts#L56 Why did he add one more variable, i dont know Quote Link to comment Share on other sites More sharing options...
Vishnu Hari Posted May 15, 2021 Share Posted May 15, 2021 the state.timeScale property can be used. test.state.timeScale = 2; Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.