Drag[en]gine Script Module DragonScript 1.35
Loading...
Searching...
No Matches
Dragengine.Scenery.ECBehaviorVRHud Class Reference

Behavior adding renderable HUD support to VR. More...

Inheritance diagram for Dragengine.Scenery.ECBehaviorVRHud:
Dragengine.Scenery.DefaultECBehavior Dragengine.Scenery.ECBehavior Dragengine.Scenery.BehaviorCompatiblePersistency

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>".

Detailed Description

Behavior adding renderable HUD support to VR.

Version
1.34

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).

See also
https://developer.dragondreams.ch/wiki/doku.php/dragengine:modules:dragonscript:behavior_vrhud

Member Function Documentation

◆ addContentCreator() [1/2]

void Dragengine.Scenery.ECBehaviorVRHud.addContentCreator ( Block blockCreator)

Add content creator using block.

Block receives as parameter Instance.

◆ addContentCreator() [2/2]

void Dragengine.Scenery.ECBehaviorVRHud.addContentCreator ( ContentCreator creator)

Add content creator.

Referenced by getBehaviorIn().

◆ createContent()

void Dragengine.Scenery.ECBehaviorVRHud.createContent ( Instance instance)

Create content using creators.

Referenced by dispose(), and getBehaviorIn().

◆ dispose()

void Dragengine.Scenery.ECBehaviorVRHud.dispose ( )

Dispose of behavior.

Reimplemented from Dragengine.Scenery.DefaultECBehavior.

References createContent(), and getPlayerControllable().

Referenced by getBehaviorIn().

◆ forEachContentCreator()

void Dragengine.Scenery.ECBehaviorVRHud.forEachContentCreator ( Block ablock)

Visit content creators with block with argument ContentCreator.

Referenced by getBehaviorIn().

◆ getBehaviorIn()

ECBehaviorVRHud Dragengine.Scenery.ECBehaviorVRHud.getBehaviorIn ( BehaviorElementClass eclass)
static

◆ getDesignerSelector()

ECPString Dragengine.Scenery.ECBehaviorVRHud.getDesignerSelector ( )

Designer selector to use for Panel.

Referenced by getBehaviorIn().

◆ getGuiTheme()

ECPGuiTheme Dragengine.Scenery.ECBehaviorVRHud.getGuiTheme ( )

Gui Theme to use for Panel.

Referenced by getBehaviorIn().

◆ getPlayerControllable()

ECBehaviorPlayerControllable Dragengine.Scenery.ECBehaviorVRHud.getPlayerControllable ( )

Player controllable behavior.

Referenced by dispose(), and getBehaviorIn().

◆ getPrefix()

String Dragengine.Scenery.ECBehaviorVRHud.getPrefix ( )

Prefix.

Referenced by getBehaviorIn().

◆ getSize()

ECPInteger Dragengine.Scenery.ECBehaviorVRHud.getSize ( )

Size of canvas.

Referenced by getBehaviorIn().

◆ new() [1/3]

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().

◆ new() [2/3]

ECBehaviorVRHud Dragengine.Scenery.ECBehaviorVRHud.new ( BehaviorElementClass eclass,
ECBehaviorPlayerControllable playerControllable,
Loaders loaders )

◆ new() [3/3]

ECBehaviorVRHud Dragengine.Scenery.ECBehaviorVRHud.new ( BehaviorElementClass eclass,
ECBehaviorPlayerControllable playerControllable,
Loaders loaders,
String prefix )

Member Data Documentation

◆ pContentCreators

Array Dragengine.Scenery.ECBehaviorVRHud.pContentCreators

Referenced by getBehaviorIn().

◆ pDesignerSelector

ECPString Dragengine.Scenery.ECBehaviorVRHud.pDesignerSelector

Referenced by getBehaviorIn().

◆ pGuiTheme

ECPGuiTheme Dragengine.Scenery.ECBehaviorVRHud.pGuiTheme

Referenced by getBehaviorIn().

◆ pPlayerControllable

ECBehaviorPlayerControllable Dragengine.Scenery.ECBehaviorVRHud.pPlayerControllable

Referenced by getBehaviorIn().

◆ pPrefix

String Dragengine.Scenery.ECBehaviorVRHud.pPrefix

Referenced by getBehaviorIn().

◆ pSize

ECPInteger Dragengine.Scenery.ECBehaviorVRHud.pSize

Referenced by getBehaviorIn().


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