2.8.0 • Published 6 months ago

stinky-2d v2.8.0

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

Stinky2D

A 2D graphics library made for Electron applications

Last edited by Rohan Kanhaisingh at 11-1-2023.

Version 1.0.1


What is Stinky2D

Stinky2D, as mentioned earlier, is a 2D graphics library created for use by Electron applications the CanvasRenderingContext2D API.

The library is written in TypeScript, giving the developer the ability to write code in the most secure and efficient way possible. Everything will be ready for deployment after writing code.

Installation

To install Stinky2D you need to install the NPM package. You do not need to install the declaration types manually because they are already generated.

$ npm install stinky-2d

Usage

import { Scene, Renderer, Camera, Looper, LooperTickState, ColorCodes } from "stinky-2d"

const scene = new Scene(innerWidth, innerHeight, document.body);
const renderer = new Renderer(scene);
const camera = new Camera(renderer, scene);
const looper = new Looper();

looper.AddEventListener("update", function(state: LooperTickState): void {
	renderer.ClearScene();
	renderer.PaintScene(ColorCodes.BLACK);

	return;
});

looper.Trigger();