summaryrefslogtreecommitdiff
path: root/doc/classes/CollisionPolygon2D.xml
blob: 7f30e8e83e8d302c34987bf3f97a0622dc7861e1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
<?xml version="1.0" encoding="UTF-8" ?>
<class name="CollisionPolygon2D" inherits="Node2D" category="Core" version="3.0.alpha.custom_build">
	<brief_description>
		Defines a 2D collision polygon.
	</brief_description>
	<description>
		Provides a 2D collision polygon to a [CollisionObject2D] parent. Polygon can be drawn in the editor or specified by a list of vertices.
	</description>
	<tutorials>
	</tutorials>
	<demos>
	</demos>
	<methods>
		<method name="get_build_mode" qualifiers="const">
			<return type="int" enum="CollisionPolygon2D.BuildMode">
			</return>
			<description>
				Return whether the polygon is a [ConvexPolygonShape2D] ([code]build_mode==0[/code]), or a [ConcavePolygonShape2D] ([code]build_mode==1[/code]).
			</description>
		</method>
		<method name="get_polygon" qualifiers="const">
			<return type="PoolVector2Array">
			</return>
			<description>
				Return the list of points that define the polygon.
			</description>
		</method>
		<method name="is_disabled" qualifiers="const">
			<return type="bool">
			</return>
			<description>
			</description>
		</method>
		<method name="is_one_way_collision_enabled" qualifiers="const">
			<return type="bool">
			</return>
			<description>
			</description>
		</method>
		<method name="set_build_mode">
			<return type="void">
			</return>
			<argument index="0" name="build_mode" type="int" enum="CollisionPolygon2D.BuildMode">
			</argument>
			<description>
				Set whether the polygon is to be a [ConvexPolygonShape2D] ([code]build_mode==0[/code]), or a [ConcavePolygonShape2D] ([code]build_mode==1[/code]).
			</description>
		</method>
		<method name="set_disabled">
			<return type="void">
			</return>
			<argument index="0" name="disabled" type="bool">
			</argument>
			<description>
			</description>
		</method>
		<method name="set_one_way_collision">
			<return type="void">
			</return>
			<argument index="0" name="enabled" type="bool">
			</argument>
			<description>
			</description>
		</method>
		<method name="set_polygon">
			<return type="void">
			</return>
			<argument index="0" name="polygon" type="PoolVector2Array">
			</argument>
			<description>
				Set the array of points forming the polygon.
				When editing the point list via the editor, depending on [method get_build_mode], it has to be a list of points (for [code]build_mode==0[/code]), or a list of lines (for [code]build_mode==1[/code]). In the second case, the even elements of the array define the start point of the line, and the odd elements the end point.
			</description>
		</method>
	</methods>
	<members>
		<member name="build_mode" type="int" setter="set_build_mode" getter="get_build_mode" enum="CollisionPolygon2D.BuildMode">
			Collision build mode. Use one of the [code]BUILD_*[/code] constants. Default value: [code]BUILD_SOLIDS[/code].
		</member>
		<member name="disabled" type="bool" setter="set_disabled" getter="is_disabled">
			If [code]true[/code] no collisions will be detected.
		</member>
		<member name="one_way_collision" type="bool" setter="set_one_way_collision" getter="is_one_way_collision_enabled">
			If [code]true[/code] only edges that face up, relative to CollisionPolygon2D's rotation, will collide with other objects.
		</member>
		<member name="polygon" type="PoolVector2Array" setter="set_polygon" getter="get_polygon">
			The polygon's list of vertices. The final point will be connected to the first.
		</member>
	</members>
	<constants>
		<constant name="BUILD_SOLIDS" value="0">
			Collisions will include the polygon and its contained area.
		</constant>
		<constant name="BUILD_SEGMENTS" value="1">
			Collisions will only include the polygon edges.
		</constant>
	</constants>
</class>