Mr_Cutia Posted September 6, 2013 Share Posted September 6, 2013 Hye, I've a case, where the animator made a complexi animation, but he divided the animation in two. Now I need play the two animation simultaneous. I use spine.setAnimationByName and I'm adding a animation with spine.state.addAnimationByName I tryed to override spineObject.state.upadate = function(delta){ this.queue.push(this.queue[0]); PIXI.Spine.prototype.state.update.call(this, update)} Then I get a error... I can't access state.update in prototype. I tryed other ways to access prototype of the spine.AnimationState (in line 8364 in pixi.js), But I could not. I'm beginner in javascript, and don't know how access this type of prototype. [pixi.js line 7479]PIXI.Spine = function (url) {...this.state = new spine.AnimationState(this.stateData); ....}; Anybody can help me? Quote Link to comment Share on other sites More sharing options...
Mr_Cutia Posted September 6, 2013 Author Share Posted September 6, 2013 Well,I can do it! I just needed to add an animation with addAnimationByName, add the second and add the first again. After this, I replaced the state.update like this: spine.state.update = function(delta) { this.currentTime += delta; this.previousTime += delta; this.mixTime += delta; if (this.queue.length > 0) { var entry = this.queue[0]; if (this.currentTime >= entry.delay) { this._setAnimation(entry.animation, entry.loop); this.queue.push(entry); this.queue.shift(); } } }; Quote Link to comment Share on other sites More sharing options...
Mr_Cutia Posted September 6, 2013 Author Share Posted September 6, 2013 But I still poss to doubt the override .... 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.