bopaBoalo
→ createGraphics()Creates a hidden drawing buffer — a second canvas you draw into first.
bopaBoalo(bophara, boleele)Call bopaBoalo(bophara, boleele) to make a buffer nobody can see. You draw into it off to one side, then stamp it onto the main canvas. It helps when you want to draw something once and reuse it many times, or simply to keep your code in parts.
Draw into the buffer. Pass it and an operation keyword to dirisaMoGo: dirisaMoGo(boalo, thalaKhutlonne, 20, 20, 60, 40). The remaining arguments belong to that operation. See dirisaMoGo for supported drawing, styling, text, transform and pixel operations.
Nothing shows until you stamp it. The buffer’s canvas is added to the page but hidden; nothing appears until you use thalaSetshwantsho(boalo, x, y). A buffer is a picture, so the word that draws it is the same word that draws any picture.
Parameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
bophara | palo | Width of the buffer in pixels. |
boleele | palo | Height of the buffer in pixels. |
Examples
Section titled “Examples”diri boalo;
tiro setaLoeto() {
thalaKanefase(400, 240);
// Boalo bo bopiwa gangwe fela.
boalo = bopaBoalo(60, 60);
dirisaMoGo(boalo, bokamorago, 255, 210, 60);
dirisaMoGo(boalo, tlogelaMothalo);
dirisaMoGo(boalo, tlatsaMmala, 40, 40, 60);
dirisaMoGo(boalo, thalaSediko, 30, 30, 34);
dirisaMoGo(boalo, tlatsaMmala, 255);
dirisaMoGo(boalo, thalaSediko, 30, 30, 14);
tlhalosa('Letshwao le le serolwana le le nang le sediko se sesweu fa gare, le beilwe makgetlo a le lesome mo moleng mo bokamoragong jo bo lefifi.');
}
tiro tshwantsha() {
bokamorago(28, 32, 48);
gopheta (diri i = 0; i < 10; i = i + 1) {
// Boalo ke setshwantsho, ka jalo `thalaSetshwantsho` e bo baya mo kanefaseng.
thalaSetshwantsho(boalo, i * 38 + 10, 90);
}
}See also
Section titled “See also”dirisaMoGo, thalaSetshwantsho, thalaKanefase, lekanyaKanefase, P2D