Skip to content
ExamplesOpen editor ↗

pebaYEFetileng

→ pmouseY

The mouse's vertical position in the previous frame.

pebaYEFetileng

The twin of pebaXEFetileng. pebaY is where the mouse is now; pebaYEFetileng is where it was one frame ago.

You almost always use the two together, in one call:

thalaMothalo(pebaXEFetileng, pebaYEFetileng, pebaX, pebaY);

They update once per frame, so reading them inside pebaEGogilwe gives you the distance the mouse travelled since the last frame.

A stroke whose weight follows the speed
tiro setaLoeto() {
  thalaKanefase(400, 260);
  bokamorago(246);
  mothaloMmala(40, 80, 140);
  tlhalosa('Mothalo o o gogwang ka peba, o o tshesane fa peba e tsamaya ka bonako.');
}

tiro pebaEGogilwe() {
  metlha lebelo = sekgala(pebaX, pebaY, pebaXEFetileng, pebaYEFetileng);
  boketeMothalo(thibela(18 - lebelo, 1, 18));
  thalaMothalo(pebaXEFetileng, pebaYEFetileng, pebaX, pebaY);
}

pebaXEFetileng, pebaY, pebaEGogilwe, phetogoYaPebaY