Drag[en]gine Script Module DragonScript
1.23
|
Composable move on rail support for element class. More...
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... | |
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
Mover Dragengine.Scenery.ECComposeMoveOnRail.createMover | ( | Collider | collider, |
StubElement | stub | ||
) |
Create mover.
TSTriggerExpression Dragengine.Scenery.ECComposeMoveOnRail.createTriggerMove | ( | Element | element, |
StubElement | stub | ||
) |
Create move trigger expression from stub or null if not used.
TSTriggerExpression Dragengine.Scenery.ECComposeMoveOnRail.createTriggerMove | ( | Element | element, |
StubElement | stub, | ||
String | defaultValue | ||
) |
Create move trigger expression from stub or null if not used.
ECPFloat Dragengine.Scenery.ECComposeMoveOnRail.getAcceleration | ( | ) |
Acceleration in m/s^2.
ECPFloat Dragengine.Scenery.ECComposeMoveOnRail.getDeceleration | ( | ) |
Deceleration in m/s^2.
String Dragengine.Scenery.ECComposeMoveOnRail.getPrefix | ( | ) |
Prefix.
ECPStringID Dragengine.Scenery.ECComposeMoveOnRail.getRail | ( | ) |
Rail to move on.
ECPBoolean Dragengine.Scenery.ECComposeMoveOnRail.getStartAtFirstCorner | ( | ) |
Element starts out at head of rail otherwise the tail of the rail.
ECPFloat Dragengine.Scenery.ECComposeMoveOnRail.getVelocity | ( | ) |
Velocity in m/s.
|
protected |
Create mover.
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.
ECComposeMoveOnRail Dragengine.Scenery.ECComposeMoveOnRail.new | ( | ElementClass | ownerClass, |
String | prefix | ||
) |