DImage.SetImage

From GMod Wiki

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



Examples

DescriptionCreate an image of an antlion.
Used onNewerClient.png
Code
// myParent = a panel
myImage = vgui.Create("DImage", myParent)
myImage:SetImage( "VGUI/entities/npc_antlion" )
myImage:SetImageColor( Color(255,0,0,255) ) // make it red.
myImage:SizeToContents() // make the control the same size as the image. 
 
OutputN/A


Additional Notes

See Also

Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox