Xbox360 controller dpad and/or analog sticks

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
Noktai
Prole
Posts: 7
Joined: Tue Sep 11, 2012 2:25 am

Xbox360 controller dpad and/or analog sticks

Post 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
User avatar
Nixola
Inner party member
Posts: 1949
Joined: Tue Dec 06, 2011 7:11 pm
Location: Italy

Re: Xbox360 controller dpad and/or analog sticks

Post by Nixola »

love.joystick.getNumAxes(1)
lf = love.filesystem
ls = love.sound
la = love.audio
lp = love.physics
lt = love.thread
li = love.image
lg = love.graphics
Noktai
Prole
Posts: 7
Joined: Tue Sep 11, 2012 2:25 am

Re: Xbox360 controller dpad and/or analog sticks

Post by Noktai »

Nixola wrote:love.joystick.getNumAxes(1)
Doh, the lua indexing got me again. Thanks a bunch !
Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests