This commit is contained in:
Renan LE CARO 2025-03-05 15:21:32 +01:00
parent 4bf6525690
commit ced49f3afd

View file

@ -3033,13 +3033,14 @@ function recordOneFrame() {
function drawMainCanvasOnSmallCanvas() {
if (!recordCanvasCtx) return
recordCanvasCtx.drawImage(canvas, offsetXRoundedDown, 0, gameZoneWidthRoundedUp, gameZoneHeight, 0, 0, recordCanvas.width, recordCanvas.height)
// Here we don't use drawText as we don't want to cache a picture for each distinct value of score
recordCanvasCtx.fillStyle = currentLevelInfo()?.black_puck ? '#000' : '#FFF'
recordCanvasCtx.textBaseline = "top";
recordCanvasCtx.font = "12px monospace";
recordCanvasCtx.textAlign = "right";
recordCanvasCtx.fillText(score.toString(), recordCanvas.width - 12, 12)
recordCanvasCtx.textAlign = "left";
recordCanvasCtx.fillText('Level ' + (currentLevel + 1) + '/' + max_levels(), 12, 12)
}