@GlobalScope

Global scope constants and variables.

Description

Global scope constants and variables. This is all that resides in the globals, constants regarding error codes, keycodes, property hints, etc.

Singletons are also documented here, since they can be accessed from anywhere.

Methods

Variant

abs ( Variant x )

float

absf ( float x )

int

absi ( int x )

float

acos ( float x )

float

asin ( float x )

float

atan ( float x )

float

atan2 ( float y, float x )

Variant

bytes2var ( PackedByteArray bytes )

Variant

bytes2var_with_objects ( PackedByteArray bytes )

float

ceil ( float x )

Variant

clamp ( Variant value, Variant min, Variant max )

float

clampf ( float value, float min, float max )

int

clampi ( int value, int min, int max )

float

cos ( float angle_rad )

float

cosh ( float x )

float

db2linear ( float db )

float

deg2rad ( float deg )

float

ease ( float x, float curve )

String

error_string ( int error )

float

exp ( float x )

float

floor ( float x )

float

fmod ( float x, float y )

float

fposmod ( float x, float y )

int

hash ( Variant variable )

Object

instance_from_id ( int instance_id )

float

inverse_lerp ( float from, float to, float weight )

bool

is_equal_approx ( float a, float b )

bool

is_inf ( float x )

bool

is_instance_id_valid ( int id )

bool

is_instance_valid ( Variant instance )

bool

is_nan ( float x )

bool

is_zero_approx ( float x )

float

lerp ( float from, float to, float weight )

float

lerp_angle ( float from, float to, float weight )

float

linear2db ( float lin )

float

log ( float x )

Variant

max ( ... ) vararg

float

maxf ( float a, float b )

int

maxi ( int a, int b )

Variant

min ( ... ) vararg

float

minf ( float a, float b )

int

mini ( int a, int b )

float

move_toward ( float from, float to, float delta )

int

nearest_po2 ( int value )

int

posmod ( int x, int y )

float

pow ( float base, float exp )

void

print ( ... ) vararg

void

print_verbose ( ... ) vararg

void

printerr ( ... ) vararg

void

printraw ( ... ) vararg

void

prints ( ... ) vararg

void

printt ( ... ) vararg

void

push_error ( ... ) vararg

void

push_warning ( ... ) vararg

float

rad2deg ( float rad )

PackedInt64Array

rand_from_seed ( int seed )

float

randf ( )

float

randf_range ( float from, float to )

int

randi ( )

int

randi_range ( int from, int to )

void

randomize ( )

float

range_lerp ( float value, float istart, float istop, float ostart, float ostop )

int

range_step_decimals ( float x )

int

rid_allocate_id ( )

RID

rid_from_int64 ( int base )

float

round ( float x )

void

seed ( int base )

Variant

sign ( Variant x )

float

signf ( float x )

int

signi ( int x )

float

sin ( float angle_rad )

float

sinh ( float x )

float

smoothstep ( float from, float to, float x )

float

snapped ( float x, float step )

float

sqrt ( float x )

int

step_decimals ( float x )

String

str ( ... ) vararg

Variant

str2var ( String string )

float

tan ( float angle_rad )

float

tanh ( float x )

int

typeof ( Variant variable )

PackedByteArray

var2bytes ( Variant variable )

PackedByteArray

var2bytes_with_objects ( Variant variable )

String

var2str ( Variant variable )

Variant

weakref ( Variant obj )

float

wrapf ( float value, float min, float max )

int

wrapi ( int value, int min, int max )

Enumerations

enum Side:

  • SIDE_LEFT = 0 --- Left side, usually used for Control or StyleBox-derived classes.

  • SIDE_TOP = 1 --- Top side, usually used for Control or StyleBox-derived classes.

  • SIDE_RIGHT = 2 --- Right side, usually used for Control or StyleBox-derived classes.

  • SIDE_BOTTOM = 3 --- Bottom side, usually used for Control or StyleBox-derived classes.


enum Corner:

  • CORNER_TOP_LEFT = 0 --- Top-left corner.

  • CORNER_TOP_RIGHT = 1 --- Top-right corner.

  • CORNER_BOTTOM_RIGHT = 2 --- Bottom-right corner.

  • CORNER_BOTTOM_LEFT = 3 --- Bottom-left corner.


enum Orientation:


enum ClockDirection:

  • CLOCKWISE = 0

  • COUNTERCLOCKWISE = 1


enum HAlign:

  • HALIGN_LEFT = 0 --- Horizontal left alignment, usually for text-derived classes.

  • HALIGN_CENTER = 1 --- Horizontal center alignment, usually for text-derived classes.

  • HALIGN_RIGHT = 2 --- Horizontal right alignment, usually for text-derived classes.

  • HALIGN_FILL = 3 --- Expand row to fit width, usually for text-derived classes.


enum VAlign:

  • VALIGN_TOP = 0 --- Vertical top alignment, usually for text-derived classes.

  • VALIGN_CENTER = 1 --- Vertical center alignment, usually for text-derived classes.

  • VALIGN_BOTTOM = 2 --- Vertical bottom alignment, usually for text-derived classes.


enum InlineAlign:

  • INLINE_ALIGN_TOP_TO = 0 --- Aligns the top of the inline object (e.g. image, table) to the position of the text specified by INLINE_ALIGN_TO_* constant.

  • INLINE_ALIGN_CENTER_TO = 1 --- Aligns the center of the inline object (e.g. image, table) to the position of the text specified by INLINE_ALIGN_TO_* constant.

  • INLINE_ALIGN_BOTTOM_TO = 2 --- Aligns the bottom of the inline object (e.g. image, table) to the position of the text specified by INLINE_ALIGN_TO_* constant.

  • INLINE_ALIGN_TO_TOP = 0 --- Aligns the position of the inline object (e.g. image, table) specified by INLINE_ALIGN_*_TO constant to the top of the text.

  • INLINE_ALIGN_TO_CENTER = 4 --- Aligns the position of the inline object (e.g. image, table) specified by INLINE_ALIGN_*_TO constant to the center of the text.

  • INLINE_ALIGN_TO_BASELINE = 8 --- Aligns the position of the inline object (e.g. image, table) specified by INLINE_ALIGN_*_TO constant to the baseline of the text.

  • INLINE_ALIGN_TO_BOTTOM = 12 --- Aligns inline object (e.g. image, table) to the bottom of the text.

  • INLINE_ALIGN_TOP = 0 --- Aligns top of the inline object (e.g. image, table) to the top of the text. Equvalent to INLINE_ALIGN_TOP_TO | INLINE_ALIGN_TO_TOP.

  • INLINE_ALIGN_CENTER = 5 --- Aligns center of the inline object (e.g. image, table) to the center of the text. Equvalent to INLINE_ALIGN_CENTER_TO | INLINE_ALIGN_TO_CENTER.

  • INLINE_ALIGN_BOTTOM = 14 --- Aligns bottom of the inline object (e.g. image, table) to the bottom of the text. Equvalent to INLINE_ALIGN_BOTTOM_TO | INLINE_ALIGN_TO_BOTTOM.


enum Key:

  • KEY_ESCAPE = 16777217 --- Escape key.

  • KEY_TAB = 16777218 --- Tab key.

  • KEY_BACKTAB = 16777219 --- Shift + Tab key.

  • KEY_BACKSPACE = 16777220 --- Backspace key.

  • KEY_ENTER = 16777221 --- Return key (on the main keyboard).

  • KEY_KP_ENTER = 16777222 --- Enter key on the numeric keypad.

  • KEY_INSERT = 16777223 --- Insert key.

  • KEY_DELETE = 16777224 --- Delete key.

  • KEY_PAUSE = 16777225 --- Pause key.

  • KEY_PRINT = 16777226 --- Print Screen key.

  • KEY_SYSREQ = 16777227 --- System Request key.

  • KEY_CLEAR = 16777228 --- Clear key.

  • KEY_HOME = 16777229 --- Home key.

  • KEY_END = 16777230 --- End key.

  • KEY_LEFT = 16777231 --- Left arrow key.

  • KEY_UP = 16777232 --- Up arrow key.

  • KEY_RIGHT = 16777233 --- Right arrow key.

  • KEY_DOWN = 16777234 --- Down arrow key.

  • KEY_PAGEUP = 16777235 --- Page Up key.

  • KEY_PAGEDOWN = 16777236 --- Page Down key.

  • KEY_SHIFT = 16777237 --- Shift key.

  • KEY_CTRL = 16777238 --- Control key.

  • KEY_META = 16777239 --- Meta key.

  • KEY_ALT = 16777240 --- Alt key.

  • KEY_CAPSLOCK = 16777241 --- Caps Lock key.

  • KEY_NUMLOCK = 16777242 --- Num Lock key.

  • KEY_SCROLLLOCK = 16777243 --- Scroll Lock key.

  • KEY_F1 = 16777244 --- F1 key.

  • KEY_F2 = 16777245 --- F2 key.

  • KEY_F3 = 16777246 --- F3 key.

  • KEY_F4 = 16777247 --- F4 key.

  • KEY_F5 = 16777248 --- F5 key.

  • KEY_F6 = 16777249 --- F6 key.

  • KEY_F7 = 16777250 --- F7 key.

  • KEY_F8 = 16777251 --- F8 key.

  • KEY_F9 = 16777252 --- F9 key.

  • KEY_F10 = 16777253 --- F10 key.

  • KEY_F11 = 16777254 --- F11 key.

  • KEY_F12 = 16777255 --- F12 key.

  • KEY_F13 = 16777256 --- F13 key.

  • KEY_F14 = 16777257 --- F14 key.

  • KEY_F15 = 16777258 --- F15 key.

  • KEY_F16 = 16777259 --- F16 key.

  • KEY_KP_MULTIPLY = 16777345 --- Multiply (*) key on the numeric keypad.

  • KEY_KP_DIVIDE = 16777346 --- Divide (/) key on the numeric keypad.

  • KEY_KP_SUBTRACT = 16777347 --- Subtract (-) key on the numeric keypad.

  • KEY_KP_PERIOD = 16777348 --- Period (.) key on the numeric keypad.

  • KEY_KP_ADD = 16777349 --- Add (+) key on the numeric keypad.

  • KEY_KP_0 = 16777350 --- Number 0 on the numeric keypad.

  • KEY_KP_1 = 16777351 --- Number 1 on the numeric keypad.

  • KEY_KP_2 = 16777352 --- Number 2 on the numeric keypad.

  • KEY_KP_3 = 16777353 --- Number 3 on the numeric keypad.

  • KEY_KP_4 = 16777354 --- Number 4 on the numeric keypad.

  • KEY_KP_5 = 16777355 --- Number 5 on the numeric keypad.

  • KEY_KP_6 = 16777356 --- Number 6 on the numeric keypad.

  • KEY_KP_7 = 16777357 --- Number 7 on the numeric keypad.

  • KEY_KP_8 = 16777358 --- Number 8 on the numeric keypad.

  • KEY_KP_9 = 16777359 --- Number 9 on the numeric keypad.

  • KEY_SUPER_L = 16777260 --- Left Super key (Windows key).

  • KEY_SUPER_R = 16777261 --- Right Super key (Windows key).

  • KEY_MENU = 16777262 --- Context menu key.

  • KEY_HYPER_L = 16777263 --- Left Hyper key.

  • KEY_HYPER_R = 16777264 --- Right Hyper key.

  • KEY_HELP = 16777265 --- Help key.

  • KEY_DIRECTION_L = 16777266 --- Left Direction key.

  • KEY_DIRECTION_R = 16777267 --- Right Direction key.

  • KEY_BACK = 16777280 --- Media back key. Not to be confused with the Back button on an Android device.

  • KEY_FORWARD = 16777281 --- Media forward key.

  • KEY_STOP = 16777282 --- Media stop key.

  • KEY_REFRESH = 16777283 --- Media refresh key.

  • KEY_VOLUMEDOWN = 16777284 --- Volume down key.

  • KEY_VOLUMEMUTE = 16777285 --- Mute volume key.

  • KEY_VOLUMEUP = 16777286 --- Volume up key.

  • KEY_BASSBOOST = 16777287 --- Bass Boost key.

  • KEY_BASSUP = 16777288 --- Bass up key.

  • KEY_BASSDOWN = 16777289 --- Bass down key.

  • KEY_TREBLEUP = 16777290 --- Treble up key.

  • KEY_TREBLEDOWN = 16777291 --- Treble down key.

  • KEY_MEDIAPLAY = 16777292 --- Media play key.

  • KEY_MEDIASTOP = 16777293 --- Media stop key.

  • KEY_MEDIAPREVIOUS = 16777294 --- Previous song key.

  • KEY_MEDIANEXT = 16777295 --- Next song key.

  • KEY_MEDIARECORD = 16777296 --- Media record key.

  • KEY_HOMEPAGE = 16777297 --- Home page key.

  • KEY_FAVORITES = 16777298 --- Favorites key.

  • KEY_SEARCH = 16777299 --- Search key.

  • KEY_STANDBY = 16777300 --- Standby key.

  • KEY_OPENURL = 16777301 --- Open URL / Launch Browser key.

  • KEY_LAUNCHMAIL = 16777302 --- Launch Mail key.

  • KEY_LAUNCHMEDIA = 16777303 --- Launch Media key.

  • KEY_LAUNCH0 = 16777304 --- Launch Shortcut 0 key.

  • KEY_LAUNCH1 = 16777305 --- Launch Shortcut 1 key.

  • KEY_LAUNCH2 = 16777306 --- Launch Shortcut 2 key.

  • KEY_LAUNCH3 = 16777307 --- Launch Shortcut 3 key.

  • KEY_LAUNCH4 = 16777308 --- Launch Shortcut 4 key.

  • KEY_LAUNCH5 = 16777309 --- Launch Shortcut 5 key.

  • KEY_LAUNCH6 = 16777310 --- Launch Shortcut 6 key.

  • KEY_LAUNCH7 = 16777311 --- Launch Shortcut 7 key.

  • KEY_LAUNCH8 = 16777312 --- Launch Shortcut 8 key.

  • KEY_LAUNCH9 = 16777313 --- Launch Shortcut 9 key.

  • KEY_LAUNCHA = 16777314 --- Launch Shortcut A key.

  • KEY_LAUNCHB = 16777315 --- Launch Shortcut B key.

  • KEY_LAUNCHC = 16777316 --- Launch Shortcut C key.

  • KEY_LAUNCHD = 16777317 --- Launch Shortcut D key.

  • KEY_LAUNCHE = 16777318 --- Launch Shortcut E key.

  • KEY_LAUNCHF = 16777319 --- Launch Shortcut F key.

  • KEY_UNKNOWN = 33554431 --- Unknown key.

  • KEY_SPACE = 32 --- Space key.

  • KEY_EXCLAM = 33 --- ! key.

  • KEY_QUOTEDBL = 34 --- " key.

  • KEY_NUMBERSIGN = 35 --- # key.

  • KEY_DOLLAR = 36 --- $ key.

  • KEY_PERCENT = 37 --- % key.

  • KEY_AMPERSAND = 38 --- & key.

  • KEY_APOSTROPHE = 39 --- ' key.

  • KEY_PARENLEFT = 40 --- ( key.

  • KEY_PARENRIGHT = 41 --- ) key.

  • KEY_ASTERISK = 42 --- * key.

  • KEY_PLUS = 43 --- + key.

  • KEY_COMMA = 44 --- , key.

  • KEY_MINUS = 45 --- - key.

  • KEY_PERIOD = 46 --- . key.

  • KEY_SLASH = 47 --- / key.

  • KEY_0 = 48 --- Number 0.

  • KEY_1 = 49 --- Number 1.

  • KEY_2 = 50 --- Number 2.

  • KEY_3 = 51 --- Number 3.

  • KEY_4 = 52 --- Number 4.

  • KEY_5 = 53 --- Number 5.

  • KEY_6 = 54 --- Number 6.

  • KEY_7 = 55 --- Number 7.

  • KEY_8 = 56 --- Number 8.

  • KEY_9 = 57 --- Number 9.

  • KEY_COLON = 58 --- : key.

  • KEY_SEMICOLON = 59 --- ; key.

  • KEY_LESS = 60 --- < key.

  • KEY_EQUAL = 61 --- = key.

  • KEY_GREATER = 62 --- > key.

  • KEY_QUESTION = 63 --- ? key.

  • KEY_AT = 64 --- @ key.

  • KEY_A = 65 --- A key.

  • KEY_B = 66 --- B key.

  • KEY_C = 67 --- C key.

  • KEY_D = 68 --- D key.

  • KEY_E = 69 --- E key.

  • KEY_F = 70 --- F key.

  • KEY_G = 71 --- G key.

  • KEY_H = 72 --- H key.

  • KEY_I = 73 --- I key.

  • KEY_J = 74 --- J key.

  • KEY_K = 75 --- K key.

  • KEY_L = 76 --- L key.

  • KEY_M = 77 --- M key.

  • KEY_N = 78 --- N key.

  • KEY_O = 79 --- O key.

  • KEY_P = 80 --- P key.

  • KEY_Q = 81 --- Q key.

  • KEY_R = 82 --- R key.

  • KEY_S = 83 --- S key.

  • KEY_T = 84 --- T key.

  • KEY_U = 85 --- U key.

  • KEY_V = 86 --- V key.

  • KEY_W = 87 --- W key.

  • KEY_X = 88 --- X key.

  • KEY_Y = 89 --- Y key.

  • KEY_Z = 90 --- Z key.

  • KEY_BRACKETLEFT = 91 --- [ key.

  • KEY_BACKSLASH = 92 --- \ key.

  • KEY_BRACKETRIGHT = 93 --- ] key.

  • KEY_ASCIICIRCUM = 94 --- ^ key.

  • KEY_UNDERSCORE = 95 --- _ key.

  • KEY_QUOTELEFT = 96 --- ` key.

  • KEY_BRACELEFT = 123 --- { key.

  • KEY_BAR = 124 --- | key.

  • KEY_BRACERIGHT = 125 --- } key.

  • KEY_ASCIITILDE = 126 --- ~ key.

  • KEY_NOBREAKSPACE = 160 --- Non-breakable space key.

  • KEY_EXCLAMDOWN = 161 --- ¡ key.

  • KEY_CENT = 162 --- ¢ key.

  • KEY_STERLING = 163 --- £ key.

  • KEY_CURRENCY = 164 --- ¤ key.

  • KEY_YEN = 165 --- ¥ key.

  • KEY_BROKENBAR = 166 --- ¦ key.

  • KEY_SECTION = 167 --- § key.

  • KEY_DIAERESIS = 168 --- ¨ key.

  • KEY_COPYRIGHT = 169 --- © key.

  • KEY_ORDFEMININE = 170 --- ª key.

  • KEY_GUILLEMOTLEFT = 171 --- « key.

  • KEY_NOTSIGN = 172 --- ¬ key.

  • KEY_HYPHEN = 173 --- Soft hyphen key.

  • KEY_REGISTERED = 174 --- ® key.

  • KEY_MACRON = 175 --- ¯ key.

  • KEY_DEGREE = 176 --- ° key.

  • KEY_PLUSMINUS = 177 --- ± key.

  • KEY_TWOSUPERIOR = 178 --- ² key.

  • KEY_THREESUPERIOR = 179 --- ³ key.

  • KEY_ACUTE = 180 --- ´ key.

  • KEY_MU = 181 --- µ key.

  • KEY_PARAGRAPH = 182 --- ¶ key.

  • KEY_PERIODCENTERED = 183 --- · key.

  • KEY_CEDILLA = 184 --- ¸ key.

  • KEY_ONESUPERIOR = 185 --- ¹ key.

  • KEY_MASCULINE = 186 --- º key.

  • KEY_GUILLEMOTRIGHT = 187 --- » key.

  • KEY_ONEQUARTER = 188 --- ¼ key.

  • KEY_ONEHALF = 189 --- ½ key.

  • KEY_THREEQUARTERS = 190 --- ¾ key.

  • KEY_QUESTIONDOWN = 191 --- ¿ key.

  • KEY_AGRAVE = 192 --- À key.

  • KEY_AACUTE = 193 --- Á key.

  • KEY_ACIRCUMFLEX = 194 --- Â key.

  • KEY_ATILDE = 195 --- Ã key.

  • KEY_ADIAERESIS = 196 --- Ä key.

  • KEY_ARING = 197 --- Å key.

  • KEY_AE = 198 --- Æ key.

  • KEY_CCEDILLA = 199 --- Ç key.

  • KEY_EGRAVE = 200 --- È key.

  • KEY_EACUTE = 201 --- É key.

  • KEY_ECIRCUMFLEX = 202 --- Ê key.

  • KEY_EDIAERESIS = 203 --- Ë key.

  • KEY_IGRAVE = 204 --- Ì key.

  • KEY_IACUTE = 205 --- Í key.

  • KEY_ICIRCUMFLEX = 206 --- Î key.

  • KEY_IDIAERESIS = 207 --- Ï key.

  • KEY_ETH = 208 --- Ð key.

  • KEY_NTILDE = 209 --- Ñ key.

  • KEY_OGRAVE = 210 --- Ò key.

  • KEY_OACUTE = 211 --- Ó key.

  • KEY_OCIRCUMFLEX = 212 --- Ô key.

  • KEY_OTILDE = 213 --- Õ key.

  • KEY_ODIAERESIS = 214 --- Ö key.

  • KEY_MULTIPLY = 215 --- × key.

  • KEY_OOBLIQUE = 216 --- Ø key.

  • KEY_UGRAVE = 217 --- Ù key.

  • KEY_UACUTE = 218 --- Ú key.

  • KEY_UCIRCUMFLEX = 219 --- Û key.

  • KEY_UDIAERESIS = 220 --- Ü key.

  • KEY_YACUTE = 221 --- Ý key.

  • KEY_THORN = 222 --- Þ key.

  • KEY_SSHARP = 223 --- ß key.

  • KEY_DIVISION = 247 --- ÷ key.

  • KEY_YDIAERESIS = 255 --- ÿ key.


enum KeyModifierMask:

  • KEY_CODE_MASK = 33554431 --- Key Code mask.

  • KEY_MODIFIER_MASK = -16777216 --- Modifier key mask.

  • KEY_MASK_SHIFT = 33554432 --- Shift key mask.

  • KEY_MASK_ALT = 67108864 --- Alt key mask.

  • KEY_MASK_META = 134217728 --- Meta key mask.

  • KEY_MASK_CTRL = 268435456 --- Ctrl key mask.

  • KEY_MASK_CMD = platform-dependent --- Command key mask. On macOS, this is equivalent to KEY_MASK_META. On other platforms, this is equivalent to KEY_MASK_CTRL. This mask should be preferred to KEY_MASK_META or KEY_MASK_CTRL for system shortcuts as it handles all platforms correctly.

  • KEY_MASK_KPAD = 536870912 --- Keypad key mask.

  • KEY_MASK_GROUP_SWITCH = 1073741824 --- Group Switch key mask.


enum MouseButton:

  • MOUSE_BUTTON_LEFT = 1 --- Left mouse button.

  • MOUSE_BUTTON_RIGHT = 2 --- Right mouse button.

  • MOUSE_BUTTON_MIDDLE = 3 --- Middle mouse button.

  • MOUSE_BUTTON_XBUTTON1 = 8 --- Extra mouse button 1 (only present on some mice).

  • MOUSE_BUTTON_XBUTTON2 = 9 --- Extra mouse button 2 (only present on some mice).

  • MOUSE_BUTTON_WHEEL_UP = 4 --- Mouse wheel up.

  • MOUSE_BUTTON_WHEEL_DOWN = 5 --- Mouse wheel down.

  • MOUSE_BUTTON_WHEEL_LEFT = 6 --- Mouse wheel left button (only present on some mice).

  • MOUSE_BUTTON_WHEEL_RIGHT = 7 --- Mouse wheel right button (only present on some mice).

  • MOUSE_BUTTON_MASK_LEFT = 1 --- Left mouse button mask.

  • MOUSE_BUTTON_MASK_RIGHT = 2 --- Right mouse button mask.

  • MOUSE_BUTTON_MASK_MIDDLE = 4 --- Middle mouse button mask.

  • MOUSE_BUTTON_MASK_XBUTTON1 = 128 --- Extra mouse button 1 mask.

  • MOUSE_BUTTON_MASK_XBUTTON2 = 256 --- Extra mouse button 2 mask.


enum JoyButton:

  • JOY_BUTTON_INVALID = -1 --- An invalid game controller button.

  • JOY_BUTTON_A = 0 --- Game controller SDL button A. Corresponds to the bottom action button: Sony Cross, Xbox A, Nintendo B.

  • JOY_BUTTON_B = 1 --- Game controller SDL button B. Corresponds to the right action button: Sony Circle, Xbox B, Nintendo A.

  • JOY_BUTTON_X = 2 --- Game controller SDL button X. Corresponds to the left action button: Sony Square, Xbox X, Nintendo Y.

  • JOY_BUTTON_Y = 3 --- Game controller SDL button Y. Corresponds to the top action button: Sony Triangle, Xbox Y, Nintendo X.

  • JOY_BUTTON_BACK = 4 --- Game controller SDL back button. Corresponds to the Sony Select, Xbox Back, Nintendo - button.

  • JOY_BUTTON_GUIDE = 5 --- Game controller SDL guide button. Corresponds to the Sony PS, Xbox Home button.

  • JOY_BUTTON_START = 6 --- Game controller SDL start button. Corresponds to the Nintendo + button.

  • JOY_BUTTON_LEFT_STICK = 7 --- Game controller SDL left stick button. Corresponds to the Sony L3, Xbox L/LS button.

  • JOY_BUTTON_RIGHT_STICK = 8 --- Game controller SDL right stick button. Corresponds to the Sony R3, Xbox R/RS button.

  • JOY_BUTTON_LEFT_SHOULDER = 9 --- Game controller SDL left shoulder button. Corresponds to the Sony L1, Xbox LB button.

  • JOY_BUTTON_RIGHT_SHOULDER = 10 --- Game controller SDL right shoulder button. Corresponds to the Sony R1, Xbox RB button.

  • JOY_BUTTON_DPAD_UP = 11 --- Game controller D-pad up button.

  • JOY_BUTTON_DPAD_DOWN = 12 --- Game controller D-pad down button.

  • JOY_BUTTON_DPAD_LEFT = 13 --- Game controller D-pad left button.

  • JOY_BUTTON_DPAD_RIGHT = 14 --- Game controller D-pad right button.

  • JOY_BUTTON_MISC1 = 15 --- Game controller SDL miscellaneous button. Corresponds to Xbox share button, PS5 microphone button, Nintendo capture button.

  • JOY_BUTTON_PADDLE1 = 16 --- Game controller SDL paddle 1 button.

  • JOY_BUTTON_PADDLE2 = 17 --- Game controller SDL paddle 2 button.

  • JOY_BUTTON_PADDLE3 = 18 --- Game controller SDL paddle 3 button.

  • JOY_BUTTON_PADDLE4 = 19 --- Game controller SDL paddle 4 button.

  • JOY_BUTTON_TOUCHPAD = 20 --- Game controller SDL touchpad button.

  • JOY_BUTTON_SDL_MAX = 21 --- The number of SDL game controller buttons.

  • JOY_BUTTON_MAX = 36 --- The maximum number of game controller buttons: Android supports up to 36 buttons.


enum JoyAxis:

  • JOY_AXIS_INVALID = -1 --- An invalid game controller axis.

  • JOY_AXIS_LEFT_X = 0 --- Game controller left joystick x-axis.

  • JOY_AXIS_LEFT_Y = 1 --- Game controller left joystick y-axis.

  • JOY_AXIS_RIGHT_X = 2 --- Game controller right joystick x-axis.

  • JOY_AXIS_RIGHT_Y = 3 --- Game controller right joystick y-axis.

  • JOY_AXIS_TRIGGER_LEFT = 4 --- Game controller left trigger axis.

  • JOY_AXIS_TRIGGER_RIGHT = 5 --- Game controller right trigger axis.

  • JOY_AXIS_SDL_MAX = 6 --- The number of SDL game controller axes.

  • JOY_AXIS_MAX = 10 --- The maximum number of game controller axes: OpenVR supports up to 5 Joysticks making a total of 10 axes.


enum MIDIMessage:

  • MIDI_MESSAGE_NOTE_OFF = 8 --- MIDI note OFF message.

  • MIDI_MESSAGE_NOTE_ON = 9 --- MIDI note ON message.

  • MIDI_MESSAGE_AFTERTOUCH = 10 --- MIDI aftertouch message.

  • MIDI_MESSAGE_CONTROL_CHANGE = 11 --- MIDI control change message.

  • MIDI_MESSAGE_PROGRAM_CHANGE = 12 --- MIDI program change message.

  • MIDI_MESSAGE_CHANNEL_PRESSURE = 13 --- MIDI channel pressure message.

  • MIDI_MESSAGE_PITCH_BEND = 14 --- MIDI pitch bend message.


enum Error:

  • OK = 0 --- Methods that return Error return OK when no error occurred. Note that many functions don't return an error code but will print error messages to standard output.

Since OK has value 0, and all other failure codes are positive integers, it can also be used in boolean checks, e.g.:

var err = method_that_returns_error()
if err != OK:
    print("Failure!")
# Or, equivalent:
if err:
    print("Still failing!")
  • FAILED = 1 --- Generic error.

  • ERR_UNAVAILABLE = 2 --- Unavailable error.

  • ERR_UNCONFIGURED = 3 --- Unconfigured error.

  • ERR_UNAUTHORIZED = 4 --- Unauthorized error.

  • ERR_PARAMETER_RANGE_ERROR = 5 --- Parameter range error.

  • ERR_OUT_OF_MEMORY = 6 --- Out of memory (OOM) error.

  • ERR_FILE_NOT_FOUND = 7 --- File: Not found error.

  • ERR_FILE_BAD_DRIVE = 8 --- File: Bad drive error.

  • ERR_FILE_BAD_PATH = 9 --- File: Bad path error.

  • ERR_FILE_NO_PERMISSION = 10 --- File: No permission error.

  • ERR_FILE_ALREADY_IN_USE = 11 --- File: Already in use error.

  • ERR_FILE_CANT_OPEN = 12 --- File: Can't open error.

  • ERR_FILE_CANT_WRITE = 13 --- File: Can't write error.

  • ERR_FILE_CANT_READ = 14 --- File: Can't read error.

  • ERR_FILE_UNRECOGNIZED = 15 --- File: Unrecognized error.

  • ERR_FILE_CORRUPT = 16 --- File: Corrupt error.

  • ERR_FILE_MISSING_DEPENDENCIES = 17 --- File: Missing dependencies error.

  • ERR_FILE_EOF = 18 --- File: End of file (EOF) error.

  • ERR_CANT_OPEN = 19 --- Can't open error.

  • ERR_CANT_CREATE = 20 --- Can't create error.

  • ERR_QUERY_FAILED = 21 --- Query failed error.

  • ERR_ALREADY_IN_USE = 22 --- Already in use error.

  • ERR_LOCKED = 23 --- Locked error.

  • ERR_TIMEOUT = 24 --- Timeout error.

  • ERR_CANT_CONNECT = 25 --- Can't connect error.

  • ERR_CANT_RESOLVE = 26 --- Can't resolve error.

  • ERR_CONNECTION_ERROR = 27 --- Connection error.

  • ERR_CANT_ACQUIRE_RESOURCE = 28 --- Can't acquire resource error.

  • ERR_CANT_FORK = 29 --- Can't fork process error.

  • ERR_INVALID_DATA = 30 --- Invalid data error.

  • ERR_INVALID_PARAMETER = 31 --- Invalid parameter error.

  • ERR_ALREADY_EXISTS = 32 --- Already exists error.

  • ERR_DOES_NOT_EXIST = 33 --- Does not exist error.

  • ERR_DATABASE_CANT_READ = 34 --- Database: Read error.

  • ERR_DATABASE_CANT_WRITE = 35 --- Database: Write error.

  • ERR_COMPILATION_FAILED = 36 --- Compilation failed error.

  • ERR_METHOD_NOT_FOUND = 37 --- Method not found error.

  • ERR_LINK_FAILED = 38 --- Linking failed error.

  • ERR_SCRIPT_FAILED = 39 --- Script failed error.

  • ERR_CYCLIC_LINK = 40 --- Cycling link (import cycle) error.

  • ERR_INVALID_DECLARATION = 41 --- Invalid declaration error.

  • ERR_DUPLICATE_SYMBOL = 42 --- Duplicate symbol error.

  • ERR_PARSE_ERROR = 43 --- Parse error.

  • ERR_BUSY = 44 --- Busy error.

  • ERR_SKIP = 45 --- Skip error.

  • ERR_HELP = 46 --- Help error.

  • ERR_BUG = 47 --- Bug error.

  • ERR_PRINTER_ON_FIRE = 48 --- Printer on fire error. (This is an easter egg, no engine methods return this error code.)


enum PropertyHint:

  • PROPERTY_HINT_NONE = 0 --- No hint for the edited property.

  • PROPERTY_HINT_RANGE = 1 --- Hints that an integer or float property should be within a range specified via the hint string "min,max" or "min,max,step". The hint string can optionally include "or_greater" and/or "or_lesser" to allow manual input going respectively above the max or below the min values. Example: "-360,360,1,or_greater,or_lesser".

Additionally, other keywords can be included: "exp" for exponential range editing, "radians" for editing radian angles in degrees, "degrees" to hint at an angle and "noslider" to hide the slider.

  • PROPERTY_HINT_ENUM = 2 --- Hints that an integer, float or string property is an enumerated value to pick in a list specified via a hint string such as "Hello,Something,Else".

  • PROPERTY_HINT_ENUM_SUGGESTION = 3 --- Hints that a string property is can be an enumerated value to pick in a list specified via a hint string such as "Hello,Something,Else".

Unlike PROPERTY_HINT_ENUM a property with this hint still accepts arbitrary values and can be empty. The list of values serves to suggest possible values.

  • PROPERTY_HINT_EXP_EASING = 4 --- Hints that a float property should be edited via an exponential easing function. The hint string can include "attenuation" to flip the curve horizontally and/or "inout" to also include in/out easing.

  • PROPERTY_HINT_LENGTH = 5 --- Deprecated hint, unused.

  • PROPERTY_HINT_KEY_ACCEL = 6 --- Deprecated hint, unused.

  • PROPERTY_HINT_FLAGS = 7 --- Hints that an integer property is a bitmask with named bit flags. For example, to allow toggling bits 0, 1, 2 and 4, the hint could be something like "Bit0,Bit1,Bit2,,Bit4".

  • PROPERTY_HINT_LAYERS_2D_RENDER = 8 --- Hints that an integer property is a bitmask using the optionally named 2D render layers.

  • PROPERTY_HINT_LAYERS_2D_PHYSICS = 9 --- Hints that an integer property is a bitmask using the optionally named 2D physics layers.

  • PROPERTY_HINT_LAYERS_2D_NAVIGATION = 10 --- Hints that an integer property is a bitmask using the optionally named 2D navigation layers.

  • PROPERTY_HINT_LAYERS_3D_RENDER = 11 --- Hints that an integer property is a bitmask using the optionally named 3D render layers.

  • PROPERTY_HINT_LAYERS_3D_PHYSICS = 12 --- Hints that an integer property is a bitmask using the optionally named 3D physics layers.

  • PROPERTY_HINT_LAYERS_3D_NAVIGATION = 13 --- Hints that an integer property is a bitmask using the optionally named 2D navigation layers.

  • PROPERTY_HINT_FILE = 14 --- Hints that a string property is a path to a file. Editing it will show a file dialog for picking the path. The hint string can be a set of filters with wildcards like "*.png,*.jpg".

  • PROPERTY_HINT_DIR = 15 --- Hints that a string property is a path to a directory. Editing it will show a file dialog for picking the path.

  • PROPERTY_HINT_GLOBAL_FILE = 16 --- Hints that a string property is an absolute path to a file outside the project folder. Editing it will show a file dialog for picking the path. The hint string can be a set of filters with wildcards like "*.png,*.jpg".

  • PROPERTY_HINT_GLOBAL_DIR = 17 --- Hints that a string property is an absolute path to a directory outside the project folder. Editing it will show a file dialog for picking the path.

  • PROPERTY_HINT_RESOURCE_TYPE = 18 --- Hints that a property is an instance of a Resource-derived type, optionally specified via the hint string (e.g. "Texture2D"). Editing it will show a popup menu of valid resource types to instantiate.

  • PROPERTY_HINT_MULTILINE_TEXT = 19 --- Hints that a string property is text with line breaks. Editing it will show a text input field where line breaks can be typed.

  • PROPERTY_HINT_PLACEHOLDER_TEXT = 20 --- Hints that a string property should have a placeholder text visible on its input field, whenever the property is empty. The hint string is the placeholder text to use.

  • PROPERTY_HINT_COLOR_NO_ALPHA = 21 --- Hints that a color property should be edited without changing its alpha component, i.e. only R, G and B channels are edited.

  • PROPERTY_HINT_IMAGE_COMPRESS_LOSSY = 22 --- Hints that an image is compressed using lossy compression.

  • PROPERTY_HINT_IMAGE_COMPRESS_LOSSLESS = 23 --- Hints that an image is compressed using lossless compression.

  • PROPERTY_HINT_OBJECT_ID = 24

  • PROPERTY_HINT_TYPE_STRING = 25 --- Hint that a property represents a particular type. If a property is TYPE_STRING, allows to set a type from the create dialog. If you need to create an Array to contain elements of a specific type, the hint_string must encode nested types using ":" and "/" for specifying Resource types. For instance:

hint_string = "%s:" % [TYPE_INT] # Array of inteters.
hint_string = "%s:%s:" % [TYPE_ARRAY, TYPE_REAL] # Two-dimensional array of floats.
hint_string = "%s/%s:Resource" % [TYPE_OBJECT, TYPE_OBJECT] # Array of resources.
hint_string = "%s:%s/%s:Resource" % [TYPE_ARRAY, TYPE_OBJECT, TYPE_OBJECT] # Two-dimensional array of resources.

Note: The final colon is required to specify for properly detecting built-in types.

  • PROPERTY_HINT_NODE_PATH_TO_EDITED_NODE = 26

  • PROPERTY_HINT_METHOD_OF_VARIANT_TYPE = 27

  • PROPERTY_HINT_METHOD_OF_BASE_TYPE = 28

  • PROPERTY_HINT_METHOD_OF_INSTANCE = 29

  • PROPERTY_HINT_METHOD_OF_SCRIPT = 30

  • PROPERTY_HINT_PROPERTY_OF_VARIANT_TYPE = 31

  • PROPERTY_HINT_PROPERTY_OF_BASE_TYPE = 32

  • PROPERTY_HINT_PROPERTY_OF_INSTANCE = 33

  • PROPERTY_HINT_PROPERTY_OF_SCRIPT = 34

  • PROPERTY_HINT_OBJECT_TOO_BIG = 35

  • PROPERTY_HINT_NODE_PATH_VALID_TYPES = 36

  • PROPERTY_HINT_SAVE_FILE = 37

  • PROPERTY_HINT_INT_IS_OBJECTID = 38

  • PROPERTY_HINT_INT_IS_POINTER = 40

  • PROPERTY_HINT_ARRAY_TYPE = 39

  • PROPERTY_HINT_MAX = 41


enum PropertyUsageFlags:

  • PROPERTY_USAGE_NONE = 0

  • PROPERTY_USAGE_STORAGE = 1 --- The property is serialized and saved in the scene file (default).

  • PROPERTY_USAGE_EDITOR = 2 --- The property is shown in the editor inspector (default).

  • PROPERTY_USAGE_NETWORK = 4 --- Deprecated usage flag, unused.

  • PROPERTY_USAGE_EDITOR_HELPER = 8 --- Deprecated usage flag, unused.

  • PROPERTY_USAGE_CHECKABLE = 16 --- The property can be checked in the editor inspector.

  • PROPERTY_USAGE_CHECKED = 32 --- The property is checked in the editor inspector.

  • PROPERTY_USAGE_INTERNATIONALIZED = 64 --- The property is a translatable string.

  • PROPERTY_USAGE_GROUP = 128 --- Used to group properties together in the editor.

  • PROPERTY_USAGE_CATEGORY = 256 --- Used to categorize properties together in the editor.

  • PROPERTY_USAGE_SUBGROUP = 512 --- Used to group properties together in the editor in a subgroup (under a group).

  • PROPERTY_USAGE_NO_INSTANCE_STATE = 2048 --- The property does not save its state in PackedScene.

  • PROPERTY_USAGE_RESTART_IF_CHANGED = 4096 --- Editing the property prompts the user for restarting the editor.

  • PROPERTY_USAGE_SCRIPT_VARIABLE = 8192 --- The property is a script variable which should be serialized and saved in the scene file.

  • PROPERTY_USAGE_STORE_IF_NULL = 16384

  • PROPERTY_USAGE_ANIMATE_AS_TRIGGER = 32768

  • PROPERTY_USAGE_UPDATE_ALL_IF_MODIFIED = 65536

  • PROPERTY_USAGE_SCRIPT_DEFAULT_VALUE = 131072

  • PROPERTY_USAGE_CLASS_IS_ENUM = 262144

  • PROPERTY_USAGE_NIL_IS_VARIANT = 524288

  • PROPERTY_USAGE_INTERNAL = 1048576

  • PROPERTY_USAGE_DO_NOT_SHARE_ON_DUPLICATE = 2097152

  • PROPERTY_USAGE_HIGH_END_GFX = 4194304

  • PROPERTY_USAGE_NODE_PATH_FROM_SCENE_ROOT = 8388608

  • PROPERTY_USAGE_RESOURCE_NOT_PERSISTENT = 16777216

  • PROPERTY_USAGE_KEYING_INCREMENTS = 33554432

  • PROPERTY_USAGE_DEFERRED_SET_RESOURCE = 67108864

  • PROPERTY_USAGE_EDITOR_INSTANTIATE_OBJECT = 134217728

  • PROPERTY_USAGE_EDITOR_BASIC_SETTING = 268435456

  • PROPERTY_USAGE_ARRAY = 1073741824

  • PROPERTY_USAGE_DEFAULT = 7 --- Default usage (storage, editor and network).

  • PROPERTY_USAGE_DEFAULT_INTL = 71 --- Default usage for translatable strings (storage, editor, network and internationalized).

  • PROPERTY_USAGE_NOEDITOR = 5 --- Default usage but without showing the property in the editor (storage, network).


enum MethodFlags:

  • METHOD_FLAG_NORMAL = 1 --- Flag for a normal method.

  • METHOD_FLAG_EDITOR = 2 --- Flag for an editor method.

  • METHOD_FLAG_NOSCRIPT = 4 --- Deprecated method flag, unused.

  • METHOD_FLAG_CONST = 8 --- Flag for a constant method.

  • METHOD_FLAG_REVERSE = 16 --- Deprecated method flag, unused.

  • METHOD_FLAG_VIRTUAL = 32 --- Flag for a virtual method.

  • METHOD_FLAG_FROM_SCRIPT = 64 --- Deprecated method flag, unused.

  • METHOD_FLAG_STATIC = 256

  • METHOD_FLAG_OBJECT_CORE = 512 --- Used internally. Allows to not dump core virtuals such as _notification to the JSON API.

  • METHOD_FLAGS_DEFAULT = 1 --- Default method flags.


enum RPCMode:

  • RPC_MODE_DISABLED = 0 --- Used with Node.rpc_config to disable a method or property for all RPC calls, making it unavailable. Default for all methods.

  • RPC_MODE_ANY_PEER = 1 --- Used with Node.rpc_config to set a method to be callable remotely by any peer. Analogous to the @rpc(any) annotation. Calls are accepted from all remote peers, no matter if they are node's authority or not.

  • RPC_MODE_AUTH = 2 --- Used with Node.rpc_config to set a method to be callable remotely only by the current multiplayer authority (which is the server by default). Analogous to the @rpc(auth) annotation. See Node.set_multiplayer_authority.


enum TransferMode:

  • TRANSFER_MODE_UNRELIABLE = 0 --- Packets are not acknowledged, no resend attempts are made for lost packets. Packets may arrive in any order. Potentially faster than TRANSFER_MODE_UNRELIABLE_ORDERED. Use for non-critical data, and always consider whether the order matters.

  • TRANSFER_MODE_UNRELIABLE_ORDERED = 1 --- Packets are not acknowledged, no resend attempts are made for lost packets. Packets are received in the order they were sent in. Potentially faster than TRANSFER_MODE_RELIABLE. Use for non-critical data or data that would be outdated if received late due to resend attempt(s) anyway, for example movement and positional data.

  • TRANSFER_MODE_RELIABLE = 2 --- Packets must be received and resend attempts should be made until the packets are acknowledged. Packets must be received in the order they were sent in. Most reliable transfer mode, but potentially the slowest due to the overhead. Use for critical data that must be transmitted and arrive in order, for example an ability being triggered or a chat message. Consider carefully if the information really is critical, and use sparingly.


enum Variant.Type:

  • TYPE_NIL = 0 --- Variable is null.

  • TYPE_BOOL = 1 --- Variable is of type bool.

  • TYPE_INT = 2 --- Variable is of type int.

  • TYPE_FLOAT = 3 --- Variable is of type float (real).

  • TYPE_STRING = 4 --- Variable is of type String.

  • TYPE_VECTOR2 = 5 --- Variable is of type Vector2.

  • TYPE_VECTOR2I = 6 --- Variable is of type Vector2i.

  • TYPE_RECT2 = 7 --- Variable is of type Rect2.

  • TYPE_RECT2I = 8 --- Variable is of type Rect2i.

  • TYPE_VECTOR3 = 9 --- Variable is of type Vector3.

  • TYPE_VECTOR3I = 10 --- Variable is of type Vector3i.

  • TYPE_TRANSFORM2D = 11 --- Variable is of type Transform2D.

  • TYPE_PLANE = 12 --- Variable is of type Plane.

  • TYPE_QUATERNION = 13 --- Variable is of type Quaternion.

  • TYPE_AABB = 14 --- Variable is of type AABB.

  • TYPE_BASIS = 15 --- Variable is of type Basis.

  • TYPE_TRANSFORM3D = 16 --- Variable is of type Transform3D.

  • TYPE_COLOR = 17 --- Variable is of type Color.

  • TYPE_STRING_NAME = 18 --- Variable is of type StringName.

  • TYPE_NODE_PATH = 19 --- Variable is of type NodePath.

  • TYPE_RID = 20 --- Variable is of type RID.

  • TYPE_OBJECT = 21 --- Variable is of type Object.

  • TYPE_CALLABLE = 22 --- Variable is of type Callable.

  • TYPE_SIGNAL = 23 --- Variable is of type Signal.

  • TYPE_DICTIONARY = 24 --- Variable is of type Dictionary.

  • TYPE_ARRAY = 25 --- Variable is of type Array.

  • TYPE_RAW_ARRAY = 26 --- Variable is of type PackedByteArray.

  • TYPE_INT32_ARRAY = 27 --- Variable is of type PackedInt32Array.

  • TYPE_INT64_ARRAY = 28 --- Variable is of type PackedInt64Array.

  • TYPE_FLOAT32_ARRAY = 29 --- Variable is of type PackedFloat32Array.

  • TYPE_FLOAT64_ARRAY = 30 --- Variable is of type PackedFloat64Array.

  • TYPE_STRING_ARRAY = 31 --- Variable is of type PackedStringArray.

  • TYPE_VECTOR2_ARRAY = 32 --- Variable is of type PackedVector2Array.

  • TYPE_VECTOR3_ARRAY = 33 --- Variable is of type PackedVector3Array.

  • TYPE_COLOR_ARRAY = 34 --- Variable is of type PackedColorArray.

  • TYPE_MAX = 35 --- Represents the size of the Variant.Type enum.


enum Variant.Operator:

  • OP_EQUAL = 0 --- Equality operator (==).

  • OP_NOT_EQUAL = 1 --- Inequality operator (!=).

  • OP_LESS = 2 --- Less than operator (<).

  • OP_LESS_EQUAL = 3 --- Less than or equal operator (<=).

  • OP_GREATER = 4 --- Greater than operator (>).

  • OP_GREATER_EQUAL = 5 --- Greater than or equal operator (>=).

  • OP_ADD = 6 --- Addition operator (+).

  • OP_SUBTRACT = 7 --- Subtraction operator (-).

  • OP_MULTIPLY = 8 --- Multiplication operator (*).

  • OP_DIVIDE = 9 --- Division operator (/).

  • OP_NEGATE = 10 --- Unary negation operator (-).

  • OP_POSITIVE = 11 --- Unary plus operator (+).

  • OP_MODULE = 12 --- Remainder/modulo operator (%).

  • OP_SHIFT_LEFT = 13 --- Left shift operator (<<).

  • OP_SHIFT_RIGHT = 14 --- Right shift operator (>>).

  • OP_BIT_AND = 15 --- Bitwise AND operator (&).

  • OP_BIT_OR = 16 --- Bitwise OR operator (|).

  • OP_BIT_XOR = 17 --- Bitwise XOR operator (^).

  • OP_BIT_NEGATE = 18 --- Bitwise NOT operator (~).

  • OP_AND = 19 --- Logical AND operator (and or &&).

  • OP_OR = 20 --- Logical OR operator (or or ||).

  • OP_XOR = 21 --- Logical XOR operator (not implemented in GDScript).

  • OP_NOT = 22 --- Logical NOT operator (not or !).

  • OP_IN = 23 --- Logical IN operator (in).

  • OP_MAX = 24 --- Represents the size of the Variant.Operator enum.

Constants

  • SPKEY = 16777216 --- Keycodes with this bit applied are non-printable.

Property Descriptions

The AudioServer singleton.


The CameraServer singleton.


The ClassDB singleton.


The DisplayServer singleton.


The Engine singleton.


The EngineDebugger singleton.


The Geometry2D singleton.


The Geometry3D singleton.


The GodotSharp singleton.


The IP singleton.


The Input singleton.


The InputMap singleton.


The JavaClassWrapper singleton.

Note: Only implemented on Android.


The JavaScript singleton.

Note: Only implemented on HTML5.


The Marshalls singleton.



The NavigationMeshGenerator singleton.


The NavigationServer2D singleton.


The NavigationServer2D singleton.


The OS singleton.


The Performance singleton.


The PhysicsServer2D singleton.


The PhysicsServer3D singleton.


The ProjectSettings singleton.


The RenderingServer singleton.


The ResourceLoader singleton.


The ResourceSaver singleton.



The TextServerManager singleton.


The Time singleton.


The TranslationServer singleton.


The VisualScriptCustomNodes singleton.


The XRServer singleton.

Method Descriptions


Returns the absolute value of float parameter x (i.e. positive value).

# a is 1.2
var a = absf(-1.2)

Returns the absolute value of int parameter x (i.e. positive value).

# a is 1
var a = absi(-1)

Returns the arc cosine of x in radians. Use to get the angle of cosine x. x must be between -1.0 and 1.0 (inclusive), otherwise, acos will return @GDScript.NAN.

# c is 0.523599 or 30 degrees if converted with rad2deg(c)
var c = acos(0.866025)

Returns the arc sine of x in radians. Use to get the angle of sine x. x must be between -1.0 and 1.0 (inclusive), otherwise, asin will return @GDScript.NAN.

# s is 0.523599 or 30 degrees if converted with rad2deg(s)
var s = asin(0.5)

Returns the arc tangent of x in radians. Use it to get the angle from an angle's tangent in trigonometry.

The method cannot know in which quadrant the angle should fall. See atan2 if you have both y and x.

var a = atan(0.5) # a is 0.463648

If x is between -PI / 2 and PI / 2 (inclusive), atan(tan(x)) is equal to x.


Returns the arc tangent of y/x in radians. Use to get the angle of tangent y/x. To compute the value, the method takes into account the sign of both arguments in order to determine the quadrant.

Important note: The Y coordinate comes first, by convention.

var a = atan2(0, -1) # a is 3.141593

Decodes a byte array back to a Variant value, without decoding objects.

Note: If you need object deserialization, see bytes2var_with_objects.


Decodes a byte array back to a Variant value. Decoding objects is allowed.

Warning: Deserialized object can contain code which gets executed. Do not use this option if the serialized object comes from untrusted sources to avoid potential security threats (remote code execution).


Rounds x upward (towards positive infinity), returning the smallest whole number that is not less than x.

var i = ceil(1.45) # i is 2.0
i = ceil(1.001)    # i is 2.0

See also floor, round, and snapped.



Clamps the float value and returns a value not less than min and not more than max.

var speed = 42.1
# a is 20.0
var a = clampf(speed, 1.0, 20.0)

speed = -10.0
# a is -1.0
a = clampf(speed, -1.0, 1.0)

Clamps the integer value and returns a value not less than min and not more than max.

var speed = 42
# a is 20
var a = clampi(speed, 1, 20)

speed = -10
# a is -1
a = clampi(speed, -1, 1)

Returns the cosine of angle angle_rad in radians.

cos(PI * 2)      # Returns 1.0
cos(PI)          # Returns -1.0
cos(deg2rad(90)) # Returns 0.0

Returns the hyperbolic cosine of x in radians.

# Prints 1.543081
print(cosh(1))

Converts from decibels to linear energy (audio).


Converts an angle expressed in degrees to radians.

# r is 3.141593
var r = deg2rad(180)

Returns an "eased" value of x based on an easing function defined with curve. This easing function is based on an exponent. The curve can be any floating-point number, with specific values leading to the following behaviors:

- Lower than -1.0 (exclusive): Ease in-out
- 1.0: Linear
- Between -1.0 and 0.0 (exclusive): Ease out-in
- 0.0: Constant
- Between 0.0 to 1.0 (exclusive): Ease in
- 1.0: Linear
- Greater than 1.0 (exclusive): Ease out

ease() curve values cheatsheet

See also smoothstep. If you need to perform more advanced transitions, use Tween or AnimationPlayer.


Returns a human-readable name for the given error code.


The natural exponential function. It raises the mathematical constant e to the power of x and returns it.

e has an approximate value of 2.71828, and can be obtained with exp(1).

For exponents to other bases use the method pow.

var a = exp(2) # Approximately 7.39

Rounds x downward (towards negative infinity), returning the largest whole number that is not more than x.

# a is 2.0
var a = floor(2.99)
# a is -3.0
a = floor(-2.99)

See also ceil, round, and snapped.

Note: This method returns a float. If you need an integer, you can use int(x) directly.


Returns the floating-point remainder of x/y, keeping the sign of x.

# Remainder is 1.5
var remainder = fmod(7, 5.5)

For the integer remainder operation, use the % operator.


Returns the floating-point modulus of x/y that wraps equally in positive and negative.

for i in 7:
    var x = 0.5 * i - 1.5
    print("%4.1f %4.1f %4.1f" % [x, fmod(x, 1.5), fposmod(x, 1.5)])

Produces:

-1.5 -0.0  0.0
-1.0 -1.0  0.5
-0.5 -0.5  1.0
 0.0  0.0  0.0
 0.5  0.5  0.5
 1.0  1.0  1.0
 1.5  0.0  0.0

Returns the integer hash of the variable passed.

print(hash("a")) # Prints 177670

  • Object instance_from_id ( int instance_id )

Returns the Object that corresponds to instance_id. All Objects have a unique instance ID.

var foo = "bar"
func _ready():
    var id = get_instance_id()
    var inst = instance_from_id(id)
    print(inst.foo) # Prints bar

Returns a normalized value considering the given range. This is the opposite of lerp.

var middle = lerp(20, 30, 0.75)
# `middle` is now 27.5.
# Now, we pretend to have forgotten the original ratio and want to get it back.
var ratio = inverse_lerp(20, 30, 27.5)
# `ratio` is now 0.75.

Returns true if a and b are approximately equal to each other.

Here, approximately equal means that a and b are within a small internal epsilon of each other, which scales with the magnitude of the numbers.

Infinity values of the same sign are considered equal.


Returns whether x is an infinity value (either positive infinity or negative infinity).


  • bool is_instance_id_valid ( int id )


Returns whether instance is a valid object (e.g. has not been deleted from memory).


Returns whether x is a NaN ("Not a Number" or invalid) value.


Returns true if x is zero or almost zero.

This method is faster than using is_equal_approx with one value as zero.


Linearly interpolates between two values by a normalized value. This is the opposite of inverse_lerp.

lerp(0, 4