diff options
author | sanine <sanine.not@pm.me> | 2022-06-05 20:38:18 -0500 |
---|---|---|
committer | sanine <sanine.not@pm.me> | 2022-06-05 20:38:18 -0500 |
commit | b3d9ffe8107bd7e0989c1fed2e5bdf31037134bb (patch) | |
tree | 6baaa464c8dd1e2b0e7cb4c31e897f6745edeb73 /src/main.js | |
parent | b9d4c658d3561106a452d8014c4d021fe175b759 (diff) |
begin adding logical map shapes
Diffstat (limited to 'src/main.js')
-rw-r--r-- | src/main.js | 26 |
1 files changed, 22 insertions, 4 deletions
diff --git a/src/main.js b/src/main.js index 0474d7a..5c6db59 100644 --- a/src/main.js +++ b/src/main.js @@ -1,5 +1,23 @@ -import { LayerData, LayerView, LayerController } from './Map/Layer.js'; +import { Transform, Canvas } from './Map/Canvas.js'; +import { Node, Shape, Point, Path, Polygon } from './Map/Shapes.js'; -const view = new LayerView('root'); -const data = new LayerData(); -const con = new LayerController(data, view); +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), + ]), +]; + +canvas.render(transform, shapes); |