summaryrefslogtreecommitdiff
path: root/src/main.js
blob: 7e4ab7997224a893e7778d5fd6767c33fe134ca5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import { Transform, Canvas } from './Map/Canvas.js';
import { Node, Shape, Point, Path, Polygon, Text } from './Map/Shapes.js';

function point(x, y) { this.x = x; this.y = y; };

const canvas = new Canvas('root');
const transform = new Transform();

const shapes = [
	new Point(new Node(30, 30)),
	new Path([
		new Node(100, 100),
		new Node(100, 200),
		new Node(150, 250),
	]),
	new Polygon([
		new Node(200, 100),
		new Node(200, 200),
		new Node(300, 200),
	]),
	new Text(new Node(10, 100), 'hello, world!'),
];

canvas.render(transform, shapes);