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:
Members
-
clockRange :Observable
-
Determines how tick should behave when
startTimeorstopTimeis reached. Computed observable @type ClockRange -
clockStep :Observable
-
Determines if calls to
Clock.tickare 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
clockStepis set to ClockStep.TICK_DEPENDENT this is the number of seconds to advance. IfclockStepis 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.tickshould 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.tickhas not yet been called.
