-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
78 lines (69 loc) · 1.55 KB
/
index.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
<html>
<head>
<title>App</title>
<style>
@charset "utf-8";
*{
padding: 0;
margin: 0;
}
#can{
position: absolute;
margin:auto;
top:0;
left:0;
right:0;
bottom:0;
border:1px solid black;
}
#can + span{
display: none;
}
#canContainer{
text-align:center;
width:100%;
height:100%;
position:relative;
}
</style>
</head>
<body>
<div id="canContainer">
<canvas id="can"></canvas>
<span>Made with <a href="https://github.com/ToniestTony/jt_lib">jt_lib21.js</a></span>
</div>
</body>
<script src="jt_lib21.js"></script>
<script>
var app={
w:600,
h:400,
//setup is called when the game has finished loading
setup:function(){
//jt.fullscreen(false);
},
//update is called every frame
update:function(){
jt.bg("grey");
}
}
//define the jt object on a global scale
var jt=undefined;
//you can also use $(document).ready(function(){}); with jQuery
window.onload = function(){
//parameters of the JT object:
//id of the canvas
//width
//height
//frames per second
//setup function name
//update function name
//name of the object which has the setup and update functions
//fullScreen button on mobile
jt=new JT("can",app.w,app.h,60,'setup','update','app',false);
//jt.loadImage("image.png","name")
//jt.loadSound("sound.mp3","name")
//jt.loadAnim("src.png","name",number of frames,fps);
}
</script>
</html>