nevarim
26-10-2010 23:27:31
hi all
i have a quesion:
i've to resize indow where is loaded a layout made with mygui, when i launch program the screen is resied with configuration rsolutio (ex 800 * 600) but mygui window is resize al building resolution (1280 * 1024) how can i size window at 800 * 600?
code for call window is here
MyGUI::OgrePlatform* mPlatform = new MyGUI::OgrePlatform();
mPlatform->initialise(mWindow, mSceneMgr); // mWindow is Ogre::RenderWindow*, mSceneManager is Ogre::SceneManager*
mGUI = new MyGUI::Gui();
mGUI->initialise();
MyGUI::LayoutManager::getInstance().load("bc_mainifc.layout");
MyGUI::ButtonPtr CMDPG = mGUI->findWidget<MyGUI::Button>("BG\\CMDPG");
MyGUI::ButtonPtr CMDINV = mGUI->findWidget<MyGUI::Button>("BG\\CMDINV");
MyGUI::ButtonPtr CMDMAG = mGUI->findWidget<MyGUI::Button>("BG\\CMDMAG");
MyGUI::ButtonPtr CMDCOMM = mGUI->findWidget<MyGUI::Button>("BG\\CMDCOMM");
thanks very much
Nevarim
nevarim
27-10-2010 10:04:41
<MyGUI type="Layout">
<Widget type="StaticImage" skin="bc_StaticImage" position="0 0 1280 1024" align="Default" layer="Back" name="BG">
<Property key="Image_Texture" value="bc_interface.png"/>
<Widget type="Button" skin="shield_button_pg" position="48 288 71 91" name="BG\CMDPG"/>
<Widget type="Button" skin="shield_button_inv" position="48 376 71 91" align="Default" name="BG\CMDINV"/>
<Widget type="Button" skin="shield_button_mag" position="48 472 71 91" align="Default" name="BG\CMDMAG"/>
<Widget type="Button" skin="shield_button_comm" position="48 568 71 91" align="Default" name="BG\CMDCOMM"/>
<Widget type="StaticImage" skin="bc_StaticImage" position="840 40 425 85" align="Default" name="BG\QUICKBAR">
<Property key="Image_Texture" value="quickbar.png"/>
</Widget>
<Widget type="Window" skin="bc_chat" position="40 744 448 170" align="Relative" name="BG\CHATSPEAK"/>
<Widget type="Window" skin="bc_chat" position="492 744 452 168" align="Default" name="BG\CHATSYSTEM"/>
<Widget type="StaticImage" skin="bc_StaticImage" position="64 32 132 133" align="Relative" name="BG\MEDAL">
<Property key="Image_Texture" value="medal.png"/>
</Widget>
</Widget>
</MyGUI>
my.name
27-10-2010 23:38:11
widget->setSize(1024, 768);
nevarim
28-10-2010 09:18:38
thanks for reply but if i set widget in layout as 1024, 768 then if i play in a resulution 1280* 1024 the resolution is right(1280,768) or (1024, 768)
the question is
is dynamic with the resolution of screen or is fixed by .layout?
thanks
Nevarim
nevarim
01-11-2010 13:59:39
MyGUI::OgrePlatform* mPlatform = new MyGUI::OgrePlatform();
mPlatform->initialise(mWindow, mSceneMgr); // mWindow is Ogre::RenderWindow*, mSceneManager is Ogre::SceneManager*
mGUI = new MyGUI::Gui();
mGUI->initialise();
MyGUI::Window::setSize(1024, 768);
MyGUI::LayoutManager::getInstance().load("bc_mainifc.layout");
MyGUI::ButtonPtr CMDPG = mGUI->findWidget<MyGUI::Button>("BG\\CMDPG");
MyGUI::ButtonPtr CMDINV = mGUI->findWidget<MyGUI::Button>("BG\\CMDINV");
MyGUI::ButtonPtr CMDMAG = mGUI->findWidget<MyGUI::Button>("BG\\CMDMAG");
MyGUI::ButtonPtr CMDCOMM = mGUI->findWidget<MyGUI::Button>("BG\\CMDCOMM");
i have a problem using this function setsize give me an error during compile, seems that mgui haven't member with setsize inside
Altren
01-11-2010 14:05:51
Ahem, Window is widget type. And setSize is not a static function.
What window you want to resize? If you want to resize Window widget, loaded from layout you should use findWidget function and call setSize for found window.
nevarim
01-11-2010 16:07:31
i don't understand what is the right syntax, i want to use the findwidget in the entire widget, and set the size on it, getting the width given to it by the ogre configuration,
have you hint for to do this?
thanks by a nooby
Nevarim
Altren
01-11-2010 16:35:00
MyGUI::WindowPtr window = mGUI->findWidget<MyGUI::Window>("Window_Widget_Name");
window->setSize(1024, 768);