G.CreateMaterial

From GMod Wiki

Jump to: navigation, search
Function
Syntax CreateMaterial( String material_name, String shader, Table shader_values )
Where is this used?
Description:
Creates a Material clientside.
Returns: Material
Part of Library: Global Functions
Realm: NewerClient.png
BBCode Link: [b][url=http://wiki.garrysmod.com/?title=G.CreateMaterial]G.CreateMaterial [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]



Examples

DescriptionThis is an example how you can create your own Material. Also watch derma/lua/vgui/DImage.lua
Used onNewerClient.png
Code
 
local params = {
	["$basetexture"] = "models/Alyx/emptool_glow",
	["$nodecal"] = 1,
	["$model"] = 1,
	["$additive"] = 1,
	["$nocull"] = 1,
	Proxies = {
		TextureScroll = {
			texturescrollvar = "$basetexturetransform",
			texturescrollrate = 33.3,
			texturescrollangle = 60,
		}
	}
}
local new_material = CreateMaterial("MyMaterial","UnlitGeneric",params);
 
OutputNone


See Also

Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox