This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// as of 1.4.2 the mobile safari reports wrong values on offset() | |
// http://dev.jquery.com/ticket/6446 | |
// remove once it's fixed | |
if ( /webkit.*mobile/i.test(navigator.userAgent)) { | |
(function($) { | |
$.fn.offsetOld = $.fn.offset; | |
$.fn.offset = function() { | |
var result = this.offsetOld(); | |
result.top -= window.scrollY; | |
result.left -= window.scrollX; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int oWidth = 20; | |
int oHeight = oWidth; | |
int oX; | |
int oY; | |
void setup() { | |
size(800,600); | |
background(0); | |
oX = floor(random(width/oWidth)) * oWidth; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int oWidth = 20; | |
int oHeight = oWidth; | |
int oX; | |
int oY; | |
void setup() { | |
size(800,600); | |
background(0); | |
oX = floor(random(width/oWidth)) * oWidth; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int oWidth = 20; | |
int oHeight = oWidth; | |
int oX; | |
int oY; | |
void setup() { | |
size(800,600); | |
background(0); | |
oX = floor(random(width/oWidth)) * oWidth; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void setup() { | |
size(1000, 715); | |
background(255); | |
smooth(); | |
} | |
void draw() { | |
stroke(0,random(10,16)); | |
noFill(); | |
beginShape(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void setup() { | |
size(1000, 715); | |
background(255); | |
smooth(); | |
} | |
void draw() { | |
stroke(0,random(10,16)); | |
noFill(); | |
beginShape(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ArrayList points; | |
int progress = 2; | |
void setup() { | |
size(1200, 800); | |
background(250); | |
smooth(); | |
frameRate(5); | |
points = new ArrayList(); | |
points.add(new Point(width/2, height*0.45)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ArrayList points; | |
int progress = 2; | |
void setup() { | |
size(1200, 800); | |
background(250); | |
smooth(); | |
frameRate(5); | |
points = new ArrayList(); | |
points.add(new Point(width/2, height*0.45)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// continuous loop over array pseudo-code example | |
var index = 0; | |
var arr = [1,2,3,4]; | |
// once the step is done, let's jump to the next one | |
if(nextStep){ | |
index = (index + 1) % arr.length; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Global variables | |
int X, Y; | |
int nX, nY; | |
int delay = 10; | |
// Setup the Processing Canvas | |
void setup() { | |
size( 800, 600 ); | |
smooth(); | |
strokeWeight(1); |