Esempio n. 1
0
void ofxUIImageSlider::drawFillHighlight()
{
    if(draw_fill_highlight)
    {
        ofxUISetColor(255);
        if(kind == OFX_UI_WIDGET_IMAGESLIDER_H)
        {
            if(value > 0.00)
                progressleft->draw(rect->getX(), rect->getY(), tlaspect*rect->getHeight(), rect->getHeight());
            
            progress->draw(rect->getX()+rect->getHeight()*tlaspect-1,rect->getY(),(rect->getWidth() - 2.0*rect->getHeight()*tlaspect)*value + 1, rect->getHeight());
            
            if(value > .99)
                progressright->draw(rect->getX()+rect->getWidth() - tlaspect*rect->getHeight(), rect->getY(), tlaspect*rect->getHeight(), rect->getHeight());
            
            ofxUISetRectMode(OFX_UI_RECTMODE_CENTER);
            ofxUISetColor(255);
            handleDown->draw(imageRect->getX()+value*imageRect->getWidth(), rect->getY()+rect->getHalfHeight(), ratio*handle->getWidth(), ratio*handle->getHeight());
            ofxUISetRectMode(OFX_UI_RECTMODE_CORNER);
        }
        else
        {
            
            
        }
        if(kind == OFX_UI_WIDGET_IMAGESLIDER_V)
        {
            label->drawString(imageRect->getX()+imageRect->getWidth()+padding, label->getRect()->getHeight()/2.0+imageRect->getY()+imageRect->getHeight()-imageRect->getHeight()*value, ofxUIToString(getScaledValue(),labelPrecision));
        }
    }
}
Esempio n. 2
0
void ofxUIValuePlotter::drawFill()
{
    if(draw_fill)
    {
        ofNoFill();
        if(draw_fill_highlight)
        {
            ofxUISetColor(color_fill_highlight);
        }
        else
        {
            ofxUISetColor(color_fill);
        }
        ofPushMatrix();
        ofTranslate(rect->getX(), rect->getY()+scale, 0);
        ofSetLineWidth(2.0);
        ofBeginShape();
        for (unsigned int i = 0; i < bufferSize; i++)
        {
            ofVertex(inc*(float)i, ofxUIMap(buffer[i], min, max, scale, -scale, true));
        }
        ofEndShape();
        ofSetLineWidth(1);
        ofPopMatrix();
        
    }
}
Esempio n. 3
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();
        }
    }
}
Esempio n. 4
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));
    }
}
Esempio n. 5
0
void ofxUIImageSampler::drawFillHighlight()
{
    if(draw_fill_highlight)
    {
        ofxUISetColor(color_fill_highlight);
        ofxUIDrawLine(rect->getX()+value.x*rect->getWidth(),  rect->getY(), rect->getX()+value.x*rect->getWidth(),  rect->getY()+rect->getHeight());
        ofxUIDrawLine(rect->getX(),  rect->getY()+value.y*rect->getHeight(), rect->getX()+rect->getWidth(),  rect->getY()+value.y*rect->getHeight());
        
        ofxUIFill();
        ofxUISetColor(sampledColor);
        ofxUISetRectMode(OFX_UI_RECTMODE_CENTER);
        ofxUIDrawRect(rect->getX()+value.x*rect->getWidth(), rect->getY()+value.y*rect->getHeight(), squareSize, squareSize);
        ofxUISetRectMode(OFX_UI_RECTMODE_CORNER);
    }
}
Esempio n. 6
0
void ofxUIWidget::drawPadded() {
	if(draw_padded_rect && !embedded) {
		ofxUIFill();
		ofxUISetColor(color_padded_rect);
		drawComponent(skin_padded,paddedRect);
	}
}
Esempio n. 7
0
void ofxUIWidget::drawFillHighlight() {
	if(draw_fill_highlight) {
		ofxUIFill();
		ofxUISetColor(color_fill_highlight);
		drawComponent(skin_fill_highlight,rect);
	}
}
Esempio n. 8
0
void ofxUIWidget::drawFill() {
	if(draw_fill) {
		ofxUIFill();
		ofxUISetColor(color_fill);
		drawComponent(skin_fill,rect);
	}
}
Esempio n. 9
0
void ofxUIWidget::drawOutlineHighlight() {
	if(draw_outline_highlight) {
		ofxUINoFill();
		ofxUISetColor(color_outline_highlight);
		drawComponent(skin_outline_highlight,rect);
	}
}
Esempio n. 10
0
void ofxUIWidget::drawPaddedOutline() {
	if(draw_padded_rect_outline && !embedded) {
		ofxUINoFill();
		ofxUISetColor(color_padded_rect_outline);
		drawComponent(skin_padded_outline,paddedRect);
	}
}
Esempio n. 11
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);
    }
}
Esempio n. 12
0
void ofxUIWidget::drawBack() {
	if(draw_back) {
		ofxUIFill();
		ofxUISetColor(color_back);		
		drawComponent(skin_back, rect);
	}
}
Esempio n. 13
0
void ofxUIWidget::drawOutline() {
	if(draw_outline) {
		ofxUINoFill();
		ofxUISetColor(color_outline);
		drawComponent(skin_outline,rect);		
	}
}
void ofxUIMultiImageToggle::drawOutlineHighlight()         //OVER
{
    if(draw_outline_highlight)
    {
        ofxUISetColor(255);
        over->draw(rect->getX(), rect->getY(), rect->getWidth(), rect->getHeight());
    }
}
void ofxUIMultiImageToggle::drawBack()                     //NORMAL
{
    if(draw_back && !draw_fill)
    {
        ofxUISetColor(255);
        back->draw(rect->getX(), rect->getY(), rect->getWidth(), rect->getHeight());
    }
}
void ofxUIMultiImageToggle::drawFill()
{
    if(draw_fill)
    {
        ofxUISetColor(255);
        on->draw(rect->getX(), rect->getY(), rect->getWidth(), rect->getHeight());
    }
}
void ofxUIMultiImageToggle::drawFillHighlight()            //DOWN/ON
{
    if(draw_fill_highlight)
    {
        ofxUISetColor(255);
        down->draw(rect->getX(), rect->getY(), rect->getWidth(), rect->getHeight());
    }
}
Esempio n. 18
0
void ofxUICircleSlider::drawBack()
{
    if(draw_back)
    {
        ofxUIFill();
        ofxUISetColor(color_back);
        ofxUICircle(rect->getX()+rect->getHalfWidth(), rect->getY()+rect->getHalfHeight(), rect->getHalfWidth());
    }
}
Esempio n. 19
0
void ofxUIWidget::drawPaddedOutline()
{
    if(draw_padded_rect_outline && !embedded)
    {
        ofxUINoFill();
        ofxUISetColor(color_padded_rect_outline);
        paddedRect->draw();
    }
}
Esempio n. 20
0
void ofxUIWidget::drawPadded()
{
    if(draw_padded_rect && !embedded)
    {
        ofxUIFill();
        ofxUISetColor(color_padded_rect);
        paddedRect->draw();
    }
}
Esempio n. 21
0
void ofxUIWidget::drawFillHighlight()
{
    if(draw_fill_highlight)
    {
        ofxUIFill();
        ofxUISetColor(color_fill_highlight);
        rect->draw();
    }
}
Esempio n. 22
0
void ofxUIWidget::drawFill()
{
    if(draw_fill)
    {
        ofxUIFill();
        ofxUISetColor(color_fill);
        rect->draw();
    }
}
Esempio n. 23
0
void ofxUIWidget::drawOutlineHighlight()
{
    if(draw_outline_highlight)
    {
        ofxUINoFill();
        ofxUISetColor(color_outline_highlight);
        rect->draw();
    }
}
Esempio n. 24
0
void ofxUIWidget::drawOutline()
{
    if(draw_outline)
    {
        ofxUINoFill();
        ofxUISetColor(color_outline);
        rect->draw();
    }
}
Esempio n. 25
0
void ofxUIWidget::drawBack()
{
    if(draw_back)
    {
        ofxUIFill();
        ofxUISetColor(color_back);
        rect->draw();
    }
}
Esempio n. 26
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. 27
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);
}
Esempio n. 28
0
void ofxUIScrollableCanvas::drawPadded()
{
    if(draw_padded_rect && !embedded)
    {
        ofxUIFill();
        ofxUISetColor(color_padded_rect);
        paddedRect->draw();
    }
}
Esempio n. 29
0
void ofxUIScrollableCanvas::drawPaddedOutline()
{
    if(draw_padded_rect_outline && !embedded)
    {
        ofNoFill();
        ofxUISetColor(color_padded_rect_outline);
        paddedRect->draw();
    }
}
Esempio n. 30
0
void ofxUICircleSlider::drawOutline()
{
    if(draw_outline)
    {
        ofNoFill();
        ofxUISetColor(color_outline);
        ofxUICircle(rect->getX()+rect->getHalfWidth(), rect->getY()+rect->getHalfHeight(), rect->getHalfWidth());
    }
}