simololaPopego
→ beginShape()Begins a shape of your own, so you can start adding vertices.
simololaPopego() | simololaPopego(mofuta)Call simololaPopego(), add vertices with ntlhana(x, y), then finish with feleletsaPopego(). This is how you draw any shape you like — a star, a leaf, a mountain — rather than only the ready-made ones such as circle and rectangle.
Nothing is drawn until you call feleletsaPopego. The outline and the fill both happen at once, at the end. That is why ntlhana is the name of a thing rather than an order to draw.
A shape can have a kind. Give simololaPopego a value — DINTLHA, METHALO, DIKHUTLOTHARO, KHUTLOTHARO_ANAMA, KHUTLOTHARO_LEBANTA, DITLHAKORENNE or TLHAKORENNE_LEBANTA — and your vertices are read a different way. Give it nothing and they are joined in order into one outline.
⚠ Some kinds need the right number of vertices. METHALO needs a multiple of 2, DIKHUTLOTHARO a multiple of 3, DITLHAKORENNE a multiple of 4. Get it wrong and the sketch stops with an unreadable error — “Cannot read properties of undefined”. Measured.
⚠ You cannot use ntlhanaBezier or ntlhanaKonego when you have given simololaPopego a kind. It throws.
Parameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
mofuta (optional) | tlhomameng | The kind of shape — DINTLHA, METHALO, DIKHUTLOTHARO and the rest. Leave it out and the vertices are joined in order. |
Examples
Section titled “Examples”tiro setaLoeto() {
thalaKanefase(400, 400);
bokamorago(24, 28, 48);
seeloSaSekhutlo(DEGREES);
tlatsaMmala(250, 205, 70);
tlogelaMothalo();
simololaPopego();
gopheta (diri i = 0; i < 10; i = i + 1) {
diri r = 140;
fa (i % 2 === 1) {
r = 60;
}
diri a = i * 36 - 90;
ntlhana(200 + cos(a) * r, 200 + sin(a) * r);
}
feleletsaPopego(TSWALA);
tlhalosa('Naledi ya serolwana e e nang le dintlhana tse tlhano, fa gare ga kanefase e e lefifi.');
}tiro setaLoeto() {
thalaKanefase(400, 220);
bokamorago(240);
tlogelaMothalo();
// Palo ya dintlhana e tshwanetse go arogana ka 3
simololaPopego(DIKHUTLOTHARO);
tlatsaMmala(230, 90, 90);
ntlhana(40, 180);
ntlhana(120, 40);
ntlhana(200, 180);
ntlhana(200, 180);
ntlhana(280, 40);
ntlhana(360, 180);
feleletsaPopego();
tlhalosa('Dikhutlotharo tse pedi tse dikhibidu tse di tlhomaganeng, tse di kgomanang fela ka ntlha e le nngwe.');
}See also
Section titled “See also”feleletsaPopego, ntlhana, simololaPhatlha, TSWALA, DIKHUTLOTHARO