canvacord
Advanced tools
Comparing version 5.2.2 to 5.2.3
{ | ||
"name": "canvacord", | ||
"version": "5.2.2", | ||
"version": "5.2.3", | ||
"description": "Powerful image manipulation package for beginners.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -45,3 +45,3 @@ const Trigger = require("../libs/Trigger"); | ||
await Canvacord.__wait(); | ||
return await Trigger(image, assets("IMAGE").TRIGGERED); | ||
return await Trigger(image, Canvacord.assets.image.get("TRIGGERED")); | ||
} | ||
@@ -343,3 +343,3 @@ | ||
const ctx = canvas.getContext("2d"); | ||
const background = await Canvas.loadImage(Canvacord.assets("IMAGE").KISS); | ||
const background = await Canvas.loadImage(Canvacord.assets.image.get("KISS")); | ||
ctx.drawImage(background, 0, 0, canvas.width, canvas.height); | ||
@@ -365,3 +365,3 @@ const avatar = await Canvas.loadImage(image1); | ||
const ctx = canvas.getContext("2d"); | ||
const background = await Canvas.loadImage(Canvacord.assets("IMAGE").SPANK); | ||
const background = await Canvas.loadImage(Canvacord.assets.image.get("SPANK")); | ||
ctx.drawImage(background, 0, 0, canvas.width, canvas.height); | ||
@@ -381,6 +381,9 @@ const avatar = await Canvas.loadImage(image1); | ||
static async registerFonts(fontArray = []) { | ||
if (!Canvacord.assets.font.loaded) await Canvacord.assets.font.load(); | ||
if (!Canvacord.assets.image.loaded) await Canvacord.assets.image.load(); | ||
if (!fontArray.length) { | ||
await Canvacord.__wait(); | ||
// default fonts | ||
Canvas.registerFont(assets("FONT").MANROPE_BOLD, { | ||
Canvas.registerFont(Canvacord.assets.font.get("MANROPE_BOLD"), { | ||
family: "Manrope", | ||
@@ -391,3 +394,3 @@ weight: "bold", | ||
Canvas.registerFont(assets("FONT").MANROPE_REGULAR, { | ||
Canvas.registerFont(Canvacord.assets.font.get("MANROPE_REGULAR"), { | ||
family: "Manrope", | ||
@@ -398,3 +401,3 @@ weight: "regular", | ||
Canvas.registerFont(assets("FONT").WHITNEY_MEDIUM, { | ||
Canvas.registerFont(Canvacord.assets.font.get("WHITNEY_MEDIUM"), { | ||
family: "Whitney", | ||
@@ -405,3 +408,3 @@ weight: "regular", | ||
Canvas.registerFont(assets("FONT").WHITNEY_BOOK, { | ||
Canvas.registerFont(Canvacord.assets.font.get("WHITNEY_BOOK"), { | ||
family: "Whitney", | ||
@@ -412,3 +415,3 @@ weight: "bold", | ||
Canvas.registerFont(assets("FONT").ROBOTO_LIGHT, { | ||
Canvas.registerFont(Canvacord.assets.font.get("ROBOTO_LIGHT"), { | ||
family: "Roboto", | ||
@@ -419,3 +422,3 @@ weight: "light", | ||
Canvas.registerFont(assets("FONT").ROBOTO_REGULAR, { | ||
Canvas.registerFont(Canvacord.assets.font.get("ROBOTO_REGULAR"), { | ||
family: "Roboto", | ||
@@ -446,3 +449,3 @@ weight: "regular", | ||
const ctx = canvas.getContext("2d"); | ||
const background = await Canvas.loadImage(Canvacord.assets("IMAGE").BATSLAP); | ||
const background = await Canvas.loadImage(Canvacord.assets.image.get("BATSLAP")); | ||
ctx.drawImage(background, 0, 0, canvas.width, canvas.height); | ||
@@ -465,3 +468,3 @@ const avatar = await Canvas.loadImage(image1); | ||
const img = await Canvas.loadImage(image); | ||
const base = await Canvas.loadImage(Canvacord.assets("IMAGE").BEAUTIFUL); | ||
const base = await Canvas.loadImage(Canvacord.assets.image.get("BEAUTIFUL")); | ||
const canvas = Canvas.createCanvas(376, 400); | ||
@@ -484,3 +487,3 @@ const ctx = canvas.getContext("2d"); | ||
await this.__wait(); | ||
let layer = await Canvas.loadImage(Canvacord.assets("IMAGE").FACEPALM); | ||
let layer = await Canvas.loadImage(Canvacord.assets.image.get("FACEPALM")); | ||
let canvas = Canvas.createCanvas(632, 357); | ||
@@ -504,3 +507,3 @@ let ctx = canvas.getContext("2d"); | ||
await this.__wait(); | ||
let bg = await Canvas.loadImage(Canvacord.assets("IMAGE").GAY); | ||
let bg = await Canvas.loadImage(Canvacord.assets.image.get("GAY")); | ||
let img = await Canvas.loadImage(image); | ||
@@ -523,3 +526,3 @@ const canvas = Canvas.createCanvas(img.width, img.height); | ||
const img = await Canvas.loadImage(image); | ||
const bg = await Canvas.loadImage(Canvacord.assets("IMAGE").RIP); | ||
const bg = await Canvas.loadImage(Canvacord.assets.image.get("RIP")); | ||
const canvas = Canvas.createCanvas(244, 253); | ||
@@ -542,3 +545,3 @@ const ctx = canvas.getContext("2d"); | ||
const img = await Canvas.loadImage(blur); | ||
const bg = await Canvas.loadImage(Canvacord.assets("IMAGE").TRASH); | ||
const bg = await Canvas.loadImage(Canvacord.assets.image.get("TRASH")); | ||
@@ -561,3 +564,3 @@ const canvas = Canvas.createCanvas(bg.width, bg.height); | ||
const img = await Canvas.loadImage(image); | ||
const bg = await Canvas.loadImage(Canvacord.assets("IMAGE").HITLER); | ||
const bg = await Canvas.loadImage(Canvacord.assets.image.get("HITLER")); | ||
@@ -601,3 +604,3 @@ const canvas = Canvas.createCanvas(bg.width, bg.height); | ||
await this.__wait(); | ||
const layer = await Canvas.loadImage(Canvacord.assets("IMAGE").JOKEOVERHEAD); | ||
const layer = await Canvas.loadImage(Canvacord.assets.image.get("JOKEOVERHEAD")); | ||
const img = await Canvas.loadImage(image) | ||
@@ -624,3 +627,3 @@ const canvas = Canvas.createCanvas(425, 404); | ||
await this.__wait(); | ||
const background = await Canvas.loadImage(Canvacord.assets("IMAGE").DISTRACTED); | ||
const background = await Canvas.loadImage(Canvacord.assets.image.get("DISTRACTED")); | ||
const avatar1 = await Canvas.loadImage(await Canvacord.circle(image1)); | ||
@@ -650,3 +653,3 @@ const avatar2 = await Canvas.loadImage(await Canvacord.circle(image2)); | ||
const img = await Canvas.loadImage(image); | ||
const bg = await Canvas.loadImage(Canvacord.assets("IMAGE").AFFECT); | ||
const bg = await Canvas.loadImage(Canvacord.assets.image.get("AFFECT")); | ||
@@ -672,3 +675,3 @@ const canvas = Canvas.createCanvas(bg.width, bg.height); | ||
const img = await Canvas.loadImage(greyscale ? await Canvacord.greyscale(image) : image); | ||
const bg = await Canvas.loadImage(Canvacord.assets("IMAGE").JAIL); | ||
const bg = await Canvas.loadImage(Canvacord.assets.image.get("JAIL")); | ||
@@ -696,3 +699,3 @@ const canvas = Canvas.createCanvas(350, 350); | ||
const avatar1 = await Canvas.loadImage(image2); | ||
const background = await Canvas.loadImage(Canvacord.assets("IMAGE").BED); | ||
const background = await Canvas.loadImage(Canvacord.assets.image.get("BED")); | ||
@@ -721,3 +724,3 @@ const canvas = Canvas.createCanvas(background.width, background.height); | ||
const img = await Canvas.loadImage(image); | ||
const bg = await Canvas.loadImage(dark ? await Canvacord.invert(Canvacord.assets("IMAGE").DELETE) : Canvacord.assets("IMAGE").DELETE); | ||
const bg = await Canvas.loadImage(dark ? await Canvacord.invert(Canvacord.assets.image.get("DELETE")) : Canvacord.assets.image.get("DELETE")); | ||
@@ -872,3 +875,3 @@ const canvas = Canvas.createCanvas(bg.width, bg.height); | ||
await this.__wait(); | ||
const bg = await Canvas.loadImage(Canvacord.assets("IMAGE").OPINION); | ||
const bg = await Canvas.loadImage(Canvacord.assets.image.get("OPINION")); | ||
const ava = await Canvas.loadImage(avatar); | ||
@@ -922,3 +925,3 @@ | ||
await Canvacord.__wait(); | ||
const bg = await Canvas.loadImage(Canvacord.assets("IMAGE").OHNO); | ||
const bg = await Canvas.loadImage(Canvacord.assets.image.get("OHNO")); | ||
const canvas = Canvas.createCanvas(1000, 1000); | ||
@@ -945,3 +948,3 @@ const ctx = canvas.getContext("2d"); | ||
await this.__wait(); | ||
const base = await Canvas.loadImage(Canvacord.assets("IMAGE").CHANGEMYMIND); | ||
const base = await Canvas.loadImage(Canvacord.assets.image.get("CHANGEMYMIND")); | ||
const canvas = Canvas.createCanvas(base.width, base.height); | ||
@@ -999,5 +1002,5 @@ const ctx = canvas.getContext("2d"); | ||
await this.__wait() | ||
let avatar = await Canvas.loadImage(await Canvacord.circle(Canvacord.assets("IMAGE").CLYDE)); | ||
let badge = await Canvas.loadImage(Canvacord.assets("IMAGE").BOTBADGE); | ||
Canvas.registerFont(Canvacord.assets("FONT").WHITNEY_MEDIUM, { | ||
let avatar = await Canvas.loadImage(await Canvacord.circle(Canvacord.assets.image.get("CLYDE"))); | ||
let badge = await Canvas.loadImage(Canvacord.assets.image.get("BOTBADGE")); | ||
Canvas.registerFont(Canvacord.assets.font.get("WHITNEY_MEDIUM"), { | ||
family: "Whitney", | ||
@@ -1008,3 +1011,3 @@ weight: "regular", | ||
Canvas.registerFont(Canvacord.assets("FONT").MANROPE_REGULAR, { | ||
Canvas.registerFont(Canvacord.assets.font.get("MANROPE_REGULAR"), { | ||
family: "Manrope", | ||
@@ -1063,3 +1066,3 @@ weight: "regular", | ||
await this.__wait(); | ||
if (!options.image) options.image = Canvacord.assets("IMAGE").CLYDE; | ||
if (!options.image) options.image = Canvacord.assets.image.get("CLYDE"); | ||
if (!options.message) options.message = "Please provide text!"; | ||
@@ -1071,3 +1074,3 @@ if (!options.username) options.username = "Clyde"; | ||
Canvas.registerFont(Canvacord.assets("FONT").WHITNEY_MEDIUM, { | ||
Canvas.registerFont(Canvacord.assets.font.get("WHITNEY_MEDIUM"), { | ||
family: "Whitney", | ||
@@ -1078,3 +1081,3 @@ weight: "regular", | ||
Canvas.registerFont(Canvacord.assets("FONT").MANROPE_REGULAR, { | ||
Canvas.registerFont(Canvacord.assets.font.get("MANROPE_REGULAR"), { | ||
family: "Manrope", | ||
@@ -1126,3 +1129,3 @@ weight: "regular", | ||
let image = await Canvas.loadImage(options.image); | ||
let baseImage = await Canvas.loadImage(Canvacord.assets("IMAGE").PHUB); | ||
let baseImage = await Canvas.loadImage(Canvacord.assets.image.get("PHUB")); | ||
@@ -1157,3 +1160,3 @@ let canvas = Canvas.createCanvas(baseImage.width, baseImage.height); | ||
const img = await Canvas.loadImage(image); | ||
const bg = await Canvas.loadImage(Canvacord.assets("IMAGE").WANTED); | ||
const bg = await Canvas.loadImage(Canvacord.assets.image.get("WANTED")); | ||
@@ -1178,3 +1181,3 @@ const canvas = Canvas.createCanvas(bg.width, bg.height); | ||
const img = await Canvas.loadImage(await Canvacord.greyscale(image)); | ||
const bg = await Canvas.loadImage(Canvacord.assets("IMAGE").WASTED); | ||
const bg = await Canvas.loadImage(Canvacord.assets.image.get("WASTED")); | ||
@@ -1206,3 +1209,3 @@ const canvas = Canvas.createCanvas(512, 512); | ||
await this.__wait(); | ||
const bg = await Canvas.loadImage(!ops.dark ? Canvacord.assets("IMAGE").YOUTUBE : await Canvacord.invert(Canvacord.assets("IMAGE").YOUTUBE)); | ||
const bg = await Canvas.loadImage(!ops.dark ? Canvacord.assets.image.get("YOUTUBE") : await Canvacord.invert(Canvacord.assets.image.get("YOUTUBE"))); | ||
const avatar = await Canvas.loadImage(await Canvacord.circle(ops.avatar)); | ||
@@ -1246,3 +1249,3 @@ | ||
const img = await Canvas.loadImage(await Canvacord.circle(image)); | ||
const bg = await Canvas.loadImage(Canvacord.assets("IMAGE").SHIT); | ||
const bg = await Canvas.loadImage(Canvacord.assets.image.get("SHIT")); | ||
@@ -1333,3 +1336,3 @@ const canvas = Canvas.createCanvas(bg.width, bg.height); | ||
Canvas.registerFont(Canvacord.assets("FONT").WHITNEY_MEDIUM, { | ||
Canvas.registerFont(Canvacord.assets.font.get("WHITNEY_MEDIUM"), { | ||
family: "Whitney", | ||
@@ -1340,3 +1343,3 @@ weight: "regular", | ||
Canvas.registerFont(Canvacord.assets("FONT").MANROPE_REGULAR, { | ||
Canvas.registerFont(Canvacord.assets.font.get("MANROPE_REGULAR"), { | ||
family: "Manrope", | ||
@@ -1343,0 +1346,0 @@ weight: "regular", |
@@ -175,3 +175,3 @@ const Canvas = require("canvas"); | ||
// default fonts | ||
Canvas.registerFont(assets("FONT").MANROPE_BOLD, { | ||
Canvas.registerFont(assets.font.get("MANROPE_BOLD"), { | ||
family: "Manrope", | ||
@@ -182,3 +182,3 @@ weight: "bold", | ||
Canvas.registerFont(assets("FONT").MANROPE_REGULAR, { | ||
Canvas.registerFont(assets.font.get("MANROPE_REGULAR"), { | ||
family: "Manrope", | ||
@@ -185,0 +185,0 @@ weight: "regular", |
@@ -105,3 +105,3 @@ const Canvas = require("canvas"); | ||
setTimeout(() => { | ||
Canvas.registerFont(assets("FONT").MANROPE_REGULAR, { | ||
Canvas.registerFont(assets.font.get("MANROPE_REGULAR"), { | ||
family: "Manrope", | ||
@@ -112,3 +112,3 @@ weight: "regular", | ||
Canvas.registerFont(assets("FONT").MANROPE_BOLD, { | ||
Canvas.registerFont(assets.font.get("MANROPE_BOLD"), { | ||
family: "Manrope", | ||
@@ -115,0 +115,0 @@ weight: "bold", |
191045
3847