Static Graphics Overview
To draw static graphics, you create a tablet. A tablet is a drawing environment that accumulates shapes and text in an internal data structure called a sketch. To render the graphics on a display, you draw the contents of the tablet’s sketch.
For example, the following code creates a tablet, creates two different graphic properties objects for drawing in blue and red, draws a rectangle using a blue pen and a line shape using a red pen, and then displays the resulting sketch on the display console.
ccUITablet tablet;
ccGraphicProps redProp(ccColor::redColor());
ccGraphicProps blueProp(ccColor::blueColor());
tablet.draw(ccRect(cc2Vect(10,10), cc2Vect(240, 100)),
redProp);
tablet.draw(ccLineSeg(cc2Vect(100,100), cc2Vect(101,100)),
blueProp);
display->drawSketch(tablet.sketch(),
ccDisplay::eImageCoords);