User Tools

Site Tools


democap:behavior_ecbcustomcolor

ECBCustomColor

Behavior extending ECBehaviorCustomColor to allow user to edit certain parameters using a gui panel.

See also:

Instance Counts

This element behavior can be present multiple times in a BehaviorElement. In this case use a unique identifier to distinguish the individual behavior instances.

Element Class Properties

Element class properties have the prefix customColor. or customColor({id}). if id is not empty.

Events

This behavior has no events.

Conversation Commands

This behavior adds no conversation commands.

Conversation Conditions

This behavior adds no conversation conditions.

Behavior Tree Actions

This behavior adds no behavior tree actions.

Behavior Tree Conditions

This behavior adds no behavior tree conditions.

Required Behaviors

Optional Behaviors

This behavior does not support optional behaviors.

API Documentation

Since DEMoCap Version 1.3

Use Cases

  • Allow editing certain parameters in a gui panel.

Element Class Example

class MyElement extends BehaviorElementClass
  public var ECBehaviorCustomColor customColor
  func new()
    customColor = ECBehaviorCustomColor.new(this, "color1", "Color 1", Color.blue)
  end
end

Behavior Factory

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='ECBehaviorCustomColor'>
    <!-- set element properties. omit property prefix if used inside behavior tag -->
    <string name='.name'>Color 1</string>
  </behavior>
 
  <behavior type='ECBCustomColor'>
    <!-- optional: use custom color with id instead of empty string -->
    <string name='customColor'>second</string>
  </behavior>
 
  <!-- for adding multiple behaviors use unique identifiers -->
  <behavior type='ECBCustomColor' id='second'/>
</elementClass>

Live Examples

You could leave a comment if you were logged in.
democap/behavior_ecbcustomcolor.txt · Last modified: 2025/03/22 17:29 by dragonlord