• Using Derma to call images?
    3 replies, posted
So i have a png image i want to use for GUI but i have no clue how to call it. I used surface.SetMaterial( Material( "menu/menu.png", "no clamp" ) ) for the HuD but how would i use that in a Dmenu?
Make it a vmf/vmt instead of png.
[QUOTE=AutoJuke;46114398]So i have a png image i want to use for GUI but i have no clue how to call it. I used surface.SetMaterial( Material( "menu/menu.png", "no clamp" ) ) for the HuD but how would i use that in a Dmenu?[/QUOTE] Add items to your DMenu, then call SetIcon on the new entry. I went to the wiki to make sure I was going to give a correct example, but it has a decent example anyway. [url]http://wiki.garrysmod.com/page/Category:DMenu[/url]
[QUOTE=wh1t3rabbit;46120337]Add items to your DMenu, then call SetIcon on the new entry. I went to the wiki to make sure I was going to give a correct example, but it has a decent example anyway. [url]http://wiki.garrysmod.com/page/Category:DMenu[/url][/QUOTE] I used DImage and function GM:ShowSpare2( ply ) ply:ConCommand( "ShowMenu" ) end function Menu() Frame = vgui.Create( "DFrame" ) Frame:SetSize( 901, 478 ) Frame:Center() Frame:SetTitle( "" ) local menu_img = vgui.Create( "DImage", Frame ) menu_img:SetPos( 10, 35 ) menu_img:SetSize( 899, 476 ) menu_img:SetImage("materials/vgui/menu.") end concommand.Add( "ShowMenu",Menu ) But when i show the menu its pink and black...... I put resource.AddFile("content/materials/vgui/menu.vmt") resource.AddFile("content/materials/vgui/menu.vtf") in my init.lua and still no luck..... Any advice? (picture of what i get:[url]http://puu.sh/bVOZs/a627d8b74f.jpg[/url])
Sorry, you need to Log In to post a reply to this thread.