Skip to content

Commit

Permalink
Restore git cleaned textRenderer.js
Browse files Browse the repository at this point in the history
  • Loading branch information
Even Alander committed Jan 26, 2021
1 parent d567909 commit 365ac23
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/textRenderer.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
export default function textRenderer(canvas) {
const context = canvas.getContext("2d");
const textMarginLeft = 20;
const textHeight = 50;
const textWidth = canvas.width - textMarginLeft * 2;

return function ({ line = 1, text }) {
context.fillStyle = "#999";
context.font = "32px sans-serif";
context.fillText(text, textMarginLeft, textHeight * line, textWidth);
};
}

0 comments on commit 365ac23

Please sign in to comment.