void MenuButton::setup(string name, ofPoint centre, string upImgUrl, string dnImgUrl) { if(font==NULL) { font = new ofTrueTypeFont(); font->loadFont("resources/Arial Bold.ttf", 14); } centre.x = (int)centre.x; centre.y = (int)centre.y; listener = NULL; down = false; over = false; this->name = name; currTouchId = -1; alpha = 1; upImg = ImageCache::getImage(upImgUrl); if(dnImgUrl=="") { dnImg = NULL; } else { dnImg = ImageCache::getImage(dnImgUrl); } setFromCenter(ofPoint(centre.x, centre.y), upImg->getWidth(), upImg->getHeight()); }
UI2DGrid::UI2DGrid(){ refRow = 0; refCol = 0; bJump = false; // colorSampler = NULL; subLines.bJump = false; cross.bJump = true; boxes.bJump = false; // Data // font.loadFont("GUI/NewMedia Fett.ttf",12,true, true, true,false); colorSampleImage.loadImage("GUI/defaultColorPalette.png"); setFromCenter(0, 0, ofGetScreenWidth(), ofGetScreenHeight()); setResolutionToInches(); }
//---------------------------------------------------------- void ofRectangle::setFromCenter(const ofPoint& p, float w, float h){ setFromCenter(p.x, p.y, w, h); }
void Book::setPosition(ofPoint _centerPosition){ setFromCenter(_centerPosition, width, height); bChange = true; }