Hello peeps, im working on a minecraft-ish inventory and I cannot import my .vtf file in lua.
I use this piece of code:
[QUOTE]
DermaImage = vgui.Create( "DImageButton", DermaPanel )
DermaImage:SetPos( 25, 50 )
DermaImage:SetImage( "MY VTF FILE HERE" ) -- Set your .vtf image
DermaImage:SizeToContents()[/QUOTE]
And I got it all valid .vtf file also made a .vmd file and when I put it to its right spot ("C:\Program Files\Steam\steamapps\#NOTSHOWING#\garrysmod\garrysmod\materials\minecraft\inv.vtf") and when I run my lua script the image will just flash with a black background and with some white cross (wireframe like) flashing ontop of the black one?
Ive tried watching some youtube instructions but none help.
All .vtf files need an associated .vmt file.
[url=https://developer.valvesoftware.com/wiki/Creating_a_Material#Creating_a_material]More information here[/url]
Thanks! I will reply if it works or if it doesnt.
[editline]6th March 2012[/editline]
[QUOTE=Nerdeboy;35023714]All .vtf files need an associated .vmt file.
[url=https://developer.valvesoftware.com/wiki/Creating_a_Material#Creating_a_material]More information here[/url][/QUOTE]
It seems not to work. There is a black box (about 10x10 pixels). It doesn't flash or anything. Maybe the LUA is some what wrong? I got it all right like:
[QUOTE]DermaImage = vgui.Create( "DImageButton", DermaPanel )
DermaImage:SetPos( 25, 50 )
DermaImage:SetImage( "mc/mcinv.vtf" ) -- Set your .vtf image
DermaImage:SizeToContents()[/QUOTE]
As far as my experience the LUA seems to be fine.
Get rid of the .vtf extension. It is a material, not a texture.
[i]Yay, 1000th post.[/i]
[QUOTE=Chessnut;35027060]Get rid of the .vtf extension. It is a material, not a texture.
[i]Yay, 1000th post.[/i][/QUOTE]
Okay, but I will reply if it works or not.
Congratulations on your 1000th post :)
[editline]7th March 2012[/editline]
Argh.... It is so annoying. It doesnt work! I wish there was a video for that.
[QUOTE=Holo;35031933]Okay, but I will reply if it works or not.
Congratulations on your 1000th post :)
[editline]7th March 2012[/editline]
Argh.... It is so annoying. It doesnt work! I wish there was a video for that.[/QUOTE]
Is the black supposed to be transparent? If it is:
If you are doing this in Photoshop make a separate alpha set the colors you want to show to white and the others to black. Save it as a png-interlaced then in the Vtf editor, check off Nomipmap and no level of detail. Vmt make it no LOD and thats it.
Sorry, you need to Log In to post a reply to this thread.