SDKs
Trunk (coming soon)
Rust wasm games built with Trunk or wasm-bindgen. Coming soon.
Coming soon: Trunk support is not available yet. This page keeps the intended integration for reference.
Warning: Trunk's generated page starts your wasm on its own, before
Mugon.starthas published the context, so it is not supported yet.
Use wasm-bindgen directly, exactly as the Bevy template does:
- Build with
cargo build --target wasm32-unknown-unknownand runwasm-bindgen --target web --out-dir pkg --out-name game <your.wasm>. - Bundle a small entry with Vite, as the template does: import
Mugonfrom@mugon/sdkfirst, then importinitfrompkg/game.jsand call it from insideMugon.start. Without a bundler, write your ownindex.htmlthat loadsmugon.iife.jsfirst instead. - Read the context from Rust (
window.mugon), for example with themugon-sdk-bevybridge or your ownwasm-bindgenexterns.
The wasm-bindgen loader fetches the .wasm with fetch and instantiates it with
WebAssembly.instantiateStreaming, which works through the file proxy.