DImageButton.SetMaterial

From GMod Wiki

Jump to: navigation, search
Function
Syntax DImageButton:SetMaterial( String image )
Description:
Sets the image to display. Exactly the same as DImageButton.SetImage
Returns: nil
In Object: DImageButton
Realm: NewerClient.png
BBCode Link: [b][url=http://wiki.garrysmod.com/?title=DImageButton.SetMaterial]DImageButton.SetMaterial [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:SetMaterial( "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