:github_url: hide .. Generated automatically by doc/tools/make_rst.py in Godot's source tree. .. DO NOT EDIT THIS FILE, but the TileSetScenesCollectionSource.xml source instead. .. The source is found in doc/classes or modules//doc_classes. .. _class_TileSetScenesCollectionSource: TileSetScenesCollectionSource ============================= **Inherits:** :ref:`TileSetSource` **<** :ref:`Resource` **<** :ref:`RefCounted` **<** :ref:`Object` Exposes a set of scenes as tiles for a :ref:`TileSet` resource. Description ----------- When placed on a :ref:`TileMap`, tiles from ``TileSetScenesCollectionSource`` will automatically instantiate an associated scene at the cell's position in the TileMap. Scenes are instantiated as children of the :ref:`TileMap` when it enters the tree. If you add/remove a scene tile in the :ref:`TileMap` that is already inside the tree, the :ref:`TileMap` will automatically instantiate/free the scene accordingly. Methods ------- +---------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`create_scene_tile` **(** :ref:`PackedScene` packed_scene, :ref:`int` id_override=-1 **)** | +---------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`get_next_scene_tile_id` **(** **)** |const| | +---------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`get_scene_tile_display_placeholder` **(** :ref:`int` id **)** |const| | +---------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`get_scene_tile_id` **(** :ref:`int` index **)** | +---------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`PackedScene` | :ref:`get_scene_tile_scene` **(** :ref:`int` id **)** |const| | +---------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`get_scene_tiles_count` **(** **)** | +---------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`has_scene_tile_id` **(** :ref:`int` id **)** | +---------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`remove_scene_tile` **(** :ref:`int` id **)** | +---------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_scene_tile_display_placeholder` **(** :ref:`int` id, :ref:`bool` display_placeholder **)** | +---------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_scene_tile_id` **(** :ref:`int` id, :ref:`int` new_id **)** | +---------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_scene_tile_scene` **(** :ref:`int` id, :ref:`PackedScene` packed_scene **)** | +---------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ Method Descriptions ------------------- .. _class_TileSetScenesCollectionSource_method_create_scene_tile: - :ref:`int` **create_scene_tile** **(** :ref:`PackedScene` packed_scene, :ref:`int` id_override=-1 **)** Creates a scene-based tile out of the given scene. Returns a newly generated unique ID. ---- .. _class_TileSetScenesCollectionSource_method_get_next_scene_tile_id: - :ref:`int` **get_next_scene_tile_id** **(** **)** |const| Returns the scene ID a following call to :ref:`create_scene_tile` would return. ---- .. _class_TileSetScenesCollectionSource_method_get_scene_tile_display_placeholder: - :ref:`bool` **get_scene_tile_display_placeholder** **(** :ref:`int` id **)** |const| Returns whether the scene tile with id ``id`` displays a placeholder in the editor. ---- .. _class_TileSetScenesCollectionSource_method_get_scene_tile_id: - :ref:`int` **get_scene_tile_id** **(** :ref:`int` index **)** Returns the scene tile ID of the scene tile at index ``index``. ---- .. _class_TileSetScenesCollectionSource_method_get_scene_tile_scene: - :ref:`PackedScene` **get_scene_tile_scene** **(** :ref:`int` id **)** |const| Returns the :ref:`PackedScene` resource of scene tile with id ``id``. ---- .. _class_TileSetScenesCollectionSource_method_get_scene_tiles_count: - :ref:`int` **get_scene_tiles_count** **(** **)** Returns the number or scene tiles this TileSet source has. ---- .. _class_TileSetScenesCollectionSource_method_has_scene_tile_id: - :ref:`bool` **has_scene_tile_id** **(** :ref:`int` id **)** Returns whether this TileSet source has a scene tile with id ``id``. ---- .. _class_TileSetScenesCollectionSource_method_remove_scene_tile: - void **remove_scene_tile** **(** :ref:`int` id **)** Remove the scene tile with id ``id``. ---- .. _class_TileSetScenesCollectionSource_method_set_scene_tile_display_placeholder: - void **set_scene_tile_display_placeholder** **(** :ref:`int` id, :ref:`bool` display_placeholder **)** Sets whether or not the scene tile with id ``id`` should display a placeholder in the editor. This might be useful for scenes that are not visible. ---- .. _class_TileSetScenesCollectionSource_method_set_scene_tile_id: - void **set_scene_tile_id** **(** :ref:`int` id, :ref:`int` new_id **)** Changes a scene tile's ID from ``id`` to ``new_id``. This will fail if there is already a tile with a ID equal to ``new_id``. ---- .. _class_TileSetScenesCollectionSource_method_set_scene_tile_scene: - void **set_scene_tile_scene** **(** :ref:`int` id, :ref:`PackedScene` packed_scene **)** Assigns a :ref:`PackedScene` resource to the scene tile with id ``id``. This will fail if the scene does not extend CanvasItem, as positioning properties are needed to place the scene on the TileMap. .. |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.)`