You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
11 lines
356 B
JavaScript
11 lines
356 B
JavaScript
'use strict';
|
|
|
|
module.exports = function drawCharacter(canvas, character, fontFamily, fontSize) {
|
|
let context = canvas.getContext("2d");
|
|
context.textAlign = "center";
|
|
context.textBaseline = "alphabetic";
|
|
context.font = `${fontSize}px '${fontFamily}'`;
|
|
context.fillStyle = "white";
|
|
context.fillText(character, canvas.width / 2, canvas.height / 2);
|
|
};
|