class_tilesetscenescollectionsource.rst 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204
  1. :github_url: hide
  2. .. DO NOT EDIT THIS FILE!!!
  3. .. Generated automatically from Godot engine sources.
  4. .. Generator: https://github.com/godotengine/godot/tree/4.2/doc/tools/make_rst.py.
  5. .. XML source: https://github.com/godotengine/godot/tree/4.2/doc/classes/TileSetScenesCollectionSource.xml.
  6. .. _class_TileSetScenesCollectionSource:
  7. TileSetScenesCollectionSource
  8. =============================
  9. **Inherits:** :ref:`TileSetSource<class_TileSetSource>` **<** :ref:`Resource<class_Resource>` **<** :ref:`RefCounted<class_RefCounted>` **<** :ref:`Object<class_Object>`
  10. Exposes a set of scenes as tiles for a :ref:`TileSet<class_TileSet>` resource.
  11. .. rst-class:: classref-introduction-group
  12. Description
  13. -----------
  14. When placed on a :ref:`TileMap<class_TileMap>`, tiles from **TileSetScenesCollectionSource** will automatically instantiate an associated scene at the cell's position in the TileMap.
  15. Scenes are instantiated as children of the :ref:`TileMap<class_TileMap>` when it enters the tree. If you add/remove a scene tile in the :ref:`TileMap<class_TileMap>` that is already inside the tree, the :ref:`TileMap<class_TileMap>` will automatically instantiate/free the scene accordingly.
  16. .. rst-class:: classref-reftable-group
  17. Methods
  18. -------
  19. .. table::
  20. :widths: auto
  21. +---------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  22. | :ref:`int<class_int>` | :ref:`create_scene_tile<class_TileSetScenesCollectionSource_method_create_scene_tile>` **(** :ref:`PackedScene<class_PackedScene>` packed_scene, :ref:`int<class_int>` id_override=-1 **)** |
  23. +---------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  24. | :ref:`int<class_int>` | :ref:`get_next_scene_tile_id<class_TileSetScenesCollectionSource_method_get_next_scene_tile_id>` **(** **)** |const| |
  25. +---------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  26. | :ref:`bool<class_bool>` | :ref:`get_scene_tile_display_placeholder<class_TileSetScenesCollectionSource_method_get_scene_tile_display_placeholder>` **(** :ref:`int<class_int>` id **)** |const| |
  27. +---------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  28. | :ref:`int<class_int>` | :ref:`get_scene_tile_id<class_TileSetScenesCollectionSource_method_get_scene_tile_id>` **(** :ref:`int<class_int>` index **)** |
  29. +---------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  30. | :ref:`PackedScene<class_PackedScene>` | :ref:`get_scene_tile_scene<class_TileSetScenesCollectionSource_method_get_scene_tile_scene>` **(** :ref:`int<class_int>` id **)** |const| |
  31. +---------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  32. | :ref:`int<class_int>` | :ref:`get_scene_tiles_count<class_TileSetScenesCollectionSource_method_get_scene_tiles_count>` **(** **)** |
  33. +---------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  34. | :ref:`bool<class_bool>` | :ref:`has_scene_tile_id<class_TileSetScenesCollectionSource_method_has_scene_tile_id>` **(** :ref:`int<class_int>` id **)** |
  35. +---------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  36. | void | :ref:`remove_scene_tile<class_TileSetScenesCollectionSource_method_remove_scene_tile>` **(** :ref:`int<class_int>` id **)** |
  37. +---------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  38. | void | :ref:`set_scene_tile_display_placeholder<class_TileSetScenesCollectionSource_method_set_scene_tile_display_placeholder>` **(** :ref:`int<class_int>` id, :ref:`bool<class_bool>` display_placeholder **)** |
  39. +---------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  40. | void | :ref:`set_scene_tile_id<class_TileSetScenesCollectionSource_method_set_scene_tile_id>` **(** :ref:`int<class_int>` id, :ref:`int<class_int>` new_id **)** |
  41. +---------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  42. | void | :ref:`set_scene_tile_scene<class_TileSetScenesCollectionSource_method_set_scene_tile_scene>` **(** :ref:`int<class_int>` id, :ref:`PackedScene<class_PackedScene>` packed_scene **)** |
  43. +---------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  44. .. rst-class:: classref-section-separator
  45. ----
  46. .. rst-class:: classref-descriptions-group
  47. Method Descriptions
  48. -------------------
  49. .. _class_TileSetScenesCollectionSource_method_create_scene_tile:
  50. .. rst-class:: classref-method
  51. :ref:`int<class_int>` **create_scene_tile** **(** :ref:`PackedScene<class_PackedScene>` packed_scene, :ref:`int<class_int>` id_override=-1 **)**
  52. Creates a scene-based tile out of the given scene.
  53. Returns a newly generated unique ID.
  54. .. rst-class:: classref-item-separator
  55. ----
  56. .. _class_TileSetScenesCollectionSource_method_get_next_scene_tile_id:
  57. .. rst-class:: classref-method
  58. :ref:`int<class_int>` **get_next_scene_tile_id** **(** **)** |const|
  59. Returns the scene ID a following call to :ref:`create_scene_tile<class_TileSetScenesCollectionSource_method_create_scene_tile>` would return.
  60. .. rst-class:: classref-item-separator
  61. ----
  62. .. _class_TileSetScenesCollectionSource_method_get_scene_tile_display_placeholder:
  63. .. rst-class:: classref-method
  64. :ref:`bool<class_bool>` **get_scene_tile_display_placeholder** **(** :ref:`int<class_int>` id **)** |const|
  65. Returns whether the scene tile with ``id`` displays a placeholder in the editor.
  66. .. rst-class:: classref-item-separator
  67. ----
  68. .. _class_TileSetScenesCollectionSource_method_get_scene_tile_id:
  69. .. rst-class:: classref-method
  70. :ref:`int<class_int>` **get_scene_tile_id** **(** :ref:`int<class_int>` index **)**
  71. Returns the scene tile ID of the scene tile at ``index``.
  72. .. rst-class:: classref-item-separator
  73. ----
  74. .. _class_TileSetScenesCollectionSource_method_get_scene_tile_scene:
  75. .. rst-class:: classref-method
  76. :ref:`PackedScene<class_PackedScene>` **get_scene_tile_scene** **(** :ref:`int<class_int>` id **)** |const|
  77. Returns the :ref:`PackedScene<class_PackedScene>` resource of scene tile with ``id``.
  78. .. rst-class:: classref-item-separator
  79. ----
  80. .. _class_TileSetScenesCollectionSource_method_get_scene_tiles_count:
  81. .. rst-class:: classref-method
  82. :ref:`int<class_int>` **get_scene_tiles_count** **(** **)**
  83. Returns the number or scene tiles this TileSet source has.
  84. .. rst-class:: classref-item-separator
  85. ----
  86. .. _class_TileSetScenesCollectionSource_method_has_scene_tile_id:
  87. .. rst-class:: classref-method
  88. :ref:`bool<class_bool>` **has_scene_tile_id** **(** :ref:`int<class_int>` id **)**
  89. Returns whether this TileSet source has a scene tile with ``id``.
  90. .. rst-class:: classref-item-separator
  91. ----
  92. .. _class_TileSetScenesCollectionSource_method_remove_scene_tile:
  93. .. rst-class:: classref-method
  94. void **remove_scene_tile** **(** :ref:`int<class_int>` id **)**
  95. Remove the scene tile with ``id``.
  96. .. rst-class:: classref-item-separator
  97. ----
  98. .. _class_TileSetScenesCollectionSource_method_set_scene_tile_display_placeholder:
  99. .. rst-class:: classref-method
  100. void **set_scene_tile_display_placeholder** **(** :ref:`int<class_int>` id, :ref:`bool<class_bool>` display_placeholder **)**
  101. Sets whether or not the scene tile with ``id`` should display a placeholder in the editor. This might be useful for scenes that are not visible.
  102. .. rst-class:: classref-item-separator
  103. ----
  104. .. _class_TileSetScenesCollectionSource_method_set_scene_tile_id:
  105. .. rst-class:: classref-method
  106. void **set_scene_tile_id** **(** :ref:`int<class_int>` id, :ref:`int<class_int>` new_id **)**
  107. Changes a scene tile's ID from ``id`` to ``new_id``. This will fail if there is already a tile with an ID equal to ``new_id``.
  108. .. rst-class:: classref-item-separator
  109. ----
  110. .. _class_TileSetScenesCollectionSource_method_set_scene_tile_scene:
  111. .. rst-class:: classref-method
  112. void **set_scene_tile_scene** **(** :ref:`int<class_int>` id, :ref:`PackedScene<class_PackedScene>` packed_scene **)**
  113. Assigns a :ref:`PackedScene<class_PackedScene>` resource to the scene tile with ``id``. This will fail if the scene does not extend CanvasItem, as positioning properties are needed to place the scene on the TileMap.
  114. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  115. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  116. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  117. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  118. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  119. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`
  120. .. |bitfield| replace:: :abbr:`BitField (This value is an integer composed as a bitmask of the following flags.)`