Skip to content
ExamplesOpen editor ↗

lekanyaKanefase

→ resizeCanvas()

Changes the canvas width and height while the sketch is running.

lekanyaKanefase(bophara, boleele)

lekanyaKanefase(bophara, boleele) gives the canvas a new size. It also updates bophara and boleele — the numbers your sketch reads — so the code after it knows the new size by itself.

It clears the canvas. Whatever was drawn is gone, and tshwantsha is called again straight away. This is measured: fill the canvas with a colour, call lekanyaKanefase, and the pixel that held that colour is transparent again.

It pairs with fensetereEFetogile. The common idiom is to call lekanyaKanefase(bopharaFensetere, boleeleFensetere) inside fensetereEFetogile, so the canvas follows the window when the reader drags it.

It does not refuse a nonsense size. lekanyaKanefase(0, 0) and lekanyaKanefase(-50, -50) are accepted without complaint — bophara simply becomes 0 or -50. It is said here so that you know.

NameTypeDescription
bopharapaloThe new canvas width in pixels.
boleelepaloThe new canvas height in pixels.
A canvas that follows the window
tiro setaLoeto() {
  thalaKanefase(bopharaFensetere, boleeleFensetere);
  tlhalosa('Sediko se sekhibidu se se nnang fa gare ga fensetere le fa o e gogolola.');
}

tiro fensetereEFetogile() {
  lekanyaKanefase(bopharaFensetere, boleeleFensetere);
}

tiro tshwantsha() {
  bokamorago(24, 28, 40);
  tlogelaMothalo();
  tlatsaMmala(230, 70, 90);
  thalaSediko(bophara / 2, boleele / 2, palopotlana(bophara, boleele) / 3);
}

thalaKanefase, fensetereEFetogile, bopharaFensetere, boleeleFensetere, bophara, boleele