Page 1 of 1

Xbox360 controller dpad and/or analog sticks

Posted: Sat Sep 15, 2012 5:28 pm
by Noktai
Hello,

I'm currently working on a game for the adventuretime gamejam and am in quite a hurry to get the xbox 360 controller working. All the buttons seems to be working fine, but I don't know how to get input from the dpad and/or analog sticks.
I've read that the triggers won't work properly if you're not using Xinput, but I don't need those haha.

These all seem to report 0:

Code: Select all

	
print("number of axis " .. tostring(love.joystick.getNumAxes(0)));
print("number of balls " .. tostring(love.joystick.getNumBalls(0)));
print("number of hats : " .. tostring(love.joystick.getNumHats(0)));
But I've read some old topics where people got everything but the triggers to work with the standard love2d joystick class.

Thanks in advance

Re: Xbox360 controller dpad and/or analog sticks

Posted: Sat Sep 15, 2012 5:37 pm
by Nixola
love.joystick.getNumAxes(1)

Re: Xbox360 controller dpad and/or analog sticks

Posted: Sat Sep 15, 2012 5:56 pm
by Noktai
Nixola wrote:love.joystick.getNumAxes(1)
Doh, the lua indexing got me again. Thanks a bunch !