Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- make the grey box
- local Wide = ScrW() / 3
- local Tall = ScrH() / 5
- --[[ Constant offset makes it fall off my screen
- local X = ScrW() - 390
- local Y = ScrH() - 175
- --]]
- local X, Y = ScrW()-Wide, ScrH()-Tall
- hook.Add("HUDPaint", "sunrisedev", function()
- local GOverlay = surface.GetTextureID( "gui/center_gradient" )
- draw.RoundedBox(0, X, Y, Wide, Tall, Color(0,0,0,200))
- surface.SetDrawColor( 100,100,100,255 )
- surface.DrawOutlinedRect( X-0, Y-0, Wide+0, Tall+0 )
- surface.SetTexture( GOverlay )
- surface.SetDrawColor( 150, 150, 150, 75)
- surface.DrawTexturedRect( X, Y, Wide, Tall )
- end)
- local BorderSize = 20
- local ButtonInfo = {
- "VGUI/entities/npc_hunter",
- "VGUI/entities/npc_combine_s",
- "VGUI/entities/npc_metropolice"
- }
- hook.Add("InitPostEntity", "sunrisedev", function()
- local ButtonWide = (Wide - BorderSize * (1 + #ButtonInfo)) / #ButtonInfo
- local ButtonTall = Tall - BorderSize * 2
- for i, bdata in ipairs(ButtonInfo) do
- local btn = vgui.Create("DImageButton")
- btn:SetPos(X + BorderSize * i + ButtonWide * (i-1),
- Y + BorderSize)
- btn:SetSize(ButtonWide, ButtonTall)
- btn:SetMaterial(bdata)
- function btn:DoClick()
- MsgN("Pressed button ", i, ", ", bdata)
- end
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement