Line2D.xml 8.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <class name="Line2D" inherits="Node2D" category="Core" version="3.0.alpha.custom_build">
  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_begin_cap_mode" qualifiers="const">
  24. <return type="int" enum="Line2D.LineCapMode">
  25. </return>
  26. <description>
  27. </description>
  28. </method>
  29. <method name="get_default_color" qualifiers="const">
  30. <return type="Color">
  31. </return>
  32. <description>
  33. </description>
  34. </method>
  35. <method name="get_end_cap_mode" qualifiers="const">
  36. <return type="int" enum="Line2D.LineCapMode">
  37. </return>
  38. <description>
  39. </description>
  40. </method>
  41. <method name="get_gradient" qualifiers="const">
  42. <return type="Gradient">
  43. </return>
  44. <description>
  45. </description>
  46. </method>
  47. <method name="get_joint_mode" qualifiers="const">
  48. <return type="int" enum="Line2D.LineJointMode">
  49. </return>
  50. <description>
  51. </description>
  52. </method>
  53. <method name="get_point_count" qualifiers="const">
  54. <return type="int">
  55. </return>
  56. <description>
  57. Returns the Line2D's amount of points.
  58. </description>
  59. </method>
  60. <method name="get_point_position" qualifiers="const">
  61. <return type="Vector2">
  62. </return>
  63. <argument index="0" name="i" type="int">
  64. </argument>
  65. <description>
  66. Returns point [code]i[code]'s position.
  67. </description>
  68. </method>
  69. <method name="get_points" qualifiers="const">
  70. <return type="PoolVector2Array">
  71. </return>
  72. <description>
  73. </description>
  74. </method>
  75. <method name="get_round_precision" qualifiers="const">
  76. <return type="int">
  77. </return>
  78. <description>
  79. </description>
  80. </method>
  81. <method name="get_sharp_limit" qualifiers="const">
  82. <return type="float">
  83. </return>
  84. <description>
  85. </description>
  86. </method>
  87. <method name="get_texture" qualifiers="const">
  88. <return type="Texture">
  89. </return>
  90. <description>
  91. </description>
  92. </method>
  93. <method name="get_texture_mode" qualifiers="const">
  94. <return type="int" enum="Line2D.LineTextureMode">
  95. </return>
  96. <description>
  97. </description>
  98. </method>
  99. <method name="get_width" qualifiers="const">
  100. <return type="float">
  101. </return>
  102. <description>
  103. </description>
  104. </method>
  105. <method name="remove_point">
  106. <return type="void">
  107. </return>
  108. <argument index="0" name="i" type="int">
  109. </argument>
  110. <description>
  111. Remove the point at index [code]i[/code] from the line.
  112. </description>
  113. </method>
  114. <method name="set_begin_cap_mode">
  115. <return type="void">
  116. </return>
  117. <argument index="0" name="mode" type="int" enum="Line2D.LineCapMode">
  118. </argument>
  119. <description>
  120. </description>
  121. </method>
  122. <method name="set_default_color">
  123. <return type="void">
  124. </return>
  125. <argument index="0" name="color" type="Color">
  126. </argument>
  127. <description>
  128. </description>
  129. </method>
  130. <method name="set_end_cap_mode">
  131. <return type="void">
  132. </return>
  133. <argument index="0" name="mode" type="int" enum="Line2D.LineCapMode">
  134. </argument>
  135. <description>
  136. </description>
  137. </method>
  138. <method name="set_gradient">
  139. <return type="void">
  140. </return>
  141. <argument index="0" name="color" type="Gradient">
  142. </argument>
  143. <description>
  144. </description>
  145. </method>
  146. <method name="set_joint_mode">
  147. <return type="void">
  148. </return>
  149. <argument index="0" name="mode" type="int" enum="Line2D.LineJointMode">
  150. </argument>
  151. <description>
  152. </description>
  153. </method>
  154. <method name="set_point_position">
  155. <return type="void">
  156. </return>
  157. <argument index="0" name="i" type="int">
  158. </argument>
  159. <argument index="1" name="position" type="Vector2">
  160. </argument>
  161. <description>
  162. Overwites the position in point [code]i[/code] with the supplied [code]position[/code].
  163. </description>
  164. </method>
  165. <method name="set_points">
  166. <return type="void">
  167. </return>
  168. <argument index="0" name="points" type="PoolVector2Array">
  169. </argument>
  170. <description>
  171. </description>
  172. </method>
  173. <method name="set_round_precision">
  174. <return type="void">
  175. </return>
  176. <argument index="0" name="precision" type="int">
  177. </argument>
  178. <description>
  179. </description>
  180. </method>
  181. <method name="set_sharp_limit">
  182. <return type="void">
  183. </return>
  184. <argument index="0" name="limit" type="float">
  185. </argument>
  186. <description>
  187. </description>
  188. </method>
  189. <method name="set_texture">
  190. <return type="void">
  191. </return>
  192. <argument index="0" name="texture" type="Texture">
  193. </argument>
  194. <description>
  195. </description>
  196. </method>
  197. <method name="set_texture_mode">
  198. <return type="void">
  199. </return>
  200. <argument index="0" name="mode" type="int" enum="Line2D.LineTextureMode">
  201. </argument>
  202. <description>
  203. </description>
  204. </method>
  205. <method name="set_width">
  206. <return type="void">
  207. </return>
  208. <argument index="0" name="width" type="float">
  209. </argument>
  210. <description>
  211. </description>
  212. </method>
  213. </methods>
  214. <members>
  215. <member name="begin_cap_mode" type="int" setter="set_begin_cap_mode" getter="get_begin_cap_mode" enum="Line2D.LineCapMode">
  216. Controls the style of the line's first point. Use [code]LINE_CAP_*[/code] constants. Default value: [code]LINE_CAP_NONE[/code].
  217. </member>
  218. <member name="default_color" type="Color" setter="set_default_color" getter="get_default_color">
  219. The line's color. Will not be used if a gradient is set.
  220. </member>
  221. <member name="end_cap_mode" type="int" setter="set_end_cap_mode" getter="get_end_cap_mode" enum="Line2D.LineCapMode">
  222. Controls the style of the line's last point. Use [code]LINE_CAP_*[/code] constants. Default value: [code]LINE_CAP_NONE[/code].
  223. </member>
  224. <member name="gradient" type="Gradient" setter="set_gradient" getter="get_gradient">
  225. The gradient is drawn through the whole line from start to finish. The default color will not be used if a gradient is set.
  226. </member>
  227. <member name="joint_mode" type="int" setter="set_joint_mode" getter="get_joint_mode" enum="Line2D.LineJointMode">
  228. The style for the points inbetween the start and the end.
  229. </member>
  230. <member name="points" type="PoolVector2Array" setter="set_points" getter="get_points">
  231. The points that form the lines. The line is drawn between every point set in this array.
  232. </member>
  233. <member name="round_precision" type="int" setter="set_round_precision" getter="get_round_precision">
  234. The smoothness of the rounded joints and caps. This is only used if a cap or joint is set as round.
  235. </member>
  236. <member name="sharp_limit" type="float" setter="set_sharp_limit" getter="get_sharp_limit">
  237. 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].
  238. </member>
  239. <member name="texture" type="Texture" setter="set_texture" getter="get_texture">
  240. The texture used for the line's texture. Uses [code]texture_mode[/code] for drawing style.
  241. </member>
  242. <member name="texture_mode" type="int" setter="set_texture_mode" getter="get_texture_mode" enum="Line2D.LineTextureMode">
  243. The style to render the [code]texture[/code] on the line. Use [code]LINE_TEXTURE_*[/code] constants. Default value: [code]LINE_TEXTURE_NONE[/code].
  244. </member>
  245. <member name="width" type="float" setter="set_width" getter="get_width">
  246. The line's width.
  247. </member>
  248. </members>
  249. <constants>
  250. <constant name="LINE_JOINT_SHARP" value="0">
  251. 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.
  252. </constant>
  253. <constant name="LINE_JOINT_BEVEL" value="1">
  254. The line's joints will be bevelled/chamfered.
  255. </constant>
  256. <constant name="LINE_JOINT_ROUND" value="2">
  257. The line's joints will be rounded.
  258. </constant>
  259. <constant name="LINE_CAP_NONE" value="0">
  260. Don't have a line cap.
  261. </constant>
  262. <constant name="LINE_CAP_BOX" value="1">
  263. Draws the line cap as a box.
  264. </constant>
  265. <constant name="LINE_CAP_ROUND" value="2">
  266. Draws the line cap as a circle.
  267. </constant>
  268. <constant name="LINE_TEXTURE_NONE" value="0">
  269. Takes the left pixels of the texture and renders it over the whole line.
  270. </constant>
  271. <constant name="LINE_TEXTURE_TILE" value="1">
  272. Tiles the texture over the line. The texture need to be imported with Repeat Enabled for it to work properly.
  273. </constant>
  274. </constants>
  275. </class>