INNER CODE UNIT · TypeScript
textSize
jamesroutley/24a2 · src/engine.ts:579
const textSize = 20; // px
ctx.save();
const textX = 0;
const textY =
this._dotSize * this._gridHeight +
this._gapSize * (this._gridHeight - 1) +
32;
ctx.clearRect(
textX,
textY - textSize,
this._dotSize * this._gridWidth + this._gapSize * (this._gridWidth - 1),
100 // This is a bit arbitrary - we just want to clear the whole bottom of the canvas
);
ctx.font = `${textSize}px monospace`;
ctx.fillText(text, textX, textY);
ctx.restore();