Project DescriptionThe DirectX Input for XNA allows usage of DirectX compatibles Joysticks in XNA game development for windows.
How to use?Create a GameComponent, add DXJoy.dll in references and add DXJoystickSupport in using declarations. After do this, put the follow code in respective methods listed above:
- Initialize
- Update
- Dispose
Insert the follow code in your game constructor(where YourGameComponent is the GameComponent created below):
- this.Components.Add(new YourGameComponent(this));
DXJoy works like Microsoft.Xna.Framework.Input.GamePad. Here has a sample of use:
if (DXJoy.GetState(PlayerIndex.One).Buttons.NegativeXAxis.Equals(ButtonState.Pressed))
{
//do something
}
if (DXJoy.GetState(PlayerIndex.One).Buttons.PointOfViewW.Equals(ButtonState.Pressed))
{
//do something
}
if (DXJoy.GetState(PlayerIndex.One).Buttons.Button1.Equals(ButtonState.Pressed))
{
//do something
}
LogoCredits to Everaldo Coelho
Website:
http://www.everaldo.com/ e
http://www.yellowicon.com/license: LGPL
DevelopmentDeveloped by Applied Information Technology Laboratory - LTIA
http://www.ltia.fc.unesp.br, from Sao Paulo State University - UNESP
http://www.unesp.br.