Game Maker Studio: (Part 2) How to Create Virtual Keys for Android?

Channel:
Subscribers:
268
Published on ● Video Link: https://www.youtube.com/watch?v=EDQMOCSmq-w



Duration: 20:51
424 views
0


Visit my MC GAMES site: https://mcolverdesigns.itch.io

Paypal Donate: http://bit.do/fkPAb

GMS File: https://bit.ly/38cworh

Resources:

GUI Location: https://bit.ly/37ffQNM

GUI Size: https://bit.ly/2tNxZos

Virtual Key Add: https://bit.ly/2SdPcR2

(Note:) Don't need to use cross hairs on buttons, better if you don't, so its easier to press on buttons.

(Note:) Virtual Key Add: I used Room Start in the Event area, over using Create, because if you go to the next room or pause game, the virtual keys will be destroyed, could be a glitch, not sure why they would be destroyed, after moving to another room. Room Start, makes virtual keys stay in room, and not be destroyed, when moving to the next room or pause game. If you are planning to switch two buttons.

(Note:) Say if you have person kicking on the right, you need a button for the right kick, and you will need a button for the left kick, but only make "one virtual key for both buttons". So, in both buttons you would have a virtual key, but its going to be named the same, example kickkey is the name for the virtual key, but the name kickkey would be used for both buttons for the kick, "do not make a second name for a virtual key for the other button", because then, the buttons are not going to work correctly when he kicks. The reason you only need one virtual key for both right and left kick buttons is because, you already assign it a keyboard key, say "vk_enter" for left and right kick. The virtual key can tell when you are moving in a different direction and knows which way you need to kick.

obj_right, same applies for other buttons, just change out coordinates, and virtual key add name events, example "rkey".

Events:

Room Start, Go to Add Event, then Other, then Room Start

Actions:

rkey = virtual_key_add(1040,2700,400,400, vk_right);

//virtual_key_show(rkey);

Events:

Draw

Actions:

draw_sprite(sprite_index,image_index,view_xview[0]+800,view_yview[0]+1472);

Events:

Draw GUI

Actions:

display_set_gui_size(view_wview[0]+800,view_hview[0]+1472);


obj_pause

Events:

Step

Actions:

x=view_xview[0]+2700
y=view_yview[0]+50

Events:

Left Pressed, for Mouse

Actions:

global.my_room = room
room_persistent=true
room_goto(room1)

Events:

Draw

Actions:

draw_sprite(sprite_index,image_index,view_xview[0]+2700,view_yview[0]+50);


obj_back

Events:

Step

Actions:

x=view_xview[0]+2700
y=view_yview[0]+50

Events:

Left Pressed, for Mouse

Actions:

room_goto(global.my_room)

Events:

Draw

Actions:

draw_sprite(sprite_index,image_index,view_xview[0]+2700,view_yview[0]+50);

obj_exit, backspace would be the back key on you're device.

Events:

Step

Actions:

if(keyboard_check_pressed(vk_backspace)){game_end();}




Other Videos By MC Designs


2020-04-19Game Maker 8.1: How to Create Shake Screen.
2020-04-11Game Maker 8.1: How to Create Pause Screen for Both Rooms.
2020-04-04Game Maker Studio: (Part 3) How to Create Virtual Keys for Android?
2020-03-28Game Maker 8.1: Understanding Hit Points, & Create Bubble Head with Sound Effects.
2020-03-21Game Maker 8.1: How to Create Hitpoints for Monsters & Barrels.
2020-03-14Game Maker 8.1: How to Create Fade In, & a Flashing Dead Screen.
2020-03-07Game Maker 8.1: How to Create Rollover Buttons, & Animate Weapons In.
2020-02-29Game Maker 8.1: How to Create Custom Pause for 8.1 & Timer.
2020-02-22Game Maker 8.1: How to Fix Cursor Glitch, Hide & Reveal Inventory Glitch, & Pause Game.
2020-02-15Game Maker 8.1: How to Create a Cursor, Hide & Reveal Inventory, & Fix Load Glitch.
2020-02-09Game Maker Studio: (Part 2) How to Create Virtual Keys for Android?
2020-02-01Game Maker Studio: (Part 1) How to Create Virtual Keys for Android?
2020-01-26Game Maker 8.1: How to Create a Save, Load, & Ice.
2020-01-18Game Maker 8.1: How to Create Columns & Slicers.
2020-01-11Game Maker 8.1: How to Press ENTER Once, without using all of you're Crystals.
2020-01-05Game Maker 8.1: How to Collect & Store you're Crystals.
2019-12-29Game Maker 8.1: (Part2) Fixing Glitches & Create Poison Gas.
2019-12-29Game Maker 8.1: (Part1) Fixing Glitches & Create Poison Gas.
2019-12-21Game Maker 8.1: How to Create Angle Walls, & fix Items Pickup Issues.
2019-12-14Game Maker 8.1: How to Draw 3D Models, using Code.
2019-12-07Game Maker 8.1: How to Create a Outside Sky with Rain.



Tags:
how
learn
teach
find
player
code
create
object
sprite
game
maker
width
length
instance
room
if
place
set
global
distance
get
draw
check
visible
key
virtual
android
move
keyboard
board
studio
gui
size
add
display
coordinate
vk
release
press
pressed
center
left
right
up
down
power
button
buttons
two
device
tablet
scale
position
static
mouse
released
layer