Home

Awesome

TSTL Flux

Declarations for flux, a fast, lightweight tweening library for Lua.

CommandDescription
yarn add -D tstl-fluxInstall these declarations
yarn add rxi/fluxInstall flux

Upon installation these declarations can be linked to a tsconfig.json file.

{
    "compilerOptions": {
        "types": [
            "tstl-flux"
        ]
    }
}

And used within any .ts file.

import * as flux from "flux"

const R = 30;
let pos = {
    x: 0,
    y: 0
}

flux.to(pos, 4, {
    x: 100,
    y: 200
})


love.update = (dt: number) => {
    flux.update(dt);
}
love.draw = () => {
    love.graphics.circle('fill', pos.x, pos.y);
}

Make sure to append ";./node_modules/?/?.lua" to your package.path in a conf.ts file (this is run first) to assist where Lua looks for modules.

package.path += ";./node_modules/?/?.lua";