First we're going to make some buttons that will let us
control the width of the line.
We know from an earlier S2JS topic how to draw in different colours and thicknesses, but we can also see the details on the w3schools canvas reference.
All we need is a function that lets us set the width:
function SetWidth(n) {
ctx.lineWidth=n;
}
And a button that calls the function:
<button onclick="SetWidth(10)"> Wide </button>
Try it — hold the mouse button down and draw, then
click the button marked "
Wide" and draw a bit more.