This class holds global variables and methods for managing PowerUI. The most important ones are: UI.Start UI.Update UI.document
Static Public Member Functions | |
static string | LoadHTML (string resource) |
Gets the content of the given file from resources. More... | |
static void | CameraGotCreated (Camera camera) |
Used internally to fire the OnCameraCreated event. More... | |
static void | SearchAssembly (System.Reflection.Assembly asm) |
Searches the given assembly for PowerUI modules, custom tags, properties etc. Just an alias for Modular.Start.Now(asm). More... | |
static void | Start () |
Startup the UI. Now called internally, but can be called at the start of any scene using PowerUI. More... | |
static void | Start (bool nitroAot) |
Used internally - don't call this one. Startup the UI for use in the Editor with AOT Nitro. More... | |
static void | HideFromCamera (Camera camera) |
Used to hide the UI from the given camera if it's generated entirely at runtime. More... | |
static void | SetDepthResolution (float gaps) |
Sets how many world units are used between elements at different depths. Default is 0.05. More... | |
static Renderman | GetRenderer () |
Gets the renderer which renders this UI. More... | |
static void | OnLogMessage (string message) |
Called by wrench when it logs a message. More... | |
static void | SetGroupResolver (string group, GroupResolveEvent resolver) |
Sets the group resolver to use when resolving a group name from a variable that isn't found in the languages groups. E.g. &cdn.text; can be handled in custom ways here. More... | |
static void | SetCameraDistance (float distance) |
Sets the distance of the camera, essentially defining the amount of z-index available. More... | |
static float | GetCameraDistance () |
Gets the distance of the main UI camera. Essentially defines how much z-index space it has. More... | |
static void | SetFieldOfView (float fov) |
Sets the field of view of the UI camera. More... | |
static float | GetFieldOfView () |
Gets the field of view of the UI camera. More... | |
static void | ClearAll () |
Clears all content from the UI and all WorldUI's. Please note that it is safer to set innerHTML to a blank string for a particular UI than calling this. More... | |
static void | Destroy () |
Clears and entirely destroys the UI and WorldUI's. Calling this is not a requirement and can only be reversed by calling Start again. More... | |
static void | OnLanguageChange (string code) |
Called by Dom when the language of the UI changes. This changes the language of all on screen . UI.Language. More... | |
static void | OnVariableChange (string code) |
static void | RequestLayout () |
Asks the renderer for a layout (Used internally). More... | |
static void | SetRate (int fps) |
Sets the update rate of the UI. More... | |
static void | RedrawNextUpdate () |
Prompts the UI to redraw on the next Update. You don't need to call this, however it can be useful in rare situations where you require the UI to bypass it's usual redraw rate (see SetRate) and refresh immediately. More... | |
static void | RedrawNow () |
In general you should never call this. It forces a full Update to occur right now; this can only be called from the main Unity thread. More... | |
static void | RequestFullLayout () |
Requests all UI's to update. This occurs when an atlas has been optimised. More... | |
static void | InternalUpdate () |
Updates the UI. Don't call this - PowerUI knows when it's needed; This is done from Start and WorldUI constructors. More... | |
Public Attributes | |
const int | Major =2 |
The major version number of PowerUI. More... | |
const int | Minor =0 |
The minor version number of PowerUI. More... | |
const int | Revision =640 |
The revision number. More... | |
const int | DefaultRate =40 |
The default max update rate in fps. Note that input is decoupled from this. More... | |
Static Public Attributes | |
static int | Layer |
The PowerUI layer's index. Used to make sure the UI is not visible with other cameras. More... | |
static HtmlElement | content |
A custom content element. You can set this to whatever element you want for easy access. More... | |
static float | RedrawRate |
The time in seconds between redraws. UI.SetRate. More... | |
static Camera | GUICamera |
The unity camera that will render all UI elements. More... | |
static HtmlDocument | document |
The main UI document. This is what you should use to add content to the UI. More... | |
static GameObject | GUINode |
The gameobject which all UI elements are parented to. More... | |
static float | CameraDistance |
How much space should be given for elements. This distance essentially defines how much z-index is allowed. More... | |
static GameObject | CameraNode |
The gameobject that our UI.GUICamera is parented to. More... | |
static Transform | CameraTransform |
The transform of the UI.GUICamera. More... | |
static FullVariableSet | Variables |
This variable set is used when parsing the HTML. can be used to replace text with custom values; e.g. in localization or . More... | |
static WorldUI | LastWorldUI |
All world UI's are kept in a linked list for updates. This is the tail of the list. More... | |
static WorldUI | FirstWorldUI |
All world UI's are kept in a linked list for updates. This is the head of the list. More... | |
static int | CameraDepth =100 |
The default depth of the main camera. More... | |
static Type | BaseCodeType =typeof(UICode) |
The type that all code derives from. Must be UICode or something that inherits UICode. More... | |
static GetSecurityDomain | OnGetSecurityDomain |
Called when a document wants the default security domain. Set with a custom method to provide your own. More... | |
static int | AtlasSize |
Properties | |
static string | UserAgent [get] |
The user agent that PowerUI uses. More... | |
static string | Version [get] |
The version of PowerUI. More... | |
static Window | window [get] |
A shortcut to UI.document.window. This is the DOM window API. More... | |
static EventTarget | Unhandled [get] |
Clicks, taps and keypresses that pass through the UI and don't hit any WorldUI's will end up being received here. Note that PowerUI already does raycasting so use the MouseEvent.rayHit property. More... | |
static CameraMode | CameraMode [get, set] |
What sort of camera should PowerUI use to render the main UI? Perspective is the default. More... | |
static Css.RenderMode | RenderMode [get, set] |
How the main UI renders images; either on an atlas or with them 'as is'. Default is Atlas. More... | |
static FilterMode | FilterMode [get, set] |
The image filter mode. More... | |
static bool | Started [get] |
Has PowerUI started up? More... | |
static string | Language [get, set] |
Gets or sets the language code (e.g. "en") of the UI. This will internally update any onscreen variables for localization so you won't need to restart the game. Please refer to our guides on localization on the website for further help with this. More... | |
static string | Gender [get, set] |
Gets or sets the gender (boy, girl, either). This is used for localization where some text is better off being specific depending on what gender the player is - e.g. when using she/ he. More... | |
static NitroDomainManager | DefaultSecurityDomain [get] |
Gets the default security domain for Nitro scripts. More... | |
static bool | Log [get, set] |
Gets/sets if the UI should log messages to the console. Default is true. More... | |
static string | Html [get, set] |
Shortcut for calling UI.Start then using UI.document.innerHTML. Applies the given HTML to the whole main UI. More... | |
static string | innerHTML [get, set] |
Shortcut for calling UI.Start then using UI.document.innerHTML. Applies the given HTML to the whole main UI. More... | |
static bool | IsRedrawUpdate [get] |
The latest real time since startup. Used to make sure PowerUI keeps going when the game is 'paused'. More... | |
static float | CurrentFrameTime [get] |
Used in callbacks and OnUpdate; the current redraw frame time. More... | |
Events | |
static CameraCreated | OnCameraCreated |
This event is fired when PowerUI generates a new camera. This is the best way to apply custom rendering to the main UI. More... | |
Static Private Member Functions | |
static void | LanguageChanged (bool goesLeftwards, HtmlDocument htmlDocument) |
Makes sure the default text direction is as given for the given html document. More... | |
static void | ResolveVariable (HtmlDocument htmlDocument, string code) |
Resolves all as used by the given document their new values. Used when e.g. the language changes. More... | |
static void | ResolveAllVariables () |
Resolves all as used by PowerUI to their new values. Used when e.g. the language changes. More... | |
static void | ResolveAllVariables (HtmlDocument htmlDocument) |
Resolves all as used by the given document their new values. Used when e.g. the language changes. More... | |
Static Private Attributes | |
static bool | _Started |
True if Start has been called. More... | |
static float | FieldOfView |
The field of view of the perspective UI camera. More... | |
static float | RedrawTimer |
How much time, in seconds, has passed since our last redraw. More... | |
static Renderman | Renderer |
The renderer which renders the main UI. More... | |
static StandardUpdater | GlobalUpdater |
Updates the UI globally. Note that this is setup automatically for you. More... | |
static CameraMode | CurrentCameraMode =CameraMode.Orthographic |
The current camera mode PowerUI is using. The default is Orthographic. See UI.CameraMode to change this. More... | |
|
inlinestatic |
Used internally to fire the OnCameraCreated event.
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
Gets the distance of the main UI camera. Essentially defines how much z-index space it has.
|
inlinestatic |
Gets the field of view of the UI camera.
|
inlinestatic |
Used to hide the UI from the given camera if it's generated entirely at runtime.
|
inlinestatic |
|
inlinestaticprivate |
Makes sure the default text direction is as given for the given html document.
goesLeftwards | True if the default text direction is leftwards. |
htmlDocument | The document to apply the setting to. |
|
inlinestatic |
Gets the content of the given file from resources.
resource | The path to the file in Resources. |
|
inlinestatic |
Called by Dom when the language of the UI changes. This changes the language of all on screen . UI.Language.
code | The language code/id (e.g. en). |
|
inlinestatic |
Called by wrench when it logs a message.
message | The message to log. |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
In general you should never call this. It forces a full Update to occur right now; this can only be called from the main Unity thread.
|
inlinestatic |
Requests all UI's to update. This occurs when an atlas has been optimised.
|
inlinestatic |
Asks the renderer for a layout (Used internally).
|
inlinestaticprivate |
Resolves all as used by PowerUI to their new values. Used when e.g. the language changes.
|
inlinestaticprivate |
Resolves all as used by the given document their new values. Used when e.g. the language changes.
htmlDocument | The document to update the variables for. |
|
inlinestaticprivate |
Resolves all as used by the given document their new values. Used when e.g. the language changes.
htmlDocument | The document to update the variables for. |
|
inlinestatic |
Searches the given assembly for PowerUI modules, custom tags, properties etc. Just an alias for Modular.Start.Now(asm).
|
inlinestatic |
Sets the distance of the camera, essentially defining the amount of z-index available.
distance | The distance of the camera from the origin along the z axis in world units. |
|
inlinestatic |
Sets how many world units are used between elements at different depths. Default is 0.05.
gaps | The distance between elements to use. |
|
inlinestatic |
Sets the field of view of the UI camera.
fov | The field of view, in degrees. |
|
inlinestatic |
Sets the group resolver to use when resolving a group name from a variable that isn't found in the languages groups. E.g. &cdn.text; can be handled in custom ways here.
resolver | The resolver to use. |
|
inlinestatic |
Sets the update rate of the UI.
fps | The rate in frames per second. Default is UI.DefaultRate. |
|
inlinestatic |
|
inlinestatic |
|
staticprivate |
True if Start has been called.
|
static |
|
static |
|
static |
The default depth of the main camera.
|
static |
How much space should be given for elements. This distance essentially defines how much z-index is allowed.
|
static |
The gameobject that our UI.GUICamera is parented to.
|
static |
The transform of the UI.GUICamera.
|
static |
A custom content element. You can set this to whatever element you want for easy access.
|
staticprivate |
The current camera mode PowerUI is using. The default is Orthographic. See UI.CameraMode to change this.
const int PowerUI.UI.DefaultRate =40 |
The default max update rate in fps. Note that input is decoupled from this.
|
static |
|
staticprivate |
The field of view of the perspective UI camera.
|
static |
All world UI's are kept in a linked list for updates. This is the head of the list.
|
staticprivate |
Updates the UI globally. Note that this is setup automatically for you.
|
static |
The unity camera that will render all UI elements.
|
static |
The gameobject which all UI elements are parented to.
|
static |
All world UI's are kept in a linked list for updates. This is the tail of the list.
|
static |
const int PowerUI.UI.Major =2 |
The major version number of PowerUI.
const int PowerUI.UI.Minor =0 |
The minor version number of PowerUI.
|
static |
Called when a document wants the default security domain. Set with a custom method to provide your own.
|
static |
The time in seconds between redraws. UI.SetRate.
|
staticprivate |
How much time, in seconds, has passed since our last redraw.
const int PowerUI.UI.Revision =640 |
The revision number.
|
static |
This variable set is used when parsing the HTML. can be used to replace text with custom values; e.g. in localization or .
|
staticgetset |
|
staticget |
Used in callbacks and OnUpdate; the current redraw frame time.
|
staticget |
Gets the default security domain for Nitro scripts.
|
staticgetset |
The image filter mode.
|
staticgetset |
Gets or sets the gender (boy, girl, either). This is used for localization where some text is better off being specific depending on what gender the player is - e.g. when using she/ he.
|
staticgetset |
|
staticgetset |
|
staticget |
|
staticgetset |
Gets or sets the language code (e.g. "en") of the UI. This will internally update any onscreen variables for localization so you won't need to restart the game. Please refer to our guides on localization on the website for further help with this.
|
staticgetset |
Gets/sets if the UI should log messages to the console. Default is true.
|
staticgetset |
How the main UI renders images; either on an atlas or with them 'as is'. Default is Atlas.
|
staticget |
Has PowerUI started up?
|
staticget |
Clicks, taps and keypresses that pass through the UI and don't hit any WorldUI's will end up being received here. Note that PowerUI already does raycasting so use the MouseEvent.rayHit property.
|
staticget |
The user agent that PowerUI uses.
|
staticget |
The version of PowerUI.
|
staticget |
A shortcut to UI.document.window. This is the DOM window API.
|
static |