Spawnicon:PaintOver

From GMod Wiki

Jump to: navigation, search
Function
Syntax SpawnIcon.PaintOver( )
Description:
Similar to DPanel.Paint, but draws over the icon.
Returns: nil
In Object: SpawnIcon
Realm: NewerClient.png
BBCode Link: [b][url=http://wiki.garrysmod.com/?title=Spawnicon:PaintOver]Spawnicon:PaintOver [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]


Examples

DescriptionSimilar to DPanel.Paint, but draws over the icon.
Used onNewerClient.png
Code
Icon = vgui.Create( "SpawnIcon", DermaPanel ); -- Create the icon
	Icon:SetIconSize( 64 ); -- Set the size of the button
	Icon:SetPos( 5, 5 ); -- Set the position of the button
	Icon:SetModel( "models/player/Group01/male_01.mdl" ); -- What does the button say (On top)
	Icon.PaintOver = 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, 64, 64 ) -- Paint what coords
end
OutputN/A
Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox