Skip to content

matronator/mgine

Repository files navigation

Ping Tracker logo

Mgine

NPM Version NPM Downloads npm TypeScript version Tree shaking Dependencies npm package minimized gzipped size Commits Issues License Follow GitHub Sponsors

Mgine (read as emgine) is a simple library to make working with HTML5 canvas graphics easier.

Installation

npm i mgine
pnpm i mgine
yarn add mgine
bun i mgine

Usage

import Mgine from 'mgine';

const mgine = Mgine.Init('canvas-id', { /* options */ });
// or
const mgine2 = new Mgine('canvas-id', { /* options */ });

mgine.fillRect({ x: 10, y: 10, width: 50, height: 50 }, 'green');