Skip to content

Instantly share code, notes, and snippets.

View PoppyWorks's full-sized avatar

Poppy Works PoppyWorks

View GitHub Profile
@PoppyWorks
PoppyWorks / button_check
Last active August 14, 2018 00:58
GML Script. Used in step after setup_inputs has been used. This is a generic input script that can change back and forth from keyboard/mouse to gamepad via the input_change swapper. Example: button_check(0,global.confirm);
///button_check(device number, button)
return keyboard_check(argument1) || gamepad_button_check(argument0,argument1)
@PoppyWorks
PoppyWorks / button_ui_held
Last active August 22, 2018 18:51
GML Script. Should be run on an object that you wish to have the player click. Create an obj_cursor for console users and move it around via the gamepad to have this script work for both gamepad. mouse, and touchscreen users.
///button_ui_held(device number, button)
var me = id;
return position_meeting(mouse_x,mouse_y,me) && mouse_check_button(mb_left) || place_meeting(x,y,obj_cursor) && gamepad_button_check(argument0,argument1)
@PoppyWorks
PoppyWorks / string_button()
Last active April 1, 2019 16:05
Replace common terms with special symbols for platform buttons
///string_button(string)
var str = argument0;
///XO - PlayStation Controller Keys
if os_type == (os_psvita || os_ps4)
{
str = string_replace_all(str,"CONFIRM","➀");
str = string_replace_all(str,"CANCEL","➁");
str = string_replace_all(str,"BUTTON3","➂");
str = string_replace_all(str,"BUTTON4","➃");