Start Page » DEMoCap: Drag[en]gine Motion Capture » XML Element Classes » ECBDesktopLanguageChanged
Behavior calling onTranslationChanged on ECBehaviorRenderableDesktop if language changed global event is send.
This behavior can be used only once on an element.
Element class properties have the prefix desktopLanguageChanged.
.
This behavior has no events.
This behavior adds no conversation commands.
This behavior adds no conversation conditions.
This behavior adds no behavior tree actions.
This behavior adds no behavior tree conditions.
This behavior does not support optional behaviors.
Since DEMoCap Version 1.3
Give an example. Has to include at least all behavior dependencies so it should at least prodduce a valid element class.
class MyElement extends BehaviorElementClass public var ECBehaviorComponent component public var ECBehaviorCollider collider public var ECBehaviorDynamicSkin dynamicSkin public var ECBehaviorRenderableDesktop renderableDesktop public var ECBDesktopLanguageChanged desktopLanguageChanged public func new() super("ExampleElement") // add required behaviors component and collider component = ECBehaviorComponent.new(this) collider = ECBehaviorCollider.new(this, component) // add dynamic skin to modify component dynamicSkin = ECBehaviorDynamicSkin.new(this, component) // create renderable desktop. the skin has to use a renderable named "board". // the panel has a size of 1024x1024 and uses gui theme loaded from "adboard.guitheme.xml". // the desktop uses by default a stack layout hence all widgets added fill the // entire desktop space and are layered ontop of each other. any behavior can // change the layout used for the desktop if required renderableDesktop = ECBehaviorRenderableDesktop.new(this, dynamicSkin) renderableDesktop.getRenderable().setValue("board") renderableDesktop.getSize().setPoint(Point.new(512, 256)) renderableDesktop.getGuiTheme().setPath("/content/ui/adboard.guitheme.xml") // here you could now add behaviors adding content to the renderable. // the simply have to create (during their init(StubElement) call) one or more widgets // adding them to the renderable. using behavior makes this a reusable process // // MyContentBehavior.new(this, renderableDesktop) // update translations if language setting changed desktopLanguageChanged = ECBDesktopLanguageChanged.new(this, renderableDesktop) end end
Using element class supporting adding behaviors the behavior can be added like this (again create an example which creates a valid element class):
<?xml version='1.0' encoding='UTF-8'?> <elementClass name='MyClass' class='GenericBehaviorElement'> <behavior type='ECBehaviorComponent'/> <behavior type='ECBehaviorCollider'/> <behavior type='ECBehaviorDynamicSkin'/> <behavior type='ECBehaviorRenderableDesktop'> <string name='.renderable'>display</string> </behavior> <behavior type='ECBDesktopLanguageChanged'/> </elementClass>