Adding Your Logo to the Menu: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
No edit summary
No edit summary
Line 69: Line 69:
* Logo xpos and ypos seems to set the topleft position of the logo being drawn in the bitmap.
* Logo xpos and ypos seems to set the topleft position of the logo being drawn in the bitmap.


So if Logo width/height is larger than GameLogo width/height, the image will be cropped.
So if Logo width/height is larger than GameLogo width/height, the image will be cropped. Negative values let you crop the top and left of the logo. With the width and height of GameLogo, you could crop the right and bottom.


The idea here is to create your logo inside a vtf, which needs to follow the vtf aspect ratio and size rules. Then you use Logo width and height to scale the vtf, and GameLogo to crop it how you want it.
The idea here is to create your logo inside a vtf, which needs to follow the vtf aspect ratio and size rules. Then you use Logo width and height to scale the vtf, and GameLogo to crop it how you want it.

Revision as of 16:26, 6 August 2025

English (en)Français (fr)Polski (pl)Русский (ru)中文 (zh)Translate (Translate)


TF2's logo (in the original version shown here) is 512x128px.

Instead of displaying your mod's name as a string of characters, you can have a logo image. To do this:

  1. Add gamelogo 1 to the top of gameinfo.txt (same block as game, type, etc.).
  2. Create <mod>\resource\GameLogo.res, a text file, with this template:
Resource/GameLogo.res
{
	GameLogo
	{
		ControlName	EditablePanel
		fieldName	GameLogo
		xpos		0
		ypos		0
		zpos		50
		wide		400
		tall		100
		autoResize	1
		pinCorner	0
		visible		1
		enabled		1
		offsetX		-20
		offsetY		-15
	}

	Logo
	{
		ControlName	ImagePanel
		fieldName	Logo
		xpos		0
		ypos		0
		zpos		50
		wide		400
		tall		100
		visible		1
		enabled		1
		image		../logo/TF2_Logo
		scaleImage	1		
	}
}

The path of the image field is relative to materials\vgui\. As you can see in the example above, the TF2 logo is actually stored in materials\logo\!

Do not include a file extension in the path.

Tip.pngTip:Removing your text from the gameinfo.txt under the name title will remove the font title and will only provide the logo.
Tip.pngTip:When creating your logo, use the UnlitGeneric shader, do not generate mipmaps, and disable LOD.
Tip.pngTip:If your game logo has an alpha channel (transparency) then add "$alphatest" "1" to your game logo's .vmt otherwise it'll look opaque in game.


Draft of some documentation:

  • GameLogo width and height seems to define the "bitmap size" the logo is drawn on
  • Logo width and height seems to define the actual draw size of the logo.
  • GameLogo xpos and ypos doesn't seem to do anything.
  • GameLogo offsetX and offsetY will move the "bitmap" around.
  • Logo xpos and ypos seems to set the topleft position of the logo being drawn in the bitmap.

So if Logo width/height is larger than GameLogo width/height, the image will be cropped. Negative values let you crop the top and left of the logo. With the width and height of GameLogo, you could crop the right and bottom.

The idea here is to create your logo inside a vtf, which needs to follow the vtf aspect ratio and size rules. Then you use Logo width and height to scale the vtf, and GameLogo to crop it how you want it.