ok so i have
local JobPanel = vgui.Create("DButton",MyJobCitizenBar1)
JobPanel:SetDrawOnTop(true)
JobPanel:Dock(LEFT)
JobPanel:SetSize(ScrW()/1.8/3.36363636364+4,ScrH()/8.36363636)
JobPanel:SetPos(0,0)
JobPanel:SetText("")
JobPanel.Paint = function(s,w,h)
draw.RoundedBox(0,0,0,w,h+4,Color(38,44,58,225))
draw.RoundedBox(1,1,0,w-4,h-4,Color(32,38,52,225))
draw.DrawText(v.name,"F4MenuFontBIG",ScrW()/1.8/3.36363636364/2.2,ScrH()/8.36363636/11,Color( 255, 255, 255, 255 ))
draw.DrawText(team.NumPlayers( v['team'] ).."/"..v.max,"F4MenuFontSmall",ScrW()/6.81818181818/1.22222222222,ScrH()/8.36363636/2.2,Color(197,202,208))
end
local JobPanel = vgui.Create("ModelImage",JobPanel)
JobPanel:SetPos(ScrW()/1.8/3.36363636364/11,ScrH()/8.36363636/22)
JobPanel:SetModel(v.model[1])
JobPanel:SetSize(100,100)
witch is all working the quest im trying to ask is how do you set the model-image to allow the button to be pressed under it
i put 2 videos in the description the first one is what i have right now and the issue and second is kind of what im trying to do
https://files.facepunch.com/forum/upload/331536/4df5226f-f0e3-4dfc-be8a-bea66a900d0e/2018-10-21 14-40-54.mp4
https://files.facepunch.com/forum/upload/331536/222e66df-05a5-4177-a979-77108440591a/2018-10-21 14-44-56.mp4
You could make another panel or button on top of that with 0 opacity.
Yep you right i was to caught up on making a specific button work i should of just done that in the first place
I don't understand what you're trying to do but you can try messing about with Panel/SetMouseInputEnabled and/or Panel/SetCursor.
Instead of ModelImage you should use SpawnIcon.
You'll also want to set your SpawnIcon/ModelImage to use a different name than your button.
After this, you can forward the SpawnIcon DoClick to the button like so:
local JobPanel = = vgui.Create( "DButton" );
function JobPanel:DoClick()
-- Do some stuff
end;
local JobIcon = vgui.Create( "SpawnIcon" );
function JobIcon:DoClick()
JobPanel:DoClick()
end;
Sorry, you need to Log In to post a reply to this thread.