0.0.14 • Published 9 months ago

@cat_in_the_dark/raylib-wasm v0.0.14

Weekly downloads
-
License
MIT
Repository
github
Last release
9 months ago

Raylib WASM

Package with WASM bindings for raylib generated via emscripten/bind.h.

Main idea is to provide almost entire raylib API for browser's js.

Example:

import { Raylib } from '@cat_in_the_dark/raylib-wasm';

const canvas = document.getElementById('game') as HTMLCanvasElement;

async function main(rl: Raylib) {
  rl.initWindow(320, 240, 'Hello');
  rl.setTargetFPS(60);

  const logo = await rl.loadTexture('logo.png');
  const pos = { x: 100, y: 120 };

  const update = () => {
    rl.drawing(() => {
      rl.clearBackground(rl.PINK);
      logo.draw(pos);
      rl.drawFPS(10, 10);
    });
  };

  rl.runLoop(update);
}

Raylib.init({ canvas }).then(main).catch(err => console.error(err));
0.0.14

9 months ago

0.0.13

10 months ago

0.0.12

10 months ago

0.0.11

10 months ago

0.0.10

10 months ago

0.0.9

10 months ago

0.0.8

10 months ago

0.0.7

10 months ago

0.0.6

10 months ago

0.0.5

10 months ago

0.0.4

10 months ago

0.0.3

10 months ago

0.0.2

10 months ago