Back

PreventScreenLock

The PreventScreenLock method prevents the device screen from dimming and locking while your app is in the foreground.

Use this method for tilt based apps where the user is not touching the screen regularly to keep the device awake.

 app.PreventScreenLock( prevent );

Example

function OnStart()
{
  app.PreventScreenLock( true );
}
  Copy   Copy All    Run