:github_url: hide .. DO NOT EDIT THIS FILE!!! .. Generated automatically from Godot engine sources. .. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py. .. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/TileMapPattern.xml. .. _class_TileMapPattern: TileMapPattern ============== **Inherits:** :ref:`Resource` **<** :ref:`RefCounted` **<** :ref:`Object` Holds a pattern to be copied from or pasted into :ref:`TileMap`\ s. .. rst-class:: classref-introduction-group Description ----------- This resource holds a set of cells to help bulk manipulations of :ref:`TileMap`. A pattern always starts at the ``(0, 0)`` coordinates and cannot have cells with negative coordinates. .. rst-class:: classref-reftable-group Methods ------- .. table:: :widths: auto +--------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`get_cell_alternative_tile`\ (\ coords\: :ref:`Vector2i`\ ) |const| | +--------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Vector2i` | :ref:`get_cell_atlas_coords`\ (\ coords\: :ref:`Vector2i`\ ) |const| | +--------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`get_cell_source_id`\ (\ coords\: :ref:`Vector2i`\ ) |const| | +--------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Vector2i` | :ref:`get_size`\ (\ ) |const| | +--------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Array`\[:ref:`Vector2i`\] | :ref:`get_used_cells`\ (\ ) |const| | +--------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`has_cell`\ (\ coords\: :ref:`Vector2i`\ ) |const| | +--------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`is_empty`\ (\ ) |const| | +--------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`remove_cell`\ (\ coords\: :ref:`Vector2i`, update_size\: :ref:`bool`\ ) | +--------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`set_cell`\ (\ coords\: :ref:`Vector2i`, source_id\: :ref:`int` = -1, atlas_coords\: :ref:`Vector2i` = Vector2i(-1, -1), alternative_tile\: :ref:`int` = -1\ ) | +--------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`set_size`\ (\ size\: :ref:`Vector2i`\ ) | +--------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ .. rst-class:: classref-section-separator ---- .. rst-class:: classref-descriptions-group Method Descriptions ------------------- .. _class_TileMapPattern_method_get_cell_alternative_tile: .. rst-class:: classref-method :ref:`int` **get_cell_alternative_tile**\ (\ coords\: :ref:`Vector2i`\ ) |const| :ref:`🔗` Returns the tile alternative ID of the cell at ``coords``. .. rst-class:: classref-item-separator ---- .. _class_TileMapPattern_method_get_cell_atlas_coords: .. rst-class:: classref-method :ref:`Vector2i` **get_cell_atlas_coords**\ (\ coords\: :ref:`Vector2i`\ ) |const| :ref:`🔗` Returns the tile atlas coordinates ID of the cell at ``coords``. .. rst-class:: classref-item-separator ---- .. _class_TileMapPattern_method_get_cell_source_id: .. rst-class:: classref-method :ref:`int` **get_cell_source_id**\ (\ coords\: :ref:`Vector2i`\ ) |const| :ref:`🔗` Returns the tile source ID of the cell at ``coords``. .. rst-class:: classref-item-separator ---- .. _class_TileMapPattern_method_get_size: .. rst-class:: classref-method :ref:`Vector2i` **get_size**\ (\ ) |const| :ref:`🔗` Returns the size, in cells, of the pattern. .. rst-class:: classref-item-separator ---- .. _class_TileMapPattern_method_get_used_cells: .. rst-class:: classref-method :ref:`Array`\[:ref:`Vector2i`\] **get_used_cells**\ (\ ) |const| :ref:`🔗` Returns the list of used cell coordinates in the pattern. .. rst-class:: classref-item-separator ---- .. _class_TileMapPattern_method_has_cell: .. rst-class:: classref-method :ref:`bool` **has_cell**\ (\ coords\: :ref:`Vector2i`\ ) |const| :ref:`🔗` Returns whether the pattern has a tile at the given coordinates. .. rst-class:: classref-item-separator ---- .. _class_TileMapPattern_method_is_empty: .. rst-class:: classref-method :ref:`bool` **is_empty**\ (\ ) |const| :ref:`🔗` Returns whether the pattern is empty or not. .. rst-class:: classref-item-separator ---- .. _class_TileMapPattern_method_remove_cell: .. rst-class:: classref-method |void| **remove_cell**\ (\ coords\: :ref:`Vector2i`, update_size\: :ref:`bool`\ ) :ref:`🔗` Remove the cell at the given coordinates. .. rst-class:: classref-item-separator ---- .. _class_TileMapPattern_method_set_cell: .. rst-class:: classref-method |void| **set_cell**\ (\ coords\: :ref:`Vector2i`, source_id\: :ref:`int` = -1, atlas_coords\: :ref:`Vector2i` = Vector2i(-1, -1), alternative_tile\: :ref:`int` = -1\ ) :ref:`🔗` Sets the tile identifiers for the cell at coordinates ``coords``. See :ref:`TileMap.set_cell()`. .. rst-class:: classref-item-separator ---- .. _class_TileMapPattern_method_set_size: .. rst-class:: classref-method |void| **set_size**\ (\ size\: :ref:`Vector2i`\ ) :ref:`🔗` Sets the size of the pattern. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)` .. |required| replace:: :abbr:`required (This method is required to be overridden when extending its base class.)` .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)` .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)` .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)` .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)` .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)` .. |bitfield| replace:: :abbr:`BitField (This value is an integer composed as a bitmask of the following flags.)` .. |void| replace:: :abbr:`void (No return value.)`