Page 1 of 1

right kilk problems

Posted: Sat May 05, 2007 9:46 pm
by darksmaster923
k i want if the right mouse button is pressed, a variable changes
but there glitches with this code

Code: Select all

              	if(self.rbutton_pressed) // right button press
                {
                       	if(zoomed = true)
                        {
                              	zoomed = false;
				return 0;
                        }
			else
			{
                            	zoomed = true;
				return 0;
			}
                }
it doesnt seem to change the var when i want it to

Posted: Sun May 06, 2007 8:47 pm
by Jay
You wrote:

Code: Select all


if(self.rbutton_pressed) // right button press 
{ 
   if(zoomed = true) 
   { 
      zoomed = false; 
      return 0; 
   }
   else 
   { 
      zoomed = true; 
      return 0; 
   } 
}
I just wrote it again because from the code you wrote (the visualization) it is very hard to see what it actually does. Please try to write it better next time. If you want the poeple to help you then you should also make it as easy as possible for them, becuase then also more poeple will try to help you. :wink:

Now for your problem:
I had this problem once too, i think, i made a workaround by writing the values in ""s.

maybe like this:

Code: Select all

if(self.rbutton_pressed) // right button press 
{ 
   if(zoomed = "true") 
   { 
      zoomed = "false"; 
      return 0; 
   }
   else 
   { 
      zoomed = "true"; 
      return 0; 
   } 
}
Somehow simkin seems to have problems with xxx = true and xxx = false, but xxx = "true" and xxx = "false" do work.