zxcraxss-canvas 中文文档教程

发布于 2年前 浏览 15 项目主页 更新于 2年前

安装

$ npm install knights-canvas

const knights = require("knights-canvas");

404

 NPM

如何使用

Welcome

const knights = require("knights-canvas");
const fs = require('fs');

const image = await new knights.Welcome()
    .setUsername("UNDEFINED")
    .setGuildName("WIBU NOLEP")
    .setGuildIcon("https://i.ibb.co/G5mJZxs/rin.jpg")
    .setMemberCount("120")
    .setAvatar("https://i.ibb.co/1s8T3sY/48f7ce63c7aa.jpg")
    .setBackground("https://i.ibb.co/4YBNyvP/images-76.jpg")
    .toAttachment();

  data = image.toBuffer();
  await fs.writeFileSync(__path +'/tmp/swelkom.png', data)

结果

Welcome2

const knights = require("knights-canvas");
const fs = require('fs');

var image = await new knights.Welcome2()
    .setAvatar("you url pic")
    .setUsername("your name") 
    .setBg("background") 
    .setGroupname("guild name/groupname") 
    .setMember("member count") 
    .toAttachment();

  data = image.toBuffer();
  await fs.writeFileSync(__path +'/tmp/sewelkom2.png', data)

Rank

const knights = require("knights-canvas");
const fs = require('fs');

const image = await new knights.Rank()
    .setAvatar("https://i.ibb.co/1s8T3sY/48f7ce63c7aa.jpg") 
    .setUsername("Lingz") 
    .setBg("https://i.ibb.co/4YBNyvP/images-76.jpg")
    .setNeedxp("1000") 
    .setCurrxp("100") 
    .setLevel("6") 
    .setRank("https://i.ibb.co/Wn9cvnv/FABLED.png") 
    .toAttachment();

  data = image.toBuffer();
  await fs.writeFileSync(__path +'/tmp/srank.png', data)

结果

Level Up

const knights = require("knights-canvas");
const fs = require('fs');

const image = await new knights.Up()
    .setAvatar("https://i.ibb.co/1s8T3sY/48f7ce63c7aa.jpg") 
    .toAttachment();

  data = image.toBuffer();
  await fs.writeFileSync(__path +'/tmp/slevelup.png', data)

结果

更新

Maker

Horny

const knights = require("knights-canvas");
const fs = require('fs');
const image = await new knights.Horny()
    .setAvatar("https://i.ibb.co/1s8T3sY/48f7ce63c7aa.jpg")
    .toBuild();
  data = image.toBuffer();
  await fs.writeFileSync(__path +'/tmp/horny', data)

结果

Jojo

const knights = require("knights-canvas");
const fs = require('fs');
const image = await new knights.Jo()
    .setImage("https://i.ibb.co/xG8L4mz/images.jpg")
    .toBuild();
  data = image.toBuffer();
  await fs.writeFileSync(__path +'/tmp/jojo.png', data)

结果

Patrick

const knights = require("knights-canvas");
const fs = require('fs');
const image = await new knights.Patrick()
    .setAvatar("https://i.ibb.co/xG8L4mz/images.jpg")
    .toAttachment();
  data = image.toBuffer();
  await fs.writeFileSync(__path +'/tmp/pat.png', data)

结果

Bonk

const knights = require("knights-canvas");
const fs = require('fs');
const image = await new knights.Bonk()
    .setAvatar1("https://i.ibb.co/G5mJZxs/rin.jpg")
    .setAvatar2("https://i.ibb.co/BZgRzh0/IMG-20210621-WA0000.jpg")
    .toBuild();
  data = image.toBuffer();
  await fs.writeFileSync(__path +'/tmp/bonk.png', data)

结果

海绵宝宝燃烧

const knights = require("knights-canvas");
const fs = require('fs');
const image = await new knights.Burn()
    .setAvatar("https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQwXmOgfrrGKdaGbnisffjJaUM2eU2izUBf3w&usqp=CAU")
    .toAttachment();
  data = image.toBuffer();
  await fs.writeFileSync(__path +'/tmp/burn.png', data)

结果

✉ 需要吗? 上与我聊天

Telegram

感谢

我的团队的帮助
骑士画布

(^ω^ )

Installation

$ npm install knights-canvas

const knights = require("knights-canvas");

404

NPM

how to use

Welcome

const knights = require("knights-canvas");
const fs = require('fs');

const image = await new knights.Welcome()
    .setUsername("UNDEFINED")
    .setGuildName("WIBU NOLEP")
    .setGuildIcon("https://i.ibb.co/G5mJZxs/rin.jpg")
    .setMemberCount("120")
    .setAvatar("https://i.ibb.co/1s8T3sY/48f7ce63c7aa.jpg")
    .setBackground("https://i.ibb.co/4YBNyvP/images-76.jpg")
    .toAttachment();

  data = image.toBuffer();
  await fs.writeFileSync(__path +'/tmp/swelkom.png', data)

result

Welcome2

const knights = require("knights-canvas");
const fs = require('fs');

var image = await new knights.Welcome2()
    .setAvatar("you url pic")
    .setUsername("your name") 
    .setBg("background") 
    .setGroupname("guild name/groupname") 
    .setMember("member count") 
    .toAttachment();

  data = image.toBuffer();
  await fs.writeFileSync(__path +'/tmp/sewelkom2.png', data)

Rank

const knights = require("knights-canvas");
const fs = require('fs');

const image = await new knights.Rank()
    .setAvatar("https://i.ibb.co/1s8T3sY/48f7ce63c7aa.jpg") 
    .setUsername("Lingz") 
    .setBg("https://i.ibb.co/4YBNyvP/images-76.jpg")
    .setNeedxp("1000") 
    .setCurrxp("100") 
    .setLevel("6") 
    .setRank("https://i.ibb.co/Wn9cvnv/FABLED.png") 
    .toAttachment();

  data = image.toBuffer();
  await fs.writeFileSync(__path +'/tmp/srank.png', data)

result

Level Up

const knights = require("knights-canvas");
const fs = require('fs');

const image = await new knights.Up()
    .setAvatar("https://i.ibb.co/1s8T3sY/48f7ce63c7aa.jpg") 
    .toAttachment();

  data = image.toBuffer();
  await fs.writeFileSync(__path +'/tmp/slevelup.png', data)

result

update

Maker

Horny

const knights = require("knights-canvas");
const fs = require('fs');
const image = await new knights.Horny()
    .setAvatar("https://i.ibb.co/1s8T3sY/48f7ce63c7aa.jpg")
    .toBuild();
  data = image.toBuffer();
  await fs.writeFileSync(__path +'/tmp/horny', data)

result

Jojo

const knights = require("knights-canvas");
const fs = require('fs');
const image = await new knights.Jo()
    .setImage("https://i.ibb.co/xG8L4mz/images.jpg")
    .toBuild();
  data = image.toBuffer();
  await fs.writeFileSync(__path +'/tmp/jojo.png', data)

result

Patrick

const knights = require("knights-canvas");
const fs = require('fs');
const image = await new knights.Patrick()
    .setAvatar("https://i.ibb.co/xG8L4mz/images.jpg")
    .toAttachment();
  data = image.toBuffer();
  await fs.writeFileSync(__path +'/tmp/pat.png', data)

result

Bonk

const knights = require("knights-canvas");
const fs = require('fs');
const image = await new knights.Bonk()
    .setAvatar1("https://i.ibb.co/G5mJZxs/rin.jpg")
    .setAvatar2("https://i.ibb.co/BZgRzh0/IMG-20210621-WA0000.jpg")
    .toBuild();
  data = image.toBuffer();
  await fs.writeFileSync(__path +'/tmp/bonk.png', data)

result

Spongebob Burn

const knights = require("knights-canvas");
const fs = require('fs');
const image = await new knights.Burn()
    .setAvatar("https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQwXmOgfrrGKdaGbnisffjJaUM2eU2izUBf3w&usqp=CAU")
    .toAttachment();
  data = image.toBuffer();
  await fs.writeFileSync(__path +'/tmp/burn.png', data)

result

✉ req ? chat me on

Telegram

Credits

thanks my team for the help
knights-canvas

(^ω^)

    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文