From GMod Wiki
surface.GetTextureID( String Texture )
Where is this used?
|Converts the filepath of a texture to a table so it can be used with Surface.SetTexture.|
|Part of Library:||surface|
|BBCode Link:||[b][url=http://wiki.garrysmod.com/?title=Surface.GetTextureID]Surface.GetTextureID [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]|
- The parameter Texture is the material path of the texture that you want to retrieve.
- The file path is relative to the folder "materials". This means you do not have to include "materials/" in the file path.
- The error "Could not find VGui Material" means that a VTF file is missing its VMT file.
- The file extension must not be included.
A texture file is located at garrysmod/materials/custom/my_texture.vtf You would then use the following piece of code to retrieve it: