VisualScriptBuiltinFunc¶
Inherits: VisualScriptNode < Resource < RefCounted < Object
A Visual Script node used to call built-in functions.
Description¶
A built-in function used inside a VisualScript. It is usually a math function or an utility function.
See also @GDScript, for the same functions in the GDScript language.
Properties¶
|
Enumerations¶
enum BuiltinFunc:
MATH_SIN = 0 --- Returns the sine of the input.
MATH_COS = 1 --- Returns the cosine of the input.
MATH_TAN = 2 --- Returns the tangent of the input.
MATH_SINH = 3 --- Returns the hyperbolic sine of the input.
MATH_COSH = 4 --- Returns the hyperbolic cosine of the input.
MATH_TANH = 5 --- Returns the hyperbolic tangent of the input.
MATH_ASIN = 6 --- Returns the arc sine of the input.
MATH_ACOS = 7 --- Returns the arc cosine of the input.
MATH_ATAN = 8 --- Returns the arc tangent of the input.
MATH_ATAN2 = 9 --- Returns the arc tangent of the input, using the signs of both parameters to determine the exact angle.
MATH_SQRT = 10 --- Returns the square root of the input.
MATH_FMOD = 11 --- Returns the remainder of one input divided by the other, using floating-point numbers.
MATH_FPOSMOD = 12 --- Returns the positive remainder of one input divided by the other, using floating-point numbers.
MATH_FLOOR = 13 --- Returns the input rounded down.
MATH_CEIL = 14 --- Returns the input rounded up.
MATH_ROUND = 15 --- Returns the input rounded to the nearest integer.
MATH_ABS = 16 --- Returns the absolute value of the input.
MATH_SIGN = 17 --- Returns 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 --- Returns the input raised to a given power.
MATH_LOG = 19 --- Returns the natural logarithm of the input. Note that this is not the typical base-10 logarithm function calculators use.
MATH_EXP = 20 --- Returns the mathematical constant e raised to the specified power of the input. e has an approximate value of 2.71828.
MATH_ISNAN = 21 --- Returns 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 --- Returns 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_STEP_DECIMALS = 24 --- Returns the number of digit places after the decimal that the first non-zero digit occurs.
MATH_SNAPPED = 25 --- Returns the input snapped to a given step.
MATH_LERP = 26 --- Returns a number linearly interpolated between the first two inputs, based on the third input. Uses the formula
a + (a - b) * t
.MATH_CUBIC_INTERPOLATE = 27
MATH_INVERSE_LERP = 28
MATH_RANGE_LERP = 29
MATH_MOVE_TOWARD = 30 --- Moves the number toward a value, based on the third input.
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_RANDI = 32 --- Returns 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 --- Returns 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_RANDI_RANGE = 34 --- Returns a random 32-bit integer value between the two inputs.
MATH_RANDF_RANGE = 35 --- Returns a random floating-point value between the two inputs.
MATH_RANDFN = 36 --- Returns a normally-distributed pseudo-random number, using Box-Muller transform with the specified mean and a standard deviation. This is also called Gaussian distribution.
MATH_SEED = 37 --- Set the seed for the random number generator.
MATH_RANDSEED = 38 --- Returns a random value from the given seed, along with the new seed.
MATH_DEG2RAD = 39 --- Convert the input from degrees to radians.
MATH_RAD2DEG = 40 --- Convert the input from radians to degrees.
MATH_LINEAR2DB = 41 --- Convert the input from linear volume to decibel volume.
MATH_DB2LINEAR = 42 --- Convert the input from decibel volume to linear volume.
MATH_WRAP = 43
MATH_WRAPF = 44
MATH_PINGPONG = 45 --- Returns the
value
wrapped between0
and thelength
. If the limit is reached, the next value the function returned is decreased to the0
side or increased to thelength
side (like a triangle wave). Iflength
is less than zero, it becomes positive.LOGIC_MAX = 46 --- Returns the greater of the two numbers, also known as their maximum.
LOGIC_MIN = 47 --- Returns the lesser of the two numbers, also known as their minimum.
LOGIC_CLAMP = 48 --- Returns 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 = 49 --- Returns the nearest power of 2 to the input.
OBJ_WEAKREF = 50 --- Create a WeakRef from the input.
TYPE_CONVERT = 51 --- Convert between types.
TYPE_OF = 52 --- Returns the type of the input as an integer. Check Variant.Type for the integers that might be returned.
TYPE_EXISTS = 53 --- Checks if a type is registered in the ClassDB.
TEXT_CHAR = 54 --- Returns 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.
TEXT_PRINT_VERBOSE = 59
VAR_TO_STR = 60 --- Serialize a Variant to a string.
STR_TO_VAR = 61 --- Deserialize a Variant from a string serialized using VAR_TO_STR.
VAR_TO_BYTES = 62 --- Serialize a Variant to a PackedByteArray.
BYTES_TO_VAR = 63 --- Deserialize a Variant from a PackedByteArray serialized using VAR_TO_BYTES.
MATH_SMOOTHSTEP = 64 --- Returns a number smoothly interpolated between the first two inputs, based on the third input. Similar to 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 BuiltinFunc enum.
Property Descriptions¶
BuiltinFunc function
Default |
|
Setter |
set_func(value) |
Getter |
get_func() |
The function to be executed.