{{tag>dragonscript behavior}}
[[:start|Start Page]] >> [[main|DragonScript Scripting Language]] >> [[dragengine:modules:dragonscript:abstractions|Abstraction Layers: How you want to build your Game]] >> [[dragengine:modules:dragonscript:behavior_elements|Behavior Elements]] >> **ECBehaviorDynamicSkin**
* [[behaviors_use_cases|Behaviors Explained: By Use-Case]]
* [[behaviors_a_to_z|Behaviors Explained: From A to Z]]
See also:
* [[gamedev:renderables|Dynamic Content using Renderables]]
* [[gamedev:deigde:editors:skin|IGDE Skin Editor]]
====== ECBehaviorDynamicSkin ======
Behavior element behavior adding dynamic skin support.
Dynamic skins are used to alter the visual appearance of [[behavior_component|ECBehaviorComponent]]. Dynamic skins affect the skin assigned to the [[behavior_component|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.
====== Instance Counts ======
Multiple ECBehaviorDynamicSkin can be added targeting different [[behavior_component|ECBehaviorComponent]] using their identifier. It is not possible to add multiple ECBehaviorDynamicSkin targeting the same [[behavior_component|ECBehaviorComponent]].
====== Element Class Properties ======
Element class properties have the prefix ''dynamicSkin.'' or ''dynamicSkin({id}).'' if id is not empty.
====== Events ======
This behavior has no events.
====== Required Behaviors ======
* [[behavior_component|ECBehaviorComponent]]
====== Optional Behaviors ======
This behavior does not support optional behaviors.
====== Persistency ======
This behavior does not required element class to be persistable (setPersistable).
====== API Documentation ======
#@LinkApiDocDEDS2_HTML~classDragengine_1_1Scenery_1_1ECBehaviorDynamicSkin.html,ECBehaviorDynamicSkin~@#.
Since DragonScript Module Version ''1.0''
====== Use Cases ======
* Add dynamic skin other behaviors or game scripts can modify to show dynamic content on components.
====== Element Class Example ======
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
====== Behavior Factory ======
Using element class supporting adding behaviors the behavior can be added like this:
second
value
====== Live Examples ======
* [[https://github.com/LordOfDragons/deexamples|DEExamples Repository]]