rulaganyaMokwalo
→ textAlign()Chooses how text sits relative to the point given to `thalaMokwalo`.
rulaganyaMokwalo(alignX, alignY)The first parameter speaks about x: MOLEMA (the default), BOGARE or MOJA. With BOGARE, the point you gave becomes the middle of the text across, not its starting point.
The second parameter is optional and speaks about y: GODIMO, TLASE, BOGARE or MOLATLASE. The default is MOLATLASE — the line the letters stand on.
Calling rulaganyaMokwalo() with nothing returns an object carrying horizontal and vertical.
⚠ What comes back is not always what went in. Set BOGARE as the vertical alignment and rulaganyaMokwalo().vertical returns 'middle' — not 'center', which is what BOGARE is. The horizontal side does not do this: it returns 'center'. So fa (rulaganyaMokwalo().vertical === BOGARE) is never true, even when that is exactly what you set.
Parameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
thulaganyoX (optional) | seelo | MOLEMA, BOGARE or MOJA. |
thulaganyoY (optional) | seelo | GODIMO, TLASE, BOGARE or MOLATLASE. |
Examples
Section titled “Examples”tiro setaLoeto() {
thalaKanefase(400, 260);
bokamorago(240);
bogoloJwaMokwalo(22);
// Mothalo o o supang ntlha ya 200
mothaloMmala(220, 60, 90);
thalaMothalo(200, 20, 200, 240);
tlogelaMothalo();
tlatsaMmala(30, 40, 60);
rulaganyaMokwalo(MOLEMA);
thalaMokwalo('MOLEMA', 200, 70);
rulaganyaMokwalo(BOGARE);
thalaMokwalo('BOGARE', 200, 140);
rulaganyaMokwalo(MOJA);
thalaMokwalo('MOJA', 200, 210);
tlhalosa('Mafoko a mararo a a lekanyeditsweng ka ditsela tse di farologaneng go dikologa mothalo o o emeng o o mokhibidu.');
}See also
Section titled “See also”thalaMokwalo, MOLEMA, MOJA, GODIMO, TLASE, MOLATLASE, BOGARE