These are chat archives for pixijs/pixi.js

23rd
May 2016
Vasiliy Versus
@dcversus
May 23 2016 10:01
Greetings! Somebody please tell me how to set frame (by Index, or time) of animation in pixi spine... I create spine where frame is state on percentage of download ... and dont know how set needed frame.
Ivan Popelyshev
@ivanpopelyshev
May 23 2016 11:07
hey @dcversus
its pretty easy
first you need to start the animation
Vasiliy Versus
@dcversus
May 23 2016 11:10
@ivanpopelyshev set autoUpdate to false, with manually spine.update ???
Ivan Popelyshev
@ivanpopelyshev
May 23 2016 11:10
spine.state.setAnimationByName(0, 'myAnim', false);
then disable autoUpdate so it wont screw it, ye
spine.autoUpdate = false;
then modify the track 0 (you have thatanimation in it)
spine.state.tracks[i].time = 0.5;
please make sure that you have EXTRA length in that animation, otherwise when you set something that equals or more than animation time, track will be destroyed
then call the update
spine.update(0);
This message was deleted
This message was deleted
no, forget it
just if you want, you can make your own update function that does not call this.state.update(dt) , and wont destroy track even if its due time
:)
I recommend you to clone both pixi.js and pixi-spine. Looking at the source code of JS library is the only way to ensure that you are doing it right
Ivan Popelyshev
@ivanpopelyshev
May 23 2016 11:15
also that way you can make PR's if you find some bad place
@dcversus is that enough?
Vasiliy Versus
@dcversus
May 23 2016 11:17
@ivanpopelyshev yes, I tried it work... using update(dt) ! Thanks!
Ivan Popelyshev
@ivanpopelyshev
May 23 2016 12:09
yep, but there's no way to set to position that you need except manually changing timer inside track :)
that's the trick that isnt documented