Contains a function that is to be executed every frame.
0.1.0
new(name:String, f:UpdateF ‑> Void, endCondition:() ‑> Bool)
Creates an nb.Timer.UpdateF instance.
nb.Timer.UpdateF
Parameters:
name
A name to identify the instance.
f
The function to be executed every frame. Will have the instance as argument.
endCondition
When this function returns true, f stops being executed.
true
name:String
A name to identify this instance.
read onlytElapsed:Float
The amount of time elapsed, in seconds.
read onlytFrames:Int
The amount of frames elapsed.
endCondition:() ‑> Bool
f:UpdateF ‑> Void
The function to be executed every frame. Will have this instance as argument.
tick(dt:Float):Bool
Updates variables and executes the associated function.
dt
An amount of time in seconds elapsed.
Returns:
true if this instance should cease to be executed, false otherwise.
false