NGUI: Next-Gen UI kit  3.7.2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Macros
UIRoot Class Reference

This is a script used to keep the game object scaled to 2/(Screen.height). If you use it, be sure to NOT use UIOrthoCamera at the same time. More...

Inheritance diagram for UIRoot:

Public Types

enum  Scaling { Scaling.Flexible, Scaling.Constrained, Scaling.ConstrainedOnMobiles }
 
enum  Constraint { Constraint.Fit, Constraint.Fill, Constraint.FitWidth, Constraint.FitHeight }
 

Public Member Functions

float GetPixelSizeAdjustment (int height)
 Calculate the pixel size adjustment at the specified screen height value. More...
 

Static Public Member Functions

static float GetPixelSizeAdjustment (GameObject go)
 Helper function that figures out the pixel size adjustment for the specified game object. More...
 
static void Broadcast (string funcName)
 Broadcast the specified message to the entire UI. More...
 
static void Broadcast (string funcName, object param)
 Broadcast the specified message to the entire UI. More...
 

Public Attributes

Scaling scalingStyle = Scaling.Flexible
 Type of scaling used by the UIRoot. More...
 
int manualWidth = 1280
 Width of the screen, used when the scaling style is set to Flexible. More...
 
int manualHeight = 720
 Height of the screen when the scaling style is set to FixedSize or Flexible. More...
 
int minimumHeight = 320
 If the screen height goes below this value, it will be as if the scaling style is set to FixedSize with manualHeight of this value. More...
 
int maximumHeight = 1536
 If the screen height goes above this value, it will be as if the scaling style is set to Fixed Height with manualHeight of this value. More...
 
bool fitWidth = false
 When Constraint is on, controls whether the content must be restricted horizontally to be at least 'manualWidth' wide. More...
 
bool fitHeight = true
 When Constraint is on, controls whether the content must be restricted vertically to be at least 'Manual Height' tall. More...
 
bool adjustByDPI = false
 Whether the final value will be adjusted by the device's DPI setting. Used when the Scaling is set to Pixel-Perfect. More...
 
bool shrinkPortraitUI = false
 If set and the game is in portrait mode, the UI will shrink based on the screen's width instead of height. Used when the Scaling is set to Pixel-Perfect. More...
 

Static Public Attributes

static List< UIRootlist = new List<UIRoot>()
 List of all UIRoots present in the scene. More...
 

Protected Member Functions

virtual void Awake ()
 
virtual void OnEnable ()
 
virtual void OnDisable ()
 
virtual void Start ()
 

Properties

Constraint constraint [get]
 When the UI scaling is constrained, this controls the type of constraint that further fine-tunes how it's scaled. More...
 
Scaling activeScaling [get]
 Active scaling type, based on platform. More...
 
int activeHeight [get]
 UI Root's active height, based on the size of the screen. More...
 
float pixelSizeAdjustment [get]
 Pixel size adjustment. Most of the time it's at 1, unless the scaling style is set to FixedSize. More...
 

Detailed Description

This is a script used to keep the game object scaled to 2/(Screen.height). If you use it, be sure to NOT use UIOrthoCamera at the same time.

Member Enumeration Documentation

Enumerator
Fit 
Fill 
FitWidth 
FitHeight 
Enumerator
Flexible 
Constrained 
ConstrainedOnMobiles 

Member Function Documentation

virtual void UIRoot.Awake ( )
protectedvirtual
static void UIRoot.Broadcast ( string  funcName)
static

Broadcast the specified message to the entire UI.

static void UIRoot.Broadcast ( string  funcName,
object  param 
)
static

Broadcast the specified message to the entire UI.

static float UIRoot.GetPixelSizeAdjustment ( GameObject  go)
static

Helper function that figures out the pixel size adjustment for the specified game object.

float UIRoot.GetPixelSizeAdjustment ( int  height)

Calculate the pixel size adjustment at the specified screen height value.

virtual void UIRoot.OnDisable ( )
protectedvirtual
virtual void UIRoot.OnEnable ( )
protectedvirtual
virtual void UIRoot.Start ( )
protectedvirtual

Member Data Documentation

bool UIRoot.adjustByDPI = false

Whether the final value will be adjusted by the device's DPI setting. Used when the Scaling is set to Pixel-Perfect.

bool UIRoot.fitHeight = true

When Constraint is on, controls whether the content must be restricted vertically to be at least 'Manual Height' tall.

bool UIRoot.fitWidth = false

When Constraint is on, controls whether the content must be restricted horizontally to be at least 'manualWidth' wide.

List<UIRoot> UIRoot.list = new List<UIRoot>()
static

List of all UIRoots present in the scene.

int UIRoot.manualHeight = 720

Height of the screen when the scaling style is set to FixedSize or Flexible.

int UIRoot.manualWidth = 1280

Width of the screen, used when the scaling style is set to Flexible.

int UIRoot.maximumHeight = 1536

If the screen height goes above this value, it will be as if the scaling style is set to Fixed Height with manualHeight of this value.

int UIRoot.minimumHeight = 320

If the screen height goes below this value, it will be as if the scaling style is set to FixedSize with manualHeight of this value.

Scaling UIRoot.scalingStyle = Scaling.Flexible

Type of scaling used by the UIRoot.

bool UIRoot.shrinkPortraitUI = false

If set and the game is in portrait mode, the UI will shrink based on the screen's width instead of height. Used when the Scaling is set to Pixel-Perfect.

Property Documentation

int UIRoot.activeHeight
get

UI Root's active height, based on the size of the screen.

Scaling UIRoot.activeScaling
get

Active scaling type, based on platform.

Constraint UIRoot.constraint
get

When the UI scaling is constrained, this controls the type of constraint that further fine-tunes how it's scaled.

float UIRoot.pixelSizeAdjustment
get

Pixel size adjustment. Most of the time it's at 1, unless the scaling style is set to FixedSize.


The documentation for this class was generated from the following file: