Root widget's layer is not specified and a cursor problem

optln

17-01-2012 08:29:11

Hello. I get "Root widget's layer is not specified, widget won't be visible. Specify layer or parent or attach it to another widget after load." warning when I try to load layouts that I created with Layout Editor. Do I have to something specific to attach my buttons to root widget?

Here is an example .layout file that gives this warning:
<?xml version="1.0" encoding="UTF-8"?>
<MyGUI type="Layout" version="3.2.0">
<Widget type="Button" skin="Button" position="310 465 404 144">
<Property key="Caption" value="Foo"/>
<Property key="FontHeight" value="30"/>
</Widget>
<CodeGeneratorSettings/>
</MyGUI>


Second question(which could be related to this): My cursor is stuck on the top-left corner of the screen. When I try to move it, it moves one second and returns to the original position. Any thought on why this happens?

Altren

17-01-2012 13:58:06

Hello. I get "Root widget's layer is not specified, widget won't be visible. Specify layer or parent or attach it to another widget after load." warning when I try to load layouts that I created with Layout Editor. Do I have to something specific to attach my buttons to root widget? If you attach your widget you can ignore this warning, but it is better to specify parent widget when loading layout.
VectorWidgetPtr loadLayout(const std::string& _file, const std::string& _prefix = "", Widget* _parent = nullptr);

Second question(which could be related to this): My cursor is stuck on the top-left corner of the screen. When I try to move it, it moves one second and returns to the original position. Any thought on why this happens?I guess you are injecting some wrong values into injectMouseMove, it doesn't depend on MyGUI, so check how you use your input system.