https://github.com/litecanvas/utils
🛠️ Small collection of tools for developing games with litecanvas.
https://github.com/litecanvas/utils
camera litecanvas math utilities vector
Last synced: 4 months ago
JSON representation
🛠️ Small collection of tools for developing games with litecanvas.
- Host: GitHub
- URL: https://github.com/litecanvas/utils
- Owner: litecanvas
- License: mit
- Created: 2024-07-02T00:58:37.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-07-26T13:20:27.000Z (5 months ago)
- Last Synced: 2025-08-08T19:04:58.562Z (5 months ago)
- Topics: camera, litecanvas, math, utilities, vector
- Language: JavaScript
- Homepage:
- Size: 194 KB
- Stars: 2
- Watchers: 1
- Forks: 1
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Litecanvas Utilities
Small collection of tools for developing games with [Litecanvas](https://github.com/litecanvas/game-engine).
## Install
### NPM package
```
npm i @litecanvas/utils
```
```js
// import everything
import * as utils from "@litecanvas/utils"
const pos = utils.vec(0, 0)
```
```js
// or import just what you want
import { vec } from "@litecanvas/utils"
const pos = vec(0, 0)
```
### CDN
Download from https://unpkg.com/browse/@litecanvas/utils/dist/ and load in a `` tag in your HTML.
```js
// now the "utils" namespace is created
const pos = utils.vec(0, 0)
```
```js
// 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](https://github.com/litecanvas/utils/tree/main/src/camera)
- **Vector**: Modular 2D vector. [Usage & Docs](https://github.com/litecanvas/utils/tree/main/src/vector)
- **Actor**: class to represent game entities. [Usage & Docs](https://github.com/litecanvas/utils/tree/main/src/actor)
- **Grid**: class to handle retangular grid areas. [Usage & Docs](https://github.com/litecanvas/utils/tree/main/src/grid)
- **Collision** utilities. [Usage & Docs](https://github.com/litecanvas/utils/tree/main/src/collision)
- **Tween** to create animations. [Usage & Docs](https://github.com/litecanvas/utils/tree/main/src/tween)
- **Image** to manipulate images. [Usage & Docs](https://github.com/litecanvas/utils/tree/main/src/image)
- **Collection** to manipulate lists (arrays). [Usage & Docs](https://github.com/litecanvas/utils/tree/main/src/collection)
- And some [math utilities](https://github.com/litecanvas/utils/tree/main/src/math)...