DButton.SetImage

From GMod Wiki

Jump to: navigation, search
Function
Syntax DButton.SetImage( Image )
Description:
This could be compared to a DImageButton, you input a image, and it will be created ontop of the button. Just like a DImageButton would. Input a "" string to remove the image.
Returns: nil
In Object: DButton
Realm: NewerClient.png
BBCode Link: [b][url=http://wiki.garrysmod.com/?title=DButton.SetImage]DButton.SetImage [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]



Examples

DescriptionCreates a button to add a bot.
Used onNewerClient.png
Code
 
local bot = vgui.Create("DButton")
bot:SetPos(50, 50)
bot:SetSize(70, 22)
bot:SetText("Add bot")
bot:SetImage("gui/silkicons/add")
bot.DoClick = function () RunConsoleCommand("bot") end
 
OutputA button with a (+) image and text "Add bot" in the left top corner of the screen.
Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox