Modifications

BacASable

559 octets ajoutés, 30 mars 2012 à 12:57
ProcessingJS
====ProcessingJS====
<processingjs>/* PROCESSINGJS.COM - BASIC EXAMPLE Delayed Mouse Tracking MIT License - Hyper-Metrix.com/F1LT3R Native Processing compatible */  // Global variablesfloat radius = 50.0;int X, Y;int nX, nY;int delay = 16; // Setup the Processing Canvasvoid setup(){ size(300200, 200); strokeWeight( 10 ); frameRate( 15 ); X = width / 2; Y = width / 2; nX = X; nY = Y; } // Main draw loopvoid draw(){ radius = radius + sin( frameCount / 4 ); // Track circle to new destination X+=(nX-X)/delay; Y+=(nY-Y)/delay; // Fill canvas grey background(100); // Set fill-color to blue fill( 0, 121, 184 ); // Set stroke-color white stroke(255); // Draw circle ellipse(150X, 50Y, 25radius, 25radius );
}
  // Set circle's next destinationvoid loopmouseMoved(){background(100) nX = mouseX;ellipse(mouseX, 50, 25, 25) nY = mouseY;
}
 
</processingjs>
{{#processingjs:void setup() { size(200, 290); background(100); stroke(255); ellipse(50, 50, 25, 25); println('hello web!'); }}}
0
6 691
modifications