├── .gitignore ├── examples ├── basic │ ├── helloworld.pde │ ├── eames.jpg │ ├── jelly.jpg │ ├── google-code-prettify │ │ ├── lang-go.js │ │ ├── lang-lua.js │ │ ├── lang-ml.js │ │ ├── lang-sql.js │ │ ├── lang-tex.js │ │ ├── lang-vb.js │ │ ├── lang-vhdl.js │ │ ├── lang-wiki.js │ │ ├── lang-apollo.js │ │ ├── lang-scala.js │ │ ├── lang-proto.js │ │ ├── lang-yaml.js │ │ ├── lang-hs.js │ │ ├── prettify.css │ │ ├── lang-lisp.js │ │ ├── lang-css.js │ │ ├── lang-n.js │ │ ├── lang-clj.js │ │ └── prettify.js │ ├── fillstrokeweight.pde │ ├── shapeprimitives.pde │ ├── color.pde │ ├── hashmap.pde │ ├── text.pde │ ├── createimage.pde │ ├── piechart.pde │ ├── loop.pde │ ├── scale.pde │ ├── pointsandlines.pde │ ├── variables.pde │ ├── pgraphics.pde │ ├── easing.pde │ ├── rotate.pde │ ├── functions.pde │ ├── loadimage.pde │ ├── coordinatesystem.pde │ ├── arm.pde │ ├── translate.pde │ ├── redraw.pde │ ├── setupanddraw.pde │ ├── pointilism.pde │ ├── coollines.pde │ ├── keyboard.pde │ ├── mousesignals.pde │ ├── colorwheel.pde │ ├── objects.pde │ ├── arraylist.pde │ └── index.html ├── pewpew │ ├── highscores.itf │ ├── images │ │ ├── body_bg.png │ │ ├── wrapper_bg.png │ │ └── jui │ │ │ ├── pbar-ani.gif │ │ │ ├── ui-bg_inset-soft_25_000000_1x100.png │ │ │ └── ui-bg_gloss-wave_35_f6a828_500x100.png │ ├── pewpew.js │ ├── css │ │ ├── pewpew.css │ │ ├── console.css │ │ ├── reset.css │ │ └── main.css │ ├── index.html │ ├── jquery.hotkeys-0.7.9.js │ └── input.js ├── localfiles │ ├── test.pde │ └── test.html ├── processing-and-js │ ├── translation.html │ ├── translation.pde │ ├── translation.pjs │ ├── translation.js │ ├── translation-html.html │ ├── index.html │ ├── translation-inline.html │ ├── translation-jquery.html │ ├── translation-data-window.html │ ├── translation-data-sketch.html │ ├── translation-js.html │ ├── translation-many-sketches.html │ ├── translation-fullscreen.html │ └── translation-data-html.html ├── tangle │ ├── Tangle-0.1.0 │ │ ├── TangleKit │ │ │ ├── TangleKit.css │ │ │ ├── BVTouchable.js │ │ │ ├── sprintf.js │ │ │ └── TangleKit.js │ │ ├── TangleTemplate.html │ │ └── Tangle.js │ └── index.html ├── multitouch │ └── index.html ├── processing-mobile │ └── index.html └── twitter │ ├── twitter-images.html │ ├── blprnt-twitter-demo.html │ └── processing-twitter.js ├── README.md ├── tools ├── httpd.py ├── processing-helper.html └── processing-helper.js ├── index.html ├── processing-mobile.js └── processing-phonegap.js /.gitignore: -------------------------------------------------------------------------------- 1 | *~ 2 | .DS_Store 3 | -------------------------------------------------------------------------------- /examples/basic/helloworld.pde: -------------------------------------------------------------------------------- 1 | size(450, 450); 2 | 3 | textSize(80); 4 | text("Hello World", 20, height/2); 5 | -------------------------------------------------------------------------------- /examples/basic/eames.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/processing-js/processing-mobile/HEAD/examples/basic/eames.jpg -------------------------------------------------------------------------------- /examples/basic/jelly.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/processing-js/processing-mobile/HEAD/examples/basic/jelly.jpg -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Processing Mobile 2 | ----------------- 3 | 4 | A collection of demos used on the Processing.js Workshop Tour 5 | -------------------------------------------------------------------------------- /examples/pewpew/highscores.itf: -------------------------------------------------------------------------------- 1 | [["343200","spoo"],["252000","omeh"],["246400","omeh"],["232800","omeh"],["179600","omeh"]] 2 | -------------------------------------------------------------------------------- /examples/pewpew/images/body_bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/processing-js/processing-mobile/HEAD/examples/pewpew/images/body_bg.png -------------------------------------------------------------------------------- /examples/pewpew/images/wrapper_bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/processing-js/processing-mobile/HEAD/examples/pewpew/images/wrapper_bg.png -------------------------------------------------------------------------------- /examples/pewpew/images/jui/pbar-ani.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/processing-js/processing-mobile/HEAD/examples/pewpew/images/jui/pbar-ani.gif -------------------------------------------------------------------------------- /examples/basic/google-code-prettify/lang-go.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/processing-js/processing-mobile/HEAD/examples/basic/google-code-prettify/lang-go.js -------------------------------------------------------------------------------- /examples/basic/google-code-prettify/lang-lua.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/processing-js/processing-mobile/HEAD/examples/basic/google-code-prettify/lang-lua.js -------------------------------------------------------------------------------- /examples/basic/google-code-prettify/lang-ml.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/processing-js/processing-mobile/HEAD/examples/basic/google-code-prettify/lang-ml.js -------------------------------------------------------------------------------- /examples/basic/google-code-prettify/lang-sql.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/processing-js/processing-mobile/HEAD/examples/basic/google-code-prettify/lang-sql.js -------------------------------------------------------------------------------- /examples/basic/google-code-prettify/lang-tex.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/processing-js/processing-mobile/HEAD/examples/basic/google-code-prettify/lang-tex.js -------------------------------------------------------------------------------- /examples/basic/google-code-prettify/lang-vb.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/processing-js/processing-mobile/HEAD/examples/basic/google-code-prettify/lang-vb.js -------------------------------------------------------------------------------- /examples/basic/google-code-prettify/lang-vhdl.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/processing-js/processing-mobile/HEAD/examples/basic/google-code-prettify/lang-vhdl.js -------------------------------------------------------------------------------- /examples/basic/google-code-prettify/lang-wiki.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/processing-js/processing-mobile/HEAD/examples/basic/google-code-prettify/lang-wiki.js -------------------------------------------------------------------------------- /examples/basic/google-code-prettify/lang-apollo.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/processing-js/processing-mobile/HEAD/examples/basic/google-code-prettify/lang-apollo.js -------------------------------------------------------------------------------- /examples/basic/google-code-prettify/lang-scala.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/processing-js/processing-mobile/HEAD/examples/basic/google-code-prettify/lang-scala.js -------------------------------------------------------------------------------- /examples/pewpew/images/jui/ui-bg_inset-soft_25_000000_1x100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/processing-js/processing-mobile/HEAD/examples/pewpew/images/jui/ui-bg_inset-soft_25_000000_1x100.png -------------------------------------------------------------------------------- /examples/pewpew/images/jui/ui-bg_gloss-wave_35_f6a828_500x100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/processing-js/processing-mobile/HEAD/examples/pewpew/images/jui/ui-bg_gloss-wave_35_f6a828_500x100.png -------------------------------------------------------------------------------- /examples/basic/fillstrokeweight.pde: -------------------------------------------------------------------------------- 1 | size(200, 200); 2 | background(255); 3 | 4 | rect(5, 5, 90, 90); 5 | 6 | fill(50, 200, 50); 7 | rect(105, 5, 90, 90); 8 | 9 | strokeWeight(10); 10 | rect(10, 110, 80, 80); 11 | 12 | stroke(50, 50, 150); 13 | rect(110, 110, 80, 80); 14 | -------------------------------------------------------------------------------- /examples/basic/shapeprimitives.pde: -------------------------------------------------------------------------------- 1 | size(200, 200); 2 | smooth(); 3 | background(0); 4 | noStroke(); 5 | fill(226); 6 | triangle(10, 10, 10, 200, 45, 200); 7 | rect(45, 45, 35, 35); 8 | quad(105, 10, 120, 10, 120, 200, 80, 200); 9 | ellipse(140, 80, 40, 40); 10 | triangle(160, 10, 195, 200, 160, 200); 11 | -------------------------------------------------------------------------------- /examples/basic/color.pde: -------------------------------------------------------------------------------- 1 | size(200, 200); 2 | noStroke(); 3 | 4 | color inside = color(204, 102, 0); 5 | color middle = color(204, 153, 0); 6 | color outside = color(153, 51, 0); 7 | 8 | fill(outside); 9 | rect(0, 0, 200, 200); 10 | fill(middle); 11 | rect(40, 60, 120, 120); 12 | fill(inside); 13 | rect(60, 90, 80, 80); 14 | -------------------------------------------------------------------------------- /examples/basic/google-code-prettify/lang-proto.js: -------------------------------------------------------------------------------- 1 | PR.registerLangHandler(PR.sourceDecorator({keywords:"bytes,default,double,enum,extend,extensions,false,group,import,max,message,option,optional,package,repeated,required,returns,rpc,service,syntax,to,true",types:/^(bool|(double|s?fixed|[su]?int)(32|64)|float|string)\b/,cStyleComments:!0}),["proto"]); 2 | -------------------------------------------------------------------------------- /examples/basic/hashmap.pde: -------------------------------------------------------------------------------- 1 | HashMap hm = new HashMap(); 2 | 3 | hm.put("Ava", 1); 4 | hm.put("Cait", 35); 5 | hm.put("Casey", 36); 6 | 7 | Iterator i = hm.entrySet().iterator(); // Get an iterator 8 | 9 | while (i.hasNext()) { 10 | Map.Entry me = (Map.Entry)i.next(); 11 | print(me.getKey() + " is "); 12 | println(me.getValue()); 13 | } 14 | -------------------------------------------------------------------------------- /examples/basic/text.pde: -------------------------------------------------------------------------------- 1 | size(450, 450); 2 | background(255); 3 | fill(0); 4 | 5 | text("PJS", 20, 20); 6 | 7 | textSize(80); 8 | text("PJS", 20, 80); 9 | 10 | textAlign(RIGHT); 11 | text("PJS", 120, 160); 12 | textAlign(CENTER); 13 | text("PJS", 120, 240); 14 | textAlign(LEFT); 15 | text("PJS", 120, 320); 16 | 17 | fill(50, 150, 50); 18 | text("PJS rules", 350, 0, 100, 300); 19 | -------------------------------------------------------------------------------- /examples/basic/createimage.pde: -------------------------------------------------------------------------------- 1 | PImage img; 2 | 3 | void setup() 4 | { 5 | size(200, 200); 6 | img = createImage(120, 120, ARGB); 7 | for(int i=0; i < img.pixels.length; i++) { 8 | img.pixels[i] = color(0, 90, 102, i%img.width * 2); 9 | } 10 | } 11 | 12 | void draw() 13 | { 14 | background(204); 15 | image(img, 33, 33); 16 | image(img, mouseX-60, mouseY-60); 17 | } 18 | -------------------------------------------------------------------------------- /examples/basic/piechart.pde: -------------------------------------------------------------------------------- 1 | size(450, 450); 2 | background(100); 3 | smooth(); 4 | noStroke(); 5 | 6 | float diameter = min(width, height) * 0.75; 7 | int[] angs = {30, 10, 45, 35, 60, 38, 75, 67}; 8 | float lastAng = 0; 9 | 10 | for (int i = 0; i < angs.length; i++){ 11 | fill(angs[i] * 3.0); 12 | arc(width/2, height/2, diameter, diameter, lastAng, lastAng+radians(angs[i])); 13 | lastAng += radians(angs[i]); 14 | } 15 | -------------------------------------------------------------------------------- /examples/localfiles/test.pde: -------------------------------------------------------------------------------- 1 | void setup() { 2 | size(500, 500); 3 | noLoop(); 4 | clearScreen(); 5 | } 6 | 7 | void clearScreen() { 8 | background(204); 9 | textSize(68); 10 | textAlign(CENTER, CENTER); 11 | text("Select an image\nbelow or drag\nand drop an\nimage on\nthe sketch", width/2, height/2); 12 | } 13 | 14 | void drawImage(Image orig) { 15 | background(255); 16 | PImage pi = new PImage(orig); 17 | image(pi); 18 | } 19 | -------------------------------------------------------------------------------- /examples/pewpew/pewpew.js: -------------------------------------------------------------------------------- 1 | /* 2 | * int13h Javascript for Pew Pew 3 | */ 4 | $(document).ready(function(){ 5 | $("#shieldlevel").progressbar({value: 100}); 6 | $("#beamlevel").progressbar({value: 100}); 7 | 8 | // Stop cursor highlight 9 | document.onselectstart=function(){return false;}; 10 | 11 | // Stop Backspace event 12 | $(document).keypress(function(event){ 13 | if(event.keyCode == 8) 14 | return false; 15 | }); 16 | }); 17 | -------------------------------------------------------------------------------- /examples/basic/google-code-prettify/lang-yaml.js: -------------------------------------------------------------------------------- 1 | var a=null; 2 | PR.registerLangHandler(PR.createSimpleLexer([["pun",/^[:>?|]+/,a,":|>?"],["dec",/^%(?:YAML|TAG)[^\n\r#]+/,a,"%"],["typ",/^&\S+/,a,"&"],["typ",/^!\S*/,a,"!"],["str",/^"(?:[^"\\]|\\.)*(?:"|$)/,a,'"'],["str",/^'(?:[^']|'')*(?:'|$)/,a,"'"],["com",/^#[^\n\r]*/,a,"#"],["pln",/^\s+/,a," \t\r\n"]],[["dec",/^(?:---|\.\.\.)(?:[\n\r]|$)/],["pun",/^-/],["kwd",/^\w+:[\n\r ]/],["pln",/^\w+/]]),["yaml","yml"]); 3 | -------------------------------------------------------------------------------- /examples/basic/loop.pde: -------------------------------------------------------------------------------- 1 | float y = 100; 2 | boolean doLoop = false; 3 | 4 | void setup() { 5 | size(450, 450); 6 | stroke(255); 7 | noLoop(); 8 | } 9 | 10 | void draw() { 11 | background(0); 12 | line(0, y, width, y); 13 | 14 | y = y - 1; 15 | if (y < 0) { 16 | y = height; 17 | } 18 | } 19 | 20 | void mousePressed() { 21 | if (doLoop) { 22 | noLoop(); 23 | } else { 24 | loop(); 25 | } 26 | doLoop = !doLoop; 27 | } 28 | -------------------------------------------------------------------------------- /examples/basic/scale.pde: -------------------------------------------------------------------------------- 1 | float a = 0.0; 2 | float s = 0.0; 3 | 4 | void setup() 5 | { 6 | size(200,200); 7 | noStroke(); 8 | rectMode(CENTER); 9 | frameRate(30); 10 | } 11 | 12 | void draw() 13 | { 14 | background(102); 15 | 16 | a = a + 0.04; 17 | s = cos(a)*2; 18 | 19 | translate(width/2, height/2); 20 | scale(s); 21 | fill(51); 22 | rect(0, 0, 50, 50); 23 | 24 | translate(75, 0); 25 | fill(255); 26 | scale(s); 27 | rect(0, 0, 50, 50); 28 | } 29 | -------------------------------------------------------------------------------- /examples/basic/pointsandlines.pde: -------------------------------------------------------------------------------- 1 | int d = 40; 2 | int p1 = d; 3 | int p2 = p1+d; 4 | int p3 = p2+d; 5 | int p4 = p3+d; 6 | 7 | size(200, 200); 8 | background(0); 9 | 10 | // Draw gray box 11 | stroke(153); 12 | line(p3, p3, p2, p3); 13 | line(p2, p3, p2, p2); 14 | line(p2, p2, p3, p2); 15 | line(p3, p2, p3, p3); 16 | 17 | // Draw white points 18 | stroke(255); 19 | point(p1, p1); 20 | point(p1, p3); 21 | point(p2, p4); 22 | point(p3, p1); 23 | point(p4, p2); 24 | point(p4, p4); 25 | 26 | -------------------------------------------------------------------------------- /examples/basic/variables.pde: -------------------------------------------------------------------------------- 1 | size(450, 450); 2 | background(255); 3 | fill(0); 4 | 5 | int a = 20; 6 | int b; 7 | b = 75; 8 | 9 | float c = 40.0; 10 | float d; 11 | d = 200.0; 12 | 13 | boolean e = true; 14 | boolean f = false; 15 | 16 | char g = 'A'; 17 | char h = 'a'; 18 | 19 | String i = "Hello"; 20 | String j = "World"; 21 | 22 | strokeWeight(5); 23 | stroke(25, 50, 255); 24 | line(a, b, c, d); 25 | 26 | stroke(0); 27 | textSize(80); 28 | text(i + j, a, b); 29 | text(g, c, d); 30 | -------------------------------------------------------------------------------- /examples/basic/pgraphics.pde: -------------------------------------------------------------------------------- 1 | PGraphics pg; 2 | 3 | void setup() { 4 | size(200, 200); 5 | pg = createGraphics(80, 80, P2D); 6 | } 7 | 8 | void draw() { 9 | fill(0, 12); 10 | rect(0, 0, width, height); 11 | fill(255); 12 | noStroke(); 13 | ellipse(mouseX, mouseY, 60, 60); 14 | 15 | pg.beginDraw(); 16 | pg.background(102); 17 | pg.noFill(); 18 | pg.stroke(255); 19 | pg.ellipse(mouseX-60, mouseY-60, 60, 60); 20 | pg.endDraw(); 21 | 22 | image(pg, 60, 60); 23 | } 24 | -------------------------------------------------------------------------------- /examples/basic/easing.pde: -------------------------------------------------------------------------------- 1 | float x; 2 | float y; 3 | float targetX, targetY; 4 | float easing = 0.05; 5 | 6 | void setup() 7 | { 8 | size(200, 200); 9 | smooth(); 10 | noStroke(); 11 | } 12 | 13 | void draw() 14 | { 15 | background( 51 ); 16 | 17 | targetX = mouseX; 18 | float dx = targetX - x; 19 | if(abs(dx) > 1) { 20 | x += dx * easing; 21 | } 22 | 23 | targetY = mouseY; 24 | float dy = targetY - y; 25 | if(abs(dy) > 1) { 26 | y += dy * easing; 27 | } 28 | 29 | ellipse(x, y, 33, 33); 30 | } 31 | -------------------------------------------------------------------------------- /examples/basic/rotate.pde: -------------------------------------------------------------------------------- 1 | float angle; 2 | float jitter; 3 | 4 | void setup() { 5 | size(200, 200); 6 | smooth(); 7 | noStroke(); 8 | fill(255); 9 | rectMode(CENTER); 10 | frameRate(30); 11 | } 12 | 13 | void draw() { 14 | background(102); 15 | 16 | // during even-numbered seconds (0, 2, 4, 6...) 17 | if (second() % 2 == 0) { 18 | jitter = random(-0.1, 0.1); 19 | } 20 | angle = angle + jitter; 21 | float c = cos(angle); 22 | translate(width/2, height/2); 23 | rotate(c); 24 | rect(0, 0, 115, 115); 25 | } 26 | 27 | -------------------------------------------------------------------------------- /examples/basic/functions.pde: -------------------------------------------------------------------------------- 1 | void setup() { 2 | size(450, 450); 3 | background(51); 4 | noStroke(); 5 | smooth(); 6 | noLoop(); 7 | } 8 | 9 | void draw() { 10 | drawTarget(250, 250, 400, 10); 11 | drawTarget(152, 16, 200, 3); 12 | drawTarget(100, 144, 180, 5); 13 | } 14 | 15 | void drawTarget(int xloc, int yloc, int size, int num) { 16 | float grayvalues = 255/num; 17 | float steps = size/num; 18 | for (int i = 0; i < num; i++) { 19 | fill(i*grayvalues); 20 | ellipse(xloc, yloc, size-i*steps, size-i*steps); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /tools/httpd.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | PORT = 9914 4 | SERVER = '127.0.0.1' 5 | 6 | import SimpleHTTPServer 7 | import BaseHTTPServer 8 | import SocketServer 9 | 10 | Handler = SimpleHTTPServer.SimpleHTTPRequestHandler 11 | 12 | class Server(SocketServer.ThreadingMixIn, BaseHTTPServer.HTTPServer): 13 | pass 14 | 15 | httpd = Server((SERVER, PORT), Handler) 16 | print "Web Server listening on http://%s:%s/ (stop with ctrl+c)..." % (SERVER, PORT) 17 | 18 | try: 19 | httpd.serve_forever() 20 | except KeyboardInterrupt: 21 | print "Going down..." -------------------------------------------------------------------------------- /examples/basic/google-code-prettify/lang-hs.js: -------------------------------------------------------------------------------- 1 | PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t-\r ]+/,null,"\t\n\r "],["str",/^"(?:[^\n\f\r"\\]|\\[\S\s])*(?:"|$)/,null,'"'],["str",/^'(?:[^\n\f\r'\\]|\\[^&])'?/,null,"'"],["lit",/^(?:0o[0-7]+|0x[\da-f]+|\d+(?:\.\d+)?(?:e[+-]?\d+)?)/i,null,"0123456789"]],[["com",/^(?:--+[^\n\f\r]*|{-(?:[^-]|-+[^}-])*-})/],["kwd",/^(?:case|class|data|default|deriving|do|else|if|import|in|infix|infixl|infixr|instance|let|module|newtype|of|then|type|where|_)(?=[^\d'A-Za-z]|$)/, 2 | null],["pln",/^(?:[A-Z][\w']*\.)*[A-Za-z][\w']*/],["pun",/^[^\d\t-\r "'A-Za-z]+/]]),["hs"]); 3 | -------------------------------------------------------------------------------- /examples/basic/loadimage.pde: -------------------------------------------------------------------------------- 1 | /* @pjs preload="jelly.jpg"; */ 2 | 3 | PImage a; // Declare variable "a" of type PImage 4 | 5 | void setup() { 6 | size(200, 200); 7 | // The file "jelly.jpg" must be in the data folder 8 | // of the current sketch to load successfully 9 | a = loadImage("jelly.jpg"); // Load the image into the program 10 | noLoop(); // Makes draw() only run once 11 | } 12 | 13 | void draw() { 14 | // Displays the image at its actual size at point (0,0) 15 | image(a, 0, 0); 16 | // Displays the image at point (100, 0) at half of its size 17 | image(a, 100, 0, a.width/2, a.height/2); 18 | } 19 | 20 | -------------------------------------------------------------------------------- /examples/processing-and-js/translation.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 |