Color legend plain property method event
Reads the four player slots at every update, raises an event for each pad that changed, and sets their vibration.
A static class, in the namespace BorrowedTorch.MonoInput.Inputs.GamePad. It holds one GamePadStatus per player slot for the whole run, connected or not. The gamepads page shows it in context, with code.
Names are colored by what they are: a property, a method or an event; values and fields keep the plain color.
Properties
GamePadsStatus →
ImmutableArray<GamePadStatus> · Static, read-only. The four player slots, indexed by (int)PlayerIndex. Each status is the same object for the whole run.
Methods
SetVibration() →
SetVibration(PlayerIndex index, float lowFreqMotor, float highFreqMotor) · Static. Sets the speed of a pad’s two vibration motors, through MonoGame’s GamePad.SetVibration. They keep that speed until the next call: set both to 0 to stop them. Does nothing for a pad that isn’t connected or can’t vibrate.
| Parameter | Type | Description |
|---|---|---|
index |
PlayerIndex |
The player slot of the pad. |
lowFreqMotor |
float |
The low-frequency motor, the left one on most pads: 0 stops it, 1 is full speed. |
highFreqMotor |
float |
The high-frequency motor, the right one on most pads: 0 to 1. |
Update() →
Update() · Static. Reads the four slots with GamePad.GetState and a circular dead zone, moves their buttons one step, and raises OnStatusChanged for each pad that changed. Call it once per frame, before anything reads a pad.
Events
OnStatusChanged →
(PlayerIndex playerIndex) · Static. Something about a pad changed at an update: it connected or disconnected, a button changed state at any step, or a stick or a trigger moved. Raised at most once per pad per update, slot One first.
| Parameter | Type | Description |
|---|---|---|
playerIndex |
PlayerIndex |
The slot of the pad: index GamePadsStatus with it. |