summaryrefslogtreecommitdiff
path: root/doc/classes/NavigationPolygon.xml
diff options
context:
space:
mode:
Diffstat (limited to 'doc/classes/NavigationPolygon.xml')
-rw-r--r--doc/classes/NavigationPolygon.xml34
1 files changed, 19 insertions, 15 deletions
diff --git a/doc/classes/NavigationPolygon.xml b/doc/classes/NavigationPolygon.xml
index e1e2c34a63..19466c171f 100644
--- a/doc/classes/NavigationPolygon.xml
+++ b/doc/classes/NavigationPolygon.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" ?>
-<class name="NavigationPolygon" inherits="Resource" version="4.0">
+<class name="NavigationPolygon" inherits="Resource" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">
<brief_description>
A node that has methods to draw outlines or use indices of vertices to create navigation polygons.
</brief_description>
@@ -28,7 +28,7 @@
var polygon = NavigationPolygon.new()
var vertices = PackedVector2Array([Vector2(0, 0), Vector2(0, 50), Vector2(50, 50), Vector2(50, 0)])
polygon.vertices = vertices
- var indices = PackedInt32Array(0, 3, 1)
+ var indices = PackedInt32Array([0, 1, 2, 3])
polygon.add_polygon(indices)
$NavigationRegion2D.navpoly = polygon
[/gdscript]
@@ -36,7 +36,7 @@
var polygon = new NavigationPolygon();
var vertices = new Vector2[] { new Vector2(0, 0), new Vector2(0, 50), new Vector2(50, 50), new Vector2(50, 0) };
polygon.Vertices = vertices;
- var indices = new int[] { 0, 3, 1 };
+ var indices = new int[] { 0, 1, 2, 3 };
polygon.AddPolygon(indices);
GetNode&lt;NavigationRegion2D&gt;("NavigationRegion2D").Navpoly = polygon;
[/csharp]
@@ -48,22 +48,22 @@
<methods>
<method name="add_outline">
<return type="void" />
- <argument index="0" name="outline" type="PackedVector2Array" />
+ <param index="0" name="outline" type="PackedVector2Array" />
<description>
Appends a [PackedVector2Array] that contains the vertices of an outline to the internal array that contains all the outlines. You have to call [method make_polygons_from_outlines] in order for this array to be converted to polygons that the engine will use.
</description>
</method>
<method name="add_outline_at_index">
<return type="void" />
- <argument index="0" name="outline" type="PackedVector2Array" />
- <argument index="1" name="index" type="int" />
+ <param index="0" name="outline" type="PackedVector2Array" />
+ <param index="1" name="index" type="int" />
<description>
Adds a [PackedVector2Array] that contains the vertices of an outline to the internal array that contains all the outlines at a fixed position. You have to call [method make_polygons_from_outlines] in order for this array to be converted to polygons that the engine will use.
</description>
</method>
<method name="add_polygon">
<return type="void" />
- <argument index="0" name="polygon" type="PackedInt32Array" />
+ <param index="0" name="polygon" type="PackedInt32Array" />
<description>
Adds a polygon using the indices of the vertices you get when calling [method get_vertices].
</description>
@@ -80,9 +80,15 @@
Clears the array of polygons, but it doesn't clear the array of outlines and vertices.
</description>
</method>
+ <method name="get_mesh">
+ <return type="NavigationMesh" />
+ <description>
+ Returns the [NavigationMesh] resulting from this navigation polygon. This navmesh can be used to update the navmesh of a region with the [method NavigationServer3D.region_set_navmesh] API directly (as 2D uses the 3D server behind the scene).
+ </description>
+ </method>
<method name="get_outline" qualifiers="const">
<return type="PackedVector2Array" />
- <argument index="0" name="idx" type="int" />
+ <param index="0" name="idx" type="int" />
<description>
Returns a [PackedVector2Array] containing the vertices of an outline that was created in the editor or by script.
</description>
@@ -95,7 +101,7 @@
</method>
<method name="get_polygon">
<return type="PackedInt32Array" />
- <argument index="0" name="idx" type="int" />
+ <param index="0" name="idx" type="int" />
<description>
Returns a [PackedInt32Array] containing the indices of the vertices of a created polygon.
</description>
@@ -120,27 +126,25 @@
</method>
<method name="remove_outline">
<return type="void" />
- <argument index="0" name="idx" type="int" />
+ <param index="0" name="idx" type="int" />
<description>
Removes an outline created in the editor or by script. You have to call [method make_polygons_from_outlines] for the polygons to update.
</description>
</method>
<method name="set_outline">
<return type="void" />
- <argument index="0" name="idx" type="int" />
- <argument index="1" name="outline" type="PackedVector2Array" />
+ <param index="0" name="idx" type="int" />
+ <param index="1" name="outline" type="PackedVector2Array" />
<description>
Changes an outline created in the editor or by script. You have to call [method make_polygons_from_outlines] for the polygons to update.
</description>
</method>
<method name="set_vertices">
<return type="void" />
- <argument index="0" name="vertices" type="PackedVector2Array" />
+ <param index="0" name="vertices" type="PackedVector2Array" />
<description>
Sets the vertices that can be then indexed to create polygons with the [method add_polygon] method.
</description>
</method>
</methods>
- <constants>
- </constants>
</class>