GMS: How to Create Virtual Keys for Android? (Over View)
GMS File: https://bit.ly/2JxETGi
Note: Do not mark your virtual keys "Persistent", if you have a save and load in the game, you're virtual keys will be gone when you load the game. You need to place them in every room. Its best to make all your buttons, then duplicate the room, so you don't have to place the buttons in the room again.
Events: Be sure to use "Room Start" on all your virtual keys, if not, the virtual keys will disappear once you resume game again, and the buttons will not work on device.
obj_fire, Depth -500
Events:
Room Start
Actions:
fire = virtual_key_add(5100,2670,450,450, vk_enter);
virtual_key_show(fire);
or virtual_key_hide(fire); ///when you are done placing them on screen.
Events:
Draw
Actions:
draw_sprite(sprite_index,image_index,view_xview[0]+2460,view_yview[0]+1250);
Events:
Draw GUI
Actions:
display_set_gui_size(view_wview[0]+3300,view_hview[0]+1991);
obj_pause, Depth -500
Events:
Step
Actions:
x=view_xview[0]+1300
y=view_yview[0]+1800
Events:
Left Press Mouse
Actions:
global.my_room = room
room_persistent=true
room_goto(room1) ///put you're room in place of room1
Events:
Draw
Actions:
draw_sprite(sprite_index,image_index,view_xview[0]+1300,view_yview[0]+1800);