Attention: Here be dragons

This is the latest (unstable) version of this documentation, which may document features not available in or compatible with released stable versions of Godot.

@GlobalScope

全局范围的常量和函数。

描述

全局范围的枚举常量和内置函数的列表。这是所有驻留在全局的,关于错误代码、键码、属性提示等的常量的集合。

单例也被记录在这里,因为它们可以从任何地方被访问。

对于可以在任何脚本中访问的与 GDScript 相关的条目,请参阅 @GDScript

备注

通过 C# 使用该 API 时会有显著不同,详见 C# API 与 GDScript 的差异

教程

属性

AudioServer

AudioServer

CameraServer

CameraServer

ClassDB

ClassDB

DisplayServer

DisplayServer

EditorInterface

EditorInterface

Engine

Engine

EngineDebugger

EngineDebugger

GDExtensionManager

GDExtensionManager

Geometry2D

Geometry2D

Geometry3D

Geometry3D

IP

IP

Input

Input

InputMap

InputMap

JavaClassWrapper

JavaClassWrapper

JavaScriptBridge

JavaScriptBridge

Marshalls

Marshalls

NativeMenu

NativeMenu

NavigationMeshGenerator

NavigationMeshGenerator

NavigationServer2D

NavigationServer2D

NavigationServer3D

NavigationServer3D

OS

OS

Performance

Performance

PhysicsServer2D

PhysicsServer2D

PhysicsServer2DManager

PhysicsServer2DManager

PhysicsServer3D

PhysicsServer3D

PhysicsServer3DManager

PhysicsServer3DManager

ProjectSettings

ProjectSettings

RenderingServer

RenderingServer

ResourceLoader

ResourceLoader

ResourceSaver

ResourceSaver

ResourceUID

ResourceUID

TextServerManager

TextServerManager

ThemeDB

ThemeDB

Time

Time

TranslationServer

TranslationServer

WorkerThreadPool

WorkerThreadPool

XRServer

XRServer

方法

Variant

abs(x: Variant)

float

absf(x: float)

int

absi(x: int)

float

acos(x: float)

float

acosh(x: float)

float

angle_difference(from: float, to: float)

float

asin(x: float)

float

asinh(x: float)

float

atan(x: float)

float

atan2(y: float, x: float)

float

atanh(x: float)

float

bezier_derivative(start: float, control_1: float, control_2: float, end: float, t: float)

float

bezier_interpolate(start: float, control_1: float, control_2: float, end: float, t: float)

Variant

bytes_to_var(bytes: PackedByteArray)

Variant

bytes_to_var_with_objects(bytes: PackedByteArray)

Variant

ceil(x: Variant)

float

ceilf(x: float)

int

ceili(x: float)

Variant

clamp(value: Variant, min: Variant, max: Variant)

float

clampf(value: float, min: float, max: float)

int

clampi(value: int, min: int, max: int)

float

cos(angle_rad: float)

float

cosh(x: float)

float

cubic_interpolate(from: float, to: float, pre: float, post: float, weight: float)

float

cubic_interpolate_angle(from: float, to: float, pre: float, post: float, weight: float)

float

cubic_interpolate_angle_in_time(from: float, to: float, pre: float, post: float, weight: float, to_t: float, pre_t: float, post_t: float)

float

cubic_interpolate_in_time(from: float, to: float, pre: float, post: float, weight: float, to_t: float, pre_t: float, post_t: float)

float

db_to_linear(db: float)

float

deg_to_rad(deg: float)

float

ease(x: float, curve: float)

String

error_string(error: int)

float

exp(x: float)

Variant

floor(x: Variant)

float

floorf(x: float)

int

floori(x: float)

float

fmod(x: float, y: float)

float

fposmod(x: float, y: float)

int

hash(variable: Variant)

Object

instance_from_id(instance_id: int)

float

inverse_lerp(from: float, to: float, weight: float)

bool

is_equal_approx(a: float, b: float)

bool

is_finite(x: float)

bool

is_inf(x: float)

bool

is_instance_id_valid(id: int)

bool

is_instance_valid(instance: Variant)

bool

is_nan(x: float)

bool

is_same(a: Variant, b: Variant)

bool

is_zero_approx(x: float)

Variant

lerp(from: Variant, to: Variant, weight: Variant)

float

lerp_angle(from: float, to: float, weight: float)

float

lerpf(from: float, to: float, weight: float)

float

linear_to_db(lin: float)

float

log(x: float)

Variant

max(...) vararg

float

maxf(a: float, b: float)

int

maxi(a: int, b: int)

Variant

min(...) vararg

float

minf(a: float, b: float)

int

mini(a: int, b: int)

float

move_toward(from: float, to: float, delta: float)

int

nearest_po2(value: int)

float

pingpong(value: float, length: float)

int

posmod(x: int, y: int)

float

pow(base: float, exp: float)

void

print(...) vararg

void

print_rich(...) 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

rad_to_deg(rad: float)

PackedInt64Array

rand_from_seed(seed: int)

float

randf()

float

randf_range(from: float, to: float)

float

randfn(mean: float, deviation: float)

int

randi()

int

randi_range(from: int, to: int)

void

randomize()

float

remap(value: float, istart: float, istop: float, ostart: float, ostop: float)

int

rid_allocate_id()

RID

rid_from_int64(base: int)

float

rotate_toward(from: float, to: float, delta: float)

Variant

round(x: Variant)

float

roundf(x: float)

int

roundi(x: float)

void

seed(base: int)

Variant

sign(x: Variant)

float

signf(x: float)

int

signi(x: int)

float

sin(angle_rad: float)

float

sinh(x: float)

float

smoothstep(from: float, to: float, x: float)

Variant

snapped(x: Variant, step: Variant)

float

snappedf(x: float, step: float)

int

snappedi(x: float, step: int)

float

sqrt(x: float)

int

step_decimals(x: float)

String