GML Functions: Value-Handling Functions

Below you find an overview of all constants, variables, and functions in GML related to handling values. You can click on the name to get additional information.


 * true 1
 * false 0
 * pi 3.14159....
 * abs(x) Returns the absolute value of x.
 * sign(x) Returns the sign of x (-1, 0 or 1).
 * round(x) Returns x rounded to the nearest integer.
 * floor(x) Returns the floor of x, that is, x rounded down to an integer.
 * ceil(x) Returns the ceiling of x, that is, x rounded up to an integer.
 * frac(x) Returns the fractional part of x, that is, the part behind the decimal dot.
 * sqrt(x) Returns the square root of x. x must be non-negative.
 * sqr(x) Returns x*x.
 * power(x,n) Returns x to the power n.
 * exp(x) Returns e to the power x.
 * ln(x) Returns the natural logarithm of x.
 * log2(x) Returns the log base 2 of x.
 * log10(x) Returns the log base 10 of x.
 * logn(n,x) Returns the log base n of x.
 * sin(x) Returns the sine of x (x in radians).
 * cos(x) Returns the cosine of x (x in radians).
 * tan(x) Returns the tangent of x (x in radians).
 * arcsin(x) Returns the inverse sine of x.
 * arccos(x) Returns the inverse cosine of x.
 * arctan(x) Returns the inverse tangent of x.
 * arctan2(y,x) Calculates arctan(Y/X), and returns an angle in the correct quadrant.
 * degtorad(x) Converts degrees to radians.
 * radtodeg(x) Converts radians to degrees.
 * min(val1,val2,val3,...) Returns the minimum of the values. The function can have up to 16 arguments. They must either be all real or all strings.
 * max(val1,val2,val3,...) Returns the maximum of the values. The function can have up to 16 arguments. They must either be all real or all strings.
 * mean(val1,val2,val3,...) Returns the average of the values. The function can have up to 16 arguments. They must all be real values.
 * median(val1,val2,val3,...) Returns the median of the values, that is, the middle value. (When the number of arguments is even, the smaller of the two middle values is returned.) The function can have up to 16 arguments. They must all be real values.
 * point_distance(x1,y1,x2,y2) Returns the distance between point (x1,y1) and point (x2,y2).
 *  Returns the distance between point (x1,y1,z1) and point (x2,y2,z2).
 * point_direction(x1,y1,x2,y2) Returns the direction from point (x1,y1) toward point (x2,y2) in degrees.
 * lengthdir_x(len,dir) Returns the horizontal x-component of the vector determined by the indicated length and direction.
 * lengthdir_y(len,dir) Returns the vertical y-component of the vector determined by the indicated length and direction.
 *  Normalizes the vectors (x1,y1) and (x2,y2) to unit vectors, and returns the dot product of these normalized vectors.
 *  Normalizes the vectors (x1,y1,z1) and (x2,y2,z2) to unit vectors, and returns the dot product of these normalized vectors.
 * is_real(x) Returns whether x is a real value (as opposed to a string).
 * is_string(x) Returns whether x is a string (as opposed to a real value).