Skip to content
Open

. #261

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file not shown.
Binary file added apigames/stumbleguys/Build/WebGL.wasm.unityweb
Binary file not shown.
2 changes: 2 additions & 0 deletions apigames/stumbleguys/Build/WebGl.Loader.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions apigames/stumbleguys/Build/whid
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

85 changes: 85 additions & 0 deletions apigames/stumbleguys/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@

<!DOCTYPE html>
<html lang="en-us">

<head>
<meta charset="utf-8">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>stumble Guys</title>
<style>
html,
body {
background: #000;
width: 100%;
height: 100%;
overflow: visible;
padding: 0;
margin: 0;
}

div#gameContainer {
background: transparent !important;
position: absolute;
}

div#gameContainer canvas {
position: absolute;
}
</style>
</head>

<body>
<div id="gameContainer">
<canvas id="unity-canvas"></canvas>
<script src="Build/WebGl.Loader.js"></script>
<script>
createUnityInstance(document.querySelector("#unity-canvas"), {
dataUrl: "https://cdn.discordapp.com/attachments/989198462295875635/1149542678409781268/WebGL.data.unityweb",
frameworkUrl: "Build/WebGL.framework.js.unityweb",
codeUrl: "Build/WebGL.wasm.unityweb",
streamingAssetsUrl: "StreamingAssets",
companyName: "Stumble Guys Inc",
productName: "Stumble Guys",
productVersion: "0.1.5c",
}).then(function (instance) {
var canvas = instance.Module.canvas;
var container = canvas.parentElement;
function onResize() {
var w;
var h;

if (scaleToFit) {
w = window.innerWidth;
h = window.innerHeight;

var r = 540 / 960;

if (w * r > window.innerHeight) {
w = Math.min(w, Math.ceil(h / r));
}
h = Math.floor(w * r);
} else {
w = 960;
h = 540;
}

container.style.width = canvas.style.width = w + "px";
container.style.height = canvas.style.height = h + "px";
container.style.top = Math.floor((window.innerHeight - h) / 2) + "px";
container.style.left = Math.floor((window.innerWidth - w) / 2) + "px";
}

var scaleToFit;
try {
scaleToFit = !!JSON.parse("");
} catch (e) {
scaleToFit = true;
}
window.addEventListener('resize', onResize);
onResize();
});
</script>
</div>
</body>

</html>