-
Notifications
You must be signed in to change notification settings - Fork 20
class_@gdscript
####Category: Core
Built-in GDScript functions.
- float sin ( float s )
- float cos ( float s )
- float tan ( float s )
- float sinh ( float s )
- float cosh ( float s )
- float tanh ( float s )
- float asin ( float s )
- float acos ( float s )
- float atan ( float s )
- float atan2 ( float x, float y )
- float sqrt ( float s )
- float fmod ( float x, float y )
- float fposmod ( float x, float y )
- float floor ( float s )
- float ceil ( float s )
- float round ( float s )
- float abs ( float s )
- float sign ( float s )
- float pow ( float x, float y )
- float log ( float s )
- float exp ( float s )
- float isnan ( float s )
- float isinf ( float s )
- float ease ( float s, float curve )
- float decimals ( float step )
- float stepify ( float s, float step )
- float lerp ( float a, float b, float c )
- float dectime ( float value, float amount, float step )
- Nil randomize ( )
- int randi ( )
- float randf ( )
- float rand_range ( float from, float to )
- Array rand_seed ( float seed )
- float deg2rad ( float deg )
- float rad2deg ( float rad )
- float linear2db ( float nrg )
- float db2linear ( float db )
- float max ( float a, float b )
- float min ( float a, float b )
- float clamp ( float val, float min, float max )
- int nearest_po2 ( int val )
- Object weakref ( Object obj )
- Object funcref ( Object instance, String funcname )
- Object convert ( var what, int type )
- String str ( var what, var ... )
- String str ( var what, var ... )
- Nil print ( var what, var ... )
- Nil printt ( var what, var ... )
- Nil printerr ( var what, var ... )
- Nil printraw ( var what, var ... )
- Array range ( var ... )
- Object load ( String path )
- Dictionary inst2dict ( Object inst )
- Object dict2inst ( Dictionary dict )
- int hash ( var var:var )
- Nil print_stack ( )
- PI = 3.141593 - Constant that represents how many times the diameter of a circumference fits around it's perimeter.
This contains the list of built-in gdscript functions. Mostly math functions and other utilities. Everything else is expanded by objects.
Standard sine function.
Standard cosine function.
Standard tangent function.
Hyperbolic sine.
Hyperbolic cosine.
Hyperbolic tangent.
Arc-sine.
Arc-cosine.
Arc-tangent.
Arc-tangent that takes a 2D vector as argument, retuns the full -pi to +pi range.
Square root.
Module (remainder of x/y).
Module (remainder of x/y) that wraps equally in positive and negative.
Floor (rounds down to nearest integer).
Ceiling (rounds up to nearest integer).
Round to nearest integer.
Remove sign (works for integer and float).
Return sign (-1 or +1).
Power function, x elevate to y.
Natural logarithm.
Exponential logarithm.
Return true if the float is not a number.
Return true if the float is infinite.
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.
Return the amount of decimals in the floating point value.
Snap float value to a given step.
- Nil randomize ( )
Reset the seed of the random number generator with a new, different one.
- int randi ( )
Random 32 bits value (integer). To obtain a value from 0 to N, you can use remainder, like (for random from 0 to 19): randi() % 20.
- float randf ( )
Random value (0 to 1 float).
Random range, any floating point value between 'from' and 'to'
Random from seed, pass a seed and an array with both number and new seed is returned.
Convert from degrees to radians.
Convert from radias to degrees.
Convert from linear energy to decibels (audio).
Convert from decibels to linear energy (audio).
Return the maximum of two values.
Return the minimum of two values.
Clamp both values to a range.
Return the nearest larger power of 2 for an integer.
Return a weak reference to an object.
Convert from a type to another in the best way possible. The "type" parameter uses the enum TYPE_* in Global Scope.
- String str ( var what, var ... )
Convert one or more arguments to strings in the best way possible.
- String str ( var what, var ... )
Convert one or more arguments to strings in the best way possible.
- Nil print ( var what, var ... )
Print one or more arguments to strings in the best way possible to a console line.
- Nil printerr ( var what, var ... )
Print one or more arguments to strings in the best way possible to standard error line.
- Nil printraw ( var what, var ... )
Print one or more arguments to strings in the best way possible to console. No newline is added at the end.
- Array range ( var ... )
Return an array with the given range. Range can be 1 argument N (0 to N-1), two arguments (initial, final-1) or three arguments (initial,final-1,increment).
Load a resource from the filesystem, pass a valid path as argument.
- Dictionary inst2dict ( Object inst )
Convert a script class instance to a dictionary (useful for serializing).
- Object dict2inst ( Dictionary dict )
Convert a previously converted instances to dictionary back into an instance. Useful for deserializing.
- Nil print_stack ( )
Print a stack track at code location, only works when running with debugger turned on.