{{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]] >> **ECBehaviorDecal**
* [[behaviors_use_cases|Behaviors Explained: By Use-Case]]
* [[behaviors_a_to_z|Behaviors Explained: From A to Z]]
====== ECBehaviorDecal ======
Behavior element behavior adding decal projected onto [[behavior_component|ECBehaviorComponent]].
====== Instance Counts ======
This behavior can be used multiple times on an element to add multiple decals to mainpulate. Use the behavior identifier to tell them apart.
====== Element Class Properties ======
Element class properties have the prefix ''decal.'' or ''decal({id}).'' if id is not empty.
===== position =====
Set position relative to component to project decal from.
* Full name: ''decal.position'' or ''decal({id}).position''
* Type: 3-component float vector
* Default Value: (0,0,0)
* Example (*.deeclass)
===== orientation =====
Set orientation relative to component to project decal from.
* Full name: ''decal.orientation'' or ''decal({id}).orientation''
* Type: 3-component float vector
* Default Value: (0,0,0)
* Example (*.deeclass)
===== size =====
Set size of decal to project. The X and Y coordinates are the size of the decal. The Z coordinate is the projection distance. The decal does not apply beyond this distance.
* Full name: ''decal.size'' or ''decal({id}).size''
* Type: 3-component float vector
* Default Value: (0.1,0.1,0.1)
* Example (*.deeclass)
===== skin =====
Set path of skin resource to use.
* Full name: ''decal.skin'' or ''decal({id}).skin''
* Type: string
* Default Value: empty string
* Expected File Type: ''*.deskin''
* Example (*.deeclass) box.deskin
====== Events ======
This behavior has no events.
====== Required Behaviors ======
* [[behavior_component|ECBehaviorComponent]]: Component to attach decal to.
====== Optional Behaviors ======
This behavior does not support optional behaviors.
====== Persistency ======
This behavior does not require the element class to be persistable (setPersistable).
====== API Documentation ======
#@LinkApiDocDEDS2_HTML~classDragengine_1_1Scenery_1_1ECBehaviorDecal.html,ECBehaviorDecal~@#.
Since DragonScript Module Version ''1.0''
====== Use Cases ======
* Add decal to component.
====== Element Class Example ======
This example defines an element which adds a decal to the component.
class MyElement extends BehaviorElementClass
public var ECBehaviorComponent component
public var ECBehaviorDecal decal
func new()
// add component to add decal to
component = ECBehaviorComponent.new(this)
// add decal. it will only show on this component. you can add multiple decals
// to the same component or to different components
decal = ECBehaviorDecal.new(this, component)
decal.getSkin().setPath("/content/decals/mark.deskin")
end
end
====== Behavior Factory ======
Using element class supporting adding behaviors the behavior can be added like this:
mark.deskin
...
====== Live Examples ======
* [[https://github.com/LordOfDragons/deexamples|DEExamples Repository]]