setup()
setup() runs exactly once when the sketch starts. It's the right place to configure the canvas and any drawing settings - like text alignment and size - that stay constant unless you explicitly change them later.
function setup() { createCanvas(windowWidth, windowHeight); textAlign(CENTER, CENTER); textSize(80); }
Line-by-line explanation (3 lines)
createCanvas(windowWidth, windowHeight);- Creates a canvas that fills the entire browser window, so the coin scene always matches the screen size.
textAlign(CENTER, CENTER);- Sets text so it's drawn centered on both the horizontal and vertical axis around the x,y coordinates you give it - important because the coin's letter is drawn at (0,0) after translating to the center.
textSize(80);- Sets a default large font size, later reused for the H/T letter on the coin face.