Detailed Description

Provides general information about the screen such as where the corners are in world units. Note: The world origin is in the middle of the screen. The provided world screen origin is the top left corner.

Static Public Member Functions

static bool IsLandscape ()
 A standard test to see if the device is oriented landscape. More...
 
static void Clear ()
 Causes all settings here to be refreshed on the next update. More...
 
static void Update ()
 Checks if the screen size changed and repaints if it did. Called by UI.Update. More...
 

Public Attributes

const int CssPixelDpi =96
 The DPI of a CSS pixel. More...
 

Static Public Attributes

static int ScreenX
 The screen width in pixels. More...
 
static int ScreenY
 The screen height in pixels. More...
 
static float ScreenXFloat
 The width of the screen in pixels as a float. More...
 
static float ScreenYFloat
 The height of the screen in pixels as a float. More...
 
static float DepthDepreciation
 How many pixels are gained/lost per unit depth on screen size. Varies with field of view. More...
 
static Vector2 WorldSize =Vector2.zero
 The height/width of the screen in world units at zero depth. More...
 
static Vector2 WorldPerPixel =Vector2.zero
 The amount of world units per screen pixel at zero depth. More...
 
static Vector3 WorldScreenOrigin =Vector3.zero
 The location of the screen origin (top left corner) in world units at zero depth. More...
 

Properties

static float DevicePixelRatio [get]
 The device's DPI / ScreenInfo.CssPixelDPI. More...
 
static int Dpi [get]
 The screen DPI. More...
 

Static Private Attributes

static DeviceOrientation PreviousOrientation =DeviceOrientation.Unknown
 The cached previous orientation. Either Unknown, LandscapeLeft or Portrait. More...
 

Member Function Documentation

static void PowerUI.ScreenInfo.Clear ( )
inlinestatic

Causes all settings here to be refreshed on the next update.

static bool PowerUI.ScreenInfo.IsLandscape ( )
inlinestatic

A standard test to see if the device is oriented landscape.

static void PowerUI.ScreenInfo.Update ( )
inlinestatic

Checks if the screen size changed and repaints if it did. Called by UI.Update.

Member Data Documentation

const int PowerUI.ScreenInfo.CssPixelDpi =96

The DPI of a CSS pixel.

float PowerUI.ScreenInfo.DepthDepreciation
static

How many pixels are gained/lost per unit depth on screen size. Varies with field of view.

DeviceOrientation PowerUI.ScreenInfo.PreviousOrientation =DeviceOrientation.Unknown
staticprivate

The cached previous orientation. Either Unknown, LandscapeLeft or Portrait.

int PowerUI.ScreenInfo.ScreenX
static

The screen width in pixels.

float PowerUI.ScreenInfo.ScreenXFloat
static

The width of the screen in pixels as a float.

int PowerUI.ScreenInfo.ScreenY
static

The screen height in pixels.

float PowerUI.ScreenInfo.ScreenYFloat
static

The height of the screen in pixels as a float.

Vector2 PowerUI.ScreenInfo.WorldPerPixel =Vector2.zero
static

The amount of world units per screen pixel at zero depth.

Vector3 PowerUI.ScreenInfo.WorldScreenOrigin =Vector3.zero
static

The location of the screen origin (top left corner) in world units at zero depth.

Vector2 PowerUI.ScreenInfo.WorldSize =Vector2.zero
static

The height/width of the screen in world units at zero depth.

Property Documentation

float PowerUI.ScreenInfo.DevicePixelRatio
staticget

The device's DPI / ScreenInfo.CssPixelDPI.

int PowerUI.ScreenInfo.Dpi
staticget

The screen DPI.