.. Generated automatically by doc/tools/makerst.py in Godot's source tree. .. DO NOT EDIT THIS FILE, but the doc/base/classes.xml source instead. .. _class_TileSet: TileSet ======= **Inherits:** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` **Category:** Core Brief Description ----------------- Tile library for tilemaps. Member Functions ---------------- +----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | 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=null **)** | +----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`OccluderPolygon2D` | :ref:`tile_get_light_occluder` **(** :ref:`int` id **)** const | +----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`ShaderMaterial` | :ref:`tile_get_material` **(** :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:`bool` | :ref:`tile_get_shape_one_way` **(** :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 | +----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | 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_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_one_way` **(** :ref:`int` id, :ref:`int` shape_id, :ref:`bool` 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 **)** | +----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ 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. Member Function Description --------------------------- .. _class_TileSet_clear: - void **clear** **(** **)** Clear all tiles. .. _class_TileSet_create_tile: - void **create_tile** **(** :ref:`int` id **)** Create a new tile which will be referenced by the given ID. .. _class_TileSet_find_tile_by_name: - :ref:`int` **find_tile_by_name** **(** :ref:`String` name **)** const Find the first tile matching the given name. .. _class_TileSet_get_last_unused_tile_id: - :ref:`int` **get_last_unused_tile_id** **(** **)** const Return the ID following the last currently used ID, useful when creating a new tile. .. _class_TileSet_get_tiles_ids: - :ref:`Array` **get_tiles_ids** **(** **)** const Return an array of all currently used tile IDs. .. _class_TileSet_remove_tile: - void **remove_tile** **(** :ref:`int` id **)** Remove the tile referenced by the given ID. .. _class_TileSet_tile_add_shape: - void **tile_add_shape** **(** :ref:`int` id, :ref:`Shape2D` shape, :ref:`Transform2D` shape_transform, :ref:`bool` one_way=null **)** .. _class_TileSet_tile_get_light_occluder: - :ref:`OccluderPolygon2D` **tile_get_light_occluder** **(** :ref:`int` id **)** const Return the light occluder of the tile. .. _class_TileSet_tile_get_material: - :ref:`ShaderMaterial` **tile_get_material** **(** :ref:`int` id **)** const Return the material of the tile. .. _class_TileSet_tile_get_name: - :ref:`String` **tile_get_name** **(** :ref:`int` id **)** const Return the name of the tile. .. _class_TileSet_tile_get_navigation_polygon: - :ref:`NavigationPolygon` **tile_get_navigation_polygon** **(** :ref:`int` id **)** const Return the navigation polygon of the tile. .. _class_TileSet_tile_get_navigation_polygon_offset: - :ref:`Vector2` **tile_get_navigation_polygon_offset** **(** :ref:`int` id **)** const Return the offset of the tile's navigation polygon. .. _class_TileSet_tile_get_normal_map: - :ref:`Texture` **tile_get_normal_map** **(** :ref:`int` id **)** const .. _class_TileSet_tile_get_occluder_offset: - :ref:`Vector2` **tile_get_occluder_offset** **(** :ref:`int` id **)** const Return the offset of the tile's light occluder. .. _class_TileSet_tile_get_region: - :ref:`Rect2` **tile_get_region** **(** :ref:`int` id **)** const Return the tile sub-region in the texture. .. _class_TileSet_tile_get_shape: - :ref:`Shape2D` **tile_get_shape** **(** :ref:`int` id, :ref:`int` shape_id **)** const .. _class_TileSet_tile_get_shape_count: - :ref:`int` **tile_get_shape_count** **(** :ref:`int` id **)** const .. _class_TileSet_tile_get_shape_one_way: - :ref:`bool` **tile_get_shape_one_way** **(** :ref:`int` id, :ref:`int` shape_id **)** const .. _class_TileSet_tile_get_shape_transform: - :ref:`Transform2D` **tile_get_shape_transform** **(** :ref:`int` id, :ref:`int` shape_id **)** const .. _class_TileSet_tile_get_shapes: - :ref:`Array` **tile_get_shapes** **(** :ref:`int` id **)** const Return the array of shapes of the tile. .. _class_TileSet_tile_get_texture: - :ref:`Texture` **tile_get_texture** **(** :ref:`int` id **)** const Return the texture of the tile. .. _class_TileSet_tile_get_texture_offset: - :ref:`Vector2` **tile_get_texture_offset** **(** :ref:`int` id **)** const Return the texture offset of the tile. .. _class_TileSet_tile_set_light_occluder: - void **tile_set_light_occluder** **(** :ref:`int` id, :ref:`OccluderPolygon2D` light_occluder **)** Set a light occluder for the tile. .. _class_TileSet_tile_set_material: - void **tile_set_material** **(** :ref:`int` id, :ref:`ShaderMaterial` material **)** Set the material of the tile. .. _class_TileSet_tile_set_name: - void **tile_set_name** **(** :ref:`int` id, :ref:`String` name **)** Set the name of the tile, for descriptive purposes. .. _class_TileSet_tile_set_navigation_polygon: - void **tile_set_navigation_polygon** **(** :ref:`int` id, :ref:`NavigationPolygon` navigation_polygon **)** Set a navigation polygon for the tile. .. _class_TileSet_tile_set_navigation_polygon_offset: - void **tile_set_navigation_polygon_offset** **(** :ref:`int` id, :ref:`Vector2` navigation_polygon_offset **)** Set an offset for the tile's navigation polygon. .. _class_TileSet_tile_set_normal_map: - void **tile_set_normal_map** **(** :ref:`int` id, :ref:`Texture` normal_map **)** .. _class_TileSet_tile_set_occluder_offset: - void **tile_set_occluder_offset** **(** :ref:`int` id, :ref:`Vector2` occluder_offset **)** Set an offset for the tile's light occluder. .. _class_TileSet_tile_set_region: - void **tile_set_region** **(** :ref:`int` id, :ref:`Rect2` region **)** Set the tile sub-region in the texture. This is common in texture atlases. .. _class_TileSet_tile_set_shape: - void **tile_set_shape** **(** :ref:`int` id, :ref:`int` shape_id, :ref:`Shape2D` shape **)** .. _class_TileSet_tile_set_shape_one_way: - void **tile_set_shape_one_way** **(** :ref:`int` id, :ref:`int` shape_id, :ref:`bool` one_way **)** .. _class_TileSet_tile_set_shape_transform: - void **tile_set_shape_transform** **(** :ref:`int` id, :ref:`int` shape_id, :ref:`Transform2D` shape_transform **)** .. _class_TileSet_tile_set_shapes: - void **tile_set_shapes** **(** :ref:`int` id, :ref:`Array` shapes **)** Set an array of shapes for the tile, enabling physics to collide with it. .. _class_TileSet_tile_set_texture: - void **tile_set_texture** **(** :ref:`int` id, :ref:`Texture` texture **)** Set the texture of the tile. .. _class_TileSet_tile_set_texture_offset: - void **tile_set_texture_offset** **(** :ref:`int` id, :ref:`Vector2` texture_offset **)** Set the texture offset of the tile.