new ClockViewModel
A ViewModel which exposes a Clock for user interfaces.
Parameters:
Name | Type | Argument | Description |
---|---|---|---|
clock |
Clock |
<optional> |
The clock object wrapped by this view model, if undefined a new instance will be created. |
See:
Source:
Members
-
clockRange :Observable
-
Determines how tick should behave when
startTime
orstopTime
is reached. Computed observable @type ClockRange -
clockStep :Observable
-
Determines if calls to
Clock.tick
are frame dependent or system clock dependent. -
currentTime :Observable
-
The current time.
-
multiplier :Observable
-
Determines how much time advances when tick is called, negative values allow for advancing backwards. If
clockStep
is set to ClockStep.TICK_DEPENDENT this is the number of seconds to advance. IfclockStep
is set to ClockStep.SYSTEM_CLOCK_MULTIPLIER this value is multiplied by the elapsed system time since the last call to tick. Computed observable @type Number -
shouldAnimate :Observable
-
Determines if
Clock.tick
should actually advance time. -
startTime :Observable
-
The start time of the clock.
-
stopTime :Observable
-
The stop time of the clock.
-
systemTime :Observable
-
The current system time.
Methods
-
synchronize
-
Updates the view model with the contents of the underlying clock. Can be called to force an update of the viewModel if the underlying clock has changed and
Clock.tick
has not yet been called.