Skip to content

Demonstrating drawing to canvas with Rust

Notifications You must be signed in to change notification settings

TomasHubelbauer/rust-wasm-canvas

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Rust WebAssembly Canvas

This is based on the Hello Rust example and the minimal Rust & Wasm example.

More resources on Rust & Wasm has since become available:

Preparing

Install PHP (by default on macOS) or replace file server in cmd/watch.sh.

git clone https://github.com/TomasHubelbauer/rust-wasm-canvas.git
chmod +x cmd/*.sh
cargo install cargo-watch
cargo install --git https://github.com/alexcrichton/wasm-gc

Note that cargo watch requires Cargo.toml to exist.

Running

(Watch out, this will kill your PHP process, change cmd/watch.sh to avoid that.)

  • Unix: ./cmd/watch.sh
  • Windows: cmd/watch.bat

To-Do

Figure out how to use with Cargo and how to depend on crates