TileMapPattern.xml 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <class name="TileMapPattern" inherits="Resource" version="4.0">
  3. <brief_description>
  4. Holds a pattern to be copied from or pasted into [TileMap]s.
  5. </brief_description>
  6. <description>
  7. This resource holds a set of cells to help bulk manipulations of [TileMap].
  8. A pattern always start at the [code](0,0)[/code] coordinates and cannot have cells with negative coordinates.
  9. </description>
  10. <tutorials>
  11. </tutorials>
  12. <methods>
  13. <method name="get_cell_alternative_tile" qualifiers="const">
  14. <return type="int" />
  15. <argument index="0" name="coords" type="Vector2i" />
  16. <description>
  17. Returns the tile alternative ID of the cell at [code]coords[/code].
  18. </description>
  19. </method>
  20. <method name="get_cell_atlas_coords" qualifiers="const">
  21. <return type="Vector2i" />
  22. <argument index="0" name="coords" type="Vector2i" />
  23. <description>
  24. Returns the tile atlas coordinates ID of the cell at [code]coords[/code].
  25. </description>
  26. </method>
  27. <method name="get_cell_source_id" qualifiers="const">
  28. <return type="int" />
  29. <argument index="0" name="coords" type="Vector2i" />
  30. <description>
  31. Returns the tile source ID of the cell at [code]coords[/code].
  32. </description>
  33. </method>
  34. <method name="get_size" qualifiers="const">
  35. <return type="Vector2i" />
  36. <description>
  37. Returns the size, in cells, of the pattern.
  38. </description>
  39. </method>
  40. <method name="get_used_cells" qualifiers="const">
  41. <return type="Vector2i[]" />
  42. <description>
  43. Returns the list of used cell coordinates in the pattern.
  44. </description>
  45. </method>
  46. <method name="has_cell" qualifiers="const">
  47. <return type="bool" />
  48. <argument index="0" name="coords" type="Vector2i" />
  49. <description>
  50. Returns whether the pattern has a tile at the given coordinates.
  51. </description>
  52. </method>
  53. <method name="is_empty" qualifiers="const">
  54. <return type="bool" />
  55. <description>
  56. Returns whether the pattern is empty or not.
  57. </description>
  58. </method>
  59. <method name="remove_cell">
  60. <return type="void" />
  61. <argument index="0" name="coords" type="Vector2i" />
  62. <argument index="1" name="update_size" type="bool" />
  63. <description>
  64. Remove the cell at the given coordinates.
  65. </description>
  66. </method>
  67. <method name="set_cell">
  68. <return type="void" />
  69. <argument index="0" name="coords" type="Vector2i" />
  70. <argument index="1" name="source_id" type="int" default="-1" />
  71. <argument index="2" name="atlas_coords" type="Vector2i" default="Vector2i(-1, -1)" />
  72. <argument index="3" name="alternative_tile" type="int" default="-1" />
  73. <description>
  74. Sets the tile indentifiers for the cell at coordinates [code]coords[/code]. See [method TileMap.set_cell].
  75. </description>
  76. </method>
  77. <method name="set_size">
  78. <return type="void" />
  79. <argument index="0" name="size" type="Vector2i" />
  80. <description>
  81. Sets the size of the pattern.
  82. </description>
  83. </method>
  84. </methods>
  85. </class>