56 lines
1.5 KiB
HTML
56 lines
1.5 KiB
HTML
<!doctypehtml>
|
|
<html lang=EN-us>
|
|
|
|
<head>
|
|
<meta charset=utf-8>
|
|
<meta content="text/html; charset=utf-8" http-equiv=Content-Type>
|
|
<title>raylib web game</title>
|
|
<meta content="raylib web game" name=title>
|
|
|
|
</head>
|
|
<style>
|
|
html {
|
|
/* width:fit-content; */
|
|
width: 100vw;
|
|
height:100vh;
|
|
}
|
|
body {
|
|
margin: 0px;
|
|
/* overflow: hidden; */
|
|
/* background-color: black; */
|
|
width:100%;
|
|
height:100%;
|
|
display:flex;
|
|
cursor:none;
|
|
}
|
|
canvas {
|
|
margin:auto;
|
|
}
|
|
</style>
|
|
<body>
|
|
<canvas id="canvas" width="640" height="544"></canvas>
|
|
<p id="output" />
|
|
<script>
|
|
var Module = {
|
|
print: (function() {
|
|
var element = document.getElementById('output');
|
|
if (element) element.value = ''; // clear browser cache
|
|
return function(text) {
|
|
if (arguments.length > 1) text = Array.prototype.slice.call(arguments).join(' ');
|
|
console.log(text);
|
|
if (element) {
|
|
element.value += text + "\n";
|
|
element.scrollTop = element.scrollHeight; // focus on bottom
|
|
}
|
|
};
|
|
})(),
|
|
canvas: (function() {
|
|
var canvas = document.getElementById('canvas');
|
|
return canvas;
|
|
})()
|
|
};
|
|
</script>
|
|
<script src=game.js async></script>
|
|
</body>
|
|
|
|
</html> |