add some clarification to gamepad input
continuous-integration/drone/push Build is passing Details

main
cosmonaut 2021-03-17 21:06:34 -07:00
parent bfacdc8f95
commit 3c2e5b81d7
1 changed files with 6 additions and 1 deletions

View File

@ -77,9 +77,14 @@ if (Inputs.GamepadExists(0))
`GetGamepad` will throw if a gamepad is not connected so you should make sure to check `GamepadExists` before using it.
MoonWorks assumes your gamepad has a left stick, a right stick, and two triggers. The stick axes are represented in the range [-1f, 1f] and the trigger axes in the range [0f, 1f];
MoonWorks assumes that your gamepad is laid out similarly to a standard Xbox 360 controller and that it has a left stick, a right stick, and two triggers.
The stick axes are represented in the range [-1f, 1f] and the trigger axes in the range [0f, 1f].
The buttons correspond to the physical location of the buttons on an Xbox 360 controller.
So on a DualShock 4 controller, for example, Moonworks would treat the Cross button as an A button input.
```cs
var xButtonDown = gamepad.X.IsDown;
var leftStickHorizontal = gamepad.LeftX;
var rightStickVertical = gamepad.RightY;
var leftTrigger = gamepad.LeftTrigger;