FindBar::FindBar() : UIElement() { barBg = new UIRect(30,30); barBg->setAnchorPoint(-1.0, -1.0, 0.0); barBg->color.setColorHexFromString(CoreServices::getInstance()->getConfig()->getStringValue("Polycode", "uiHeaderBgColor")); addChild(barBg); setHeight(30); UILabel *findLabel = new UILabel("FIND", 18, "section"); addChild(findLabel); findLabel->setColor(1.0, 1.0, 1.0, 0.6); findLabel->setPosition(10,3); UILabel *replaceLabel = new UILabel("REPLACE", 18, "section"); addChild(replaceLabel); replaceLabel->setColor(1.0, 1.0, 1.0, 0.6); replaceLabel->setPosition(200,3); processInputEvents = true; findInput = new UITextInput(false, 120, 12); addFocusChild(findInput); findInput->setPosition(60, 4); replaceInput = new UITextInput(false, 120, 12); addFocusChild(replaceInput); replaceInput->setPosition(280, 4); replaceAllButton = new UIButton("Replace All", 100); addFocusChild(replaceAllButton); replaceAllButton->setPosition(420, 3); UIImage *functionIcon = new UIImage("main/function_icon.png", 11, 17); addChild(functionIcon); functionIcon->setPosition(540, 6); functionList = new UIComboBox(globalMenu, 200); addChild(functionList); functionList->setPosition(560, 4); closeButton = new UIImageButton("main/barClose.png", 1.0, 17, 17); addChild(closeButton); }
void Game::startIntroCutscene() { gfx->recomputeBackground(); gfx->getUI()->darkenScreen(1.f); if(introCutscene) gfx->deleteSceneNode(introCutscene); introCutscene = new UICutscene(gfx); vector2 wparams = gfx->getRenderer()->getWindowParams(); vector2 center = wparams*0.5f; /*** FRAME 0 ***/ introCutscene->startFrame(3.f); UILabel* text = new UILabel(gfx); text->setColor(color(0.7f, 0.7f, 0.7f, 0.f)); text->setText("powered by", 0, 32.f); text->setPosition(center+vector2(-150.f, 100.f)); // text->fadeOut(); UIImage* gllogo = new UIImage(gfx); gllogo->setImage("LOGOS"); gllogo->setPosition(vector2(center[0]-100.f, center[1]-gllogo->getSize()[1]+100.f)); // gllogo->fadeOut(); introCutscene->addWidgetToFrame(text); introCutscene->addWidgetToFrame(gllogo); introCutscene->endFrame(); /*** FRAME 1 ***/ introCutscene->startFrame(6.f); text = new UILabel(gfx); text->setColor(color(0.7f, 0.7f, 0.7f, 0.f)); // text->setText("Copyright 2010 Alexander Dzhoganov", 0, 32.f); text->setText(GNU_COPYRIGHT_NOTICE, 0, 20.f); text->setPosition(vector2(center[0]-400.f, center[1])); text->fadeOut(); introCutscene->addWidgetToFrame(text); UILabel* skiplabel = new UILabel(gfx); skiplabel->setColor(color(0.4f, 0.4f, 0.4f, 0.f)); skiplabel->setText("press [space ] to skip intro", 0, 16.f); skiplabel->setPosition(vector2(wparams[0]-320.f, 50.f)); introCutscene->addWidgetToFrame(skiplabel); introCutscene->endFrame(); /*** FRAME 2 ***/ introCutscene->startFrame(3.f); text = new UILabel(gfx); text->setColor(color(0.7f, 0.7f, 0.7f, 0.f)); text->setText("a game by Alexander Dzhoganov", 0, 32.f); text->setPosition(center); text->fadeOut(); introCutscene->addWidgetToFrame(text); introCutscene->endFrame(); /*** FRAME 3 ***/ introCutscene->startFrame(3.f); text = new UILabel(gfx); text->setColor(color(0.7f, 0.7f, 0.7f, 0.f)); text->setText("programming by:\nAlexander Dzhoganov\n\nart by:\nViktor Popov", 0, 32.f); text->setPosition(center); text->fadeOut(); introCutscene->addWidgetToFrame(text); introCutscene->endFrame(); gfx->getUI()->addWidget(introCutscene); }