Skip to content

consider adding char shape type (i.e. emoji) #82

@catdad

Description

@catdad

Example code:

function text(context, x, y, scaleX, scaleY, rotation, char) {
  context.setTransform(scaleX, 0, 0, scaleY, x, y);
  context.rotate(rotation);
  context.textAlign = 'center';
  context.font = 'normal normal 16px auto';
  context.fillText(char, 0, 0);
  context.setTransform(1,0,0,1,0,0);
}
...
text(context, fetti.x, fetti.y, Math.abs(x2 - x1) * 0.2, Math.abs(y2 - y1) * 0.2, Math.PI / 10 * fetti.wobble, fetti.shape.char);
...
confetti({
  shapes: [{ type: 'char', char: '💩' }]
});

I am guessing we'd need an additional font family argument.

This code has very poor performance. Any acceptable solution will need to solve that.

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature requestA neat new idea for this projecthelp wantedIssue could use a contributor

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions