Import the library somewhere in your index.js file:
import "animcc"
You can now utilise the web component in your HTML/JSX:
<anim-cc path='../assets/test/' clip="Scene" stage-width="550" stage-height="310" origin-x="0.5" origin-y="0.5" />
See the web component example for optional attributes.
const animContext = new Canvas2dAnimationContext(ctx)
const testLibrary = animContext.createLibrary('test', './test')
const monstersLibrary = animContext.createLibrary('monsters', './monsters')
await testLibrary.loadData();
await monstersLibrary.loadData();
testLibrary.symbol("Walker_Laser").draw(frame)
monsterLibrary.symbol("win").draw(frame)
See the dynamic-content.ts example
- The 'rotate' export option
- Tints
- Filters
- Brightness
npm install
npm run build-page
Set up a simple live server with
npm install
npm run dev