Skip to content

Latest commit

 

History

History
29 lines (25 loc) · 668 Bytes

README.md

File metadata and controls

29 lines (25 loc) · 668 Bytes

@damienvesper/canvas-map

A canvas mapping library, ported to TypeScript.


Usage

import { CanvasMap, Text } from '@damienvesper/canvas-map';

const canvas = document.querySelector(`canvas`);
const map = new CanvasMap(canvas, 200, 200);

// Add a text to the map.
map.add(new Text({
    id: `hello-world-text`,
    x: 100,
    y: 100,
    text: `Hello World`,
    fill: `rgba(0, 0, 0, 1)`,
    size: 200
}));

// Render elements to the canvas.
map.draw();