void ofxUIWidget::drawFillHighlight() { if(draw_fill_highlight) { ofxUIFill(); ofxUISetColor(color_fill_highlight); drawComponent(skin_fill_highlight,rect); } }
void ofxUIWidget::drawPadded() { if(draw_padded_rect && !embedded) { ofxUIFill(); ofxUISetColor(color_padded_rect); drawComponent(skin_padded,paddedRect); } }
void ofxUIWidget::drawBack() { if(draw_back) { ofxUIFill(); ofxUISetColor(color_back); drawComponent(skin_back, rect); } }
void ofxUIWidget::drawFill() { if(draw_fill) { ofxUIFill(); ofxUISetColor(color_fill); drawComponent(skin_fill,rect); } }
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(); }
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); } }
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(); } } }
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); } }
void ofxUIRotarySlider::drawFillHighlight() { if(draw_fill_highlight) { ofxUIFill(); ofxUISetColor(color_fill_highlight); drawArcStrip(value); } }
void ofxUIRotarySlider::drawBack() { if(draw_back) { ofxUIFill(); ofxUISetColor(color_back); drawArcStrip(1.0); } }
void ofxUIImageButton::drawBack() { if(draw_back && !draw_fill) { ofxUIFill(); ofxUISetColor(color_back); img->draw(rect->getX(), rect->getY(), rect->getWidth(), rect->getHeight()); } }
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(); } }
void ofxUISlider_<T>::drawBack() { if(draw_back) { ofxUIFill(); ofxUISetColor(color_back); rect->draw(); } }
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(); } }
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(); } }
void ofxUICircleSlider::drawFill() { if(draw_fill) { ofxUIFill(); ofxUISetColor(color_fill); ofxUICircle(rect->getX()+rect->getHalfWidth(), rect->getY()+rect->getHalfHeight(), value*rect->getHalfWidth()); } }
void ofxUIScrollableCanvas::drawPadded() { if(draw_padded_rect && !embedded) { ofxUIFill(); ofxUISetColor(color_padded_rect); paddedRect->draw(); } }
void ofxUICircleSlider::drawBack() { if(draw_back) { ofxUIFill(); ofxUISetColor(color_back); ofxUICircle(rect->getX()+rect->getHalfWidth(), rect->getY()+rect->getHalfHeight(), rect->getHalfWidth()); } }
void ofxUIScrollableCanvas::drawFillHighlight() { if(draw_fill_highlight) { ofxUIFill(); ofxUISetColor(color_fill_highlight); sRect->draw(); } }
void ofxUIScrollableCanvas::drawFill() { if(draw_fill) { ofxUIFill(); ofxUISetColor(color_fill); sRect->draw(); } }
void ofxUIScrollableCanvas::drawBack() { if(draw_back) { ofxUIFill(); ofxUISetColor(color_back); sRect->draw(); } }
void ofxUISlider_<T>::drawFill() { if(draw_fill && value > 0.0) { ofxUIFill(); ofxUISetColor(color_fill); drawSkinInDrawRect(); } }
void ofxUIEnvelopeEditor::drawFill() { if(draw_fill) { ofxUIFill(); ofxUISetColor(color_fill); drawEnvelope(); updateEnvelopeData(); } }
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)); } }
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()); } }