gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

DS development > Touch Screen Variables - Quick Question

#73872 - genfish - Tue Feb 28, 2006 6:06 pm

in the touchPosition structure,

what is x, px, y and py and whats the difference between them?

I'll assume that x and y are the postions of the touch, but what about the others?

Also, what type is the value returned?

thanks :)
_________________
there is no rl only afk

#73879 - knight0fdragon - Tue Feb 28, 2006 7:16 pm

x and y are the touch coordinates, 2 bytes large
px and py are screen coordinates, which should be 1 byte large
_________________
http://www.myspace.com/knight0fdragonds

MK DS FC: Dragon 330772 075464
AC WW FC: Anthony SamsClub 1933-3433-9458
MPFH: Dragon 0215 4231 1206

#73904 - Sausage Boy - Tue Feb 28, 2006 9:32 pm

What he sais is that x and y are wierd numbers that mean alot with the right math, but don't mean anything to you. px and py are x and y + maths, which gives you the exact screen coordinates of the touch. Those are the ones you want to use.
_________________
"no offense, but this is the gayest game ever"

#74005 - genfish - Wed Mar 01, 2006 5:35 pm

ok cool.

so i can operate normal mathematics with px and py, like,
if (px < 50) function();

thanks
_________________
there is no rl only afk