Loading

Paste #pjhqp9spl

  1.  
  2. [edit] Positioning
  3.  
  4. How to position the sprite depends on the type of sprite:
  5.  
  6.     ground: Ground sprites cannot be positioned.
  7.     building: A three-dimensional bounding box may be defined. The X-axis runs from top-right to bottom-left and the Y-axis from top-left to bottom-right. Both X and Y are measured in 1/16 length of the the tile border. The Z axis is vertical and measured in pixels. Extending the bounding box over the edges of a tile is possible, but not recommended as it may lead to glitches. Unless you know exactly what you are doing, do not define any offsets or extents, but use NML's defaults. They are most likely exactly what you need. Default values are 0, 0, 0, 16, 16, 16, respectively. In NewGRF developer mode in OpenTTD, it's possible to view the bounding boxes of all sprites by pressing Ctrl+B. In order to use and define a custom bounding box, the following attributes can be used:
  8.         xoffset: Offset from the northwestern edge to the start of the bounding box (X). Unit is 1/16 of the tile border
  9.         yoffset: Offset from the northeastern edge to the start of the bounding box (Y). Unit is 1/16 of the tile border
  10.         zoffset: Offset from the lowest tile corner (with foundation added) to the start of the bounding box (Z). Unit is pixels
  11.         xextent: Size of the bounding box, in the X-direction. Must be a compile-time constant. Unit is 1/16 of the tile border
  12.         yextent: Size of the bounding box, in the Y-direction. Must be a compile-time constant. Unit is 1/16 of the tile border
  13.         zextent: Size of the bounding box, in the Z-direction. Must be a compile-time constant. Unit is pixels
  14.     childsprite: Child sprites may be positioned relative to their 'parent' sprite that defines the bounding box. xoffset and yoffset may be set to specify an offset in pixels between the origin of the parent and child sprite. When the parent sprite is the ground sprite, TTDPatch does not support offsets other than 0,0. Note that all child sprites should fit inside the bounding box of the parent sprite to avoid visual glitches.

Comments