Custom Unit Icons: Difference between revisions

From Spring
Jump to navigationJump to search
Line 34: Line 34:
  }
  }


"bitmap" is the location of the custom icon bitmap. If it is missing or incorrect, Spring replaces it with the standard radar dot.
"bitmap" is the location of the custom icon bitmap. If it is missing or incorrect, Spring replaces it with the standard radar dot. The transparent color is black (0,0,0).


"size" is a number that acts multiplier for the icon size. Default is 1.
"size" is a number that acts multiplier for the icon size. Default is 1.

Revision as of 15:20, 24 June 2006

Custom unit icons

What are they?

When you zoom out in Spring, units will get replaced with icons. The default icon is the radar blip, but mod developers have the ability to assign different icons to units. The custom icon information is stored in gamedata/icontypes.tdf.

Icontypes.tdf

The custom icons specification, gamedata/icontypes.tdf, should look like this:

The explosion script is structured like this:

[icontypes]
{
	[default]
	{
		// Spring replaces missing or incorrect bitmaps by the radar  dot.
		size=1;
		radiusadjust=1;
	}
	[type1]
	{
		bitmap=icons/type1.bmp;
		size=2;
		radiusadjust=0;
	}
	[type2]
	{
		bitmap=icons/type2.bmp;
		size=2;
		radiusadjust=0;
	}
	// other type definitions may follow

}

"bitmap" is the location of the custom icon bitmap. If it is missing or incorrect, Spring replaces it with the standard radar dot. The transparent color is black (0,0,0).

"size" is a number that acts multiplier for the icon size. Default is 1.

"radiusadjust" is a boolean (0 or 1) that tells Spring whether or not the icon should scale with the unit radius. Default is 0 (false).

The "default" icon type is a bit special; every unit that misses an 'iconType' tag (see below) or has one that doesn't match a type specified in gamedate/icontypes.tdf gets assigned to the "default" type. If the "default" type is not specified, Spring will create it with the default values.

Icon unit tag

To assign units to a specific icon type, add the following line to their FBI file:

iconType=type1;

You can replace "type1" with icontypes defined in gamedata/icontypes.tdf. If the tag "iconType" is missing, Spring sets it to the icontype "default".