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.xml8
1 files changed, 4 insertions, 4 deletions
diff --git a/doc/classes/NavigationPolygon.xml b/doc/classes/NavigationPolygon.xml
index 4ede80b98c..53389d6599 100644
--- a/doc/classes/NavigationPolygon.xml
+++ b/doc/classes/NavigationPolygon.xml
@@ -6,22 +6,22 @@
<description>
There are two ways to create polygons. Either by using the [method add_outline] method or using the [method add_polygon] method.
Using [method add_outline]:
- [code]
+ [codeblock]
var polygon = NavigationPolygon.new()
var outline = PoolVector2Array([Vector2(0, 0), Vector2(0, 50), Vector2(50, 50), Vector2(50, 0)])
polygon.add_outline(outline)
polygon.make_polygons_from_outlines()
$NavigationPolygonInstance.navpoly = polygon
- [/code]
+ [/codeblock]
Using [method add_polygon] and indices of the vertices array.
- [code]
+ [codeblock]
var polygon = NavigationPolygon.new()
var vertices = PoolVector2Array([Vector2(0, 0), Vector2(0, 50), Vector2(50, 50), Vector2(50, 0)])
polygon.set_vertices(vertices)
var indices = PoolIntArray(0, 3, 1)
polygon.add_polygon(indices)
$NavigationPolygonInstance.navpoly = polygon
- [/code]
+ [/codeblock]
</description>
<tutorials>
</tutorials>