Hey guys, I recently started working on a new hud to develop my coding skills in glua. Before i continue working on it, I need you guys to tell me how can i use masking on a panel according to a surface.
Just in case you didn’t understand what I’m talking about. Here is what i have:
Here is my problem:
And here is the result I am intending to achieve:
The circle is a surface in a painted panel and the DmodelPanel is a child to that panel
So, I would like a clear explanation from A to Z about what do i need to do.
Here is a part of my code just in case you need a clearer idea about the structure:
function HPHud() local hud = vgui.Create('DPanel') --skipped some code function hud:Paint(w, h) -- skipped more code --function that will draw the circle using drawpoly drawCircledBox(false, padw ,padh, 0, radius - 7, 360, nil, nil, Color(0,0,0,255), nil) end local plymod = vgui.Create('DModelPanel', hud) -- skip skip skip function plymod:LayoutEntity(ent) --skip some more end function plymod.Entity:GetPlayerColor() return pl:GetPlayerColor() end -- skipped more code relate to the eyepos end