Example #1
0
void ofxUIWidget::drawFillHighlight() {
	if(draw_fill_highlight) {
		ofxUIFill();
		ofxUISetColor(color_fill_highlight);
		drawComponent(skin_fill_highlight,rect);
	}
}
Example #2
0
void ofxUIWidget::drawPadded() {
	if(draw_padded_rect && !embedded) {
		ofxUIFill();
		ofxUISetColor(color_padded_rect);
		drawComponent(skin_padded,paddedRect);
	}
}
Example #3
0
void ofxUIWidget::drawBack() {
	if(draw_back) {
		ofxUIFill();
		ofxUISetColor(color_back);		
		drawComponent(skin_back, rect);
	}
}
Example #4
0
void ofxUIWidget::drawFill() {
	if(draw_fill) {
		ofxUIFill();
		ofxUISetColor(color_fill);
		drawComponent(skin_fill,rect);
	}
}
Example #5
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();
}
Example #6
0
void ofxUILabel::drawFill()
{
    if(draw_fill)
    {
        ofxUIFill();
        ofxUISetColor(color_fill);

        // --!
        int px=0, py=0;
        ofxUIRectangle* parentRect = rect;
        // 循环到canvas的上一层
        while(parentRect->getParent() != NULL)
        {
            px += parentRect->x;
            py += parentRect->y;

            parentRect = parentRect->getParent();
        }

        font->drawString(label, floor(px)+xOffset, floor(py+rect->getHeight())+yOffset);

        //font->drawString(label, floor(rect->x)+xOffset, floor(rect->y+rect->getHeight())+yOffset);

        // getX()和getY()并非实际意义上的xy 而是加了parent之后的坐标
        //cout << label << floor(rect->getX()) << ", " << floor(rect->getY()) << endl;
        //drawStringShadow(floor(rect->getX())+xOffset, floor(rect->getY()+rect->getHeight())+yOffset, label);
    }
}
Example #7
0
void ofxUISpectrum::drawFill()
{
    if(draw_fill)
    {
        ofxUIFill();
        if(draw_fill_highlight)
        {
            ofxUISetColor(color_fill_highlight);
        }
        else
        {
            ofxUISetColor(color_fill);
        }
        if(buffer != NULL)
        {
            ofPushMatrix();
            ofTranslate(rect->getX(), rect->getY()+scale, 0);
            ofBeginShape();
            ofVertex(0, 0);
            for (int i = 0; i < bufferSize; i++)
            {
                ofVertex(inc*(float)i, ofxUIMap(buffer[i], min, max, 0, -scale, true));
            }
            ofVertex((bufferSize-1)*inc, 0);
            ofEndShape(true);
            ofPopMatrix();
        }
    }
}
Example #8
0
void ofxUILabel::drawFillHighlight()
{
    if(draw_fill_highlight)
    {
        ofxUIFill();
        ofxUISetColor(color_fill_highlight);
        font->drawString(label, floor(rect->getX())+xOffset, floor(rect->getY()+rect->getHeight())+yOffset);
    }
}
Example #9
0
void ofxUIRotarySlider::drawFillHighlight()
{
    if(draw_fill_highlight)
    {
        ofxUIFill();
        ofxUISetColor(color_fill_highlight);
        drawArcStrip(value);
    }
}
Example #10
0
void ofxUIRotarySlider::drawBack()
{
    if(draw_back)
    {
        ofxUIFill();
        ofxUISetColor(color_back);
        drawArcStrip(1.0);
    }
}
Example #11
0
void ofxUIImageButton::drawBack()
{
    if(draw_back && !draw_fill)
    {
        ofxUIFill();
        ofxUISetColor(color_back);
        img->draw(rect->getX(), rect->getY(), rect->getWidth(), rect->getHeight());
    }
}
Example #12
0
void ofxUIImageButton::drawFillHighlight()
{
    if(draw_fill_highlight)
    {
        ofxUIFill();
        ofxUISetColor(color_fill_highlight);
        img->draw(rect->getX(), rect->getY(), rect->getWidth(), rect->getHeight());
    }
}
void ofxUIButton::drawFill()
{
    if(*value)
    {
        ofxUIFill();
        ofxUISetColor(color_fill);
        rect->draw();
    }
}
Example #14
0
void ofxUISlider_<T>::drawBack()
{
    if(draw_back)
    {
        ofxUIFill();
        ofxUISetColor(color_back);
        rect->draw();
    }
}
Example #15
0
void ofxUILabel::drawStringShadow(float x, float y, string _string)
{
    ofxUIFill();
    ofxUISetColor(color_back);
    // --!ofxUI只是ofTrueTypeFont的别称
    // --!floor()返回小于或者等于指定表达式的最大整数 即向上取整
    //if(bDrawString == true)
    font->drawString(_string, floor(x)+1, floor(y)+1);
}
void ofxUIWidget::drawFillHighlight()
{
    if(draw_fill_highlight)
    {
        ofxUIFill();
        ofxUISetColor(color_fill_highlight);
        rect->draw();
    }
}
Example #17
0
void ofxUIImageToggle::drawFill()
{
    if(draw_fill)
    {
        ofxUIFill();
        ofxUISetColor(color_fill);
        img->draw(rect->getX(), rect->getY(), rect->getWidth(), rect->getHeight());
    }
}
void ofxUIWidget::drawPadded()
{
    if(draw_padded_rect && !embedded)
    {
        ofxUIFill();
        ofxUISetColor(color_padded_rect);
        paddedRect->draw();
    }
}
void ofxUIWidget::drawBack()
{
    if(draw_back)
    {
        ofxUIFill();
        ofxUISetColor(color_back);
        rect->draw();
    }
}
void ofxUIWidget::drawFill()
{
    if(draw_fill)
    {
        ofxUIFill();
        ofxUISetColor(color_fill);
        rect->draw();
    }
}
Example #21
0
void ofxUICircleSlider::drawFill()
{
    if(draw_fill)
    {
        ofxUIFill();
        ofxUISetColor(color_fill);
        ofxUICircle(rect->getX()+rect->getHalfWidth(), rect->getY()+rect->getHalfHeight(), value*rect->getHalfWidth());
    }
}
Example #22
0
void ofxUIScrollableCanvas::drawPadded()
{
    if(draw_padded_rect && !embedded)
    {
        ofxUIFill();
        ofxUISetColor(color_padded_rect);
        paddedRect->draw();
    }
}
Example #23
0
void ofxUICircleSlider::drawBack()
{
    if(draw_back)
    {
        ofxUIFill();
        ofxUISetColor(color_back);
        ofxUICircle(rect->getX()+rect->getHalfWidth(), rect->getY()+rect->getHalfHeight(), rect->getHalfWidth());
    }
}
Example #24
0
void ofxUIScrollableCanvas::drawFillHighlight()
{
    if(draw_fill_highlight)
    {
        ofxUIFill();
        ofxUISetColor(color_fill_highlight);
        sRect->draw();
    }
}
Example #25
0
void ofxUIScrollableCanvas::drawFill()
{
    if(draw_fill)
    {
        ofxUIFill();
        ofxUISetColor(color_fill);
        sRect->draw();
    }
}
Example #26
0
void ofxUIScrollableCanvas::drawBack()
{
    if(draw_back)
    {
        ofxUIFill();
        ofxUISetColor(color_back);
        sRect->draw();
    }
}
Example #27
0
void ofxUISlider_<T>::drawFill()
{
	if(draw_fill && value > 0.0)
	{
		ofxUIFill();
		ofxUISetColor(color_fill);		
		drawSkinInDrawRect();
	}
}
Example #28
0
void ofxUIEnvelopeEditor::drawFill()
{
    if(draw_fill)
    {
        ofxUIFill();
        ofxUISetColor(color_fill);
        drawEnvelope();
        updateEnvelopeData();
    }
}
Example #29
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));
    }
}
Example #30
0
void ofxUIValuePlotter::drawBack()
{
    if(draw_back)
    {
        ofxUIFill();
        ofxUISetColor(color_back);
        rect->draw();
        
        ofxUIDrawLine(rect->getX(), rect->getY()+rect->getHalfHeight(), rect->getX()+rect->getWidth(), rect->getY()+rect->getHalfHeight());
    }
}