forked from github/game-off-2013
-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy patheditor.html
91 lines (78 loc) · 2.15 KB
/
editor.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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Editor</title>
<style>
body {
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
}
canvas {
border: 2px solid black;
}
textarea {
display: block;
width: 640px;
}
.controls {
display: block;
position: absolute;
bottom: 0;
right: 0;
background-color: #fff;
opacity: 0.8;
}
label,
input,
.history {
display: block;
}
#translate-x,
#translate-y {
display: inline;
}
.history {
width: 224px;
}
.help > p {
font-size: 0.8em;
line-height: 0;
}
</style>
</head>
<body>
<div class="controls">
<label for="scale">Scale</label>
<input type="number" id="scale" value="0.1" min="0.1" max="2" step="0.1">
<label for="translate">Translate All</label>
<input type="number" id="translate-x" value="0" min="-100" max="100" step="1">
<input type="number" id="translate-y" value="0" min="-100" max="100" step="1">
<button id="translate-btn">Translate</button>
<label for="history">History</label>
<select class="history" id="history" size="20"></select>
<button id="load-history-btn">Load</button>
<button id="remove-history-btn">Remove</button>
<button id="clear-history-btn">Clear</button>
</div>
<div id="editor"></div>
<div class="data-controls">
<label for="load-scale">Scale</label>
<input type="number" id="load-scale" value="0.1" min="0.1" max="2" step="0.1">
<button id="load-data-btn">Load Data</button>
<button id="load-batch-btn">Load Batch Data</button>
</div>
<div class="help">
<p>A - add shape.</p>
<p>D - remove shape.</p>
<p>V - add vertex.</p>
<p>Alt+click - remove vertex.</p>
<p>R - reset camera.</p>
<p>S - toggle snapping.</p>
<p>P - move player preview to mouse position.</p>
<p>Alt+P - center all polygons on centroid.</p>
<p>Space - export as physics entities.</p>
<p>Alt+Space - export as batch physics entities.</p>
</div>
<script data-main="js/editor-main" src="./js/require.js"></script>
</body>
</html>