void VDGridTest::drawGraph(GeoDrawer * dr) { #define SHO_NODE 0 #define SHO_EDGE 0 #define SHO_ERR 1 #if SHO_NODE drawNodes(&m_msh, dr); #endif #if SHO_EDGE dr->setColor(0.f, 0.f, .5f); drawEdges(&m_msh, dr); #endif #if SHO_ERR drawErrors(&m_msh, m_msh.dirtyEdges(), m_msh.errorThreshold() ); #endif }
void Lyric::draw(){ ofPushMatrix(); ofTranslate(center.x, center.y); //sentence to read string toRead = currentSentence; ofSetColor(colorTextTyped.r, colorTextTyped.g,colorTextTyped.b); ofRectangle readBounds = font.getStringBoundingBox(toRead, 0, 0); font.drawString(currentSentence, -readBounds.width/2, -readBounds.height ); //typed sentence string strCorrect = typedSentenceCorrect.str(); ofSetColor(colorTextToType.r, colorTextToType.g,colorTextToType.b); ofRectangle keyCorrectBounds = font.getStringBoundingBox(strCorrect, 0, 0); int strCorrectHalfWidth = + keyCorrectBounds.width/2; font.drawString(strCorrect, -strCorrectHalfWidth, +readBounds.height); //errors positionCurrentSentence = ofVec2f(strCorrectHalfWidth, keyCorrectBounds.height/2); drawErrors(); ofPopMatrix(); };