Multitouch Tutorial
In this tutorial, i will be guiding you through a very simple progress, to illustrate how you can use multitouch in your apps or games.
We will be using GameMaker: Studio
We will be using GameMaker: Studio
1. Creating an object
Simply, create an object, and name it whatever you want. I call it obj_test. This is the only object we need.
2. Add a draw event to the object
3. To the code
To use multitouch, we will be using 3 functions:
- device_mouse_x To get the x-coordinate of our touch)
- device_mouse_y To get the y-coordinate of our touch)
- device_mouse_check_button To check if there's a touch
What we want to do is to draw a red circle at the 5 available touches GameMaker gives us the ability to listen to. If the finger is touching the screen, draw a circle at the touch's coordinates. Try to see if you can figure it out. If not, take a look at my code below
4. Run it on your phone/device
Android
A simple way to test it is either to connect your phone to the computer, and run it using the YoYo Runner.
You could also export the project as an APK file and email it to your own mail, and then open the mail with your APK on your device.
iOS
To test on iOS, you'll need a mac/hackintosh.
The way i do it is to run a virtual machine inside of mac with Windows and GameMaker: Studio, connected to the root operative system, Mac.
Windows
If you choose to test it on Windows, you'll only be able to see one touch, but that's still a little proof that our beautiful app is working :)
A simple way to test it is either to connect your phone to the computer, and run it using the YoYo Runner.
You could also export the project as an APK file and email it to your own mail, and then open the mail with your APK on your device.
iOS
To test on iOS, you'll need a mac/hackintosh.
The way i do it is to run a virtual machine inside of mac with Windows and GameMaker: Studio, connected to the root operative system, Mac.
Windows
If you choose to test it on Windows, you'll only be able to see one touch, but that's still a little proof that our beautiful app is working :)