I made this reference sheet since I couldn't find any info about this ancient Game Maker extension anywhere on the internet. Tested in Game Maker 8.0 Pro on Steam Deck via Proton Experimental 2024-10-23.
Port numbers are Zero indexed! i.e. Player 1 is id 0, Player 4 is id 3.
Player | P1 | P2 | P3 | P4 |
Xindex | 0 | 1 | 2 | 3 |
Xin provides 8 functions for accessing and managing XInput devices, such as an Xbox controller or virtually (haha) any controller via Steam Input.
Function | Parameters | Output | example |
|
|
Returns bool (0 = not pressed, 1 = pressed) |
draw_text(x,y,xin_check(1,xb_a)) //display whether player 2 is pressing the A button |
|
|
Returns bool (0 = not pressed, 1 = pressed) , but only stays true until next room step. |
draw_text(x,y,xin_check(1,xb_b)) //display whether player 2 just pressed the B button |
|
|
Returns bool (0 = still pressed, 1 = released) , but only stays true until next room step. |
draw_text(x,y,xin_check_released(1,xb_y)) //display whether just let go of the Y button |
|
|
Returns int value showing button id |
xin_get_input(0) //check which button Player 1 is currently pressing. |
|
|
Returns int bitmask respresenting button combination |
xin_get_input_bitmask(0) //check which buttons Player 1 is currently pressing. |
|
|
Returns bool (0 = not pressed, 1 = pressed) |
draw_text(x,y,xin_get_state(1,xb_rightTrigger) //display how far Player 2 is pulling their Right Trigger |
|
|
Sets rumble strength of motors on each side of controller at port index |
xin_set_rumble(3,0.01,1) //set Player 4's rumble to minimum strength on left and maximum strength on right |
|
Port numbers are Zero indexed! i.e. Player 1 is id 0, Player 4 is id 3. |
bool (0 = disconnected, 1 = connected)
Returns Boolean connection status of the gamepad connected to the specified port. |
switch(xin_update(0)) //player 1's controller |
xin_check(index,button)
button valuesvalue | Xin constant | button |
7 | xb_a | A |
8 | xb_b | B |
9 | xb_x | X |
10 | xb_y | Y |
11 | xb_leftShoulder | LB |
12 | xb_rightShoulder | RB |
13 | xb_leftThumb | Left stick click |
14 | xb_rightThumb | Right stick click |
15 | xb_up | Dpad up |
16 | xb_down | Dpad down |
17 | xb_left | Dpad left |
18 | xb_right | Dpad right |
19 | xb_start | Start / Menu |
20 | xb_back | Back / View |
value | Xin constant | analogue input |
1 | xb_leftTrigger | LT |
2 | xb_rightTrigger | RT |
3 | xb_leftThumbX | Left Stick x (left/right) |
4 | xb_leftThumbY | Left Stick y (up/down) |
5 | xb_rightThumbX | Right Stick x (left/right) |
6 | xb_rightThumbY | Right Stick y (up/down) |
Xbox 360 controller diagram by Alphathon is licensed under CC-BY-SA 3.0, and modified by blobeee to replace labels with concise Xin 1.1 example code.
Xin 1.1 by JacksonYarr is in the public domain according to the info displayed in the Extension Package Manager: