View gist:8697477
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
// mouse events - mousePressed(), mouseReleased(), mouseMoved(), mouseDragged() | |
// runs once each time unlike mousepressed | |
var gray = 0; | |
function setup() { | |
createGraphics(600, 400); | |
} |
View gist:9399632
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
// 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
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
function setup() { | |
createCanvas(600, 400); | |
background(255, 0, 0); | |
} | |
function draw() { | |
} |
View gist:9955650
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
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
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
var div; | |
var cnv; | |
var x = 0; | |
function setup() { | |
cnv = createCanvas(600, 400); | |
div = createHTML("HERE IS TEXT"); | |
} |
View gist:11052282
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
var element; | |
function setup() { | |
element = createHTML("You chose the color ______"); | |
element.style("color:blue"); | |
} | |
function draw() { |
View gist:11185292
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
// 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() { |
View gist:11253473
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
var values = { | |
radius: 40, | |
opacity: 1, | |
color: 'red', | |
animate: false | |
}; | |
var components = { | |
radius: { | |
type: 'slider', label: 'Radius', |
View gist:64ddafbf082b7fc16203
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
//// 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
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
var c; | |
function setup() { | |
c = createCanvas(800, 600); | |
console.log(width, height); | |
} | |
function draw() { | |
background(95, 65, 26); | |
}; |
OlderNewer