• Derma Images Problem
    6 replies, posted
Hello today im getting some problems with my derma menu every time i try to use my own image( i alredy converted it from png to vtf and created the VMT file) it dont shows the image instead it shows the annoying black and pink squares! this is the code i was using function OPEMNEUH() local DImage2 local DImage1 DImage2 = vgui.Create('DImage') DImage2:SetSize(50, 50) DImage2:SetPos(318, 184) DImage2:SetImage('') DImage2:SizeToContents() DImage1 = vgui.Create('DImage') DImage1:SetSize(209, 308) DImage1:SetPos(7, 59) DImage1:SetImage('materials/menutexture/fondo.vtf') DImage1:SizeToContents() end concommand.Add("openmenuh", OPEMNEUH) material vmt file LightmappedGeneric { $basetexture menutexture\fondo $surfaceprop gravel }
Did you add the material with resource.AddFile? [b][url=http://wiki.garrysmod.com/?title=Resource.AddFile]Resource.AddFile [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b] Also, for your vmt try this: [code] "UnlitGeneric" { "$basetexture" "menutexture\fondo" "$surfaceprop" "gravel" } [/code] And so people can read your code better: [lua]function OPEMNEUH() local DImage2 local DImage1 DImage2 = vgui.Create('DImage') DImage2:SetSize(50, 50) DImage2:SetPos(318, 184) DImage2:SetImage('') DImage2:SizeToContents() DImage1 = vgui.Create('DImage') DImage1:SetSize(209, 308) DImage1:SetPos(7, 59) DImage1:SetImage('materials/menutexture/fondo.vtf') DImage1:SizeToContents() end concommand.Add("openmenuh", OPEMNEUH)[/lua]
yeah i tired using resource.Addfile("my material vmt file and my mat vtf file") but it still dont works
so it would end up like this? DImage1:SetImage('menutexture/fondo')
[lua]function OPEMNEUH() local DImage2 local DImage1 DImage2 = vgui.Create('DImage') DImage2:SetSize(50, 50) DImage2:SetPos(318, 184) DImage2:SetImage('') DImage2:SizeToContents() DImage1 = vgui.Create('DImage') DImage1:SetSize(209, 308) DImage1:SetPos(7, 59) DImage1:SetImage('menutexture/fondo.vtf') DImage1:SizeToContents() end concommand.Add("openmenuh", OPEMNEUH)[/lua] Yes, it would end up like that.
thanks now it works
Sorry, you need to Log In to post a reply to this thread.