Files
godot-docs-l10n/classes/zh_Hans/class_tileset.rst

1621 lines
110 KiB
ReStructuredText
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

:github_url: hide
.. _class_TileSet:
TileSet
=======
**继承:** :ref:`Resource<class_Resource>` **<** :ref:`RefCounted<class_RefCounted>` **<** :ref:`Object<class_Object>`
Tilemap 的图块库。
.. rst-class:: classref-introduction-group
描述
----
TileSet 是 :ref:`TileMapLayer<class_TileMapLayer>` 的图块库。TileSet 处理 :ref:`TileSetSource<class_TileSetSource>` 列表,每个表中存储一组图块。
图块既可以来自 :ref:`TileSetAtlasSource<class_TileSetAtlasSource>`\ ,可以渲染纹理中的图块,支持物理、导航等功能,也可以来自 :ref:`TileSetScenesCollectionSource<class_TileSetScenesCollectionSource>`\ ,提供基于场景的图块。
图块通过使用三个 ID 来引用:源 ID、图集坐标 ID、备选图块 ID。
TileSet 可以配置图块暴露哪些属性。为了做到这一点TileSet 资源使用了属性层,你可以根据需要进行添加和删除。
例如,添加物理层可以为瓷砖提供碰撞形状。不同的层都有不同的属性(物理层和遮罩),要实现不同类型的碰撞,你也可以添加多个 TileSet 物理层。
更多信息请参阅添加新层的函数。
.. rst-class:: classref-introduction-group
教程
----
- :doc:`使用 Tilemap <../tutorials/2d/using_tilemaps>`
- `2D 平台跳跃演示 <https://godotengine.org/asset-library/asset/2727>`__
- `2D 等轴演示 <https://godotengine.org/asset-library/asset/2718>`__
- `2D 六边形演示 <https://godotengine.org/asset-library/asset/2717>`__
- `AStarGrid2D 的 2D 网格导航演示 <https://godotengine.org/asset-library/asset/2723>`__
- `2D 角色扮演游戏RPG演示 <https://godotengine.org/asset-library/asset/2729>`__
- `2D 运动学角色演示 <https://godotengine.org/asset-library/asset/2719>`__
.. rst-class:: classref-reftable-group
属性
----
.. table::
:widths: auto
+----------------------------------------------------+------------------------------------------------------------------+----------------------+
| :ref:`TileLayout<enum_TileSet_TileLayout>` | :ref:`tile_layout<class_TileSet_property_tile_layout>` | ``0`` |
+----------------------------------------------------+------------------------------------------------------------------+----------------------+
| :ref:`TileOffsetAxis<enum_TileSet_TileOffsetAxis>` | :ref:`tile_offset_axis<class_TileSet_property_tile_offset_axis>` | ``0`` |
+----------------------------------------------------+------------------------------------------------------------------+----------------------+
| :ref:`TileShape<enum_TileSet_TileShape>` | :ref:`tile_shape<class_TileSet_property_tile_shape>` | ``0`` |
+----------------------------------------------------+------------------------------------------------------------------+----------------------+
| :ref:`Vector2i<class_Vector2i>` | :ref:`tile_size<class_TileSet_property_tile_size>` | ``Vector2i(16, 16)`` |
+----------------------------------------------------+------------------------------------------------------------------+----------------------+
| :ref:`bool<class_bool>` | :ref:`uv_clipping<class_TileSet_property_uv_clipping>` | ``false`` |
+----------------------------------------------------+------------------------------------------------------------------+----------------------+
.. rst-class:: classref-reftable-group
方法
----
.. table::
:widths: auto
+-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| |void| | :ref:`add_custom_data_layer<class_TileSet_method_add_custom_data_layer>`\ (\ to_position\: :ref:`int<class_int>` = -1\ ) |
+-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| |void| | :ref:`add_navigation_layer<class_TileSet_method_add_navigation_layer>`\ (\ to_position\: :ref:`int<class_int>` = -1\ ) |
+-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| |void| | :ref:`add_occlusion_layer<class_TileSet_method_add_occlusion_layer>`\ (\ to_position\: :ref:`int<class_int>` = -1\ ) |
+-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`add_pattern<class_TileSet_method_add_pattern>`\ (\ pattern\: :ref:`TileMapPattern<class_TileMapPattern>`, index\: :ref:`int<class_int>` = -1\ ) |
+-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| |void| | :ref:`add_physics_layer<class_TileSet_method_add_physics_layer>`\ (\ to_position\: :ref:`int<class_int>` = -1\ ) |
+-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`add_source<class_TileSet_method_add_source>`\ (\ source\: :ref:`TileSetSource<class_TileSetSource>`, atlas_source_id_override\: :ref:`int<class_int>` = -1\ ) |
+-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| |void| | :ref:`add_terrain<class_TileSet_method_add_terrain>`\ (\ terrain_set\: :ref:`int<class_int>`, to_position\: :ref:`int<class_int>` = -1\ ) |
+-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| |void| | :ref:`add_terrain_set<class_TileSet_method_add_terrain_set>`\ (\ to_position\: :ref:`int<class_int>` = -1\ ) |
+-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| |void| | :ref:`cleanup_invalid_tile_proxies<class_TileSet_method_cleanup_invalid_tile_proxies>`\ (\ ) |
+-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| |void| | :ref:`clear_tile_proxies<class_TileSet_method_clear_tile_proxies>`\ (\ ) |
+-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Array<class_Array>` | :ref:`get_alternative_level_tile_proxy<class_TileSet_method_get_alternative_level_tile_proxy>`\ (\ source_from\: :ref:`int<class_int>`, coords_from\: :ref:`Vector2i<class_Vector2i>`, alternative_from\: :ref:`int<class_int>`\ ) |
+-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Array<class_Array>` | :ref:`get_coords_level_tile_proxy<class_TileSet_method_get_coords_level_tile_proxy>`\ (\ source_from\: :ref:`int<class_int>`, coords_from\: :ref:`Vector2i<class_Vector2i>`\ ) |
+-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`get_custom_data_layer_by_name<class_TileSet_method_get_custom_data_layer_by_name>`\ (\ layer_name\: :ref:`String<class_String>`\ ) |const| |
+-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`String<class_String>` | :ref:`get_custom_data_layer_name<class_TileSet_method_get_custom_data_layer_name>`\ (\ layer_index\: :ref:`int<class_int>`\ ) |const| |
+-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Variant.Type<enum_@GlobalScope_Variant.Type>` | :ref:`get_custom_data_layer_type<class_TileSet_method_get_custom_data_layer_type>`\ (\ layer_index\: :ref:`int<class_int>`\ ) |const| |
+-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`get_custom_data_layers_count<class_TileSet_method_get_custom_data_layers_count>`\ (\ ) |const| |
+-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`get_navigation_layer_layer_value<class_TileSet_method_get_navigation_layer_layer_value>`\ (\ layer_index\: :ref:`int<class_int>`, layer_number\: :ref:`int<class_int>`\ ) |const| |
+-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`get_navigation_layer_layers<class_TileSet_method_get_navigation_layer_layers>`\ (\ layer_index\: :ref:`int<class_int>`\ ) |const| |
+-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`get_navigation_layers_count<class_TileSet_method_get_navigation_layers_count>`\ (\ ) |const| |
+-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`get_next_source_id<class_TileSet_method_get_next_source_id>`\ (\ ) |const| |
+-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`get_occlusion_layer_light_mask<class_TileSet_method_get_occlusion_layer_light_mask>`\ (\ layer_index\: :ref:`int<class_int>`\ ) |const| |
+-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`get_occlusion_layer_sdf_collision<class_TileSet_method_get_occlusion_layer_sdf_collision>`\ (\ layer_index\: :ref:`int<class_int>`\ ) |const| |
+-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`get_occlusion_layers_count<class_TileSet_method_get_occlusion_layers_count>`\ (\ ) |const| |
+-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`TileMapPattern<class_TileMapPattern>` | :ref:`get_pattern<class_TileSet_method_get_pattern>`\ (\ index\: :ref:`int<class_int>` = -1\ ) |
+-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`get_patterns_count<class_TileSet_method_get_patterns_count>`\ (\ ) |
+-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`get_physics_layer_collision_layer<class_TileSet_method_get_physics_layer_collision_layer>`\ (\ layer_index\: :ref:`int<class_int>`\ ) |const| |
+-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`get_physics_layer_collision_mask<class_TileSet_method_get_physics_layer_collision_mask>`\ (\ layer_index\: :ref:`int<class_int>`\ ) |const| |
+-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`float<class_float>` | :ref:`get_physics_layer_collision_priority<class_TileSet_method_get_physics_layer_collision_priority>`\ (\ layer_index\: :ref:`int<class_int>`\ ) |const| |
+-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`PhysicsMaterial<class_PhysicsMaterial>` | :ref:`get_physics_layer_physics_material<class_TileSet_method_get_physics_layer_physics_material>`\ (\ layer_index\: :ref:`int<class_int>`\ ) |const| |
+-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`get_physics_layers_count<class_TileSet_method_get_physics_layers_count>`\ (\ ) |const| |
+-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`TileSetSource<class_TileSetSource>` | :ref:`get_source<class_TileSet_method_get_source>`\ (\ source_id\: :ref:`int<class_int>`\ ) |const| |
+-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`get_source_count<class_TileSet_method_get_source_count>`\ (\ ) |const| |
+-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`get_source_id<class_TileSet_method_get_source_id>`\ (\ index\: :ref:`int<class_int>`\ ) |const| |
+-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`get_source_level_tile_proxy<class_TileSet_method_get_source_level_tile_proxy>`\ (\ source_from\: :ref:`int<class_int>`\ ) |
+-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Color<class_Color>` | :ref:`get_terrain_color<class_TileSet_method_get_terrain_color>`\ (\ terrain_set\: :ref:`int<class_int>`, terrain_index\: :ref:`int<class_int>`\ ) |const| |
+-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`String<class_String>` | :ref:`get_terrain_name<class_TileSet_method_get_terrain_name>`\ (\ terrain_set\: :ref:`int<class_int>`, terrain_index\: :ref:`int<class_int>`\ ) |const| |
+-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`TerrainMode<enum_TileSet_TerrainMode>` | :ref:`get_terrain_set_mode<class_TileSet_method_get_terrain_set_mode>`\ (\ terrain_set\: :ref:`int<class_int>`\ ) |const| |
+-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`get_terrain_sets_count<class_TileSet_method_get_terrain_sets_count>`\ (\ ) |const| |
+-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`get_terrains_count<class_TileSet_method_get_terrains_count>`\ (\ terrain_set\: :ref:`int<class_int>`\ ) |const| |
+-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`has_alternative_level_tile_proxy<class_TileSet_method_has_alternative_level_tile_proxy>`\ (\ source_from\: :ref:`int<class_int>`, coords_from\: :ref:`Vector2i<class_Vector2i>`, alternative_from\: :ref:`int<class_int>`\ ) |
+-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`has_coords_level_tile_proxy<class_TileSet_method_has_coords_level_tile_proxy>`\ (\ source_from\: :ref:`int<class_int>`, coords_from\: :ref:`Vector2i<class_Vector2i>`\ ) |
+-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`has_custom_data_layer_by_name<class_TileSet_method_has_custom_data_layer_by_name>`\ (\ layer_name\: :ref:`String<class_String>`\ ) |const| |
+-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`has_source<class_TileSet_method_has_source>`\ (\ source_id\: :ref:`int<class_int>`\ ) |const| |
+-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`has_source_level_tile_proxy<class_TileSet_method_has_source_level_tile_proxy>`\ (\ source_from\: :ref:`int<class_int>`\ ) |
+-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Array<class_Array>` | :ref:`map_tile_proxy<class_TileSet_method_map_tile_proxy>`\ (\ source_from\: :ref:`int<class_int>`, coords_from\: :ref:`Vector2i<class_Vector2i>`, alternative_from\: :ref:`int<class_int>`\ ) |const| |
+-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| |void| | :ref:`move_custom_data_layer<class_TileSet_method_move_custom_data_layer>`\ (\ layer_index\: :ref:`int<class_int>`, to_position\: :ref:`int<class_int>`\ ) |
+-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| |void| | :ref:`move_navigation_layer<class_TileSet_method_move_navigation_layer>`\ (\ layer_index\: :ref:`int<class_int>`, to_position\: :ref:`int<class_int>`\ ) |
+-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| |void| | :ref:`move_occlusion_layer<class_TileSet_method_move_occlusion_layer>`\ (\ layer_index\: :ref:`int<class_int>`, to_position\: :ref:`int<class_int>`\ ) |
+-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| |void| | :ref:`move_physics_layer<class_TileSet_method_move_physics_layer>`\ (\ layer_index\: :ref:`int<class_int>`, to_position\: :ref:`int<class_int>`\ ) |
+-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| |void| | :ref:`move_terrain<class_TileSet_method_move_terrain>`\ (\ terrain_set\: :ref:`int<class_int>`, terrain_index\: :ref:`int<class_int>`, to_position\: :ref:`int<class_int>`\ ) |
+-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| |void| | :ref:`move_terrain_set<class_TileSet_method_move_terrain_set>`\ (\ terrain_set\: :ref:`int<class_int>`, to_position\: :ref:`int<class_int>`\ ) |
+-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| |void| | :ref:`remove_alternative_level_tile_proxy<class_TileSet_method_remove_alternative_level_tile_proxy>`\ (\ source_from\: :ref:`int<class_int>`, coords_from\: :ref:`Vector2i<class_Vector2i>`, alternative_from\: :ref:`int<class_int>`\ ) |
+-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| |void| | :ref:`remove_coords_level_tile_proxy<class_TileSet_method_remove_coords_level_tile_proxy>`\ (\ source_from\: :ref:`int<class_int>`, coords_from\: :ref:`Vector2i<class_Vector2i>`\ ) |
+-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| |void| | :ref:`remove_custom_data_layer<class_TileSet_method_remove_custom_data_layer>`\ (\ layer_index\: :ref:`int<class_int>`\ ) |
+-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| |void| | :ref:`remove_navigation_layer<class_TileSet_method_remove_navigation_layer>`\ (\ layer_index\: :ref:`int<class_int>`\ ) |
+-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| |void| | :ref:`remove_occlusion_layer<class_TileSet_method_remove_occlusion_layer>`\ (\ layer_index\: :ref:`int<class_int>`\ ) |
+-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| |void| | :ref:`remove_pattern<class_TileSet_method_remove_pattern>`\ (\ index\: :ref:`int<class_int>`\ ) |
+-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| |void| | :ref:`remove_physics_layer<class_TileSet_method_remove_physics_layer>`\ (\ layer_index\: :ref:`int<class_int>`\ ) |
+-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| |void| | :ref:`remove_source<class_TileSet_method_remove_source>`\ (\ source_id\: :ref:`int<class_int>`\ ) |
+-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| |void| | :ref:`remove_source_level_tile_proxy<class_TileSet_method_remove_source_level_tile_proxy>`\ (\ source_from\: :ref:`int<class_int>`\ ) |
+-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| |void| | :ref:`remove_terrain<class_TileSet_method_remove_terrain>`\ (\ terrain_set\: :ref:`int<class_int>`, terrain_index\: :ref:`int<class_int>`\ ) |
+-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| |void| | :ref:`remove_terrain_set<class_TileSet_method_remove_terrain_set>`\ (\ terrain_set\: :ref:`int<class_int>`\ ) |
+-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| |void| | :ref:`set_alternative_level_tile_proxy<class_TileSet_method_set_alternative_level_tile_proxy>`\ (\ source_from\: :ref:`int<class_int>`, coords_from\: :ref:`Vector2i<class_Vector2i>`, alternative_from\: :ref:`int<class_int>`, source_to\: :ref:`int<class_int>`, coords_to\: :ref:`Vector2i<class_Vector2i>`, alternative_to\: :ref:`int<class_int>`\ ) |
+-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| |void| | :ref:`set_coords_level_tile_proxy<class_TileSet_method_set_coords_level_tile_proxy>`\ (\ p_source_from\: :ref:`int<class_int>`, coords_from\: :ref:`Vector2i<class_Vector2i>`, source_to\: :ref:`int<class_int>`, coords_to\: :ref:`Vector2i<class_Vector2i>`\ ) |
+-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| |void| | :ref:`set_custom_data_layer_name<class_TileSet_method_set_custom_data_layer_name>`\ (\ layer_index\: :ref:`int<class_int>`, layer_name\: :ref:`String<class_String>`\ ) |
+-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| |void| | :ref:`set_custom_data_layer_type<class_TileSet_method_set_custom_data_layer_type>`\ (\ layer_index\: :ref:`int<class_int>`, layer_type\: :ref:`Variant.Type<enum_@GlobalScope_Variant.Type>`\ ) |
+-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| |void| | :ref:`set_navigation_layer_layer_value<class_TileSet_method_set_navigation_layer_layer_value>`\ (\ layer_index\: :ref:`int<class_int>`, layer_number\: :ref:`int<class_int>`, value\: :ref:`bool<class_bool>`\ ) |
+-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| |void| | :ref:`set_navigation_layer_layers<class_TileSet_method_set_navigation_layer_layers>`\ (\ layer_index\: :ref:`int<class_int>`, layers\: :ref:`int<class_int>`\ ) |
+-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| |void| | :ref:`set_occlusion_layer_light_mask<class_TileSet_method_set_occlusion_layer_light_mask>`\ (\ layer_index\: :ref:`int<class_int>`, light_mask\: :ref:`int<class_int>`\ ) |
+-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| |void| | :ref:`set_occlusion_layer_sdf_collision<class_TileSet_method_set_occlusion_layer_sdf_collision>`\ (\ layer_index\: :ref:`int<class_int>`, sdf_collision\: :ref:`bool<class_bool>`\ ) |
+-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| |void| | :ref:`set_physics_layer_collision_layer<class_TileSet_method_set_physics_layer_collision_layer>`\ (\ layer_index\: :ref:`int<class_int>`, layer\: :ref:`int<class_int>`\ ) |
+-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| |void| | :ref:`set_physics_layer_collision_mask<class_TileSet_method_set_physics_layer_collision_mask>`\ (\ layer_index\: :ref:`int<class_int>`, mask\: :ref:`int<class_int>`\ ) |
+-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| |void| | :ref:`set_physics_layer_collision_priority<class_TileSet_method_set_physics_layer_collision_priority>`\ (\ layer_index\: :ref:`int<class_int>`, priority\: :ref:`float<class_float>`\ ) |
+-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| |void| | :ref:`set_physics_layer_physics_material<class_TileSet_method_set_physics_layer_physics_material>`\ (\ layer_index\: :ref:`int<class_int>`, physics_material\: :ref:`PhysicsMaterial<class_PhysicsMaterial>`\ ) |
+-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| |void| | :ref:`set_source_id<class_TileSet_method_set_source_id>`\ (\ source_id\: :ref:`int<class_int>`, new_source_id\: :ref:`int<class_int>`\ ) |
+-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| |void| | :ref:`set_source_level_tile_proxy<class_TileSet_method_set_source_level_tile_proxy>`\ (\ source_from\: :ref:`int<class_int>`, source_to\: :ref:`int<class_int>`\ ) |
+-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| |void| | :ref:`set_terrain_color<class_TileSet_method_set_terrain_color>`\ (\ terrain_set\: :ref:`int<class_int>`, terrain_index\: :ref:`int<class_int>`, color\: :ref:`Color<class_Color>`\ ) |
+-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| |void| | :ref:`set_terrain_name<class_TileSet_method_set_terrain_name>`\ (\ terrain_set\: :ref:`int<class_int>`, terrain_index\: :ref:`int<class_int>`, name\: :ref:`String<class_String>`\ ) |
+-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| |void| | :ref:`set_terrain_set_mode<class_TileSet_method_set_terrain_set_mode>`\ (\ terrain_set\: :ref:`int<class_int>`, mode\: :ref:`TerrainMode<enum_TileSet_TerrainMode>`\ ) |
+-----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
.. rst-class:: classref-section-separator
----
.. rst-class:: classref-descriptions-group
枚举
----
.. _enum_TileSet_TileShape:
.. rst-class:: classref-enumeration
enum **TileShape**: :ref:`🔗<enum_TileSet_TileShape>`
.. _class_TileSet_constant_TILE_SHAPE_SQUARE:
.. rst-class:: classref-enumeration-constant
:ref:`TileShape<enum_TileSet_TileShape>` **TILE_SHAPE_SQUARE** = ``0``
矩形图块形状。
.. _class_TileSet_constant_TILE_SHAPE_ISOMETRIC:
.. rst-class:: classref-enumeration-constant
:ref:`TileShape<enum_TileSet_TileShape>` **TILE_SHAPE_ISOMETRIC** = ``1``
钻石图块形状(用于等轴外观)。
\ **注意:**\ 等轴 **TileSet** 在所有同级 :ref:`TileMapLayer<class_TileMapLayer>` 及其派生自 :ref:`Node2D<class_Node2D>` 的父节点都启用了Y 排序时效果最好。
.. _class_TileSet_constant_TILE_SHAPE_HALF_OFFSET_SQUARE:
.. rst-class:: classref-enumeration-constant
:ref:`TileShape<enum_TileSet_TileShape>` **TILE_SHAPE_HALF_OFFSET_SQUARE** = ``2``
矩形图块形状,每隔一行/列偏移半个图块。
.. _class_TileSet_constant_TILE_SHAPE_HEXAGON:
.. rst-class:: classref-enumeration-constant
:ref:`TileShape<enum_TileSet_TileShape>` **TILE_SHAPE_HEXAGON** = ``3``
六边形图块形状。
.. rst-class:: classref-item-separator
----
.. _enum_TileSet_TileLayout:
.. rst-class:: classref-enumeration
enum **TileLayout**: :ref:`🔗<enum_TileSet_TileLayout>`
.. _class_TileSet_constant_TILE_LAYOUT_STACKED:
.. rst-class:: classref-enumeration-constant
:ref:`TileLayout<enum_TileSet_TileLayout>` **TILE_LAYOUT_STACKED** = ``0``
图块坐标布局,两个轴与对应的局部水平轴和垂直轴保持一致。
.. _class_TileSet_constant_TILE_LAYOUT_STACKED_OFFSET:
.. rst-class:: classref-enumeration-constant
:ref:`TileLayout<enum_TileSet_TileLayout>` **TILE_LAYOUT_STACKED_OFFSET** = ``1``
:ref:`TILE_LAYOUT_STACKED<class_TileSet_constant_TILE_LAYOUT_STACKED>` 相同,但第一个半偏移偏向负方向,而不是正方向。
.. _class_TileSet_constant_TILE_LAYOUT_STAIRS_RIGHT:
.. rst-class:: classref-enumeration-constant
:ref:`TileLayout<enum_TileSet_TileLayout>` **TILE_LAYOUT_STAIRS_RIGHT** = ``2``
图块坐标布局,水平轴保持水平,垂直轴朝向右下方。
.. _class_TileSet_constant_TILE_LAYOUT_STAIRS_DOWN:
.. rst-class:: classref-enumeration-constant
:ref:`TileLayout<enum_TileSet_TileLayout>` **TILE_LAYOUT_STAIRS_DOWN** = ``3``
图块坐标布局,垂直轴保持垂直,水平轴朝向右下方。
.. _class_TileSet_constant_TILE_LAYOUT_DIAMOND_RIGHT:
.. rst-class:: classref-enumeration-constant
:ref:`TileLayout<enum_TileSet_TileLayout>` **TILE_LAYOUT_DIAMOND_RIGHT** = ``4``
图块坐标布局,水平轴朝向右上方,垂直轴朝向右下方。
.. _class_TileSet_constant_TILE_LAYOUT_DIAMOND_DOWN:
.. rst-class:: classref-enumeration-constant
:ref:`TileLayout<enum_TileSet_TileLayout>` **TILE_LAYOUT_DIAMOND_DOWN** = ``5``
图块坐标布局,水平轴朝向右下方,垂直轴朝向左下方。
.. rst-class:: classref-item-separator
----
.. _enum_TileSet_TileOffsetAxis:
.. rst-class:: classref-enumeration
enum **TileOffsetAxis**: :ref:`🔗<enum_TileSet_TileOffsetAxis>`
.. _class_TileSet_constant_TILE_OFFSET_AXIS_HORIZONTAL:
.. rst-class:: classref-enumeration-constant
:ref:`TileOffsetAxis<enum_TileSet_TileOffsetAxis>` **TILE_OFFSET_AXIS_HORIZONTAL** = ``0``
水平半偏移。
.. _class_TileSet_constant_TILE_OFFSET_AXIS_VERTICAL:
.. rst-class:: classref-enumeration-constant
:ref:`TileOffsetAxis<enum_TileSet_TileOffsetAxis>` **TILE_OFFSET_AXIS_VERTICAL** = ``1``
垂直半偏移。
.. rst-class:: classref-item-separator
----
.. _enum_TileSet_CellNeighbor:
.. rst-class:: classref-enumeration
enum **CellNeighbor**: :ref:`🔗<enum_TileSet_CellNeighbor>`
.. _class_TileSet_constant_CELL_NEIGHBOR_RIGHT_SIDE:
.. rst-class:: classref-enumeration-constant
:ref:`CellNeighbor<enum_TileSet_CellNeighbor>` **CELL_NEIGHBOR_RIGHT_SIDE** = ``0``
右侧相邻单元格。
.. _class_TileSet_constant_CELL_NEIGHBOR_RIGHT_CORNER:
.. rst-class:: classref-enumeration-constant
:ref:`CellNeighbor<enum_TileSet_CellNeighbor>` **CELL_NEIGHBOR_RIGHT_CORNER** = ``1``
右角相邻单元格。
.. _class_TileSet_constant_CELL_NEIGHBOR_BOTTOM_RIGHT_SIDE:
.. rst-class:: classref-enumeration-constant
:ref:`CellNeighbor<enum_TileSet_CellNeighbor>` **CELL_NEIGHBOR_BOTTOM_RIGHT_SIDE** = ``2``
右下侧相邻单元格。
.. _class_TileSet_constant_CELL_NEIGHBOR_BOTTOM_RIGHT_CORNER:
.. rst-class:: classref-enumeration-constant
:ref:`CellNeighbor<enum_TileSet_CellNeighbor>` **CELL_NEIGHBOR_BOTTOM_RIGHT_CORNER** = ``3``
右下角相邻单元格。
.. _class_TileSet_constant_CELL_NEIGHBOR_BOTTOM_SIDE:
.. rst-class:: classref-enumeration-constant
:ref:`CellNeighbor<enum_TileSet_CellNeighbor>` **CELL_NEIGHBOR_BOTTOM_SIDE** = ``4``
下侧相邻单元格。
.. _class_TileSet_constant_CELL_NEIGHBOR_BOTTOM_CORNER:
.. rst-class:: classref-enumeration-constant
:ref:`CellNeighbor<enum_TileSet_CellNeighbor>` **CELL_NEIGHBOR_BOTTOM_CORNER** = ``5``
下角相邻单元格。
.. _class_TileSet_constant_CELL_NEIGHBOR_BOTTOM_LEFT_SIDE:
.. rst-class:: classref-enumeration-constant
:ref:`CellNeighbor<enum_TileSet_CellNeighbor>` **CELL_NEIGHBOR_BOTTOM_LEFT_SIDE** = ``6``
左下侧相邻单元格。
.. _class_TileSet_constant_CELL_NEIGHBOR_BOTTOM_LEFT_CORNER:
.. rst-class:: classref-enumeration-constant
:ref:`CellNeighbor<enum_TileSet_CellNeighbor>` **CELL_NEIGHBOR_BOTTOM_LEFT_CORNER** = ``7``
左下角相邻单元格。
.. _class_TileSet_constant_CELL_NEIGHBOR_LEFT_SIDE:
.. rst-class:: classref-enumeration-constant
:ref:`CellNeighbor<enum_TileSet_CellNeighbor>` **CELL_NEIGHBOR_LEFT_SIDE** = ``8``
左侧相邻单元格。
.. _class_TileSet_constant_CELL_NEIGHBOR_LEFT_CORNER:
.. rst-class:: classref-enumeration-constant
:ref:`CellNeighbor<enum_TileSet_CellNeighbor>` **CELL_NEIGHBOR_LEFT_CORNER** = ``9``
左角相邻单元格。
.. _class_TileSet_constant_CELL_NEIGHBOR_TOP_LEFT_SIDE:
.. rst-class:: classref-enumeration-constant
:ref:`CellNeighbor<enum_TileSet_CellNeighbor>` **CELL_NEIGHBOR_TOP_LEFT_SIDE** = ``10``
左上侧相邻单元格。
.. _class_TileSet_constant_CELL_NEIGHBOR_TOP_LEFT_CORNER:
.. rst-class:: classref-enumeration-constant
:ref:`CellNeighbor<enum_TileSet_CellNeighbor>` **CELL_NEIGHBOR_TOP_LEFT_CORNER** = ``11``
左上角相邻单元格。
.. _class_TileSet_constant_CELL_NEIGHBOR_TOP_SIDE:
.. rst-class:: classref-enumeration-constant
:ref:`CellNeighbor<enum_TileSet_CellNeighbor>` **CELL_NEIGHBOR_TOP_SIDE** = ``12``
上侧相邻单元格。
.. _class_TileSet_constant_CELL_NEIGHBOR_TOP_CORNER:
.. rst-class:: classref-enumeration-constant
:ref:`CellNeighbor<enum_TileSet_CellNeighbor>` **CELL_NEIGHBOR_TOP_CORNER** = ``13``
上角相邻单元格。
.. _class_TileSet_constant_CELL_NEIGHBOR_TOP_RIGHT_SIDE:
.. rst-class:: classref-enumeration-constant
:ref:`CellNeighbor<enum_TileSet_CellNeighbor>` **CELL_NEIGHBOR_TOP_RIGHT_SIDE** = ``14``
右上侧相邻单元格。
.. _class_TileSet_constant_CELL_NEIGHBOR_TOP_RIGHT_CORNER:
.. rst-class:: classref-enumeration-constant
:ref:`CellNeighbor<enum_TileSet_CellNeighbor>` **CELL_NEIGHBOR_TOP_RIGHT_CORNER** = ``15``
右上角相邻单元格。
.. rst-class:: classref-item-separator
----
.. _enum_TileSet_TerrainMode:
.. rst-class:: classref-enumeration
enum **TerrainMode**: :ref:`🔗<enum_TileSet_TerrainMode>`
.. _class_TileSet_constant_TERRAIN_MODE_MATCH_CORNERS_AND_SIDES:
.. rst-class:: classref-enumeration-constant
:ref:`TerrainMode<enum_TileSet_TerrainMode>` **TERRAIN_MODE_MATCH_CORNERS_AND_SIDES** = ``0``
要求与相邻图块地形的角和边都匹配。
.. _class_TileSet_constant_TERRAIN_MODE_MATCH_CORNERS:
.. rst-class:: classref-enumeration-constant
:ref:`TerrainMode<enum_TileSet_TerrainMode>` **TERRAIN_MODE_MATCH_CORNERS** = ``1``
要求与相邻图块地形的角相匹配。
.. _class_TileSet_constant_TERRAIN_MODE_MATCH_SIDES:
.. rst-class:: classref-enumeration-constant
:ref:`TerrainMode<enum_TileSet_TerrainMode>` **TERRAIN_MODE_MATCH_SIDES** = ``2``
要求与相邻图块地形的边相匹配。
.. rst-class:: classref-section-separator
----
.. rst-class:: classref-descriptions-group
属性说明
--------
.. _class_TileSet_property_tile_layout:
.. rst-class:: classref-property
:ref:`TileLayout<enum_TileSet_TileLayout>` **tile_layout** = ``0`` :ref:`🔗<class_TileSet_property_tile_layout>`
.. rst-class:: classref-property-setget
- |void| **set_tile_layout**\ (\ value\: :ref:`TileLayout<enum_TileSet_TileLayout>`\ )
- :ref:`TileLayout<enum_TileSet_TileLayout>` **get_tile_layout**\ (\ )
对于所有半偏移形状(等轴、六边形和半偏移正方形),更改图块在 :ref:`TileMapLayer<class_TileMapLayer>` 栅格中的索引方式。
.. rst-class:: classref-item-separator
----
.. _class_TileSet_property_tile_offset_axis:
.. rst-class:: classref-property
:ref:`TileOffsetAxis<enum_TileSet_TileOffsetAxis>` **tile_offset_axis** = ``0`` :ref:`🔗<class_TileSet_property_tile_offset_axis>`
.. rst-class:: classref-property-setget
- |void| **set_tile_offset_axis**\ (\ value\: :ref:`TileOffsetAxis<enum_TileSet_TileOffsetAxis>`\ )
- :ref:`TileOffsetAxis<enum_TileSet_TileOffsetAxis>` **get_tile_offset_axis**\ (\ )
对于所有半偏移形状(等轴、六边形和半偏移正方形),确定偏移轴。
.. rst-class:: classref-item-separator
----
.. _class_TileSet_property_tile_shape:
.. rst-class:: classref-property
:ref:`TileShape<enum_TileSet_TileShape>` **tile_shape** = ``0`` :ref:`🔗<class_TileSet_property_tile_shape>`
.. rst-class:: classref-property-setget
- |void| **set_tile_shape**\ (\ value\: :ref:`TileShape<enum_TileSet_TileShape>`\ )
- :ref:`TileShape<enum_TileSet_TileShape>` **get_tile_shape**\ (\ )
图块的形状。
.. rst-class:: classref-item-separator
----
.. _class_TileSet_property_tile_size:
.. rst-class:: classref-property
:ref:`Vector2i<class_Vector2i>` **tile_size** = ``Vector2i(16, 16)`` :ref:`🔗<class_TileSet_property_tile_size>`
.. rst-class:: classref-property-setget
- |void| **set_tile_size**\ (\ value\: :ref:`Vector2i<class_Vector2i>`\ )
- :ref:`Vector2i<class_Vector2i>` **get_tile_size**\ (\ )
图块的大小,单位为像素。无论图块是什么形状,这个大小对应的都是图块形状的包围矩形。因此,这是图集所需的最小单元格大小。
.. rst-class:: classref-item-separator
----
.. _class_TileSet_property_uv_clipping:
.. rst-class:: classref-property
:ref:`bool<class_bool>` **uv_clipping** = ``false`` :ref:`🔗<class_TileSet_property_uv_clipping>`
.. rst-class:: classref-property-setget
- |void| **set_uv_clipping**\ (\ value\: :ref:`bool<class_bool>`\ )
- :ref:`bool<class_bool>` **is_uv_clipping**\ (\ )
渲染图块时启用/禁用 UV 裁剪。
.. rst-class:: classref-section-separator
----
.. rst-class:: classref-descriptions-group
方法说明
--------
.. _class_TileSet_method_add_custom_data_layer:
.. rst-class:: classref-method
|void| **add_custom_data_layer**\ (\ to_position\: :ref:`int<class_int>` = -1\ ) :ref:`🔗<class_TileSet_method_add_custom_data_layer>`
在 TileSet 中添加自定义数据层,放置到数组中的 ``to_position`` 位置。如果 ``to_position`` 为 -1则会将其添加到数组的末尾。
自定义数据层能够为图集图块分配自定义属性。
.. rst-class:: classref-item-separator
----
.. _class_TileSet_method_add_navigation_layer:
.. rst-class:: classref-method
|void| **add_navigation_layer**\ (\ to_position\: :ref:`int<class_int>` = -1\ ) :ref:`🔗<class_TileSet_method_add_navigation_layer>`
在 TileSet 中添加导航层,放置到数组中的 ``to_position`` 位置。如果 ``to_position`` 为 -1则会将其添加到数组的末尾。
导航层能够为图集图块分配导航区域。
.. rst-class:: classref-item-separator
----
.. _class_TileSet_method_add_occlusion_layer:
.. rst-class:: classref-method
|void| **add_occlusion_layer**\ (\ to_position\: :ref:`int<class_int>` = -1\ ) :ref:`🔗<class_TileSet_method_add_occlusion_layer>`
在 TileSet 中添加遮挡层,放置到数组中的 ``to_position`` 位置。如果 ``to_position`` 为 -1则会将其添加到数组的末尾。
遮挡层能够为图集图块分配遮挡多边形。
.. rst-class:: classref-item-separator
----
.. _class_TileSet_method_add_pattern:
.. rst-class:: classref-method
:ref:`int<class_int>` **add_pattern**\ (\ pattern\: :ref:`TileMapPattern<class_TileMapPattern>`, index\: :ref:`int<class_int>` = -1\ ) :ref:`🔗<class_TileSet_method_add_pattern>`
添加存储在 TileSet 资源中的 :ref:`TileMapPattern<class_TileMapPattern>`\ 。如果提供了 ``index``\ ,则会插入到给定的位置。
.. rst-class:: classref-item-separator
----
.. _class_TileSet_method_add_physics_layer:
.. rst-class:: classref-method
|void| **add_physics_layer**\ (\ to_position\: :ref:`int<class_int>` = -1\ ) :ref:`🔗<class_TileSet_method_add_physics_layer>`
在 TileSet 中添加物理层,放置到数组中的 ``to_position`` 位置。如果 ``to_position`` 为 -1则会将其添加到数组的末尾。
物理层能够为图集图块分配碰撞多边形。
.. rst-class:: classref-item-separator
----
.. _class_TileSet_method_add_source:
.. rst-class:: classref-method
:ref:`int<class_int>` **add_source**\ (\ source\: :ref:`TileSetSource<class_TileSetSource>`, atlas_source_id_override\: :ref:`int<class_int>` = -1\ ) :ref:`🔗<class_TileSet_method_add_source>`
在 TileSet 中添加 :ref:`TileSetSource<class_TileSetSource>`\ 。如果 ``atlas_source_id_override`` 不为 -1则还会设置其源 ID。否则会自动生成唯一标识符。
函数返回添加的源 ID如果无法添加源则返回 -1。
\ **警告:**\ 同一个源不能同时属于两个 TileSet。如果添加的源已经附加到其他 **TileSet**\ ,则会在该那个 TileSet 中移除。
.. rst-class:: classref-item-separator
----
.. _class_TileSet_method_add_terrain:
.. rst-class:: classref-method
|void| **add_terrain**\ (\ terrain_set\: :ref:`int<class_int>`, to_position\: :ref:`int<class_int>` = -1\ ) :ref:`🔗<class_TileSet_method_add_terrain>`
在 TileSet 的 ``terrain_set`` 地形集中添加新的地形,放置到数组中的 ``to_position`` 位置。如果 ``to_position`` 为 -1则会将其添加到数组的末尾。
.. rst-class:: classref-item-separator
----
.. _class_TileSet_method_add_terrain_set:
.. rst-class:: classref-method
|void| **add_terrain_set**\ (\ to_position\: :ref:`int<class_int>` = -1\ ) :ref:`🔗<class_TileSet_method_add_terrain_set>`
在 TileSet 添加新的地形集,放置到数组中的 ``to_position`` 位置。如果 ``to_position`` 为 -1则会将其添加到数组的末尾。
.. rst-class:: classref-item-separator
----
.. _class_TileSet_method_cleanup_invalid_tile_proxies:
.. rst-class:: classref-method
|void| **cleanup_invalid_tile_proxies**\ (\ ) :ref:`🔗<class_TileSet_method_cleanup_invalid_tile_proxies>`
清除指向无效图块的图块代理。
.. rst-class:: classref-item-separator
----
.. _class_TileSet_method_clear_tile_proxies:
.. rst-class:: classref-method
|void| **clear_tile_proxies**\ (\ ) :ref:`🔗<class_TileSet_method_clear_tile_proxies>`
清除所有图块代理。
.. rst-class:: classref-item-separator
----
.. _class_TileSet_method_get_alternative_level_tile_proxy:
.. rst-class:: classref-method
:ref:`Array<class_Array>` **get_alternative_level_tile_proxy**\ (\ source_from\: :ref:`int<class_int>`, coords_from\: :ref:`Vector2i<class_Vector2i>`, alternative_from\: :ref:`int<class_int>`\ ) :ref:`🔗<class_TileSet_method_get_alternative_level_tile_proxy>`
返回给定标识符的备选级代理。返回的数组包含三个代理的目标标识符(源 ID、图集坐标 ID 和备选图块 ID
如果该 TileSet 没有给定标识符的代理,则返回空数组。
.. rst-class:: classref-item-separator
----
.. _class_TileSet_method_get_coords_level_tile_proxy:
.. rst-class:: classref-method
:ref:`Array<class_Array>` **get_coords_level_tile_proxy**\ (\ source_from\: :ref:`int<class_int>`, coords_from\: :ref:`Vector2i<class_Vector2i>`\ ) :ref:`🔗<class_TileSet_method_get_coords_level_tile_proxy>`
返回给定标识符的坐标级代理。返回的数组包含代理的两个目标标识符(源 ID 和图集坐标 ID
如果该 TileSet 没有给定标识符的代理,则返回空数组。
.. rst-class:: classref-item-separator
----
.. _class_TileSet_method_get_custom_data_layer_by_name:
.. rst-class:: classref-method
:ref:`int<class_int>` **get_custom_data_layer_by_name**\ (\ layer_name\: :ref:`String<class_String>`\ ) |const| :ref:`🔗<class_TileSet_method_get_custom_data_layer_by_name>`
返回自定义数据层的索引,该自定义数据层由名称表示。
.. rst-class:: classref-item-separator
----
.. _class_TileSet_method_get_custom_data_layer_name:
.. rst-class:: classref-method
:ref:`String<class_String>` **get_custom_data_layer_name**\ (\ layer_index\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_TileSet_method_get_custom_data_layer_name>`
返回自定义数据层的名称,该自定义数据层由索引表示。
.. rst-class:: classref-item-separator
----
.. _class_TileSet_method_get_custom_data_layer_type:
.. rst-class:: classref-method
:ref:`Variant.Type<enum_@GlobalScope_Variant.Type>` **get_custom_data_layer_type**\ (\ layer_index\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_TileSet_method_get_custom_data_layer_type>`
返回自定义数据层的类型,该自定义数据层由索引表示。
.. rst-class:: classref-item-separator
----
.. _class_TileSet_method_get_custom_data_layers_count:
.. rst-class:: classref-method
:ref:`int<class_int>` **get_custom_data_layers_count**\ (\ ) |const| :ref:`🔗<class_TileSet_method_get_custom_data_layers_count>`
返回自定义数据层的数量。
.. rst-class:: classref-item-separator
----
.. _class_TileSet_method_get_navigation_layer_layer_value:
.. rst-class:: classref-method
:ref:`bool<class_bool>` **get_navigation_layer_layer_value**\ (\ layer_index\: :ref:`int<class_int>`, layer_number\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_TileSet_method_get_navigation_layer_layer_value>`
返回由给定的 ``layer_index`` 标识的 TileSet 导航数据层是否启用了指定的导航层,导航层 ``layer_number`` 在 1 和 32 之间。
.. rst-class:: classref-item-separator
----
.. _class_TileSet_method_get_navigation_layer_layers:
.. rst-class:: classref-method
:ref:`int<class_int>` **get_navigation_layer_layers**\ (\ layer_index\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_TileSet_method_get_navigation_layer_layers>`
返回给定 TileSet 导航层的(导航服务器中的)导航层。
.. rst-class:: classref-item-separator
----
.. _class_TileSet_method_get_navigation_layers_count:
.. rst-class:: classref-method
:ref:`int<class_int>` **get_navigation_layers_count**\ (\ ) |const| :ref:`🔗<class_TileSet_method_get_navigation_layers_count>`
返回导航层的数量。
.. rst-class:: classref-item-separator
----
.. _class_TileSet_method_get_next_source_id:
.. rst-class:: classref-method
:ref:`int<class_int>` **get_next_source_id**\ (\ ) |const| :ref:`🔗<class_TileSet_method_get_next_source_id>`
返回新的未使用的源 ID。这个生成的 ID 与调用 :ref:`add_source()<class_TileSet_method_add_source>` 将返回的 ID 相同。
.. rst-class:: classref-item-separator
----
.. _class_TileSet_method_get_occlusion_layer_light_mask:
.. rst-class:: classref-method
:ref:`int<class_int>` **get_occlusion_layer_light_mask**\ (\ layer_index\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_TileSet_method_get_occlusion_layer_light_mask>`
返回遮挡层的光照掩码。
.. rst-class:: classref-item-separator
----
.. _class_TileSet_method_get_occlusion_layer_sdf_collision:
.. rst-class:: classref-method
:ref:`bool<class_bool>` **get_occlusion_layer_sdf_collision**\ (\ layer_index\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_TileSet_method_get_occlusion_layer_sdf_collision>`
返回这个层的遮挡器是否使用 ``sdf_collision``\ 。
.. rst-class:: classref-item-separator
----
.. _class_TileSet_method_get_occlusion_layers_count:
.. rst-class:: classref-method
:ref:`int<class_int>` **get_occlusion_layers_count**\ (\ ) |const| :ref:`🔗<class_TileSet_method_get_occlusion_layers_count>`
返回遮挡层的数量。
.. rst-class:: classref-item-separator
----
.. _class_TileSet_method_get_pattern:
.. rst-class:: classref-method
:ref:`TileMapPattern<class_TileMapPattern>` **get_pattern**\ (\ index\: :ref:`int<class_int>` = -1\ ) :ref:`🔗<class_TileSet_method_get_pattern>`
返回给定 ``index`` 处的 :ref:`TileMapPattern<class_TileMapPattern>`\ 。
.. rst-class:: classref-item-separator
----
.. _class_TileSet_method_get_patterns_count:
.. rst-class:: classref-method
:ref:`int<class_int>` **get_patterns_count**\ (\ ) :ref:`🔗<class_TileSet_method_get_patterns_count>`
返回此图块集处理的 :ref:`TileMapPattern<class_TileMapPattern>` 的数量。
.. rst-class:: classref-item-separator
----
.. _class_TileSet_method_get_physics_layer_collision_layer:
.. rst-class:: classref-method
:ref:`int<class_int>` **get_physics_layer_collision_layer**\ (\ layer_index\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_TileSet_method_get_physics_layer_collision_layer>`
返回给定 TileSet 物理层中的物体所在的(物理服务器中的)碰撞层。
.. rst-class:: classref-item-separator
----
.. _class_TileSet_method_get_physics_layer_collision_mask:
.. rst-class:: classref-method
:ref:`int<class_int>` **get_physics_layer_collision_mask**\ (\ layer_index\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_TileSet_method_get_physics_layer_collision_mask>`
返回给定 TileSet 物理层中物体的碰撞遮罩。
.. rst-class:: classref-item-separator
----
.. _class_TileSet_method_get_physics_layer_collision_priority:
.. rst-class:: classref-method
:ref:`float<class_float>` **get_physics_layer_collision_priority**\ (\ layer_index\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_TileSet_method_get_physics_layer_collision_priority>`
返回给定 TileSet 物理层中物体的碰撞优先级。
.. rst-class:: classref-item-separator
----
.. _class_TileSet_method_get_physics_layer_physics_material:
.. rst-class:: classref-method
:ref:`PhysicsMaterial<class_PhysicsMaterial>` **get_physics_layer_physics_material**\ (\ layer_index\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_TileSet_method_get_physics_layer_physics_material>`
返回给定 TileSet 物理层中物体的碰撞材质。
.. rst-class:: classref-item-separator
----
.. _class_TileSet_method_get_physics_layers_count:
.. rst-class:: classref-method
:ref:`int<class_int>` **get_physics_layers_count**\ (\ ) |const| :ref:`🔗<class_TileSet_method_get_physics_layers_count>`
返回物理层的数量。
.. rst-class:: classref-item-separator
----
.. _class_TileSet_method_get_source:
.. rst-class:: classref-method
:ref:`TileSetSource<class_TileSetSource>` **get_source**\ (\ source_id\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_TileSet_method_get_source>`
返回 ID 为 ``source_id``:ref:`TileSetSource<class_TileSetSource>`\ 。
.. rst-class:: classref-item-separator
----
.. _class_TileSet_method_get_source_count:
.. rst-class:: classref-method
:ref:`int<class_int>` **get_source_count**\ (\ ) |const| :ref:`🔗<class_TileSet_method_get_source_count>`
返回该 TileSet 中 :ref:`TileSetSource<class_TileSetSource>` 的数量。
.. rst-class:: classref-item-separator
----
.. _class_TileSet_method_get_source_id:
.. rst-class:: classref-method
:ref:`int<class_int>` **get_source_id**\ (\ index\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_TileSet_method_get_source_id>`
返回索引为 ``index`` 的源的源 ID。
.. rst-class:: classref-item-separator
----
.. _class_TileSet_method_get_source_level_tile_proxy:
.. rst-class:: classref-method
:ref:`int<class_int>` **get_source_level_tile_proxy**\ (\ source_from\: :ref:`int<class_int>`\ ) :ref:`🔗<class_TileSet_method_get_source_level_tile_proxy>`
返回给定源标识符的源级别代理。
如果 TileSet 没有给定标识符的代理,则返回 -1。
.. rst-class:: classref-item-separator
----
.. _class_TileSet_method_get_terrain_color:
.. rst-class:: classref-method
:ref:`Color<class_Color>` **get_terrain_color**\ (\ terrain_set\: :ref:`int<class_int>`, terrain_index\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_TileSet_method_get_terrain_color>`
返回地形的颜色。
.. rst-class:: classref-item-separator
----
.. _class_TileSet_method_get_terrain_name:
.. rst-class:: classref-method
:ref:`String<class_String>` **get_terrain_name**\ (\ terrain_set\: :ref:`int<class_int>`, terrain_index\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_TileSet_method_get_terrain_name>`
返回地形的名称。
.. rst-class:: classref-item-separator
----
.. _class_TileSet_method_get_terrain_set_mode:
.. rst-class:: classref-method
:ref:`TerrainMode<enum_TileSet_TerrainMode>` **get_terrain_set_mode**\ (\ terrain_set\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_TileSet_method_get_terrain_set_mode>`
返回地形集模式。
.. rst-class:: classref-item-separator
----
.. _class_TileSet_method_get_terrain_sets_count:
.. rst-class:: classref-method
:ref:`int<class_int>` **get_terrain_sets_count**\ (\ ) |const| :ref:`🔗<class_TileSet_method_get_terrain_sets_count>`
返回地形集的数量。
.. rst-class:: classref-item-separator
----
.. _class_TileSet_method_get_terrains_count:
.. rst-class:: classref-method
:ref:`int<class_int>` **get_terrains_count**\ (\ terrain_set\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_TileSet_method_get_terrains_count>`
返回给定地形集中的地形数。
.. rst-class:: classref-item-separator
----
.. _class_TileSet_method_has_alternative_level_tile_proxy:
.. rst-class:: classref-method
:ref:`bool<class_bool>` **has_alternative_level_tile_proxy**\ (\ source_from\: :ref:`int<class_int>`, coords_from\: :ref:`Vector2i<class_Vector2i>`, alternative_from\: :ref:`int<class_int>`\ ) :ref:`🔗<class_TileSet_method_has_alternative_level_tile_proxy>`
返回给定的标识符是否存在备选级别的代理。
.. rst-class:: classref-item-separator
----
.. _class_TileSet_method_has_coords_level_tile_proxy:
.. rst-class:: classref-method
:ref:`bool<class_bool>` **has_coords_level_tile_proxy**\ (\ source_from\: :ref:`int<class_int>`, coords_from\: :ref:`Vector2i<class_Vector2i>`\ ) :ref:`🔗<class_TileSet_method_has_coords_level_tile_proxy>`
返回给定的标识符是否存在坐标级别的代理。
.. rst-class:: classref-item-separator
----
.. _class_TileSet_method_has_custom_data_layer_by_name:
.. rst-class:: classref-method
:ref:`bool<class_bool>` **has_custom_data_layer_by_name**\ (\ layer_name\: :ref:`String<class_String>`\ ) |const| :ref:`🔗<class_TileSet_method_has_custom_data_layer_by_name>`
返回是否存在名为 ``layer_name`` 的自定义数据层。
.. rst-class:: classref-item-separator
----
.. _class_TileSet_method_has_source:
.. rst-class:: classref-method
:ref:`bool<class_bool>` **has_source**\ (\ source_id\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_TileSet_method_has_source>`
返回该 TileSet 中是否存在给定源 ID 的源。
.. rst-class:: classref-item-separator
----
.. _class_TileSet_method_has_source_level_tile_proxy:
.. rst-class:: classref-method
:ref:`bool<class_bool>` **has_source_level_tile_proxy**\ (\ source_from\: :ref:`int<class_int>`\ ) :ref:`🔗<class_TileSet_method_has_source_level_tile_proxy>`
返回给定的源 ID 是否存在源级别的代理。
.. rst-class:: classref-item-separator
----
.. _class_TileSet_method_map_tile_proxy:
.. rst-class:: classref-method
:ref:`Array<class_Array>` **map_tile_proxy**\ (\ source_from\: :ref:`int<class_int>`, coords_from\: :ref:`Vector2i<class_Vector2i>`, alternative_from\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_TileSet_method_map_tile_proxy>`
根据配置的代理,将提供的标识符映射到一组新的标识符。返回的是由源 ID、图集坐标 ID 和备选图块 ID 这三个元素构成的 Array。
这个函数首先查找匹配的备选级代理,然后是坐标级代理,然后是源级代理。
如果未找到与提供的标识符对应的代理,则返回与用作参数的值相同的值。
.. rst-class:: classref-item-separator
----
.. _class_TileSet_method_move_custom_data_layer:
.. rst-class:: classref-method
|void| **move_custom_data_layer**\ (\ layer_index\: :ref:`int<class_int>`, to_position\: :ref:`int<class_int>`\ ) :ref:`🔗<class_TileSet_method_move_custom_data_layer>`
将索引为 ``layer_index`` 的自定义数据层移动到数组中给定的 ``to_position`` 位置。还会更新相应的图集图块。
.. rst-class:: classref-item-separator
----
.. _class_TileSet_method_move_navigation_layer:
.. rst-class:: classref-method
|void| **move_navigation_layer**\ (\ layer_index\: :ref:`int<class_int>`, to_position\: :ref:`int<class_int>`\ ) :ref:`🔗<class_TileSet_method_move_navigation_layer>`
将索引为 ``layer_index`` 的导航层移动到数组中给定的 ``to_position`` 位置。还会更新相应的图集图块。
.. rst-class:: classref-item-separator
----
.. _class_TileSet_method_move_occlusion_layer:
.. rst-class:: classref-method
|void| **move_occlusion_layer**\ (\ layer_index\: :ref:`int<class_int>`, to_position\: :ref:`int<class_int>`\ ) :ref:`🔗<class_TileSet_method_move_occlusion_layer>`
将索引为 ``layer_index`` 的遮挡层移动到数组中给定的 ``to_position`` 位置。还会更新相应的图集图块。
.. rst-class:: classref-item-separator
----
.. _class_TileSet_method_move_physics_layer:
.. rst-class:: classref-method
|void| **move_physics_layer**\ (\ layer_index\: :ref:`int<class_int>`, to_position\: :ref:`int<class_int>`\ ) :ref:`🔗<class_TileSet_method_move_physics_layer>`
将索引为 ``layer_index`` 的物理层移动到数组中给定的 ``to_position`` 位置。还会更新相应的图集图块。
.. rst-class:: classref-item-separator
----
.. _class_TileSet_method_move_terrain:
.. rst-class:: classref-method
|void| **move_terrain**\ (\ terrain_set\: :ref:`int<class_int>`, terrain_index\: :ref:`int<class_int>`, to_position\: :ref:`int<class_int>`\ ) :ref:`🔗<class_TileSet_method_move_terrain>`
将地形集 ``terrain_set`` 中索引为 ``terrain_index`` 的地形移动到数组中给定的 ``to_position`` 位置。还会更新相应的图集图块。
.. rst-class:: classref-item-separator
----
.. _class_TileSet_method_move_terrain_set:
.. rst-class:: classref-method
|void| **move_terrain_set**\ (\ terrain_set\: :ref:`int<class_int>`, to_position\: :ref:`int<class_int>`\ ) :ref:`🔗<class_TileSet_method_move_terrain_set>`
将索引为 ``terrain_set`` 的地形集移动到数组中给定的 ``to_position`` 位置。还会更新相应的图集图块。
.. rst-class:: classref-item-separator
----
.. _class_TileSet_method_remove_alternative_level_tile_proxy:
.. rst-class:: classref-method
|void| **remove_alternative_level_tile_proxy**\ (\ source_from\: :ref:`int<class_int>`, coords_from\: :ref:`Vector2i<class_Vector2i>`, alternative_from\: :ref:`int<class_int>`\ ) :ref:`🔗<class_TileSet_method_remove_alternative_level_tile_proxy>`
移除具有给定标识符的备选级别代理。
.. rst-class:: classref-item-separator
----
.. _class_TileSet_method_remove_coords_level_tile_proxy:
.. rst-class:: classref-method
|void| **remove_coords_level_tile_proxy**\ (\ source_from\: :ref:`int<class_int>`, coords_from\: :ref:`Vector2i<class_Vector2i>`\ ) :ref:`🔗<class_TileSet_method_remove_coords_level_tile_proxy>`
移除具有给定标识符的坐标级别代理。
.. rst-class:: classref-item-separator
----
.. _class_TileSet_method_remove_custom_data_layer:
.. rst-class:: classref-method
|void| **remove_custom_data_layer**\ (\ layer_index\: :ref:`int<class_int>`\ ) :ref:`🔗<class_TileSet_method_remove_custom_data_layer>`
移除索引为 ``layer_index`` 的自定义数据层。也会相应地更新图集中的图块。
.. rst-class:: classref-item-separator
----
.. _class_TileSet_method_remove_navigation_layer:
.. rst-class:: classref-method
|void| **remove_navigation_layer**\ (\ layer_index\: :ref:`int<class_int>`\ ) :ref:`🔗<class_TileSet_method_remove_navigation_layer>`
移除索引为 ``layer_index`` 的导航层。也会相应地更新图集中的图块。
.. rst-class:: classref-item-separator
----
.. _class_TileSet_method_remove_occlusion_layer:
.. rst-class:: classref-method
|void| **remove_occlusion_layer**\ (\ layer_index\: :ref:`int<class_int>`\ ) :ref:`🔗<class_TileSet_method_remove_occlusion_layer>`
移除索引为 ``layer_index`` 的遮挡层。也会相应地更新图集中的图块。
.. rst-class:: classref-item-separator
----
.. _class_TileSet_method_remove_pattern:
.. rst-class:: classref-method
|void| **remove_pattern**\ (\ index\: :ref:`int<class_int>`\ ) :ref:`🔗<class_TileSet_method_remove_pattern>`
移除给定索引处的 :ref:`TileMapPattern<class_TileMapPattern>`\ 。
.. rst-class:: classref-item-separator
----
.. _class_TileSet_method_remove_physics_layer:
.. rst-class:: classref-method
|void| **remove_physics_layer**\ (\ layer_index\: :ref:`int<class_int>`\ ) :ref:`🔗<class_TileSet_method_remove_physics_layer>`
移除索引为 ``layer_index`` 的物理层。也会更新图集中的相应图块。
.. rst-class:: classref-item-separator
----
.. _class_TileSet_method_remove_source:
.. rst-class:: classref-method
|void| **remove_source**\ (\ source_id\: :ref:`int<class_int>`\ ) :ref:`🔗<class_TileSet_method_remove_source>`
移除具有给定源 ID 的源。
.. rst-class:: classref-item-separator
----
.. _class_TileSet_method_remove_source_level_tile_proxy:
.. rst-class:: classref-method
|void| **remove_source_level_tile_proxy**\ (\ source_from\: :ref:`int<class_int>`\ ) :ref:`🔗<class_TileSet_method_remove_source_level_tile_proxy>`
移除源级别的图块代理。
.. rst-class:: classref-item-separator
----
.. _class_TileSet_method_remove_terrain:
.. rst-class:: classref-method
|void| **remove_terrain**\ (\ terrain_set\: :ref:`int<class_int>`, terrain_index\: :ref:`int<class_int>`\ ) :ref:`🔗<class_TileSet_method_remove_terrain>`
移除给定地形集 ``terrain_set`` 中索引为 ``terrain_index`` 的地形。也会相应地更新图集中的图块。
.. rst-class:: classref-item-separator
----
.. _class_TileSet_method_remove_terrain_set:
.. rst-class:: classref-method
|void| **remove_terrain_set**\ (\ terrain_set\: :ref:`int<class_int>`\ ) :ref:`🔗<class_TileSet_method_remove_terrain_set>`
移除索引为 ``terrain_set`` 的地形集。也会相应地更新图集中的图块。
.. rst-class:: classref-item-separator
----
.. _class_TileSet_method_set_alternative_level_tile_proxy:
.. rst-class:: classref-method
|void| **set_alternative_level_tile_proxy**\ (\ source_from\: :ref:`int<class_int>`, coords_from\: :ref:`Vector2i<class_Vector2i>`, alternative_from\: :ref:`int<class_int>`, source_to\: :ref:`int<class_int>`, coords_to\: :ref:`Vector2i<class_Vector2i>`, alternative_to\: :ref:`int<class_int>`\ ) :ref:`🔗<class_TileSet_method_set_alternative_level_tile_proxy>`
为给定的标识符创建备选级代理。代理会将一组图块标识符映射到另一组标识符。
可以使用编辑器自动替换 TileMapLayer 节点中的代理图块。
.. rst-class:: classref-item-separator
----
.. _class_TileSet_method_set_coords_level_tile_proxy:
.. rst-class:: classref-method
|void| **set_coords_level_tile_proxy**\ (\ p_source_from\: :ref:`int<class_int>`, coords_from\: :ref:`Vector2i<class_Vector2i>`, source_to\: :ref:`int<class_int>`, coords_to\: :ref:`Vector2i<class_Vector2i>`\ ) :ref:`🔗<class_TileSet_method_set_coords_level_tile_proxy>`
为给定的标识符创建坐标级代理。代理会将一组图块标识符映射到另一组标识符。使用坐标级代理时,备选图块 ID 保持不变。
可以使用编辑器自动替换 TileMapLayer 节点中的代理图块。
.. rst-class:: classref-item-separator
----
.. _class_TileSet_method_set_custom_data_layer_name:
.. rst-class:: classref-method
|void| **set_custom_data_layer_name**\ (\ layer_index\: :ref:`int<class_int>`, layer_name\: :ref:`String<class_String>`\ ) :ref:`🔗<class_TileSet_method_set_custom_data_layer_name>`
设置由给定索引标识的自定义数据层的名称。名称是层的标识符,因此如果名称已被使用就会失败并报错。
.. rst-class:: classref-item-separator
----
.. _class_TileSet_method_set_custom_data_layer_type:
.. rst-class:: classref-method
|void| **set_custom_data_layer_type**\ (\ layer_index\: :ref:`int<class_int>`, layer_type\: :ref:`Variant.Type<enum_@GlobalScope_Variant.Type>`\ ) :ref:`🔗<class_TileSet_method_set_custom_data_layer_type>`
设置自定义数据层的类型,该自定义数据层由索引表示。
.. rst-class:: classref-item-separator
----
.. _class_TileSet_method_set_navigation_layer_layer_value:
.. rst-class:: classref-method
|void| **set_navigation_layer_layer_value**\ (\ layer_index\: :ref:`int<class_int>`, layer_number\: :ref:`int<class_int>`, value\: :ref:`bool<class_bool>`\ ) :ref:`🔗<class_TileSet_method_set_navigation_layer_layer_value>`
根据 ``value``\ ,启用或禁用 TileSet 导航数据层中指定的导航层,导航数据层由给定的 ``layer_index`` 标识,给定的 ``layer_number`` 应在 1 和 32 之间。
.. rst-class:: classref-item-separator
----
.. _class_TileSet_method_set_navigation_layer_layers:
.. rst-class:: classref-method
|void| **set_navigation_layer_layers**\ (\ layer_index\: :ref:`int<class_int>`, layers\: :ref:`int<class_int>`\ ) :ref:`🔗<class_TileSet_method_set_navigation_layer_layers>`
设置给定 TileSet 导航层中导航区域的导航层(导航服务器中使用)。
.. rst-class:: classref-item-separator
----
.. _class_TileSet_method_set_occlusion_layer_light_mask:
.. rst-class:: classref-method
|void| **set_occlusion_layer_light_mask**\ (\ layer_index\: :ref:`int<class_int>`, light_mask\: :ref:`int<class_int>`\ ) :ref:`🔗<class_TileSet_method_set_occlusion_layer_light_mask>`
设置给定 TileSet 遮挡层中遮挡器的遮挡层(渲染服务器中使用)。
.. rst-class:: classref-item-separator
----
.. _class_TileSet_method_set_occlusion_layer_sdf_collision:
.. rst-class:: classref-method
|void| **set_occlusion_layer_sdf_collision**\ (\ layer_index\: :ref:`int<class_int>`, sdf_collision\: :ref:`bool<class_bool>`\ ) :ref:`🔗<class_TileSet_method_set_occlusion_layer_sdf_collision>`
启用或禁用给定 TileSet 遮挡层中遮挡器的 SDF 碰撞。
.. rst-class:: classref-item-separator
----
.. _class_TileSet_method_set_physics_layer_collision_layer:
.. rst-class:: classref-method
|void| **set_physics_layer_collision_layer**\ (\ layer_index\: :ref:`int<class_int>`, layer\: :ref:`int<class_int>`\ ) :ref:`🔗<class_TileSet_method_set_physics_layer_collision_layer>`
设置给定 TileSet 物理层中物体的碰撞层(物理服务器中使用)。
.. rst-class:: classref-item-separator
----
.. _class_TileSet_method_set_physics_layer_collision_mask:
.. rst-class:: classref-method
|void| **set_physics_layer_collision_mask**\ (\ layer_index\: :ref:`int<class_int>`, mask\: :ref:`int<class_int>`\ ) :ref:`🔗<class_TileSet_method_set_physics_layer_collision_mask>`
设置给定 TileSet 物理层中物体的碰撞遮罩。
.. rst-class:: classref-item-separator
----
.. _class_TileSet_method_set_physics_layer_collision_priority:
.. rst-class:: classref-method
|void| **set_physics_layer_collision_priority**\ (\ layer_index\: :ref:`int<class_int>`, priority\: :ref:`float<class_float>`\ ) :ref:`🔗<class_TileSet_method_set_physics_layer_collision_priority>`
设置给定 TileSet 物理层中物体的碰撞优先级。
.. rst-class:: classref-item-separator
----
.. _class_TileSet_method_set_physics_layer_physics_material:
.. rst-class:: classref-method
|void| **set_physics_layer_physics_material**\ (\ layer_index\: :ref:`int<class_int>`, physics_material\: :ref:`PhysicsMaterial<class_PhysicsMaterial>`\ ) :ref:`🔗<class_TileSet_method_set_physics_layer_physics_material>`
设置给定 TileSet 物理层中物体的物理材质。
.. rst-class:: classref-item-separator
----
.. _class_TileSet_method_set_source_id:
.. rst-class:: classref-method
|void| **set_source_id**\ (\ source_id\: :ref:`int<class_int>`, new_source_id\: :ref:`int<class_int>`\ ) :ref:`🔗<class_TileSet_method_set_source_id>`
更改源的 ID。
.. rst-class:: classref-item-separator
----
.. _class_TileSet_method_set_source_level_tile_proxy:
.. rst-class:: classref-method
|void| **set_source_level_tile_proxy**\ (\ source_from\: :ref:`int<class_int>`, source_to\: :ref:`int<class_int>`\ ) :ref:`🔗<class_TileSet_method_set_source_level_tile_proxy>`
为给定的源 ID 创建源级代理。代理会将一组图块标识符映射到另一组标识符。使用源级代理时,图集坐标 ID 和备选图块 ID 均保持不变。
可以使用编辑器自动替换 TileMapLayer 节点中的代理图块。
.. rst-class:: classref-item-separator
----
.. _class_TileSet_method_set_terrain_color:
.. rst-class:: classref-method
|void| **set_terrain_color**\ (\ terrain_set\: :ref:`int<class_int>`, terrain_index\: :ref:`int<class_int>`, color\: :ref:`Color<class_Color>`\ ) :ref:`🔗<class_TileSet_method_set_terrain_color>`
设置地形的颜色。该颜色用于在 TileSet 编辑器中区分不同的地形。
.. rst-class:: classref-item-separator
----
.. _class_TileSet_method_set_terrain_name:
.. rst-class:: classref-method
|void| **set_terrain_name**\ (\ terrain_set\: :ref:`int<class_int>`, terrain_index\: :ref:`int<class_int>`, name\: :ref:`String<class_String>`\ ) :ref:`🔗<class_TileSet_method_set_terrain_name>`
设置地形的名称。
.. rst-class:: classref-item-separator
----
.. _class_TileSet_method_set_terrain_set_mode:
.. rst-class:: classref-method
|void| **set_terrain_set_mode**\ (\ terrain_set\: :ref:`int<class_int>`, mode\: :ref:`TerrainMode<enum_TileSet_TerrainMode>`\ ) :ref:`🔗<class_TileSet_method_set_terrain_set_mode>`
设置地形模式。每种模式决定了图块形状的哪一个位被用来匹配相邻图块的地形。
.. |virtual| replace:: :abbr:`virtual (本方法通常需要用户覆盖才能生效。)`
.. |required| replace:: :abbr:`required (This method is required to be overridden when extending its base class.)`
.. |const| replace:: :abbr:`const (本方法无副作用,不会修改该实例的任何成员变量。)`
.. |vararg| replace:: :abbr:`vararg (本方法除了能接受在此处描述的参数外,还能够继续接受任意数量的参数。)`
.. |constructor| replace:: :abbr:`constructor (本方法用于构造某个类型。)`
.. |static| replace:: :abbr:`static (调用本方法无需实例,可直接使用类名进行调用。)`
.. |operator| replace:: :abbr:`operator (本方法描述的是使用本类型作为左操作数的有效运算符。)`
.. |bitfield| replace:: :abbr:`BitField (这个值是由下列位标志构成位掩码的整数。)`
.. |void| replace:: :abbr:`void (无返回值。)`