change theme on gui init

gmysu

07-11-2011 12:37:39

Hello, I would like to load and apply dark orange theme on gui init, but i dont know how to achieve that. I browsed through sources of themes demo and layout editor but no luck so far. Mb im just blind. Could anyone give me a snippet?

Cheers,
Luke

uberkoch

07-11-2011 12:48:23

you need to pass it as parameter to the initialise() function.
In your case something like this:

m_gui = new MyGUI::Gui();
m_gui->initialise("MyGUI_BlackOrangeCore.xml");


Where MyGUI_BlackOrangeCore.xml is a copy of MyGUI_Core.xml with the MyGUI_BlackOrangeTheme instead of MyGUI_BlueWhiteTheme.

gmysu

07-11-2011 13:08:23

So now I got something like this


mGUI->initialise("core_theme_black_orange_tag.xml");
MyGUI::LayoutManager::getInstance().loadLayout("my_window.layout");


Yet it wont display anything now, not even the deafult skin. Perphaps im passing wrong file into the program? it loads other resources fine.

mygui.log


14:01:31 | Core | Info | Gui successfully initialized | E:\MyGUI3.0\MyGUIEngine\src\MyGUI_Gui.cpp | 129
14:01:31 | Core | Error | Skin 'Panel' not found. Replaced with default skin. | E:\MyGUI3.0\MyGUIEngine\src\MyGUI_SkinManager.cpp | 116
14:01:31 | Core | Error | Layer 'Back' is not found | E:\MyGUI3.0\MyGUIEngine\src\MyGUI_LayerManager.cpp | 154
14:01:31 | Core | Error | Skin 'Edit' not found. Replaced with default skin. | E:\MyGUI3.0\MyGUIEngine\src\MyGUI_SkinManager.cpp | 116
14:01:31 | Core | Error | Skin 'Edit' not found. Replaced with default skin. | E:\MyGUI3.0\MyGUIEngine\src\MyGUI_SkinManager.cpp | 116
14:01:31 | Core | Error | Skin 'Button' not found. Replaced with default skin. | E:\MyGUI3.0\MyGUIEngine\src\MyGUI_SkinManager.cpp | 116
14:01:31 | Core | Error | Skin 'Button' not found. Replaced with default skin. | E:\MyGUI3.0\MyGUIEngine\src\MyGUI_SkinManager.cpp | 116
14:01:31 | Core | Error | Skin 'CheckBox' not found. Replaced with default skin. | E:\MyGUI3.0\MyGUIEngine\src\MyGUI_SkinManager.cpp | 116

uberkoch

07-11-2011 13:35:51

First of all, check my edit of the last post, I was slightly mistaken.

Secondly you are definitely loading the wrong file, but i don't know which file you need as you seem to use MyGUI 3.0, I use 3.2 and the file names have changed. But you can check what the default argument for the initialise() function is and have a look at that file, it should be relatively obvious what you need to change in there.

gmysu

07-11-2011 16:31:26

Thanks to your advice I managed to switch the skin, it was the lame way though. I simply swapped the gui texture in core_theme_tag.xml. Still dont know how to load other gui xmls from within my app & how to build one with proper, custom texture.

Thanks anyway! :)