class_navigationregion2d.rst 4.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. :github_url: hide
  2. .. Generated automatically by doc/tools/make_rst.py in Godot's source tree.
  3. .. DO NOT EDIT THIS FILE, but the NavigationRegion2D.xml source instead.
  4. .. The source is found in doc/classes or modules/<name>/doc_classes.
  5. .. _class_NavigationRegion2D:
  6. NavigationRegion2D
  7. ==================
  8. **Inherits:** :ref:`Node2D<class_Node2D>` **<** :ref:`CanvasItem<class_CanvasItem>` **<** :ref:`Node<class_Node>` **<** :ref:`Object<class_Object>`
  9. A region of the 2D navigation map.
  10. Description
  11. -----------
  12. A region of the navigation map. It tells the :ref:`NavigationServer2D<class_NavigationServer2D>` what can be navigated and what cannot, based on its :ref:`NavigationPolygon<class_NavigationPolygon>` resource.
  13. Two regions can be connected to each other if they share a similar edge. You can set the minimum distance between two vertices required to connect two edges by using :ref:`NavigationServer2D.map_set_edge_connection_margin<class_NavigationServer2D_method_map_set_edge_connection_margin>`.
  14. \ **Note:** Overlapping two regions' polygons is not enough for connecting two regions. They must share a similar edge.
  15. Properties
  16. ----------
  17. +---------------------------------------------------+-----------------------------------------------------------+----------+
  18. | :ref:`bool<class_bool>` | :ref:`enabled<class_NavigationRegion2D_property_enabled>` | ``true`` |
  19. +---------------------------------------------------+-----------------------------------------------------------+----------+
  20. | :ref:`int<class_int>` | :ref:`layers<class_NavigationRegion2D_property_layers>` | ``1`` |
  21. +---------------------------------------------------+-----------------------------------------------------------+----------+
  22. | :ref:`NavigationPolygon<class_NavigationPolygon>` | :ref:`navpoly<class_NavigationRegion2D_property_navpoly>` | |
  23. +---------------------------------------------------+-----------------------------------------------------------+----------+
  24. Property Descriptions
  25. ---------------------
  26. .. _class_NavigationRegion2D_property_enabled:
  27. - :ref:`bool<class_bool>` **enabled**
  28. +-----------+--------------------+
  29. | *Default* | ``true`` |
  30. +-----------+--------------------+
  31. | *Setter* | set_enabled(value) |
  32. +-----------+--------------------+
  33. | *Getter* | is_enabled() |
  34. +-----------+--------------------+
  35. Determines if the ``NavigationRegion2D`` is enabled or disabled.
  36. ----
  37. .. _class_NavigationRegion2D_property_layers:
  38. - :ref:`int<class_int>` **layers**
  39. +-----------+-------------------+
  40. | *Default* | ``1`` |
  41. +-----------+-------------------+
  42. | *Setter* | set_layers(value) |
  43. +-----------+-------------------+
  44. | *Getter* | get_layers() |
  45. +-----------+-------------------+
  46. A bitfield determining all layers the region belongs to. These layers can be checked upon when requesting a path with :ref:`NavigationServer2D.map_get_path<class_NavigationServer2D_method_map_get_path>`.
  47. ----
  48. .. _class_NavigationRegion2D_property_navpoly:
  49. - :ref:`NavigationPolygon<class_NavigationPolygon>` **navpoly**
  50. +----------+-------------------------------+
  51. | *Setter* | set_navigation_polygon(value) |
  52. +----------+-------------------------------+
  53. | *Getter* | get_navigation_polygon() |
  54. +----------+-------------------------------+
  55. The :ref:`NavigationPolygon<class_NavigationPolygon>` resource to use.
  56. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  57. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  58. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  59. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  60. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  61. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`