Elspin
10-06-2011 01:34:38
So I'm just trying to create a simple popup window for a login screen and I'm having a strange problem with how the entity is being aligned. I'm not sure if this is a bug or if I'm just misunderstanding how MyGUI does it's relative positioning, but I made a simple window in the layout editor looking like so:

and then copied the relative positions into my code, and at the exact same rendering settings and resolution this came out:

the code for the window is here:
Is this just a bug with 3.0.1, or have I done something wrong here that I just can't find?
and then copied the relative positions into my code, and at the exact same rendering settings and resolution this came out:
the code for the window is here:
MyGUI::WindowPtr mainMenu = mGUI->findWidget<MyGUI::Window>("MainMenu");
MyGUI::WindowPtr loginWindow = mainMenu->createWidgetReal<MyGUI::Window>("WindowCSX", 0.5-.2, 0.5-.1, 0.4, 0.2, MyGUI::Align::Default, "LoginWindow");
loginWindow->setCaption("Login Details");
MyGUI::StaticTextPtr usernameText = loginWindow->createWidgetReal<MyGUI::StaticText>("StaticText", 0.026, 0.107, 0.161, 0.185, MyGUI::Align::Default);
usernameText->setCaption("Username:");
MyGUI::StaticTextPtr passwordText = loginWindow->createWidgetReal<MyGUI::StaticText>("StaticText", .026, .488, .159, .190, MyGUI::Align::Default);
passwordText->setCaption("Password:");
MyGUI::EditPtr usernameEdit = loginWindow->createWidgetReal<MyGUI::Edit>("Edit", .217, .06, .763, .238, MyGUI::Align::Default, "UsernameEdit");
MyGUI::EditPtr passwordEdit = loginWindow->createWidgetReal<MyGUI::Edit>("Edit", .217, .44, .763, .238, MyGUI::Align::Default, "PasswordEdit");
MyGUI::ButtonPtr loginButton = loginWindow->createWidgetReal<MyGUI::Button>("Button", .026, .77, .954, .19, MyGUI::Align::Default, "LoginButton");
loginButton->setCaption("Login");
Is this just a bug with 3.0.1, or have I done something wrong here that I just can't find?