https://github.com/repcomm/scenario2d
A 2d scene graph so I don't have to keep rewriting them, does not implement a renderer
https://github.com/repcomm/scenario2d
Last synced: 10 months ago
JSON representation
A 2d scene graph so I don't have to keep rewriting them, does not implement a renderer
- Host: GitHub
- URL: https://github.com/repcomm/scenario2d
- Owner: RepComm
- Created: 2020-12-15T23:17:36.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2022-07-27T03:14:13.000Z (over 3 years ago)
- Last Synced: 2025-01-28T08:52:10.363Z (12 months ago)
- Language: TypeScript
- Size: 444 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: ReadMe.md
Awesome Lists containing this project
README
# scenario2d
Zero dependencies 2d scene graph for web canvas
## Implemented Classes
- Resource, TextResource, XmlResource, SvgResource
- Object2d (base class for scene objs)
- PathObject2d - svg `d` attribute equivalent
- Transform2d - scale, translate, rotation
- Vec2
## Using
To install with npm run
`npm install @repcomm/scenario2d`
This package comes with typescript definitions, and should work in both typescript and javascript.
## Example Usage
See [index.html](./index.html) and [index.js](./index.js)
Note: Example uses my other library [exponent-ts](https://github.com/RepComm/exponent-ts)
As well as [es-module-shims.js](https://github.com/guybedford/es-module-shims) to load node_modules using import maps directly in the browser.
This is to reduce build time to < 1s
hence the extra boilerplate in index.html
## Compiling
To build you'll want to clone the repo
`git clone https://github.com/RepComm/scenario2d.git`
Run `npm install` to get dependencies
Run `npm run build`