Layer not found

Towelie

11-04-2011 00:05:05

Hi, i'm new in MyGUI, i'm trying to create Odometer. I've made Layout in LayoutEditor, trying to load it in my project, but it throw exception:

02:48:17 | Core | Error | Layer 'odometer' is not found | ..\..\MyGUI\MyGUIEngine\src\MyGUI_LayerManager.cpp | 154
02:48:17 | Core | Warning | Texture 'arrow.psd' have non power of two size | ..\..\MyGUI\MyGUIEngine\src\MyGUI_TextureUtility.cpp |

But other layout work normaly.

//init MyGUI
mPlatform = new MyGUI::OgrePlatform();
mPlatform->initialise(mRenderWindow, mSceneMgr);
mGui = new MyGUI::Gui();
mGui->initialise();

MyGUI::ResourceManager::getInstance().load("MyGUI_BlackOrangeTheme.xml");
MyGUI::LayoutManager::getInstance().loadLayout("Panel.layout");

//........

MyGUI::LayoutManager::getInstance().loadLayout("Odometer.layout");

mBackground = MyGUI::Gui::getInstance().findWidget<MyGUI::ImageBox> ("SpeedArrow");
mArrow = MyGUI::Gui::getInstance().findWidget<MyGUI::ImageBox> ("adometrBackground");

mBackground->setCoord(x, y, width, height);

Altren

11-04-2011 00:30:40

There's no such layer as "odometer", it is not even possible to write such layer through Layout Editor without changed in it's resources.
Use some common layer, for example "Main".
Also using psd file as texture is bad idea. I thought Ogre doesn't support it. Anyway I recommend you to save your texture in png or dds.

Towelie

11-04-2011 09:44:25

Thx. and how can i create layer and move widget, cauze i can't do it this way. mBackground->setCoord(x, y, 256, 256); Also, is there any way to create widget with reference point (0,0) in the lower left corner or in any other place? but it doesnot work, or is it any solution to set widget position

Altren

11-04-2011 13:38:33

Thx. and how can i create layer and move widget, cauze i can't do it this way. mBackground->setCoord(x, y, 256, 256);I don't get it, what you can't do? Also try setPosition(x, y)
Also, is there any way to create widget with reference point (0,0) in the lower left corner or in any other place? but it doesnot work, or is it any solution to set widget positionUse (window height minus y minus widget's height), something like
int viewHeight = MyGUI::RenderManager::getInstance().getViewSize().height;
widget->setPosition(x, viewHeight - y - widgetHeight);