Drag[en]gine Script Module DragonScript  1.23
Dragengine.Scenery.ECComposeMoveOnRail Class Reference

Composable move on rail support for element class. More...

Inheritance diagram for Dragengine.Scenery.ECComposeMoveOnRail:

Classes

class  Mover
 Mover support for elements. More...
 

Public Member Functions

Mover createMover (Collider collider, StubElement stub)
 Create mover. More...
 
TSTriggerExpression createTriggerMove (Element element, StubElement stub)
 Create move trigger expression from stub or null if not used. More...
 
TSTriggerExpression createTriggerMove (Element element, StubElement stub, String defaultValue)
 Create move trigger expression from stub or null if not used. More...
 
ECPFloat getAcceleration ()
 Acceleration in m/s^2. More...
 
ECPFloat getDeceleration ()
 Deceleration in m/s^2. More...
 
String getPrefix ()
 Prefix. More...
 
ECPStringID getRail ()
 Rail to move on. More...
 
ECPBoolean getStartAtFirstCorner ()
 Element starts out at head of rail otherwise the tail of the rail. More...
 
ECPFloat getVelocity ()
 Velocity in m/s. More...
 
ECComposeMoveOnRail new (ElementClass ownerClass)
 Create composable element class. More...
 
ECComposeMoveOnRail new (ElementClass ownerClass, String prefix)
 

Protected Member Functions

void initMover (Mover mover, StubElement stub)
 Create mover. More...
 

Detailed Description

Composable move on rail support for element class.

Provides support for elements to move along a Rail without subclassing from a specific class. Sets the Rail to move along as well as movement parameters like velocity, acceleration and deceleration. A trigger is used to start moving along the rail from front to back. The mover class provides the movement logic to be used by element instances.

The velocity defines how fast the element will be moving. When starting to move the accelration is used to speed up the element until it hits velocity. When approaching the opposite end of the rail path the deceleration is used to slow down.

The element is placed at the beginning either at the start of the rail path or at the end. When triggered the element starts moving towards the opposite end. The element will continue moving when the trigger changes to false. This allows to create elements moving between two locations when trigger is pulsed or just once when it stays triggered

Member Function Documentation

◆ createMover()

Mover Dragengine.Scenery.ECComposeMoveOnRail.createMover ( Collider  collider,
StubElement  stub 
)

Create mover.

◆ createTriggerMove() [1/2]

TSTriggerExpression Dragengine.Scenery.ECComposeMoveOnRail.createTriggerMove ( Element  element,
StubElement  stub 
)

Create move trigger expression from stub or null if not used.

◆ createTriggerMove() [2/2]

TSTriggerExpression Dragengine.Scenery.ECComposeMoveOnRail.createTriggerMove ( Element  element,
StubElement  stub,
String  defaultValue 
)

Create move trigger expression from stub or null if not used.

◆ getAcceleration()

ECPFloat Dragengine.Scenery.ECComposeMoveOnRail.getAcceleration ( )

Acceleration in m/s^2.

◆ getDeceleration()

ECPFloat Dragengine.Scenery.ECComposeMoveOnRail.getDeceleration ( )

Deceleration in m/s^2.

◆ getPrefix()

String Dragengine.Scenery.ECComposeMoveOnRail.getPrefix ( )

Prefix.

◆ getRail()

ECPStringID Dragengine.Scenery.ECComposeMoveOnRail.getRail ( )

Rail to move on.

◆ getStartAtFirstCorner()

ECPBoolean Dragengine.Scenery.ECComposeMoveOnRail.getStartAtFirstCorner ( )

Element starts out at head of rail otherwise the tail of the rail.

◆ getVelocity()

ECPFloat Dragengine.Scenery.ECComposeMoveOnRail.getVelocity ( )

Velocity in m/s.

◆ initMover()

void Dragengine.Scenery.ECComposeMoveOnRail.initMover ( Mover  mover,
StubElement  stub 
)
protected

Create mover.

◆ new() [1/2]

ECComposeMoveOnRail Dragengine.Scenery.ECComposeMoveOnRail.new ( ElementClass  ownerClass)

Create composable element class.

Adds all properties to ownerClass. If you do not want a property to be configurable using XML subclassing use ownerClass.removeProperty() to remove them.

◆ new() [2/2]

ECComposeMoveOnRail Dragengine.Scenery.ECComposeMoveOnRail.new ( ElementClass  ownerClass,
String  prefix 
)

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