Earest Posted January 29, 2015 Share Posted January 29, 2015 Hi, I've a little problem to using tween.I use this folowing twin to make move a sprite when I click on a buttongame.scene.addTween(this.object.sprite.position, { y: this.object.sprite.position.y-35}, 500, { easing: game.Tween.Easing.Quadratic.In, repeat: 1, yoyo: true}).start();but if i click on the button during the animation, he restart one at the end with the object position when the second click happened. And its create an unwanted gap. Quote Link to comment Share on other sites More sharing options...
Ninjadoodle Posted January 29, 2015 Share Posted January 29, 2015 Hi @Earest You can try 2 things ... 1. You can either disable the button and enable it again when the tween is finished.2. Kill any current tweens, before staring the button tween. Hope this helps Quote Link to comment Share on other sites More sharing options...
Earest Posted January 30, 2015 Author Share Posted January 30, 2015 Thanks for the help Ninjadoodle.I choose the first solution, I disable the button interactivity when a clic is detected, and, re enable it when the tween is complete (discover the onComplete syntax <3 ). 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.