Garry's Mod Wiki


  MatSelect ControlPanel:MatSelect( string convar, table options = nil, boolean autostretch = nil, number width = nil, number height = nil )


Creates a MatSelect panel and adds it as an item.


1 string convar
Calls MatSelect:SetConVar with this value.
2 table options = nil
If specified, calls MatSelect:AddMaterial(key, value) for each table entry. If the table key is a number, the function will instead be called with the value as both arguments.
3 boolean autostretch = nil
If specified, calls MatSelect:SetAutoHeight with this value.
4 number width = nil
If specified, calls MatSelect:SetItemWidth with this value.
5 number height = nil
If specified, calls MatSelect:SetItemHeight with this value.


1 MatSelect
The created MatSelect panel.