forked from godotengine/godot
-
Notifications
You must be signed in to change notification settings - Fork 20
class_@gdscript
reduz edited this page Feb 23, 2014
·
13 revisions
Category: Core\
Built-in GDScript functions.
- real #sin( real s )
- real #cos( real s )
- real #tan( real s )
- real #sinh( real s )
- real #cosh( real s )
- real #tanh( real s )
- real #asin( real s )
- real #acos( real s )
- real #atan( real s )
- real #atan2( real x, real y )
- real #sqrt( real s )
- real #fmod( real x, real y )
- real #fposmod( real x, real y )
- real #floor( real s )
- real #ceil( real s )
- real #round( real s )
- real #abs( real s )
- real #sign( real s )
- real #pow( real x, real y )
- real #log( real s )
- real #exp( real s )
- real #isnan( real s )
- real #isinf( real s )
- real #ease( real s, real curve )
- real #decimals( real step )
- real #stepify( real s, real step )
- real #lerp( real a, real b, real c )
- real #dectime( real value, real amount, real step )
- Nil #randomize(****)
- int #rand(****)
- real #randf(****)
- real #rand_range( real from, real to )
- Array #rand_seed( real seed )
- real #deg2rad( real deg )
- real #rad2deg( real rad )
- real #linear2db( real nrg )
- real #db2linear( real db )
- real #max( real a, real b )
- real #min( real a, real b )
- real #clamp( real val, real min, real max )
- int #nearest_po2( int val )
- Object #weakref( Object obj )
- 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 ... )
- Dictionary #inst2dict( Object inst )
- Object #dict2inst( Dictionary dict )
- Nil #print_stack(****)
This contains the list of built-in gdscript functions. Mostly math functions and other utilities. Everything else is expanded by objects.
== sin ==
- real #sin( real s ) \ Standard sine function. == cos ==
- real #cos( real s ) \ Standard cosine function. == tan ==
- real #tan( real s ) \ Standard tangent function. == sinh ==
- real #sinh( real s ) \ Hyperbolic sine. == tanh ==
- real #tanh( real s ) \ Hyperbolic tangent. == asin ==
- real #asin( real s ) \ Arc-sine. == acos ==
- real #acos( real s ) \ Arc-cosine. == atan ==
- real #atan( real s ) \ Arc-tangent. == atan2 ==
- real #atan2( real x, real y ) \ Arc-tangent that takes a 2D vector as argument, retuns the full -pi to +pi range. == sqrt ==
- real #sqrt( real s ) \ Square root. == fmod ==
- real #fmod( real x, real y ) \ Module (remainder of x/y). == fposmod ==
- real #fposmod( real x, real y ) \ Module (remainder of x/y) that wraps equally in positive and negative. == floor ==
- real #floor( real s ) \ Floor (rounds down to nearest integer). == ceil ==
- real #ceil( real s ) \ Ceiling (rounds up to nearest integer). == round ==
- real #round( real s ) \ Round to nearest integer. == abs ==
- real #abs( real s ) \ Remove sign (works for integer and float). == sign ==
- real #sign( real s ) \ Return sign (-1 or +1). == pow ==
- real #pow( real x, real y ) \ Power function, x elevate to y. == log ==
- real #log( real s ) \ Natural logarithm. == exp ==
- real #exp( real s ) \ Exponential logarithm. == isnan ==
- real #isnan( real s ) \ Return true if the float is not a number. == isinf ==
- real #isinf( real s ) \ Return true if the float is infinite. == ease ==
- real #ease( real s, real curve ) \ 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. == decimals ==
- real #decimals( real step ) \ Return the amount of decimals in the floating point value. == stepify ==
- real #stepify( real s, real step ) \ Snap float value to a given step. == rand ==
- int #rand(****) \ Random value (integer). == randf ==
- real #randf(****) \ Random value (0 to 1 float). == rand_range ==
- real #rand_range( real from, real to ) \ Random range. == rand_seed ==
- Array #rand_seed( real seed ) \ random from seed, pass a seed and an array with both number and new seed is returned. == deg2rad ==
- real #deg2rad( real deg ) \ Convert from degrees to radians. == rad2deg ==
- real #rad2deg( real rad ) \ Convert from radias to degrees. == linear2db ==
- real #linear2db( real nrg ) \ Convert from linear energy to decibels (audio). == db2linear ==
- real #db2linear( real db ) \ Convert from decibels to linear energy (audio). == max ==
- real #max( real a, real b ) \ Return the maximum of two values. == min ==
- real #min( real a, real b ) \ Return the minimum of two values. == clamp ==
- real #clamp( real val, real min, real max ) \ Clamp both values to a range. == nearest_po2 ==
- int #nearest_po2( int val ) \ Return the nearest larger power of 2 for an integer. == weakref ==
- Object #weakref( Object obj ) \ Return a weak reference to an object. == convert ==
- Object #convert( var what, int type ) \ Convert from a type to another in the best way possible. The "type" parameter uses the enum TYPE_* in Global Scope. == str ==
- String #str( var what, var ... ) \ Convert one or more arguments to strings in the best way possible. == str ==
- String #str( var what, var ... ) \ Convert one or more arguments to strings in the best way possible. == print ==
- Nil #print( var what, var ... ) \ Print one or more arguments to strings in the best way possible to a console line. == printerr ==
- Nil #printerr( var what, var ... ) \ Print one or more arguments to strings in the best way possible to standard error line. == printraw ==
- 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. == range ==
- 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).