ryanisaacg / quicksilver

A simple framework for 2D games on desktop and web
https://ryanisaacg.github.io/quicksilver
Other
782 stars 77 forks source link

stdweb works but web-sys does not #627

Closed jgarvin closed 4 years ago

jgarvin commented 4 years ago

Describe the bug Try running the squares example, with cargo web start --release --auto-reload --features quicksilver/stdweb you get a blue rectangle, with cargo web start --release --auto-reload --features quicksilver/web-sys you get an empty page.

To Reproduce Copy the squares demo to main.rs, add quicksilver dep, then run cargo web start --release --auto-reload --features quicksilver/web-sys and visit in Chrome.

Environment and versions (please complete the following information):

lenscas commented 4 years ago

the web-sys feature is when using wasm-bindgen, which is incompatible with cargo web.

Either use cargo web with the stdweb feature or use wasm-bindgen with the web-sys feature.

jgarvin commented 4 years ago

I will definitely give this a try tomorrow. Is there any way to make mismatching it give an error message? You'll get fewer clueless questions from people like me ;)

jgarvin commented 4 years ago

Sorry I figured there'd be a separate command for wasm-bindgen, but the readme says it's not documented yet. I tried looking through some tutorials but it's not trivial to map them to the example, e.g. they seem to want the code to live in a library instead of a binary, and assume you want to use a full node-js install. I think I'll revisit in the future.