This is an old revision of the document!
Start Page » DragonScript Scripting Language » Behavior Elements: Quick and Easy Development » ECBehaviorDynamicSkin
See also:
Behavior element behavior adding dynamic skin support.
Dynamic skins are used to alter the visual appearance of ECBehaviorComponent. Dynamic skins affect the skin assigned to the ECBehaviorComponent.
This behavior provides the dynamic skin for the component. Other behaviors add renderables to them to provide their functionality. Multiple behaviors should not target the same named renderable unless they are crafted in a specific way to not interfere with each other.
Multiple ECBehaviorDynamicSkin can be added targeting different ECBehaviorComponent using their identifier. It is not possible to add multiple ECBehaviorDynamicSkin targeting the same ECBehaviorComponent.
Element class properties have the prefix dynamicSkin.
or dynamicSkin({id}).
if id is not empty.
This behavior has no events.
This behavior requires these other behaviors:
This behavior does not support optional behaviors.
This behavior does not required element class to be persistable (setPersistable).
Since DragonScript Module Version 1.0
This example defines an element which a dynamic skin.
class MyElement extends BehaviorElementClass public var ECBehaviorComponent component public var ECBehaviorDynamicSkin dynamicSkin func new() component = ECBehaviorComponent.new(this, null) dynamicSkin = ECBehaviorDynamicSkin.new(this, component) end end
Using element class supporting adding behaviors the behavior can be added like this:
<?xml version='1.0' encoding='UTF-8'?> <elementClass name='MyClass' class='GenericBehaviorElement'> <behavior type='ECBehaviorComponent'/> <behavior type='ECBehaviorDynamicSkin'> <!-- optional: use component with id instead of empty string --> <string name='component'>second</string> <!-- set element properties. omit property prefix if used inside behavior tag --> <string name='.name'>value</string> </behavior> <!-- for adding multiple behaviors use unique identifiers --> <behavior type='ECBehaviorDynamicSkin' id='second'/> </elementClass>