Class Turntable
From TrainzOnline
- An interface to operate a Turntable or similar object.
Contents |
Messages
- Turntable assets support attached-triggers.
- Adding an attached trigger table will enable SceneryWithTrack messages for each trigger.
CanMoveToNextStop
public native bool CanMoveToNextStop(void)
- Parameters
- None
- Returned Value
- True if there is a next stop to move to, false otherwise.
- Syntax
bool endOfTravel = Table.CanMoveToNextStop();
- Notes
- This method only make sense for transfer tables and the like where the animation has a defined start and end position.
- For circular turntables the method will always return true.
CanMoveToPrevStop
public native bool CanMoveToPrevStop(void)
- Parameters
- None
- Returned Value
- True if there is a previous stop to move to, false otherwise.
- Syntax
bool startOfTravel = Table.CanMoveToNextStop();
- Notes
- This method only make sense for transfer tables and the like where the animation has a defined start and end position.
- For circular turntables the method will always return true.
GetStopPosition
public native int GetStopPosition(void)
- Parameters
- None
- Returned Value
- The current position of the turntable.
- Syntax
int position = Table.GetStopPositionStop();
- Notes
IsMoving
public native bool IsMoving(void)
- Parameters
- None
- Returned Value
- True if the turntable is currently in motion, false otherwise.
- Syntax
bool canSelectStop = Table.IsMoving();
- Notes
MoveToNextStop
public native void MoveToNextStop(void)
- Parameters
- None
- Returned Value
- None
- Syntax
Table.MoveToNextStop();
- Notes
- Moves the turntable to the next stop.
MoveToPrevStop
public native void MoveToPrevStop(void)
- Parameters
- None
- Returned Value
- None
- Syntax
Table.MoveToPrevStop();
- Notes
- Moves the turntable to the previous stop.
MoveToStop
public native void MoveToStop(int index)
- Parameters
- index = Position to move to.
- Returned Value
- None
- Syntax
Table.MoveToStop(2);
- Notes
- Moves the turntable to the indicated stop.