We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpSyntax Questions › flipping the mouse movement
Page Index Toggle Pages: 1
flipping the mouse movement (Read 995 times)
flipping the mouse movement
Apr 29th, 2005, 7:33pm
 
ok, this may seem like a dumb question but I have been having problem with that. is there any way to flip the mouse movement horizontally like when i move the mouse to left but the pointer goes right? mouseX and/or pmouseX are flipped but mouseY and/or pmouseY keep no changing.

cheers,

proce55ing newbie
zara
Re: flipping the mouse movement
Reply #1 - May 1st, 2005, 11:28pm
 
Try the width of the stage minus the current mouse position:

Code:

void setup() {
 size(200,200);
}

void draw() {
 background(153);
 int x1 = width-mouseX;
 int y1 = mouseY;
 ellipseMode(CENTER);
 ellipse(x1, y1, 10, 10);
}


In the example the circle draws the opposite side of the window from the mouse position.
Page Index Toggle Pages: 1