Drag[en]gine Script Module DragonScript 1.32.1
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.
 
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

bool pAnchorAdded
 
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".

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.
See also
https://developer.dragondreams.ch/wiki/doku.php/dragengine:modules:dragonscript:behavior_attachable_anchorelement

Member Function Documentation

◆ addToGameWorld()

void Dragengine.Scenery.ECABehaviorAnchorElement.addToGameWorld ( )

◆ getAnchorID()

StringID Dragengine.Scenery.ECABehaviorAnchorElement.getAnchorID ( )

Anchor name or null to not anchor.

◆ new()

ECABehaviorAnchorElement Dragengine.Scenery.ECABehaviorAnchorElement.new ( )

Create behavior.

Reimplemented from Dragengine.Scenery.DefaultECAttachableBehavior.

◆ onAddToElement()

void Dragengine.Scenery.ECABehaviorAnchorElement.onAddToElement ( )

Behavior has been added to element.

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

  • BehaviorElement::addAttachableBehavior()
  • BehaviorElement::readFromFile()

Reimplemented from Dragengine.Scenery.DefaultECAttachableBehavior.

◆ onRemoveFromElement()

void Dragengine.Scenery.ECABehaviorAnchorElement.onRemoveFromElement ( )

Behavior has been removed from element.

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

  • BehaviorElement::removeAttachableBehavior()

Reimplemented from Dragengine.Scenery.DefaultECAttachableBehavior.

◆ removeFromGameWorld()

void Dragengine.Scenery.ECABehaviorAnchorElement.removeFromGameWorld ( )

Member Data Documentation

◆ FACTORY_NAME

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

Factory name.

◆ pAnchorAdded

bool Dragengine.Scenery.ECABehaviorAnchorElement.pAnchorAdded

◆ pAnchorID

StringID Dragengine.Scenery.ECABehaviorAnchorElement.pAnchorID

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