Using the Table Realms Plugin for Touch Functionality

Please Note: This plugin is still under construction, and therefore the information in this section is likely to change!

Overview

If you’re not familiar with the Construct2/3 native touch functionality, they have extensively documented it here.

Due to Construct2/3 having its own touch input functionality, Table Realms will be working off that functionality through the Core plugin, rather than making developers use an unfamiliar set of tools. The touch functionality handled by the core plugin requires a touch passthrough component in an Aug file, in order for Construct’s built in touch features to work.

In order to use the touch passthrough functionality, you need to specify the name of the touch component being used to pass through the input data.

The Aug File

The Aug file being designed for use with Construct will be slightly different to Aug files used on other platforms.

The Construct specific Aug file will need to be created with a named touch passthrough component placed above everything else, in order for C2/3 to read the touch input. It is recommended that this is done by creating a stack panel layout in which the passthrough component is placed, and then nesting other layout panels within the stack layout, underneath the passthrough component.

Ensure that you have the new base.trp file included in your project. If you don’t yet have it, you can find it here.

NOTE - To Remove: The new base.trp file will be packaged with the new release of the IDE. For now, you can request it from Dirk.

When working in the IDE, set up your touch component on the aug as follows:

By toggling the touch passthrough flag, the passthrough is activated for all pages.

Once the passthrough flag has been toggled, save your Aug file and import it into your C2/3 project. Voila! That’s about 90% of the touch setup done.

To test that the latest touch functionality works in your project, ensure that you have the latest Table Realms developer app running on your device.

Presently, the latest dev app version is d_1.0.152. You can check this on your app by opening the settings menu option, and scrolling down to the version number.

Sample Touch Input Events

Some sample event blocks for the touch input are as follows:

Object for Event Condition Parameters Object for Action Action Parameters
Touch Is in Touch [object for touch] Set X Touch.X
[object for touch] Set Y Touch.Y
Browser Log in Console “Touch Count:” & Touch.TouchCount


Object for Event Condition Parameters Object for Action Action Parameters
Touch On any touch start Browser Log in console “A touch has started”


Object for Event Condition Parameters Object for Action Action Parameters
Touch On any touch end Browser Log in console “A touch has ended”


Object for Event Condition Parameters Object for Action Action Parameters
Touch Is touching [Specified object] Browser Log in console “Is touching specified object”


Object for Event Condition Parameters Object for Action Action Parameters
Touch On touched [Specified object] Browser Log in console “Is touching specified object”
[Object] [Action] [Parameters]