VisualScriptBuiltinFunc.xml 8.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <class name="VisualScriptBuiltinFunc" inherits="VisualScriptNode" category="Core" version="3.0.alpha.custom_build">
  3. <brief_description>
  4. A Visual Script node used to call built-in functions.
  5. </brief_description>
  6. <description>
  7. A built-in function used inside a [VisualScript]. It is usually a math function or an utility function.
  8. See also [@GDScript], for the same functions in the GDScript language.
  9. </description>
  10. <tutorials>
  11. </tutorials>
  12. <demos>
  13. </demos>
  14. <methods>
  15. <method name="get_func">
  16. <return type="int" enum="VisualScriptBuiltinFunc.BuiltinFunc">
  17. </return>
  18. <description>
  19. </description>
  20. </method>
  21. <method name="set_func">
  22. <return type="void">
  23. </return>
  24. <argument index="0" name="which" type="int" enum="VisualScriptBuiltinFunc.BuiltinFunc">
  25. </argument>
  26. <description>
  27. </description>
  28. </method>
  29. </methods>
  30. <members>
  31. <member name="function" type="int" setter="set_func" getter="get_func" enum="VisualScriptBuiltinFunc.BuiltinFunc">
  32. The function to be executed.
  33. </member>
  34. </members>
  35. <constants>
  36. <constant name="MATH_SIN" value="0">
  37. Return the sine of the input.
  38. </constant>
  39. <constant name="MATH_COS" value="1">
  40. Return the cosine of the input.
  41. </constant>
  42. <constant name="MATH_TAN" value="2">
  43. Return the tangent of the input.
  44. </constant>
  45. <constant name="MATH_SINH" value="3">
  46. Return the hyperbolic sine of the input.
  47. </constant>
  48. <constant name="MATH_COSH" value="4">
  49. Return the hyperbolic cosine of the input.
  50. </constant>
  51. <constant name="MATH_TANH" value="5">
  52. Return the hyperbolic tangent of the input.
  53. </constant>
  54. <constant name="MATH_ASIN" value="6">
  55. Return the arc sine of the input.
  56. </constant>
  57. <constant name="MATH_ACOS" value="7">
  58. Return the arc cosine of the input.
  59. </constant>
  60. <constant name="MATH_ATAN" value="8">
  61. Return the arc tangent of the input.
  62. </constant>
  63. <constant name="MATH_ATAN2" value="9">
  64. Return the arc tangent of the input, using the signs of both parameters to determine the exact angle.
  65. </constant>
  66. <constant name="MATH_SQRT" value="10">
  67. Return the square root of the input.
  68. </constant>
  69. <constant name="MATH_FMOD" value="11">
  70. Return the remainder of one input divided by the other, using floating-point numbers.
  71. </constant>
  72. <constant name="MATH_FPOSMOD" value="12">
  73. Return the positive remainder of one input divided by the other, using floating-point numbers.
  74. </constant>
  75. <constant name="MATH_FLOOR" value="13">
  76. Return the input rounded down.
  77. </constant>
  78. <constant name="MATH_CEIL" value="14">
  79. Return the input rounded up.
  80. </constant>
  81. <constant name="MATH_ROUND" value="15">
  82. Return the input rounded to the nearest integer.
  83. </constant>
  84. <constant name="MATH_ABS" value="16">
  85. Return the absolute value of the input.
  86. </constant>
  87. <constant name="MATH_SIGN" value="17">
  88. Return the sign of the input, turning it into 1, -1, or 0. Useful to determine if the input is positive or negative.
  89. </constant>
  90. <constant name="MATH_POW" value="18">
  91. Return the input raised to a given power.
  92. </constant>
  93. <constant name="MATH_LOG" value="19">
  94. Return the natural logarithm of the input. Note that this is not the typical base-10 logarithm function calculators use.
  95. </constant>
  96. <constant name="MATH_EXP" value="20">
  97. Return [b]e[/b] raised to the power of the input. [b]e[/b] sometimes called "Euler's number" is a mathematical constant whose value is approximately 2.71828.
  98. </constant>
  99. <constant name="MATH_ISNAN" value="21">
  100. Return whether the input is NaN (Not a Number) or not. NaN is usually produced by dividing 0 by 0, though other ways exist.
  101. </constant>
  102. <constant name="MATH_ISINF" value="22">
  103. Return whether the input is an infinite floating-point number or not. Infinity is usually produced by dividing a number by 0, though other ways exist.
  104. </constant>
  105. <constant name="MATH_EASE" value="23">
  106. Easing function, based on exponent. 0 is constant, 1 is linear, 0 to 1 is ease-in, 1+ is ease out. Negative values are in-out/out in.
  107. </constant>
  108. <constant name="MATH_DECIMALS" value="24">
  109. Return the number of digit places after the decimal that the first non-zero digit occurs.
  110. </constant>
  111. <constant name="MATH_STEPIFY" value="25">
  112. Return the input snapped to a given step.
  113. </constant>
  114. <constant name="MATH_LERP" value="26">
  115. Return a number linearly interpolated between the first two inputs, based on the third input. Uses the formula [code]a + (a - b) * t[/code].
  116. </constant>
  117. <constant name="MATH_INVERSE_LERP" value="27">
  118. </constant>
  119. <constant name="MATH_RANGE_LERP" value="28">
  120. </constant>
  121. <constant name="MATH_DECTIME" value="29">
  122. Return the result of 'value' decreased by 'step' * 'amount'.
  123. </constant>
  124. <constant name="MATH_RANDOMIZE" value="30">
  125. Randomize the seed (or the internal state) of the random number generator. Current implementation reseeds using a number based on time.
  126. </constant>
  127. <constant name="MATH_RAND" value="31">
  128. Return a random 32 bits integer value. To obtain a random value between 0 to N (where N is smaller than 2^32 - 1), you can use it with the remainder function.
  129. </constant>
  130. <constant name="MATH_RANDF" value="32">
  131. Return a random floating-point value between 0 and 1. To obtain a random value between 0 to N, you can use it with multiplication.
  132. </constant>
  133. <constant name="MATH_RANDOM" value="33">
  134. Return a random floating-point value between the two inputs.
  135. </constant>
  136. <constant name="MATH_SEED" value="34">
  137. Set the seed for the random number generator.
  138. </constant>
  139. <constant name="MATH_RANDSEED" value="35">
  140. Return a random value from the given seed, along with the new seed.
  141. </constant>
  142. <constant name="MATH_DEG2RAD" value="36">
  143. Convert the input from degrees to radians.
  144. </constant>
  145. <constant name="MATH_RAD2DEG" value="37">
  146. Convert the input from radians to degrees.
  147. </constant>
  148. <constant name="MATH_LINEAR2DB" value="38">
  149. Convert the input from linear volume to decibel volume.
  150. </constant>
  151. <constant name="MATH_DB2LINEAR" value="39">
  152. Convert the input from decibel volume to linear volume.
  153. </constant>
  154. <constant name="LOGIC_MAX" value="40">
  155. Return the greater of the two numbers, also known as their maximum.
  156. </constant>
  157. <constant name="LOGIC_MIN" value="41">
  158. Return the lesser of the two numbers, also known as their minimum.
  159. </constant>
  160. <constant name="LOGIC_CLAMP" value="42">
  161. Return the input clamped inside the given range, ensuring the result is never outside it. Equivalent to `min(max(input, range_low), range_high)`
  162. </constant>
  163. <constant name="LOGIC_NEAREST_PO2" value="43">
  164. Return the nearest power of 2 to the input.
  165. </constant>
  166. <constant name="OBJ_WEAKREF" value="44">
  167. Create a [WeakRef] from the input.
  168. </constant>
  169. <constant name="FUNC_FUNCREF" value="45">
  170. Create a [FuncRef] from the input.
  171. </constant>
  172. <constant name="TYPE_CONVERT" value="46">
  173. Convert between types.
  174. </constant>
  175. <constant name="TYPE_OF" value="47">
  176. Return the type of the input as an integer. Check [enum Variant.Type] for the integers that might be returned.
  177. </constant>
  178. <constant name="TYPE_EXISTS" value="48">
  179. Checks if a type is registered in the [ClassDB].
  180. </constant>
  181. <constant name="TEXT_CHAR" value="49">
  182. Return a character with the given ascii value.
  183. </constant>
  184. <constant name="TEXT_STR" value="50">
  185. Convert the input to a string.
  186. </constant>
  187. <constant name="TEXT_PRINT" value="51">
  188. Print the given string to the output window.
  189. </constant>
  190. <constant name="TEXT_PRINTERR" value="52">
  191. Print the given string to the standard error output.
  192. </constant>
  193. <constant name="TEXT_PRINTRAW" value="53">
  194. Print the given string to the standard output, without adding a newline.
  195. </constant>
  196. <constant name="VAR_TO_STR" value="54">
  197. Serialize a [Variant] to a string.
  198. </constant>
  199. <constant name="STR_TO_VAR" value="55">
  200. Deserialize a [Variant] from a string serialized using [VAR_TO_STR].
  201. </constant>
  202. <constant name="VAR_TO_BYTES" value="56">
  203. Serialize a [Variant] to a [PoolByteArray].
  204. </constant>
  205. <constant name="BYTES_TO_VAR" value="57">
  206. Deserialize a [Variant] from a [PoolByteArray] serialized using [VAR_TO_BYTES].
  207. </constant>
  208. <constant name="COLORN" value="58">
  209. Return the [Color] with the given name and alpha ranging from 0 to 1. Note: names are defined in color_names.inc.
  210. </constant>
  211. <constant name="FUNC_MAX" value="59">
  212. The maximum value the [member function] property can have.
  213. </constant>
  214. </constants>
  215. </class>