I have been working on MT4j since long , but the development has stopped since long.(It is using processing 1.5). I tried porting it to Processing 2.0 but it ended up with long list of errors. Therefore I thought it will be a good idea to start the work of a new Multitouch library using processing. What do you think ?
Anybody up for help ? I could use some help from the brilliant folks here. :-)
I am new to the forum. I am using processing through another framework (MT4J), which uses Processing 1.5
What I am trying to achieve is simple. I have a background image-bgImage , a foreground image-fgImage .(both of same size drawn on screen with fgImage on top). Now when a person touches at x,y . The background image is revealed near the finger with some animation (say one star rotating/circle with border on fire etc).
So I draw the bgImage , then set alpha of respective pixels of fgImage to 0. I have loaded the animated png sequence to calculate the animated pixels. The draw code is as follows.
P.S - I am using processing 1.5 through mt4j , therefore I have to call the functions using graphics.image() instead of image() and app.alpha() instead of alpha().
fgImage.updatePixels(); //Update the pixels, seems like this reduces the fps
graphics.image(fgImage,0,0);
}
Till line 8 - Everything runs normally with 60fps. (i.e with other parts commented out)
Till line 26 - Runs fine with 60fps , but with one finger on , runs with 40 fps , average
When line 27 is uncommented , the fps drops directly to 4-5 fps.
I don't see any obvious error. Can anyone please point me where I am doing wrong ? Or is there any better approach to handle this problem ?
Thanks in advance.
Edit: Seems like if I comment out line #21 & #25 , it runs @ 60fps. i.e. if I dont update the pixels in fgImage, with #25 commented out , runs @ 40-45 fps when there's any finger.