1. Post #1
    r0cky's Avatar
    June 2008
    29 Posts
    Code:
    local hud = surface.GetTextureID( "VGUI/Hud" )
    surface.SetDrawColor( 255, 255, 255, 255 ) 
    surface.SetTexture( hud )
    surface.DrawTexturedRect( 40, ScrH() -552, 512, 512 )
    can anyone tell me why its not finding my texture in the engine it shows pink and black checkered
    the vtf is 512x512 and is DXT5 format
    the texture is located here "garrysmod\gamemodes\<my gamemode>\content\materials\VGUI\"
    my vmt file looks like this and is in the same folder

    Code:
    "unlitgeneric"
    {
        "$basetexture" "Hud"
        "$vertexalpha"    "1"
        "$vertexcolor"     "1"
        "$nolod"        "1"
        "$translucent"    "1"
        "$ignorez"        "1"
    }

  2. Post #2
    diaoyudao shi ZHONGGUO de
    Disseminate's Avatar
    December 2007
    4,040 Posts
    You're sure that the texture is Hud.vtf? Try capitalizing unlitgeneric in the vmt? Restart gmod if you haven't already?

  3. Post #3
    r0cky's Avatar
    June 2008
    29 Posts
    You're sure that the texture is Hud.vtf? Try capitalizing unlitgeneric in the vmt? Restart gmod if you haven't already?
    Unlitgeneric is now captalized restarted gmod several times i noticed most of the other .vtf textures used on vgui are in rgba8888 format so i changed it but still no luck ..im drawing this from a HUDPaint function in shared.lua i just dont know what else to try :/

  4. Post #4
    BastinkaLive's Avatar
    March 2009
    232 Posts
    In the VMT the $basetexture must include the file path in the materials folder. In this case it would be:
    Code:
    "$basetexture" "VGUI/Hud"
    Also make sure capitalization is correct.
    Reply With Quote Edit / Delete Reply United States Show Events Agree Agree x 1 (list)

  5. Post #5
    r0cky's Avatar
    June 2008
    29 Posts
    In the VMT the $basetexture must include the file path in the materials folder. In this case it would be:
    Code:
    "$basetexture" "VGUI/Hud"
    Also make sure capitalization is correct.
    yeah how dumb of me not to notice that also had to change it to
    local hud = Material( "VGUI/Hud" ) for it to work which i tried b4 but it failed cos of that missed file path thanks :)