-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Closed
Description
I'm using the latest version of the p5.js editor (p5.js version 1.4.1), and I have code like this:
function setup() {
createCanvas(400, 400);
}
function draw() {
background(220);
// This line causes an error: "p5.js says: you have used a p5.js reserved function "width"
// make sure you change the function name to something else."
let x = constrain(200, 0, width);
circle(x, 200, 100);
}
When I run the sketch, the code works fine and I see a circle, but I also see this error message in the console:
p5.js says: you have used a p5.js reserved function "width" make sure you change the function name to something else.
+ More info: https://p5js.org/reference/#/p5/width
Details about the bug:
- p5.js version: 1.4.1
- Web browser and version: Chrome 103.0.5060.114
- Operating System: Windows 10
- Steps to reproduce this: Run this sketch: https://editor.p5js.org/KevinWorkman/sketches/1hXBA9MFY