: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. Description ----------- This resource holds a set of cells to help bulk manipulations of :ref:`TileMap`. A pattern always start at the ``(0,0)`` coordinates and cannot have cells with negative coordinates. Methods ------- +-----------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`get_cell_alternative_tile` **(** :ref:`Vector2i` coords **)** |const| | +-----------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Vector2i` | :ref:`get_cell_atlas_coords` **(** :ref:`Vector2i` coords **)** |const| | +-----------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`get_cell_source_id` **(** :ref:`Vector2i` coords **)** |const| | +-----------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Vector2i` | :ref:`get_size` **(** **)** |const| | +-----------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Vector2i[]` | :ref:`get_used_cells` **(** **)** |const| | +-----------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`has_cell` **(** :ref:`Vector2i` coords **)** |const| | +-----------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`is_empty` **(** **)** |const| | +-----------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`remove_cell` **(** :ref:`Vector2i` coords, :ref:`bool` update_size **)** | +-----------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_cell` **(** :ref:`Vector2i` coords, :ref:`int` source_id=-1, :ref:`Vector2i` atlas_coords=Vector2i(-1, -1), :ref:`int` alternative_tile=-1 **)** | +-----------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_size` **(** :ref:`Vector2i` size **)** | +-----------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ Method Descriptions ------------------- .. _class_TileMapPattern_method_get_cell_alternative_tile: - :ref:`int` **get_cell_alternative_tile** **(** :ref:`Vector2i` coords **)** |const| Returns the tile alternative ID of the cell at ``coords``. ---- .. _class_TileMapPattern_method_get_cell_atlas_coords: - :ref:`Vector2i` **get_cell_atlas_coords** **(** :ref:`Vector2i` coords **)** |const| Returns the tile atlas coordinates ID of the cell at ``coords``. ---- .. _class_TileMapPattern_method_get_cell_source_id: - :ref:`int` **get_cell_source_id** **(** :ref:`Vector2i` coords **)** |const| Returns the tile source ID of the cell at ``coords``. ---- .. _class_TileMapPattern_method_get_size: - :ref:`Vector2i` **get_size** **(** **)** |const| Returns the size, in cells, of the pattern. ---- .. _class_TileMapPattern_method_get_used_cells: - :ref:`Vector2i[]` **get_used_cells** **(** **)** |const| Returns the list of used cell coordinates in the pattern. ---- .. _class_TileMapPattern_method_has_cell: - :ref:`bool` **has_cell** **(** :ref:`Vector2i` coords **)** |const| Returns whether the pattern has a tile at the given coordinates. ---- .. _class_TileMapPattern_method_is_empty: - :ref:`bool` **is_empty** **(** **)** |const| Returns whether the pattern is empty or not. ---- .. _class_TileMapPattern_method_remove_cell: - void **remove_cell** **(** :ref:`Vector2i` coords, :ref:`bool` update_size **)** Remove the cell at the given coordinates. ---- .. _class_TileMapPattern_method_set_cell: - void **set_cell** **(** :ref:`Vector2i` coords, :ref:`int` source_id=-1, :ref:`Vector2i` atlas_coords=Vector2i(-1, -1), :ref:`int` alternative_tile=-1 **)** Sets the tile indentifiers for the cell at coordinates ``coords``. See :ref:`TileMap.set_cell`. ---- .. _class_TileMapPattern_method_set_size: - void **set_size** **(** :ref:`Vector2i` size **)** Sets the size of the pattern. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)` .. |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.)`