Commit dcf88f22 authored by fallenstardust's avatar fallenstardust

调整wMainMenu布局

parent fd6ac022
...@@ -207,6 +207,7 @@ bool Game::Initialize() { ...@@ -207,6 +207,7 @@ bool Game::Initialize() {
adFont = irr::gui::CGUITTFont::createTTFont(driver, dataManager.FileSystem, gameConf.numfont, (int)12 * yScale, isAntialias, false); adFont = irr::gui::CGUITTFont::createTTFont(driver, dataManager.FileSystem, gameConf.numfont, (int)12 * yScale, isAntialias, false);
lpcFont = irr::gui::CGUITTFont::createTTFont(driver, dataManager.FileSystem, gameConf.numfont, (int)48 * yScale, isAntialias, true); lpcFont = irr::gui::CGUITTFont::createTTFont(driver, dataManager.FileSystem, gameConf.numfont, (int)48 * yScale, isAntialias, true);
guiFont = irr::gui::CGUITTFont::createTTFont(driver, dataManager.FileSystem, gameConf.textfont, (int)gameConf.textfontsize * yScale, isAntialias, true); guiFont = irr::gui::CGUITTFont::createTTFont(driver, dataManager.FileSystem, gameConf.textfont, (int)gameConf.textfontsize * yScale, isAntialias, true);
titleFont = irr::gui::CGUITTFont::createTTFont(driver, dataManager.FileSystem, gameConf.textfont, (int)30 * yScale, isAntialias, true);
textFont = guiFont; textFont = guiFont;
if(!numFont || !textFont) { if(!numFont || !textFont) {
os::Printer::log("add font fail "); os::Printer::log("add font fail ");
...@@ -218,19 +219,45 @@ bool Game::Initialize() { ...@@ -218,19 +219,45 @@ bool Game::Initialize() {
newskin->setFont(textFont); newskin->setFont(textFont);
env->setSkin(newskin); env->setSkin(newskin);
newskin->drop(); newskin->drop();
#ifdef _IRR_ANDROID_PLATFORM_
//main menu //main menu
wchar_t strbuf[256]; wchar_t strbuf[256];
myswprintf(strbuf, L"YGOPro Version:%X.0%X.%X", PRO_VERSION >> 12, (PRO_VERSION >> 4) & 0xff, PRO_VERSION & 0xf); myswprintf(strbuf, L"YGOPro Version:%X.0%X.%X", PRO_VERSION >> 12, (PRO_VERSION >> 4) & 0xff, PRO_VERSION & 0xf);
#ifdef _IRR_ANDROID_PLATFORM_ wMainMenu = env->addWindow(rect<s32>(450 * xScale, 40 * yScale, 900 * xScale, 600 * yScale), false, strbuf);
wMainMenu = env->addWindow(rect<s32>(370 * xScale, 150 * yScale, 650 * xScale, 465 * yScale), false, strbuf);
wMainMenu->getCloseButton()->setVisible(false); wMainMenu->getCloseButton()->setVisible(false);
btnLanMode = env->addButton(rect<s32>(15 * xScale, 30 * yScale, 265 * xScale, 80 * yScale), wMainMenu, BUTTON_LAN_MODE, dataManager.GetSysString(1200)); wMainMenu->setDrawBackground(false);
btnSingleMode = env->addButton(rect<s32>(15 * xScale, 85 * yScale, 265 * xScale, 135 * yScale), wMainMenu, BUTTON_SINGLE_MODE, dataManager.GetSysString(1201)); btnLanMode = env->addButton(rect<s32>(15 * xScale, 30 * yScale, 415 * xScale, 106 * yScale), wMainMenu, BUTTON_LAN_MODE, dataManager.GetSysString(1200));
btnReplayMode = env->addButton(rect<s32>(15 * xScale, 140 * yScale, 265 * xScale, 190 * yScale), wMainMenu, BUTTON_REPLAY_MODE, dataManager.GetSysString(1202)); btnLanMode->setUseAlphaChannel(true);
btnDeckEdit = env->addButton(rect<s32>(15 * xScale, 195 * yScale, 265 * xScale, 245 * yScale), wMainMenu, BUTTON_DECK_EDIT, dataManager.GetSysString(1204)); //btnLanMode->setDrawBorder(false);
btnModeExit = env->addButton(rect<s32>(15 * xScale, 250 * yScale, 265 * xScale, 300 * yScale), wMainMenu, BUTTON_MODE_EXIT, dataManager.GetSysString(1210)); btnLanMode->setImage(imageManager.tTitleBar);
btnLanMode->setOverrideFont(titleFont);
//lan mode env->addStaticText(strbuf, rect<s32>(75 * xScale, 35 * yScale, 300 * xScale, 65 * yScale), false, false, wMainMenu);
btnSingleMode = env->addButton(rect<s32>(15 * xScale, 110 * yScale, 415 * xScale, 186 * yScale), wMainMenu, BUTTON_SINGLE_MODE, dataManager.GetSysString(1201));
btnSingleMode->setUseAlphaChannel(true);
btnSingleMode->setDrawBorder(false);
btnSingleMode->setImage(imageManager.tTitleBar);
btnSingleMode->setOverrideFont(titleFont);
btnReplayMode = env->addButton(rect<s32>(15 * xScale, 190 * yScale, 415 * xScale, 266 * yScale), wMainMenu, BUTTON_REPLAY_MODE, dataManager.GetSysString(1202));
btnReplayMode->setUseAlphaChannel(true);
btnReplayMode->setDrawBorder(false);
btnReplayMode->setImage(imageManager.tTitleBar);
btnReplayMode->setOverrideFont(titleFont);
btnDeckEdit = env->addButton(rect<s32>(15 * xScale, 270 * yScale, 415 * xScale, 346 * yScale), wMainMenu, BUTTON_DECK_EDIT, dataManager.GetSysString(1204));
btnDeckEdit->setUseAlphaChannel(true);
btnDeckEdit->setDrawBorder(false);
btnDeckEdit->setImage(imageManager.tTitleBar);
btnDeckEdit->setOverrideFont(titleFont);
btnSettings = env->addButton(rect<s32>(15 * xScale, 350 * yScale, 415 * xScale, 426 * yScale), wMainMenu, BUTTON_SETTINGS, dataManager.GetSysString(1273));
btnSettings->setUseAlphaChannel(true);
btnSettings->setDrawBorder(false);
btnSettings->setImage(imageManager.tTitleBar);
btnSettings->setOverrideFont(titleFont);
btnModeExit = env->addButton(rect<s32>(15 * xScale, 430 * yScale, 415 * xScale, 506 * yScale), wMainMenu, BUTTON_MODE_EXIT, dataManager.GetSysString(1210));
btnModeExit->setUseAlphaChannel(true);
btnModeExit->setDrawBorder(false);
btnModeExit->setImage(imageManager.tTitleBar);
btnModeExit->setOverrideFont(titleFont);
//lan mode
wLanWindow = env->addWindow(rect<s32>(200 * xScale, 80 * yScale, 820 * xScale, 590 * yScale), false, dataManager.GetSysString(1200)); wLanWindow = env->addWindow(rect<s32>(200 * xScale, 80 * yScale, 820 * xScale, 590 * yScale), false, dataManager.GetSysString(1200));
wLanWindow->getCloseButton()->setVisible(false); wLanWindow->getCloseButton()->setVisible(false);
wLanWindow->setVisible(false); wLanWindow->setVisible(false);
......
...@@ -251,6 +251,7 @@ public: ...@@ -251,6 +251,7 @@ public:
irr::gui::CGUITTFont* numFont; irr::gui::CGUITTFont* numFont;
irr::gui::CGUITTFont* adFont; irr::gui::CGUITTFont* adFont;
irr::gui::CGUITTFont* lpcFont; irr::gui::CGUITTFont* lpcFont;
irr::gui::CGUITTFont* titleFont;
std::map<irr::gui::CGUIImageButton*, int> imageLoading; std::map<irr::gui::CGUIImageButton*, int> imageLoading;
//card image //card image
irr::gui::IGUIStaticText* wCardImg; irr::gui::IGUIStaticText* wCardImg;
...@@ -314,6 +315,7 @@ public: ...@@ -314,6 +315,7 @@ public:
irr::gui::IGUIButton* btnReplayMode; irr::gui::IGUIButton* btnReplayMode;
irr::gui::IGUIButton* btnTestMode; irr::gui::IGUIButton* btnTestMode;
irr::gui::IGUIButton* btnDeckEdit; irr::gui::IGUIButton* btnDeckEdit;
irr::gui::IGUIButton* btnSettings;
irr::gui::IGUIButton* btnModeExit; irr::gui::IGUIButton* btnModeExit;
//lan //lan
irr::gui::IGUIWindow* wLanWindow; irr::gui::IGUIWindow* wLanWindow;
......
...@@ -40,6 +40,7 @@ bool ImageManager::Initial(const path dir) { ...@@ -40,6 +40,7 @@ bool ImageManager::Initial(const path dir) {
tPlay = driver->getTexture((dir + path("/textures/extra/tplay.png")).c_str()); tPlay = driver->getTexture((dir + path("/textures/extra/tplay.png")).c_str());
tTalk = driver->getTexture((dir + path("/textures/extra/ttalk.png")).c_str()); tTalk = driver->getTexture((dir + path("/textures/extra/ttalk.png")).c_str());
tShut = driver->getTexture((dir + path("/textures/extra/tshut.png")).c_str()); tShut = driver->getTexture((dir + path("/textures/extra/tshut.png")).c_str());
tTitleBar = driver->getTexture((dir + path("/textures/extra/stitlebar.png")).c_str());
if(!tBackGround_menu) if(!tBackGround_menu)
tBackGround_menu = tBackGround; tBackGround_menu = tBackGround;
tBackGround_deck = driver->getTexture((dir + path("/textures/bg_deck.jpg")).c_str()); tBackGround_deck = driver->getTexture((dir + path("/textures/bg_deck.jpg")).c_str());
......
...@@ -61,6 +61,7 @@ public: ...@@ -61,6 +61,7 @@ public:
irr::video::ITexture* tPlay; irr::video::ITexture* tPlay;
irr::video::ITexture* tTalk; irr::video::ITexture* tTalk;
irr::video::ITexture* tShut; irr::video::ITexture* tShut;
irr::video::ITexture* tTitleBar;
std::list<std::string> support_types; std::list<std::string> support_types;
}; };
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment