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

Behavior element behavior adding outline support to components. More...

Inheritance diagram for Dragengine.Scenery.ECBehaviorOutline:
Dragengine.Scenery.DefaultECBehavior Dragengine.Scenery.ECBehavior Dragengine.Scenery.BehaviorCompatiblePersistency

Classes

class  Factory
 Behavior factory. More...
 
class  Instance
 Behavior instance. More...
 

Public Member Functions

void dispose ()
 Dispose of behavior.
 
ECComposeBTSM getBTSMs ()
 Compose behavior trees and state machines.
 
ECBehaviorCollider getCollider ()
 Collider behavior.
 
ECPColor getColor ()
 Color property.
 
ECBehaviorComponent getComponent ()
 Component behavior.
 
ECPFloat getIntensity ()
 Intensity property.
 
ECPModel getModel ()
 Model property.
 
String getPrefix ()
 Prefix.
 
ECPRig getRig ()
 Rig property.
 
ECPSkin getSkin ()
 Skin property.
 
ECPFloat getThickness ()
 THickness property.
 
Instance instance (BehaviorElement element)
 Get instance in element from owner element class.
 
ECBehaviorOutline new (BehaviorElementClass eclass, ECBehaviorComponent component, ECBehaviorCollider collider)
 Create behavior element class.
 
ECBehaviorOutline new (BehaviorElementClass eclass, ECBehaviorComponent component, ECBehaviorCollider collider, String id)
 
- Public Member Functions inherited from Dragengine.Scenery.DefaultECBehavior
void assignInstanceIndex (int instanceIndex)
 Assign instance index.
 
String getBehaviorID ()
 Unique identifier of behavior.
 
String getID ()
 Identifier.
 
int getInstanceIndex ()
 Instance index.
 
void loadSupportedData (String identifier, PersistencyEnvironment env, FileReader reader, ECBehaviorInstance instance)
 Load instance data of another behavior.
 
bool supportsBehaviorID (String identifier)
 Behavior supports loading instance data of another behavior.
 
- Public Member Functions inherited from Dragengine.Scenery.ECBehavior
ECBehaviorInstance createInstance (BehaviorElement element)
 Create Behavior instance.
 

Static Public Member Functions

static ECBehaviorOutline getBehaviorIn (BehaviorElementClass eclass)
 Get behavior in element class or null if absent.
 

Public Attributes

ECComposeBTSM pBTSMs
 
ECBehaviorCollider pCollider
 
ECPColor pColor
 
ECBehaviorComponent pComponent
 
ECPFloat pIntensity
 
ECPModel pModel
 
String pPrefix
 
ECPRig pRig
 
ECPSkin pSkin
 
ECPFloat pThickness
 

Additional Inherited Members

- Protected Member Functions inherited from Dragengine.Scenery.DefaultECBehavior
DefaultECBehavior new (BehaviorElementClass eclass)
 Create default composeable behavior with empty identifier.
 
DefaultECBehavior new (BehaviorElementClass eclass, String id)
 Create default composeable behavior.
 
void setBehaviorID (String identifier)
 Set behavior identifier.
 
void useClassNameAsBehaviorID ()
 Set behavior identifier to "<class-name>:<identifier>".
 
void useFullyQualifiedClassNameAsBehaviorID ()
 Set behavior identifier to "<fully-qualified-class-name>:<identifier>".
 

Detailed Description

Behavior element behavior adding outline support to components.

Renders outline around a component.

This is done by creating a new component resource. The model and rig of the existing component is assigned to the new component. The new component resource is attached to an existing collider using rig attachment mode. This makes the new component deform the same way as the existing component. The new component is thus a kind of "copy" of the existing component.

Then an outline skin is assigned to the new component and all textures it contains. This replaces every texture in the new component with the outline skin.

The outline skin is set by the user. To work properly it has to use the "outline.*" skin texture properties to render the outline and "solidity" with value "0" to hide everything but the outline. A typical outline skin looks like this:

<?xml version='1.0' encoding='UTF-8'?>
<skin>
<texture name='material'>
<value property='solidity'>0</value>
<color property='outline.color' r='0' g='0' b='0' a='1' renderable='color'/>
<value property='outline.thickness' renderable='thickness'>0.005</value>
<value property='outline.thickness.screen'>1</value>
<color property='outline.emissivity' r='0' g='0' b='0' a='1' renderable='color'/>
<value property='outline.emissivity.intensity' renderable='intensity'>4</value>
</texture>
</skin>

By default the skin "/shareddata/materials/outlined.deskin" is used which is provided by the shared DragonScript Module data and provides tintable and emissive outlines.

The emissivity is optional and allows to make the outline glow in the dark. Using renderable "color" is also optional but recommended. This allows this behavior to change the outline color using a dynamic skin.

This set up allows to add an outline skin to any ECBehaviorComponent without the need to create skins with built-in support for outline rendering. If you want to use outline for all objects by default better build it into their skins which is faster.

This behavior can be also used to add outer skins in general to an ECBehaviorComponent. You have to adjust the outline skin to achieve the desired result.

This is an effect type behavior and starts out invisible. Use setVisible() to switch the outline on and off. Typically this is done in response to game events or by other behaviors managing outline parameters.

Multiple instances of ECBehaviorOutline can be used for example to create different outlines to switch on and off or to add multiple outline skins to a single ECBehaviorComponent. Keep in mind though that each instance of ECBehaviorOutline creates a new component and dynamic skin resource which can impact performance if the used model has high polygon count. To use multiple instances use code like this in your subclass constructor:

class MyElement extends BehaviorElementClass
public var ECBehaviorComponent component
public var ECBehaviorCollider collider
func new()
component = ECBehaviorComponent.new(this)
collider = ECBehaviorCollider.new(this, component)
ECBehaviorOutline.new(this, component, collider)
ECBehaviorOutline.new(this, component, collider, "secondOutline")
end
end
Behavior element element class.
Definition BehaviorElementClass.ds:54
Behavior element behavior adding collider support.
Definition ECBehaviorCollider.ds:147
Behavior element behavior adding component support.
Definition ECBehaviorComponent.ds:103
Behavior element behavior adding outline support to components.
Definition ECBehaviorOutline.ds:114

Element class properties have the prefix "outline{(id)}.".

This behavior does support element class to be persistable (setPersistable). Saves color, intensity and visiblity state.

See also
https://developer.dragondreams.ch/wiki/doku.php/dragengine:modules:dragonscript:behavior_outline

Member Function Documentation

◆ dispose()

void Dragengine.Scenery.ECBehaviorOutline.dispose ( )

Dispose of behavior.

Reimplemented from Dragengine.Scenery.DefaultECBehavior.

◆ getBehaviorIn()

static ECBehaviorOutline Dragengine.Scenery.ECBehaviorOutline.getBehaviorIn ( BehaviorElementClass  eclass)
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.

◆ getBTSMs()

ECComposeBTSM Dragengine.Scenery.ECBehaviorOutline.getBTSMs ( )

Compose behavior trees and state machines.

Version
1.26

◆ getCollider()

ECBehaviorCollider Dragengine.Scenery.ECBehaviorOutline.getCollider ( )

Collider behavior.

◆ getColor()

ECPColor Dragengine.Scenery.ECBehaviorOutline.getColor ( )

Color property.

◆ getComponent()

ECBehaviorComponent Dragengine.Scenery.ECBehaviorOutline.getComponent ( )

Component behavior.

◆ getIntensity()

ECPFloat Dragengine.Scenery.ECBehaviorOutline.getIntensity ( )

Intensity property.

◆ getModel()

ECPModel Dragengine.Scenery.ECBehaviorOutline.getModel ( )

Model property.

◆ getPrefix()

String Dragengine.Scenery.ECBehaviorOutline.getPrefix ( )

Prefix.

Version
1.26

◆ getRig()

ECPRig Dragengine.Scenery.ECBehaviorOutline.getRig ( )

Rig property.

◆ getSkin()

ECPSkin Dragengine.Scenery.ECBehaviorOutline.getSkin ( )

Skin property.

◆ getThickness()

ECPFloat Dragengine.Scenery.ECBehaviorOutline.getThickness ( )

THickness property.

◆ instance()

Instance Dragengine.Scenery.ECBehaviorOutline.instance ( BehaviorElement  element)

Get instance in element from owner element class.

◆ new() [1/2]

ECBehaviorOutline Dragengine.Scenery.ECBehaviorOutline.new ( BehaviorElementClass  eclass,
ECBehaviorComponent  component,
ECBehaviorCollider  collider 
)

Create behavior element class.

◆ new() [2/2]

ECBehaviorOutline Dragengine.Scenery.ECBehaviorOutline.new ( BehaviorElementClass  eclass,
ECBehaviorComponent  component,
ECBehaviorCollider  collider,
String  id 
)

Member Data Documentation

◆ pBTSMs

ECComposeBTSM Dragengine.Scenery.ECBehaviorOutline.pBTSMs

◆ pCollider

ECBehaviorCollider Dragengine.Scenery.ECBehaviorOutline.pCollider

◆ pColor

ECPColor Dragengine.Scenery.ECBehaviorOutline.pColor

◆ pComponent

ECBehaviorComponent Dragengine.Scenery.ECBehaviorOutline.pComponent

◆ pIntensity

ECPFloat Dragengine.Scenery.ECBehaviorOutline.pIntensity

◆ pModel

ECPModel Dragengine.Scenery.ECBehaviorOutline.pModel

◆ pPrefix

String Dragengine.Scenery.ECBehaviorOutline.pPrefix

◆ pRig

ECPRig Dragengine.Scenery.ECBehaviorOutline.pRig

◆ pSkin

ECPSkin Dragengine.Scenery.ECBehaviorOutline.pSkin

◆ pThickness

ECPFloat Dragengine.Scenery.ECBehaviorOutline.pThickness

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