Transform2D.xml 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <class name="Transform2D" category="Built-In Types" version="3.1">
  3. <brief_description>
  4. 2D Transformation. 3x2 matrix.
  5. </brief_description>
  6. <description>
  7. Represents one or many transformations in 2D space such as translation, rotation, or scaling. It consists of a two [Vector2] x, y and [Vector2] "origin". It is similar to a 3x2 matrix.
  8. </description>
  9. <tutorials>
  10. </tutorials>
  11. <demos>
  12. </demos>
  13. <methods>
  14. <method name="Transform2D">
  15. <return type="Transform2D">
  16. </return>
  17. <argument index="0" name="from" type="Transform">
  18. </argument>
  19. <description>
  20. Constructs the transform from a 3D [Transform].
  21. </description>
  22. </method>
  23. <method name="Transform2D">
  24. <return type="Transform2D">
  25. </return>
  26. <argument index="0" name="x_axis" type="Vector2">
  27. </argument>
  28. <argument index="1" name="y_axis" type="Vector2">
  29. </argument>
  30. <argument index="2" name="origin" type="Vector2">
  31. </argument>
  32. <description>
  33. Constructs the transform from 3 [Vector2]s representing x, y, and origin.
  34. </description>
  35. </method>
  36. <method name="Transform2D">
  37. <return type="Transform2D">
  38. </return>
  39. <argument index="0" name="rotation" type="float">
  40. </argument>
  41. <argument index="1" name="position" type="Vector2">
  42. </argument>
  43. <description>
  44. Constructs the transform from a given angle (in radians) and position.
  45. </description>
  46. </method>
  47. <method name="affine_inverse">
  48. <return type="Transform2D">
  49. </return>
  50. <description>
  51. Returns the inverse of the matrix.
  52. </description>
  53. </method>
  54. <method name="basis_xform">
  55. <return type="Vector2">
  56. </return>
  57. <argument index="0" name="v" type="Vector2">
  58. </argument>
  59. <description>
  60. Transforms the given vector by this transform's basis (no translation).
  61. </description>
  62. </method>
  63. <method name="basis_xform_inv">
  64. <return type="Vector2">
  65. </return>
  66. <argument index="0" name="v" type="Vector2">
  67. </argument>
  68. <description>
  69. Inverse-transforms the given vector by this transform's basis (no translation).
  70. </description>
  71. </method>
  72. <method name="get_origin">
  73. <return type="Vector2">
  74. </return>
  75. <description>
  76. Returns the transform's origin (translation).
  77. </description>
  78. </method>
  79. <method name="get_rotation">
  80. <return type="float">
  81. </return>
  82. <description>
  83. Returns the transform's rotation (in radians).
  84. </description>
  85. </method>
  86. <method name="get_scale">
  87. <return type="Vector2">
  88. </return>
  89. <description>
  90. Returns the scale.
  91. </description>
  92. </method>
  93. <method name="interpolate_with">
  94. <return type="Transform2D">
  95. </return>
  96. <argument index="0" name="transform" type="Transform2D">
  97. </argument>
  98. <argument index="1" name="weight" type="float">
  99. </argument>
  100. <description>
  101. Returns a transform interpolated between this transform and another by a given weight (0-1).
  102. </description>
  103. </method>
  104. <method name="inverse">
  105. <return type="Transform2D">
  106. </return>
  107. <description>
  108. Returns the inverse of the transform, under the assumption that the transformation is composed of rotation and translation (no scaling, use affine_inverse for transforms with scaling).
  109. </description>
  110. </method>
  111. <method name="orthonormalized">
  112. <return type="Transform2D">
  113. </return>
  114. <description>
  115. Returns the transform with the basis orthogonal (90 degrees), and normalized axis vectors.
  116. </description>
  117. </method>
  118. <method name="rotated">
  119. <return type="Transform2D">
  120. </return>
  121. <argument index="0" name="phi" type="float">
  122. </argument>
  123. <description>
  124. Rotates the transform by the given angle (in radians).
  125. </description>
  126. </method>
  127. <method name="scaled">
  128. <return type="Transform2D">
  129. </return>
  130. <argument index="0" name="scale" type="Vector2">
  131. </argument>
  132. <description>
  133. Scales the transform by the given factor.
  134. </description>
  135. </method>
  136. <method name="translated">
  137. <return type="Transform2D">
  138. </return>
  139. <argument index="0" name="offset" type="Vector2">
  140. </argument>
  141. <description>
  142. Translates the transform by the given offset.
  143. </description>
  144. </method>
  145. <method name="xform">
  146. <return type="Variant">
  147. </return>
  148. <argument index="0" name="v" type="Variant">
  149. </argument>
  150. <description>
  151. Transforms the given [Vector2] or [Rect2] by this transform.
  152. </description>
  153. </method>
  154. <method name="xform_inv">
  155. <return type="Variant">
  156. </return>
  157. <argument index="0" name="v" type="Variant">
  158. </argument>
  159. <description>
  160. Inverse-transforms the given [Vector2] or [Rect2] by this transform.
  161. </description>
  162. </method>
  163. </methods>
  164. <members>
  165. <member name="origin" type="Vector2" setter="" getter="">
  166. The transform's translation offset.
  167. </member>
  168. <member name="x" type="Vector2" setter="" getter="">
  169. The X axis of 2x2 basis matrix containing 2 [Vector2]s as its columns: X axis and Y axis. These vectors can be interpreted as the basis vectors of local coordinate system traveling with the object.
  170. </member>
  171. <member name="y" type="Vector2" setter="" getter="">
  172. The Y axis of 2x2 basis matrix containing 2 [Vector2]s as its columns: X axis and Y axis. These vectors can be interpreted as the basis vectors of local coordinate system traveling with the object.
  173. </member>
  174. </members>
  175. <constants>
  176. <constant name="IDENTITY" value="Transform2D( 1, 0, 0, 1, 0, 0 )">
  177. </constant>
  178. <constant name="FLIP_X" value="Transform2D( -1, 0, 0, 1, 0, 0 )">
  179. </constant>
  180. <constant name="FLIP_Y" value="Transform2D( 1, 0, 0, -1, 0, 0 )">
  181. </constant>
  182. </constants>
  183. </class>