Getting started
Installation
First you need to download latest version of Hashira SDK. That includes the rendering engine (WebAssembly module) and JavaScript bindings. Demo project is available on code sandbox.
Setup
You will need to include the Hashira JavaScript library:
<head>
<script src="your-domain.tld/js/hashira.js"></script>
</head>
And add canvas to your HTML:
<body>
<canvas id="hashira" style="width: 224px; height: 256px;"></canvas>
</body>
Do not use
width
andheight
attributes on canvas element, prefer CSS instead.
Then you need to fetch the WebAssembly that will initialize hashira SDK:
const canvas = document.getElementById("hashira");
Hashira.Fetch("your-domain.tld/wasm/hashira.wasm").then((hashira) => {
hashira.bindEvents(canvas); // this will handle automatic resizing
hashira.bindCanvasByID("hashira"); // this will bind canvas to the engine, must use canvas ID
// ...
// go see SDK
});