Tickrate class
Tickrate provides fractional Frametime values over time via digest.
Frametime values are whole integers and represent frame-perfect or even pixel-perfect quanities. Because of this, representing anything less than 1 fixed unit is impossible. Tickrate takes in a units and delay field and represent the expression "every (delay-1) frames, increase units".
// Every 5 frames move 2 pixels, or in other words:
// After 4 frames, the next frame yields an additional 2 pixels.
frame = frame.inc();
final ticker = Tickrate(2, 4);
playerXY += Vector2(ticker.digest(frame), playerXY.y);
Constructors
Properties
Methods
-
digest(
Frametime elapsed) → Frametime -
fractional(
) → double -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited