Game Maker Xin 1.1 extension documentation

by blobeee

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.

Quick start

Diagram of an Xbox 360 controller with example code snippets for accessing each controller input.

Port numbers are Zero indexed! i.e. Player 1 is id 0, Player 4 is id 3.

PlayerP1P2P3P4
Xindex0123

Table of functions

Xin provides 8 functions for accessing and managing XInput devices, such as an Xbox controller or virtually (haha) any controller via Steam Input.

FunctionParametersOutputexample

xin_check(index,button)

int index = port number
int button = button id
See xin_check() button values

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

xin_check_pressed(index,button)

int index = port number
int button = button id
See xin_check() button values

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

xin_check_released(index,button)

int index = port number
int button = button id
See xin_check() button values

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

xin_get_input(index)

int index = port number

Returns int value showing button id xin_get_input(0) //check which button Player 1 is currently pressing.

xin_get_input_bitmask(index)

int index = port number

Returns int bitmask respresenting button combination xin_get_input_bitmask(0) //check which buttons Player 1 is currently pressing.

xin_get_state(index,button axis)

int index = port number
int button axis = axis id
See xin_get_state() analogue axes

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

xin_set_rumble(index,left,right)

int index = port number
float left: left motor
float right: right motor

Max precision is 2dp / 3sf, so smallest rumble value is 0.01

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

xin_update(index)

int index = port number

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
{case 0: plug = "unplugged";break;
case 1: plug = "connected"}
draw_text(x,y,plug)

xin_check(index,button) button values

valueXin constantbutton
7xb_aA
8xb_bB
9xb_xX
10xb_yY
11xb_leftShoulderLB
12xb_rightShoulderRB
13xb_leftThumbLeft stick click
14xb_rightThumbRight stick click
15xb_upDpad up
16xb_downDpad down
17xb_leftDpad left
18xb_rightDpad right
19xb_startStart / Menu
20xb_backBack / View

xin_get_state(index,axis) analogue axes

valueXin constantanalogue input
1xb_leftTriggerLT
2xb_rightTriggerRT
3xb_leftThumbXLeft Stick x (left/right)
4xb_leftThumbYLeft Stick y (up/down)
5xb_rightThumbXRight Stick x (left/right)
6xb_rightThumbYRight Stick y (up/down)

Credits

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:

Extension Packages window with Xin v1.1 selected. The author of Xin is JacksonYarr and the license is set to Public Domain.

Changelog