Workshop › Chess › Step 19 of 48
Write whose turn it is centered above the board, in the space TOP left free.
```js
const message = turn === 'w' ? 'White to move' : 'Black to move'
ctx.fillStyle = 'white'
ctx.font = 'bold 17px sans-serif'
ctx.textAlign = 'center'
ctx.textBaseline = 'alphabetic'
ctx.fillText(message, canvas.width / 2, 34)
```turn.canvas.width / 2 with textAlign = 'center' centers it; y = 34 is in the top margin.textBaseline = 'alphabetic' puts text back on the normal line (the pieces set it to 'middle').At the end of draw (under the dot loop, before the last }), leave an empty line and write the message lines.
Skills: Drawing on a canvas
← Click a dot to move The rook slides →