Попытка добавить два разных текста узла-холста вместе - PullRequest
0 голосов
/ 18 апреля 2020

Пытаясь заставить userText и disText появляться рядом друг с другом.

Допустим, userText = hello и disText = #world, я хочу соединить эти две строки вместе, как hello#world с hello с другим шрифтом / цветом, чем #world.

    ctx.font = primaryText(canvas, message.author.username);
    ctx.fillStyle = '#ffffff';
    var userText = ctx.fillText(message.author.username,  canvas.width / 2.8, canvas.height / 2.0);

    ctx.font = secondaryText(canvas, message.author.username);
    ctx.fillStyle = '#dedede';
    var disText = ctx.fillText(message.author.discriminator, canvas.width / 2.8, canvas.height / 2.0);
...