Ive noticed a "delay" of some sort when parent.mod is being called upon "onCreated".
PHP Code:
//#CLIENTSIDE
function onCreated()
{
new GuiWindowCtrl("ChatWindow_Main") {
width = 200, height = 400;
x = screenwidth/2 - width/2, y = screenheight/2 - height/2;
//visible = false;
new GuiMLTextCtrl("ChatWindow_Text") {
width = parent.width - 14, height = parent.height - 30;
x = 8, y = 25;
setText("This is my text!");
}
}
}
When I do that, the width and height of ChatWindow_Text is at default value. However, it works if I do this:
PHP Code:
//#CLIENTSIDE
function onCreated()
{
new GuiWindowCtrl("ChatWindow_Main") {
width = 200, height = 400;
x = screenwidth/2 - width/2, y = screenheight/2 - height/2;
//visible = false;
new GuiMLTextCtrl("ChatWindow_Text") {
width = ChatWindow_Main.width - 14, height = ChatWindow_Main.height - 30;
x = 8, y = 25;
setText("This is my text!");
}
}
}
If I created the GUI first, and then try reading the parent values, they all match up to the proper value.