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

Behavior element behavior adding world support. More...

Inheritance diagram for Dragengine.Scenery.ECBehaviorWorld:
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.
 
DecalBuilder getDecalBuilder ()
 Decal builder used for world decals.
 
MutableID getIDGenerator ()
 ID Generator.
 
ECPVector getOrientation ()
 Orientation.
 
ECPVector getPosition ()
 Position.
 
ECPWorld getWorld ()
 World to load.
 
Instance instance (BehaviorElement element)
 Get instance in element from owner element class.
 
ECBehaviorWorld new (BehaviorElementClass eclass)
 Create behavior element class.
 
ECBehaviorWorld new (BehaviorElementClass eclass, Loaders loaders, MutableID idGenerator)
 
ECBehaviorWorld new (BehaviorElementClass eclass, Loaders loaders, MutableID idGenerator, String id)
 
ECBehaviorWorld new (BehaviorElementClass eclass, Loaders loaders, MutableID idGenerator, String id, String prefix)
 
ECBehaviorWorld new (BehaviorElementClass eclass, String id)
 Create default composeable behavior.
 
void setDecalBuilder (DecalBuilder decalBuilder)
 Set decal builder used for world decals.
 
void setIDGenerator (MutableID idGenerator)
 Set ID Generator.
 
- 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 ECBehaviorWorld getBehaviorIn (BehaviorElementClass eclass)
 Get first behavior in element class or null if absent.
 

Public Attributes

DecalBuilder pDecalBuilder
 
MutableID pIDGenerator
 
ECPVector pOrientation
 
ECPVector pPosition
 
ECPWorld pWorld
 

Additional Inherited Members

- Protected Member Functions inherited from Dragengine.Scenery.DefaultECBehavior
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 world support.

Version
1.26

Behavior loads world file and adds contained content to the the game world this element is located in.

This behavior can be added multiple times to an element. Each instance loads an own world and adds its content to the parent world. To distinguish the world behaviors an identifier is used to retrieve a specific instance. By default world class properties have no prefix. If the identifier is not empty the world element class properties have the prefix "{id}.". This can be overwritten if required. Hence to use more than one world use code like this in your subclass constructor:

class MyElement extends BehaviorElementClass
func new()
ECBehaviorWorld.new(this)
ECBehaviorWorld.new(this, "subWorld")
end
end
Behavior element element class.
Definition BehaviorElementClass.ds:54
Behavior element behavior adding world support.
Definition ECBehaviorWorld.ds:65

You can now define the parameters to use for both worlds using for example the properties "path" for the first world and "subWorld.path" for the second world.

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

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

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

Member Function Documentation

◆ dispose()

void Dragengine.Scenery.ECBehaviorWorld.dispose ( )

Dispose of behavior.

Reimplemented from Dragengine.Scenery.DefaultECBehavior.

◆ getBehaviorIn()

static ECBehaviorWorld Dragengine.Scenery.ECBehaviorWorld.getBehaviorIn ( BehaviorElementClass  eclass)
static

Get first behavior in element class or null if absent.

◆ getDecalBuilder()

DecalBuilder Dragengine.Scenery.ECBehaviorWorld.getDecalBuilder ( )

Decal builder used for world decals.

◆ getIDGenerator()

MutableID Dragengine.Scenery.ECBehaviorWorld.getIDGenerator ( )

ID Generator.

◆ getOrientation()

ECPVector Dragengine.Scenery.ECBehaviorWorld.getOrientation ( )

Orientation.

◆ getPosition()

ECPVector Dragengine.Scenery.ECBehaviorWorld.getPosition ( )

Position.

◆ getWorld()

ECPWorld Dragengine.Scenery.ECBehaviorWorld.getWorld ( )

World to load.

◆ instance()

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

Get instance in element from owner element class.

◆ new() [1/5]

ECBehaviorWorld Dragengine.Scenery.ECBehaviorWorld.new ( BehaviorElementClass  eclass)

Create behavior element class.

Reimplemented from Dragengine.Scenery.DefaultECBehavior.

◆ new() [2/5]

ECBehaviorWorld Dragengine.Scenery.ECBehaviorWorld.new ( BehaviorElementClass  eclass,
Loaders  loaders,
MutableID  idGenerator 
)

◆ new() [3/5]

ECBehaviorWorld Dragengine.Scenery.ECBehaviorWorld.new ( BehaviorElementClass  eclass,
Loaders  loaders,
MutableID  idGenerator,
String  id 
)

◆ new() [4/5]

ECBehaviorWorld Dragengine.Scenery.ECBehaviorWorld.new ( BehaviorElementClass  eclass,
Loaders  loaders,
MutableID  idGenerator,
String  id,
String  prefix 
)

◆ new() [5/5]

ECBehaviorWorld Dragengine.Scenery.ECBehaviorWorld.new ( BehaviorElementClass  eclass,
String  id 
)

Create default composeable behavior.

Reimplemented from Dragengine.Scenery.DefaultECBehavior.

◆ setDecalBuilder()

void Dragengine.Scenery.ECBehaviorWorld.setDecalBuilder ( DecalBuilder  decalBuilder)

Set decal builder used for world decals.

The old decal builder is disposed of if present.

◆ setIDGenerator()

void Dragengine.Scenery.ECBehaviorWorld.setIDGenerator ( MutableID  idGenerator)

Set ID Generator.

Member Data Documentation

◆ pDecalBuilder

DecalBuilder Dragengine.Scenery.ECBehaviorWorld.pDecalBuilder

◆ pIDGenerator

MutableID Dragengine.Scenery.ECBehaviorWorld.pIDGenerator

◆ pOrientation

ECPVector Dragengine.Scenery.ECBehaviorWorld.pOrientation

◆ pPosition

ECPVector Dragengine.Scenery.ECBehaviorWorld.pPosition

◆ pWorld

ECPWorld Dragengine.Scenery.ECBehaviorWorld.pWorld

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