a port of the Processing Visualization Language


example pic
PShape s;
s = loadShape("bot.svg");
shape(s, 10, 10, 80, 80);

Datatype for storing shapes. Processing can currently load and display SVG (Scalable Vector Graphics) shapes. Before a shape is used, it must be loaded with the loadShape() function. The shape() function is used to draw the shape to the display window. The PShape object contain a group of methods, linked below, that can operate on the shape data.

The loadShape() method supports SVG files created with Inkscape and Adobe Illustrator. It is not a full SVG implementation, but offers some straightforward support for handling vector data.

width Shape document width
height Shape document width
isVisible() Returns a boolean value "true" if the image is set to be visible, "false" if not
setVisible() Sets the shape to be visible or invisible
disableStyle() Disables the shape's style data and uses Processing styles
enableStyle() Enables the shape's style data and ignores the Processing styles
getChild() Returns a child element of a shape as a PShape object
translate() Displaces the shape
rotate() Rotates the shape
rotateX() Rotates the shape around the x-axis
rotateY() Rotates the shape around the y-axis
rotateZ() Rotates the shape around the z-axis
scale() Increases and decreases the size of a shape
Usage Web & Application
Related shape()

This reference is licensed under the CC BY-NC-SA 2.0 license:

Creative Commons License
Fork me on GitHub