Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/abh80/discord-emoji-canvas
A canvas module for adding custom emojis of discord to canvas!
https://github.com/abh80/discord-emoji-canvas
Last synced: 2 days ago
JSON representation
A canvas module for adding custom emojis of discord to canvas!
- Host: GitHub
- URL: https://github.com/abh80/discord-emoji-canvas
- Owner: abh80
- License: mit
- Created: 2020-07-31T04:18:02.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2020-08-04T05:24:51.000Z (over 4 years ago)
- Last Synced: 2024-04-26T18:21:59.503Z (9 months ago)
- Language: TypeScript
- Size: 8.79 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# discord-emoji-canvas
An easy to use module for canvas which supports custom emojis of discord!!
# Installing
```bash
npm i discord-emoji-canvas
```
# Getting Started
- Typescript
```ts
import {Canvas,fillWithEmoji} from 'discord-emoji-canvas'
const canvas = Canvas.CreateCanvas(200,200) // creating a canvas
const ctx = canvas.getContext('2d') //context
ctx.fillStyle = '#ffffff' //selecting any color, i can only remember the hex of white x)
await fillWithEmoji(ctx,"hello",20,20) //context,text(supports emoji),x,y
const buffer = canvas.toBuffer()
```
- Javascript
```js
const {Canvas,fillWithEmoji} = require('discord-emoji-canvas')
const canvas = Canvas.CreateCanvas(200,200) // creating a canvas
const ctx = canvas.getContext('2d') //context
ctx.fillStyle = '#ffffff' //selecting any color, i can only remember the hex of white x)
await fillWithEmoji(ctx,"hello",20,20) //context,text(supports emoji),x,y
const buffer = canvas.toBuffer()
```