NML:Spriteset

From GRFSpecs
Revision as of 00:23, 9 September 2011 by Planetmaker (talk | contribs) (Undo revision 2630 by Planetmaker (Talk) but keep link fix)
Jump to navigationJump to search
Block Syntax

A spriteset associates a name with a number piece of an existing image file and describes the offsets with respect to some origin the graphics will be painted within the game. Different features and situations require that a single set has a certain amount of actual sprites associated. E.g. a vehicle usually requires eight sprites in order to provide on view for each of the eight possible ingame orientations of a vehicle.

spriteset (SPRITESET_NAME, graphics_file) {
	list of realsprites
	...
}

Each sprite may be prefixed with a label, see sprite layouts for more info. Example:

 	some_label: [... real sprite ...]

How to use a sprite set depends on the feature:

  • For canals, cargos, airports (not tiles!) and railtypes, you can refer to sprite sets directly from the graphics block, or use intermediate (random)switches to make a descision.
  • For vehicles, the same as above is possible. However, to facilitate the common case of having multiple loading stages, you can also define sprite groups, see below. These sprite groups are then used in place of a single sprite set.
  • Stations, houses, industry tiles, objects and airport tiles all define the look of a tile. This often requires more than one sprite, for example a concrete ground sprite with a building sprite on top of it. To combine and arrange these sprites a sprite layout is used, directly referring to sprite sets is not possible here
  • Features not mmentioned here have no use for sprite sets, as such they are not supported by NML.