Пример #1
0
//-----------------------------------------------.
void guiTypePanel::render(){
	ofPushStyle();

		glPushMatrix();
		glTranslatef(boundingBox.x, boundingBox.y, 0);
			//draw the background
			ofFill();
			glColor4fv(bgColor.getColorF());
			ofRect(0, 0, boundingBox.width, boundingBox.height);

			//draw the outline
			ofNoFill();
			glColor4fv(outlineColor.getColorF());
			ofRect(0, 0, boundingBox.width, boundingBox.height);

			if( locked ){
				drawLocked();
			}else{
				drawUnlocked();
			}

		glPopMatrix();
		renderText();

		glPushMatrix();
			glTranslatef(hitArea.x, hitArea.y, 0);
				for(unsigned int i = 0; i < children.size(); i++){
					children[children.size()-(1+i)]->render();
				}
		glPopMatrix();

	ofPopStyle();
}
Пример #2
0
//-----------------------------------------------.
void guiTypePanel::render(){
	ofPushStyle();

		if( showOnly && elementInteracting ){
		
			glPushMatrix();
				glTranslatef(hitArea.x, hitArea.y, 0);
				for(unsigned int i = 0; i < children.size(); i++){
					int elementToRender = children.size()-(1+i);
					if( elementToRender == whichElementInteracting ){
						children[elementToRender]->render();
					}
				}
			glPopMatrix();
					
		}else{
		
			glPushMatrix();
			glTranslatef(boundingBox.x, boundingBox.y, 0);
							
				//draw the background
				ofFill();
				glColor4fv(bgColor.getColorF());
				ofRect(0, 0, boundingBox.width, boundingBox.height);

				//draw the outline
//				ofNoFill();
//				glColor4fv(outlineColor.getColorF());
//				ofRect(0, 0, boundingBox.width, boundingBox.height);

				if( locked ){
					drawLocked();
				}else{
					drawUnlocked();
				}
					
			glPopMatrix();
			//renderText();

			glPushMatrix();
				glTranslatef(hitArea.x, hitArea.y, 0);
				for(unsigned int i = 0; i < children.size(); i++){
					children[children.size()-(1+i)]->render();
				}
			glPopMatrix();
		}
	ofPopStyle();
}