123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340 |
- :github_url: hide
- .. Generated automatically by doc/tools/make_rst.py in Godot's source tree.
- .. DO NOT EDIT THIS FILE, but the VisualScriptBuiltinFunc.xml source instead.
- .. The source is found in doc/classes or modules/<name>/doc_classes.
- .. _class_VisualScriptBuiltinFunc:
- VisualScriptBuiltinFunc
- =======================
- **Inherits:** :ref:`VisualScriptNode<class_VisualScriptNode>` **<** :ref:`Resource<class_Resource>` **<** :ref:`Reference<class_Reference>` **<** :ref:`Object<class_Object>`
- A Visual Script node used to call built-in functions.
- Description
- -----------
- A built-in function used inside a :ref:`VisualScript<class_VisualScript>`. It is usually a math function or an utility function.
- See also :ref:`@GDScript<class_@GDScript>`, for the same functions in the GDScript language.
- Properties
- ----------
- +--------------------------------------------------------------+------------------------------------------------------------------+-------+
- | :ref:`BuiltinFunc<enum_VisualScriptBuiltinFunc_BuiltinFunc>` | :ref:`function<class_VisualScriptBuiltinFunc_property_function>` | ``0`` |
- +--------------------------------------------------------------+------------------------------------------------------------------+-------+
- Enumerations
- ------------
- .. _enum_VisualScriptBuiltinFunc_BuiltinFunc:
- .. _class_VisualScriptBuiltinFunc_constant_MATH_SIN:
- .. _class_VisualScriptBuiltinFunc_constant_MATH_COS:
- .. _class_VisualScriptBuiltinFunc_constant_MATH_TAN:
- .. _class_VisualScriptBuiltinFunc_constant_MATH_SINH:
- .. _class_VisualScriptBuiltinFunc_constant_MATH_COSH:
- .. _class_VisualScriptBuiltinFunc_constant_MATH_TANH:
- .. _class_VisualScriptBuiltinFunc_constant_MATH_ASIN:
- .. _class_VisualScriptBuiltinFunc_constant_MATH_ACOS:
- .. _class_VisualScriptBuiltinFunc_constant_MATH_ATAN:
- .. _class_VisualScriptBuiltinFunc_constant_MATH_ATAN2:
- .. _class_VisualScriptBuiltinFunc_constant_MATH_SQRT:
- .. _class_VisualScriptBuiltinFunc_constant_MATH_FMOD:
- .. _class_VisualScriptBuiltinFunc_constant_MATH_FPOSMOD:
- .. _class_VisualScriptBuiltinFunc_constant_MATH_FLOOR:
- .. _class_VisualScriptBuiltinFunc_constant_MATH_CEIL:
- .. _class_VisualScriptBuiltinFunc_constant_MATH_ROUND:
- .. _class_VisualScriptBuiltinFunc_constant_MATH_ABS:
- .. _class_VisualScriptBuiltinFunc_constant_MATH_SIGN:
- .. _class_VisualScriptBuiltinFunc_constant_MATH_POW:
- .. _class_VisualScriptBuiltinFunc_constant_MATH_LOG:
- .. _class_VisualScriptBuiltinFunc_constant_MATH_EXP:
- .. _class_VisualScriptBuiltinFunc_constant_MATH_ISNAN:
- .. _class_VisualScriptBuiltinFunc_constant_MATH_ISINF:
- .. _class_VisualScriptBuiltinFunc_constant_MATH_EASE:
- .. _class_VisualScriptBuiltinFunc_constant_MATH_DECIMALS:
- .. _class_VisualScriptBuiltinFunc_constant_MATH_STEPIFY:
- .. _class_VisualScriptBuiltinFunc_constant_MATH_LERP:
- .. _class_VisualScriptBuiltinFunc_constant_MATH_INVERSE_LERP:
- .. _class_VisualScriptBuiltinFunc_constant_MATH_RANGE_LERP:
- .. _class_VisualScriptBuiltinFunc_constant_MATH_MOVE_TOWARD:
- .. _class_VisualScriptBuiltinFunc_constant_MATH_DECTIME:
- .. _class_VisualScriptBuiltinFunc_constant_MATH_RANDOMIZE:
- .. _class_VisualScriptBuiltinFunc_constant_MATH_RAND:
- .. _class_VisualScriptBuiltinFunc_constant_MATH_RANDF:
- .. _class_VisualScriptBuiltinFunc_constant_MATH_RANDOM:
- .. _class_VisualScriptBuiltinFunc_constant_MATH_SEED:
- .. _class_VisualScriptBuiltinFunc_constant_MATH_RANDSEED:
- .. _class_VisualScriptBuiltinFunc_constant_MATH_DEG2RAD:
- .. _class_VisualScriptBuiltinFunc_constant_MATH_RAD2DEG:
- .. _class_VisualScriptBuiltinFunc_constant_MATH_LINEAR2DB:
- .. _class_VisualScriptBuiltinFunc_constant_MATH_DB2LINEAR:
- .. _class_VisualScriptBuiltinFunc_constant_MATH_POLAR2CARTESIAN:
- .. _class_VisualScriptBuiltinFunc_constant_MATH_CARTESIAN2POLAR:
- .. _class_VisualScriptBuiltinFunc_constant_MATH_WRAP:
- .. _class_VisualScriptBuiltinFunc_constant_MATH_WRAPF:
- .. _class_VisualScriptBuiltinFunc_constant_LOGIC_MAX:
- .. _class_VisualScriptBuiltinFunc_constant_LOGIC_MIN:
- .. _class_VisualScriptBuiltinFunc_constant_LOGIC_CLAMP:
- .. _class_VisualScriptBuiltinFunc_constant_LOGIC_NEAREST_PO2:
- .. _class_VisualScriptBuiltinFunc_constant_OBJ_WEAKREF:
- .. _class_VisualScriptBuiltinFunc_constant_FUNC_FUNCREF:
- .. _class_VisualScriptBuiltinFunc_constant_TYPE_CONVERT:
- .. _class_VisualScriptBuiltinFunc_constant_TYPE_OF:
- .. _class_VisualScriptBuiltinFunc_constant_TYPE_EXISTS:
- .. _class_VisualScriptBuiltinFunc_constant_TEXT_CHAR:
- .. _class_VisualScriptBuiltinFunc_constant_TEXT_STR:
- .. _class_VisualScriptBuiltinFunc_constant_TEXT_PRINT:
- .. _class_VisualScriptBuiltinFunc_constant_TEXT_PRINTERR:
- .. _class_VisualScriptBuiltinFunc_constant_TEXT_PRINTRAW:
- .. _class_VisualScriptBuiltinFunc_constant_VAR_TO_STR:
- .. _class_VisualScriptBuiltinFunc_constant_STR_TO_VAR:
- .. _class_VisualScriptBuiltinFunc_constant_VAR_TO_BYTES:
- .. _class_VisualScriptBuiltinFunc_constant_BYTES_TO_VAR:
- .. _class_VisualScriptBuiltinFunc_constant_COLORN:
- .. _class_VisualScriptBuiltinFunc_constant_MATH_SMOOTHSTEP:
- .. _class_VisualScriptBuiltinFunc_constant_MATH_POSMOD:
- .. _class_VisualScriptBuiltinFunc_constant_MATH_LERP_ANGLE:
- .. _class_VisualScriptBuiltinFunc_constant_TEXT_ORD:
- .. _class_VisualScriptBuiltinFunc_constant_FUNC_MAX:
- enum **BuiltinFunc**:
- - **MATH_SIN** = **0** --- Return the sine of the input.
- - **MATH_COS** = **1** --- Return the cosine of the input.
- - **MATH_TAN** = **2** --- Return the tangent of the input.
- - **MATH_SINH** = **3** --- Return the hyperbolic sine of the input.
- - **MATH_COSH** = **4** --- Return the hyperbolic cosine of the input.
- - **MATH_TANH** = **5** --- Return the hyperbolic tangent of the input.
- - **MATH_ASIN** = **6** --- Return the arc sine of the input.
- - **MATH_ACOS** = **7** --- Return the arc cosine of the input.
- - **MATH_ATAN** = **8** --- Return the arc tangent of the input.
- - **MATH_ATAN2** = **9** --- Return the arc tangent of the input, using the signs of both parameters to determine the exact angle.
- - **MATH_SQRT** = **10** --- Return the square root of the input.
- - **MATH_FMOD** = **11** --- Return the remainder of one input divided by the other, using floating-point numbers.
- - **MATH_FPOSMOD** = **12** --- Return the positive remainder of one input divided by the other, using floating-point numbers.
- - **MATH_FLOOR** = **13** --- Return the input rounded down.
- - **MATH_CEIL** = **14** --- Return the input rounded up.
- - **MATH_ROUND** = **15** --- Return the input rounded to the nearest integer.
- - **MATH_ABS** = **16** --- Return the absolute value of the input.
- - **MATH_SIGN** = **17** --- Return the sign of the input, turning it into 1, -1, or 0. Useful to determine if the input is positive or negative.
- - **MATH_POW** = **18** --- Return the input raised to a given power.
- - **MATH_LOG** = **19** --- Return the natural logarithm of the input. Note that this is not the typical base-10 logarithm function calculators use.
- - **MATH_EXP** = **20** --- Return the mathematical constant **e** raised to the specified power of the input. **e** has an approximate value of 2.71828.
- - **MATH_ISNAN** = **21** --- Return whether the input is NaN (Not a Number) or not. NaN is usually produced by dividing 0 by 0, though other ways exist.
- - **MATH_ISINF** = **22** --- 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.
- - **MATH_EASE** = **23** --- 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.
- - **MATH_DECIMALS** = **24** --- Return the number of digit places after the decimal that the first non-zero digit occurs.
- - **MATH_STEPIFY** = **25** --- Return the input snapped to a given step.
- - **MATH_LERP** = **26** --- Return a number linearly interpolated between the first two inputs, based on the third input. Uses the formula ``a + (a - b) * t``.
- - **MATH_INVERSE_LERP** = **27**
- - **MATH_RANGE_LERP** = **28**
- - **MATH_MOVE_TOWARD** = **29** --- Moves the number toward a value, based on the third input.
- - **MATH_DECTIME** = **30** --- Return the result of ``value`` decreased by ``step`` \* ``amount``.
- - **MATH_RANDOMIZE** = **31** --- Randomize the seed (or the internal state) of the random number generator. Current implementation reseeds using a number based on time.
- - **MATH_RAND** = **32** --- 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.
- - **MATH_RANDF** = **33** --- 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.
- - **MATH_RANDOM** = **34** --- Return a random floating-point value between the two inputs.
- - **MATH_SEED** = **35** --- Set the seed for the random number generator.
- - **MATH_RANDSEED** = **36** --- Return a random value from the given seed, along with the new seed.
- - **MATH_DEG2RAD** = **37** --- Convert the input from degrees to radians.
- - **MATH_RAD2DEG** = **38** --- Convert the input from radians to degrees.
- - **MATH_LINEAR2DB** = **39** --- Convert the input from linear volume to decibel volume.
- - **MATH_DB2LINEAR** = **40** --- Convert the input from decibel volume to linear volume.
- - **MATH_POLAR2CARTESIAN** = **41** --- Converts a 2D point expressed in the polar coordinate system (a distance from the origin ``r`` and an angle ``th``) to the cartesian coordinate system (X and Y axis).
- - **MATH_CARTESIAN2POLAR** = **42** --- Converts a 2D point expressed in the cartesian coordinate system (X and Y axis) to the polar coordinate system (a distance from the origin and an angle).
- - **MATH_WRAP** = **43**
- - **MATH_WRAPF** = **44**
- - **LOGIC_MAX** = **45** --- Return the greater of the two numbers, also known as their maximum.
- - **LOGIC_MIN** = **46** --- Return the lesser of the two numbers, also known as their minimum.
- - **LOGIC_CLAMP** = **47** --- Return the input clamped inside the given range, ensuring the result is never outside it. Equivalent to ``min(max(input, range_low), range_high)``.
- - **LOGIC_NEAREST_PO2** = **48** --- Return the nearest power of 2 to the input.
- - **OBJ_WEAKREF** = **49** --- Create a :ref:`WeakRef<class_WeakRef>` from the input.
- - **FUNC_FUNCREF** = **50** --- Create a :ref:`FuncRef<class_FuncRef>` from the input.
- - **TYPE_CONVERT** = **51** --- Convert between types.
- - **TYPE_OF** = **52** --- Return the type of the input as an integer. Check :ref:`Variant.Type<enum_@GlobalScope_Variant.Type>` for the integers that might be returned.
- - **TYPE_EXISTS** = **53** --- Checks if a type is registered in the :ref:`ClassDB<class_ClassDB>`.
- - **TEXT_CHAR** = **54** --- Return a character with the given ascii value.
- - **TEXT_STR** = **55** --- Convert the input to a string.
- - **TEXT_PRINT** = **56** --- Print the given string to the output window.
- - **TEXT_PRINTERR** = **57** --- Print the given string to the standard error output.
- - **TEXT_PRINTRAW** = **58** --- Print the given string to the standard output, without adding a newline.
- - **VAR_TO_STR** = **59** --- Serialize a :ref:`Variant<class_Variant>` to a string.
- - **STR_TO_VAR** = **60** --- Deserialize a :ref:`Variant<class_Variant>` from a string serialized using :ref:`VAR_TO_STR<class_VisualScriptBuiltinFunc_constant_VAR_TO_STR>`.
- - **VAR_TO_BYTES** = **61** --- Serialize a :ref:`Variant<class_Variant>` to a :ref:`PoolByteArray<class_PoolByteArray>`.
- - **BYTES_TO_VAR** = **62** --- Deserialize a :ref:`Variant<class_Variant>` from a :ref:`PoolByteArray<class_PoolByteArray>` serialized using :ref:`VAR_TO_BYTES<class_VisualScriptBuiltinFunc_constant_VAR_TO_BYTES>`.
- - **COLORN** = **63** --- Return the :ref:`Color<class_Color>` with the given name and alpha ranging from 0 to 1.
- **Note:** Names are defined in ``color_names.inc``.
- - **MATH_SMOOTHSTEP** = **64** --- Return a number smoothly interpolated between the first two inputs, based on the third input. Similar to :ref:`MATH_LERP<class_VisualScriptBuiltinFunc_constant_MATH_LERP>`, but interpolates faster at the beginning and slower at the end. Using Hermite interpolation formula:
- ::
- var t = clamp((weight - from) / (to - from), 0.0, 1.0)
- return t * t * (3.0 - 2.0 * t)
- - **MATH_POSMOD** = **65**
- - **MATH_LERP_ANGLE** = **66**
- - **TEXT_ORD** = **67**
- - **FUNC_MAX** = **68** --- Represents the size of the :ref:`BuiltinFunc<enum_VisualScriptBuiltinFunc_BuiltinFunc>` enum.
- Property Descriptions
- ---------------------
- .. _class_VisualScriptBuiltinFunc_property_function:
- - :ref:`BuiltinFunc<enum_VisualScriptBuiltinFunc_BuiltinFunc>` **function**
- +-----------+-----------------+
- | *Default* | ``0`` |
- +-----------+-----------------+
- | *Setter* | set_func(value) |
- +-----------+-----------------+
- | *Getter* | get_func() |
- +-----------+-----------------+
- The function to be executed.
- .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
- .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
- .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
|