Skip to content
ExamplesOpen editor ↗

phimola

→ clear()

Wipes the canvas back to fully transparent.

phimola()

phimola is not the same as bokamorago. bokamorago paints over what was there with a solid colour; phimola takes it away, leaving the canvas showing whatever is behind it on the page.

It is what you want for an animation that has to sit on the page on its own, or when you want the trail of earlier shapes gone without putting a colour in its place.

⚠ Call phimola() with no arguments. Four optional components (r, g, b, alpha) can be written, but on a 2D canvas — the only kind Bopa draws on — they are dropped entirely: the renderer method that does the work takes no parameters at all. So phimola(1, 0, 0, 1) does exactly what phimola() does. When you want a colour, use bokamorago.

A moving circle that leaves no trail
diri x = 0;

tiro setaLoeto() {
  thalaKanefase(400, 200);
}

tiro tshwantsha() {
  phimola();
  tlogelaMothalo();
  tlatsaMmala(230, 60, 90);
  thalaSediko(x, 100, 60);
  x = x + 3;
  fa (x > 400) {
    x = 0;
  }
}
Draw, then wipe it all away
tiro setaLoeto() {
  thalaKanefase(400, 200);
  bokamorago(220);
  tlogelaMothalo();
  tlatsaMmala(230, 60, 90);
  thalaSediko(120, 100, 90);
  phimola();
  tlatsaMmala(30, 80, 200);
  thalaSediko(280, 100, 90);
}

bokamorago, alpha, thalaKanefase