khleug35 Posted March 25, 2019 Share Posted March 25, 2019 How to check if the timer is paused?? the following is my example code game.createScene('Main', { init: function() { this.animation = game.Timer.add(100, function() { //dosomething }, true); this.animation.pause(); }, I try to using "this.animation.pasued", but not work update: function() { if(this.animation.pasued){ //check if the timer is paused, but not work this.animation.resume(); } any idea??? Thank you very much. Wolfsbane 1 Quote Link to comment Share on other sites More sharing options...
taoprox Posted March 25, 2019 Share Posted March 25, 2019 Ive never used Panda 2. It is spelt "paused" not "pasued". If there isnt a function for it, just add a variable after the pause and check for that: isPaused = true... Quote Link to comment Share on other sites More sharing options...
khleug35 Posted March 25, 2019 Author Share Posted March 25, 2019 @taoprox Thank you for a reply and remind, my apologies for misspelling but I using 'paused' now and not work : ( Quote Link to comment Share on other sites More sharing options...
Stephan Posted March 25, 2019 Share Posted March 25, 2019 there is no public property available but you could use the following private property timer._pause working example: var timer = game.Timer.add(1000, function() { sprite.remove(); }); if(timer._pause){ console.log("paused") } else{ console.log("Not paused") } khleug35 and Wolfsbane 2 Quote Link to comment Share on other sites More sharing options...
khleug35 Posted March 26, 2019 Author Share Posted March 26, 2019 @Stephan Awesome !!! it work!!!!! Thank you very much for the awesome code and teaching me!!! Have a nice day!!! Thanks again!!! Quote Link to comment Share on other sites More sharing options...
enpu Posted March 27, 2019 Share Posted March 27, 2019 I have added new paused property to Timer class, which is true if the timer is paused. Wolfsbane 1 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.