neonwarge04 Posted August 26, 2015 Share Posted August 26, 2015 Is there a way to reset a tween? I have a tween which animates the object to move upward from the bottom-most of the screen. Now if I selected the object, it will collapse back to where it came from. I am able to animate the object to show to the screen but I can't animate it back.I sneaked into the source but couldn't found a way. Any ideas? This is frustrating, it feels like I am coding in assembly. Thanks! Quote Link to comment Share on other sites More sharing options...
tips4design Posted August 26, 2015 Share Posted August 26, 2015 I have asked the same thing:http://www.html5gamedevs.com/topic/16641-restart-tween/ Quote Link to comment Share on other sites More sharing options...
neonwarge04 Posted August 26, 2015 Author Share Posted August 26, 2015 I am so sorry, I forgot to tell I am using tween/tween.js. Quote Link to comment Share on other sites More sharing options...
neonwarge04 Posted August 26, 2015 Author Share Posted August 26, 2015 Strange thing is, this.mLogoMove = new TweenWrapper({x : this.mLogo.x , y : this.mLogo.y}) .to({y : 330} , 200) .onUpdate((function(updatedVariables) { this.mLogo.y = 500 - updatedVariables.y; }).bind(this)) .onComplete((function() { this.mStartButtonMove.start(); }) .bind(this)) .start(); this.mLogoMove.start(); the line this.mLogoMove.start() is undefined. Setting up breakpoints on instanciation still also undefine. That is crazy. Imagine I already instanciated an object and the var is still undefine, but you can still see the object fires up normally. Though I believe this is pure JS thing. 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.