Screen

More information can be found in the Unity API Reference and maybe in the Unity Manual.

Static members

Member

Description

height

The current screen height in pixels.

width

The current screen width in pixels.

Static methods

Method

Description

LockCursor()

Undo UnlockCursor().

UnlockCursor()

Unlocks the mouse cursor, typically in order to allow the player to click UI elements.

Details

class Screen
static const float height

The current screen height in pixels.

static const float width

The current screen width in pixels.

static void LockCursor()

Undo UnlockCursor(). This function only affects the ingame cursor. It does not affect the cursor state when a menu is open, etc.

static void UnlockCursor()

Unlocks the mouse cursor, typically in order to allow the player to click UI elements. This function only affects the ingame cursor. It does not affect the cursor state when a menu is open, etc.