class_tilemappattern.rst 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187
  1. :github_url: hide
  2. .. DO NOT EDIT THIS FILE!!!
  3. .. Generated automatically from Godot engine sources.
  4. .. Generator: https://github.com/godotengine/godot/tree/4.2/doc/tools/make_rst.py.
  5. .. XML source: https://github.com/godotengine/godot/tree/4.2/doc/classes/TileMapPattern.xml.
  6. .. _class_TileMapPattern:
  7. TileMapPattern
  8. ==============
  9. **Inherits:** :ref:`Resource<class_Resource>` **<** :ref:`RefCounted<class_RefCounted>` **<** :ref:`Object<class_Object>`
  10. Holds a pattern to be copied from or pasted into :ref:`TileMap<class_TileMap>`\ s.
  11. .. rst-class:: classref-introduction-group
  12. Description
  13. -----------
  14. This resource holds a set of cells to help bulk manipulations of :ref:`TileMap<class_TileMap>`.
  15. A pattern always start at the ``(0,0)`` coordinates and cannot have cells with negative coordinates.
  16. .. rst-class:: classref-reftable-group
  17. Methods
  18. -------
  19. .. table::
  20. :widths: auto
  21. +-----------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  22. | :ref:`int<class_int>` | :ref:`get_cell_alternative_tile<class_TileMapPattern_method_get_cell_alternative_tile>` **(** :ref:`Vector2i<class_Vector2i>` coords **)** |const| |
  23. +-----------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  24. | :ref:`Vector2i<class_Vector2i>` | :ref:`get_cell_atlas_coords<class_TileMapPattern_method_get_cell_atlas_coords>` **(** :ref:`Vector2i<class_Vector2i>` coords **)** |const| |
  25. +-----------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  26. | :ref:`int<class_int>` | :ref:`get_cell_source_id<class_TileMapPattern_method_get_cell_source_id>` **(** :ref:`Vector2i<class_Vector2i>` coords **)** |const| |
  27. +-----------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  28. | :ref:`Vector2i<class_Vector2i>` | :ref:`get_size<class_TileMapPattern_method_get_size>` **(** **)** |const| |
  29. +-----------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  30. | :ref:`Vector2i[]<class_Vector2i>` | :ref:`get_used_cells<class_TileMapPattern_method_get_used_cells>` **(** **)** |const| |
  31. +-----------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  32. | :ref:`bool<class_bool>` | :ref:`has_cell<class_TileMapPattern_method_has_cell>` **(** :ref:`Vector2i<class_Vector2i>` coords **)** |const| |
  33. +-----------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  34. | :ref:`bool<class_bool>` | :ref:`is_empty<class_TileMapPattern_method_is_empty>` **(** **)** |const| |
  35. +-----------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  36. | void | :ref:`remove_cell<class_TileMapPattern_method_remove_cell>` **(** :ref:`Vector2i<class_Vector2i>` coords, :ref:`bool<class_bool>` update_size **)** |
  37. +-----------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  38. | void | :ref:`set_cell<class_TileMapPattern_method_set_cell>` **(** :ref:`Vector2i<class_Vector2i>` coords, :ref:`int<class_int>` source_id=-1, :ref:`Vector2i<class_Vector2i>` atlas_coords=Vector2i(-1, -1), :ref:`int<class_int>` alternative_tile=-1 **)** |
  39. +-----------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  40. | void | :ref:`set_size<class_TileMapPattern_method_set_size>` **(** :ref:`Vector2i<class_Vector2i>` size **)** |
  41. +-----------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  42. .. rst-class:: classref-section-separator
  43. ----
  44. .. rst-class:: classref-descriptions-group
  45. Method Descriptions
  46. -------------------
  47. .. _class_TileMapPattern_method_get_cell_alternative_tile:
  48. .. rst-class:: classref-method
  49. :ref:`int<class_int>` **get_cell_alternative_tile** **(** :ref:`Vector2i<class_Vector2i>` coords **)** |const|
  50. Returns the tile alternative ID of the cell at ``coords``.
  51. .. rst-class:: classref-item-separator
  52. ----
  53. .. _class_TileMapPattern_method_get_cell_atlas_coords:
  54. .. rst-class:: classref-method
  55. :ref:`Vector2i<class_Vector2i>` **get_cell_atlas_coords** **(** :ref:`Vector2i<class_Vector2i>` coords **)** |const|
  56. Returns the tile atlas coordinates ID of the cell at ``coords``.
  57. .. rst-class:: classref-item-separator
  58. ----
  59. .. _class_TileMapPattern_method_get_cell_source_id:
  60. .. rst-class:: classref-method
  61. :ref:`int<class_int>` **get_cell_source_id** **(** :ref:`Vector2i<class_Vector2i>` coords **)** |const|
  62. Returns the tile source ID of the cell at ``coords``.
  63. .. rst-class:: classref-item-separator
  64. ----
  65. .. _class_TileMapPattern_method_get_size:
  66. .. rst-class:: classref-method
  67. :ref:`Vector2i<class_Vector2i>` **get_size** **(** **)** |const|
  68. Returns the size, in cells, of the pattern.
  69. .. rst-class:: classref-item-separator
  70. ----
  71. .. _class_TileMapPattern_method_get_used_cells:
  72. .. rst-class:: classref-method
  73. :ref:`Vector2i[]<class_Vector2i>` **get_used_cells** **(** **)** |const|
  74. Returns the list of used cell coordinates in the pattern.
  75. .. rst-class:: classref-item-separator
  76. ----
  77. .. _class_TileMapPattern_method_has_cell:
  78. .. rst-class:: classref-method
  79. :ref:`bool<class_bool>` **has_cell** **(** :ref:`Vector2i<class_Vector2i>` coords **)** |const|
  80. Returns whether the pattern has a tile at the given coordinates.
  81. .. rst-class:: classref-item-separator
  82. ----
  83. .. _class_TileMapPattern_method_is_empty:
  84. .. rst-class:: classref-method
  85. :ref:`bool<class_bool>` **is_empty** **(** **)** |const|
  86. Returns whether the pattern is empty or not.
  87. .. rst-class:: classref-item-separator
  88. ----
  89. .. _class_TileMapPattern_method_remove_cell:
  90. .. rst-class:: classref-method
  91. void **remove_cell** **(** :ref:`Vector2i<class_Vector2i>` coords, :ref:`bool<class_bool>` update_size **)**
  92. Remove the cell at the given coordinates.
  93. .. rst-class:: classref-item-separator
  94. ----
  95. .. _class_TileMapPattern_method_set_cell:
  96. .. rst-class:: classref-method
  97. void **set_cell** **(** :ref:`Vector2i<class_Vector2i>` coords, :ref:`int<class_int>` source_id=-1, :ref:`Vector2i<class_Vector2i>` atlas_coords=Vector2i(-1, -1), :ref:`int<class_int>` alternative_tile=-1 **)**
  98. Sets the tile identifiers for the cell at coordinates ``coords``. See :ref:`TileMap.set_cell<class_TileMap_method_set_cell>`.
  99. .. rst-class:: classref-item-separator
  100. ----
  101. .. _class_TileMapPattern_method_set_size:
  102. .. rst-class:: classref-method
  103. void **set_size** **(** :ref:`Vector2i<class_Vector2i>` size **)**
  104. Sets the size of the pattern.
  105. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  106. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  107. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  108. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  109. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  110. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`
  111. .. |bitfield| replace:: :abbr:`BitField (This value is an integer composed as a bitmask of the following flags.)`