| <!-- Black background so that pixels with alpha are more obvious, rather than |
| being composited into the browser below. --> |
| <canvas id="canvas" style="background-color: black"></canvas> |
| <script> |
| window.onhashchange = function() { location.reload(); } |
| function printMessageOnServer(text) { |
| // Don't try to use things like "Module['_malloc']" before the |
| // emscripten runtime is initialized; early stderr only logs to the |
| // browser console (not the deploy_tests.py terminal as well) instead of |
| // crashing. |
| if (typeof runtimeInitialized === 'undefined' || !runtimeInitialized) { |
| return; |
| } |
| 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> |