User Tools

Site Tools


democap:behavior_ecbselectable

ECBSelectable

Behavior adding support for element to be selected. Selection tracker is present in the game application. Only one element can be selected at each time or none at all.

It is mandatory to add this behavior otherwise the user can not add an instance of this object to the scene.

Instance Counts

This behavior can be used only once on an element.

Element Class Properties

Element class properties have the prefix selectable..

Events

selected

Object has been selected.

deselected

Object has been deselected.

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

This behavior requires no other behaviors.

Optional Behaviors

This behavior does not support optional behaviors.

API Documentation

Since DEMoCap Version 1.3

Use Cases

  • Allow object to be selected.

Element Class Example

class MyElement extends BehaviorElementClass
  public var ECBSelectable selectable
  func new()
    selectable = ECBSelectable.new(this, component)
  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='ECBSelectable'/>
</elementClass>

Live Examples

You could leave a comment if you were logged in.
democap/behavior_ecbselectable.txt · Last modified: 2025/03/22 19:21 by dragonlord