Skip to content
reduz edited this page Feb 23, 2014 · 13 revisions

@GDScript

Brief Description

Built-in GDScript functions.

Member Functions

Description

This contains the list of built-in gdscript functions. Mostly math functions and other utilities. Everything else is expanded by objects.

Member Function Description

  • real atan2 ( real x, real y ) \ Arc-tangent that takes a 2D vector as argument, retuns the full -pi to +pi range.
  • real fposmod ( real x, real y ) \ Module (remainder of x/y) that wraps equally in positive and negative.
  • real floor ( real s ) \ Floor (rounds down to nearest integer).
  • real ceil ( real s ) \ Ceiling (rounds up to nearest integer).
  • real abs ( real s ) \ Remove sign (works for integer and float).
  • real isnan ( real s ) \ Return true if the float is not a number.
  • 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.
  • real decimals ( real step ) \ Return the amount of decimals in the floating point value.
  • int rand ( ) \ Random value (integer).
  • real randf ( ) \ Random value (0 to 1 float).
  • Array rand_seed ( real seed ) \ random from seed, pass a seed and an array with both number and new seed is returned.
  • 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.
  • 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).
Clone this wiki locally