-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Updating all the broken refrence examples. #7739
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 26 commits
81ff09d
77a1492
302e25b
ade54ac
9df7595
28cf83f
5d2aad1
9e7445f
12a6a17
8f017b0
eaedc0a
2abbd76
7b5d67c
c3851b3
dac7ff2
d19fefc
e4acb5f
9039796
63af24e
24763af
301d42f
dd6a988
58e8746
25b164e
bf86b77
289c176
36b0bb0
608d2fa
68dd3ae
cefb10b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -81,6 +81,11 @@ function outputs(p5, fn){ | |
| * | ||
| * <div> | ||
| * <code> | ||
| * | ||
| * function setup(){ | ||
| * createCanvas(100, 100); | ||
| * } | ||
| * | ||
| * function draw() { | ||
| * // Add the text description. | ||
| * textOutput(); | ||
|
|
@@ -101,6 +106,11 @@ function outputs(p5, fn){ | |
| * | ||
| * <div> | ||
| * <code> | ||
| * | ||
| * function setup(){ | ||
| * createCanvas(100, 100); | ||
| * } | ||
| * | ||
| * function draw() { | ||
| * // Add the text description and | ||
| * // display it for debugging. | ||
|
|
@@ -215,6 +225,11 @@ function outputs(p5, fn){ | |
| * | ||
| * <div> | ||
| * <code> | ||
| * | ||
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| * function setup() { | ||
| * createCanvas(100, 100); | ||
| * } | ||
| * | ||
| * function draw() { | ||
| * // Add the grid description. | ||
| * gridOutput(); | ||
|
|
@@ -235,6 +250,11 @@ function outputs(p5, fn){ | |
| * | ||
| * <div> | ||
| * <code> | ||
| * | ||
| * function setup(){ | ||
| * createCanvas(100, 100); | ||
| * } | ||
| * | ||
| * function draw() { | ||
| * // Add the grid description and | ||
| * // display it for debugging. | ||
|
|
@@ -255,6 +275,7 @@ function outputs(p5, fn){ | |
| * </div> | ||
| */ | ||
|
|
||
|
|
||
| fn.gridOutput = function(display) { | ||
| // p5._validateParameters('gridOutput', arguments); | ||
| //if gridOutput is already true | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -462,9 +462,10 @@ for (const k in constants) { | |
| * ``` | ||
| * | ||
| * Code placed in `setup()` will run once before code placed in | ||
| * <a href="#/p5/draw">draw()</a> begins looping. If the | ||
| * <a href="#/p5/preload">preload()</a> is declared, then `setup()` will | ||
| * run immediately after <a href="#/p5/preload">preload()</a> finishes | ||
| * <a href="#/p5/draw">draw()</a> begins looping. When `setup()` is declared async, | ||
|
||
| * execution pauses at each `await` until the promise resolves, ensuring all assets | ||
|
||
| * are loaded before the sketch continues. | ||
| * | ||
| * loading assets. | ||
| * | ||
| * Note: `setup()` doesn’t have to be declared, but it’s common practice to do so. | ||
|
|
@@ -535,7 +536,6 @@ for (const k in constants) { | |
| * </code> | ||
| * </div> | ||
| */ | ||
|
|
||
| /** | ||
| * A function that's called repeatedly while the sketch runs. | ||
| * | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -352,7 +352,7 @@ function dom(p5, fn){ | |
| * let slider; | ||
| * | ||
| * function setup() { | ||
| * createCanvas(100, 100); | ||
| * createCanvas(200, 200); | ||
| * | ||
| * // Create a paragraph element and place | ||
| * // it at the top of the canvas. | ||
|
|
@@ -596,7 +596,7 @@ function dom(p5, fn){ | |
| * 'https://p5js.org/assets/img/asterisk-01.png', | ||
|
||
| * 'The p5.js magenta asterisk.' | ||
| * ); | ||
| * img.position(0, -10); | ||
| * img.position(0, 10); | ||
| * | ||
| * describe('A gray square with a magenta asterisk in its center.'); | ||
| * } | ||
|
|
@@ -945,7 +945,7 @@ function dom(p5, fn){ | |
| * | ||
| * // Create a checkbox and place it beneath the canvas. | ||
| * checkbox = createCheckbox(); | ||
| * checkbox.position(0, 100); | ||
| * checkbox.position(0, 70); | ||
| * | ||
| * describe('A black square with a checkbox beneath it. The square turns white when the box is checked.'); | ||
| * } | ||
|
|
@@ -971,7 +971,7 @@ function dom(p5, fn){ | |
| * // Create a checkbox and place it beneath the canvas. | ||
| * // Label the checkbox "white". | ||
| * checkbox = createCheckbox(' white'); | ||
| * checkbox.position(0, 100); | ||
| * checkbox.position(0, 70); | ||
| * | ||
| * describe('A black square with a checkbox labeled "white" beneath it. The square turns white when the box is checked.'); | ||
| * } | ||
|
|
@@ -997,7 +997,7 @@ function dom(p5, fn){ | |
| * // Create a checkbox and place it beneath the canvas. | ||
| * // Label the checkbox "white" and set its value to true. | ||
| * checkbox = createCheckbox(' white', true); | ||
| * checkbox.position(0, 100); | ||
| * checkbox.position(0, 70); | ||
| * | ||
| * describe('A white square with a checkbox labeled "white" beneath it. The square turns black when the box is unchecked.'); | ||
| * } | ||
|
|
@@ -1876,7 +1876,7 @@ function dom(p5, fn){ | |
| * let img; | ||
| * | ||
| * function setup() { | ||
| * createCanvas(100, 100); | ||
| * createCanvas(200, 200); | ||
| * | ||
| * // Create a file input and place it beneath | ||
| * // the canvas. | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -142,18 +142,18 @@ function acceleration(p5, fn){ | |
| * @example | ||
| * <div> | ||
| * <code> | ||
| * let rotationX = 0; // Angle in degrees | ||
| * | ||
| * function setup() { | ||
| * createCanvas(100, 100, WEBGL); | ||
| * createCanvas(200, 200, WEBGL); // Create 3D canvas | ||
| * } | ||
| * | ||
| * function draw() { | ||
| * background(200); | ||
| * //rotateZ(radians(rotationZ)); | ||
| * rotateX(radians(rotationX)); | ||
| * //rotateY(radians(rotationY)); | ||
| * box(200, 200, 200); | ||
| * describe(`red horizontal line right, green vertical line bottom. | ||
| * black background.`); | ||
| * background(220); // Set light gray background | ||
| * rotateX(radians(rotationX)); // Rotate around X-axis | ||
| * normalMaterial(); // Apply simple shaded material | ||
| * box(60); // Draw 3D cube (60 units wide) | ||
| * rotationX = (rotationX + 2) % 360; // Increment rotation (2° per frame) | ||
| * } | ||
| * </code> | ||
| * </div> | ||
|
|
@@ -175,18 +175,18 @@ function acceleration(p5, fn){ | |
| * @example | ||
| * <div> | ||
| * <code> | ||
| * let rotationY = 0; // Angle in degrees | ||
| * | ||
| * function setup() { | ||
| * createCanvas(100, 100, WEBGL); | ||
| * createCanvas(200, 200, WEBGL); // Create 3D canvas | ||
| * } | ||
| * | ||
| * function draw() { | ||
| * background(200); | ||
| * //rotateZ(radians(rotationZ)); | ||
| * //rotateX(radians(rotationX)); | ||
| * rotateY(radians(rotationY)); | ||
| * box(200, 200, 200); | ||
| * describe(`red horizontal line right, green vertical line bottom. | ||
| * black background.`); | ||
| * background(220); // Set light gray background | ||
| * rotateY(radians(rotationY)); // Rotate around Y-axis (vertical) | ||
| * normalMaterial(); // Apply simple shaded material | ||
| * box(60); // Draw 3D cube (60 units wide) | ||
| * rotationY = (rotationY + 2) % 360; // Increment rotation (2° per frame) | ||
| * } | ||
| * </code> | ||
| * </div> | ||
|
|
@@ -209,18 +209,18 @@ function acceleration(p5, fn){ | |
| * @example | ||
| * <div> | ||
| * <code> | ||
| * let rotationZ = 0; // Angle in degrees | ||
| * | ||
| * function setup() { | ||
| * createCanvas(100, 100, WEBGL); | ||
| * createCanvas(200, 200, WEBGL); // Create 3D canvas | ||
| * } | ||
| * | ||
| * function draw() { | ||
| * background(200); | ||
| * rotateZ(radians(rotationZ)); | ||
| * //rotateX(radians(rotationX)); | ||
| * //rotateY(radians(rotationY)); | ||
| * box(200, 200, 200); | ||
| * describe(`red horizontal line right, green vertical line bottom. | ||
| * black background.`); | ||
| * background(220); | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nice, thank you for the expanded example 👍 |
||
| * rotateZ(radians(rotationZ)); // Rotate around Z-axis | ||
| * normalMaterial(); // Apply simple shaded material | ||
| * box(60); // Draw 3D cube | ||
| * rotationZ = (rotationZ + 2) % 360; // Increment rotation angle | ||
| * } | ||
| * </code> | ||
| * </div> | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @ksen0 , are these functions still broken on my branch as well i.e. After this PR?. I think I tried fixing textOutput() and gridOutput here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suspect there's bigger problems here because they're broken on 1.x and 2.0. I'll make a separate 1.x/2.0 issue tomorrow about it, please feel free to ignore for this PR. Thank you!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, So sorry for the oversight, I think the sketch works correctly but it didn't shows up correctly in the website. I'll have a look today late night or tomorrow morning to figure out what's going on. Thanks for the patience @ksen0 :)