I’m trying to make a page in spawnmenu with multiple elements in it. I’m using PANEL:Dock () to arrange them, like
loadoutm = vgui.Create ("DPanel", panel)
loadoutm:Dock (TOP)
weapm = vgui.Create ("DPanel", panel)
weapm:Dock (TOP)
But when I’m opening the menu for the first time I see this http://i.imgur.com/PwPGi3A.jpg, on second time I open the spawn menu I do see this http://i.imgur.com/wltkJBL.jpg. On second pic you can see how this script should work. I was experimenting with that for a while, and discovered some odds:
hook.Add ("SpawnMenuOpen", "blablabla", function () print (weapm:GetSize(), "< - >", weapm:GetParent():GetSize())
That script returns “1228 < - > 64 24” first time and “1260 < - > 1260 952” right after. Is there any other way I can arrange elements? Or how to deal with the “parent” size? I’ll appreciate any help, because for now it seems like not using :Dock () is the only right way.