-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Closed
Labels
Description
Most appropriate sub-area of p5.js?
- Accessibility
- Color
- Core/Environment/Rendering
- Data
- DOM
- Events
- Image
- IO
- Math
- Typography
- Utilities
- WebGL
- Build Process
- Unit Testing
- Internalization
- Friendly Errors
- Other (specify if possible)
p5.js version
1.9.0
Web browser and version
Chrome 118, Firefox 120, Safari 17
Operating System
macOS
Steps to reproduce this
Steps:
- Draw a circle at the center of the canvas.
- Call
textOutput(LABEL)and view the results. - Move the circle to the top-left to test an idea.
- Call
pixelDensity(1)to test the idea a little more.
Original
function setup() {
createCanvas(400, 400);
textOutput(LABEL);
}
function draw() {
background(220);
circle(200, 200, 50);
}The sketch above produces the following description:
Text Output
Your output is a, 400 by 400 pixels, white canvas containing the following shape:
- white circle, at bottom right, covering 1% of the canvas.
white circle location = bottom right area = 1%
Move the circle to the top-left
function setup() {
createCanvas(400, 400);
textOutput(LABEL);
}
function draw() {
background(220);
circle(100, 100, 50);
}The sketch above produces the following description:
Text Output
Your output is a, 400 by 400 pixels, white canvas containing the following shape:
- white circle, at middle, covering 1% of the canvas.
white circle location = middle area = 1%
Change the pixel density
function setup() {
createCanvas(400, 400);
textOutput(LABEL);
pixelDensity(1);
}
function draw() {
background(220);
circle(200, 200, 50);
}The sketch above produces the following description:
Text Output
Your output is a, 400 by 400 pixels, white canvas containing the following shape:
- white circle, at middle, covering 1% of the canvas.
white circle location = middle area = 1%