DButton.Paint

From GMod Wiki

Jump to: navigation, search
Function
Syntax DButton.Paint( )
Description:
Adds color to your buttons.
Returns: nil
In Object: DButton
Realm: NewerClient.png
BBCode Link: [b][url=http://wiki.garrysmod.com/?title=DButton.Paint]DButton.Paint [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]


Examples

DescriptionAdds color to your buttons.
Used onNewerClient.png
Code
InfoPanel = vgui.Create( "DButton", DermaPanel ); -- Create the button
	InfoPanel:SetSize( 100, 30 ); -- Set the size of the button
	InfoPanel:SetPos( 50, 30 ); -- Set the position of the button
	InfoPanel:SetText( "Information" ); -- What does the button say (On top)
	InfoPanel.Paint = function() -- The paint function
    surface.SetDrawColor( 68, 87, 101, 255 ) -- What color do You want to paint the button (R, B, G, A)
    surface.DrawRect( 0, 0, InfoPanel:GetWide(), InfoPanel:GetTall() ) -- Paint what coords (Used a function to figure that out)
end
OutputN/A
Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox