Post tutorial RSS How to get your logo on the main menu - Source Modding Tutorials #1

Welcome to the first guide in Source Modding Tutorials! This guide will show you how you can get your logo onto your Source game's main menu. This tutorial will be in more detail than Valve's on their developer wiki.

Posted by on - Intermediate Client Side Coding

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:

Step 0: Create your image (optional)

You can create your logo easily. I recommend:

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\logoAfter 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!

Comments
Nejby
Nejby

didn't really worked :/
a video tutorial would be really helpful

Reply Good karma Bad karma+1 vote
Nejby
Nejby

the second step is a bit confusing for me

Reply Good karma Bad karma+1 vote
Nejby
Nejby

nvm everything works

Reply Good karma Bad karma+1 vote
Post a comment
Sign in or join with:

Only registered members can share their thoughts. So come on! Join the community today (totally free - or sign in with your social account on the right) and join in the conversation.