maxiy01 / tstl-flux

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

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

TSTL Flux

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

Command Description
yarn add -D tstl-flux Install these declarations
yarn add rxi/flux Install 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";

About

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

License:MIT License