The basic drawing functions are the following (see Chapter 2, Creating Your First openFrameworks Project, for details):
Example of function usage |
Description |
---|---|
|
This sets the background to the white color. |
|
The |
|
The |
|
This draws a line segment connecting the points (100, 200) and (300, 400). |
|
This draws a rectangle with the top-left corner (100, 200), a width of 300 pixels, and a height of 400 pixels. The |
|
This draws a triangle with the vertices (10, 20), (30, 40), and (50, 60). |
|
This draws a circle with the center (100, 200) and a radius of 30. The |
|
This enables the mode for drawing filled figures. |
|
This enables the mode for drawing unfilled figures. |
|
This sets the drawing color with a red value of 100, a green value of 150, and a blue value of 200. |
|
This sets the drawing color with the red, green, and blue values equal to 255 and the alpha value equal to 200. To enable additive blending, use the To enable alpha blending back, use the |
| |
|
This stores the current coordinate system to a special stack. |
|
This restores the coordinate system from the stack. |
|
This translates the coordinate system by (200, 100) pixels. |
|
This rotates the coordinate system by 90 degrees clockwise. |
|
This scales the coordinate system; all objects will grow bigger by two times. |