Skip to content
ExamplesOpen editor ↗

tlhalosa

→ describe()

Writes a description of the canvas that screen readers can read.

tlhalosa(description)

Someone who cannot see does not see what your sketch draws. tlhalosa says what is on the canvas in words, and a screen reader reads it out.

Write it as you would tell someone over the phone: “A red circle moving across a white background.” Say what can be seen and what is happening, not what code makes it happen.

Every showcase example in Bopa carries a tlhalosa line. That is the first rule of writing an example here, not an extra step — making things should be something everyone can take part in.

Call it once in setaLoeto when the sketch does not change, or in tshwantsha when it does. Calling tlhalosa again replaces the earlier description.

NameTypeDescription
tlhalosomokwaloWhat is on the canvas, in words.
A sketch that describes itself
tiro setaLoeto() {
  thalaKanefase(400, 240);
  bokamorago(245);

  tlogelaMothalo();
  tlatsaMmala(230, 70, 60);
  thalaSediko(140, 120, 130);

  tlatsaMmala(60, 130, 200);
  thalaSekwere(230, 60, 120);

  tlhalosa('Sediko se sekhibidu se se fa molemeng le sekwere se se botala jwa loapi se se fa mojeng, mo bokamoragong jo bosweu.');
}

tlhalosaKarolo, setaLoeto