[−][src]Static p5_sys::global::describe
pub static describe: DescribeInternalType
Creates a screen-reader accessible description for the canvas. The first parameter should be a string with a description of the canvas. The second parameter is optional. If specified, it determines how the description is displayed.
describe(text, LABEL)
displays
the description to all users as a
tombstone or exhibit label/caption in a
adjacent to the canvas. You can style it as you wish in your CSS.
describe(text, FALLBACK)
makes the
description accessible to screen-reader users only, in
a sub DOM inside the canvas element. If a second parameter is not
specified, by default, the description will only be available to
screen-reader users.
Examples
describe('pink square with red heart in the bottom right corner', LABEL);
background('pink');
fill('red');
noStroke();
ellipse(67, 67, 20, 20);
ellipse(83, 67, 20, 20);
triangle(91, 73, 75, 95, 59, 73);
let x = 0;
function draw() {
if (x > 100) {
x = 0;
}
background(220);
fill(0, 255, 0);
ellipse(x, 50, 40, 40);
x = x + 0.1;
describe('green circle at x pos ' + round(x) + ' moving to the right');
}
Parameters
text
description of the canvas
display?
either LABEL or FALLBACK (Optional)