//-------------------------------------------------------------- void ofApp::setup(){ fonts.setup(512); fonts.addFont("veraMono", "fonts/VeraMono.ttf"); fonts.addFont("veraMonoBold", "fonts/VeraMono-Bold.ttf"); fonts.addFont("Helvetica", "fonts/HelveticaNeue.ttf"); ofxFontStashStyle style; style.fontID = "veraMono"; style.fontSize = 14; style.color = ofColor::yellow; fonts.addStyle("banana", style); style.color = ofColor::brown; fonts.addStyle("monkey", style); fonts.setLineHeightMult(0.9); ofBackground(22); TIME_SAMPLE_ENABLE(); TIME_SAMPLE_SET_AVERAGE_RATE(0.01); TIME_SAMPLE_SET_DRAW_LOCATION(TIME_SAMPLE_DRAW_LOC_TOP_RIGHT); RUI_SETUP(); RUI_SHARE_PARAM(debug); RUI_LOAD_FROM_XML(); }
//-------------------------------------------------------------- void ofApp::setup(){ ofBackground(22); ofSetFrameRate(60); ofEnableSmoothing(); ofEnableAlphaBlending(); ofSetVerticalSync(true); #ifdef TIME_SAMPLE TIME_SAMPLE_SET_FRAMERATE(60); TIME_SAMPLE_SET_PRECISION(3); TIME_SAMPLE_SET_AVERAGE_RATE(0.01); TIME_SAMPLE_SET_DRAW_LOCATION(TIME_MEASUREMENTS_BOTTOM_RIGHT); TIME_SAMPLE_DISABLE(); #endif width = 10; for ( int i = 0; i < NUM_ANIM_CURVES; i++ ){ pos[i].animateFromTo( xMargin, xMargin + widthCol ); pos[i].setDuration(2); pos[i].setRepeatType( LOOP_BACK_AND_FORTH ); AnimCurve curve = (AnimCurve) (EASE_IN_EASE_OUT + i ); pos[i].setCurve( curve ); curveNames[i] = ofxAnimatable::getCurveName( curve ); } ball.reset(floorLine - 100); ball.setCurve(EASE_IN); ball.setRepeatType(LOOP_BACK_AND_FORTH); ball.setDuration(0.55); ball.animateTo( floorLine ); colorAnim.setColor( ofColor::black ); colorAnim.setDuration( 0.5f ); colorAnim.setRepeatType(LOOP_BACK_AND_FORTH); colorAnim.setCurve(LINEAR); colorAnim.animateTo( ofColor::white ); pointAnim.setDuration(0.3); pointAnim.setPosition( ofPoint(100,100) ); pointAnim.setRepeatType(PLAY_N_TIMES); pointAnim.setCurve(QUADRATIC_EASE_OUT); pointAnim.setRepeatTimes(3); //pointAnim.setAutoFlipCurve(true); }
void testApp::setup(){ ofBackground(22); TIME_SAMPLE_SET_FRAMERATE( 60.0f ); //set the app's target framerate (MANDATORY) //specify where the widget is to be drawn TIME_SAMPLE_SET_DRAW_LOCATION( TIME_MEASUREMENTS_TOP_RIGHT ); //specify a drawing location (OPTIONAL) TIME_SAMPLE_SET_AVERAGE_RATE(0.1); //averaging samples, (0..1], //1.0 gets you no averaging at all //use lower values to get steadier readings TIME_SAMPLE_DISABLE_AVERAGE(); //disable averaging TIME_SAMPLE_SET_REMOVE_EXPIRED_THREADS(true); //inactive threads will be dropped from the table //customize color //TIME_SAMPLE_GET_INSTANCE()->setHighlightColor(ofColor::yellow); startThread(); }