Wanzyee Studio
ResolutionSetter

Set standalone player window resolution, position and style. More...

Inherits MonoBehaviour.

Public Member Functions

void Apply ()
 Apply window resolution. More...
 

Static Public Member Functions

static Resolution GetResolution ()
 Get the primary monitor resolution. More...
 
static void SetFullscreen ()
 Set window fullscreen with primary monitor resolution. More...
 
static void SetFullscreen (int width, int height)
 Set window fullscreen with specified size. More...
 
static void SetWindowed (int width, int height)
 Set normal window with specified size. More...
 
static void SetBorderless (int x, int y, int width, int height)
 Set borderless window with specified position. More...
 
static void SetPopup (int width, int height)
 Set popup window with specified size centered on primary monitor. More...
 

Public Attributes

bool applyOnAwake
 Flag if to apply resolution when Awake(). More...
 
WindowStyle style = WindowStyle.Fullscreen
 The window style, borderless for Windows only. More...
 
Rect rect = new Rect(0f, 0f, 1920f, 1080f)
 The window position rect. More...
 

Detailed Description

Set standalone player window resolution, position and style.

Member Function Documentation

static Resolution GetResolution ( )
static

Get the primary monitor resolution.

Returns
The resolution.
static void SetFullscreen ( )
static

Set window fullscreen with primary monitor resolution.

Standalone player only. This may take a few frames to process.

static void SetFullscreen ( int  width,
int  height 
)
static

Set window fullscreen with specified size.

Standalone player only. This may take a few frames to process.

Parameters
widthScreen width.
heightScreen height.
static void SetWindowed ( int  width,
int  height 
)
static

Set normal window with specified size.

Standalone player only. The result resolution isn't guaranteed if the assigned out of range. This may take a few frames to process.

Parameters
widthWindow width.
heightWindow height.
static void SetBorderless ( int  x,
int  y,
int  width,
int  height 
)
static

Set borderless window with specified position.

Windows standalone only. This may take a few frames to process.

Parameters
xThe x offset from primary monitor.
yThe y offset from primary monitor.
widthWindow width.
heightWindow height.
static void SetPopup ( int  width,
int  height 
)
static

Set popup window with specified size centered on primary monitor.

Windows standalone only. This may take a few frames to process.

Parameters
widthWindow width.
heightWindow height.
void Apply ( )

Apply window resolution.

Only works on standalone player, and the borderless style is for Windows only.

Member Data Documentation

bool applyOnAwake

Flag if to apply resolution when Awake().

The window style, borderless for Windows only.

Rect rect = new Rect(0f, 0f, 1920f, 1080f)

The window position rect.

The size's used besides fullscreen, the position's only used by borderless style.