Drag[en]gine Script Module DragonScript
1.23
|
Behavior element behavior adding a renderable Desktop widget. More...
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... | |
Behavior element behavior adding a renderable Desktop widget.
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.
Element class properties have the prefix "renderableDesktop{(id)}.".
This behavior does not require the element class to be persistable (setPersistable).
void Dragengine.Scenery.ECBehaviorRenderableDesktop.addContentCreator | ( | Block | blockCreator | ) |
void Dragengine.Scenery.ECBehaviorRenderableDesktop.addContentCreator | ( | ContentCreator | creator | ) |
Add content creator.
void Dragengine.Scenery.ECBehaviorRenderableDesktop.createContent | ( | Instance | instance | ) |
Create content using creators.
void Dragengine.Scenery.ECBehaviorRenderableDesktop.dispose | ( | ) |
Dispose of behavior.
Reimplemented from Dragengine.Scenery.DefaultECBehavior.
void Dragengine.Scenery.ECBehaviorRenderableDesktop.forEachContentCreator | ( | Block | ablock | ) |
Visit content creators with block with argument ContentCreator.
|
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.
ECPString Dragengine.Scenery.ECBehaviorRenderableDesktop.getDesignerSelector | ( | ) |
Designer selector to use for Desktop.
ECBehaviorDynamicSkin Dragengine.Scenery.ECBehaviorRenderableDesktop.getDynamicSkin | ( | ) |
Dynamic skin behavior.
ECPGuiTheme Dragengine.Scenery.ECBehaviorRenderableDesktop.getGuiTheme | ( | ) |
Gui Theme to use for Desktop.
ECPString Dragengine.Scenery.ECBehaviorRenderableDesktop.getRenderable | ( | ) |
Name of renderable to create or empty string if not used.
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.
ECPPoint Dragengine.Scenery.ECBehaviorRenderableDesktop.getSize | ( | ) |
Size of canvas.
ECBehaviorRenderableDesktop Dragengine.Scenery.ECBehaviorRenderableDesktop.new | ( | BehaviorElementClass | eclass, |
ECBehaviorDynamicSkin | dynamicSkin | ||
) |
Create behavior element class.
ECBehaviorRenderableDesktop Dragengine.Scenery.ECBehaviorRenderableDesktop.new | ( | BehaviorElementClass | eclass, |
ECBehaviorDynamicSkin | dynamicSkin, | ||
Loaders | loaders | ||
) |
ECBehaviorRenderableDesktop Dragengine.Scenery.ECBehaviorRenderableDesktop.new | ( | BehaviorElementClass | eclass, |
ECBehaviorDynamicSkin | dynamicSkin, | ||
Loaders | loaders, | ||
String | id | ||
) |
ECBehaviorRenderableDesktop Dragengine.Scenery.ECBehaviorRenderableDesktop.new | ( | BehaviorElementClass | eclass, |
ECBehaviorDynamicSkin | dynamicSkin, | ||
Loaders | loaders, | ||
String | id, | ||
String | prefix | ||
) |
ECBehaviorRenderableDesktop Dragengine.Scenery.ECBehaviorRenderableDesktop.new | ( | BehaviorElementClass | eclass, |
ECBehaviorDynamicSkin | dynamicSkin, | ||
String | id | ||
) |