GTicker class

GTicker provides a way to schedule callbacks that will be executed on every frame. In GraphX, GTicker is used at the core to update the DisplayObject tree and the inner Ticker that runs it, also invalidates the rendering for the CustomPainter through the ScenePainter when SceneConfig.autoUpdateRender, is true.

The GTicker class internally creates a Ticker (provided the Flutter). On each tick, it calculates the elapsed time and the delta time between the current and previous frames. It also dispatches the onFrame signal, which is used to update the DisplayObject tree.

It is important to note that GTicker is not meant to be used directly by the user, as it is used internally by the GraphX framework.

Constructors

GTicker()
Creates a GTicker.

Properties

currentDeltaRatio double
The ratio of the current delta time to the expected delta time.
no setter
currentDeltaTime double
The time elapsed since the last frame in seconds.
no setter
currentTime double
The current time in seconds.
no setter
frameRate double
The frame rate of the Ticker in frames per second.
getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
isActive bool
Indicates whether the Ticker is currently active or not. Whether time is elapsing for this Ticker. Becomes true when resume is called and false when pause is called.
no setter
isTicking bool
Indicates whether the Ticker is currently ticking or not.
no setter
onFrame EventSignal<double>
Signal dispatched on every frame with the elapsed time since the last frame as a parameter.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

callNextFrame(VoidCallback callback) → void
Schedules callback to be executed on the next frame.
dispose() → void
Removes all listeners from the onFrame signal and disposes the Ticker object.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
pause() → void
Pauses the Ticker if it's currently ticking. This is equivalent to calling Ticker.muted with true.
resume() → void
Resumes the Ticker if it's not currently ticking. This is equivalent to calling Ticker.muted with false.
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited