2017-09-13 04:42:36 +08:00
<?xml version="1.0" encoding="UTF-8" ?>
<class name= "CollisionPolygon2D" inherits= "Node2D" category= "Core" version= "3.0.alpha.custom_build" >
<brief_description >
2017-09-16 09:12:44 +08:00
Editor-only class for defining a collision polygon in 2D space.
2017-09-13 04:42:36 +08:00
</brief_description>
<description >
2017-09-16 09:12:44 +08:00
Allows editing a collision polygon's vertices. This class is only available in the editor. It will not appear in the scene tree at runtime. Creates a [Shape2D] for gameplay. Properties modified during gameplay will have no effect.
2017-09-13 04:42:36 +08:00
</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 >
2017-09-13 14:49:40 +08:00
<member name= "build_mode" type= "int" setter= "set_build_mode" getter= "get_build_mode" enum= "CollisionPolygon2D.BuildMode" >
2017-09-16 09:12:44 +08:00
If BUILD_SOLIDS, the polygon and the area within it will have collision. If BUILD_SEGMENTS, only the edges of the polygon will have collision.
2017-09-13 04:42:36 +08:00
</member>
2017-09-13 14:49:40 +08:00
<member name= "disabled" type= "bool" setter= "set_disabled" getter= "is_disabled" >
2017-09-16 09:12:44 +08:00
If true, no collision will be produced.
2017-09-13 04:42:36 +08:00
</member>
2017-09-13 14:49:40 +08:00
<member name= "one_way_collision" type= "bool" setter= "set_one_way_collision" getter= "is_one_way_collision_enabled" >
2017-09-16 09:12:44 +08:00
If true, only edges that face up, relative to CollisionPolygon2D's rotation, will collide with other objects.
2017-09-13 04:42:36 +08:00
</member>
2017-09-13 14:49:40 +08:00
<member name= "polygon" type= "PoolVector2Array" setter= "set_polygon" getter= "get_polygon" >
2017-09-16 09:12:44 +08:00
Array of vertices which define the polygon.
2017-09-13 04:42:36 +08:00
</member>
</members>
<constants >
2017-09-16 07:46:14 +08:00
<constant name= "BUILD_SOLIDS" value= "0" >
</constant>
<constant name= "BUILD_SEGMENTS" value= "1" >
</constant>
2017-09-13 04:42:36 +08:00
</constants>
</class>