-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathexample-map.html
34 lines (34 loc) · 2.27 KB
/
example-map.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="user-scalable=no, width=device-width, initial-scale=1, maximum-scale=1">
<title>Battle Map Explorer</title>
<style>
* { margin: 0; padding: 0;}
body, html { height:100%; }
#canvas {
position:absolute;
width:100%;
height:100%;
}
</style>
</head>
<body onload="Init();">
<canvas id="canvas" style="background-color:#000;" ></canvas>
</body>
<script type="text/javascript" src="external/hammer.min.js"></script>
<script type="text/javascript" src="external/visibility_polygon.js"></script>
<script type="text/javascript" src="battle-map-explorer.js"></script>
<script type="text/javascript">
function Init() {
var image = 'http://i.imgur.com/wWoz8GO.jpg'; // https://www.reddit.com/r/battlemaps/comments/2ep3j7/the_experiments_of_a_madman_halmonds_laboratory/
var position = [210, 715];
var polygons = [];
polygons.push([[160,685],[260,685],[260,814],[391,814],[391,567],[30,567],[30,391],[210,391],[210,273],[509,273],[509,1354],[814,1354],[814,1168],[632,1168],[632,631],[1109,631],[1109,1168],[929,1168],[929,1352],[1233,1352],[1233,1050],[1353,1050],[1353,870],[1471,870],[1471,754],[1951,754],[1951,446],[1711,446],[1711,628],[1289,628],[1289,269],[1468,269],[1468,152],[1771,152],[1771,271],[1952,271],[1952,90],[2127,90],[2127,272],[2368,272],[2368,89],[2789,89],[2789,571],[2671,571],[2671,690],[2430,690],[2430,447],[2127,447],[2127,755],[2908,755],[2908,1289],[2193,1289],[2193,985],[1467,985],[1467,1051],[1530,1051],[1530,1590],[1651,1590],[1651,1293],[2070,1293],[2070,1528],[1770,1528],[1770,1654],[2194,1654],[2194,1411],[2432,1411],[2432,1705],[2309,1705],[2309,1829],[2431,1829],[2431,2012],[1895,2012],[1895,1768],[1770,1768],[1770,1890],[1352,1890],[1352,1527],[506,1527],[506,1767],[211,1767],[211,1893],[630,1893],[630,1649],[873,1649],[873,1770],[988,1770],[988,2069],[31,2069],[31,1650],[272,1650],[272,1107],[90,1107],[90,814],[160,814]]);
polygons.push([[2490,929],[2615,929],[2615,1111],[2490,1111]]);
var doors = [[[391,770],[509,770]],[[239,1767],[239,1650]],[[814,1313],[929,1313]],[[1651,1563],[1770,1563]],[[1833,1768],[1833,1654]],[[1353,1014],[1467,1014]]];
var darkness = true;
BattleMapExplorer.run(image, position, polygons, doors, darkness);
};
</script>
</html>