Tlola o ye mo diteng
DikaiBula setseleganyi ↗

mmalaWaPhikisele

→ get()

E busa mmala wa ntlha e le nngwe mo kanefaseng.

mmalaWaPhikisele(x, y)

mmalaWaPhikisele(x, y) e busa mmala o o mo boemong joo. Ke leina, e seng lediri, go tsamaisana le bopharaFensetere le paloYaUra: se o se kopang ke boleng, e seng tiro.

Se e se busang ke lenaneo la dipalo tse nne, e seng bopaMmala — e lekantswe: mmalaWaPhikisele(2, 2) e busa [255, 0, 0, 255]. Ka jalo mmala[0] ke khibidu, mmala[1] ke tala jwa tlhaga, mmala[2] ke tala jwa loapi, mme mmala[3] ke go bonala.

Kwa ntle ga kanefase e busa [0, 0, 0, 0] — ga e ntshe phoso. E lekantswe ka mmalaWaPhikisele(-5, -5) le mmalaWaPhikisele(9999, 9999).

Ka dipalo tse nne, e busa setshwantsho. mmalaWaPhikisele(x, y, bophara, boleele) e busa karolo ya kanefase e le setshwantsho se se ka thadiwang ka thalaSetshwantsho; kwa ntle ga dipalo gotlhelele, e busa kanefase yotlhe. Leina le reilwe ka tiriso e e tlwaelegileng — mmala wa ntlha e le nngwe — mme mefuta e mengwe e mebedi e ka fa tlase ga lona.

⚠ Ke tiro e e bonya fa e bidiwa makgetlho a mantsi. Fa o batla dintlha tse dintsi, balaDiphikisele gangwe go bofefo go feta mmalaWaPhikisele makgetlho a le sekete.

LeinaMofutaTlhaloso
xpaloBoemo jwa x jwa ntlha.
ypaloBoemo jwa y jwa ntlha.
Tsaya mmala o o fa tlase ga peba
diri mmala;

tiro setaLoeto() {
  thalaKanefase(400, 200);
  mmala = letela tlisaSetshwantsho('mmala.png');
  tlogelaBorethe();
  tlhalosa('Ditsela tse nne tsa mmala. Sekwere se se fa thoko se supa mmala o o fa tlase ga peba.');
}

tiro tshwantsha() {
  bokamorago(245);
  thalaSetshwantsho(mmala, 20, 20, 160, 160);

  diri o = mmalaWaPhikisele(pebaX, pebaY);
  tlatsaMmala(o[0], o[1], o[2]);
  thalaKhutlonne(230, 20, 140, 160);
}

tlatsaPhikisele, balaDiphikisele, diphikisele, bopaMmala