• materials
    1 replies, posted
I have this addon and I want to use a custom material. I put the vmt and vtf inside addon->materials and my lua file's inside addon->lua->autorun->client : [lua] //using this to draw : render.SetMaterial( Material( "circle" ) ) render.DrawQuadEasy(v:GetPos(), Vector(0, 0, 1), 48, 48, Color( 255, 0, 0 )) [/lua] addon->lua->autorun->server [lua] resource.AddFile("materials/circle.vtf") resource.AddFile("materials/circle.vmt") [/lua] it shows up red but with the blocks and if I use another filepath for the setmaterial it just shows up purple.
Try: [b][url=http://wiki.garrysmod.com/?title=Surface.DrawTexturedRect]Surface.DrawTexturedRect [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b] Also its good optimisation not to use the Material() function inside a Draw function. I recoment just doing: [lua] local Texture = Material( "circle" ) [/lua] then use Texture in your draw function.
Sorry, you need to Log In to post a reply to this thread.