- Functions and constants to access the window, window event listeners and screen dimming.
Static methods
staticgetDimMode():WindowDimmingMode
- Returns the current dimming mode set on a mobile device.
The dimming mode specifies whether or not a mobile device should dim the screen after a period without user interaction.
On platforms that does not support dimming, DIMMING_UNKNOWN
is always returned.
Returns:
The mode for screen dimming
staticgetDisplayScale():Float
- This returns the content scale of the current display.
Returns:
The display scale
staticgetMouseLock():Bool
- This returns the current lock state of the mouse cursor.
Returns:
The lock state
staticgetSize():WindowSize
- This returns the current window size (width and height).
Returns:
The size of the window.
staticsetDimMode(mode:WindowDimmingMode):Void
- Sets the dimming mode on a mobile device.
The dimming mode specifies whether or not a mobile device should dim the screen after a period without user interaction. The dimming mode will only affect the mobile device while the game is in focus on the device, but not when the game is running in the background.
This function has no effect on platforms that does not support dimming.
Parameters:
mode | The mode for screen dimming |
---|
staticinlinesetListener(callback:(event:WindowEvent, data:WindowEventData) ‑> Void):Void
- Sets a window event listener.
Parameters:
callback | A callback which receives info about window events. Can be null. |
---|
staticsetMouseLock(flag:Bool):Void
- Set the locking state for current mouse cursor on a PC platform. This function locks or unlocks the mouse cursor to the center point of the window. While the cursor is locked, mouse position updates will still be sent to the scripts as usual.
Parameters:
flag | The lock state for the mouse cursor |
---|
staticsetPosition(x:Int, y:Int):Void
- Sets the window position.
Parameters:
x | Horizontal position of window |
---|---|
y | Vertical position of window |
staticsetSize(width:Int, height:Int):Void
- Sets the window size. Works on desktop platforms only.
Parameters:
width | Width of window |
---|---|
height | Height of window |
staticsetTitle(title:String):Void
- Sets the window title. Works on desktop platforms.
Parameters:
title | The window title (UTF-8) |
---|