Drag[en]gine Script Module DragonScript
1.23
|
Behavior element behavior adding touch sensor support. More...
Classes | |
class | BlockListenerFactory |
Factory creating listeners using block. More... | |
class | BooleanListener |
Implementation of behavior instance listener using BooleanBehaviorListener. More... | |
class | DefaultListener |
Default implementation of behavior instance listener. More... | |
class | Instance |
Behavior instance. More... | |
interface | Listener |
Listener for behavior instance events. More... | |
interface | ListenerFactory |
Factory creating listeners. More... | |
Additional Inherited Members | |
Public Member Functions inherited from Dragengine.Scenery.DefaultECBehavior | |
void | assignInstanceIndex (int instanceIndex) |
Assign instance index. More... | |
void | dispose () |
Dispose of behavior. More... | |
String | getBehaviorID () |
Unique identifier of behavior. More... | |
String | getID () |
Identifier. More... | |
int | getInstanceIndex () |
Instance index. More... | |
void | loadSupportedData (String identifier, PersistencyEnvironment env, FileReader reader, ECBehaviorInstance instance) |
Load instance data of another behavior. More... | |
bool | supportsBehaviorID (String identifier) |
Behavior supports loading instance data of another behavior. More... | |
Public Member Functions inherited from Dragengine.Scenery.ECBehavior | |
ECBehaviorInstance | createInstance (BehaviorElement element) |
Create Behavior instance. More... | |
Protected Member Functions inherited from Dragengine.Scenery.DefaultECBehavior | |
DefaultECBehavior | new (BehaviorElementClass eclass) |
Create default composeable behavior with empty identifier. More... | |
DefaultECBehavior | new (BehaviorElementClass eclass, String id) |
Create default composeable behavior. More... | |
void | setBehaviorID (String identifier) |
Set behavior identifier. More... | |
void | useClassNameAsBehaviorID () |
Set behavior identifier to "<class-name>:<identifier>". More... | |
void | useFullyQualifiedClassNameAsBehaviorID () |
Set behavior identifier to "<fully-qualified-class-name>:<identifier>". More... | |
Behavior element behavior adding touch sensor support.
Attaches a TouchSensor resource to the behavior element. By default the collision filter category is set to BaseGameApp.CollisionFilterBit.trigger and the collision filter mask is set to BaseGameApp.CollisionFilterBit.actorAI . This causes actors to trigger this touch sensor unless they have the CollisionFilterBit.trigger bit cleared. Modify the collision filter to allow other elements to trigger this touch sensor.
Upon being touched the touch sensor notifies the listeners as well as setting a trigger target in case a trigger table is present and the user set a trigger target name,
The TouchSensor resource can be queried for the colliders currently touching it. Furthermore colliders entering and leaving trigger a notification allowing elements to track elements of interest.
If the ECBehaviorCollider behavior is present in the behavior element the TouchSensor is attached to the collider.
The behavior retrieves the owner of colliders inside the touch sensor. If these owners are elements they are stored in a list of elements touched by the owner element. This list is updated when elements enter or leave the touch sensor.
The owner behavior element as well as other ECBehavior subclasses can add a listener to be notified if elements enter and exit the touch sensor.
This element behavior can be present multiple times in a BehaviorElement. In this case use a unique identifier to distinguish the individual touch sensors.
Element class properties have the prefix "touchSensor{(identifier)}.".
This behavior does require the element class to be persistable (setPersistable).