This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
dragengine:modules:dragonscript:behavior_customcolor [2025/03/09 18:12] – [allowedColors] dragonlord | dragengine:modules:dragonscript:behavior_customcolor [2025/03/13 17:05] (current) – dragonlord | ||
---|---|---|---|
Line 1: | Line 1: | ||
{{tag> | {{tag> | ||
<WRAP youarehere> | <WRAP youarehere> | ||
- | [[: | + | [[: |
</ | </ | ||
Line 71: | Line 71: | ||
* Example (*.deeclass) <code xml>< | * Example (*.deeclass) <code xml>< | ||
- | ===== Events ===== | + | ====== Events |
Since this behavior provides no support to apply the chosen color listening is used. Behaviors knowing how to apply the color add a listener and are notified if the color changes. These events can be received: | Since this behavior provides no support to apply the chosen color listening is used. Behaviors knowing how to apply the color add a listener and are notified if the color changes. These events can be received: | ||
- | ==== colorChanged ==== | + | ===== colorChanged |
Selected color changed. Use behavior to get the newly set color. | Selected color changed. Use behavior to get the newly set color. | ||
Line 113: | Line 113: | ||
end | end | ||
end | end | ||
+ | </ | ||
+ | |||
+ | ====== Behavior Factory ====== | ||
+ | |||
+ | Using element class supporting adding behaviors the behavior can be added like this: | ||
+ | <code xml> | ||
+ | <?xml version=' | ||
+ | < | ||
+ | < | ||
+ | <!-- set element properties. omit property prefix if used inside behavior tag --> | ||
+ | <string name=' | ||
+ | </ | ||
+ | | ||
+ | <!-- for adding multiple behaviors use unique identifiers --> | ||
+ | < | ||
+ | </ | ||
</ | </ | ||