2017-09-12 20:42:36 +00:00
|
|
|
<?xml version="1.0" encoding="UTF-8" ?>
|
2019-07-05 09:32:53 +00:00
|
|
|
<class name="Line2D" inherits="Node2D" category="Core" version="3.1.2">
|
2017-09-12 20:42:36 +00:00
|
|
|
<brief_description>
|
|
|
|
A 2D line.
|
|
|
|
</brief_description>
|
|
|
|
<description>
|
|
|
|
A line through several points in 2D space.
|
|
|
|
</description>
|
|
|
|
<tutorials>
|
|
|
|
</tutorials>
|
|
|
|
<methods>
|
|
|
|
<method name="add_point">
|
|
|
|
<return type="void">
|
|
|
|
</return>
|
2017-09-10 13:37:49 +00:00
|
|
|
<argument index="0" name="position" type="Vector2">
|
2017-09-12 20:42:36 +00:00
|
|
|
</argument>
|
|
|
|
<description>
|
2017-10-01 22:12:14 +00:00
|
|
|
Add a point at the [code]position[/code]. Appends the point at the end of the line.
|
2017-09-12 20:42:36 +00:00
|
|
|
</description>
|
|
|
|
</method>
|
2019-03-19 16:59:24 +00:00
|
|
|
<method name="clear_points">
|
|
|
|
<return type="void">
|
|
|
|
</return>
|
|
|
|
<description>
|
|
|
|
Removes all points from the line.
|
|
|
|
</description>
|
|
|
|
</method>
|
2017-09-12 20:42:36 +00:00
|
|
|
<method name="get_point_count" qualifiers="const">
|
|
|
|
<return type="int">
|
|
|
|
</return>
|
|
|
|
<description>
|
2017-10-01 22:12:14 +00:00
|
|
|
Returns the Line2D's amount of points.
|
2017-09-12 20:42:36 +00:00
|
|
|
</description>
|
|
|
|
</method>
|
2017-09-10 13:37:49 +00:00
|
|
|
<method name="get_point_position" qualifiers="const">
|
2017-09-12 20:42:36 +00:00
|
|
|
<return type="Vector2">
|
|
|
|
</return>
|
|
|
|
<argument index="0" name="i" type="int">
|
|
|
|
</argument>
|
|
|
|
<description>
|
2017-11-18 00:29:32 +00:00
|
|
|
Returns point [code]i[/code]'s position.
|
2017-09-12 20:42:36 +00:00
|
|
|
</description>
|
|
|
|
</method>
|
|
|
|
<method name="remove_point">
|
|
|
|
<return type="void">
|
|
|
|
</return>
|
|
|
|
<argument index="0" name="i" type="int">
|
|
|
|
</argument>
|
|
|
|
<description>
|
2017-10-01 22:12:14 +00:00
|
|
|
Remove the point at index [code]i[/code] from the line.
|
2017-09-12 20:42:36 +00:00
|
|
|
</description>
|
|
|
|
</method>
|
2017-09-10 13:37:49 +00:00
|
|
|
<method name="set_point_position">
|
2017-09-12 20:42:36 +00:00
|
|
|
<return type="void">
|
|
|
|
</return>
|
|
|
|
<argument index="0" name="i" type="int">
|
|
|
|
</argument>
|
2017-09-10 13:37:49 +00:00
|
|
|
<argument index="1" name="position" type="Vector2">
|
2017-09-12 20:42:36 +00:00
|
|
|
</argument>
|
|
|
|
<description>
|
2018-02-21 16:30:55 +00:00
|
|
|
Overwrites the position in point [code]i[/code] with the supplied [code]position[/code].
|
2017-09-12 20:42:36 +00:00
|
|
|
</description>
|
|
|
|
</method>
|
|
|
|
</methods>
|
|
|
|
<members>
|
2017-09-15 23:46:14 +00:00
|
|
|
<member name="begin_cap_mode" type="int" setter="set_begin_cap_mode" getter="get_begin_cap_mode" enum="Line2D.LineCapMode">
|
2017-10-01 22:12:14 +00:00
|
|
|
Controls the style of the line's first point. Use [code]LINE_CAP_*[/code] constants. Default value: [code]LINE_CAP_NONE[/code].
|
2017-09-12 20:42:36 +00:00
|
|
|
</member>
|
2017-09-13 06:49:40 +00:00
|
|
|
<member name="default_color" type="Color" setter="set_default_color" getter="get_default_color">
|
2017-10-01 22:12:14 +00:00
|
|
|
The line's color. Will not be used if a gradient is set.
|
2017-09-12 20:42:36 +00:00
|
|
|
</member>
|
2017-09-15 23:46:14 +00:00
|
|
|
<member name="end_cap_mode" type="int" setter="set_end_cap_mode" getter="get_end_cap_mode" enum="Line2D.LineCapMode">
|
2017-10-01 22:12:14 +00:00
|
|
|
Controls the style of the line's last point. Use [code]LINE_CAP_*[/code] constants. Default value: [code]LINE_CAP_NONE[/code].
|
2017-09-12 20:42:36 +00:00
|
|
|
</member>
|
2017-09-13 06:49:40 +00:00
|
|
|
<member name="gradient" type="Gradient" setter="set_gradient" getter="get_gradient">
|
2017-10-01 22:12:14 +00:00
|
|
|
The gradient is drawn through the whole line from start to finish. The default color will not be used if a gradient is set.
|
2017-09-12 20:42:36 +00:00
|
|
|
</member>
|
2017-09-15 23:46:14 +00:00
|
|
|
<member name="joint_mode" type="int" setter="set_joint_mode" getter="get_joint_mode" enum="Line2D.LineJointMode">
|
2018-01-18 20:37:17 +00:00
|
|
|
The style for the points between the start and the end.
|
2017-09-12 20:42:36 +00:00
|
|
|
</member>
|
2017-09-13 06:49:40 +00:00
|
|
|
<member name="points" type="PoolVector2Array" setter="set_points" getter="get_points">
|
2017-10-01 22:12:14 +00:00
|
|
|
The points that form the lines. The line is drawn between every point set in this array.
|
2017-09-12 20:42:36 +00:00
|
|
|
</member>
|
2017-09-13 06:49:40 +00:00
|
|
|
<member name="round_precision" type="int" setter="set_round_precision" getter="get_round_precision">
|
2017-10-01 22:12:14 +00:00
|
|
|
The smoothness of the rounded joints and caps. This is only used if a cap or joint is set as round.
|
2017-09-12 20:42:36 +00:00
|
|
|
</member>
|
2017-09-13 06:49:40 +00:00
|
|
|
<member name="sharp_limit" type="float" setter="set_sharp_limit" getter="get_sharp_limit">
|
2017-10-01 22:12:14 +00:00
|
|
|
The direction difference in radians between vector points. This value is only used if [code]joint mode[/code] is set to [code]LINE_JOINT_SHARP[/code].
|
2017-09-12 20:42:36 +00:00
|
|
|
</member>
|
2017-09-13 06:49:40 +00:00
|
|
|
<member name="texture" type="Texture" setter="set_texture" getter="get_texture">
|
2017-10-01 22:12:14 +00:00
|
|
|
The texture used for the line's texture. Uses [code]texture_mode[/code] for drawing style.
|
2017-09-12 20:42:36 +00:00
|
|
|
</member>
|
2017-09-15 23:46:14 +00:00
|
|
|
<member name="texture_mode" type="int" setter="set_texture_mode" getter="get_texture_mode" enum="Line2D.LineTextureMode">
|
2017-10-01 22:12:14 +00:00
|
|
|
The style to render the [code]texture[/code] on the line. Use [code]LINE_TEXTURE_*[/code] constants. Default value: [code]LINE_TEXTURE_NONE[/code].
|
2017-09-12 20:42:36 +00:00
|
|
|
</member>
|
2017-09-13 06:49:40 +00:00
|
|
|
<member name="width" type="float" setter="set_width" getter="get_width">
|
2017-10-01 22:12:14 +00:00
|
|
|
The line's width.
|
2017-09-12 20:42:36 +00:00
|
|
|
</member>
|
|
|
|
</members>
|
|
|
|
<constants>
|
2017-11-24 22:16:30 +00:00
|
|
|
<constant name="LINE_JOINT_SHARP" value="0" enum="LineJointMode">
|
2017-10-01 22:12:14 +00:00
|
|
|
The line's joints will be pointy. If [code]sharp_limit[/code] is greater than the rotation of a joint, it becomes a bevel joint instead.
|
2017-09-12 20:42:36 +00:00
|
|
|
</constant>
|
2017-11-24 22:16:30 +00:00
|
|
|
<constant name="LINE_JOINT_BEVEL" value="1" enum="LineJointMode">
|
2017-10-01 22:12:14 +00:00
|
|
|
The line's joints will be bevelled/chamfered.
|
2017-09-12 20:42:36 +00:00
|
|
|
</constant>
|
2017-11-24 22:16:30 +00:00
|
|
|
<constant name="LINE_JOINT_ROUND" value="2" enum="LineJointMode">
|
2017-10-01 22:12:14 +00:00
|
|
|
The line's joints will be rounded.
|
2017-09-12 20:42:36 +00:00
|
|
|
</constant>
|
2017-11-24 22:16:30 +00:00
|
|
|
<constant name="LINE_CAP_NONE" value="0" enum="LineCapMode">
|
2017-10-01 22:12:14 +00:00
|
|
|
Don't have a line cap.
|
2017-09-12 20:42:36 +00:00
|
|
|
</constant>
|
2017-11-24 22:16:30 +00:00
|
|
|
<constant name="LINE_CAP_BOX" value="1" enum="LineCapMode">
|
2017-10-01 22:12:14 +00:00
|
|
|
Draws the line cap as a box.
|
2017-09-12 20:42:36 +00:00
|
|
|
</constant>
|
2017-11-24 22:16:30 +00:00
|
|
|
<constant name="LINE_CAP_ROUND" value="2" enum="LineCapMode">
|
2017-10-01 22:12:14 +00:00
|
|
|
Draws the line cap as a circle.
|
2017-09-12 20:42:36 +00:00
|
|
|
</constant>
|
2017-11-24 22:16:30 +00:00
|
|
|
<constant name="LINE_TEXTURE_NONE" value="0" enum="LineTextureMode">
|
2017-10-01 22:12:14 +00:00
|
|
|
Takes the left pixels of the texture and renders it over the whole line.
|
2017-09-12 20:42:36 +00:00
|
|
|
</constant>
|
2017-11-24 22:16:30 +00:00
|
|
|
<constant name="LINE_TEXTURE_TILE" value="1" enum="LineTextureMode">
|
2017-10-01 22:12:14 +00:00
|
|
|
Tiles the texture over the line. The texture need to be imported with Repeat Enabled for it to work properly.
|
2017-09-12 20:42:36 +00:00
|
|
|
</constant>
|
2018-07-16 12:31:19 +00:00
|
|
|
<constant name="LINE_TEXTURE_STRETCH" value="2" enum="LineTextureMode">
|
|
|
|
Stretches the texture across the line. Import the texture with Repeat Disabled for best results.
|
|
|
|
</constant>
|
2017-09-12 20:42:36 +00:00
|
|
|
</constants>
|
|
|
|
</class>
|