• DNotify Dock(TOP) not working?
    1 replies, posted
Hey guys, Ok so I'm trying to make a Notification, and I wanted to make it like, if I send 2 of them, the second would go on the default position and the first one would go under the second one. But what is happening right now is, the first notification stays on the same spot, and even after it disappears the second one will go under the already "dead" first one. This is what I tried till now: [CODE] local Noty = vgui.Create("DNotify") Noty:Dock(TOP) Noty:DockMargin(ScrW()*0.4091, ScrH()*0.12, 0, 0) local NotifyBG = vgui.Create("DPanel", self) NotifyBG:SetPos(ScrW()*0.4091, ScrH()*0.12) NotifyBG:SetSize(300, 1000) NotifyBG:SetBackgroundColor(Color(255, 255, 255, 0)) local Image = vgui.Create("DImage", NotifyBG) Image:SetPos(0, 0) Image:SetSize(32, 32) Image:SetImage("image_example.png") local Text = vgui.Create("DLabel", NotifyBG) Text:SetPos(60, 5) Text:SetSize(260, 30) Text:SetText("Hey") Text:SetTextColor(Color(0, 0, 0, 255)) Text:SetFont("Score") Text:SetWrap(true) self:AddItem(NotifyBG) [/CODE] What am I doing wrong? Thanks in Advance :)
You need to put it inside a parent for docking to work. Create an empty panel to hold the notifications and dock them inside that [editline]18th June 2017[/editline] Optionally you can also dock your empty panel to the HUD [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/Panel/ParentToHUD]Panel:ParentToHUD[/url]
Sorry, you need to Log In to post a reply to this thread.