Skip to content
ExamplesOpen editor ↗

pebaXEFetileng

→ pmouseX

The mouse's horizontal position in the previous frame.

pebaXEFetileng

pebaX gives you where the mouse is now; pebaXEFetileng gives you where it was one frame ago. Together they let you draw a continuous line from where the mouse was to where it is — which is the heart of every drawing pad.

thalaMothalo(pebaXEFetileng, pebaYEFetileng, pebaX, pebaY);

Without them, drawing in pebaEGogilwe leaves gaps whenever the mouse moves quickly.

fetileng is the ordinary Setswana for that which has passed, as in “Nako e e fetileng ke ditiragalo tsotlhe tse di diragetseng pele ga nako e e rileng” (“the past is everything that happened before a given time”).

A continuous line, not dots
tiro setaLoeto() {
  thalaKanefase(400, 260);
  bokamorago(246);
  boketeMothalo(4);
  mothaloMmala(60, 110, 180);
  tlhalosa('Mothalo o o tswelelang o o latelang peba fa e gogwa.');
}

tiro pebaEGogilwe() {
  thalaMothalo(pebaXEFetileng, pebaYEFetileng, pebaX, pebaY);
}

pebaYEFetileng, pebaX, pebaEGogilwe, phetogoYaPebaX