This file contains hidden or 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
<!doctype html> | |
<html> | |
<head> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/0.4.23/p5.js"></script> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/0.4.23/addons/p5.dom.js"></script> | |
<script src="https://cdn.socket.io/socket.io-1.4.5.js"></script> | |
<script> | |
var socket = io(); | |
socket.on('chat message', function(msg){ | |
createDiv(msg); |
This file contains hidden or 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
///////////////////////////////////////////////////////////////////////// | |
//// MANIFEST | |
{ | |
"manifest_version": 2, | |
"name": "Getting started example", | |
"description": "This extension shows a Google Image search result for the current page", |
This file contains hidden or 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
// Port of Processing Examples > Libraries > Video > Mirror | |
// Size of each cell in the grid | |
var cellSize = 20; | |
// Number of columns and rows in our system | |
var cols, rows; | |
// Variable for capture device | |
var vid; |
This file contains hidden or 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, 600) | |
noFill(); | |
stroke(255); | |
} | |
function draw() { | |
background(0, 10); |
This file contains hidden or 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
//////////////////////////////////////// | |
//// BASIC BOX | |
function setup() { | |
createCanvas(600, 400, WEBGL); | |
} | |
function draw(){ | |
background(0); | |
box(); |
This file contains hidden or 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 DRAW | |
// Take a look at the HTML file where some things have been | |
// added for mobile viewing | |
function setup() { | |
// Make the canvas the size of the mobile device screen | |
createCanvas(windowWidth, windowHeight); |
This file contains hidden or 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
// Worker thread to help with massive pixel processing. | |
self.onmessage = function(event) { | |
if (event.data.hasOwnProperty("message")){ | |
var message = event.data.message; | |
console.log("Worker got message ", event.data.message); |
This file contains hidden or 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
////////////////////////////////////////////////// | |
///////////////////////////////////// SOUND | |
//// 1. Click to toggle sound. | |
var song; | |
function preload() { | |
song = loadSound("sounds/beat.mp3"); |
This file contains hidden or 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 img; | |
function preload() { | |
img = loadImage('cat.jpg'); | |
} | |
function setup() { | |
createCanvas(600, 400); | |
copy(img, 0, 0, 50, 50, 50, 50, 50, 50); | |
copy(img, 50, 50, 50, 50, 150, 150, 50, 50); |
This file contains hidden or 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
//// LOAD STRINGS PRELOAD | |
var lines; | |
function preload() { | |
lines = loadStrings("lines.txt"); | |
} | |
function setup() { | |
createCanvas(600, 400); |