setup()
setup() runs once when the sketch starts. It's the perfect place to configure your canvas size and apply one-time settings like hiding the cursor.
function setup() {
createCanvas(windowWidth, windowHeight);
noCursor(); // hide default cursor for a cleaner effect
}
Line-by-line explanation (2 lines)
createCanvas(windowWidth, windowHeight);- Creates a canvas that fills the entire browser window, using windowWidth and windowHeight so it adapts to any screen size
noCursor();- Hides the default mouse cursor, making the glowing clone at your mouse position become the visual cursor instead