Skip to content

FrogeBot/canvas

Repository files navigation

@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")

About

Canvas module, designed for FrogeBot

Resources

License

Stars

Watchers

Forks