I saved older positions in case MotionEvent.ACTION_POINTER_DOWN for zoom and case MotionEvent.ACTION_DOWN for pan
this is the errors :
[javac] Compiling 2 source files to C:\DOCUME~1\T0P4568\LOCALS~1\Temp\android893850823480544580.pde\bin\classes
[javac] C:\DOCUME~1\T0P4568\LOCALS~1\Temp\android893850823480544580.pde\src\changethispackage\beforesubmitting\tothemarket\sketch_may28a\sketch_may28a.java:118: variable x0 might not have been initialized
[javac] C:\DOCUME~1\T0P4568\LOCALS~1\Temp\android893850823480544580.pde\src\changethispackage\beforesubmitting\tothemarket\sketch_may28a\sketch_may28a.java:119: variable y0 might not have been initialized
[javac] C:\DOCUME~1\T0P4568\LOCALS~1\Temp\android893850823480544580.pde\src\changethispackage\beforesubmitting\tothemarket\sketch_may28a\sketch_may28a.java:125: variable z4 might not have been initialized
Not sure about the way you're going about doing it, but your error is caused because you haven't properly initialized any of your variables... You're declaring them in one case statement and trying to use them in another. Try declaring and initializing them all outside of the switch statement...
On a side note, go to Edit > Auto Format to make your code easier to read...
how can I initiate the outside the switch ? for example I should save the old position in MotionEvent.ACTION_POINTER_DOWN because it's the place where recognize the second finger touch the screen and case MotionEvent.ACTION_MOVE is where we get the movement . In android I think it's how we that but I'm not sure how can I do this in processing. I want to compare the old distance between two fingers and the new one to perfom zoomming .
Leave a comment on calsign's reply
Change topic type
Link this topic
Provide the permalink of a topic that is related to this topic