Closed Mercerenies closed 2 years ago
Note: Does not include typecasting functions like int
, nor does it include #65-style pseudo-constructors. Separate issues will be opened as necessary.
Notes on some specific implementations. This comment will be updated as more notes need to be added.
typeof
has been rewritten and enhanced to support scripts, primitives, and builtins in one single function.yield
, due to its status as a sort of special operator that looks like a function, has simply been implemented as a special form on the GDLisp side, not an ordinary function.convert
has been wrapped to support instances of the GDLisp PrimitiveType
in addition to TYPE_*
constants.Once print
is done, we will want to remove print
from bind_helper_symbols
.
assert
had to be a special case, due to it not following the usual argument evaluation rules (arguments are not evaluated in release mode), similar to yield
. As of 48487b5, this issue is closed. All Godot 3.4 functions have been implemented.
This is a list of all of the functions defined in the
@GDScript
namespace. GDLisp should, in some form or another, support all of these or something comparable to all of these.Color8 ( int r8, int g8, int b8, int a8=255 )
- #78ColorN ( String name, float alpha=1.0 )
- #78abs ( float s )
acos ( float s )
asin ( float s )
assert ( bool condition, String message="" )
- #78atan ( float s )
atan2 ( float y, float x )
bytes2var ( PoolByteArray bytes, bool allow_objects=false )
- #78cartesian2polar ( float x, float y )
ceil ( float s )
char ( int code )
clamp ( float value, float min, float max )
convert ( Variant what, int type )
- See notes belowcos ( float s )
cosh ( float s )
db2linear ( float db )
decimals ( float step )
~ - Intentionally omitted; deprecated in GDScriptdectime ( float value, float amount, float step )
~ - Intentionally omitted; deprecated in GDScriptdeg2rad ( float deg )
dict2inst ( Dictionary dict )
ease ( float s, float curve )
exp ( float s )
floor ( float s )
fmod ( float a, float b )
fposmod ( float a, float b )
funcref ( Object instance, String funcname )
get_stack ( )
hash ( Variant var )
inst2dict ( Object inst )
instance_from_id ( int instance_id )
inverse_lerp ( float from, float to, float weight )
is_equal_approx ( float a, float b )
is_inf ( float s )
is_instance_valid ( Object instance )
is_nan ( float s )
is_zero_approx ( float s )
len ( Variant var )
lerp ( Variant from, Variant to, float weight )
lerp_angle ( float from, float to, float weight )
linear2db ( float nrg )
load ( String path )
log ( float s )
max ( float a, float b )
min ( float a, float b )
move_toward ( float from, float to, float delta )
nearest_po2 ( int value )
ord ( String char )
parse_json ( String json )
polar2cartesian ( float r, float th )
posmod ( int a, int b )
pow ( float base, float exp )
preload ( String path )
print ( ... ) vararg
- #79print_debug ( ... ) vararg
- #79print_stack ( )
printerr ( ... ) vararg
- #79printraw ( ... ) vararg
- #79prints ( ... ) vararg
- #79printt ( ... ) vararg
- #79push_error ( String message )
push_warning ( String message )
rad2deg ( float rad )
rand_range ( float from, float to )
rand_seed ( int seed )
randf ( )
randi ( )
randomize ( )
range ( ... ) vararg
- #78 (Note: The GDScript docs list this as a vararg function, but it makes more sense to treat it as having optional arguments)range_lerp ( float value, float istart, float istop, float ostart, float ostop )
round ( float s )
seed ( int seed )
sign ( float s )
sin ( float s )
sinh ( float s )
smoothstep ( float from, float to, float s )
sqrt ( float s )
step_decimals ( float step )
stepify ( float s, float step )
str ( ... ) vararg
- #79str2var ( String string )
tan ( float s )
tanh ( float s )
to_json ( Variant var )
type_exists ( String type )
typeof ( Variant what )
- See notes belowvalidate_json ( String json )
var2bytes ( Variant var, bool full_objects=false )
- #78var2str ( Variant var )
weakref ( Object obj )
wrapf ( float value, float min, float max )
wrapi ( int value, int min, int max )
yield ( Object object=null, String signal="" )
- See notes below