Drag[en]gine Script Module DragonScript  1.21
Dragengine.Scenery.ECBehaviorRenderableDesktop Class Reference

Behavior element behavior adding a renderable Desktop widget. More...

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

Classes

class  BlockContentCreator
 Factory creating renderable content using block. More...
 
interface  ContentCreator
 Create renderable desktop content. More...
 
class  Instance
 Behavior instance. More...
 

Public Member Functions

void addContentCreator (Block blockCreator)
 Add content creator using block. More...
 
void addContentCreator (ContentCreator creator)
 Add content creator. More...
 
void createContent (Instance instance)
 Create content using creators. More...
 
void dispose ()
 Dispose of behavior. More...
 
void forEachContentCreator (Block ablock)
 Visit content creators with block with argument ContentCreator. More...
 
ECPString getDesignerSelector ()
 Designer selector to use for Desktop. More...
 
ECBehaviorDynamicSkin getDynamicSkin ()
 Dynamic skin behavior. More...
 
ECPGuiTheme getGuiTheme ()
 Gui Theme to use for Desktop. More...
 
ECPString getRenderable ()
 Name of renderable to create or empty string if not used. More...
 
ECPString getRenderableSolidity ()
 Name of solidity renderable to create or empty string if not used. More...
 
ECPPoint getSize ()
 Size of canvas. More...
 
ECBehaviorRenderableDesktop new (BehaviorElementClass eclass, ECBehaviorDynamicSkin dynamicSkin)
 Create behavior element class. More...
 
ECBehaviorRenderableDesktop new (BehaviorElementClass eclass, ECBehaviorDynamicSkin dynamicSkin, Loaders loaders)
 
ECBehaviorRenderableDesktop new (BehaviorElementClass eclass, ECBehaviorDynamicSkin dynamicSkin, Loaders loaders, String id)
 
ECBehaviorRenderableDesktop new (BehaviorElementClass eclass, ECBehaviorDynamicSkin dynamicSkin, Loaders loaders, String id, String prefix)
 
ECBehaviorRenderableDesktop new (BehaviorElementClass eclass, ECBehaviorDynamicSkin dynamicSkin, String id)
 
- Public Member Functions inherited from Dragengine.Scenery.DefaultECBehavior
void assignInstanceIndex (int instanceIndex)
 Assign instance index. More...
 
String getBehaviorID ()
 Unique identifier of behavior. More...
 
String getID ()
 Identifier. More...
 
int getInstanceIndex ()
 Instance index. More...
 
void loadSupportedData (String identifier, PersistencyEnvironment env, FileReader reader, ECBehaviorInstance instance)
 Load instance data of another behavior. More...
 
bool supportsBehaviorID (String identifier)
 Behavior supports loading instance data of another behavior. More...
 
- Public Member Functions inherited from Dragengine.Scenery.ECBehavior
ECBehaviorInstance createInstance (BehaviorElement element)
 Create Behavior instance. More...
 

Static Public Member Functions

static ECBehaviorRenderableDesktop getBehaviorIn (BehaviorElementClass eclass)
 Get behavior in element class or null if absent. More...
 

Additional Inherited Members

- Protected Member Functions inherited from Dragengine.Scenery.DefaultECBehavior
DefaultECBehavior new (BehaviorElementClass eclass)
 Create default composeable behavior with empty identifier. More...
 
DefaultECBehavior new (BehaviorElementClass eclass, String id)
 Create default composeable behavior. More...
 
void setBehaviorID (String identifier)
 Set behavior identifier. More...
 
void useClassNameAsBehaviorID ()
 Set behavior identifier to "<class-name>:<identifier>". More...
 
void useFullyQualifiedClassNameAsBehaviorID ()
 Set behavior identifier to "<fully-qualified-class-name>:<identifier>". More...
 

Detailed Description

Behavior element behavior adding a renderable Desktop widget.

Version
1.7

This behavior is useful for models displaying interactive UI where the content of the texture is provided by a Desktop widget. Multiple other behaviors can add their content Window to the Desktop separating logic for reuse. Using ECBehaviorRenderableDesktop allows to use the full power of the GUI ToolKit including using GuiThemes to create complex content easily.

The default gui theme is "/shareddata/guithemes/modern/modern.guitheme.xml". The default Desktop designer selector is "RenderableDesktop".

To use this behavior add an ECBehaviorDynamicSkin to the element class before adding this behavior. Create ECBehaviorRenderableDesktop behavior and set the dynamic skin and designer selector and GuiTheme for the Desktop. Now you can add other behaviors targeting the ECBehaviorRenderableDesktop to add Window resources to.

The Desktop is created with a default size of 1024x1024 . You can change the size using the element property to fit the texture requirements.

Using WidgetInputProcessor the player can control the Desktop like regular UI Desktops.

Using the "renderableSolidity" parameter an additional renderable can be defined. If used this renderable is set up to contain a CanvasCanvasView using the regular renderable CanvasView as input using a ColorMatrix to convert the transparency to a grayscale image. This can then be used to create transparent HUD displays or holographic displays with fully or partial transparent content.

Multiple ECBehaviorRenderableDesktop instances can be added to affect individual dynamic skin textures. The example below uses one component with one dynamic skin to two individual renderables named "content1" and "content2" each allowing to be individiually filled with content by different behaviors.

class MyElement extends BehaviorElementClass
public func new()
ECBehaviorComponent.new(this)
ECBehaviorDynamicSkin.new(this)
ECBehaviorCanvas.new(this)
ECBehaviorCanvas.new(this, "canvas2")
var ECBehaviorRenderableDesktop behavior = ECBehaviorRenderableDesktop.new(this)
behavior.getRenderable().setValue("content1")
behavior.getGuiTheme().setPath("/content/renderable.guitheme.xml")
behavior.getDesignerSelector().setValue("Desktop.MyElement")
behavior = ECBehaviorRenderableDesktop.new(this, "renderableDesktop2")
behavior.setBackgroundColor(Color.blue)
behavior.getRenderable().setValue("intensity2")
behavior.getGuiTheme().setPath("/content/renderable.guitheme.xml")
behavior.getDesignerSelector().setValue("Desktop.MyElement")
end
end
ECBehaviorRenderableDesktop new(BehaviorElementClass eclass, ECBehaviorDynamicSkin dynamicSkin)
Create behavior element class.
ECPString getRenderable()
Name of renderable to create or empty string if not used.
ECPGuiTheme getGuiTheme()
Gui Theme to use for Desktop.
ECPString getDesignerSelector()
Designer selector to use for Desktop.

Element class properties have the prefix "renderableDesktop{(id)}.".

This behavior does not require the element class to be persistable (setPersistable).

Member Function Documentation

◆ addContentCreator() [1/2]

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

Add content creator using block.

Version
1.9

Block receives as parameter Instance.

◆ addContentCreator() [2/2]

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

Add content creator.

Version
1.9

◆ createContent()

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

Create content using creators.

Version
1.9

◆ dispose()

void Dragengine.Scenery.ECBehaviorRenderableDesktop.dispose ( )

Dispose of behavior.

Reimplemented from Dragengine.Scenery.DefaultECBehavior.

◆ forEachContentCreator()

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

Visit content creators with block with argument ContentCreator.

Version
1.9

◆ getBehaviorIn()

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

Get behavior in element class or null if absent.

Use this method to check if a particular BehaviorElementClass contains a behavior of type ECBehaviorComponent.

◆ getDesignerSelector()

ECPString Dragengine.Scenery.ECBehaviorRenderableDesktop.getDesignerSelector ( )

Designer selector to use for Desktop.

◆ getDynamicSkin()

ECBehaviorDynamicSkin Dragengine.Scenery.ECBehaviorRenderableDesktop.getDynamicSkin ( )

Dynamic skin behavior.

◆ getGuiTheme()

ECPGuiTheme Dragengine.Scenery.ECBehaviorRenderableDesktop.getGuiTheme ( )

Gui Theme to use for Desktop.

◆ getRenderable()

ECPString Dragengine.Scenery.ECBehaviorRenderableDesktop.getRenderable ( )

Name of renderable to create or empty string if not used.

◆ getRenderableSolidity()

ECPString Dragengine.Scenery.ECBehaviorRenderableDesktop.getRenderableSolidity ( )

Name of solidity renderable to create or empty string if not used.

If not empty the solidity renderable is set to contain the transparency of the regular renderable converted to grayscale image. This can be used to create HUD displays or holographic displays where content is fully or partially transparent.

◆ getSize()

ECPPoint Dragengine.Scenery.ECBehaviorRenderableDesktop.getSize ( )

Size of canvas.

◆ new() [1/5]

ECBehaviorRenderableDesktop Dragengine.Scenery.ECBehaviorRenderableDesktop.new ( BehaviorElementClass  eclass,
ECBehaviorDynamicSkin  dynamicSkin 
)

Create behavior element class.

◆ new() [2/5]

ECBehaviorRenderableDesktop Dragengine.Scenery.ECBehaviorRenderableDesktop.new ( BehaviorElementClass  eclass,
ECBehaviorDynamicSkin  dynamicSkin,
Loaders  loaders 
)

◆ new() [3/5]

ECBehaviorRenderableDesktop Dragengine.Scenery.ECBehaviorRenderableDesktop.new ( BehaviorElementClass  eclass,
ECBehaviorDynamicSkin  dynamicSkin,
Loaders  loaders,
String  id 
)

◆ new() [4/5]

ECBehaviorRenderableDesktop Dragengine.Scenery.ECBehaviorRenderableDesktop.new ( BehaviorElementClass  eclass,
ECBehaviorDynamicSkin  dynamicSkin,
Loaders  loaders,
String  id,
String  prefix 
)

◆ new() [5/5]

ECBehaviorRenderableDesktop Dragengine.Scenery.ECBehaviorRenderableDesktop.new ( BehaviorElementClass  eclass,
ECBehaviorDynamicSkin  dynamicSkin,
String  id 
)

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