- Initiateur de la discussion
~> MrSupergadin <~
Geek
- Messages
- 315
- Score réaction
- 59
- Points
- 70
Tout est dans le titre
Code:
local Button = vgui.Create( "DButton", frame )
Button:SetText( "X" )
Button:SetSize( 40, 20)
Button.DoClick = function()
frame:Close()
end
Button.Paint = function(self, w, h)
local bcol
if self.Hovered then
bcol = Color( 238, 0, 0, 250 )
else
bcol = Color( 238, 0, 0, 150 )
end
draw.RoundedBox(0, 0, 0, w, h, bcol)
surface.SetDrawColor( 0, 0, 0 )
surface.DrawOutlinedRect( 0, 0, w, h )
end
Button.OnCursorEntered = function(self)
self.hover = true
end
Button.OnCursorExited = function(self)
self.hover = false
end