Canvas module, designed for FrogeBot
$ npm i @frogebot/canvas
let frogeCanvas = require("@frogebot/canvas");
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")