0.1.2 • Published 2 years ago

@yeliulee/rust-wasm-mirage-tank v0.1.2

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

MirageTank Wasm

MirageTank Wasm driven by rustwasm

GitHub forks

Online demo

https://ol.woobx.cn/tool/mirage-tank

Installation

yarn add @yeliulee/rust-wasm-mirage-tank
# or
npm install @yeliulee/rust-wasm-mirage-tank

Usage

import * as wasm from "@yeliulee/rust-wasm-mirage-tank_bg.wasm";
// or `import wasm from "@yeliulee/rust-wasm-mirage-tank_bg.wasm?url"` with vite
import {
  MirageTankWrapper,
  default as initWasm,
} from "@yeliulee/rust-wasm-mirage-tank";

// init wasm module, you can specific wasm from cdn or just imported from the module itself
initWasm(wasm);


const initMirageTank = () => {
  const foreImageBuffer = undefined; // specific your own image buffer here
  const backImageBuffer = undefined; // specific your own image buffer here

  // make sure to init mirage tank after wasm is initialized
  const tank = new MirageTankWrapper(foreImageBuffer, backImageBuffer);
};

// more