|
QuadUI 1.2.9 public beta
Run-time API for QuadUI
|
Public Types | |
| enum | Resolution { Custom = 0 } |
Static Public Member Functions | |
| static void | ModifyResolution (int width, int height, bool fullscreen) |
| static void | OnLevelEnd () |
Public Attributes | |
| bool | allowUserInput = true |
| Camera | cam |
| QuadUI.Resolution | resolution |
| Vector2 | screenDimensions = new Vector2(1024,768) |
| bool | resizable = true |
Static Public Attributes | |
| static float | deltaTime |
Properties | |
| static Vector2 | screenCenter [get] |
| static QuadUI | Instance [get] |
| static bool | Interactive [get, set] |
This is a Singleton class. Only one QuadUI object may be instantiated at any given time, otherwise an exception is thrown. This class is sealed and cannot be extended.
This is your top-level UI manager. All interactive events are dispatched from here. This class also has some helper Gizmos for laying out your UI in the Scene View.
QuadUI is platform-independent as it takes advantage of Unity's platform-dependent compilation to filter out unnecessary user interaction events on platforms. For example: A touch interface has no "Mouse Over" event, so anything like that will not be compiled when working within a Mobile build setting such as iOS or Android.
| enum QuadUI::Resolution |
The screen resolution of your deployment platform. This is used to draw out your wireframe canvas in the Scene View.
Note: This enum is Build-Setting dependent, and therefore different values will be available for different build settings.
For iPhone:
Custom = 0, iPhonePortrait = 1, iPhoneLandscape = 2, iPadPortrait = 3, iPadLandscape = 4, iPhone4Portrait = 5, iPhone4Landscape = 6
For Android:
Custom = 0, HTCLegendTall = 1, HTCLegendWide = 2, NexusOneTall = 3, NexusOneWide = 4, MotorolaDroidTall = 5, MotorolaDroidWide = 6, TegraTabletTall = 7, TegraTabletWide = 8
| static void QuadUI.ModifyResolution | ( | int | width, |
| int | height, | ||
| bool | fullscreen | ||
| ) | [static] |
If you are changing the resolution of the screen, call this instead of Screen.SetResolution This function calls Screen.SetResolution, but also BroadcastMessage for the function OnResolutionChange() which can be found in Screen2D to reposition your 2D elements! If resizable is set to false, this function will do nothing. Note: If you are designing for multiple resolutions, animations done with the Unity Animation Tool will probably not work the way you'd expect.
| static void QuadUI.OnLevelEnd | ( | ) | [static] |
It is imperative to call this method before moving to another Level, especially if the next level contains another instantiation of QuadUI.
| bool QuadUI.allowUserInput = true |
If this is false, this class will not perform any automatic raycasts on input events and your UI will effectively be disabled.
| Camera QuadUI.cam |
This is the orthographic camera that will fill your screen space. All raycasting is done from here with the Camera's layerBitMask taken into account to filter out non-UI colliders.
float QuadUI.deltaTime [static] |
Time.timeScale independent deltaTime. TimescaleIndependentAnimation uses this variable to power its animations.
| bool QuadUI.resizable = true |
Should QuadUI check for resize events?
This should match the resolution your are building the UI for.
| Vector2 QuadUI.screenDimensions = new Vector2(1024,768) |
If QuadUI.resolution is set to Custom, define the dimensions here.
QuadUI QuadUI.Instance [static, get] |
Static Read only. Returns the Instantiation of this Singleton.
bool QuadUI.Interactive [static, get, set] |
Static communication to the Singleton instance's allowUserInput variable. Use this to toggle the activation of your UI. For more info see QuadUI.allowUserInput.
Vector2 QuadUI.screenCenter [static, get] |
Returns the center pixel of the Screen