Esempio n. 1
0
void ofxUIEnvelopeEditor::drawEnvelope(){
    
    vector<ofVec3f> points = envelope->getPoints();
    int size = points.size();
    float rX = rect->getX();
    float rY = rect->getY();
    
    ofxUISetRectMode(OFX_UI_RECTMODE_CENTER);
    ofxUINoFill();
    for (int i = 0; i < size; i++)
    {
        float x = rX + points[i].x*rect->getWidth();
        float y = rY + points[i].y*rect->getHeight();
        
        ofxUICircle(x, y, pointNodeRadius);
        
        if(i < size-1)
        {
            float nx = rX + points[i+1].x*rect->getWidth();
            float hx = (x + nx)/2.0;
            ofxUIDrawRect(hx, rY + envelope->getY((hx-rX)/rect->getWidth())*rect->getHeight(), pointNodeRectWidth, pointNodeRectHeight);
        }
    }
    ofxUIFill();
    ofxUISetRectMode(OFX_UI_RECTMODE_CORNER);
    
    polyline.draw();
}
Esempio n. 2
0
void ofxUICircleSlider::drawFill()
{
    if(draw_fill)
    {
        ofxUIFill();
        ofxUISetColor(color_fill);
        ofxUICircle(rect->getX()+rect->getHalfWidth(), rect->getY()+rect->getHalfHeight(), value*rect->getHalfWidth());
    }
}
Esempio n. 3
0
void ofxUICircleSlider::drawOutline()
{
    if(draw_outline)
    {
        ofNoFill();
        ofxUISetColor(color_outline);
        ofxUICircle(rect->getX()+rect->getHalfWidth(), rect->getY()+rect->getHalfHeight(), rect->getHalfWidth());
    }
}
Esempio n. 4
0
void ofxUICircleSlider::drawBack()
{
    if(draw_back)
    {
        ofxUIFill();
        ofxUISetColor(color_back);
        ofxUICircle(rect->getX()+rect->getHalfWidth(), rect->getY()+rect->getHalfHeight(), rect->getHalfWidth());
    }
}
Esempio n. 5
0
void ofxUICircleSlider::drawFillHighlight()
{
    if(draw_fill_highlight)
    {
        ofxUIFill();
        ofxUISetColor(color_fill_highlight);
        ofxUICircle(rect->getX()+rect->getHalfWidth(), rect->getY()+rect->getHalfHeight(), value*rect->getHalfWidth());
        ofxUISetColor(label->getColorFillHighlight());
        label->drawString(rect->getX()+rect->getWidth()+padding, label->getRect()->getHeight()/2.0+rect->getY()+rect->getHeight()-rect->getHeight()*.5, ofxUIToString(getScaledValue(),labelPrecision));
    }
}