PellipseMode


processing
Since v1.0.0
Available on all platforms
See also

Modifies the location from which ellipses are drawn by changing the way in which parameters given to Pellipse are intepreted.

The default mode is ellipseMode(CENTER), which interprets the first two parameters of Pellipse as the shape's center point, while the third and fourth parameters are its width and height.

ellipseMode(RADIUS) also uses the first two parameters of Pellipse as the shape's center point, but uses the third and fourth parameters to specify half of the shapes's width and height.

ellipseMode(CORNER) interprets the first two parameters of Pellipse as the upper-left corner of the shape, while the third and fourth parameters are its width and height.

ellipseMode(CORNERS) interprets the first two parameters of Pellipse as the location of one corner of the ellipse's bounding box, and the third and fourth parameters as the location of the opposite corner.

Link to original Processing doc

Signature

Examples

200 100 '2D3' PGraphics 255 Pbackground //white 16 PtextSize 0 'x' STORE 0x5fff0000 Pfill //red 'CORNER' PellipseMode $x 50 + 50 20 20 Pellipse // Draw white rect using CORNER mode 'CORNER' $x 95 Ptext 0x9f0000ff Pfill //blue 'CORNERS' PellipseMode $x 50 + 50 20 20 Pellipse // Draw white rect using CORNERS mode 'CORNERS' $x 18 Ptext 100 'x' STORE 0x5fff0000 Pfill //red 'RADIUS' PellipseMode $x 50 + 50 20 20 Pellipse // Draw white rect using RADIUS mode 'RADIUS' $x 95 Ptext 0x9f0000ff Pfill //blue 'CENTER' PellipseMode $x 50 + 50 20 20 Pellipse // Draw white rect using CENTER mode 'CENTER' $x 18 Ptext Pencode