DImageButton.SetImage

From GMod Wiki

Jump to: navigation, search
Function
Syntax DImageButton.SetImage( String image )
Description:
Sets the image to display
Returns: nil
In Object: DImageButton
Realm: NewerClient.png
BBCode Link: [b][url=http://wiki.garrysmod.com/?title=DImageButton.SetImage]DImageButton.SetImage [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]



Examples

DescriptionCreates a button with Dr Mossmans face on it.
Used onNewerClient.png
Code
// myParent = a Panel based object.
myButton = vgui.Create("DImageButton", myParent)
myButton:SetImage( "VGUI/entities/npc_mossman" )
myButton:SizeToContents()
myButton.DoClick = function()
        Msg("You clicked the button!\n")
    end
myButton.DoRightClick = function()
        Msg("You right-clicked the button!\n")
    end
 
OutputN/A


See Also

Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox