Difference between revisions of "NML:Graphics"

From GRFSpecs
Jump to navigationJump to search
(add nav template)
(redirect to item page)
 
Line 1: Line 1:
  +
#REDIRECT [[NML:Item]]
{{NMLNavBlocksyntax}}
 
 
A graphics block must be placed in an item-block. It allows to define the graphics for a particular item, as well as various callbacks. Callbacks are used to define various things at run time, based on information (variables) of the item itself. This provides a much greater degree of flexibility than setting properties. An example (using fictional callback names):
 
 
<pre style="color:blue">
 
graphics {
 
callback_a: switch_a;
 
callback_b: return 42 + some_var;
 
default: some_spritegroup;
 
}
 
</pre>
 
 
The callbacks that are available differ per feature, refer to the feature-specific pages for more information. The 'default'-callback is usually used to resolve the graphics. For each callback a return value may be specified, in the same way as for [[NML:Switch| switch-blocks]]. Note that all callbacks have to be defined in a '''single''' graphics-block.
 

Latest revision as of 00:29, 9 September 2011

Redirect to: