pebaYEFetileng
→ pmouseYThe mouse's vertical position in the previous frame.
pebaYEFetilengThe 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.
Examples
Section titled “Examples”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);
}