ClockViewModel

ClockViewModel

new

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

:Observable

Determines how tick should behave when startTime or stopTime is reached. Computed observable @type ClockRange

:Observable

Determines if calls to Clock.tick are frame dependent or system clock dependent.

:Observable

The current time.

: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. If clockStep 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

:Observable

Determines if Clock.tick should actually advance time.

:Observable

The start time of the clock.

:Observable

The stop time of the clock.

:Observable

The current system time.

Methods

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.