1.1.1 • Published 2 years ago

@frogebot/canvas v1.1.1

Weekly downloads
-
License
ISC
Repository
-
Last release
2 years ago

@frogebot/canvas

Canvas module, designed for FrogeBot


Installation

$ npm i @frogebot/canvas

Use

let frogeCanvas = require("@frogebot/canvas");

Functions

The functions return a promise with an image buffer of the canvas

// Draws text on a canvas with automatic wrapping
canvasText(text, fontSize, fontFamily, width, align = "center", lineSpacing = 1.5, fillStyle = "black", bg = "transparent", strokeStyle = "transparent", lineWidth = 0)
// Draws a rectangle on a canvas
canvasRect(width, height, strokeStyle = "white", strokeWidth = 4, fillStyle = "black")
// Draws a "window" on a canvas
canvasWindow(width, height, x, y, holeWidth, holeHeight, strokeStyle = "white", strokeWidth = 4, strokeOffset = 0, fillStyle = "black")