@litecanvas/utils
v0.52.1
Published
Utilities to help build litecanvas games
Downloads
1,160
Maintainers
Readme
Litecanvas Utilities
Small collection of tools for developing games with Litecanvas.
[!TIP] All modules of this package are automatically loaded on Litecanvas playground.
Install
NPM package
npm i @litecanvas/utils// import everything
import * as utils from "@litecanvas/utils"
const pos = utils.vec(0, 0)// or import just what you want
import { vec } from "@litecanvas/utils"
const pos = vec(0, 0)Global/CDN
Download or load from a CDN:
- jsDelivr: https://cdn.jsdelivr.net/npm/@litecanvas/utils
- Unpkg: https://unpkg.com/@litecanvas/utils
// now the "utils" namespace is created
const pos = utils.vec(0, 0)// also, you can call this once to
// expose the components globally
utils.global()
// now the namescape is not required
const pos = vec(0, 0)Components
- Camera: Move-, zoom- and rotatable camera with shake. Usage & Docs
- Vector: Modular 2D vector. Usage & Docs
- Actor: class to represent game entities. Usage & Docs
- Grid: class to handle retangular grid areas. Usage & Docs
- Collision utilities. Usage & Docs
- Tween to create animations. Usage & Docs
- Image to manipulate images. Usage & Docs
- Collection to manipulate lists (arrays). Usage & Docs
- And some math utilities...
