Skip to content
forked from dromara/newcar

A modern animation engine for html5

License

Notifications You must be signed in to change notification settings

onion108/newcar

 
 

Repository files navigation

newcar

logo stars forks license community team

Introduction

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.

For example

Install

You can use npm to install it.

$ npm install newcar # the package of user API

Create a animation

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.

Document

The document is served on newcar.js.org.

Contribution

If you want to join the development or make a contribution, please read the Contribution Guide

Copyright (c) 2022-present, BugDuck Team

About

A modern animation engine for html5

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • TypeScript 81.6%
  • HTML 15.8%
  • JavaScript 2.6%