Skip to content

Instantly share code, notes, and snippets.

View lmccart's full-sized avatar
🍊

Lauren Lee McCarthy lmccart

🍊
View GitHub Profile
// 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 August 29, 2015 13:57
p5 sketch instance options
// 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;
function setup() {
createCanvas(600, 400);
background(255, 0, 0);
}
function draw() {
}
@lmccart
lmccart / gist:9955650
Last active August 29, 2015 13:58
test gist
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");
var div;
var cnv;
var x = 0;
function setup() {
cnv = createCanvas(600, 400);
div = createHTML("HERE IS TEXT");
}
@lmccart
lmccart / gist:11052282
Last active August 29, 2015 14:00
html manipulation
var element;
function setup() {
element = createHTML("You chose the color ______");
element.style("color:blue");
}
function draw() {
// 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 April 24, 2014 12:50
sketch.paperjs test code
var values = {
radius: 40,
opacity: 1,
color: 'red',
animate: false
};
var components = {
radius: {
type: 'slider', label: 'Radius',
//// TOUCHX/Y
// touch events are very similar to mouse events
var red = 0;
function setup() {
createCanvas(windowWidth, windowHeight);
noStroke();
fill(255, 255, 255);
var c;
function setup() {
c = createCanvas(800, 600);
console.log(width, height);
}
function draw() {
background(95, 65, 26);
};