ok i'm writing a config prog for my new controllers and i have a problem. the d-pad registers as a hat and i'm using joyhat() to return a number to draw a line with but it wont return the number.
heres the code
and you will need to save both the code and this picture properly if you want to see the cool graphics the way there supposed to be. you need to save it as a bmp named controller.bmp
heres the code
Graphics 400,300 SetBuffer BackBuffer() AutoMidHandle True cont= LoadImage("controller.bmp") Const left_stick_pos=88,right_stick_pos=124 Const hat_x=160,hat_y=100 Repeat ju#=JoyU() judir=JoyUDir() jv#=JoyV() jvdir=JoyVDir() jyaw#=JoyYaw() jpitch#=JoyPitch() jroll#=JoyRoll() jz#=JoyZ() jx#=JoyX() jy#=JoyY() jxdir#=JoyXDir() jydir#=JoyYDir() jzdir#=JoyZDir() jhat=JoyHat() button=GetJoy() DrawImage cont,200,100 If button <> 0 Then Select button Case button=1 Text 0,214, "you hit the A button" Case button=2 Text 0,214,"you hit the B button" End Select End If ;left stick If jydir#<>0 Or jxdir#<>0 Color 255,0,0 Line 145,left_stick_pos,jx#*200,jy#*200 Text 0,214,jy#+" "+jx# End If ;right stick If jyaw#<>0 Or jpitch#<>0 Color 255,0,0 Line 230,right_stick_pos,jpitch#*100,jyaw#*100 Text 0,234,jyaw#+" "+jpitch# End If ;Z-triggers If jzdir#<>0 Color 0,0,255 Line 200,30,200+(-jz#*100),30 Text 0,254,jz# End If ;joyhat stuff Select jhat Case jhat=0 Color 255,0,0 Line hat_x,hat_y,hat_x,hat_y-50 Text 0,274,jhat Delay 100 End Select Flip Delay 100 Color 255,255,255 Cls Forever
and you will need to save both the code and this picture properly if you want to see the cool graphics the way there supposed to be. you need to save it as a bmp named controller.bmp