os_powersave_enable

Set the powersave functions of the device.

Syntax:

GML Code Example

os_powersave_enable(flag)


Argument Description
flag Set to true or false to enable or disable powersave functions.


Returns: N/A


Description

With this function you can turn on or off the power saving features of the device. This is important as certain games (for example those that use the tilt functions) may not generate events that the OS can interpret as being user input and so shut down the screen or exit the game. By setting this function to false you can disable the power saving features and ensure that the screen (and game) are always functioning.

NOTE: This is limited to iOS, Android and Windows 8 Phone targets.


Example:

GML Code Example

if os_type == os_android || os_type == os_ios
    {
    os_powersave_enable(false);
    }
 

The above code checks the OS type and if it is either Android or an iOS then power saving features are deactivated.





No Examples Submitted

Does this page need better examples? Be the first to Submit

No Edits Suggested

Is this page unclear or not descriptive enough? Suggest an edit to the page and with enough upvotes your changes will be made.

No Questions Have Been Ask

Do you have a question about this page? Ask it Here