anim8 readme wrote:onLoop is an optional parameter which can be either a function or a string representing one of the animation methods. It does nothing by default. If specified, it will be called every time an animation "loops".It will have two parameters: the animation instance, and how many loops have been elapsed. The most usual value (apart from none) is the string 'pauseAtEnd'. It will make the animation loop once and then pause and stop on the last frame.

Now, let's say I supply my own little function.
But I don't exactly understand, how am I supposed to access the two parameters you talked about in the quote?

-- if instead of anim:update(dt) you do:
anim:update(dt * 2) -- anim will run twice as fast.
anim:update(dt * 0.5) -- anim will run twice as slow.

So you can store that coefficient in a variable and multiply it on the update section. You can use this to do cool stuff like time manipulation, or make the gears of a train engine move in synchronicity with its velocity, using a single animation.

-- if instead of anim:update(dt) you do:
anim:update(dt * 2) -- anim will run twice as fast.
anim:update(dt * 0.5) -- anim will run twice as slow.

So you can store that coefficient in a variable and multiply it on the update section. You can use this to do cool stuff like time manipulation, or make the gears of a train engine move in synchronicity with its velocity, using a single animation.

onLoop is an optional parameter which can be a function or a string representing one of the animation methods. It does nothing by default. If specified, it will be called every time an animation "loops". It will have two parameters: the animation instance, and how many loops have been elapsed. The most usual value (apart from none) is the string 'pauseAtEnd'. It will make the animation loop once and then pause and stop on the last frame.

But bellow i see another description

animation:pauseAtEnd()Moves the animation to its last frame and then pauses it.

I know that this works as described below - moves the animation to its last frame and then pauses it.