Skip to content

Instantly share code, notes, and snippets.

Avatar
🍊

Lauren Lee McCarthy lmccart

🍊
View GitHub Profile
View gist:8697477
// mouse events - mousePressed(), mouseReleased(), mouseMoved(), mouseDragged()
// runs once each time unlike mousepressed
var gray = 0;
function setup() {
createGraphics(600, 400);
}
@lmccart
lmccart / gist:9399632
Last active Aug 29, 2015
p5 sketch instance options
View gist:9399632
// Note: all of these are demonstrating the implicit version where
// no canvas or div is specified, and one is automatically generated.
// With all of these it would be possible to also pass in a node.
// Option 1: sketch is obj created and run by p5
var sketch = new P5.createSketch();
sketch.gray = 0;
View gist:9762141
function setup() {
createCanvas(600, 400);
background(255, 0, 0);
}
function draw() {
}
View gist:9955650
var angle = 0;
var img;
function setup() {
cnv = createCanvas(600, 400);
//noLoop();
noStroke();
console.log(img);
img = createHTMLImage("https://pbs.twimg.com/media/BkLMTz9IIAAKobt.jpg");
View gist:10333272
var div;
var cnv;
var x = 0;
function setup() {
cnv = createCanvas(600, 400);
div = createHTML("HERE IS TEXT");
}
@lmccart
lmccart / gist:11052282
Last active Aug 29, 2015
html manipulation
View gist:11052282
var element;
function setup() {
element = createHTML("You chose the color ______");
element.style("color:blue");
}
function draw() {
View gist:11185292
// https://github.com/auduno/headtrackr
// http://auduno.github.io/headtrackr/documentation/reference.html
var mySketch = function(sketch) {
var pop;
var radius = 10;
var y = 270;
sketch.setup = function() {
@lmccart
lmccart / gist:11253473
Created Apr 24, 2014
sketch.paperjs test code
View gist:11253473
var values = {
radius: 40,
opacity: 1,
color: 'red',
animate: false
};
var components = {
radius: {
type: 'slider', label: 'Radius',
View gist:64ddafbf082b7fc16203
//// TOUCHX/Y
// touch events are very similar to mouse events
var red = 0;
function setup() {
createCanvas(windowWidth, windowHeight);
noStroke();
fill(255, 255, 255);
View gist:8a2fa5ad81edcf3344e2
var c;
function setup() {
c = createCanvas(800, 600);
console.log(width, height);
}
function draw() {
background(95, 65, 26);
};