Drag[en]gine Script Module DragonScript  1.23
Dragengine.Scenery.ECBehaviorRenderablePanel Class Reference

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

Inheritance diagram for Dragengine.Scenery.ECBehaviorRenderablePanel:
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  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 Panel. More...
 
ECBehaviorDynamicSkin getDynamicSkin ()
 Dynamic skin behavior. More...
 
ECPGuiTheme getGuiTheme ()
 Gui Theme to use for Panel. 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...
 
ECBehaviorRenderablePanel new (BehaviorElementClass eclass, ECBehaviorDynamicSkin dynamicSkin)
 Create behavior element class. More...
 
ECBehaviorRenderablePanel new (BehaviorElementClass eclass, ECBehaviorDynamicSkin dynamicSkin, Loaders loaders)
 
ECBehaviorRenderablePanel new (BehaviorElementClass eclass, ECBehaviorDynamicSkin dynamicSkin, Loaders loaders, String id)
 
ECBehaviorRenderablePanel new (BehaviorElementClass eclass, ECBehaviorDynamicSkin dynamicSkin, Loaders loaders, String id, String prefix)
 
ECBehaviorRenderablePanel 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 ECBehaviorRenderablePanel 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 Panel widget.

This behavior is useful for models with a complex dynamic texture where the content of the texture is provided by a Panel widget. Multiple other behaviors can add their content Widget to the Panel separating logic for reuse. Using ECBehaviorRenderablePanel instead of ECBehaviorRenderableCanvas 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.guitheme.xml". The default Panel designer selector is "RenderablePanel".

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

The Panel is created with a default size of 512x512 . You can change the size using the element property to fit the texture requirements.

Multiple ECBehaviorRenderablePanel 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 individiaully filled with content by different behaviors.

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

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

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

Version 1.7

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 partiall transparent content.

Member Function Documentation

◆ addContentCreator() [1/2]

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

Add content creator using block.

Version
1.9

Block receives as parameter Instance.

◆ addContentCreator() [2/2]

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

Add content creator.

Version
1.9

◆ createContent()

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

Create content using creators.

Version
1.9

◆ dispose()

void Dragengine.Scenery.ECBehaviorRenderablePanel.dispose ( )

Dispose of behavior.

Reimplemented from Dragengine.Scenery.DefaultECBehavior.

◆ forEachContentCreator()

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

Visit content creators with block with argument ContentCreator.

Version
1.9

◆ getBehaviorIn()

static ECBehaviorRenderablePanel Dragengine.Scenery.ECBehaviorRenderablePanel.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.ECBehaviorRenderablePanel.getDesignerSelector ( )

Designer selector to use for Panel.

◆ getDynamicSkin()

ECBehaviorDynamicSkin Dragengine.Scenery.ECBehaviorRenderablePanel.getDynamicSkin ( )

Dynamic skin behavior.

◆ getGuiTheme()

ECPGuiTheme Dragengine.Scenery.ECBehaviorRenderablePanel.getGuiTheme ( )

Gui Theme to use for Panel.

◆ getRenderable()

ECPString Dragengine.Scenery.ECBehaviorRenderablePanel.getRenderable ( )

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

◆ getRenderableSolidity()

ECPString Dragengine.Scenery.ECBehaviorRenderablePanel.getRenderableSolidity ( )

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

Version
1.7

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

Size of canvas.

◆ new() [1/5]

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

Create behavior element class.

◆ new() [2/5]

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

◆ new() [3/5]

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

◆ new() [4/5]

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

◆ new() [5/5]

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

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