//-------------------------------------------------------------- void ofxMuiColorPicker::init() { // super class init should have already been called in the constructor def list setObjectType("COLOR_PICKER"); // override the superclass setBoxProperties(defaults->colorPickerBoxProperties); setValue(1,0); // r setValue(1,1); // g setValue(1,2); // b setValue(1,3); // a // set default key binding //keyBind_toggleValue(' '); // custom, just for the button itself (i.e. no clicking on the label) setHitBox(0, 0, defaults->colorPickerWidth, defaults->colorPickerHeight); colorPickerPreview.height = defaults->colorPickerPreviewHeight; // get the little preview-r eyeDropperPreviewPixelWidth = defaults->colorPickerEyeDropperWidth / defaults->colorPickerEyeDropperZoom; eyeDropperPreviewPixelHeight = defaults->colorPickerEyeDropperWidth / defaults->colorPickerEyeDropperZoom; eyeDropperPreview.allocate(eyeDropperPreviewPixelWidth,eyeDropperPreviewPixelHeight,GL_RGB); showEyeDroperPreview = false; setNeedsLayoutUpdate(true); }
//-------------------------------------------------------------- void ofxMuiButton::init() { // super class init should have already been called in the constructor def list setObjectType("BUTTON"); roundFrame = defaults->buttonRoundFrame; // override the superclass setBoxProperties(defaults->buttonBoxProperties); buttonType = BUTTON_TYPE_TOGGLE; setButtonIcon(ICON_DEFAULT); setValue(false); // set default key binding keyBind_toggleValue(defaults->keyboardToggle); // custom, just for the button itself (i.e. no clicking on the label) setHitBox(0, 0, defaults->buttonWidth, defaults->buttonHeight); // label->setText(name); // label->enable(); // requestBoxLayout(); }
//-------------------------------------------------------------- void ofxMuiWindow::doContentBoxLayout() { cout << "doing content box layout " << endl; int currentX = 0; int currentY = 0; int maxX = 0; int maxY = 0; // position the minmax/enable/disable buttons enableDisableButton->setPosition(0,0); currentX+=enableDisableButton->getWidth(); minMaxButton->setPosition(currentX,0); currentX+=minMaxButton->getWidth(); // position the label // TODO: center this // int labelY = (minMaxButton->getY() + minMaxButton->getHeight()) / 2.0 -label->getHeight() / 2.0 ; // label->setPosition(currentX, labelY); // // // maxX = MAX(maxX, label->getPosition().x + label->getWidth()); // // currentY+=MAX(MAX(enableDisableButton->getHeight(), // minMaxButton->getHeight()), // label->getHeight()); // // // currentX = 0; minimizedRect.x = 0; minimizedRect.y = 0; minimizedRect.width = maxX; minimizedRect.height = currentY; if(isMinimized) { } else { for(int i = 0; i < childObjects.size(); i++) { if(childObjects[i] != enableDisableButton && childObjects[i] != minMaxButton/*&& childObjects[i] != label && childObjects[i] != valueLabel*/) { currentX = 0; childObjects[i]->setPosition(currentX,currentY); currentY += childObjects[i]->getHeight(); maxX = MAX(maxX,childObjects[i]->getWidth()); } } } setHitBox(0,0,maxX,currentY); setContentBoxWidth(getHitBoxWidth()); setContentBoxHeight(getHitBoxHeight()); }
//-------------------------------------------------------------- void ofxMuiBox::setHitBox(const ofRectangle& _hitBox) { cout << "SETHITBOX ="<< _hitBox.x << "|" << _hitBox.y << "|" << _hitBox.width << "|" << _hitBox.height << endl; setHitBox(_hitBox.x, _hitBox.y, _hitBox.width, _hitBox.height); }
Butter::Butter(Vector3* vec) { _position = vec; setHitBox(3.5); speed = 0; GLfloat amb[] = { 0.83f,0.81f,0.13f,1.0f }; GLfloat diff[] = { 0.94f,0.83f,0.1f,1.0f }; GLfloat spec[] = { 0.99f,0.75f,0.13f,1.0f }; GLfloat shine = 2.0f; _material = new Material(amb, diff, spec, shine); }