@ion-cloud/compass
v1.9.3
Published
JavaScript mapping classes and random generation algorithms
Downloads
12
Maintainers
Readme
compass
JavaScript mapping classes and random generation algorithms JavaScript mapping classes and random generation algorithms
Table of Contents
Setup
Getting started is as easy as npm i @ion-cloud/compass --save
and then importing
the required modules into your app with import {Map,Sector,maps} from '@ion-cloud/compass'
.
Please see code example here.
Usage
WebGL Canvas
import {EaselWebGL} from '@ion-cloud/easel';
import {Map,maps,BasicWebGLDisplay} from '@ion-cloud/compass';
const easel = new EaselWebGL(),
map = new Map({width:100,height:100}),
display = new BasicWebGLDisplay({easel,map}),
{generator} = maps.find(map=> map.name==='template - basic');
generator({map});
easel.onDraw = function(){ display.draw(); };
easel.redraw();
2d Canvas
import {Easel} from '@ion-cloud/core';
import {Map,maps,BasicDisplay} from '@ion-cloud/compass';
const easel = new Easel(),
map = new Map({width:100,height:100}),
display = new BasicDisplay({easel,map}),
{generator} = maps.find(map=> map.name==='template - basic');
generator({map});
easel.onDraw = function(){ display.draw(); };
easel.redraw();