-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgame01.html
57 lines (37 loc) · 808 Bytes
/
game01.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
<!DOCTYPE html>
<html>
<head>
<title></title>
<style type="text/css">
canvas { border:0px solid #000; }
</style>
<script type="text/javascript" src="CanvasDOM.js"></script>
</head>
<body>
<canvas id="test" width="300" height="500"></canvas>
<script type="text/javascript">
var doc = new CanvasDocument('test');
ani.regdoc(doc);
var bg = doc.createBackground();
var img = new Image();
img.onload = function(){
bg.setImage(this);
doc.draw();
}
img.src = 'bg.png'
var button1 = doc.createPanel();
button1.moveTo(60, 60);
button1.content('click me');
var button3 = doc.createButton();
button3.moveTo(200, 200);
button3.content('new button');
doc.append(bg);
doc.append(button1);
doc.append(button3);
doc.draw();
window.onload = function(){
//bg.$move(-1);
}
</script>
</body>
</html>