Drag[en]gine Script Module DragonScript
1.21
|
Behavior element behavior adding component support. More...
Classes | |
class | Instance |
Behavior instance. More... | |
Public Member Functions | |
void | addTextureReplacement (String name, String pathSkin) |
Helper method to quickly add a texture replacement. More... | |
void | addTextureReplacement (String name, String pathSkin, Color tint) |
void | addTextureReplacement (String name, String pathSkin, Vector2 tcScale) |
void | addTextureReplacement (String name, String pathSkin, Vector2 tcScale, Color tint) |
void | dispose () |
Dispose of behavior. More... | |
ECBehaviorCollider | getCollider () |
Collider behavior. More... | |
ECComposeComponent | getComponent () |
Composeable component for element class. More... | |
Instance | instance (BehaviorElement element) |
Get instance in element from owner element class. More... | |
ECBehaviorComponent | new (BehaviorElementClass eclass, ECBehaviorCollider collider) |
Create behavior element class. More... | |
ECBehaviorComponent | new (BehaviorElementClass eclass, ECBehaviorCollider collider, String id) |
ECBehaviorComponent | new (BehaviorElementClass eclass, ECBehaviorCollider collider, String id, String prefix) |
void | setAllPath (String directory, String model, String skin, String rig, String occlusionMesh, String audioModel) |
Helper method to quickly set model, skin, rig, occlusion mesh and audio model path located in the same directory. More... | |
void | setAllPath (String model, String skin, String rig, String occlusionMesh, String audioModel) |
Helper method to quickly set model, skin, rig, occlusion mesh and audio model path. More... | |
void | setCommonPath (String directory, String model, String skin, String rig) |
Helper method to quickly set model, skin and rig path located in the same directory. More... | |
void | setCommonPath (String model, String skin, String rig) |
Helper method to quickly set model, skin and rig path. More... | |
Public Member Functions inherited from Dragengine.Scenery.DefaultECBehavior | |
void | assignInstanceIndex (int instanceIndex) |
Assign instance index. 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... | |
Static Public Member Functions | |
static ECBehaviorComponent | getBehaviorIn (BehaviorElementClass eclass) |
Get behavior in element class or null if absent. More... | |
Protected Member Functions | |
ECPTextureReplacementList | createTextureReplacements (String propertyName) |
Create texture replacements property. 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 component support.
Components provide visual appearance to elements. This behavior can be added multiple times to an element. Each instance creates one component attached to the element collider which can be individually modified. To distinguish the components each instance has an identifier which can be used to retrieve a specific instance. The identifier is also used as prefix for element class properties and stub properties if not empty. Hence to use more than one component use code like this in your subclass constructor:
You can now define the model to use for both components using the properties "model" for the first component and "subComponent.model" for the second component.
If the ECBehaviorCollider behavior is present in the behavior element before this behavior is added the component is statically attached. In this case the collider is a ColliderVolume and the rig assigned to the component is only used for animation purpose.
If the ECBehaviorCollider behavior is added after this behavior then a ColliderComponent is created. In this case the component is implicitly attached by ECBehaviorCollider and the component rig is used for collision detection. This is required if you intend to use per-bone collisions matching animation state or physical simulations like rag-dolls.
Hence these two use cases are possible depending on the order the behaviors are added:
Component is only visual. For collision only static collision shape is used. The component is attached statically to the collider and does not collide. If collider is dynamic physics simulation will be done using collision shape only.
Component is used for collision detection. If collider is dynamic component bones will be updated by the collider automatically.
Element class properties have the prefix "component{(id)}.".
This behavior does not require the element class to be persistable (setPersistable).
void Dragengine.Scenery.ECBehaviorComponent.addTextureReplacement | ( | String | name, |
String | pathSkin | ||
) |
Helper method to quickly add a texture replacement.
Replaces calls like this:
void Dragengine.Scenery.ECBehaviorComponent.addTextureReplacement | ( | String | name, |
String | pathSkin, | ||
Color | tint | ||
) |
void Dragengine.Scenery.ECBehaviorComponent.addTextureReplacement | ( | String | name, |
String | pathSkin, | ||
Vector2 | tcScale | ||
) |
void Dragengine.Scenery.ECBehaviorComponent.addTextureReplacement | ( | String | name, |
String | pathSkin, | ||
Vector2 | tcScale, | ||
Color | tint | ||
) |
|
protected |
Create texture replacements property.
void Dragengine.Scenery.ECBehaviorComponent.dispose | ( | ) |
Dispose of behavior.
Reimplemented from Dragengine.Scenery.DefaultECBehavior.
|
static |
Get behavior in element class or null if absent.
Use this method to check if a particular BehaviorElementClass contains a behavior of type ECBehaviorCollider.
ECBehaviorCollider Dragengine.Scenery.ECBehaviorComponent.getCollider | ( | ) |
Collider behavior.
ECComposeComponent Dragengine.Scenery.ECBehaviorComponent.getComponent | ( | ) |
Composeable component for element class.
Instance Dragengine.Scenery.ECBehaviorComponent.instance | ( | BehaviorElement | element | ) |
Get instance in element from owner element class.
ECBehaviorComponent Dragengine.Scenery.ECBehaviorComponent.new | ( | BehaviorElementClass | eclass, |
ECBehaviorCollider | collider | ||
) |
Create behavior element class.
These values are optional and can be null: collider.
ECBehaviorComponent Dragengine.Scenery.ECBehaviorComponent.new | ( | BehaviorElementClass | eclass, |
ECBehaviorCollider | collider, | ||
String | id | ||
) |
ECBehaviorComponent Dragengine.Scenery.ECBehaviorComponent.new | ( | BehaviorElementClass | eclass, |
ECBehaviorCollider | collider, | ||
String | id, | ||
String | prefix | ||
) |
void Dragengine.Scenery.ECBehaviorComponent.setAllPath | ( | String | directory, |
String | model, | ||
String | skin, | ||
String | rig, | ||
String | occlusionMesh, | ||
String | audioModel | ||
) |
Helper method to quickly set model, skin, rig, occlusion mesh and audio model path located in the same directory.
directory is not required to end with a slash. model, skin, rig, occlusionMesh and audioModel can be relative or absolute path. If absolute directory is not used.
Set path will be:
If model, skin, rig, occlusionMesh or audioModel are null the respective path is not set.
void Dragengine.Scenery.ECBehaviorComponent.setAllPath | ( | String | model, |
String | skin, | ||
String | rig, | ||
String | occlusionMesh, | ||
String | audioModel | ||
) |
Helper method to quickly set model, skin, rig, occlusion mesh and audio model path.
If model, skin, rig, occlusionMesh or audioModel are null the respective path is not set.
void Dragengine.Scenery.ECBehaviorComponent.setCommonPath | ( | String | directory, |
String | model, | ||
String | skin, | ||
String | rig | ||
) |
Helper method to quickly set model, skin and rig path located in the same directory.
directory is not required to end with a slash. model, skin and rig can be relative or absolute path. If absolute directory is not used.
Set path will be:
If model, skin or rig are null the respective path is not set.
void Dragengine.Scenery.ECBehaviorComponent.setCommonPath | ( | String | model, |
String | skin, | ||
String | rig | ||
) |
Helper method to quickly set model, skin and rig path.
If model, skin or rig are null the respective path is not set.