-
1 Attachment(s)
How to Pinch this
I have this example, and it's working fine with a mouse to Zoom in and out and move around.
I am trying to replace the scroll from the mouse with pinching it, and moving my finger to move around.
I have them both working separately, but combined, I cannot get it to work.
Anyone knows how to implement this?.
Been working on this forever, and cannot figure it out.
I disabled the pinching part.
I have set it to Windows, so you need to change it back to Android.
Thank you
-
:(
I see the pinch object has various parameters,
I could only try to "guess" what they do without chance to test...
I'm very sorry not being able to help in this situation.
Maybe the easiest thing would be being able to replace the "mouse wheel" action with "on pinch" action,
but I see that pinching takes also other parameters and wants a scale..
Same thing for touch, should replace mouse position, but also make for scroll...
couldn't you replace various xmouse/ymouse with "last thumb position" in some way?
Well, I guess this will be of very little help,
hope someone will sort that out soon :(
-
I Need to clarify something.
At the end, I only need Event 1-14. Not even 15 and up. I just added that, to see how the pinching should work.
Till today, I am still stuck.
Anyone has any insight on how to make this work?
-
1 Attachment(s)
ok, I got the pinch to work, but now I am running into a few other issues..
1. How can I set the min zoom ?
2. The Max Zoom is I think 5.. at least if that's what I think it is, at the end of the pinch event.
3. How can I slow it down a lot? now it's flying on the screen
4. as soon as I touch the screen. it's jumping to a different location.. how to prevent that?
Any help is appriciated
-
1 Attachment(s)
This is what I have so far now.
Still not getting the zooming with pinching right..
even when I zoom in, and tap on the screen, it should stay at that position, and now it's jumping all over the place.
Does anyone know about this ?
-
A couple things:
1) I couldn't get the pinch to work until I removed the extra conditions in the 'A pinch is active' event. The Min/Max expressions should prevent the values from getting out of the range but if they somehow did you actively prevent the code from correcting this.
2) When you start a pinch you need to find out a "pivot point" of sorts - a point where the zooming scaling will originate from. If you simply use the XMouse/YMouse unmodified you end up having the objects jump when you start pinching. So when the pinch is started your "pivot point" should be the center point between the two fingers which you have to figure out yourself : (first touch position + second touch position)/2
So to scale and position objects you first subtract the pivot point position from the object's orginal coordinate (I think you store this in Alterable Value X and Y), then scale and then move back to the pivot position.
Basically in pseudocode: (originalPosition - pivot)*scale + pivot
-
1. I Removed those again, but then there is no min and max limit anymore.
2. I tried Value "center" and grabbed the pinch distance("Touch Object") / 2 to get that number.
3. then the last one... I got lost :(
something like this (originalPosition - "center")* current_scale("object") + "center"
But where to I put it and to what?
-
ok.. got that with the Min / Max sorted out.
Min(Max(referenceScale( "Multiple Touch" ) * ( pinchPercent( "Multiple Touch" ) / 100.0 ), 1.0 ), 2.5 )
I had those wrong.
So that's fixed :)
As far the items jumping.. Those are not jumping..
All the items are fine..
The issue that I mean it, when you zoom in. and tap the screen, the whole screen jumps to a different position.. All the objects etc are fine :)
it's that 1 finger touching the screen.
edit: Think I see what that touch does... when I touch it's taking the x,y from the screen and doesn't see if it's zoomed or not... so I need to add that somewhere, somehow..
-
Already then.... another week passed by and tried 100's of combo's ...
I am still stuck wit the following.....
if you zoom in... and then tap on he screen, it's jumping the whole screen, as if it's not going to the correct X,Y position..
I added 2 counters to see if it reflects were i tap, and it's showing the correct X and Y, but how to i revert it back to the code, so it stays on that position on the screen??
Anyone any suggestions ??? .. I'm about to check myself into the mental hospital because of this :(
-
ok, I am still stuck with this...
Anyone has any clue ?
-
Oh Perry,
I saw it but not have much time to run but I think anders comment is the one
you need to "scaled positioning" your center.
-
I will take a look again tonight.. Thanks..
I did see a comment from Anders, and did that, but looks like I am missing the + pivot at the end.. that might be my missing link here.
Assuming that I need to set the Touch Drag X and Y for that.
-
1 Attachment(s)
ok, here is a new file..
I added some new items in there, but now the item stays in the left top corner :(
idk, what i am missing here now.