API Reference 0.7.1rikulo_effectMotionState

MotionState class

The state in a Motion.

class MotionState {
 
 final int startTime;
 int _current, _elapsed, _paused, _pauseStart;
 var data;
 
 MotionState._(int current, {int start, int paused : 0}) : 
   startTime = start != null ? start : current, 
   _current = current, _elapsed = 0, _paused = paused;
 
 /** Return current time, in the form of millisecond since epoch.
  */
 int get currentTime => _current;
 
 /** Return elapsed time since the previous animation frame. At the first 
  * animation frame, the value is 0.
  */
 int get elapsedTime => _elapsed;
 
 /** Return paused time in milliseconds.
  */
 int get pausedTime => _paused;
 
 /** Return the total running time in milliseconds since motion starts, 
  * excluding paused time.
  */
 int get runningTime => _current - startTime - _paused;
 
 /** Return true if paused.
  */
 bool get isPaused => _pauseStart != null;
 
 void _snapshot(int current) {
   _elapsed = current - _current;
   _current = current;
 }
 
 void _pause(int current) {
   _pauseStart = current;
 }
 
 void _resume(int current) {
   if (_pauseStart != null) {
     _paused += current - _pauseStart;
     _pauseStart = null;
   }
 }
 
}

Properties

final int currentTime #

Return current time, in the form of millisecond since epoch.

int get currentTime => _current;

var data #

var data

final int elapsedTime #

Return elapsed time since the previous animation frame. At the first animation frame, the value is 0.

int get elapsedTime => _elapsed;

final bool isPaused #

Return true if paused.

bool get isPaused => _pauseStart != null;

final int pausedTime #

Return paused time in milliseconds.

int get pausedTime => _paused;

final int runningTime #

Return the total running time in milliseconds since motion starts, excluding paused time.

int get runningTime => _current - startTime - _paused;

final int startTime #

final int startTime