Partial documentation for Polygon2D and Raycast2D (#4467)

(cherry picked from commit 9f29b4b26a)
This commit is contained in:
Daniel Ramirez 2016-04-28 03:14:55 -05:00 committed by Rémi Verschelde
parent 238bbb6539
commit 35e05b092c
1 changed files with 32 additions and 1 deletions

View File

@ -25954,80 +25954,94 @@ This method controls whether the position between two cached points is interpola
</class> </class>
<class name="Polygon2D" inherits="Node2D" category="Core"> <class name="Polygon2D" inherits="Node2D" category="Core">
<brief_description> <brief_description>
2D polygon representation
</brief_description> </brief_description>
<description> <description>
A Polygon2D is defined by a set of n points connected together by line segments, meaning that the point 1 will be connected with point 2, point 2 with point 3 ..., point n-1 with point n and point n with point 1 in order to close the loop and define a plane.
</description> </description>
<methods> <methods>
<method name="set_polygon"> <method name="set_polygon">
<argument index="0" name="polygon" type="Vector2Array"> <argument index="0" name="polygon" type="Vector2Array">
</argument> </argument>
<description> <description>
Defines the set of points that will represent the polygon.
</description> </description>
</method> </method>
<method name="get_polygon" qualifiers="const"> <method name="get_polygon" qualifiers="const">
<return type="Vector2Array"> <return type="Vector2Array">
</return> </return>
<description> <description>
Returns the set of points that defines this polygon
</description> </description>
</method> </method>
<method name="set_uv"> <method name="set_uv">
<argument index="0" name="uv" type="Vector2Array"> <argument index="0" name="uv" type="Vector2Array">
</argument> </argument>
<description> <description>
Sets the uv value for every point of the polygon
</description> </description>
</method> </method>
<method name="get_uv" qualifiers="const"> <method name="get_uv" qualifiers="const">
<return type="Vector2Array"> <return type="Vector2Array">
</return> </return>
<description> <description>
Returns the uv value associated with every point of the polygon
</description> </description>
</method> </method>
<method name="set_color"> <method name="set_color">
<argument index="0" name="color" type="Color"> <argument index="0" name="color" type="Color">
</argument> </argument>
<description> <description>
Sets the polygon fill color, if the polygon has a texture defined, the defined texture will be tinted to the polygon fill color.
</description> </description>
</method> </method>
<method name="get_color" qualifiers="const"> <method name="get_color" qualifiers="const">
<return type="Color"> <return type="Color">
</return> </return>
<description> <description>
Returns the polygon fill color
</description> </description>
</method> </method>
<method name="set_texture"> <method name="set_texture">
<argument index="0" name="texture" type="Object"> <argument index="0" name="texture" type="Object">
</argument> </argument>
<description> <description>
Sets the polygon texture.
</description> </description>
</method> </method>
<method name="get_texture" qualifiers="const"> <method name="get_texture" qualifiers="const">
<return type="Object"> <return type="Object">
</return> </return>
<description> <description>
Returns the polygon texture
</description> </description>
</method> </method>
<method name="set_texture_offset"> <method name="set_texture_offset">
<argument index="0" name="texture_offset" type="Vector2"> <argument index="0" name="texture_offset" type="Vector2">
</argument> </argument>
<description> <description>
Sets the offset of the polygon texture. Initially the texture will appear anchored to the polygon position, the offset is used to move the texture location away from that point (notice that the texture origin is set to its top left corner, so when offset is 0,0 the top left corner of the texture is at the polygon position), for example setting the offset to 10, 10 will move the texture 10 units to the left and 10 units to the top.
</description> </description>
</method> </method>
<method name="get_texture_offset" qualifiers="const"> <method name="get_texture_offset" qualifiers="const">
<return type="Vector2"> <return type="Vector2">
</return> </return>
<description> <description>
Returns the polygon texture offset
</description> </description>
</method> </method>
<method name="set_texture_rotation"> <method name="set_texture_rotation">
<argument index="0" name="texture_rotation" type="float"> <argument index="0" name="texture_rotation" type="float">
</argument> </argument>
<description> <description>
Sets the amount of rotation of the polygon texture, [code]texture_rotation[/code] is specified in degrees and clockwise rotation, meaning that if the texture rotation is set to 45 degrees, the texture will be rotated 45 degrees clockwise along the polygon position plus the texture offset.
</description> </description>
</method> </method>
<method name="get_texture_rotation" qualifiers="const"> <method name="get_texture_rotation" qualifiers="const">
<return type="float"> <return type="float">
</return> </return>
<description> <description>
Returns the rotation in degrees of the texture polygon
</description> </description>
</method> </method>
<method name="set_texture_scale"> <method name="set_texture_scale">
@ -26046,12 +26060,14 @@ This method controls whether the position between two cached points is interpola
<argument index="0" name="invert" type="bool"> <argument index="0" name="invert" type="bool">
</argument> </argument>
<description> <description>
Sets the polygon as the defined polygon bounding box minus the defined polygon (the defined polygon will appear as a hole on square that contains the defined polygon).
</description> </description>
</method> </method>
<method name="get_invert" qualifiers="const"> <method name="get_invert" qualifiers="const">
<return type="bool"> <return type="bool">
</return> </return>
<description> <description>
Returns whether this polygon is inverted or not
</description> </description>
</method> </method>
<method name="set_invert_border"> <method name="set_invert_border">
@ -26070,12 +26086,14 @@ This method controls whether the position between two cached points is interpola
<argument index="0" name="offset" type="Vector2"> <argument index="0" name="offset" type="Vector2">
</argument> </argument>
<description> <description>
Sets the amount of distance from the polygon points from the polygon position, for example if the offset is set to 10,10 then all the polygon points will move 10 units to the right and 10 units to the bottom.
</description> </description>
</method> </method>
<method name="get_offset" qualifiers="const"> <method name="get_offset" qualifiers="const">
<return type="Vector2"> <return type="Vector2">
</return> </return>
<description> <description>
Returns the polygon points offset to the polygon position.
</description> </description>
</method> </method>
</methods> </methods>
@ -27277,39 +27295,45 @@ This method controls whether the position between two cached points is interpola
</class> </class>
<class name="RayCast2D" inherits="Node2D" category="Core"> <class name="RayCast2D" inherits="Node2D" category="Core">
<brief_description> <brief_description>
Query the closest object intersecting a ray
</brief_description> </brief_description>
<description> <description>
A RayCast2D represents a line from its origin to its destination position [code]cast_to[/code], it is used to query the 2D space in order to find the closest object intersecting with the ray.
</description> </description>
<methods> <methods>
<method name="set_enabled"> <method name="set_enabled">
<argument index="0" name="enabled" type="bool"> <argument index="0" name="enabled" type="bool">
</argument> </argument>
<description> <description>
Enables the RayCast2D. Only enabled raycasts will be able to query the space and report collisions.
</description> </description>
</method> </method>
<method name="is_enabled" qualifiers="const"> <method name="is_enabled" qualifiers="const">
<return type="bool"> <return type="bool">
</return> </return>
<description> <description>
Returns whether this raycast is enabled or not
</description> </description>
</method> </method>
<method name="set_cast_to"> <method name="set_cast_to">
<argument index="0" name="local_point" type="Vector2"> <argument index="0" name="local_point" type="Vector2">
</argument> </argument>
<description> <description>
Sets the ray destination point, so that the ray will test from the ray's origin to [code]local_point[/code]
</description> </description>
</method> </method>
<method name="get_cast_to" qualifiers="const"> <method name="get_cast_to" qualifiers="const">
<return type="Vector2"> <return type="Vector2">
</return> </return>
<description> <description>
Return the destination point of this ray object
</description> </description>
</method> </method>
<method name="is_colliding" qualifiers="const"> <method name="is_colliding" qualifiers="const">
<return type="bool"> <return type="bool">
</return> </return>
<description> <description>
Return whether the closest object the ray is pointing to is colliding with the vector, with the vector length considered. Return whether the closest object the ray is pointing to is colliding with the vector (considering the vector length).
</description> </description>
</method> </method>
<method name="get_collider" qualifiers="const"> <method name="get_collider" qualifiers="const">
@ -27323,18 +27347,21 @@ This method controls whether the position between two cached points is interpola
<return type="int"> <return type="int">
</return> </return>
<description> <description>
Returns the collision shape of the closest object the ray is pointing to.
</description> </description>
</method> </method>
<method name="get_collision_point" qualifiers="const"> <method name="get_collision_point" qualifiers="const">
<return type="Vector2"> <return type="Vector2">
</return> </return>
<description> <description>
Returns the collision point in which the ray intersects the closest object.
</description> </description>
</method> </method>
<method name="get_collision_normal" qualifiers="const"> <method name="get_collision_normal" qualifiers="const">
<return type="Vector2"> <return type="Vector2">
</return> </return>
<description> <description>
Returns the normal of the intersecting object shape face containing the collision point.
</description> </description>
</method> </method>
<method name="add_exception_rid"> <method name="add_exception_rid">
@ -27347,6 +27374,7 @@ This method controls whether the position between two cached points is interpola
<argument index="0" name="node" type="Object"> <argument index="0" name="node" type="Object">
</argument> </argument>
<description> <description>
Adds a collision exception so the ray does not report collisions with the specified [code]node[/code].
</description> </description>
</method> </method>
<method name="remove_exception_rid"> <method name="remove_exception_rid">
@ -27359,10 +27387,12 @@ This method controls whether the position between two cached points is interpola
<argument index="0" name="node" type="Object"> <argument index="0" name="node" type="Object">
</argument> </argument>
<description> <description>
Removes a collision exception so the ray does report collisions with the specified [code]node[/code].
</description> </description>
</method> </method>
<method name="clear_exceptions"> <method name="clear_exceptions">
<description> <description>
Removes all collision exception for this ray.
</description> </description>
</method> </method>
<method name="set_layer_mask"> <method name="set_layer_mask">
@ -27375,6 +27405,7 @@ This method controls whether the position between two cached points is interpola
<return type="int"> <return type="int">
</return> </return>
<description> <description>
Returns the layer mask for this ray.
</description> </description>
</method> </method>
<method name="set_type_mask"> <method name="set_type_mask">