Garry's Mod Wiki

ControlPanel:MatSelect

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

Description

Creates a MatSelect panel and adds it as an item.

Arguments

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.

Returns

1 MatSelect
The created MatSelect panel.