Skip to main content

Installation

This page shows the quickest way to add @canvas-tile-engine/core to a plain JS/TS project.

Install

npm install @canvas-tile-engine/core
yarn add @canvas-tile-engine/core
pnpm add @canvas-tile-engine/core

Quick start

<div id="canvas">
<canvas />
</div>
import { CanvasTileEngine } from "@canvas-tile-engine/core";

const el = document.getElementById("canvas");
const engine = new CanvasTileEngine(el, {
scale: number;
size: {
width: number;
height: number;
};
});

//
engine.drawRect({x: 10, y: 5})

engine.drawCircle([
{ x: 1, y: 1, size: 0.7 },
{ x: 7, y: 4, style: {
fillStyle: "red"
}}
])

engine.render();