Reference for Processing (BETA) version 0135+. If you have a previous version, use the reference included with your software. If you see any errors or have any comments, let us know.
Class | SVG |
||||
---|---|---|---|---|---|
Name | drawMode() |
||||
Examples | import processing.candy.*; import processing.xml.*; SVG m; void setup(){ size(400,400); // The file "moo.svg" must be in the data folder // of the current sketch to load successfully m = new SVG(this, "moo.svg"); } void draw(){ m.drawMode(CORNER); m.draw(100, 100, 200, 200); m.drawMode(CORNERS); m.draw(100, 100, 200, 200); m.drawMode(CENTER); m.draw(100, 100, 200, 200); } |
||||
Description | Modifies the location from which the SVG draws. The default mode is drawMode(CORNER), which specifies the location to be the upper left corner and uses the third and fourth parameters of draw() to set the SVG's width and height. The syntax drawMode(CORNERS) uses the first and second parameters of draw() to set the location of one corner of the SVG and uses the third and fourth parameters to set the opposite corner. The syntax drawMode(CENTER) uses the first and second parameters of draw() to set the middle of the SVG and uses the third and fourth parameters to set the width and height. The parameter to imageMode() must be written in "ALL CAPS" because Processing is a case sensitive language. | ||||
Syntax | svg.drawMode(MODE) |
||||
Parameters |
|
||||
Usage | Web & Application | ||||
Related | draw() |