-
Book Overview & Buying
-
Table Of Contents
OpenFrameworks Essentials
By :
The simplest thing that can be drawn with openFrameworks is a geometric primitive such as a line, rectangle, or circle. Before drawing, we should set the drawing color using the ofSetColor function and then draw primitives using commands such as ofLine, ofRect, ofTriangle, and ofCircle (they draw a line, rectangle, triangle, and circle respectively). Let's consider setting the color and then drawing functions in detail.
The ofSetColor function switches the drawing color to a specified color. There are several overloaded versions of this function:
ofSetColor( 255, 0, 0, 255 );
The arguments are integers from 0 to 255, which correspond to red, green, or blue color components and alpha color components. In our example, we will get the red opaque color because the red component is maximal, the blue and green components are zero, and...
Change the font size
Change margin width
Change background colour