class_tilemappattern.rst 9.5 KB

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