surface.GetTextureID
From GMod Wiki
Function | |
Syntax |
surface.GetTextureID( String Texture ) Where is this used? |
Description: | |
Converts the filepath of a texture to a table so it can be used with Surface.SetTexture. | |
Returns: | Number |
Part of Library: | surface |
Realm: | |
BBCode Link: | [b][url=http://wiki.garrysmod.com/?title=Surface.GetTextureID]Surface.GetTextureID [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b] |
Examples
Additional Notes
- 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.
Example:
A texture file is located at garrysmod/materials/custom/my_texture.vtf You would then use the following piece of code to retrieve it:
surface.GetTextureID("custom/my_texture")