123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438 |
- :github_url: hide
- .. Generated automatically by doc/tools/make_rst.py in Godot's source tree.
- .. DO NOT EDIT THIS FILE, but the TileData.xml source instead.
- .. The source is found in doc/classes or modules/<name>/doc_classes.
- .. _class_TileData:
- TileData
- ========
- **Inherits:** :ref:`Object<class_Object>`
- Properties
- ----------
- +---------------------------------------------+---------------------------------------------------------------+-----------------------+
- | :ref:`bool<class_bool>` | :ref:`flip_h<class_TileData_property_flip_h>` | ``false`` |
- +---------------------------------------------+---------------------------------------------------------------+-----------------------+
- | :ref:`bool<class_bool>` | :ref:`flip_v<class_TileData_property_flip_v>` | ``false`` |
- +---------------------------------------------+---------------------------------------------------------------+-----------------------+
- | :ref:`ShaderMaterial<class_ShaderMaterial>` | :ref:`material<class_TileData_property_material>` | |
- +---------------------------------------------+---------------------------------------------------------------+-----------------------+
- | :ref:`Color<class_Color>` | :ref:`modulate<class_TileData_property_modulate>` | ``Color(1, 1, 1, 1)`` |
- +---------------------------------------------+---------------------------------------------------------------+-----------------------+
- | :ref:`float<class_float>` | :ref:`probability<class_TileData_property_probability>` | ``1.0`` |
- +---------------------------------------------+---------------------------------------------------------------+-----------------------+
- | :ref:`int<class_int>` | :ref:`terrain_set<class_TileData_property_terrain_set>` | ``-1`` |
- +---------------------------------------------+---------------------------------------------------------------+-----------------------+
- | :ref:`Vector2i<class_Vector2i>` | :ref:`texture_offset<class_TileData_property_texture_offset>` | ``Vector2i(0, 0)`` |
- +---------------------------------------------+---------------------------------------------------------------+-----------------------+
- | :ref:`bool<class_bool>` | :ref:`transpose<class_TileData_property_transpose>` | ``false`` |
- +---------------------------------------------+---------------------------------------------------------------+-----------------------+
- | :ref:`int<class_int>` | :ref:`y_sort_origin<class_TileData_property_y_sort_origin>` | ``0`` |
- +---------------------------------------------+---------------------------------------------------------------+-----------------------+
- | :ref:`int<class_int>` | :ref:`z_index<class_TileData_property_z_index>` | ``0`` |
- +---------------------------------------------+---------------------------------------------------------------+-----------------------+
- Methods
- -------
- +-----------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | void | :ref:`add_collision_polygon<class_TileData_method_add_collision_polygon>` **(** :ref:`int<class_int>` layer_id **)** |
- +-----------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`float<class_float>` | :ref:`get_collision_polygon_one_way_margin<class_TileData_method_get_collision_polygon_one_way_margin>` **(** :ref:`int<class_int>` layer_id, :ref:`int<class_int>` polygon_index **)** |const| |
- +-----------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`PackedVector2Array<class_PackedVector2Array>` | :ref:`get_collision_polygon_points<class_TileData_method_get_collision_polygon_points>` **(** :ref:`int<class_int>` layer_id, :ref:`int<class_int>` polygon_index **)** |const| |
- +-----------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`int<class_int>` | :ref:`get_collision_polygons_count<class_TileData_method_get_collision_polygons_count>` **(** :ref:`int<class_int>` layer_id **)** |const| |
- +-----------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`float<class_float>` | :ref:`get_constant_angular_velocity<class_TileData_method_get_constant_angular_velocity>` **(** :ref:`int<class_int>` layer_id **)** |const| |
- +-----------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`Vector2<class_Vector2>` | :ref:`get_constant_linear_velocity<class_TileData_method_get_constant_linear_velocity>` **(** :ref:`int<class_int>` layer_id **)** |const| |
- +-----------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`Variant<class_Variant>` | :ref:`get_custom_data<class_TileData_method_get_custom_data>` **(** :ref:`String<class_String>` layer_name **)** |const| |
- +-----------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`Variant<class_Variant>` | :ref:`get_custom_data_by_layer_id<class_TileData_method_get_custom_data_by_layer_id>` **(** :ref:`int<class_int>` layer_id **)** |const| |
- +-----------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`NavigationPolygon<class_NavigationPolygon>` | :ref:`get_navigation_polygon<class_TileData_method_get_navigation_polygon>` **(** :ref:`int<class_int>` layer_id **)** |const| |
- +-----------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`OccluderPolygon2D<class_OccluderPolygon2D>` | :ref:`get_occluder<class_TileData_method_get_occluder>` **(** :ref:`int<class_int>` layer_id **)** |const| |
- +-----------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`int<class_int>` | :ref:`get_peering_bit_terrain<class_TileData_method_get_peering_bit_terrain>` **(** :ref:`CellNeighbor<enum_TileSet_CellNeighbor>` peering_bit **)** |const| |
- +-----------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`bool<class_bool>` | :ref:`is_collision_polygon_one_way<class_TileData_method_is_collision_polygon_one_way>` **(** :ref:`int<class_int>` layer_id, :ref:`int<class_int>` polygon_index **)** |const| |
- +-----------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | void | :ref:`remove_collision_polygon<class_TileData_method_remove_collision_polygon>` **(** :ref:`int<class_int>` layer_id, :ref:`int<class_int>` polygon_index **)** |
- +-----------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | void | :ref:`set_collision_polygon_one_way<class_TileData_method_set_collision_polygon_one_way>` **(** :ref:`int<class_int>` layer_id, :ref:`int<class_int>` polygon_index, :ref:`bool<class_bool>` one_way **)** |
- +-----------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | void | :ref:`set_collision_polygon_one_way_margin<class_TileData_method_set_collision_polygon_one_way_margin>` **(** :ref:`int<class_int>` layer_id, :ref:`int<class_int>` polygon_index, :ref:`float<class_float>` one_way_margin **)** |
- +-----------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | void | :ref:`set_collision_polygon_points<class_TileData_method_set_collision_polygon_points>` **(** :ref:`int<class_int>` layer_id, :ref:`int<class_int>` polygon_index, :ref:`PackedVector2Array<class_PackedVector2Array>` polygon **)** |
- +-----------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | void | :ref:`set_collision_polygons_count<class_TileData_method_set_collision_polygons_count>` **(** :ref:`int<class_int>` layer_id, :ref:`int<class_int>` polygons_count **)** |
- +-----------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | void | :ref:`set_constant_angular_velocity<class_TileData_method_set_constant_angular_velocity>` **(** :ref:`int<class_int>` layer_id, :ref:`float<class_float>` velocity **)** |
- +-----------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | void | :ref:`set_constant_linear_velocity<class_TileData_method_set_constant_linear_velocity>` **(** :ref:`int<class_int>` layer_id, :ref:`Vector2<class_Vector2>` velocity **)** |
- +-----------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | void | :ref:`set_custom_data<class_TileData_method_set_custom_data>` **(** :ref:`String<class_String>` layer_name, :ref:`Variant<class_Variant>` value **)** |
- +-----------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | void | :ref:`set_custom_data_by_layer_id<class_TileData_method_set_custom_data_by_layer_id>` **(** :ref:`int<class_int>` layer_id, :ref:`Variant<class_Variant>` value **)** |
- +-----------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | void | :ref:`set_navigation_polygon<class_TileData_method_set_navigation_polygon>` **(** :ref:`int<class_int>` layer_id, :ref:`NavigationPolygon<class_NavigationPolygon>` navigation_polygon **)** |
- +-----------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | void | :ref:`set_occluder<class_TileData_method_set_occluder>` **(** :ref:`int<class_int>` layer_id, :ref:`OccluderPolygon2D<class_OccluderPolygon2D>` occluder_polygon **)** |
- +-----------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | void | :ref:`set_peering_bit_terrain<class_TileData_method_set_peering_bit_terrain>` **(** :ref:`CellNeighbor<enum_TileSet_CellNeighbor>` peering_bit, :ref:`int<class_int>` terrain **)** |
- +-----------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- Signals
- -------
- .. _class_TileData_signal_changed:
- - **changed** **(** **)**
- Property Descriptions
- ---------------------
- .. _class_TileData_property_flip_h:
- - :ref:`bool<class_bool>` **flip_h**
- +-----------+-------------------+
- | *Default* | ``false`` |
- +-----------+-------------------+
- | *Setter* | set_flip_h(value) |
- +-----------+-------------------+
- | *Getter* | get_flip_h() |
- +-----------+-------------------+
- ----
- .. _class_TileData_property_flip_v:
- - :ref:`bool<class_bool>` **flip_v**
- +-----------+-------------------+
- | *Default* | ``false`` |
- +-----------+-------------------+
- | *Setter* | set_flip_v(value) |
- +-----------+-------------------+
- | *Getter* | get_flip_v() |
- +-----------+-------------------+
- ----
- .. _class_TileData_property_material:
- - :ref:`ShaderMaterial<class_ShaderMaterial>` **material**
- +----------+---------------------+
- | *Setter* | set_material(value) |
- +----------+---------------------+
- | *Getter* | get_material() |
- +----------+---------------------+
- ----
- .. _class_TileData_property_modulate:
- - :ref:`Color<class_Color>` **modulate**
- +-----------+-----------------------+
- | *Default* | ``Color(1, 1, 1, 1)`` |
- +-----------+-----------------------+
- | *Setter* | set_modulate(value) |
- +-----------+-----------------------+
- | *Getter* | get_modulate() |
- +-----------+-----------------------+
- ----
- .. _class_TileData_property_probability:
- - :ref:`float<class_float>` **probability**
- +-----------+------------------------+
- | *Default* | ``1.0`` |
- +-----------+------------------------+
- | *Setter* | set_probability(value) |
- +-----------+------------------------+
- | *Getter* | get_probability() |
- +-----------+------------------------+
- ----
- .. _class_TileData_property_terrain_set:
- - :ref:`int<class_int>` **terrain_set**
- +-----------+------------------------+
- | *Default* | ``-1`` |
- +-----------+------------------------+
- | *Setter* | set_terrain_set(value) |
- +-----------+------------------------+
- | *Getter* | get_terrain_set() |
- +-----------+------------------------+
- ----
- .. _class_TileData_property_texture_offset:
- - :ref:`Vector2i<class_Vector2i>` **texture_offset**
- +-----------+---------------------------+
- | *Default* | ``Vector2i(0, 0)`` |
- +-----------+---------------------------+
- | *Setter* | set_texture_offset(value) |
- +-----------+---------------------------+
- | *Getter* | get_texture_offset() |
- +-----------+---------------------------+
- ----
- .. _class_TileData_property_transpose:
- - :ref:`bool<class_bool>` **transpose**
- +-----------+----------------------+
- | *Default* | ``false`` |
- +-----------+----------------------+
- | *Setter* | set_transpose(value) |
- +-----------+----------------------+
- | *Getter* | get_transpose() |
- +-----------+----------------------+
- ----
- .. _class_TileData_property_y_sort_origin:
- - :ref:`int<class_int>` **y_sort_origin**
- +-----------+--------------------------+
- | *Default* | ``0`` |
- +-----------+--------------------------+
- | *Setter* | set_y_sort_origin(value) |
- +-----------+--------------------------+
- | *Getter* | get_y_sort_origin() |
- +-----------+--------------------------+
- ----
- .. _class_TileData_property_z_index:
- - :ref:`int<class_int>` **z_index**
- +-----------+--------------------+
- | *Default* | ``0`` |
- +-----------+--------------------+
- | *Setter* | set_z_index(value) |
- +-----------+--------------------+
- | *Getter* | get_z_index() |
- +-----------+--------------------+
- Method Descriptions
- -------------------
- .. _class_TileData_method_add_collision_polygon:
- - void **add_collision_polygon** **(** :ref:`int<class_int>` layer_id **)**
- Adds a collision polygon to the tile on the given TileSet physics layer.
- ----
- .. _class_TileData_method_get_collision_polygon_one_way_margin:
- - :ref:`float<class_float>` **get_collision_polygon_one_way_margin** **(** :ref:`int<class_int>` layer_id, :ref:`int<class_int>` polygon_index **)** |const|
- Returns the one-way margin (for one-way platforms) of the polygon at index ``polygon_index`` for TileSet physics layer with index ``layer_id``.
- ----
- .. _class_TileData_method_get_collision_polygon_points:
- - :ref:`PackedVector2Array<class_PackedVector2Array>` **get_collision_polygon_points** **(** :ref:`int<class_int>` layer_id, :ref:`int<class_int>` polygon_index **)** |const|
- Returns the points of the polygon at index ``polygon_index`` for TileSet physics layer with index ``layer_id``.
- ----
- .. _class_TileData_method_get_collision_polygons_count:
- - :ref:`int<class_int>` **get_collision_polygons_count** **(** :ref:`int<class_int>` layer_id **)** |const|
- Returns how many polygons the tile has for TileSet physics layer with index ``layer_id``.
- ----
- .. _class_TileData_method_get_constant_angular_velocity:
- - :ref:`float<class_float>` **get_constant_angular_velocity** **(** :ref:`int<class_int>` layer_id **)** |const|
- Returns the constant angular velocity applied to objects colliding with this tile.
- ----
- .. _class_TileData_method_get_constant_linear_velocity:
- - :ref:`Vector2<class_Vector2>` **get_constant_linear_velocity** **(** :ref:`int<class_int>` layer_id **)** |const|
- Returns the constant linear velocity applied to objects colliding with this tile.
- ----
- .. _class_TileData_method_get_custom_data:
- - :ref:`Variant<class_Variant>` **get_custom_data** **(** :ref:`String<class_String>` layer_name **)** |const|
- Returns the custom data value for custom data layer named ``layer_name``.
- ----
- .. _class_TileData_method_get_custom_data_by_layer_id:
- - :ref:`Variant<class_Variant>` **get_custom_data_by_layer_id** **(** :ref:`int<class_int>` layer_id **)** |const|
- Returns the custom data value for custom data layer with index ``layer_id``.
- ----
- .. _class_TileData_method_get_navigation_polygon:
- - :ref:`NavigationPolygon<class_NavigationPolygon>` **get_navigation_polygon** **(** :ref:`int<class_int>` layer_id **)** |const|
- Returns the navigation polygon of the tile for the TileSet navigation layer with index ``layer_id``.
- ----
- .. _class_TileData_method_get_occluder:
- - :ref:`OccluderPolygon2D<class_OccluderPolygon2D>` **get_occluder** **(** :ref:`int<class_int>` layer_id **)** |const|
- Returns the occluder polygon of the tile for the TileSet occlusion layer with index ``layer_id``.
- ----
- .. _class_TileData_method_get_peering_bit_terrain:
- - :ref:`int<class_int>` **get_peering_bit_terrain** **(** :ref:`CellNeighbor<enum_TileSet_CellNeighbor>` peering_bit **)** |const|
- Returns the tile's terrain bit for the given ``peering_bit`` direction.
- ----
- .. _class_TileData_method_is_collision_polygon_one_way:
- - :ref:`bool<class_bool>` **is_collision_polygon_one_way** **(** :ref:`int<class_int>` layer_id, :ref:`int<class_int>` polygon_index **)** |const|
- Returns whether one-way collisions are enabled for the polygon at index ``polygon_index`` for TileSet physics layer with index ``layer_id``.
- ----
- .. _class_TileData_method_remove_collision_polygon:
- - void **remove_collision_polygon** **(** :ref:`int<class_int>` layer_id, :ref:`int<class_int>` polygon_index **)**
- Removes the polygon at index ``polygon_index`` for TileSet physics layer with index ``layer_id``.
- ----
- .. _class_TileData_method_set_collision_polygon_one_way:
- - void **set_collision_polygon_one_way** **(** :ref:`int<class_int>` layer_id, :ref:`int<class_int>` polygon_index, :ref:`bool<class_bool>` one_way **)**
- Enables/disables one-way collisions on the polygon at index ``polygon_index`` for TileSet physics layer with index ``layer_id``.
- ----
- .. _class_TileData_method_set_collision_polygon_one_way_margin:
- - void **set_collision_polygon_one_way_margin** **(** :ref:`int<class_int>` layer_id, :ref:`int<class_int>` polygon_index, :ref:`float<class_float>` one_way_margin **)**
- Enables/disables one-way collisions on the polygon at index ``polygon_index`` for TileSet physics layer with index ``layer_id``.
- ----
- .. _class_TileData_method_set_collision_polygon_points:
- - void **set_collision_polygon_points** **(** :ref:`int<class_int>` layer_id, :ref:`int<class_int>` polygon_index, :ref:`PackedVector2Array<class_PackedVector2Array>` polygon **)**
- Sets the points of the polygon at index ``polygon_index`` for TileSet physics layer with index ``layer_id``.
- ----
- .. _class_TileData_method_set_collision_polygons_count:
- - void **set_collision_polygons_count** **(** :ref:`int<class_int>` layer_id, :ref:`int<class_int>` polygons_count **)**
- Sets the polygons count for TileSet physics layer with index ``layer_id``.
- ----
- .. _class_TileData_method_set_constant_angular_velocity:
- - void **set_constant_angular_velocity** **(** :ref:`int<class_int>` layer_id, :ref:`float<class_float>` velocity **)**
- Sets the constant angular velocity. This does not rotate the tile. This angular velocity is applied to objects colliding with this tile.
- ----
- .. _class_TileData_method_set_constant_linear_velocity:
- - void **set_constant_linear_velocity** **(** :ref:`int<class_int>` layer_id, :ref:`Vector2<class_Vector2>` velocity **)**
- Sets the constant linear velocity. This does not move the tile. This linear velocity is applied to objects colliding with this tile. This is useful to create conveyor belts.
- ----
- .. _class_TileData_method_set_custom_data:
- - void **set_custom_data** **(** :ref:`String<class_String>` layer_name, :ref:`Variant<class_Variant>` value **)**
- Sets the tile's custom data value for the TileSet custom data layer with name ``layer_name``.
- ----
- .. _class_TileData_method_set_custom_data_by_layer_id:
- - void **set_custom_data_by_layer_id** **(** :ref:`int<class_int>` layer_id, :ref:`Variant<class_Variant>` value **)**
- Sets the tile's custom data value for the TileSet custom data layer with index ``layer_id``.
- ----
- .. _class_TileData_method_set_navigation_polygon:
- - void **set_navigation_polygon** **(** :ref:`int<class_int>` layer_id, :ref:`NavigationPolygon<class_NavigationPolygon>` navigation_polygon **)**
- Sets the navigation polygon for the TileSet navigation layer with index ``layer_id``.
- ----
- .. _class_TileData_method_set_occluder:
- - void **set_occluder** **(** :ref:`int<class_int>` layer_id, :ref:`OccluderPolygon2D<class_OccluderPolygon2D>` occluder_polygon **)**
- Sets the occluder for the TileSet occlusion layer with index ``layer_id``.
- ----
- .. _class_TileData_method_set_peering_bit_terrain:
- - void **set_peering_bit_terrain** **(** :ref:`CellNeighbor<enum_TileSet_CellNeighbor>` peering_bit, :ref:`int<class_int>` terrain **)**
- Sets the tile's terrain bit for the given ``peering_bit`` direction.
- .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
- .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
- .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
- .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
- .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
- .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`
|