Advertisement
henke37

Tiled metatile extension

Jun 30th, 2014
495
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.29 KB | None | 0 0
  1. <metatile>
  2. Defines a metatile: a section of tiles that should be placed together. It can be seen as a tilemap that can be stamped onto another tilemap.
  3.  
  4. *probability: Same as for <tile>
  5.  
  6. Goes in the <tileset> element.
  7.  
  8. Either contains a <layer> element or a <quickMetatile> element. May also contain a <9SectionScaling> element.
  9.  
  10. <quickmetatile>
  11. Defines that the tilemap for the metatile is just a section of prelaidout tiles on the tileset.
  12.  
  13. * x: The x postion (in tiles) on the tileset where the top left corner of the metatile begins
  14. * y: The y postion (in tiles) on the tileset where the top left corner of the metatile begins
  15. * width: The width of the metatile (in tiles)
  16. * height: The height of the metatile (in tiles)
  17. * scan: (Defaults to 2D) If the metatile is laid out in 2D or 1D scan on the tilemap
  18.  
  19. 2D scan has the tiles laid out as in the source image, while 1D use only the tile id.
  20. 1D scan builds the tilemap by starting in the top left corner and using incrementing tile indexes left-to-right, top-to-bottom.
  21.  
  22.  
  23. <9SectionScaling>
  24. Allows scaling the metatile by repeating parts of it. The top and bottom edges are not repeated on the y axis,
  25. with the left and right edges not repeating on the x axis. The corners don't repeat at all.
  26.  
  27. * top: The number of tiles that compose the non resizing part of the top edge of the metatile
  28. * bottom: The number of tiles that compose the non resizing part of the bottom edge of the metatile
  29. * left: The number of tiles that compose the non resizing part of the left edge of the metatile
  30. * right: The number of tiles that compose the non resizing part of the right edge of the metatile
  31.  
  32. If an attribute or the entire element is missing then the default value is zero.
  33.  
  34. <data>
  35. Bits 25 to and including bit 28 define a tile type integer.
  36.  
  37. Type 0 is a plain ordinary tile.
  38. Type 4 is a non scaled metatile instance.
  39. Type 5 is a scaled metatile instance.
  40. Type 8 is an animated tile
  41. Type 9 is an animated tile with an overriden animation rate
  42. Type 10 is an animated tile with a staggering offset
  43. Type 11 is an animated tile with an overriden animation rate and a staggering offset
  44.  
  45. Normal tiles, metatiles and animations have different namespaces. In other words, they do not share the same set of numbers. Tile # 1 is not the same as metatile # 1.
  46.  
  47. If the tile is a scaled metatile instance then two integers follow the tile number. They are, in order, the width of the metatile instance and the height of the metatile instance.
  48. Metatile instances are not written out for each tile they are composed of. Instead they work like a table cell in HTML with a colspan and/or rowspan attribute. Scaling takes place before rotation/mirroring.
  49. If the metatile instance is rotated and/or mirrored then both the indididual tiles and the tilemap of the metatile is rotated.
  50. The position of the metatile instance in the main tilemap is always the top left corner of the boundary region that the metatile occupies in the main tilemap.
  51. Metatile instances may not overlap with other tiles.
  52.  
  53. If there is an overriden animation rate then an additional integer follows the tile number. (Someone else think up the unit for that)
  54. If there is a staggering offset then an additional integer follows the tile number (or animation rate override). (Yup, someone else think up the unit here too)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement