What you will learn:
- What format to use
- How to convert PNG or JPG to VTF
- What to do when UnlitGeneric code is needed in your VMT.
What you need:
- VTFEdit (click here to download)
- A logo image
- Either Notepad++ or Microsoft Visual Studio Community (official free version by Microsoft)
Step 0: Create your image (optional)
You can create your logo easily. I recommend:
- Photoshop
- GIMP 2 (free, click here to download)
Step 1: Convert to VTF (Valve Texture File)
Open VTFEdit. Click file, and then click Import. Now find your image.
Uncheck Generate Mipmaps and uncheck Generate Normal Map. Click OK.
Click on Options and check Auto create VMT file. Now you can click File > Save as... and save it to:
<YOURMODFOLDER>\materials\vgui\logo
After that, open <NAME OF YOUR LOGO>.vmt. Next, delete the existing code,
then paste this code (make sure you change filename!!)
"UnlitGeneric"
{
// Original shader: BaseTimesVertexColorAlphaBlendNoOverbright
"$translucent" 1
"$basetexture" "VGUI\logo\<YOURLOGONAMEHERE>"
"$vertexcolor" 1
"$vertexalpha" 1
"$no_fullbright" 1
"$ignorez" 1
}
If it reports an error to do with line 9 remove the } (worked with me)
Now your logo is fully converted to UnlitGeneric VTF!
Step 2: Remove the title from gameinfo.txt
We haven't told the game to load the logo yet. Don't load the game yet. Open gameinfo.txt and find:
game "<<YOUR FOLDER NAME>>"
title "<<YOUR TITLE>>"
Replace the word title with gamelogo and your title (INCLUDING THE QUOTATION MARKS!!!!) with 1.
When you launch the game now, your title will be gone, but the logo won't be there just yet.
Step 2½: How to make an RES file
Go to view in windows explorer, go to Folder Options, go to View and then uncheck Hide file extensions and click OK. Now right-click in your folder and click New > text document.
Replace the .txt at the end with .res
Step 3: Write the script
We need to write a script to tell the game how to load the logo. So go to your resource folder, and create a res file called GameLogo. Open it with either Notepad++ or Microsoft Visual Studio, and paste this template (MAKE SURE YOUR CHANGE FILE NAME!! LEAVE THE ... IN!! IT TELLS THE GAME TO GO TO WHERE YOUR LOGO IS SAVED!!!! DO NOT INCLUDE THE FILE EXTENSION!!!!!!!!!!!):
"GameLogo"
{
GameLogo
{
ControlName EditablePanel
fieldName GameLogo
xpos 0
ypos 0
zpos 50
wide 470
tall 200
autoResize 1
pinCorner 0
visible 1
enabled 1
offsetX -20
offsetY -15
}
Logo
{
ControlName ImagePanel
fieldName Logo
xpos 0
ypos 0
zpos 50
wide 470
tall 200
visible 1
enabled 1
image ../vgui/logo/<<YOUR LOGO NAME>>
scaleImage 1
}
}
Now you need to test it by saving your RES file and opening the game.
Did it work?
Tell me in the comments below!
didn't really worked :/
a video tutorial would be really helpful
the second step is a bit confusing for me
nvm everything works
Did not work please help
it worked, thanks man i was looking for a solution for 2 days