mirror of
https://github.com/italicsjenga/winit-sonoma-fix.git
synced 2024-12-23 22:01:31 +11:00
Fix readme for webassembly usage. (#425)
Needs to do `getElementById()`, not just have the ID name. Not sure if this is a winit change or what.
This commit is contained in:
parent
559681b0ed
commit
5dcde83b4c
|
@ -50,6 +50,6 @@ Building a binary will yield a `.js` file. In order to use it in an HTML file, y
|
|||
|
||||
- Put a `<canvas id="my_id"></canvas>` element somewhere. A canvas corresponds to a winit "window".
|
||||
- Write a Javascript code that creates a global variable named `Module`. Set `Module.canvas` to
|
||||
the ID of the `<canvas>` element (in the example this would be `"my_id"`). More information
|
||||
[here](https://kripken.github.io/emscripten-site/docs/api_reference/module.html).
|
||||
the element of the `<canvas>` element (in the example you would retrieve it via `document.getElementById("my_id")`).
|
||||
More information [here](https://kripken.github.io/emscripten-site/docs/api_reference/module.html).
|
||||
- Make sure that you insert the `.js` file generated by Rust after the `Module` variable is created.
|
||||
|
|
Loading…
Reference in a new issue