Created
November 17, 2011 08:25
-
-
Save hkurosawa/1372685 to your computer and use it in GitHub Desktop.
AndEngine: using TimerHandler
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public Scene onLoadScene() { | |
| final Scene scene = new Scene(); | |
| scene.setBackground(new ColorBackground(0.09804f, 0.6274f, 0.8784f)); | |
| //TimerHandler(sec, autoReset, callback) | |
| TimerHandler timerHandler = new TimerHandler(0.1f, true, this); | |
| scene.registerUpdateHandler(timerHandler); | |
| return scene; | |
| } | |
| //--- cut --- | |
| @Override | |
| public void onTimePassed(TimerHandler pTimerHandler) { | |
| Log.d("onTimePassed", ""+pTimerHandler.getTimerSeconds()); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment