Stopwatch¶
Overview¶
Stopwatch is the model for the stopwatch. It is responsible for time, position, and visibility.
@author Chris Malley (PixelZoom, Inc.)
Class Stopwatch¶
Constructor¶
new Stopwatch( providedOptions? : StopwatchOptions )¶
Instance Methods¶
dispose()¶
reset()¶
step( dt : number )¶
Steps the stopwatch. @param dt - time delta, in units as specified by the client
setTime( t : number )¶
Similar to step() but sets the time to a specific value. @param t
Instance Properties¶
positionProperty : Property<Vector2>¶
(readonly)
position of the stopwatch, in view coordinates
isVisibleProperty : Property<boolean>¶
(readonly)
whether the stopwatch is visible
isRunningProperty : Property<boolean>¶
(readonly)
whether the stopwatch is running
timeProperty : NumberProperty¶
(readonly)
time displayed on the stopwatch, in units as specified by the client
Static Properties¶
ZERO_TO_ALMOST_SIXTY : Range¶
(readonly)
Type StopwatchOptions¶
- position?: Vector2
- isVisible?: boolean
- timePropertyOptions?: StrictOmit<NumberPropertyOptions, "tandem">
- & PhetioObjectOptions
Source Code¶
See the source for Stopwatch.ts in the scenery-phet repository.