Module digitroller

Provides a rolling number display.

The digit roller simply watches a value on a table for changes. The roller then interpolates the displayed value via a tween, so it appears to count up or down.

Info:

  • License: GPL v3
  • Author: Wesley Werner

Functions

module:new (args) Create a digit roller.
update (dt) Process animations.

Tables

args A table of arguments for new digit rollers.
instance Lists properties available on the instance.


Functions

module:new (args)
Create a digit roller.

Parameters:

Returns:

    instance A digit roller instance.
update (dt)
Process animations. Call this in you main game loop.

Parameters:

  • dt number Time delta as given by the Love callback

Tables

args
A table of arguments for new digit rollers.

Fields:

  • subject table The table to watch.
  • target string The key on the table to watch.
  • duration number The time in seconds the rolling animation will last. The default is 1 second. (optional)
  • easing string The name of easing function to use for the rolling animation.

    List of easing functions: https://github.com/kikito/tween.lua#easing-functions

instance
Lists properties available on the instance.

Fields:

  • value number Represents the current display value of the digit roller.
generated by LDoc 1.4.6 Last updated 2018-01-03 16:24:23