This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> | |
<style type="text/css"> | |
* { | |
margin: 0; | |
padding: 0; | |
background-color: #222; | |
} | |
canvas { | |
margin: 0 auto; | |
display: block; | |
} | |
</style> | |
</head> | |
<body> | |
<script type='text/javascript'> | |
var Module = {}; | |
fetch('index.wasm') | |
.then(response => | |
response.arrayBuffer() | |
).then(buffer => { | |
Module.canvas = document.getElementById("canvas"); | |
Module.wasmBinary = buffer; | |
var script = document.createElement('script'); | |
script.src = "index.js"; | |
script.onload = function() { | |
console.log("Emscripten boilerplate loaded.") | |
} | |
document.body.appendChild(script); | |
// When you click outside the canvas on itch.io input stops working, this fixes it | |
Module.canvas.onclick = function() { | |
Module.canvas.focus() | |
} | |
}); | |
</script> | |
<canvas id="canvas" style="width:auto; height:100%; outline:none;" tabindex=0></canvas> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
thomashope commentedMar 14, 2021