Newcar is a modern animation engine. This repository basically contains a renderer using HTML Canvas API to render. This repository cannot deal with the newcar filetype.
You can use npm to install it.
$ npm install newcar # the package of user API
Firstly, you need to define a <canvas>
tag in document, and then you need create a object Car
.
import { newcar } from "./node_modules/newcar/dist/newcar.js"
const animation = new newcar.Car(
document.getElementById("canvas_element_id"), // The DOM of `<canvas>`.
60 // The frame per second.
)
Secondly, you need to add a object on it!
const text = new newcar.object.Text({
x: 100,
y: 200,
text: "Hello world!"
});
animation.addObject(text);
Finally, you just need to play it.
animation.startPlay();
And then, you can see a text object with "Hello world!" on the canvas.
The document is served on newcar.js.org.
If you want to join the development or make a contribution, please read the Contribution Guide
Copyright (c) 2022-present, BugDuck Team