|
Drag[en]gine Script Module DragonScript 1.35
|
Behavior adding renderable HUD support to VR. More...
Classes | |
| class | BlockContentCreator |
| Factory creating renderable content using block. More... | |
| interface | ContentCreator |
| Create renderable panel content. More... | |
| class | Factory |
| Behavior factory. More... | |
| class | Instance |
| Behavior instance. More... | |
Public Member Functions | |
| void | addContentCreator (Block blockCreator) |
| Add content creator using block. | |
| void | addContentCreator (ContentCreator creator) |
| Add content creator. | |
| void | createContent (Instance instance) |
| Create content using creators. | |
| void | dispose () |
| Dispose of behavior. | |
| void | forEachContentCreator (Block ablock) |
| Visit content creators with block with argument ContentCreator. | |
| ECPString | getDesignerSelector () |
| Designer selector to use for Panel. | |
| ECPGuiTheme | getGuiTheme () |
| Gui Theme to use for Panel. | |
| ECBehaviorPlayerControllable | getPlayerControllable () |
| Player controllable behavior. | |
| String | getPrefix () |
| Prefix. | |
| ECPInteger | getSize () |
| Size of canvas. | |
| ECBehaviorVRHud | new (BehaviorElementClass eclass, ECBehaviorPlayerControllable playerControllable) |
| Create behavior element class. | |
| ECBehaviorVRHud | new (BehaviorElementClass eclass, ECBehaviorPlayerControllable playerControllable, Loaders loaders) |
| ECBehaviorVRHud | new (BehaviorElementClass eclass, ECBehaviorPlayerControllable playerControllable, Loaders loaders, String prefix) |
| Public Member Functions inherited from Dragengine.Scenery.DefaultECBehavior | |
| void | assignInstanceIndex (int instanceIndex) |
| Assign instance index. | |
| String | getBehaviorID () |
| Unique identifier of behavior. | |
| String | getID () |
| Identifier. | |
| int | getInstanceIndex () |
| Instance index. | |
| void | loadSupportedData (String identifier, PersistencyEnvironment env, FileReader reader, ECBehaviorInstance instance) |
| Load instance data of another behavior. | |
| bool | supportsBehaviorID (String identifier) |
| Behavior supports loading instance data of another behavior. | |
| Public Member Functions inherited from Dragengine.Scenery.ECBehavior | |
| ECBehaviorInstance | createInstance (BehaviorElement element) |
| Create Behavior instance. | |
Static Public Member Functions | |
| static ECBehaviorVRHud | getBehaviorIn (BehaviorElementClass eclass) |
| Get behavior in element class or null if absent. | |
Public Attributes | |
| Array | pContentCreators |
| ECPString | pDesignerSelector |
| ECPGuiTheme | pGuiTheme |
| ECBehaviorPlayerControllable | pPlayerControllable |
| String | pPrefix |
| ECPInteger | pSize |
Additional Inherited Members | |
| Protected Member Functions inherited from Dragengine.Scenery.DefaultECBehavior | |
| DefaultECBehavior | new (BehaviorElementClass eclass) |
| Create default composeable behavior with empty identifier. | |
| DefaultECBehavior | new (BehaviorElementClass eclass, String id) |
| Create default composeable behavior. | |
| void | setBehaviorID (String identifier) |
| Set behavior identifier. | |
| void | useClassNameAsBehaviorID () |
| Set behavior identifier to "<class-name>:<identifier>". | |
| void | useFullyQualifiedClassNameAsBehaviorID () |
| Set behavior identifier to "<fully-qualified-class-name>:<identifier>". | |
Behavior adding renderable HUD support to VR.
This behavior works similar to ECBehaviorRenderablePanel but shows the content on the VR HUD canvas overlay instead of a dynamic skin. The VR HUD canvas overlay is a canvas displayed on top of the VR view using a user defined field of view. This avoids the developer guessing the best field of view to render the HUD content. This also ensures users can adjust the HUD field of view to their personal preferences easily.
The behavior allows other behaviors to add their content Widget to the Panel separating logic for reuse. This also allows to use the full power of the GUI ToolKit including using GuiThemes to create complex content easily.
The default layout for the Panel is StackLayout. The default gui theme is "/shareddata/guithemes/modern/modern.degt". The default Panel designer selector is "VRHudPanel".
To use this behavior add it to the element class and set the designer selector and GuiTheme to use for the Panel. Now you can add other behaviors targeting the ECBehaviorVRHud to add Widget resources to.
The Panel is created with a default size of 1024x1024 . You can change the size using the element property to fit the HUD size to your needs.
This behavior can be used only once.
If ECBehaviorPlayerControllable is present the HUD is activated while the actor is controlled by the player. If absent the HUD has to be activated manually. This is required since only one canvas can be the active VR Hud overlay canvas.
Element class properties have the prefix "vrHud.".
This behavior does not require the element class to be persistable (setPersistable).
| void Dragengine.Scenery.ECBehaviorVRHud.addContentCreator | ( | Block | blockCreator | ) |
Add content creator using block.
Block receives as parameter Instance.
| void Dragengine.Scenery.ECBehaviorVRHud.addContentCreator | ( | ContentCreator | creator | ) |
Add content creator.
Referenced by getBehaviorIn().
| void Dragengine.Scenery.ECBehaviorVRHud.createContent | ( | Instance | instance | ) |
Create content using creators.
Referenced by dispose(), and getBehaviorIn().
| void Dragengine.Scenery.ECBehaviorVRHud.dispose | ( | ) |
Dispose of behavior.
Reimplemented from Dragengine.Scenery.DefaultECBehavior.
References createContent(), and getPlayerControllable().
Referenced by getBehaviorIn().
| void Dragengine.Scenery.ECBehaviorVRHud.forEachContentCreator | ( | Block | ablock | ) |
Visit content creators with block with argument ContentCreator.
Referenced by getBehaviorIn().
|
static |
Get behavior in element class or null if absent.
Use this method to check if a particular BehaviorElementClass contains a behavior of type ECBehaviorVRHud.
References addContentCreator(), createContent(), Dragengine.Scenery.ECBehavior.createInstance(), dispose(), forEachContentCreator(), getBehaviorIn(), getDesignerSelector(), getGuiTheme(), getPlayerControllable(), getPrefix(), getSize(), new(), pContentCreators, pDesignerSelector, pGuiTheme, pPlayerControllable, pPrefix, and pSize.
Referenced by getBehaviorIn().
| ECPString Dragengine.Scenery.ECBehaviorVRHud.getDesignerSelector | ( | ) |
Designer selector to use for Panel.
Referenced by getBehaviorIn().
| ECPGuiTheme Dragengine.Scenery.ECBehaviorVRHud.getGuiTheme | ( | ) |
Referenced by getBehaviorIn().
| ECBehaviorPlayerControllable Dragengine.Scenery.ECBehaviorVRHud.getPlayerControllable | ( | ) |
Player controllable behavior.
Referenced by dispose(), and getBehaviorIn().
| String Dragengine.Scenery.ECBehaviorVRHud.getPrefix | ( | ) |
Prefix.
Referenced by getBehaviorIn().
| ECPInteger Dragengine.Scenery.ECBehaviorVRHud.getSize | ( | ) |
Size of canvas.
Referenced by getBehaviorIn().
| ECBehaviorVRHud Dragengine.Scenery.ECBehaviorVRHud.new | ( | BehaviorElementClass | eclass, |
| ECBehaviorPlayerControllable | playerControllable ) |
Create behavior element class.
Player controllable is optional. If present the HUD is activated while the actor is controlled by the player. If absent the HUD has to be activated manually.
References new().
Referenced by getBehaviorIn(), and new().
| ECBehaviorVRHud Dragengine.Scenery.ECBehaviorVRHud.new | ( | BehaviorElementClass | eclass, |
| ECBehaviorPlayerControllable | playerControllable, | ||
| Loaders | loaders ) |
| ECBehaviorVRHud Dragengine.Scenery.ECBehaviorVRHud.new | ( | BehaviorElementClass | eclass, |
| ECBehaviorPlayerControllable | playerControllable, | ||
| Loaders | loaders, | ||
| String | prefix ) |
| Array Dragengine.Scenery.ECBehaviorVRHud.pContentCreators |
Referenced by getBehaviorIn().
| ECPString Dragengine.Scenery.ECBehaviorVRHud.pDesignerSelector |
Referenced by getBehaviorIn().
| ECPGuiTheme Dragengine.Scenery.ECBehaviorVRHud.pGuiTheme |
Referenced by getBehaviorIn().
| ECBehaviorPlayerControllable Dragengine.Scenery.ECBehaviorVRHud.pPlayerControllable |
Referenced by getBehaviorIn().
| String Dragengine.Scenery.ECBehaviorVRHud.pPrefix |
Referenced by getBehaviorIn().
| ECPInteger Dragengine.Scenery.ECBehaviorVRHud.pSize |
Referenced by getBehaviorIn().