Recently I put a post that got disapproved by Izhido and I did what he said (To Try & Find Out Myself In The Examples Folder) but I still can't find out how to use the Nunchuck in my games? Does someone else know?
I put ? marks like you said Wintermute
Nunchuck
Re: Nunchuck
Amazing. I was completely sure there was code in there showing input devices. Guess I was wrong, after all .
Anyway, try this:
nx and ny should contain valid values for the nunchuk's joystick. Check the "expansion_t" structure in libogc's header files. All the keys & controls for the expansion devices (like the nunchuk) should be right there.
Of course, be sure to call WPAD_Init() before attempting to use this code in your application.
Hope that helps.
Anyway, try this:
Code: Select all
expansion_t e;
int nx;
int ny;
WPAD_Expansion(WPAD_CHAN_0, &e);
if(e.type != WPAD_EXP_NUNCHUK)
{
iprintf("Nunchuk not attached to Wiimote 0");
}
nx = e.nunchuk.js.pos.x - e.nunchuk.js.center.x;
ny = e.nunchuk.js.pos.y - e.nunchuk.js.center.y;
Of course, be sure to call WPAD_Init() before attempting to use this code in your application.
Hope that helps.
Re: Nunchuck
How do you define "movement" ? What actions are you performing with the nunchuk that cause what you're calling "movement", and what do you expect from your app when you do that?
Re: Nunchuck
I mean if you push the control stick (UP, DOWN, LEFT or RIGHT) The sprite on screen will do so. I think it is the values that you said but I don't know how to use them.
Who is online
Users browsing this forum: Ahrefs [Bot] and 4 guests