surface.SetMaterial

From GMod Wiki

Jump to: navigation, search
Function
Syntax surface.SetMaterial( Material material object )
Where is this used?
Description:
Sets the material for all images drawn in its function until you set the material again.
Returns: nil
Part of Library: surface
Realm: NewerClient.png
BBCode Link: [b][url=http://wiki.garrysmod.com/?title=Surface.SetMaterial]Surface.SetMaterial [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]


Examples

DescriptionExample.
Used onNewerClient.png
Code
 
surface.SetDrawColor( 255, 255, 255, 255 ) 
surface.SetMaterial( Material( "vgui/hud_pv" ) )
surface.DrawTexturedRect( ScrW() * 0.5, ScrH() * 0.5, 50, 50 ) 
OutputN/A


See Also

Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox