BoxSymbol Clock.png
This is an archive.
See the new ClickWiki at https://clickwiki.github.io. This version is just an archive for the purposes of migrating content to the new structure.


Jump to: navigation, search

Multiple Touch

Icon Multiple Touch.png
Author Official extension or is supported by Clickteam.
Status Released
Release Date Unknown
Last Updated {{{LastUpdated}}}
Available for Not yet documented
Supported Runtimes Windows Runtime Flash Runtime iOS Runtime Android Runtime HTML5 Runtime XNA Runtime (now deprecated) UWP Runtime
License Free
Attributes {{{Attributes}}}
Download
Includes Examples No
Includes Help Files Yes
Links
Downloadable via the Extension Manager
Included by default.
Alternates The Mouse & Keyboard object

The Multiple Touch object allows you to retrieve the coordinates of the user's fingers on the screen of a multitouch device. You can detect more than one "touch" at the same time, track the position of each touch, detect a touch on an object and a pinch gesture. iOS only: in order to work with multiple touches, the "Touch mode" property must be set to "Multiple touches" in the frame's properties.

Conditions

A new touch has started

This one-shot condition is fired when the user has started a new touch on the screen of the device. Touches are affected to "slots" in the extension, with a maximum of 10 touches at the same time. Use the Get last touch, or Get last new touch expression to retrieve the slot number of the touch. The first free slot is affected to the new touch: if no finger is on the screen when a touch starts, then slot number 0 will be used.

A new touch on an object has started

This one-shot condition is fired when the user has started a new touch on the specified object. As for the previous condition, touches on objects are affected to slots.

A touch has moved (number)

This one-shot condition is fired when the user moves his finger on the screen of the device. It can happen very rapidly. You have to specify the number of the touch (slot) to test.

A touch is active (number)

This condition is true as long as the specified touch is active, meaning that the user has not taken his finger off the device. This condition can be true even if the finger has not moved.

A touch on an object is active (number)

This condition is true as long as the specified touch is active and positioned over the given object.

A touch has been released

This one-shot condition is fired when a touch has been released (when the user removes his finger from the screen). Use the Get last touch or Get last end touch to find the number of the touch.

A touch has been released (number)

This one-shot condition is fired when the specific touch has been released (when the user removes his finger from the screen). It asks for one parameter, the number of the touch to monitor.

Actions

Set drag X origin

This action changes the X coordinate of the origin of the drag operation. It asks for the number of the touch to affect and the new coordinate.

Set drag Y origin

This action changes the Y coordinate of the origin of the drag operation. It asks for the number of the touch to affect and the new coordinate.

Expressions

Touch

Get number of touches

Number( "Multiple Touch" )

Retrieves the current number of active touches, which is the number of fingers on the screen.

Get last touch

LastTouch( "Multiple Touch" )

Retrieves the slot number of the last touch initiated by the user. Please note, that if the user starts two touches at the same time (quite unlikely, but this can happen), you may miss one of the new touches.

Get last new touch

LastNewTouch( "Multiple Touch" )

Retrieves the slot number of the last new touch initiated by the user. Please note, that if the user starts two touches at the same time (quite unlikely, but this can happen), the second one is reported.

Get last end touch

LastEndTouch( "Multiple Touch" )

Retrieves the slot number of the last touch released by the user. Please note, that if the user end two touches at the same time (quite unlikely, but this can happen), the second one is reported.

Get touch X

XTouch( "Multiple Touch", >Number of the touch (0 based)< )

Returns the last X coordinate of the touch in the given slot. The parameter is the number of the slot to test. If the slot is not an active touch at the time of calling, this expression returns -1.

Get touch Y

YTouch( "Multiple Touch", >Number of the touch (0 based)< )

Returns the last Y coordinate of the touch in the given slot. The parameter is the number of the slot to test. If the slot is not an active touch at the time of calling, this expression returns -1.

Drag

Get X origin

XTouchOrigin( "Multiple Touch", >Number of the touch (0 based)< )

Returns the X position where the drag operation has begun (where the user has put his finger). This expression asks for the number of the touch.

Get Y origin

YTouchOrigin( "Multiple Touch", >Number of the touch (0 based)< )

Same as above, for the Y origin.

Get X delta

XTouchDelta( "Multiple Touch", >Number of the touch (0 based)< )

In case of drag, this expression returns the difference between the current X position of the finger and the origin of the drag. It asks for the number of the touch.

Get Y delta

YTouchDelta( "Multiple Touch", >Number of the touch (0 based)< )

Same as above, for the Y difference.

Get angle

AngleTouch( "Multiple Touch", >Number of the touch (0 based)< )

In case of drag, this expression returns the angle of the vector traced between the origin and the current dragging point. The value returned is the angle in degrees, from 0 to 360. This expression asks for the number of the touch.

Get distance

DistanceTouch( "Multiple Touch", >Number of the touch (0 based)< )

In case of drag, this expression returns the distance between the current position of the drag and its origin. This expression asks for the number of the touch.

Pinch

Get pinch distance

pinchDistance( "Multiple Touch" )

This expression returns, when it is active, the distance between the two fingers of the pinch. The result is only valid when a pinch is occurring.

Get pinch angle

pinchAngle( "Multiple Touch" )

This expression returns, when it is active, the angle of the pinch (the angle of the line created by the two fingers). The result is expressed in degrees, and is only valid when a pinch is occurring.

Get pinch percentage

pinchPercent( "Multiple Touch" )

This expression returns, when it is active, the percentage of growth of the distance between the two fingers compared with the distance when the pinch started. For example, a value of 200 will mean that the distance has doubled.


Contributors to this page

Advaith (100.0%)