void ofxAppEmscriptenWindow::toggleFullscreen(){ EmscriptenFullscreenChangeEvent fullscreenStatus; emscripten_get_fullscreen_status(&fullscreenStatus); if(fullscreenStatus.isFullscreen){ setFullscreen(false); }else if(fullscreenStatus.fullscreenEnabled){ setFullscreen(true); } }
bool Video::loadXML(const QDomElement& root) { if (root.tagName() != KXMLQLCFunction) { qWarning() << Q_FUNC_INFO << "Function node not found"; return false; } if (root.attribute(KXMLQLCFunctionType) != typeToString(Function::Video)) { qWarning() << Q_FUNC_INFO << root.attribute(KXMLQLCFunctionType) << "is not Video"; return false; } QDomNode node = root.firstChild(); while (node.isNull() == false) { QDomElement tag = node.toElement(); if (tag.tagName() == KXMLQLCVideoSource) { if (tag.hasAttribute(KXMLQLCVideoStartTime)) setStartTime(tag.attribute(KXMLQLCVideoStartTime).toUInt()); if (tag.hasAttribute(KXMLQLCVideoColor)) setColor(QColor(tag.attribute(KXMLQLCVideoColor))); if (tag.hasAttribute(KXMLQLCVideoLocked)) setLocked(true); if (tag.hasAttribute(KXMLQLCVideoScreen)) setScreen(tag.attribute(KXMLQLCVideoScreen).toInt()); if (tag.hasAttribute(KXMLQLCVideoFullscreen)) { if (tag.attribute(KXMLQLCVideoFullscreen) == "1") setFullscreen(true); else setFullscreen(false); } if (tag.text().contains("://") == true) setSourceUrl(tag.text()); else setSourceUrl(m_doc->denormalizeComponentPath(tag.text())); } else if (tag.tagName() == KXMLQLCFunctionSpeed) { loadXMLSpeed(tag); } node = node.nextSibling(); } return true; }
void CritterBarterState::init() { if (_initialized) return; State::init(); setFullscreen(false); setModal(true); setX((Game::getInstance()->renderer()->width() - 640)*0.5); setY((Game::getInstance()->renderer()->height() - 480)*0.5 + 291); addUI("background",new Image("art/intrface/barter.frm")); getActiveUI("background")->addEventHandler("mouseleftclick", this, (EventRecieverMethod) &CritterBarterState::onBackgroundClick); addUI("offerButton", new ImageButton(ImageButton::TYPE_DIALOG_RED_BUTTON, 40, 162)); addUI("talkButton", new ImageButton(ImageButton::TYPE_DIALOG_RED_BUTTON, 583, 162)); getActiveUI("talkButton")->addEventHandler("mouseleftclick", this, (EventRecieverMethod) &CritterBarterState::onTalkButtonClick); addUI("mineInventoryScrollUpButton", new ImageButton(ImageButton::TYPE_DIALOG_UP_ARROW, 190, 56)); addUI("mineInventoryScrollDownButton", new ImageButton(ImageButton::TYPE_DIALOG_DOWN_ARROW, 190, 82)); addUI("theirsInventoryScrollUpButton", new ImageButton(ImageButton::TYPE_DIALOG_UP_ARROW, 421, 56)); addUI("theirsInventoryScrollDownButton", new ImageButton(ImageButton::TYPE_DIALOG_DOWN_ARROW, 421, 82)); }
void CritterDialogReview::init() { if (_initialized) return; State::init(); setFullscreen(false); setModal(false); auto background = new UI::Image("art/intrface/review.frm"); Point backgroundPos = Point((Game::getInstance()->renderer()->size() - background->size()) / 2); background->setPosition(backgroundPos); // Interface buttons auto doneButton = new UI::ImageButton(UI::ImageButton::Type::DIALOG_DONE_BUTTON, backgroundPos + Point(500, 398)); doneButton->mouseClickHandler().add(std::bind(&CritterDialogReview::onDoneButtonClick, this, std::placeholders::_1)); auto upButton = new UI::ImageButton(UI::ImageButton::Type::DIALOG_BIG_UP_ARROW, backgroundPos + Point(476, 154)); upButton->mouseClickHandler().add(std::bind(&CritterDialogReview::onUpButtonClick, this, std::placeholders::_1)); auto downButton = new UI::ImageButton(UI::ImageButton::Type::DIALOG_BIG_DOWN_ARROW, backgroundPos + Point(476, 192)); downButton->mouseClickHandler().add(std::bind(&CritterDialogReview::onDownButtonClick, this, std::placeholders::_1)); addUI(background); addUI(doneButton); addUI(upButton); addUI(downButton); auto list = new UI::TextAreaList(Point(88,76)); list->setSize(Size(340,340)); addUI("list",list); }
/** * Handles screen key shortcuts. * @param action Pointer to an action. */ void Screen::handle(Action *action) { if (Options::getBool("debug")) { if (action->getDetails()->type == SDL_KEYDOWN && action->getDetails()->key.keysym.sym == SDLK_F8) { switch(Timer::gameSlowSpeed) { case 1: Timer::gameSlowSpeed = 5; break; case 5: Timer::gameSlowSpeed = 15; break; default: Timer::gameSlowSpeed = 1; break; } } } if (action->getDetails()->type == SDL_KEYDOWN && action->getDetails()->key.keysym.sym == SDLK_RETURN && (SDL_GetModState() & KMOD_ALT) != 0) { setFullscreen(!_fullscreen); } else if (action->getDetails()->type == SDL_KEYDOWN && action->getDetails()->key.keysym.sym == Options::getInt("keyScreenshot")) { std::stringstream ss; int i = 0; do { ss.str(""); ss << Options::getUserFolder() << "screen" << std::setfill('0') << std::setw(3) << i << ".png"; i++; } while (CrossPlatform::fileExists(ss.str())); screenshot(ss.str()); return; } }
CVBAOptions::CVBAOptions() { // Standardwerte setEmulator(CAbstraktOptions::VBA); setEmuCommand("visualboyadvance"); setScale(1); setFullscreen(true); }
void CritterDialog::init() { if (_initialized) return; State::init(); setFullscreen(false); setModal(false); setPosition((Game::getInstance()->renderer()->size() - Point(640, 480)) / 2 + Point(0, 291)); auto background = new UI::Image("art/intrface/di_talk.frm"); addUI("background", background); auto question = new UI::TextArea("question", 140, -55); question->setSize({370, 0}); question->setWordWrap(true); addUI("question", question); // Interface buttons auto reviewButton = new UI::ImageButton(UI::ImageButton::Type::DIALOG_REVIEW_BUTTON, 13, 154); reviewButton->addEventHandler("mouseleftclick", [this](Event::Event* event){ this->onReviewButtonClick(dynamic_cast<Event::Mouse*>(event)); }); addUI(reviewButton); auto barterButton = new UI::ImageButton(UI::ImageButton::Type::DIALOG_RED_BUTTON, 593, 40); barterButton->addEventHandler("mouseleftclick", [this](Event::Event* event){ this->onBarterButtonClick(dynamic_cast<Event::Mouse*>(event)); }); addUI(barterButton); }
GlAndroidContext::GlAndroidContext(const XCHAR *title, int width, int height) { _render = new GlRender(width, height); printGraphicInformation(); setResolution(width, height); setFullscreen(true); _Context = this; }
bool BasisManager::keyPressed( const OIS::KeyEvent &arg ) { // меняем оконный режим по Alt+Enter if (arg.key == OIS::KC_RETURN) { if (mInput->isKeyDown(OIS::KC_RMENU)) { setFullscreen(!isFullscreen()); return true; } } if ( arg.key == OIS::KC_SYSRQ ) { std::ifstream stream; std::string file; do { stream.close(); static size_t num = 0; const size_t max_shot = 100; if (num == max_shot) { MYGUI_LOG(Info, "The limit of screenshots is exceeded : " << max_shot); return true; } file = MyGUI::utility::toString("screenshot_", ++num, ".png"); stream.open(file.c_str()); } while (stream.is_open()); mWindow->writeContentsToFile(file); return true; } return mStates.back()->keyPressed(arg); }
void WorldMap::init() { if (_initialized) return; State::init(); setModal(true); setFullscreen(true); unsigned int renderWidth = Game::getInstance()->renderer()->width(); unsigned int renderHeight = Game::getInstance()->renderer()->height(); // loading map tiles _tiles = new UI::ImageList((std::vector<std::string>){ "art/intrface/wrldmp00.frm", "art/intrface/wrldmp01.frm", "art/intrface/wrldmp02.frm", "art/intrface/wrldmp03.frm", "art/intrface/wrldmp04.frm", "art/intrface/wrldmp05.frm", "art/intrface/wrldmp06.frm", "art/intrface/wrldmp07.frm", "art/intrface/wrldmp08.frm", "art/intrface/wrldmp09.frm", "art/intrface/wrldmp10.frm", "art/intrface/wrldmp11.frm", "art/intrface/wrldmp12.frm", "art/intrface/wrldmp13.frm", "art/intrface/wrldmp14.frm", "art/intrface/wrldmp15.frm", "art/intrface/wrldmp16.frm", "art/intrface/wrldmp17.frm", "art/intrface/wrldmp18.frm", "art/intrface/wrldmp19.frm" }, 0, 0); //auto cross = new Image("art/intrface/wmaploc.frm"); _hotspot = new UI::ImageButton(UI::ImageButton::Type::MAP_HOTSPOT, 0, 0); //addUI(_hotspot); // creating screen if (Game::getInstance()->settings()->worldMapFullscreen()) { _panel = new UI::Image("art/intrface/wminfce2.frm"); // panel small mapWidth = renderWidth - 168; mapHeight = renderHeight; mapMinX = 0; mapMinY = 0; } else { _panel = new UI::Image("art/intrface/wmapbox.frm"); // panel full mapWidth = 450; // fallout 2 map screen width mapHeight = 442; // fallout 2 map screen height mapMinX = (renderWidth - 640)/2 + 22; mapMinY = (renderHeight - 480)/2 + 21; } _screenMap = new UI::Image (mapWidth, mapHeight); _screenMap->setPosition(Point(mapMinX, mapMinY)); }
/** * (De)activates full screen mode when the checkbox is (un)checked. * * Invoked when the fullscreen checkbox is triggered/changed. */ void View::changeFullscreen() { auto settings = ::FourInALine::getInstance()->getSettings(); auto viewSettings = settings->getViewSettings(); bool isFullscreen = this->fullscreenCheckboxAction->isChecked(); viewSettings->setFullscreen(isFullscreen); viewSettings->apply(); }
void Credits::init() { if (_initialized) return; State::init(); setModal(true); setFullscreen(true); Game::getInstance()->mouse()->pushState(Input::Mouse::Cursor::NONE); auto renderer = Game::getInstance()->renderer(); setPosition(Point((renderer->size().width() - 640) / 2, renderer->size().height())); auto credits = ResourceManager::getInstance()->datFileItem("text/english/credits.txt"); std::stringstream ss; credits->setPosition(0); ss << credits; std::string line; auto font_default = ResourceManager::getInstance()->font("font4.aaf", 0x907824ff); auto font_at = ResourceManager::getInstance()->font("font3.aaf", 0x706050ff); auto font_hash = ResourceManager::getInstance()->font("font4.aaf", 0x8c8c84ff); int y = 0; while (std::getline(ss, line)) { Font* cur_font = font_default; int additionalGap = 0; if (line.find('\r') != std::string::npos) { line.erase(line.find('\r')); } if (line[0] == '#') { line.erase(line.begin()); cur_font = font_hash; } else if (line[0] == '@') { line.erase(line.begin()); cur_font = font_at; additionalGap = 6; } else if (line.empty()) { line = " "; } auto tx = new UI::TextArea(line, 0, y); tx->setFont(cur_font); tx->setSize({640, 0}); tx->setHorizontalAlign(UI::TextArea::HorizontalAlign::CENTER); addUI(tx); _lines.push_back(tx); y += tx->textSize().height() + cur_font->verticalGap() + additionalGap; } _lastTicks=SDL_GetTicks(); }
void InventoryDragItemState::init() { if (_initialized) return; State::init(); setModal(true); setFullscreen(false); }
void LoadGame::init() { if (_initialized) return; State::init(); setModal(true); setFullscreen(true); auto game = Game::getInstance(); //auto player = Game::getInstance()->player(); // background auto bg = new UI::Image("art/intrface/lsgame.frm"); Point bgPos = Point((game->renderer()->size() - bg->size()) / 2); auto bgX = bgPos.x(); auto bgY = bgPos.y(); bg->setPosition(bgPos); addUI(bg); // BUTTONS // button: up arrow addUI("button_up", new UI::ImageButton(UI::ImageButton::Type::SMALL_UP_ARROW, bgX+35, bgY+58)); // button: down arrow addUI("button_down", new UI::ImageButton(UI::ImageButton::Type::SMALL_DOWN_ARROW, bgX+35, bgY+72)); // button: Done auto doneButton = new UI::ImageButton(UI::ImageButton::Type::SMALL_RED_CIRCLE, bgX+391, bgY+349); doneButton->mouseClickHandler().add(std::bind(&LoadGame::onDoneButtonClick, this, std::placeholders::_1)); addUI(doneButton); // button: Cancel auto cancelButton = new UI::ImageButton(UI::ImageButton::Type::SMALL_RED_CIRCLE, bgX+495, bgY+349); cancelButton->mouseClickHandler().add([this](Event::Event* event){ this->doCancel(); }); addUI(cancelButton); // LABELS auto font3_907824ff = ResourceManager::getInstance()->font("font3.aaf"); SDL_Color color = {0x90, 0x78, 0x24, 0xff}; // LOAD GAME LABEL auto saveGameLabel = new UI::TextArea(_t(MSG_LOAD_SAVE, 110), bgX+48, bgY+27); saveGameLabel->setFont(font3_907824ff, color); addUI(saveGameLabel); // DONE BUTTON LABEL auto doneButtonLabel = new UI::TextArea(_t(MSG_OPTIONS, 300), bgX+410, bgY+348); doneButtonLabel->setFont(font3_907824ff, color); addUI(doneButtonLabel); // CANCEL BUTTON LABEL auto cancelButtonLabel = new UI::TextArea(_t(MSG_OPTIONS, 121), bgX+515, bgY+348); cancelButtonLabel->setFont(font3_907824ff, color); addUI(cancelButtonLabel); }
void Window::processCommands(CommunicationBuffer* fromGame, CommunicationBuffer* toGame) { core::WinMsg cmd; while( fromGame->peek(cmd) ) { switch( cmd.type ) { case core::WinMsgType::LockCursor: { setLockCursor(cmd.lockCursor); } break; case core::WinMsgType::ShowCursor: { setShowCursor(cmd.showCursor); } break; case core::WinMsgType::RelativeCursor: { setRelativeCursor(cmd.relativeCursor); } break; case core::WinMsgType::Fullscreen: { setFullscreen(cmd.fullscreen); } break; case core::WinMsgType::Size: { resize(cmd.screen.x, cmd.screen.y); WinMsg msg{}; msg.type = core::WinMsgType::Size; msg.screen.x = getSizeX(); msg.screen.y = getSizeY(); toGame->writeEvent(msg); } break; case core::WinMsgType::Position: { move(cmd.screen.x, cmd.screen.y); } break; case core::WinMsgType::FileChange: { monitorDirectoryForChanges(cmd.fileChange.name); } break; case core::WinMsgType::Close: { close(); } break; } } }
void RenderingWindowX11::setFullscreen( FullscreenMode fullscreenMode ) { if( fullscreenMode.custom ) throwNotImplemented(); setDimensionsConstraint( {0, 0} ); setFullscreen( true ); ::XMapWindow( _display, _handle ); _fullscreen = true; }
void CursorDropdown::init() { if (_initialized) return; State::init(); setFullscreen(false); if (!_onlyShowIcon) { setModal(true); } showMenu(); }
void X11Window::show() { m_visible = true; XMapWindow(m_display, m_window); XMoveWindow(m_display, m_window, m_position.x, m_position.y); XFlush(m_display); if(m_maximized) maximize(); if(m_fullscreen) setFullscreen(true); }
void RenderingWindowX11::setWindowed( Dimensions windowDimensions ) { setDimensionsConstraint( windowDimensions ); setFullscreen( false ); ::XResizeWindow( _display, _handle, windowDimensions.width, windowDimensions.height ); ::XMapWindow( _display, _handle ); _fullscreen = false; }
void NewGame::init() { if (_initialized) return; State::init(); setFullscreen(true); setModal(true); auto renderer = Game::getInstance()->renderer(); setPosition((renderer->size() - Point(640, 480)) / 2); addUI("background", new UI::Image("art/intrface/pickchar.frm")); auto beginGameButton = addUI(new UI::ImageButton(UI::ImageButton::Type::SMALL_RED_CIRCLE, 81, 322)); beginGameButton->mouseClickHandler().add(std::bind(&NewGame::onBeginGameButtonClick, this, std::placeholders::_1)); auto editButton = addUI(new UI::ImageButton(UI::ImageButton::Type::SMALL_RED_CIRCLE, 436, 319)); editButton->mouseClickHandler().add(std::bind(&NewGame::onEditButtonClick, this, std::placeholders::_1)); auto createButton = addUI(new UI::ImageButton(UI::ImageButton::Type::SMALL_RED_CIRCLE, 81, 424)); createButton->mouseClickHandler().add(std::bind(&NewGame::onCreateButtonClick, this, std::placeholders::_1)); auto backButton = addUI(new UI::ImageButton(UI::ImageButton::Type::SMALL_RED_CIRCLE, 461, 424)); backButton->mouseClickHandler().add(std::bind(&NewGame::onBackButtonClick, this, std::placeholders::_1)); auto prevCharacterButton = addUI(new UI::ImageButton(UI::ImageButton::Type::LEFT_ARROW, 292, 320)); prevCharacterButton->mouseClickHandler().add(std::bind(&NewGame::onPrevCharacterButtonClick, this, std::placeholders::_1)); auto nextCharacterButton = addUI(new UI::ImageButton(UI::ImageButton::Type::RIGHT_ARROW, 318, 320)); nextCharacterButton->mouseClickHandler().add(std::bind(&NewGame::onNextCharacterButtonClick, this, std::placeholders::_1)); addUI("images", new UI::ImageList({ "art/intrface/combat.frm", "art/intrface/stealth.frm", "art/intrface/diplomat.frm" }, 27, 23)); addUI("name", new UI::TextArea(300, 40)); addUI("stats_1", new UI::TextArea(0, 70)); getTextArea("stats_1")->setWidth(362); getTextArea("stats_1")->setHorizontalAlign(UI::TextArea::HorizontalAlign::RIGHT); addUI("stats_2", new UI::TextArea(374, 70)); addUI("bio", new UI::TextArea(437, 40)); addUI("stats_3", new UI::TextArea(294, 150)); getTextArea("stats_3")->setWidth(85); getTextArea("stats_3")->setHorizontalAlign(UI::TextArea::HorizontalAlign::RIGHT); addUI("stats3_values", new UI::TextArea(383, 150)); }
void ExitConfirmState::init() { if (_initialized) return; State::init(); setModal(true); setFullscreen(false); auto background = new Image("art/intrface/lgdialog.frm"); auto backgroundX = (Game::getInstance()->renderer()->width() - background->width())*0.5; auto backgroundY = (Game::getInstance()->renderer()->height() - background->height())*0.5; auto box1 = new Image("art/intrface/donebox.frm"); auto box2 = new Image("art/intrface/donebox.frm"); box1->setX(backgroundX+38); box1->setY(backgroundY+98); box2->setX(backgroundX+170); box2->setY(backgroundY+98); auto yesButton = new ImageButton(ImageButton::TYPE_SMALL_RED_CIRCLE, backgroundX+50, backgroundY+102); auto noButton = new ImageButton(ImageButton::TYPE_SMALL_RED_CIRCLE, backgroundX+183, backgroundY+102); yesButton->addEventHandler("mouseleftclick", this, (EventRecieverMethod) &ExitConfirmState::onYesButtonClick); noButton->addEventHandler("mouseleftclick", this, (EventRecieverMethod) &ExitConfirmState::onNoButtonClick); // label: Are you sure you want to quit? auto msg = ResourceManager::msgFileType("text/english/game/misc.msg"); auto font = ResourceManager::font("font1.aaf", 0xb89c28ff); auto quitLabel = new TextArea(msg->message(0), backgroundX+30, backgroundY+52); quitLabel->setFont(font)->setWidth(244)->setHorizontalAlign(TextArea::HORIZONTAL_ALIGN_CENTER); // label: yes & no auto msg2 = ResourceManager::msgFileType("text/english/game/dbox.msg"); auto fontBig = ResourceManager::font("font3.aaf", 0xb89c28ff); // label: yes 101 auto yesButtonLabel = new TextArea(msg2->message(101), backgroundX+74, backgroundY+101); yesButtonLabel->setFont(fontBig); // label: no 102 auto noButtonLabel = new TextArea(msg2->message(102), backgroundX+204, backgroundY+101); noButtonLabel->setFont(fontBig); background->setX(backgroundX); background->setY(backgroundY); addUI(background); addUI(box1); addUI(box2); addUI(yesButton); addUI(noButton); addUI(quitLabel); addUI(yesButtonLabel); addUI(noButtonLabel); }
void ZLEwlApplicationWindow::init() { ZLDesktopApplicationWindow::init(); switch (myWindowStateOption.value()) { case NORMAL: break; case FULLSCREEN: setFullscreen(true); break; case MAXIMIZED: break; } }
/** Updates the game states, and sets the view to match the window size every frame */ void App::update() { statemanager.update(); if (inputmanager.isKeyHit(sf::Keyboard::F4)) { setFullscreen(!m_fullscreen); } sf::View view(sf::FloatRect(0.f, 0.f, static_cast<float>(window.getSize().x), static_cast<float>(window.getSize().y))); view.setCenter(window.getView().getCenter()); window.setView(view); }
void Window::graphicsSettings() { if (fullScreen_) { //Sets our screen to fullscreen setFullscreen(sdlWindow, SDL_WINDOW_FULLSCREEN); } if (borderlessWin_) { //Sets window to be borderless setBorderless(sdlWindow, SDL_FALSE); } }
void Credits::init() { if (_initialized) return; State::init(); setModal(true); setFullscreen(true); Game::getInstance()->mouse()->pushState(Mouse::NONE); auto renderer = Game::getInstance()->renderer(); setX((renderer->width() - 640)*0.5); setY(renderer->height()); auto credits = ResourceManager::datFileItem("text/english/credits.txt"); std::stringstream ss; credits->setPosition(0); ss << credits; std::string line; auto font_default = ResourceManager::font("font4.aaf", 0x907824ff); auto font_at = ResourceManager::font("font3.aaf", 0x706050ff); auto font_hash = ResourceManager::font("font4.aaf", 0x8c8c84ff); int y = 0; while (std::getline(ss, line)) { auto cur_font = font_default; if (line.find('\r')!=std::string::npos) line.erase(line.find('\r')); if (line[0]=='#') { line.erase(line.begin()); cur_font = font_hash; } else if (line[0]=='@') { line.erase(line.begin()); cur_font = font_at; } else if (line.empty()) { line = " "; } auto tx = new TextArea(line,0,y); tx->setFont(cur_font)->setWidth(640)->setHorizontalAlign(TextArea::HORIZONTAL_ALIGN_CENTER); addUI(tx); _lines.push_back(tx); y+=tx->height(); } _lastTicks=SDL_GetTicks(); }
DXDisplay::~DXDisplay() { setFullscreen(false); Memory::deleteDynamicMapContainer(constantBuffers_); Memory::deleteDynamicMapContainer(rasterizerStates_); Memory::deleteDynamicMapContainer(samplerStates_); Memory::deleteDynamicMapContainer(blendStates_); Memory::deleteDynamicMapContainer(depthStencilStates_); Memory::deleteDynamicMapContainer(renderTargetViews_); Memory::deleteDynamicMapContainer(renderers_); Memory::deleteDynamicMapContainer(depthStencilViews_); Memory::deleteDynamicMapContainer(renderPasses_); Memory::deleteDynamicMapContainer(textures_); }
Director::Director() : p_runningScene (NULL) , p_appdelegate (NULL) , p_nextScene (NULL) , p_notificationNode (NULL) , p_hud (NULL) , m_resourcesFactor (1) , m_glConfig () , m_animationInterval ( 1.0f / kFZ_FPS_DEFAULT ) , m_projection (kFZProjectionDefault) , m_resizeMode (kFZResizeMode_Fit) , m_orientation (kFZOrientation_Auto) , m_autoOrientation (kFZOrientation_All) , m_displayFPS (false) , m_frames (0) , m_isInitialized (false) , m_isRunning (false) , m_isPaused (false) , m_dirtyFlags (true) , m_clearColor (0, 0, 0.09f) , m_screenFactor (1) , m_screenSize (FZSizeZero) , m_canvasSize (FZSizeZero) , m_windowSize (FZSizeZero) , m_renderingRect (FZRectZero) { printf("FORZE ENGINE 0.0.99 \n"); // RANDOM STUFF srand(time(NULL)); srand48(time(NULL)); srandom(time(NULL)); // INITIALIZE MATRIX STACK MS::initialize(); // GET SCREEN SIZE fzDevice_getScreenSize(&m_screenSize, &m_screenFactor); #ifndef FZ_OS_DESKTOP // if the OS is not a desktop OS, then the default window size // is equal to the screen size. -> we call setFullscreen() setFullscreen(); #else setOrientation(kFZOrientation_Portrait); #endif }
void PlayerEditAge::init() { if (_initialized) return; State::init(); setFullscreen(false); setModal(true); Point backgroundPos = Point((Game::getInstance()->renderer()->size() - Point(640, 480)) / 2); int backgroundX = backgroundPos.x(); int backgroundY = backgroundPos.y(); auto bg = new UI::Image("art/intrface/charwin.frm"); bg->setPosition(backgroundPos + Point(160, 0)); auto ageBox = new UI::Image("art/intrface/agebox.frm"); ageBox->setPosition(backgroundPos + Point(168, 10)); auto doneBox = new UI::Image("art/intrface/donebox.frm"); doneBox->setPosition(backgroundPos + Point(175, 40)); auto decButton = new UI::ImageButton(UI::ImageButton::Type::LEFT_ARROW, backgroundX+178, backgroundY+14); decButton->mouseClickHandler().add(std::bind(&PlayerEditAge::onDecButtonClick, this, std::placeholders::_1)); auto incButton = new UI::ImageButton(UI::ImageButton::Type::RIGHT_ARROW, backgroundX+262, backgroundY+14); incButton->mouseClickHandler().add(std::bind(&PlayerEditAge::onIncButtonClick, this, std::placeholders::_1)); auto doneButton= new UI::ImageButton(UI::ImageButton::Type::SMALL_RED_CIRCLE, backgroundX+188, backgroundY+43); doneButton->mouseClickHandler().add(std::bind(&PlayerEditAge::onDoneButtonClick, this, std::placeholders::_1)); auto doneLabel = new UI::TextArea(_t(MSG_EDITOR, 100), backgroundX+210, backgroundY+43); doneLabel->setFont("font3.aaf", {0xb8, 0x9c, 0x28, 0xff}); _counter = new UI::BigCounter(backgroundX+215, backgroundY+13); _counter->setNumber(Game::getInstance()->player()->age()); addUI(bg); addUI(ageBox); addUI(doneBox); addUI(incButton); addUI(decButton); addUI(doneLabel); addUI(doneButton); addUI(_counter); }
void PlayerEditGender::init() { if (_initialized) return; State::init(); setFullscreen(false); setModal(true); Point bgPos = Point((Game::getInstance()->renderer()->size() - Point(640, 480)) / 2); int bgX = bgPos.x(); int bgY = bgPos.y(); auto bg = new UI::Image("art/intrface/charwin.frm"); bg->setPosition(bgPos + Point(236, 0)); _maleImage = new UI::ImageList((std::vector<std::string>){ "art/intrface/maleoff.frm", "art/intrface/maleon.frm" }, bgX+260, bgY+2); _maleImage->addEventHandler("mouseleftclick", [this](Event::Event* event){ this->onMaleButtonPress(dynamic_cast<Event::Mouse*>(event)); }); _femaleImage = new UI::ImageList((std::vector<std::string>){ "art/intrface/femoff.frm", "art/intrface/femon.frm" }, bgX+310, bgY+2); _femaleImage->addEventHandler("mouseleftclick", [this](Event::Event* event){ this->onFemaleButtonPress(dynamic_cast<Event::Mouse*>(event)); }); auto doneBox = new UI::Image("art/intrface/donebox.frm"); doneBox->setPosition(bgPos + Point(250, 42)); auto doneLabel = new UI::TextArea(_t(MSG_EDITOR, 100), bgX+281, bgY+45); auto font3_b89c28ff = ResourceManager::getInstance()->font("font3.aaf", 0xb89c28ff); doneLabel->setFont(font3_b89c28ff); auto doneButton = new UI::ImageButton(UI::ImageButton::Type::SMALL_RED_CIRCLE, bgX+260, bgY+45); doneButton->addEventHandler("mouseleftclick", [this](Event::Event* event){ this->onDoneButtonClick(dynamic_cast<Event::Mouse*>(event)); }); addUI(bg); addUI(doneBox); addUI(doneButton); addUI(doneLabel); addUI(_maleImage); addUI(_femaleImage); setGender(Game::getInstance()->player()->gender()); }
void ApplicationController::keyPressed(oak::Window* window, unsigned char key, int x, int y) { UNUSED(window); UNUSED(x); UNUSED(y); switch(key) { case 'q': _app->exit(0); break; case 'f': setFullscreen(!_config.fullscreen); break; case 'v': setVSyncOn(!_config.vsyncOn); break; case 'p': setAnimatingOn(!_config.animatingOn); break; case 'h': setHelpVisible(!_config.helpVisible); break; case 't': setUseTessellation(!_config.useTessellation); break; case 'r': setRandomSplines(true); break; case 's': setRandomSplines(false); break; case 'c': setContinuityConstraint((oak::SplineContinuityConstraint)(((int)_config.constraint + 1) % 3)); break; case 'z': setCurvesCount(nextCurveCount(_config.curvesCount, -1)); break; case 'x': setCurvesCount(nextCurveCount(_config.curvesCount, +1)); break; default: break; } }