Skip to content
ExamplesOpen editor ↗

tlatsaPhikisele

→ set()

Paints a single dot of the canvas one colour.

tlatsaPhikisele(x, y, colour)

tlatsaPhikisele(x, y, colour) puts a colour on a single dot. The word tlatsa is the one tlatsaMmala uses — to fill something with colour.

⚠ Nothing shows until you call ntshwafatsaDiphikisele. This is what separates tlatsaPhikisele from thalaNtlha, and it was measured: after tlatsaPhikisele(5, 5, …), mmalaWaPhikisele(5, 5) still returns the old colour until ntshwafatsaDiphikisele is called.

The difference from thalaNtlha: thalaNtlha obeys mothaloMmala, boketeMothalo and any sutisa/dikologa you have applied. tlatsaPhikisele obeys none of them — it writes to the dot directly.

A single number is a grey. tlatsaPhikisele(6, 6, 0) gives a black dot — measured: [0, 0, 0, 255].

NameTypeDescription
xpaloThe x position of the dot.
ypaloThe y position of the dot.
mmalammalaA colour — bopaMmala(…), or a single number for a grey.
Scattered dots, painted fast
tiro setaLoeto() {
  thalaKanefase(300, 160);
  bokamorago(245);

  gopheta (diri i = 0; i < 900; i = i + 1) {
    diri x = paloEpe(0, 300);
    diri y = paloEpe(0, 160);
    tlatsaPhikisele(x, y, bopaMmala(paloEpe(0, 255), 90, 140));
  }
  ntshwafatsaDiphikisele();

  tlhalosa('Dintlha tse dinnye tse di kgasitsweng mo kanefaseng ka mebala e e farologaneng.');
}

mmalaWaPhikisele, ntshwafatsaDiphikisele, balaDiphikisele, thalaNtlha