Controls whether the idle timer is enabled. If enabled is true, the timer will be active (default); inactive if false. When active, the idle timer dims the screen and eventually puts the device to sleep when no user activity occurs (e.g. screen touches).
1 | system.setIdleTimer( enabled ) |
system.setIdleTimer( false ) -- disable (turn off) the idle timer system.setIdleTimer( true ) -- enable (turn on) the idle timer
enabled
Either true or false to enable or disable the idle timer.
Nothing.
Note: This API will not disable the screen saver on the Mac or Windows simulator.
Is there a way to reset the idleTimer?
Say I've got an app that just uses the accelerometer so I turn off the idleTimer. Then when the games ends and returns to a menu screen, I want the idleTimer back on.
But if I do that now, the system remembers it's not been touched so at the moment I reenable the idleTimer the screen dims.
Marco