Line2D.xml 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <class name="Line2D" inherits="Node2D" category="Core" version="3.1">
  3. <brief_description>
  4. A 2D line.
  5. </brief_description>
  6. <description>
  7. A line through several points in 2D space.
  8. </description>
  9. <tutorials>
  10. </tutorials>
  11. <demos>
  12. </demos>
  13. <methods>
  14. <method name="add_point">
  15. <return type="void">
  16. </return>
  17. <argument index="0" name="position" type="Vector2">
  18. </argument>
  19. <description>
  20. Add a point at the [code]position[/code]. Appends the point at the end of the line.
  21. </description>
  22. </method>
  23. <method name="get_point_count" qualifiers="const">
  24. <return type="int">
  25. </return>
  26. <description>
  27. Returns the Line2D's amount of points.
  28. </description>
  29. </method>
  30. <method name="get_point_position" qualifiers="const">
  31. <return type="Vector2">
  32. </return>
  33. <argument index="0" name="i" type="int">
  34. </argument>
  35. <description>
  36. Returns point [code]i[/code]'s position.
  37. </description>
  38. </method>
  39. <method name="remove_point">
  40. <return type="void">
  41. </return>
  42. <argument index="0" name="i" type="int">
  43. </argument>
  44. <description>
  45. Remove the point at index [code]i[/code] from the line.
  46. </description>
  47. </method>
  48. <method name="set_point_position">
  49. <return type="void">
  50. </return>
  51. <argument index="0" name="i" type="int">
  52. </argument>
  53. <argument index="1" name="position" type="Vector2">
  54. </argument>
  55. <description>
  56. Overwrites the position in point [code]i[/code] with the supplied [code]position[/code].
  57. </description>
  58. </method>
  59. </methods>
  60. <members>
  61. <member name="begin_cap_mode" type="int" setter="set_begin_cap_mode" getter="get_begin_cap_mode" enum="Line2D.LineCapMode">
  62. Controls the style of the line's first point. Use [code]LINE_CAP_*[/code] constants. Default value: [code]LINE_CAP_NONE[/code].
  63. </member>
  64. <member name="default_color" type="Color" setter="set_default_color" getter="get_default_color">
  65. The line's color. Will not be used if a gradient is set.
  66. </member>
  67. <member name="end_cap_mode" type="int" setter="set_end_cap_mode" getter="get_end_cap_mode" enum="Line2D.LineCapMode">
  68. Controls the style of the line's last point. Use [code]LINE_CAP_*[/code] constants. Default value: [code]LINE_CAP_NONE[/code].
  69. </member>
  70. <member name="gradient" type="Gradient" setter="set_gradient" getter="get_gradient">
  71. The gradient is drawn through the whole line from start to finish. The default color will not be used if a gradient is set.
  72. </member>
  73. <member name="joint_mode" type="int" setter="set_joint_mode" getter="get_joint_mode" enum="Line2D.LineJointMode">
  74. The style for the points between the start and the end.
  75. </member>
  76. <member name="points" type="PoolVector2Array" setter="set_points" getter="get_points">
  77. The points that form the lines. The line is drawn between every point set in this array.
  78. </member>
  79. <member name="round_precision" type="int" setter="set_round_precision" getter="get_round_precision">
  80. The smoothness of the rounded joints and caps. This is only used if a cap or joint is set as round.
  81. </member>
  82. <member name="sharp_limit" type="float" setter="set_sharp_limit" getter="get_sharp_limit">
  83. 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].
  84. </member>
  85. <member name="texture" type="Texture" setter="set_texture" getter="get_texture">
  86. The texture used for the line's texture. Uses [code]texture_mode[/code] for drawing style.
  87. </member>
  88. <member name="texture_mode" type="int" setter="set_texture_mode" getter="get_texture_mode" enum="Line2D.LineTextureMode">
  89. The style to render the [code]texture[/code] on the line. Use [code]LINE_TEXTURE_*[/code] constants. Default value: [code]LINE_TEXTURE_NONE[/code].
  90. </member>
  91. <member name="width" type="float" setter="set_width" getter="get_width">
  92. The line's width.
  93. </member>
  94. </members>
  95. <constants>
  96. <constant name="LINE_JOINT_SHARP" value="0" enum="LineJointMode">
  97. 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.
  98. </constant>
  99. <constant name="LINE_JOINT_BEVEL" value="1" enum="LineJointMode">
  100. The line's joints will be bevelled/chamfered.
  101. </constant>
  102. <constant name="LINE_JOINT_ROUND" value="2" enum="LineJointMode">
  103. The line's joints will be rounded.
  104. </constant>
  105. <constant name="LINE_CAP_NONE" value="0" enum="LineCapMode">
  106. Don't have a line cap.
  107. </constant>
  108. <constant name="LINE_CAP_BOX" value="1" enum="LineCapMode">
  109. Draws the line cap as a box.
  110. </constant>
  111. <constant name="LINE_CAP_ROUND" value="2" enum="LineCapMode">
  112. Draws the line cap as a circle.
  113. </constant>
  114. <constant name="LINE_TEXTURE_NONE" value="0" enum="LineTextureMode">
  115. Takes the left pixels of the texture and renders it over the whole line.
  116. </constant>
  117. <constant name="LINE_TEXTURE_TILE" value="1" enum="LineTextureMode">
  118. Tiles the texture over the line. The texture need to be imported with Repeat Enabled for it to work properly.
  119. </constant>
  120. <constant name="LINE_TEXTURE_STRETCH" value="2" enum="LineTextureMode">
  121. Stretches the texture across the line. Import the texture with Repeat Disabled for best results.
  122. </constant>
  123. </constants>
  124. </class>