<div>
<code>
function setup() {
// Add the text description.
textOutput();
// Draw a couple of shapes.
background(200);
fill(255, 0, 0);
circle(20, 20, 20);
fill(0, 0, 255);
square(50, 50, 50);
// Add a general description of the canvas.
describe('A red circle and a blue square on a gray background.');
}
</code>
</div>
<div>
<code>
function setup() {
// Add the text description and
// display it for debugging.
textOutput(LABEL);
// Draw a couple of shapes.
background(200);
fill(255, 0, 0);
circle(20, 20, 20);
fill(0, 0, 255);
square(50, 50, 50);
// Add a general description of the canvas.
describe('A red circle and a blue square on a gray background.');
}
</code>
</div>
<div>
<code>
function draw() {
// Add the text description.
textOutput();
// Draw a moving circle.
background(200);
let x = frameCount * 0.1;
fill(255, 0, 0);
circle(x, 20, 20);
fill(0, 0, 255);
square(50, 50, 50);
// Add a general description of the canvas.
describe('A red circle moves from left to right above a blue square.');
}
</code>
</div>
<div>
<code>
function draw() {
// Add the text description and
// display it for debugging.
textOutput(LABEL);
// Draw a moving circle.
background(200);
let x = frameCount * 0.1;
fill(255, 0, 0);
circle(x, 20, 20);
fill(0, 0, 255);
square(50, 50, 50);
// Add a general description of the canvas.
describe('A red circle moves from left to right above a blue square.');
}
</code>
</div> |