iOS 3D Touch 1.0.1

A GameMaker: Studio extension developed by Beneton Software

Table of Contents

Requirements

This extension was fully tested on GameMaker: Studio v1.4.1772, compiling for both iOS and iOS (YYC). It was also successfully tested with GameMaker Studio 2 for Windows (v2.0.7.171), although it is not officially supported at the moment.

Getting Started

This extension package contains an example, in the form of GameMaker: Studio resources (sprites, objects, rooms, etc.) that can be imported in your project. This example is completely optional; it is meant to showcase what can be achieved with the extension, as well as help get familiarized with its functionality and quickly dive into the code. It is not meant to be used “as is”, and it doesn’t replace this documentation. If you wish to check out the example, we recommend adding the extension to an empty project, importing all the resources, moving the room that fits your device (phone or tablet) to the first position, and running it on your iOS or Android device (note: for Android, you have to create a full APK).

Below is the complete list of functions. If you are experiencing any issue, please make sure to check out the “Troubleshooting” section at the bottom of this document. If you don’t find an answer to your question, don’t hesitate to contact us through the YoYo Games Marketplace (link at the top). Thank you!

Functions

ios3dtouch_is_available()

Returns whether 3D Touch is supported and enabled on the current device.

Returns: Boolean

ios3dtouch_get_force(touch)

Gets the pressure applied to the screen for the given touch.

Real (Integer) touch The touch index, starting from 0 (first finger that touched the screen). This argument is equivalent to the deviceargument in GameMaker: Studio’s device_mouse_* functions.

Returns: Real (Double) The force of the touch, between 0 and ios3dtouch_get_maximum_force(), or -1 if the touch is inactive or 3D Touch is unavailable.

ios3dtouch_get_maximum_force()

Gets the maximum possible force that can be obtained by ios3dtouch_get_force().

Returns: Real (Double) The maximum force, or -1 if the user hasn’t yet touched the screen or 3D Touch is unavailable.

Troubleshooting

Some touches are not recognized properly.

Please disable the feature in GameMaker: Studio that detects double taps as mb_right instead of two individual taps by calling device_mouse_dbclick_enable(false) at the beginning of your game. You should get better results.

The extension is not working on a device that supports 3D Touch.

For 3D Touch to be available to the application, the device not only needs to support it but 3D Touch must be enabled in iOS’s Accessibility settings.

Changelog

1.0.1 (2017-01-13)

1.0.0 (2016-10-31)

0.8.0 (2015-10-31)