Drag[en]gine Script Module DragonScript 1.35
Loading...
Searching...
No Matches
Dragengine.Scenery.ECABehaviorAnchorElement Class Reference

Attachable behavior element behavior adding anchor element support. More...

Inheritance diagram for Dragengine.Scenery.ECABehaviorAnchorElement:
Dragengine.Scenery.DefaultECAttachableBehavior

Classes

class  Factory
 Behavior factory. More...

Public Member Functions

void addToGameWorld ()
StringID getAnchorID ()
 Anchor name or null to not anchor.
StringID getGroupID ()
 Anchor group ID or null to not anchor.
ECABehaviorAnchorElement new ()
 Create behavior.
void onAddToElement ()
 Behavior has been added to element.
void onRemoveFromElement ()
 Behavior has been removed from element.
void removeFromGameWorld ()
Public Member Functions inherited from Dragengine.Scenery.DefaultECAttachableBehavior
void attachToParent (Element parent)
void dispose ()
void enterFrame ()
void geometryChanged ()
BehaviorElement getElement ()
String persistencyFactoryName ()
void postThink (float elapsed)
bool requiresEnterFrame ()
bool requiresThink ()
void safeDispose ()
 Remove from element if present then call dispose().
void setElement (BehaviorElement element)
void stateChanged ()
void think (float elapsed)
void writeObjectToFile (PersistencyEnvironment env, FileWriter writer)

Public Attributes

StringID pAnchorID
Public Attributes inherited from Dragengine.Scenery.DefaultECAttachableBehavior
BehaviorElement pElement
bool pRequiresEnterFrame
bool pRequiresThink

Static Public Attributes

static final String FACTORY_NAME = "ECABehaviorAnchorElement"
 Factory name.

Additional Inherited Members

Protected Member Functions inherited from Dragengine.Scenery.DefaultECAttachableBehavior
void setRequiresEnterFrame (bool required)
 Set if behavior instance requires enterFrame() to be called.
void setRequiresThink (bool required)
 Set if behavior instance requires think() and postThink() to be called.

Detailed Description

Attachable behavior element behavior adding anchor element support.

Version
1.31

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.

Element class property has name "anchorID" and "anchorGroupID".

This element behavior can be present only once in a BehaviorElement. Trying to add more than one instance results in an exception thrown.

This behavior does not require the element class to be persistable (setPersistable).

This behavior is similar to ECBehaviorAnchorElement but can be attached if required. This is especially useful in editing worlds to add an anchor to any element without needing to add ECBehaviorAnchorElement to the element class itself.

Upon adding behavior to element these properties are evaluated if present:

  • "anchorID" (string): anchor name to use. If not present the element is not anchored.
  • "anchorGroupID" (string): anchor group name to use. If not present the element is not added to any group.
See also
https://developer.dragondreams.ch/wiki/doku.php/dragengine:modules:dragonscript:behavior_attachable_anchorelement

Member Function Documentation

◆ addToGameWorld()

void Dragengine.Scenery.ECABehaviorAnchorElement.addToGameWorld ( )

Reimplemented from Dragengine.Scenery.DefaultECAttachableBehavior.

References new().

Referenced by removeFromGameWorld().

◆ getAnchorID()

StringID Dragengine.Scenery.ECABehaviorAnchorElement.getAnchorID ( )

Anchor name or null to not anchor.

References Dragengine.Scenery.DefaultECAttachableBehavior.getElement(), new(), onAddToElement(), and pAnchorID.

Referenced by removeFromGameWorld().

◆ getGroupID()

StringID Dragengine.Scenery.ECABehaviorAnchorElement.getGroupID ( )

Anchor group ID or null to not anchor.

Version
1.35

Referenced by removeFromGameWorld().

◆ new()

ECABehaviorAnchorElement Dragengine.Scenery.ECABehaviorAnchorElement.new ( )

Create behavior.

Reimplemented from Dragengine.Scenery.DefaultECAttachableBehavior.

References pAnchorID.

Referenced by addToGameWorld(), getAnchorID(), and onRemoveFromElement().

◆ onAddToElement()

void Dragengine.Scenery.ECABehaviorAnchorElement.onAddToElement ( )

Behavior has been added to element.

Called by setElement() after element has been set in these situations:

Reimplemented from Dragengine.Scenery.DefaultECAttachableBehavior.

Referenced by getAnchorID().

◆ onRemoveFromElement()

void Dragengine.Scenery.ECABehaviorAnchorElement.onRemoveFromElement ( )

Behavior has been removed from element.

Called by setElement() before element is set to null in these situations:

Reimplemented from Dragengine.Scenery.DefaultECAttachableBehavior.

References new().

Referenced by removeFromGameWorld().

◆ removeFromGameWorld()

Member Data Documentation

◆ FACTORY_NAME

final String Dragengine.Scenery.ECABehaviorAnchorElement.FACTORY_NAME = "ECABehaviorAnchorElement"
static

◆ pAnchorID

StringID Dragengine.Scenery.ECABehaviorAnchorElement.pAnchorID

The documentation for this class was generated from the following file: