• The syntax of JAVA condition statement is the same as C/C++ and Javascript, so transition is very easy
  • Other languages have similar statements, also trivially easy to make transition following the relevant document
  • Add Unx's example from : (https://www.openprocessing.org/sketch/47481)
Simple
 
void setup()
{
  size(400,400);
  strokeWeight( 2 );
}
void draw()
{
  if( mouseX > 200 ) {
    background( 255 ); //White
	stroke( 0 );
	line( 200, 0, 200, 400 );
  } else {
    background( 0 ); //Black
	stroke( 255 );
	line( 200, 0, 200, 400 );
  }
}
Mouse Pressed Variable
if( mousePressed ) {
    background( 255 ); //White
}
Mouse Pressed
 
void setup()
{
  size(400,400);
  strokeWeight( 2 );
}
void draw()
{
  if( mousePressed ) {
    background( 255 ); //White
  } else {
    background( 0 ); //Black
  }
}
  • No labels