Table of Contents

,

Start Page » DragonScript Scripting Language » Abstraction Layers: How you want to build your Game » Behavior Elements » ECBehaviorAnchorElement

ECBehaviorAnchorElement

Behavior element behavior adding anchor element support.

Anchoring elements allows to locate elements in a GameWorld using a unique name set by the mapper. This is useful for game commands send by conversations scripts.

Instance Counts

This behavior can be used only once on an element.

Element Class Properties

Element class properties have no prefix.

anchorID

Sets the anchor name or empty string to not anchor.

Events

This behavior has no events

Required Behaviors

This behavior requires no other behaviors.

Optional Behaviors

This behavior does not support optional behaviors.

Persistency

This behavior does not require persistency.

API Documentation

ECBehaviorAnchorElement.

Since DragonScript Module Version 1.0

Use Cases

Element Class Example

This example defines an element for which the user can set the anchor name in the world editor. He can then locate the element in the parent GameWorld using this anchor name.

class MyElement extends BehaviorElementClass
  public func new()
    ECBehaviorAnchorElement.new(this)
  end
end

Behavior Factory

Using element class supporting adding behaviors the behavior can be added like this:

<?xml version='1.0' encoding='UTF-8'?>
<elementClass name='MyClass' class='GenericBehaviorElement'>
   <behavior type='ECBehaviorAnchorElement'/>
</elementClass>

Live Examples