Hi!
I’m new to openFrameworks, coming from Processing. So, hello to everyone since this is my first post, and congratulations to the developers.
Maybe someone can help me with this: I’m doing a test on dragging an image around using the mouse position. In Processing, I would use PmouseX and PmouseY (functions that retrieve the X and Y position of the mouse in the previous frame) to detect the direction towards I try to move the image. Is there any similar function in openFrameworks? what would you recommend to do in this case?
I’m also working with a processing project which i’m trying to convert it into iphone application using ofxIphone. The thing is, i can’t find the mouseX variable in update(). What i do is put the pmouseX = touch.x in touchMoved(), touchDown() and touchUp(). But it seems the movement doesn’t work very smooth.
mouseX and mouseY are variables that are part of the ofBaseApp (which your app extends) so you wont see them, but they are there and accessible in update and draw.
Yeah, it works. I’m working on a project which using “Ball” objects. I need to use pmouseX and pmouseY to grab and move the ball nicely. I came out with an idea:
it’s like saving the position of the touch for the last 2 frames. As u see i don’t write any code for position in the update(). This initial idea is working fine. And when i tried the one u gave me, it seems like there’s something wrong with memory. The balls’ movement are slow everytime i touch the surface even when im not touching the balls.
Do u know why is this happening? And which idea do u think i should use? The initial one which work okay but using arrays and boolean, or the one u gave me which quite straight-forward but slow when i touch? >.<