class_tilemappattern.rst 9.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  1. :github_url: hide
  2. .. Generated automatically by doc/tools/make_rst.py in Godot's source tree.
  3. .. DO NOT EDIT THIS FILE, but the TileMapPattern.xml source instead.
  4. .. The source is found in doc/classes or modules/<name>/doc_classes.
  5. .. _class_TileMapPattern:
  6. TileMapPattern
  7. ==============
  8. **Inherits:** :ref:`Resource<class_Resource>` **<** :ref:`RefCounted<class_RefCounted>` **<** :ref:`Object<class_Object>`
  9. Holds a pattern to be copied from or pasted into :ref:`TileMap<class_TileMap>`\ s.
  10. Description
  11. -----------
  12. This resource holds a set of cells to help bulk manipulations of :ref:`TileMap<class_TileMap>`.
  13. A pattern always start at the ``(0,0)`` coordinates and cannot have cells with negative coordinates.
  14. Methods
  15. -------
  16. +-----------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  17. | :ref:`int<class_int>` | :ref:`get_cell_alternative_tile<class_TileMapPattern_method_get_cell_alternative_tile>` **(** :ref:`Vector2i<class_Vector2i>` coords **)** |const| |
  18. +-----------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  19. | :ref:`Vector2i<class_Vector2i>` | :ref:`get_cell_atlas_coords<class_TileMapPattern_method_get_cell_atlas_coords>` **(** :ref:`Vector2i<class_Vector2i>` coords **)** |const| |
  20. +-----------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  21. | :ref:`int<class_int>` | :ref:`get_cell_source_id<class_TileMapPattern_method_get_cell_source_id>` **(** :ref:`Vector2i<class_Vector2i>` coords **)** |const| |
  22. +-----------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  23. | :ref:`Vector2i<class_Vector2i>` | :ref:`get_size<class_TileMapPattern_method_get_size>` **(** **)** |const| |
  24. +-----------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  25. | :ref:`Vector2i[]<class_Vector2i>` | :ref:`get_used_cells<class_TileMapPattern_method_get_used_cells>` **(** **)** |const| |
  26. +-----------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  27. | :ref:`bool<class_bool>` | :ref:`has_cell<class_TileMapPattern_method_has_cell>` **(** :ref:`Vector2i<class_Vector2i>` coords **)** |const| |
  28. +-----------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  29. | :ref:`bool<class_bool>` | :ref:`is_empty<class_TileMapPattern_method_is_empty>` **(** **)** |const| |
  30. +-----------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  31. | void | :ref:`remove_cell<class_TileMapPattern_method_remove_cell>` **(** :ref:`Vector2i<class_Vector2i>` coords, :ref:`bool<class_bool>` update_size **)** |
  32. +-----------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  33. | 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 **)** |
  34. +-----------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  35. | void | :ref:`set_size<class_TileMapPattern_method_set_size>` **(** :ref:`Vector2i<class_Vector2i>` size **)** |
  36. +-----------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  37. Method Descriptions
  38. -------------------
  39. .. _class_TileMapPattern_method_get_cell_alternative_tile:
  40. - :ref:`int<class_int>` **get_cell_alternative_tile** **(** :ref:`Vector2i<class_Vector2i>` coords **)** |const|
  41. Returns the tile alternative ID of the cell at ``coords``.
  42. ----
  43. .. _class_TileMapPattern_method_get_cell_atlas_coords:
  44. - :ref:`Vector2i<class_Vector2i>` **get_cell_atlas_coords** **(** :ref:`Vector2i<class_Vector2i>` coords **)** |const|
  45. Returns the tile atlas coordinates ID of the cell at ``coords``.
  46. ----
  47. .. _class_TileMapPattern_method_get_cell_source_id:
  48. - :ref:`int<class_int>` **get_cell_source_id** **(** :ref:`Vector2i<class_Vector2i>` coords **)** |const|
  49. Returns the tile source ID of the cell at ``coords``.
  50. ----
  51. .. _class_TileMapPattern_method_get_size:
  52. - :ref:`Vector2i<class_Vector2i>` **get_size** **(** **)** |const|
  53. Returns the size, in cells, of the pattern.
  54. ----
  55. .. _class_TileMapPattern_method_get_used_cells:
  56. - :ref:`Vector2i[]<class_Vector2i>` **get_used_cells** **(** **)** |const|
  57. Returns the list of used cell coordinates in the pattern.
  58. ----
  59. .. _class_TileMapPattern_method_has_cell:
  60. - :ref:`bool<class_bool>` **has_cell** **(** :ref:`Vector2i<class_Vector2i>` coords **)** |const|
  61. Returns whether the pattern has a tile at the given coordinates.
  62. ----
  63. .. _class_TileMapPattern_method_is_empty:
  64. - :ref:`bool<class_bool>` **is_empty** **(** **)** |const|
  65. Returns whether the pattern is empty or not.
  66. ----
  67. .. _class_TileMapPattern_method_remove_cell:
  68. - void **remove_cell** **(** :ref:`Vector2i<class_Vector2i>` coords, :ref:`bool<class_bool>` update_size **)**
  69. Remove the cell at the given coordinates.
  70. ----
  71. .. _class_TileMapPattern_method_set_cell:
  72. - 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 **)**
  73. Sets the tile indentifiers for the cell at coordinates ``coords``. See :ref:`TileMap.set_cell<class_TileMap_method_set_cell>`.
  74. ----
  75. .. _class_TileMapPattern_method_set_size:
  76. - void **set_size** **(** :ref:`Vector2i<class_Vector2i>` size **)**
  77. Sets the size of the pattern.
  78. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  79. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  80. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  81. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  82. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  83. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`