G.Material
From GMod Wiki
Function | |
Syntax |
Material( String filepath, String tags ) Where is this used? |
Description: | |
Opens and reads the given filepath and converts into table, to use with material settings such as render.SetMaterial must be a usable format, give filename without an extension to use | |
Returns: | IMaterial , Number |
Part of Library: | Global Functions |
Realm: | |
BBCode Link: | [b][url=http://wiki.garrysmod.com/?title=G.Material]G.Material [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b] |
Examples
Description | This will set the render texture to a texture in a file. |
---|---|
Used on | |
Code | local material = Material ("textures/theimage") render.SetMaterial( material ) |
Output | N/A |
Tags and materials using PNGs are currently available only in Garry's Mod Beta 13 |
Additional Notes
- The filepath is relative to the materials folder.
- The extension of the file is not specified.
- Additionally returns a number, which might be the time it took to load the texture.