Skip to content

Instantly share code, notes, and snippets.

@Yannael
Created April 16, 2016 12:05
Show Gist options
  • Save Yannael/2511c41e41dcc0a36ed03477b207e90e to your computer and use it in GitHub Desktop.
Save Yannael/2511c41e41dcc0a36ed03477b207e90e to your computer and use it in GitHub Desktop.
FnCrandow
<!DOCTYPE html>
<head>
<meta charset="utf-8">
<script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/0.4.23/p5.min.js"></script>
</head>
<body>
<script>
wait=1000;
function setup() {
createCanvas(640, 480);
image(img,0,0,400,200);
now=millis()
}
function preload() {
img = loadImage("http://foodandcode.github.io/assets/images/footer_back.png");
}
function draw() {
if ((millis()-now)>wait) {
now=millis()
if (mouseIsPressed) {
background(255)
} else {
background(0)
}
tint(255,255,255); // Color, so plays like stroke and fill
image(img,random(width)-100, random(height)-50, 200, 100);
//ellipse(mouseX, mouseY, 80, 80);
}
} </script>
</body>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment