blob: f5a78b8472aed0968fd8bde13eb3edcb6f54c275 [file] [log] [blame] [edit]
<canvas id="canvas"></canvas>
<script>
window.onhashchange = function() { location.reload(); }
function printMessageOnServer(text) {
const lengthBytes = lengthBytesUTF8(text) + 1;
const stringOnWasmHeap = Module['_malloc'](lengthBytes);
stringToUTF8(text, stringOnWasmHeap, lengthBytes);
Module['_rive_print_message_on_server'](stringOnWasmHeap);
Module['_free'](stringOnWasmHeap);
}
var Module = {
'canvas': document.getElementById("canvas"),
'print': function(text) {
// Log 1st in case we're in a state where printMessageOnServer crashes.
console.log(text);
printMessageOnServer(text + '\n');
},
'printErr': function(text) {
// Log 1st in case we're in a state where printMessageOnServer crashes.
console.error(text);
printMessageOnServer(text + '\n');
},
};
</script>
<script src="gms.js"></script>