:github_url: hide .. Generated automatically by doc/tools/make_rst.py in Godot's source tree. .. DO NOT EDIT THIS FILE, but the TileSet.xml source instead. .. The source is found in doc/classes or modules//doc_classes. .. _class_TileSet: TileSet ======= **Inherits:** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` Tile library for tilemaps. Description ----------- A TileSet is a library of tiles for a :ref:`TileMap`. It contains a list of tiles, each consisting of a sprite and optional collision shapes. Tiles are referenced by a unique integer ID. Tutorials --------- - :doc:`../tutorials/2d/using_tilemaps` - `2D Platformer Demo `__ - `2D Isometric Demo `__ - `2D Hexagonal Demo `__ - `2D Navigation Astar Demo `__ - `2D Role Playing Game Demo `__ - `2D Kinematic Character Demo `__ Methods ------- +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Vector2` | :ref:`_forward_atlas_subtile_selection` **(** :ref:`int` atlastile_id, :ref:`Object` tilemap, :ref:`Vector2` tile_location **)** |virtual| | +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Vector2` | :ref:`_forward_subtile_selection` **(** :ref:`int` autotile_id, :ref:`int` bitmask, :ref:`Object` tilemap, :ref:`Vector2` tile_location **)** |virtual| | +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`_is_tile_bound` **(** :ref:`int` drawn_id, :ref:`int` neighbor_id **)** |virtual| | +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`autotile_clear_bitmask_map` **(** :ref:`int` id **)** | +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`autotile_get_bitmask` **(** :ref:`int` id, :ref:`Vector2` coord **)** | +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`BitmaskMode` | :ref:`autotile_get_bitmask_mode` **(** :ref:`int` id **)** |const| | +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Vector2` | :ref:`autotile_get_icon_coordinate` **(** :ref:`int` id **)** |const| | +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`OccluderPolygon2D` | :ref:`autotile_get_light_occluder` **(** :ref:`int` id, :ref:`Vector2` coord **)** |const| | +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`NavigationPolygon` | :ref:`autotile_get_navigation_polygon` **(** :ref:`int` id, :ref:`Vector2` coord **)** |const| | +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Vector2` | :ref:`autotile_get_size` **(** :ref:`int` id **)** |const| | +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`autotile_get_spacing` **(** :ref:`int` id **)** |const| | +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`autotile_get_subtile_priority` **(** :ref:`int` id, :ref:`Vector2` coord **)** | +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`autotile_get_z_index` **(** :ref:`int` id, :ref:`Vector2` coord **)** | +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`autotile_set_bitmask` **(** :ref:`int` id, :ref:`Vector2` bitmask, :ref:`int` flag **)** | +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`autotile_set_bitmask_mode` **(** :ref:`int` id, :ref:`BitmaskMode` mode **)** | +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`autotile_set_icon_coordinate` **(** :ref:`int` id, :ref:`Vector2` coord **)** | +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`autotile_set_light_occluder` **(** :ref:`int` id, :ref:`OccluderPolygon2D` light_occluder, :ref:`Vector2` coord **)** | +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`autotile_set_navigation_polygon` **(** :ref:`int` id, :ref:`NavigationPolygon` navigation_polygon, :ref:`Vector2` coord **)** | +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`autotile_set_size` **(** :ref:`int` id, :ref:`Vector2` size **)** | +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`autotile_set_spacing` **(** :ref:`int` id, :ref:`int` spacing **)** | +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`autotile_set_subtile_priority` **(** :ref:`int` id, :ref:`Vector2` coord, :ref:`int` priority **)** | +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`autotile_set_z_index` **(** :ref:`int` id, :ref:`Vector2` coord, :ref:`int` z_index **)** | +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`clear` **(** **)** | +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`create_tile` **(** :ref:`int` id **)** | +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`find_tile_by_name` **(** :ref:`String` name **)** |const| | +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`get_last_unused_tile_id` **(** **)** |const| | +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Array` | :ref:`get_tiles_ids` **(** **)** |const| | +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`remove_tile` **(** :ref:`int` id **)** | +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`tile_add_shape` **(** :ref:`int` id, :ref:`Shape2D` shape, :ref:`Transform2D` shape_transform, :ref:`bool` one_way=false, :ref:`Vector2` autotile_coord=Vector2( 0, 0 ) **)** | +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`OccluderPolygon2D` | :ref:`tile_get_light_occluder` **(** :ref:`int` id **)** |const| | +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`ShaderMaterial` | :ref:`tile_get_material` **(** :ref:`int` id **)** |const| | +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Color` | :ref:`tile_get_modulate` **(** :ref:`int` id **)** |const| | +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`String` | :ref:`tile_get_name` **(** :ref:`int` id **)** |const| | +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`NavigationPolygon` | :ref:`tile_get_navigation_polygon` **(** :ref:`int` id **)** |const| | +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Vector2` | :ref:`tile_get_navigation_polygon_offset` **(** :ref:`int` id **)** |const| | +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Texture` | :ref:`tile_get_normal_map` **(** :ref:`int` id **)** |const| | +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Vector2` | :ref:`tile_get_occluder_offset` **(** :ref:`int` id **)** |const| | +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Rect2` | :ref:`tile_get_region` **(** :ref:`int` id **)** |const| | +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Shape2D` | :ref:`tile_get_shape` **(** :ref:`int` id, :ref:`int` shape_id **)** |const| | +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`tile_get_shape_count` **(** :ref:`int` id **)** |const| | +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Vector2` | :ref:`tile_get_shape_offset` **(** :ref:`int` id, :ref:`int` shape_id **)** |const| | +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`tile_get_shape_one_way` **(** :ref:`int` id, :ref:`int` shape_id **)** |const| | +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`float` | :ref:`tile_get_shape_one_way_margin` **(** :ref:`int` id, :ref:`int` shape_id **)** |const| | +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Transform2D` | :ref:`tile_get_shape_transform` **(** :ref:`int` id, :ref:`int` shape_id **)** |const| | +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Array` | :ref:`tile_get_shapes` **(** :ref:`int` id **)** |const| | +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Texture` | :ref:`tile_get_texture` **(** :ref:`int` id **)** |const| | +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Vector2` | :ref:`tile_get_texture_offset` **(** :ref:`int` id **)** |const| | +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`TileMode` | :ref:`tile_get_tile_mode` **(** :ref:`int` id **)** |const| | +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`tile_get_z_index` **(** :ref:`int` id **)** |const| | +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`tile_set_light_occluder` **(** :ref:`int` id, :ref:`OccluderPolygon2D` light_occluder **)** | +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`tile_set_material` **(** :ref:`int` id, :ref:`ShaderMaterial` material **)** | +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`tile_set_modulate` **(** :ref:`int` id, :ref:`Color` color **)** | +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`tile_set_name` **(** :ref:`int` id, :ref:`String` name **)** | +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`tile_set_navigation_polygon` **(** :ref:`int` id, :ref:`NavigationPolygon` navigation_polygon **)** | +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`tile_set_navigation_polygon_offset` **(** :ref:`int` id, :ref:`Vector2` navigation_polygon_offset **)** | +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`tile_set_normal_map` **(** :ref:`int` id, :ref:`Texture` normal_map **)** | +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`tile_set_occluder_offset` **(** :ref:`int` id, :ref:`Vector2` occluder_offset **)** | +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`tile_set_region` **(** :ref:`int` id, :ref:`Rect2` region **)** | +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`tile_set_shape` **(** :ref:`int` id, :ref:`int` shape_id, :ref:`Shape2D` shape **)** | +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`tile_set_shape_offset` **(** :ref:`int` id, :ref:`int` shape_id, :ref:`Vector2` shape_offset **)** | +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`tile_set_shape_one_way` **(** :ref:`int` id, :ref:`int` shape_id, :ref:`bool` one_way **)** | +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`tile_set_shape_one_way_margin` **(** :ref:`int` id, :ref:`int` shape_id, :ref:`float` one_way **)** | +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`tile_set_shape_transform` **(** :ref:`int` id, :ref:`int` shape_id, :ref:`Transform2D` shape_transform **)** | +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`tile_set_shapes` **(** :ref:`int` id, :ref:`Array` shapes **)** | +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`tile_set_texture` **(** :ref:`int` id, :ref:`Texture` texture **)** | +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`tile_set_texture_offset` **(** :ref:`int` id, :ref:`Vector2` texture_offset **)** | +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`tile_set_tile_mode` **(** :ref:`int` id, :ref:`TileMode` tilemode **)** | +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`tile_set_z_index` **(** :ref:`int` id, :ref:`int` z_index **)** | +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ Enumerations ------------ .. _enum_TileSet_BitmaskMode: .. _class_TileSet_constant_BITMASK_2X2: .. _class_TileSet_constant_BITMASK_3X3_MINIMAL: .. _class_TileSet_constant_BITMASK_3X3: enum **BitmaskMode**: - **BITMASK_2X2** = **0** - **BITMASK_3X3_MINIMAL** = **1** - **BITMASK_3X3** = **2** ---- .. _enum_TileSet_AutotileBindings: .. _class_TileSet_constant_BIND_TOPLEFT: .. _class_TileSet_constant_BIND_TOP: .. _class_TileSet_constant_BIND_TOPRIGHT: .. _class_TileSet_constant_BIND_LEFT: .. _class_TileSet_constant_BIND_CENTER: .. _class_TileSet_constant_BIND_RIGHT: .. _class_TileSet_constant_BIND_BOTTOMLEFT: .. _class_TileSet_constant_BIND_BOTTOM: .. _class_TileSet_constant_BIND_BOTTOMRIGHT: enum **AutotileBindings**: - **BIND_TOPLEFT** = **1** - **BIND_TOP** = **2** - **BIND_TOPRIGHT** = **4** - **BIND_LEFT** = **8** - **BIND_CENTER** = **16** - **BIND_RIGHT** = **32** - **BIND_BOTTOMLEFT** = **64** - **BIND_BOTTOM** = **128** - **BIND_BOTTOMRIGHT** = **256** ---- .. _enum_TileSet_TileMode: .. _class_TileSet_constant_SINGLE_TILE: .. _class_TileSet_constant_AUTO_TILE: .. _class_TileSet_constant_ATLAS_TILE: enum **TileMode**: - **SINGLE_TILE** = **0** - **AUTO_TILE** = **1** - **ATLAS_TILE** = **2** Method Descriptions ------------------- .. _class_TileSet_method__forward_atlas_subtile_selection: - :ref:`Vector2` **_forward_atlas_subtile_selection** **(** :ref:`int` atlastile_id, :ref:`Object` tilemap, :ref:`Vector2` tile_location **)** |virtual| ---- .. _class_TileSet_method__forward_subtile_selection: - :ref:`Vector2` **_forward_subtile_selection** **(** :ref:`int` autotile_id, :ref:`int` bitmask, :ref:`Object` tilemap, :ref:`Vector2` tile_location **)** |virtual| ---- .. _class_TileSet_method__is_tile_bound: - :ref:`bool` **_is_tile_bound** **(** :ref:`int` drawn_id, :ref:`int` neighbor_id **)** |virtual| Determines when the auto-tiler should consider two different auto-tile IDs to be bound together. **Note:** ``neighbor_id`` will be ``-1`` (:ref:`TileMap.INVALID_CELL`) when checking a tile against an empty neighbor tile. ---- .. _class_TileSet_method_autotile_clear_bitmask_map: - void **autotile_clear_bitmask_map** **(** :ref:`int` id **)** Clears all bitmask information of the autotile. ---- .. _class_TileSet_method_autotile_get_bitmask: - :ref:`int` **autotile_get_bitmask** **(** :ref:`int` id, :ref:`Vector2` coord **)** Returns the bitmask of the subtile from an autotile given its coordinates. The value is the sum of the values in :ref:`AutotileBindings` present in the subtile (e.g. a value of 5 means the bitmask has bindings in both the top left and top right). ---- .. _class_TileSet_method_autotile_get_bitmask_mode: - :ref:`BitmaskMode` **autotile_get_bitmask_mode** **(** :ref:`int` id **)** |const| Returns the :ref:`BitmaskMode` of the autotile. ---- .. _class_TileSet_method_autotile_get_icon_coordinate: - :ref:`Vector2` **autotile_get_icon_coordinate** **(** :ref:`int` id **)** |const| Returns the subtile that's being used as an icon in an atlas/autotile given its coordinates. The subtile defined as the icon will be used as a fallback when the atlas/autotile's bitmask information is incomplete. It will also be used to represent it in the TileSet editor. ---- .. _class_TileSet_method_autotile_get_light_occluder: - :ref:`OccluderPolygon2D` **autotile_get_light_occluder** **(** :ref:`int` id, :ref:`Vector2` coord **)** |const| Returns the light occluder of the subtile from an atlas/autotile given its coordinates. ---- .. _class_TileSet_method_autotile_get_navigation_polygon: - :ref:`NavigationPolygon` **autotile_get_navigation_polygon** **(** :ref:`int` id, :ref:`Vector2` coord **)** |const| Returns the navigation polygon of the subtile from an atlas/autotile given its coordinates. ---- .. _class_TileSet_method_autotile_get_size: - :ref:`Vector2` **autotile_get_size** **(** :ref:`int` id **)** |const| Returns the size of the subtiles in an atlas/autotile. ---- .. _class_TileSet_method_autotile_get_spacing: - :ref:`int` **autotile_get_spacing** **(** :ref:`int` id **)** |const| Returns the spacing between subtiles of the atlas/autotile. ---- .. _class_TileSet_method_autotile_get_subtile_priority: - :ref:`int` **autotile_get_subtile_priority** **(** :ref:`int` id, :ref:`Vector2` coord **)** Returns the priority of the subtile from an autotile given its coordinates. When more than one subtile has the same bitmask value, one of them will be picked randomly for drawing. Its priority will define how often it will be picked. ---- .. _class_TileSet_method_autotile_get_z_index: - :ref:`int` **autotile_get_z_index** **(** :ref:`int` id, :ref:`Vector2` coord **)** Returns the drawing index of the subtile from an atlas/autotile given its coordinates. ---- .. _class_TileSet_method_autotile_set_bitmask: - void **autotile_set_bitmask** **(** :ref:`int` id, :ref:`Vector2` bitmask, :ref:`int` flag **)** Sets the bitmask of the subtile from an autotile given its coordinates. The value is the sum of the values in :ref:`AutotileBindings` present in the subtile (e.g. a value of 5 means the bitmask has bindings in both the top left and top right). ---- .. _class_TileSet_method_autotile_set_bitmask_mode: - void **autotile_set_bitmask_mode** **(** :ref:`int` id, :ref:`BitmaskMode` mode **)** Sets the :ref:`BitmaskMode` of the autotile. ---- .. _class_TileSet_method_autotile_set_icon_coordinate: - void **autotile_set_icon_coordinate** **(** :ref:`int` id, :ref:`Vector2` coord **)** Sets the subtile that will be used as an icon in an atlas/autotile given its coordinates. The subtile defined as the icon will be used as a fallback when the atlas/autotile's bitmask information is incomplete. It will also be used to represent it in the TileSet editor. ---- .. _class_TileSet_method_autotile_set_light_occluder: - void **autotile_set_light_occluder** **(** :ref:`int` id, :ref:`OccluderPolygon2D` light_occluder, :ref:`Vector2` coord **)** Sets the light occluder of the subtile from an atlas/autotile given its coordinates. ---- .. _class_TileSet_method_autotile_set_navigation_polygon: - void **autotile_set_navigation_polygon** **(** :ref:`int` id, :ref:`NavigationPolygon` navigation_polygon, :ref:`Vector2` coord **)** Sets the navigation polygon of the subtile from an atlas/autotile given its coordinates. ---- .. _class_TileSet_method_autotile_set_size: - void **autotile_set_size** **(** :ref:`int` id, :ref:`Vector2` size **)** Sets the size of the subtiles in an atlas/autotile. ---- .. _class_TileSet_method_autotile_set_spacing: - void **autotile_set_spacing** **(** :ref:`int` id, :ref:`int` spacing **)** Sets the spacing between subtiles of the atlas/autotile. ---- .. _class_TileSet_method_autotile_set_subtile_priority: - void **autotile_set_subtile_priority** **(** :ref:`int` id, :ref:`Vector2` coord, :ref:`int` priority **)** Sets the priority of the subtile from an autotile given its coordinates. When more than one subtile has the same bitmask value, one of them will be picked randomly for drawing. Its priority will define how often it will be picked. ---- .. _class_TileSet_method_autotile_set_z_index: - void **autotile_set_z_index** **(** :ref:`int` id, :ref:`Vector2` coord, :ref:`int` z_index **)** Sets the drawing index of the subtile from an atlas/autotile given its coordinates. ---- .. _class_TileSet_method_clear: - void **clear** **(** **)** Clears all tiles. ---- .. _class_TileSet_method_create_tile: - void **create_tile** **(** :ref:`int` id **)** Creates a new tile with the given ID. ---- .. _class_TileSet_method_find_tile_by_name: - :ref:`int` **find_tile_by_name** **(** :ref:`String` name **)** |const| Returns the first tile matching the given name. ---- .. _class_TileSet_method_get_last_unused_tile_id: - :ref:`int` **get_last_unused_tile_id** **(** **)** |const| Returns the ID following the last currently used ID, useful when creating a new tile. ---- .. _class_TileSet_method_get_tiles_ids: - :ref:`Array` **get_tiles_ids** **(** **)** |const| Returns an array of all currently used tile IDs. ---- .. _class_TileSet_method_remove_tile: - void **remove_tile** **(** :ref:`int` id **)** Removes the given tile ID. ---- .. _class_TileSet_method_tile_add_shape: - void **tile_add_shape** **(** :ref:`int` id, :ref:`Shape2D` shape, :ref:`Transform2D` shape_transform, :ref:`bool` one_way=false, :ref:`Vector2` autotile_coord=Vector2( 0, 0 ) **)** Adds a shape to the tile. ---- .. _class_TileSet_method_tile_get_light_occluder: - :ref:`OccluderPolygon2D` **tile_get_light_occluder** **(** :ref:`int` id **)** |const| Returns the tile's light occluder. ---- .. _class_TileSet_method_tile_get_material: - :ref:`ShaderMaterial` **tile_get_material** **(** :ref:`int` id **)** |const| Returns the tile's material. ---- .. _class_TileSet_method_tile_get_modulate: - :ref:`Color` **tile_get_modulate** **(** :ref:`int` id **)** |const| Returns the tile's modulation color. ---- .. _class_TileSet_method_tile_get_name: - :ref:`String` **tile_get_name** **(** :ref:`int` id **)** |const| Returns the tile's name. ---- .. _class_TileSet_method_tile_get_navigation_polygon: - :ref:`NavigationPolygon` **tile_get_navigation_polygon** **(** :ref:`int` id **)** |const| Returns the navigation polygon of the tile. ---- .. _class_TileSet_method_tile_get_navigation_polygon_offset: - :ref:`Vector2` **tile_get_navigation_polygon_offset** **(** :ref:`int` id **)** |const| Returns the offset of the tile's navigation polygon. ---- .. _class_TileSet_method_tile_get_normal_map: - :ref:`Texture` **tile_get_normal_map** **(** :ref:`int` id **)** |const| Returns the tile's normal map texture. ---- .. _class_TileSet_method_tile_get_occluder_offset: - :ref:`Vector2` **tile_get_occluder_offset** **(** :ref:`int` id **)** |const| Returns the offset of the tile's light occluder. ---- .. _class_TileSet_method_tile_get_region: - :ref:`Rect2` **tile_get_region** **(** :ref:`int` id **)** |const| Returns the tile sub-region in the texture. ---- .. _class_TileSet_method_tile_get_shape: - :ref:`Shape2D` **tile_get_shape** **(** :ref:`int` id, :ref:`int` shape_id **)** |const| Returns a tile's given shape. ---- .. _class_TileSet_method_tile_get_shape_count: - :ref:`int` **tile_get_shape_count** **(** :ref:`int` id **)** |const| Returns the number of shapes assigned to a tile. ---- .. _class_TileSet_method_tile_get_shape_offset: - :ref:`Vector2` **tile_get_shape_offset** **(** :ref:`int` id, :ref:`int` shape_id **)** |const| Returns the offset of a tile's shape. ---- .. _class_TileSet_method_tile_get_shape_one_way: - :ref:`bool` **tile_get_shape_one_way** **(** :ref:`int` id, :ref:`int` shape_id **)** |const| Returns the one-way collision value of a tile's shape. ---- .. _class_TileSet_method_tile_get_shape_one_way_margin: - :ref:`float` **tile_get_shape_one_way_margin** **(** :ref:`int` id, :ref:`int` shape_id **)** |const| ---- .. _class_TileSet_method_tile_get_shape_transform: - :ref:`Transform2D` **tile_get_shape_transform** **(** :ref:`int` id, :ref:`int` shape_id **)** |const| Returns the :ref:`Transform2D` of a tile's shape. ---- .. _class_TileSet_method_tile_get_shapes: - :ref:`Array` **tile_get_shapes** **(** :ref:`int` id **)** |const| Returns an array of dictionaries describing the tile's shapes. **Dictionary structure in the array returned by this method:** :: { "autotile_coord": Vector2, "one_way": bool, "one_way_margin": int, "shape": CollisionShape2D, "shape_transform": Transform2D, } ---- .. _class_TileSet_method_tile_get_texture: - :ref:`Texture` **tile_get_texture** **(** :ref:`int` id **)** |const| Returns the tile's texture. ---- .. _class_TileSet_method_tile_get_texture_offset: - :ref:`Vector2` **tile_get_texture_offset** **(** :ref:`int` id **)** |const| Returns the texture offset of the tile. ---- .. _class_TileSet_method_tile_get_tile_mode: - :ref:`TileMode` **tile_get_tile_mode** **(** :ref:`int` id **)** |const| Returns the tile's :ref:`TileMode`. ---- .. _class_TileSet_method_tile_get_z_index: - :ref:`int` **tile_get_z_index** **(** :ref:`int` id **)** |const| Returns the tile's Z index (drawing layer). ---- .. _class_TileSet_method_tile_set_light_occluder: - void **tile_set_light_occluder** **(** :ref:`int` id, :ref:`OccluderPolygon2D` light_occluder **)** Sets a light occluder for the tile. ---- .. _class_TileSet_method_tile_set_material: - void **tile_set_material** **(** :ref:`int` id, :ref:`ShaderMaterial` material **)** Sets the tile's material. ---- .. _class_TileSet_method_tile_set_modulate: - void **tile_set_modulate** **(** :ref:`int` id, :ref:`Color` color **)** Sets the tile's modulation color. **Note:** Modulation is performed by setting the tile's vertex color. To access this in a shader, use ``COLOR`` rather than ``MODULATE`` (which instead accesses the :ref:`TileMap`'s :ref:`CanvasItem.modulate` property). ---- .. _class_TileSet_method_tile_set_name: - void **tile_set_name** **(** :ref:`int` id, :ref:`String` name **)** Sets the tile's name. ---- .. _class_TileSet_method_tile_set_navigation_polygon: - void **tile_set_navigation_polygon** **(** :ref:`int` id, :ref:`NavigationPolygon` navigation_polygon **)** Sets the tile's navigation polygon. ---- .. _class_TileSet_method_tile_set_navigation_polygon_offset: - void **tile_set_navigation_polygon_offset** **(** :ref:`int` id, :ref:`Vector2` navigation_polygon_offset **)** Sets an offset for the tile's navigation polygon. ---- .. _class_TileSet_method_tile_set_normal_map: - void **tile_set_normal_map** **(** :ref:`int` id, :ref:`Texture` normal_map **)** Sets the tile's normal map texture. **Note:** Godot expects the normal map to use X+, Y-, and Z+ coordinates. See `this page `__ for a comparison of normal map coordinates expected by popular engines. ---- .. _class_TileSet_method_tile_set_occluder_offset: - void **tile_set_occluder_offset** **(** :ref:`int` id, :ref:`Vector2` occluder_offset **)** Sets an offset for the tile's light occluder. ---- .. _class_TileSet_method_tile_set_region: - void **tile_set_region** **(** :ref:`int` id, :ref:`Rect2` region **)** Sets the tile's sub-region in the texture. This is common in texture atlases. ---- .. _class_TileSet_method_tile_set_shape: - void **tile_set_shape** **(** :ref:`int` id, :ref:`int` shape_id, :ref:`Shape2D` shape **)** Sets a shape for the tile, enabling collision. ---- .. _class_TileSet_method_tile_set_shape_offset: - void **tile_set_shape_offset** **(** :ref:`int` id, :ref:`int` shape_id, :ref:`Vector2` shape_offset **)** Sets the offset of a tile's shape. ---- .. _class_TileSet_method_tile_set_shape_one_way: - void **tile_set_shape_one_way** **(** :ref:`int` id, :ref:`int` shape_id, :ref:`bool` one_way **)** Enables one-way collision on a tile's shape. ---- .. _class_TileSet_method_tile_set_shape_one_way_margin: - void **tile_set_shape_one_way_margin** **(** :ref:`int` id, :ref:`int` shape_id, :ref:`float` one_way **)** ---- .. _class_TileSet_method_tile_set_shape_transform: - void **tile_set_shape_transform** **(** :ref:`int` id, :ref:`int` shape_id, :ref:`Transform2D` shape_transform **)** Sets a :ref:`Transform2D` on a tile's shape. ---- .. _class_TileSet_method_tile_set_shapes: - void **tile_set_shapes** **(** :ref:`int` id, :ref:`Array` shapes **)** Sets an array of shapes for the tile, enabling collision. ---- .. _class_TileSet_method_tile_set_texture: - void **tile_set_texture** **(** :ref:`int` id, :ref:`Texture` texture **)** Sets the tile's texture. ---- .. _class_TileSet_method_tile_set_texture_offset: - void **tile_set_texture_offset** **(** :ref:`int` id, :ref:`Vector2` texture_offset **)** Sets the tile's texture offset. ---- .. _class_TileSet_method_tile_set_tile_mode: - void **tile_set_tile_mode** **(** :ref:`int` id, :ref:`TileMode` tilemode **)** Sets the tile's :ref:`TileMode`. ---- .. _class_TileSet_method_tile_set_z_index: - void **tile_set_z_index** **(** :ref:`int` id, :ref:`int` z_index **)** Sets the tile's drawing index. .. |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.)`