Actual Stylus X and Y positions?

Post Reply
MisterFuzzy
Posts: 4
Joined: Sat Feb 12, 2011 6:35 am

Actual Stylus X and Y positions?

Post by MisterFuzzy » Mon Feb 14, 2011 2:47 am

Why does the function touch.px and touch.py return weird values rather than actual positions, 0 - 255, 0 - 191? I attached a file with my problem... Image

I am assuming this is normal, however. If so, how can I get an actual XY position? :|
Thanks in advance!
Attachments

[The extension nds has been deactivated and can no longer be displayed.]


WinterMute
Site Admin
Posts: 2003
Joined: Tue Aug 09, 2005 3:21 am
Location: UK
Contact:

Re: Actual Stylus X and Y positions?

Post by WinterMute » Mon Feb 14, 2011 11:26 am

The pixel positions are within 0-255 & 0-191 although some values around the edges may not be available - this varies by console.

What may be confusing you here is that you're not erasing the old values when you print the new values, I think that's why you think you're seeing "weird" values. Just add two spaces on the end of your print strings, i.e.

Code: Select all

	iprintf("StylusX: %d  \n", touch.px);
	iprintf("StylusY: %d  \n", touch.py);
Help keep devkitPro toolchains free, Donate today

Personal Blog

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest