Page 1 of 1

Pan and Release Working Together

PostPosted: Mon Jun 04, 2018 4:14 pm
by SlaggyWolfie
Hi,

I am still new to TouchScript, so I'm wondering if anybody has an idea how to achieve a specific effect: You need to release your touch on an object to select, but also want to pan the camera - so whenever the pointer ends on an object and the pointer is released, it selects, however, it must also work in conjunction with the camera panning, so if you start the pointer on top of the object but move away the pointer and therefore pan the camera, and the pointer is released (and it's not on top of the object anymore), so the object is not selected. And vice versa if you start panning but end on top of an object - it selects (interacts with) the object.

I attempted to get this behaviour with the Fullscreen Layer using the Screen Transform gesture and the Release gesture for the objects but I'm starting to believe a custom gesture would be better. Any ideas?

Re: Pan and Release Working Together

PostPosted: Tue Jun 12, 2018 10:06 pm
by SlaggyWolfie
Bump.

Re: Pan and Release Working Together

PostPosted: Thu Jun 21, 2018 5:56 pm
by SlaggyWolfie
Ok, I'm trying to semi-merge the functionality of the Screen Transform Gesture and the Release Gesture - the point being to achieve the effect of clicking on something BUT if you decide to drag/transform whatever (by going over a threshold) it'll cancel the click (in this case the Release) and perform the standard Screen Transform's behaviour.

So to sum it up a Gesture that when Released and that has not had its pointer moved will throw an OnReleased event or something similar, otherwise if it does exit the threshold it'll perform as the Screen Transform Gesture.

I have currently attempted to achieve this by inheriting from TwoPointTransformGestureBase by importing some code from the Release Gesture and the Screen Transform Gesture. Any pointers (no pun intended) on how to proceed?