AppTime<T extends App<T> > class
Tracks frame timing for an App instance: elapsed time, frame count, time scaling, and target FPS.
Time values are updated once per frame via _update, which is expected
to be driven by the app's main loop.
Constructors
- AppTime(T app)
Properties
- app → T
-
final
- dt → double
-
Time elapsed since the previous frame, in seconds, already multiplied
by timeScale.
no setter
- fps → int
-
The current target frames-per-second, as last set via setFPS.
no setter
- frameCount → int
-
Number of frames rendered since the app started.
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- time → double
-
Total elapsed time in seconds since the app started.
no setter
- timeScale → double
-
Multiplier applied to the per-frame delta time (dt).
no setter
- timeScaled → double
-
Total elapsed time in seconds since the app started, scaled by
timeScale.
no setter
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
setFPS(
int newFPS) → void - Changes the target FPS backend renders at.
-
setTimeScale(
double timeScale) → void - Sets the speed at which dt progresses relative to real time.
-
toString(
) → String -
A string representation of this object.
inherited
-
updateTimeScale(
double fn(double t)) → void -
Updates timeScale by applying
fnto its current value.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited