GetJoystick1Button

Non-platform specific questions.

GetJoystick1Button

Postby erfan71 » Sun Aug 05, 2012 1:55 pm

is anybody know about Joystick?

i want to create my game for Windows and I want to use Controller?
(Xbox 360 Controller for Windows)

how can i do this?

i think in Doc doesn't write any things ?
erfan71
 
Posts: 33
Joined: Sat Jul 21, 2012 8:46 am
Score: 0 Give a positive score

Re: GetJoystick1Button

Postby erfan71 » Sun Aug 05, 2012 2:04 pm

excuse me .
i found this@@
erfan71
 
Posts: 33
Joined: Sat Jul 21, 2012 8:46 am
Score: 0 Give a positive score

Re: GetJoystick1Button

Postby Hblade » Mon Aug 06, 2012 12:53 am

First you want to get the joystick Axis.
Code: Select all
double XAXIS=GetJoysitck1Axis(0);
double YAXIS=GetJoysitck1Axis(1);


now you want to get the button inputs
Code: Select all
int BUTTON[15];
int i;

for(i=0;i<14;i++)
{
BUTTON[i]=GetJoystick1Button(i);
}


Now to use the button (Find the button with trial and error), use this for example, when the A is pressed:
Code: Select all
if(BUTTON[2])
{
x+=5;
}


now when you press one of the buttons (not sure which one), the player will move 5 pixels.

NOTE:
All of this must be in Draw Actor.
Subscribe to my YouTube? - Yes| No
User avatar
Hblade
 
Posts: 4455
Joined: Fri Dec 08, 2006 11:14 pm
Score: 181 Give a positive score

Re: GetJoystick1Button

Postby erfan71 » Thu Aug 09, 2012 5:42 pm

so so thanks
erfan71
 
Posts: 33
Joined: Sat Jul 21, 2012 8:46 am
Score: 0 Give a positive score


Return to General

Who is online

Users browsing this forum: No registered users and 1 guest

cron