diff --git a/CNAME b/CNAME deleted file mode 100644 index 1c989db..0000000 --- a/CNAME +++ /dev/null @@ -1 +0,0 @@ -processingjs.org diff --git a/_config.yml b/_config.yml index 93a2530..1eb1c01 100644 --- a/_config.yml +++ b/_config.yml @@ -2,3 +2,4 @@ safe: true lsi: false highlighter: rouge +url: /processing-js.github.io/ diff --git a/_layouts/default.html b/_layouts/default.html index 38c85c6..c602f30 100644 --- a/_layouts/default.html +++ b/_layouts/default.html @@ -1,50 +1,37 @@
- + +
+
+
diff --git a/_layouts/withcc.html b/_layouts/withcc.html
index fe6c216..443bb85 100644
--- a/_layouts/withcc.html
+++ b/_layouts/withcc.html
@@ -4,7 +4,7 @@
{{ content }}
\ No newline at end of file
+
diff --git a/articles/_posts/2011-12-01-PomaxGuide.html b/articles/_posts/2011-12-01-PomaxGuide.html
index 96b91b6..5a5c932 100644
--- a/articles/_posts/2011-12-01-PomaxGuide.html
+++ b/articles/_posts/2011-12-01-PomaxGuide.html
@@ -2,7 +2,7 @@
layout: default
desc: Pomax's guide to Processing.js
title: Pomax Guide
-permalink: /articles/PomaxGuide.html
+permalink: ./articles/PomaxGuide.html
---
+
-My Life Aquatic (2012)
-by David Leibovic and Sunah Suh
-Koi designed by nardove
My Life Aquatic (2012)
+by David Leibovic and Sunah Suh
+Koi designed by nardove

float f = 0.0; +diff --git a/reference/HashMap/index.html b/reference/HashMap/index.html index 866c17f..01e8959 100644 --- a/reference/HashMap/index.html +++ b/reference/HashMap/index.html @@ -38,7 +38,7 @@ Constructor diff --git a/reference/Object/index.html b/reference/Object/index.html index 3b26e82..448ca27 100644 --- a/reference/Object/index.html +++ b/reference/Object/index.html @@ -154,7 +154,7 @@ HashMap()
HashMap(initialCapacity)
-HashMap(initialCapacity,loadFactor)
+HashMap(initialCapacity, loadFactor)
HashMap(m)
Related -class +class diff --git a/reference/PFont/index.html b/reference/PFont/index.html index d61b8bb..08bf90d 100644 --- a/reference/PFont/index.html +++ b/reference/PFont/index.html @@ -10,13 +10,13 @@Processing.js Behavior Font support for the Canvas element varies across browsers. FireFox currently has the best support, but still uses a pre-defined set of fonts. (Documentation to follow soon.) Good alternatives to the browser's Canvas-font functions are available: such as the Glyph method. See also: Canvas Text, BurntToys Bauhaus. - Please use the following demos to learn how fonts can be rendered in Firefox with Processing.js: Letters, Words, width()
+Please use the following demos to learn how fonts can be rendered in Firefox with Processing.js: Letters, Words, textWidth()
Examples - PFont font; +PFont font; // The font must be located in the sketch's // "data" directory to load successfully font = loadFont("FFScala.ttf"); @@ -37,7 +37,7 @@Methods diff --git a/reference/PFont_list_/index.html b/reference/PFont_list_/index.html index da9f992..ba3e55c 100644 --- a/reference/PFont_list_/index.html +++ b/reference/PFont_list_/index.html @@ -14,7 +14,7 @@
- PFont_list() +PFont.list() Gets a list of the fonts installed on the system. @@ -69,8 +69,8 @@Related -loadFont() +
- textFont()
- createGraphics()loadFont()
+ textFont()
+ createGraphics()Processing.js Behavior Font support for the Canvas element varies across browsers. FireFox currently has the best support, but still uses a pre-defined set of fonts. (Documentation to follow soon.) Good alternatives to the browser's Canvas-font functions are available: such as the Glyph method. See also: Canvas Text, BurntToys Bauhaus. - Please use the following demos to learn how fonts can be rendered in Firefox with Processing.js: Letters, Words, width()
+Please use the following demos to learn how fonts can be rendered in Firefox with Processing.js: Letters, Words, textWidth()
diff --git a/reference/PGraphics/index.html b/reference/PGraphics/index.html index a64cbd9..a1970d2 100644 --- a/reference/PGraphics/index.html +++ b/reference/PGraphics/index.html @@ -11,7 +11,7 @@ diff --git a/reference/preload/index.html b/reference/preload/index.html index cd30749..bf7714a 100644 --- a/reference/preload/index.html +++ b/reference/preload/index.html @@ -30,7 +30,7 @@ Examples - PGraphics pg; +PGraphics pg; void setup() { size(100, 100); @@ -43,13 +43,13 @@@@ -90,6 +90,6 @@
- beginDraw() +beginDraw() Sets up the rendering context - endDraw() +endDraw() Finalizes the renderering context diff --git a/reference/PImage/index.html b/reference/PImage/index.html index a070fc5..969f1a3 100644 --- a/reference/PImage/index.html +++ b/reference/PImage/index.html @@ -11,7 +11,7 @@ Related -createGraphics() +createGraphics() @@ -33,16 +33,16 @@ Examples - PImage b; +PImage b; b = loadImage("laDefense.jpg"); image(b, 0, 0);diff --git a/reference/PVector/index.html b/reference/PVector/index.html index 83e364c..637ba90 100644 --- a/reference/PVector/index.html +++ b/reference/PVector/index.html @@ -46,16 +46,16 @@
- width +width Shape document width - height +height Shape document width - @@ -54,49 +54,49 @@pixels[] +pixels[] Shape document width Methods @@ -140,8 +140,8 @@
- get() +get() Reads the color of any pixel or grabs a rectangle of pixels - set() +set() Writes a color to any pixel or writes an image into another - copy() +copy() Copies the entire image - mask() +mask() Masks part of the image from displaying - blend() +blend() Copies a pixel or rectangle of pixels using different blending modes - filter() +filter() Converts the image to grayscale or black and white - save() +save() Saves the image to a TIFF, TARGA, PNG, or JPEG file - resize() +resize() Changes the size of an image to a new width and height - loadPixels() +loadPixels() Loads the pixel data for the image into its pixels[] array - updatePixels() +updatePixels() Updates the image with the data in its pixels[] array Related -loadImage() +
- imageMode()
- createImage()loadImage()
+ imageMode()
+ createImage()\ No newline at end of file + diff --git a/reference/globalKeyEvents/index.html b/reference/globalKeyEvents/index.html index 85c3a25..9c2620b 100644 --- a/reference/globalKeyEvents/index.html +++ b/reference/globalKeyEvents/index.html @@ -120,7 +120,7 @@
- x +x x component of the vector - y +y y component of the vector - @@ -67,65 +67,65 @@z +z z component of the vector Methods diff --git a/reference/background_/index.html b/reference/background_/index.html index 1e243ce..22ec0b8 100644 --- a/reference/background_/index.html +++ b/reference/background_/index.html @@ -20,7 +20,7 @@
- get() +get() Gets the x, y, z component of the vector - set() +set() Sets the x, y, z component of the vector - mag() +mag() Calculates the magnitude (length) of the vector and returns the result as a float - add() +add() Adds one vector to another - sub() +sub() Subtracts one vector from another - mult() +mult() Multiplies the vector by a scalar - div() +div() Divides the vector by a scalar - dist() +dist() Calculate the Euclidean distance between two points - dot() +dot() Calculates the dot product - cross() +cross() Calculates the cross product - normalize() +normalize() Normalizes the vector - limit() +limit() Limits the magnitude of the vector - angleBetween() +angleBetween() Calculates the angle between two vectors - array() +array() Return a representation of the vector as an array Examples - background(51);background(255, 204, 0);+diff --git a/reference/createGraphics_/index.html b/reference/createGraphics_/index.html index 25a8563..fb487c6 100644 --- a/reference/createGraphics_/index.html +++ b/reference/createGraphics_/index.html @@ -20,7 +20,7 @@ background(51);background(255, 204, 0);// @pjs preload must be used to preload the image @@ -188,11 +188,11 @@stroke() + colorMode()
- fill()
+ fill()
- tint()
+ tint()
- colorMode()Examples - PGraphics pg; + PGraphics pg; @@ -160,7 +160,7 @@Related -PGraphics +PGraphics diff --git a/reference/createImage_/index.html b/reference/createImage_/index.html index 408cca1..4c9b176 100644 --- a/reference/createImage_/index.html +++ b/reference/createImage_/index.html @@ -20,7 +20,7 @@Examples - PImage img = createImage(66, 66, RGB); +diff --git a/reference/font/index.html b/reference/font/index.html index 197025e..ec01b14 100644 --- a/reference/font/index.html +++ b/reference/font/index.html @@ -34,7 +34,7 @@ PImage img = createImage(66, 66, RGB); for(int i=0; i < img.pixels.length; i++) { @@ -28,7 +28,7 @@ } -image(img, 17, 17);PImage img = createImage(66, 66, RGB); +image(img, 17, 17);Description If you wish to use custom fonts in your sketch, these must be preloaded using the font @pjs directive. Preloading fonts uses its own command, - rather than the standard preload command, because unlike images a font must not just be cached, but must also be loaded into memory for the browser + rather than the standard preload command, because unlike images a font must not just be cached, but must also be loaded into memory for the browser to make use of. Processing.js does this by relying on the browser to load the font via a CSS @font-face rule. While most browsers support a large number of font formats for use with @font-face (woff, svg, eot, ttf and otf), relying on "truetype" (ttf) and "opentype" (otf) font formats offer the greatest interoperability between Processing and Processing.js.
@@ -90,8 +90,8 @@- Related - @pjs directives -
createFont() + @pjs directives +
createFont()diff --git a/reference/imageMode_/index.html b/reference/imageMode_/index.html index c3fe70b..d9ebfd1 100644 --- a/reference/imageMode_/index.html +++ b/reference/imageMode_/index.html @@ -12,7 +12,7 @@ Related - @pjs directives + @pjs directives diff --git a/reference/pauseOnBlur/index.html b/reference/pauseOnBlur/index.html index ab3ffe8..864c3f3 100644 --- a/reference/pauseOnBlur/index.html +++ b/reference/pauseOnBlur/index.html @@ -86,7 +86,7 @@ Examples - // @pjs preload must be used to preload the image +// @pjs preload must be used to preload the image /* @pjs preload="laDefense_crop.jpg"; */ PImage b; b = loadImage("laDefense_crop.jpg"); @@ -60,9 +60,9 @@diff --git a/reference/image_/index.html b/reference/image_/index.html index 185fbd9..bbb556c 100644 --- a/reference/image_/index.html +++ b/reference/image_/index.html @@ -20,7 +20,7 @@ Related -loadImage() +
- PImage
- image()
- background()loadImage()
+ PImage
+ image()
+ background()Examples - +// @pjs preload must be used to preload the image @@ -30,7 +30,7 @@ b = loadImage("laDefense.jpg"); - image(b, 0, 0);+ image(b, 0, 0);diff --git a/reference/loadImage_/index.html b/reference/loadImage_/index.html index 4d98c04..fa0204e 100644 --- a/reference/loadImage_/index.html +++ b/reference/loadImage_/index.html @@ -20,7 +20,7 @@// @pjs preload must be used to preload the image @@ -170,17 +170,17 @@- loadImage() diff --git a/reference/index.html b/reference/index.html index 9590788..11f0c4d 100644 --- a/reference/index.html +++ b/reference/index.html @@ -7,152 +7,153 @@
+ loadImage()
- PImage
+ PImage
- imageMode()
+ imageMode()
- tint()
+ tint()
- background()
+ background()
- alpha()
+ alpha()
Reference
This page references all the commands available to Processing.js. Regular Javascript commands will work in Processing.js script.
The Processing.js community is working towards a 100% compatible API, allowing all native Java code to run in Javascript. Items highlighted in red are not yet implemented.
-The original Processing reference can be found on the Processing website
-If you encounter any problems with these commands or their documentation please file a bug +
The original Processing reference can be found on the Processing website
+If you encounter any problems with these commands or their documentation please file a +bug
@@ -160,173 +161,173 @@Processing.js instructions - @pjs directives - font - globalKeyEvents - pauseOnBlur - preload + @pjs directives + font + globalKeyEvents + pauseOnBlur + preloadStructure - [] (array access) - = (assign) - class - , (comma) - // (comment) - {} (curly braces) - /** */ (doc comment) - . (dot) - draw() - exit() - extends - false - final - implements - import - loop() - /* */ (multiline comment) - new - noLoop() - null - () (parentheses) - popStyle() - private - public - - redraw() - return - ; (semicolon) - setup() - size() - static - super - this - true - void + [] (array access) + = (assign) + class + , (comma) + // (comment) + {} (curly braces) + /** */ (doc comment) + . (dot) + draw() + exit() + extends + false + final + implements + import + loop() + /* */ (multiline comment) + new + noLoop() + null + () (parentheses) + popStyle() + private + public + + redraw() + return + ; (semicolon) + setup() + size() + static + super + this + true + voidEnvironment - cursor() - focused - frameCount - frameRate() - frameRate - height - noCursor() - online - screen - width + cursor() + focused + frameCount + frameRate() + frameRate + height + noCursor() + online + screen + widthDataPrimitive
- boolean - byte - char - color - double - float - int - long + boolean + byte + char + color + double + float + int + longComposite
- Array - ArrayList - HashMap - Object - String - XMLElement + Array + ArrayList + HashMap + Object + String + XMLElementConversion
- binary() - boolean() - byte() - char() - float() - hex() - int() - str() - unbinary() - unhex() + binary() + boolean() + byte() + char() + float() + hex() + int() + str() + unbinary() + unhex()String Functions
- join() - match() - matchAll() - nf() - nfc() - nfp() - nfs() - split() - splitTokens() - trim() + join() + match() + matchAll() + nf() + nfc() + nfp() + nfs() + split() + splitTokens() + trim()ControlRelational Operators
- == (equality) - > (greater than) - >= (greater than or equal to) - != (inequality) - < (less than) - <= (less than or equal to) + == (equality) + > (greater than) + >= (greater than or equal to) + != (inequality) + < (less than) + <= (less than or equal to)Iteration
- for() - while() + for() + while()Conditionals
- break - case - ?: (conditional) - continue - default - else() - if() - switch() + break + case + ?: (conditional) + continue + default + else() + if() + switch()Logical Operators
- && (logical AND) - ! (logical NOT) - || (logical OR) + && (logical AND) + ! (logical NOT) + || (logical OR)Logical Operators
@@ -334,139 +335,139 @@Shape - PShape + PShape2D Primitives
- arc() - ellipse() - line() - point() - quad() - rect() - triangle() + arc() + ellipse() + line() + point() + quad() + rect() + triangle()Curves
- bezier() - bezierDetail() - bezierPoint() - bezierTangent() - curve() - curveDetail() - curvePoint() - curveTangent() - curveTightness() + bezier() + bezierDetail() + bezierPoint() + bezierTangent() + curve() + curveDetail() + curvePoint() + curveTangent() + curveTightness()Attributes
- ellipseMode() - noSmooth() - rectMode() - smooth() - strokeCap() - strokeJoin() - strokeWeight() + ellipseMode() + noSmooth() + rectMode() + smooth() + strokeCap() + strokeJoin() + strokeWeight()Vertex
- beginShape() - bezierVertex() - curveVertex() - endShape() - texture() - textureMode() - vertex() + beginShape() + bezierVertex() + curveVertex() + endShape() + texture() + textureMode() + vertex()InputMouse
- mouseButton - mouseClicked() - mouseDragged() - mouseMoved() - mouseOut() - mouseOver() - mousePressed() - mousePressed - mouseReleased() - mouseX - mouseY - pmouseX - pmouseY + mouseButton + mouseClicked() + mouseDragged() + mouseMoved() + mouseOut() + mouseOver() + mousePressed() + mousePressed + mouseReleased() + mouseX + mouseY + pmouseX + pmouseYKeyboard
- key - keyCode - keyPressed() - keyPressed - keyReleased() - keyTyped() + key + keyCode + keyPressed() + keyPressed + keyReleased() + keyTyped()Files
- createInput() - loadBytes() - loadStrings() - open() - selectFolder() - selectInput() + createInput() + loadBytes() + loadStrings() + open() + selectFolder() + selectInput()Web
- link() - param() - status() + link() + param() + status()Time & Date
- day() - hour() - millis() - minute() - month() - second() - year() + day() + hour() + millis() + minute() + month() + second() + year()OutputText Area
- print() - println() + print() + println()Files
- PrintWriter - beginRaw() - beginRecord() - createOutput() - createReader() - createWriter() - endRaw() - endRecord() - saveBytes() - saveStream() - saveStrings() - selectOutput() + PrintWriter + beginRaw() + beginRecord() + createOutput() + createReader() + createWriter() + endRaw() + endRecord() + saveBytes() + saveStream() + saveStrings() + selectOutput()Transform - applyMatrix() - popMatrix() - printMatrix() - pushMatrix() - resetMatrix() - rotate() - rotateX() - rotateY() - rotateZ() - scale() - translate() + applyMatrix() + popMatrix() + printMatrix() + pushMatrix() + resetMatrix() + rotate() + rotateX() + rotateY() + rotateZ() + scale() + translate()Lights, CameraLights
- ambientLight() - directionalLight() - lightFalloff() - lightSpecular() - lights() - noLights() - normal() - pointLight() - spotLight() + ambientLight() + directionalLight() + lightFalloff() + lightSpecular() + lights() + noLights() + normal() + pointLight() + spotLight()Camera
- beginCamera() - camera() - endCamera() - frustum() - ortho() - perspective() - printCamera() - printProjection() + beginCamera() + camera() + endCamera() + frustum() + ortho() + perspective() + printCamera() + printProjection()Coordinates
- modelX() - modelY() - modelZ() - screenX() - screenY() - screenZ() + modelX() + modelY() + modelZ() + screenX() + screenY() + screenZ()Material Properties
- ambient() - emissive() - shininess() - specular() + ambient() + emissive() + shininess() + specular()Material Properties
ColorSetting
- background() - colorMode() - fill() - noFill() - noStroke() - stroke() + background() + colorMode() + fill() + noFill() + noStroke() + stroke()Creating & Reading
- alpha() - blendColor() - blue() - brightness() - color() - green() - hue() - lerpColor() - red() - saturation() + alpha() + blendColor() + blue() + brightness() + color() + green() + hue() + lerpColor() + red() + saturation()Image - PImage - createImage() + PImage + createImage()Loading & Displaying
- image() - imageMode() - loadImage() - noTint() - requestImage() - tint() + image() + imageMode() + loadImage() + noTint() + requestImage() + tint()Pixels
- blend() - copy() - filter() - get() - loadPixels() - pixels[] - set() - updatePixels() + blend() + copy() + filter() + get() + loadPixels() + pixels[] + set() + updatePixels()TypographyLoading & Displaying
- createFont() - loadFont() - text() - textFont() + createFont() + loadFont() + text() + textFont()Attributes
- textAlign() - textLeading() - textMode() - textSize() - textWidth() + textAlign() + textLeading() + textMode() + textSize() + textWidth()Metrics
- textAscent() - textDescent() + textAscent() + textDescent()Math - PVector + PVectorOperators
- += (add assign) - + (addition) - -- (decrement) - / (divide) - /= (divide assign) - ++ (increment) - - (minus) - % (modulo) - * (multiply) - *= (multiply assign) - -= (subtract assign) + += (add assign) + + (addition) + -- (decrement) + / (divide) + /= (divide assign) + ++ (increment) + - (minus) + % (modulo) + * (multiply) + *= (multiply assign) + -= (subtract assign)Bitwise Operators
- & (bitwise AND) - | (bitwise OR) - << (left shift) - >> (right shift) + & (bitwise AND) + | (bitwise OR) + << (left shift) + >> (right shift)Calculation
- abs() - ceil() - constrain() - dist() - exp() - floor() - lerp() - log() - mag() - map() - max() - min() - norm() - pow() - round() - sq() - sqrt() + abs() + ceil() + constrain() + dist() + exp() + floor() + lerp() + log() + mag() + map() + max() + min() + norm() + pow() + round() + sq() + sqrt()Trigonometry
- acos() - asin() - atan() - atan2() - cos() - degrees() - radians() - sin() - tan() + acos() + asin() + atan() + atan2() + cos() + degrees() + radians() + sin() + tan()Random
- noise() - noiseDetail() - noiseSeed() - random() - randomSeed() + noise() + noiseDetail() + noiseSeed() + random() + randomSeed()Examples - +// @pjs preload must be used to preload the image @@ -32,7 +32,7 @@ image(b, 0, 0); -+// @pjs preload must be used to preload the image @@ -160,13 +160,13 @@Related -PImage + PImage - +
image() +
image() -
imageMode() +
imageMode() -
background()
background()- \ No newline at end of file + diff --git a/reference/pjs directive/index.html b/reference/pjs directive/index.html index 7e392d9..5d3da1d 100644 --- a/reference/pjs directive/index.html +++ b/reference/pjs directive/index.html @@ -34,9 +34,9 @@ Related - @pjs directives + @pjs directives As Processing.js offers a tighter integration between Processing sketches and webpages than the traditional applet approach, certain functions that are normally regulated by Processing are left to be handled by the browser. This approach means that certain behaviour that is expected from a sketch may not work without additional "outside the sketch" instructions, for which /* @pjs */ directives must be used. There - are two types of directives: directives that tell Processing.js to buffer data that must be available to a sketch when it is run (preload, - font), and directives that tell Processing.js how to behave once the sketch is running (crisp, - globalKeyEvents, pauseOnBlur).
+ are two types of directives: directives that tell Processing.js to buffer data that must be available to a sketch when it is run (preload, + font), and directives that tell Processing.js how to behave once the sketch is running (crisp, + globalKeyEvents, pauseOnBlur).These directives are in block comment syntax so that they do not interfere with a sketch when it runs as native Processing, but if you do not wish to pollute your source with @pjs directives, you can also store your directives in a separate file, and only call this file on your page:
directives.pde:
@@ -87,11 +87,11 @@Related -font -
crisp -
pauseOnBlur -
globalKeyEvents -
preload +font +
crisp +
pauseOnBlur +
globalKeyEvents +
preloadDescription -This directive regulates image preloading, which is required when using loadImage() or requestImage() in a sketch. +
This directive regulates image preloading, which is required when using loadImage() or requestImage() in a sketch. Using this directive will preload all images indicated between quotes, and comma separated if multiple images are used, so that they will be ready for use when the sketch begins running. As resources are loaded via the AJAX approach, not using this directive will result in the sketch loading an image, and then immediately trying to use this image in some way, even though the browser has not finished downloading and caching it. Images @@ -80,9 +80,9 @@
- \ No newline at end of file + diff --git a/reference/requestImage_/index.html b/reference/requestImage_/index.html index 328c51f..021aafc 100644 --- a/reference/requestImage_/index.html +++ b/reference/requestImage_/index.html @@ -76,7 +76,7 @@ Related - @pjs directives -
loadImage() -
requestImage() + @pjs directives +
loadImage() +
requestImage()diff --git a/tools/processing-helper.html b/tools/processing-helper.html index 251b244..d6500d8 100644 --- a/tools/processing-helper.html +++ b/tools/processing-helper.html @@ -31,5 +31,5 @@ Related -loadImage() +
- PImageloadImage()
+ PImageCanvas
Output
- - + +