| Crates.io | canvas-display |
| lib.rs | canvas-display |
| version | 0.1.2 |
| created_at | 2020-05-29 10:42:37.250618+00 |
| updated_at | 2020-09-18 04:35:47.577891+00 |
| description | Wasm32 implementation for embedded-graphics https://github.com/jamwaffles/embedded-graphics DrawTarget. It is based on a HTML canvas. |
| homepage | |
| repository | https://codeberg.org/morph/canvas-display |
| max_upload_size | |
| id | 247326 |
| size | 28,368 |
Wasm32 implementation for embedded-graphics https://github.com/jamwaffles/embedded-graphics DrawTarget. It is based on a HTML canvas.
To include canvas-display in your project, add this dependency
line to your Cargo.toml file:
canvas-display = "0.1.2"
To enable offscreen rendering, the crate provides a offscreen feature (no default feature). With this feature you have to call the flip method
on CanvasDisplay after rendering.
canvas-display requires Rust 1.30 or newer.
wasm-pack is required for building Rust-generated WebAssembly. Install it from https://rustwasm.github.io/wasm-pack/installer/.
npm is a JavaScript package manger and is used to install and run a JavaScript bundler and development server. You could install npm from https://www.npmjs.com/get-npm.
For the examples we uses the latest version of npm. You could install it with this command:
npm install npm@latest -g
Navigate to directory of the example and run:
npm install
To serve the example locally run:
npm run serve
Navigate your Web browser to http://localhost:8080/
You can build and view the latest documentation by executing the following command:
cargo doc --no-deps --open