This used to work and now it doesn't
Changes in 0116 (approaching 1.0)
Changes between Alpha (Release 0069) and Beta (Release 0085)
This used to work and now it doesn't
For each release, read the revisions.txt file (included with the download) to see what's changed since the release before it. This is where you go if your code stops working in the most recent release, or if you want to know if your favorite bug has been fixed. If you don't want to download first, you can read the most recent version here.
This page was updated prior to release 0126, to clean up a couple inconsistencies.
Changes in 0116+ (approaching 1.0)
Release 0116 contains many changes, frameRate(), beginShape(),
and endShape() are the biggest ones.
- framerate() is now called frameRate(), for better API consistency. It didn't make sense to have a frameCount variable and a framerate() method as its misshapen cousin.
- The default frame rate is now 60 fps. This will prevent some odd quirks with sketches running faster than they need to and throttling the resources of your machine. To disable this, you can set the frame rate arbitrarily high.
- beginShape() has changed. LINE_LOOP and LINE_STRIP have been
removed because they are redundant, and not consistent with the
rest of the API. beginShape(POLYGON) is no longer recommended,
simply use beginShape() with no parameters when drawing an
irregular shape. Code examples:
OLD SYNTAX: beginShape(POLYGON); // call vertex() several times endShape() NEW SYNTAX: beginShape(); // call vertex() several times endShape(CLOSE);
endShape() with the CLOSE parameter will make the stroke on your shape continue back to where the shape started. This is the same way that POLYGON and LINE_LOOP worked.OLD_SYNTAX: beginShape(LINE_STRIP); // draw with vertex() endShape(); NEW SYNTAX: noFill(); beginShape(); // draw with vertex(); endShape();
In the above case, noFill() must be called, and the CLOSE parameter to endShape() is not used, because the last point should not come back to meet the original point.OLD SYNTAX: beginShape(LINE_LOOP); // draw with vertex() endShape(); NEW SYNTAX: noFill(); beginShape(); // draw with vertex(); endShape(CLOSE);
For the LINE_LOOP example, endShape(CLOSE) is used to specify close the shape. noFill() must also be called, so that the shape is not filled in.
The two main problems with the old API were 1) LINE_LOOP was simply a POLYGON with no fill setting, this made for a strange inconsistency. 2) there was no way to draw a non-closed POLYGON shape.
Using beginShape(POLYGON) doesn't make much sense when you're drawing a line, so this is one more reason that beginShape() with no parameters is recommended. - The single pixel blend() methods have been removed, they were overkill. Also, the blend() function that blends a color, instead of image data, is now called blendColor().
- Along with blendColor(), a lerpColor() method has been added. It works just like lerp()... but with colors!
- writer() and reader() are now createWriter() and createReader().
- toInt() and toFloat() are now parseInt() and parseFloat(), to change to JavaScript syntax. Not sure if anyone was using these.
- Text with the JAVA2D setting no longer uses native fonts by default, which means they'll be slower and uglier. See the reference for textFont() for details and how it can be addressed.
- Threading has been modified signficantly. Some of these changes had to be undone at the last minute, so further changes are coming. The changes will fix several strange InterruptedException problems.
- The PGraphics classes have all been reworked and renamed.
- PGraphics is an abstract class on which additional PGraphics subclasses can be built. It is an abstract class, and therefore cannot be invoked directly.
- PGraphics2D (P2D) contains the former contents of PGraphics that are specific to 2D rendering. This will be P2D once it is complete. As of release 0126, P2D is not currently complete and cannot be used.
- PGraphics3D (P3D), formerly PGraphics3, remains mostly unchanged.
- PGraphicsJava2D (JAVA2D), formerly PGraphics2, is the renderer used when you call size(w, h) or size(w, h, JAVA2D). It remains the default renderer when none is specified. It is slower but more accurate than the others.
- PGraphicsOpenGL (OPENGL) is the new name for PGraphicsGL.
- Do not use "new PGraphics" to create PGraphics objects. Instead, use createGraphics(), which will properly handle connecting the new graphics object to its parent sketch, and will enable save() to work properly. See the reference for createGraphics.
- For the same reasons as above, createImage(width, height, format) should be used instead of "new PImage" when creating images.
- More recent releases include better support for ARGB format images. This is helpful for using createImage() or createGraphics() to generate a transparent surface. Be sure to use PNG or another format that supports alpha. This support is incomplete, however, and there are a handful of bugs.
- beginFrame() and endFrame() are now beginDraw() and endDraw(). Use these around drawing commands to a PGraphics created by createGraphics(). The defaults() method should not/need not be called, just beginDraw() and endDraw().
Changes between Alpha (Release 0069) and Beta (Release 0085)
Between revision 0069 (the last public alpha) and the beta release (0085), many, many functions have been added, and are detailed in the complete reference. Aside from that, this page lists functions whose names have changed or fundamental API differences between the two versions.
- loop() has been removed, and is instead called draw(). If you want applications to only run draw() once (the way draw() used to work), use the function noLoop() inside of setup().
- size() should now be the very first thing in your setup(), otherwise commands that come before it may be ignored. your settings for fill() and stroke(), for instance, will disappear after you call size().
- 2D and 3D graphics are no longer completely mixed. To specify 3D graphics, instead of size(200, 200), the new way is to use size(200, 200, P3D).
- You may find that by default, your code runs more slowly in a beta release than an alpha release. The new renderers might be slower for some things, faster for others. If you want faster pixel operations, try using P3D (until P2D is available). For high-quality lines and strokeWeight() and strokeCap(), use JAVA2D (the default).
- BImage → PImage, BFont → PFont, and so on...
- For advanced users who were making their own BGraphics objects in
the previous release:
BGraphics bg = new BGraphics(200, 200);
should be changed to:PGraphics pg = new PGraphics2(200, 200, null); pg.defaults(); // clear the buffer, get it readyPGraphics pg = createGraphics(200, 200); pg.beginDraw(); // drawing commands for pg here pg.endDraw();We didn't realize quite how many people were using this, so we'll probably add a createGraphics() method because PGraphics2 may be temporary (instead of just PGraphics), and the "null" thing is pretty weird. Even still, this isn't quite working as expected, but it's a high priority to fix for the future, seeBug 92 for the status. - To use OpenGL rendering, change that to size(200, 200, OPENGL), and use Sketch → Import Library → opengl. OpenGL support is incomplete, but allows for much larger screen sizes and accelerated graphics that make use of a decent graphics card.
- When using the pixels[] array of the main window, or on an image, you should first call loadPixels(). Once you're done editing, call updatePixels(). This is because the new JAVA2D and OPENGL renderers both need to post-process the image data before displaying it, which is a time-consuming operation.
- Library events are handled differently because more than one serial port or video input device can be used with Processing beta. See the documentation for movieEvent, captureEvent, and serialEvent. Documentation for clientEvent and serverEvent for network will also eventually be linked from this page.
- push() → pushMatrix()
- pop() → popMatrix()
- textureMode(NORMAL_SPACE) → textureMode(NORMALIZED)
- textureMode(IMAGE_SPACE) → textureMode(IMAGE)
- textMode(ALIGN_LEFT) → textAlign(LEFT)
- textMode(ALIGN_RIGHT) → textAlign(RIGHT)
- textMode(ALIGN_CENTER) → textAlign(CENTER)
- textSpace(SCREEN_SPACE) → textMode(SCREEN)
- textSpace(OBJECT_SPACE) → textMode(MODEL)
- font.width(String s) → textWidth(String s)
- font.ascent() → textAscent()
- font.descent() → textDescent()
- Fonts should now be more accurately sized, if your font sizing looks weird, try using "Create Font" to create a new font using the most recent release of Processing. It's strongly suggested that you do this when updated projects from alpha to beta.
- The function alpha(), when used to create an alpha mask of an image, is now mask(), to remove a conflict with the alpha() function that extracts the alpha value of a color.
- Previous default ellipseMode was CORNER → now it's ellipseMode(CENTER)
- RGBA for images → ARGB (more technically accurate)
- CENTER_DIAMETER → CENTER
- objectX, objectY, objectZ → modelX, modelY, modelZ
- curveSegments() → curveDetail()
- bezierSegments() → bezierDetail()
- splitStrings() → split() (changed in rev 0069)
- splitInts() → toInt(split()) (changed in rev 0069)
- splitFloats() → toFloat(split()) (changed in rev 0069)
- angleMode() has been removed. Radians are used for all functions. If you don't like radians, you can convert to radians to degrees via the radians() function, i.e.: sin(radians(90)).
- Four calls to bezierVertex(x, y) should instead be a single call to vertex(x, y), followed by bezierVertex(cx1, cy1, cx2, cy2, x2, y2) (two control points followed by the destination point).
- The libraries for serial, video, and network have changed completely. Check out the examples or visit the libraries reference for the full details.