charlie_says Posted May 14, 2014 Share Posted May 14, 2014 I'm trying to make a one off delayed event, so ideally something like setTimeout, which fires once (and, if necessary, then removes itself.) But I'm not getting anywhere very fast with this - anyone tried something similar? Link to comment Share on other sites More sharing options...
stasuss Posted May 14, 2014 Share Posted May 14, 2014 Something like this?http://examples.phaser.io/_site/view_full.html?d=time&f=basic+timed+event.js&t=basic%20timed%20event Link to comment Share on other sites More sharing options...
charlie_says Posted May 14, 2014 Author Share Posted May 14, 2014 Ok, I'm trying this now... (I was trying Phaser.Timer) does this automatically remove itself after it's fired? Link to comment Share on other sites More sharing options...
stasuss Posted May 14, 2014 Share Posted May 14, 2014 I think so, but to be sure I'll do this:game.time.events.add(Phaser.Timer.SECOND * 4, fadePicture, this).autoDestroy = true; charlie_says 1 Link to comment Share on other sites More sharing options...
hayesmaker Posted April 22, 2015 Share Posted April 22, 2015 how would you cancel that? Link to comment Share on other sites More sharing options...
rsadwick Posted April 23, 2015 Share Posted April 23, 2015 how would you cancel that? var timer = game.time.events.add(Phaser.Timer.SECOND * 4, fadePicture, this);//at some point you want to remove itgame.time.events.remove(timer); MichaelD 1 Link to comment Share on other sites More sharing options...
valueerror Posted April 23, 2015 Share Posted April 23, 2015 is autodestroy really neccesary ? what happens if you don't add this? (just asking because i nevery add autodestroy.. i thought they destroy themselves anyway ?! Link to comment Share on other sites More sharing options...
MichaelD Posted April 23, 2015 Share Posted April 23, 2015 So we can all agree we want suicidal timers? (I'm sorry I just had to say it...) Link to comment Share on other sites More sharing options...
drhayes Posted April 23, 2015 Share Posted April 23, 2015 Hey, what you get back from "game.time.events.add" isn't a Timer, it's a TimerEvent. They don't have an autoDestroy property, they're already single-use. jdnichollsc 1 Link to comment Share on other sites More sharing options...
Recommended Posts