Navigation2D.xml 3.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <class name="Navigation2D" inherits="Node2D" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">
  3. <brief_description>
  4. 2D navigation and pathfinding node.
  5. </brief_description>
  6. <description>
  7. [i]Deprecated.[/i] [Navigation2D] node and [method get_simple_path] are deprecated and will be removed in a future version. Use [method Navigation2DServer.map_get_path] instead.
  8. Navigation2D provides navigation and pathfinding within a 2D area, specified as a collection of [NavigationPolygon] resources. By default, these are automatically collected from child [NavigationPolygonInstance] nodes.
  9. </description>
  10. <tutorials>
  11. <link title="2D Navigation Demo">https://godotengine.org/asset-library/asset/117</link>
  12. </tutorials>
  13. <methods>
  14. <method name="get_closest_point" qualifiers="const">
  15. <return type="Vector2" />
  16. <argument index="0" name="to_point" type="Vector2" />
  17. <description>
  18. Returns the navigation point closest to the point given. Points are in local coordinate space.
  19. </description>
  20. </method>
  21. <method name="get_closest_point_owner" qualifiers="const">
  22. <return type="RID" />
  23. <argument index="0" name="to_point" type="Vector2" />
  24. <description>
  25. Returns the owner of the [NavigationPolygon] which contains the navigation point closest to the point given. This is usually a [NavigationPolygonInstance].
  26. </description>
  27. </method>
  28. <method name="get_rid" qualifiers="const">
  29. <return type="RID" />
  30. <description>
  31. Returns the object's [RID].
  32. </description>
  33. </method>
  34. <method name="get_simple_path" qualifiers="const">
  35. <return type="PoolVector2Array" />
  36. <argument index="0" name="start" type="Vector2" />
  37. <argument index="1" name="end" type="Vector2" />
  38. <argument index="2" name="optimize" type="bool" default="true" />
  39. <description>
  40. [i]Deprecated.[/i] [Navigation2D] node and [method get_simple_path] are deprecated and will be removed in a future version. Use [method Navigation2DServer.map_get_path] instead.
  41. Returns the path between two given points. Points are in local coordinate space. If [code]optimize[/code] is [code]true[/code] (the default), the path is smoothed by merging path segments where possible.
  42. </description>
  43. </method>
  44. </methods>
  45. <members>
  46. <member name="cell_size" type="float" setter="set_cell_size" getter="get_cell_size" default="1.0">
  47. The XY plane cell size to use for fields.
  48. </member>
  49. <member name="edge_connection_margin" type="float" setter="set_edge_connection_margin" getter="get_edge_connection_margin" default="1.0">
  50. This value is used to detect the near edges to connect compatible regions.
  51. </member>
  52. <member name="navigation_layers" type="int" setter="set_navigation_layers" getter="get_navigation_layers" default="1">
  53. A bitfield determining all navigation map layers the navigation can use on a [method Navigation2D.get_simple_path] path query.
  54. </member>
  55. </members>
  56. <constants>
  57. </constants>
  58. </class>