Discord
Steam
/
Developers
/
Derma Parentin..
Login/Join
Event Log
Derma Parenting not working
2 replies, posted
Search
In This Thread
function closepagefunction() if IsValid(mainmenufirstscreenframe) then mainmenufirstscreenframe:Close() end end function mainmenubackground() mainmenubackgroundframe = vgui.Create("DFrame") mainmenubackgroundframe:SetSize(ScrW(),ScrH()) mainmenubackgroundframe:SetPos(0,0) mainmenubackgroundframe:SetVisible(true) mainmenubackgroundframe:MakePopup() mainmenubackgroundframe:SetDraggable(false) mainmenubackgroundframe:ShowCloseButton(true) mainmenubackgroundframe:SetTitle("") mainmenubackgroundframe.Paint = function() draw.RoundedBox(0,0,0,DM.FW:getWSize(mainmenubackgroundframe),DM.FW:getHSize(mainmenubackgroundframe),Color(100,100,100,255)) end mainmenubackgroundframe:MoveToFront() mainmenubackgroundframe:SetDrawOnTop(true) mainmenubackgroundframe:SetMouseInputEnabled(true) mainmenubackgroundframe.OnClose = function() closepagefunction() mainmenubackgroundframe:Remove() end end function mainmenufirstscreenfunction() mainmenufirstscreenframe = vgui.Create("DFrame",mainmenubackgroundframe) mainmenufirstscreenframe:SetSize(ScrW()/3,ScrH()/4*3) mainmenufirstscreenframe:SetPos(ScrW()/2-ScrW()/6,ScrH()/8) mainmenufirstscreenframe:SetVisible(true) mainmenufirstscreenframe:MakePopup() mainmenufirstscreenframe:SetDraggable(false) mainmenufirstscreenframe:ShowCloseButton(true) mainmenufirstscreenframe:SetTitle("") mainmenufirstscreenframe.Paint = function() draw.RoundedBox(0,0,0,DM.FW:getWSize(mainmenufirstscreenframe),DM.FW:getHSize(mainmenufirstscreenframe),Color(255,100,100,255)) end mainmenufirstscreenframe:MoveToFront() mainmenufirstscreenframe:SetDrawOnTop(true) mainmenufirstscreenframe:SetMouseInputEnabled(true) mainmenufirstscreenframe.OnClose = function() mainmenubuttonframe:Close() mainmenufirstscreenframe:Remove() end mainmenubuttonframe = vgui.Create("DFrame" , mainmenufirstscreenframe) mainmenubuttonframe:SetSize(DM.FW:getWSize(mainmenufirstscreenframe) - menumargin * 2,DM.FW:getHSize(mainmenufirstscreenframe) - menumargin * 2) mainmenubuttonframe:SetPos(menumargin, menumargin) mainmenubuttonframe:SetVisible(true) mainmenubuttonframe:MakePopup() mainmenubuttonframe:SetDraggable(false) mainmenubuttonframe:ShowCloseButton(true) mainmenubuttonframe:SetTitle("") mainmenubuttonframe.Paint = function() draw.RoundedBox(0,0,0,DM.FW:getWSize(mainmenubuttonframe),DM.FW:getHSize(mainmenubuttonframe),Color(100,255,100,255)) end mainmenubuttonframe:MoveToFront() mainmenubuttonframe:SetDrawOnTop(true) mainmenubuttonframe:SetMouseInputEnabled(true) end concommand.Add("mainmenu", function() mainmenubackground() mainmenufirstscreenfunction() end) For some reason mainmenubuttonframe doesn't get parented to mainmenufirstscreenframe. Any ideas why?
What does Panel/GetParent return?
Prints the info GetParent would normally print. Weirdly enough works if i turn mainmenubuttonframe into a DButton
Sorry, you need to
Log In
to post a reply to this thread.