Jump to content


Photo

Touch screen


  • Please log in to reply
4 replies to this topic

#1 witcher

witcher

    GMC Member

  • GMC Member
  • 396 posts
  • Version:Unknown

Posted 01 May 2012 - 02:49 PM

Hello i am new to studio
I was wondering how to use touch screen to move char left and right and double tap to shoot
I cant find touch screen option in game maker
Also is it possible to make your own virtual keys for android games?
  • 0

#2 Jack Indie Box

Jack Indie Box

    GMC Member

  • GMC Member
  • 1460 posts
  • Version:GM:Studio

Posted 01 May 2012 - 04:00 PM

from what i have read you do these by mouse events and virtual buttons(name is incorrect) that are placed in areas on the screen. so for single touch games i think you can use the standard mouse position and press events. but for more functionality you use the built in studio functions which you can find in the help files.

im not currently on a machine with it installed so i cant list them but i know they arent hard to find
  • 0

#3 witcher

witcher

    GMC Member

  • GMC Member
  • 396 posts
  • Version:Unknown

Posted 05 May 2012 - 08:18 AM

I cant find any mouse events tha lets you move left and right
Suppose like in space invaders type game how can you move left and right with your mouse
  • 0

#4 jn2002dk

jn2002dk

    GMC Member

  • New Member
  • 58 posts

Posted 05 May 2012 - 08:28 AM

YoYo_AddVirtualKey( X position, Y position, Width, Height, Keycode)
YoYo_ShowVirtualKey()

Those are the 2 functions you use for it

Like this

zz = YoYo_AddVirtualKey(60,320,128,128,ord('Z'));

YoYo_ShowVirtualKey(zz);

For virtual keys to move

Use YoYo_Mouse for mouse like input. You can use normal mouse events too but then you wont have multitouch
  • 0

#5 mrsmes

mrsmes

    GMC Member

  • GMC Member
  • 972 posts
  • Version:Unknown

Posted 06 May 2012 - 04:46 AM

your fingers should emulate the mouse so get this code in the left mouse event:
x=mouse_x
if you want to do height wise coordinates do thusly so in the code below:
y=mouse_y
  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users