Skip to content

Instantly share code, notes, and snippets.


Poppy Works PoppyWorks

View GitHub Profile
PoppyWorks / button_check
Last active Aug 14, 2018
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);
View button_check
///button_check(device number, button)
return keyboard_check(argument1) || gamepad_button_check(argument0,argument1)
PoppyWorks / button_ui_held
Last active Aug 22, 2018
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.
View button_ui_held
///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 / string_button()
Last active Apr 1, 2019
Replace common terms with special symbols for platform buttons
View string_button()
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","➃");