Refer to the design of canvas-confetti https://github.com/catdad/canvas-confetti/blob/4c1c86d19c265414c030df20b4090183c1042455/src/confetti.js#L16
const shape = fromText();
// or
const shape = fromImage();
// {
// type: 'text' | 'image';
// ...
// }
const {} = backmoji(canvas, {
shape
})
It's better to separate the process of rendering (text or images) from the process of creating patterns (such as grid patterns or center rotation images).
Refer to the design of
canvas-confettihttps://github.com/catdad/canvas-confetti/blob/4c1c86d19c265414c030df20b4090183c1042455/src/confetti.js#L16It's better to separate the process of rendering (text or images) from the process of creating patterns (such as grid patterns or center rotation images).