Skip to content
ExamplesOpen editor ↗

ntlhana

→ vertex()

Adds one vertex to the shape you are building.

ntlhana(x, y)

ntlhana(x, y) names the place of one corner of your shape. It is used between simololaPopego and feleletsaPopego, and the vertices are joined in the order you add them.

It draws nothing by itself. It is the name of a thing — a corner added to a list — not an order to draw. The visible line arrives when feleletsaPopego is called. That is why the name does not begin with thala, while thalaNtlha does put a single dot on the canvas straight away.

ntlhana is a little point. The Setswana Year-1 maths book asks a child: “Kwala dipalo tsa dintlhana ka fa tlase ga popego nngwe le nngwe” — count the vertices of each shape. This is that word.

⚠ It only works between simololaPopego and feleletsaPopego. Call it outside them in a fresh sketch and it throws an unreadable error: “Cannot read properties of undefined”. Call it outside them after you have already drawn a shape and it does not throw — your vertex is simply lost, with nothing to see. Measured.

NameTypeDescription
xpaloThe x coordinate of the vertex.
ypaloThe y coordinate of the vertex.
A mountain drawn from vertices
tiro setaLoeto() {
  thalaKanefase(400, 240);
  bokamorago(180, 210, 240);
  tlogelaMothalo();
  tlatsaMmala(70, 100, 90);

  simololaPopego();
  ntlhana(0, 240);
  ntlhana(60, 150);
  ntlhana(120, 190);
  ntlhana(200, 70);
  ntlhana(280, 170);
  ntlhana(340, 120);
  ntlhana(400, 240);
  feleletsaPopego(TSWALA);

  tlhalosa('Setshwantsho sa dithaba tse ditalatala mo bokamoragong jwa loapi jo bo bofefo.');
}

simololaPopego, feleletsaPopego, thalaNtlha, ntlhanaBezier, ntlhanaKonego