From d7e7a6156a90c892289e270e1ef17fcee0c591b1 Mon Sep 17 00:00:00 2001 From: rowan Date: Wed, 7 May 2025 15:42:26 -0500 Subject: [PATCH] fuck this thing is fragile; damage/health/weapons working --- resources/items/handgun.tres | 4 +- scenes/node_3d.tscn | 14 +- scenes/player.tscn | 77 +- src/annotations.ts | 9 +- src/debug_draw.ts | 8 +- src/entity.ts.uid | 1 + src/equipped_weapon.ts | 30 +- src/health.ts | 4 + src/node.ts | 48 + src/vec.ts | 6 + src/vec.ts.uid | 1 + src/weapon.ts | 6 + tsconfig.json | 8 +- .../addons/dev_console/console.nodes.gen.d.ts | 2 +- .../dev_console/output_line.nodes.gen.d.ts | 7 + typings/assets/Glock 17 Gen 4/Glock17.fbx | 13 + .../assets/Glock 17 Gen 4/MagazineOnly.blend | 8 + .../assets/Glock 17 Gen 4/MagazineOnly.fbx | 8 + typings/assets/Glock 17 Gen 4/Main.blend | 13 + typings/assets/Glock 17 Gen 4/Main.glb | 13 + typings/assets/level.glb | 9 + typings/assets/player.glb | 17 + typings/assets/player2.glb | 25 + typings/godot.mix.d.ts | 73 +- typings/godot0.gen.d.ts | 5535 ++--- typings/godot1.gen.d.ts | 9299 ++++---- typings/godot2.gen.d.ts | 11065 +++++----- typings/godot3.gen.d.ts | 13090 ++++++----- typings/godot4.gen.d.ts | 15391 +++++++------ typings/godot5.gen.d.ts | 17323 ++++++++------- typings/godot6.gen.d.ts | 17974 ++++++++-------- typings/godot7.gen.d.ts | 16689 +++++++------- typings/godot8.gen.d.ts | 8552 ++++++++ typings/jsb.editor.bundle.d.ts | 21 +- typings/jsb.runtime.bundle.d.ts | 27 +- typings/player.nodes.gen.d.ts | 24 + typings/scenes/node_3d.nodes.gen.d.ts | 8 +- typings/scenes/player.nodes.gen.d.ts | 4 +- typings/scenes/player_mesh.nodes.gen.d.ts | 17 + 39 files changed, 61546 insertions(+), 53877 deletions(-) create mode 100644 src/entity.ts.uid create mode 100644 src/node.ts create mode 100644 src/vec.ts create mode 100644 src/vec.ts.uid create mode 100644 typings/addons/dev_console/output_line.nodes.gen.d.ts create mode 100644 typings/assets/Glock 17 Gen 4/Glock17.fbx create mode 100644 typings/assets/Glock 17 Gen 4/MagazineOnly.blend create mode 100644 typings/assets/Glock 17 Gen 4/MagazineOnly.fbx create mode 100644 typings/assets/Glock 17 Gen 4/Main.blend create mode 100644 typings/assets/Glock 17 Gen 4/Main.glb create mode 100644 typings/assets/level.glb create mode 100644 typings/assets/player.glb create mode 100644 typings/assets/player2.glb create mode 100644 typings/godot8.gen.d.ts create mode 100644 typings/player.nodes.gen.d.ts create mode 100644 typings/scenes/player_mesh.nodes.gen.d.ts diff --git a/resources/items/handgun.tres b/resources/items/handgun.tres index 67b7f6d..5c31277 100644 --- a/resources/items/handgun.tres +++ b/resources/items/handgun.tres @@ -4,10 +4,12 @@ [resource] script = ExtResource("1_bp18i") -name = &"" +name = &"Handgun" description = "" max_quantity = 99 scene = "uid://ddgak6clk2i2p" +range = 100.0 fire_rate = 0.5 capacity = 9 +damage = 1.0 metadata/_custom_type_script = "uid://tv71bu1y658n" diff --git a/scenes/node_3d.tscn b/scenes/node_3d.tscn index ea1b0e2..3c113ce 100644 --- a/scenes/node_3d.tscn +++ b/scenes/node_3d.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=16 format=3 uid="uid://dl8pjf2esflbr"] +[gd_scene load_steps=18 format=3 uid="uid://dl8pjf2esflbr"] [ext_resource type="PackedScene" uid="uid://cersx8w4ps2sr" path="res://scenes/player.tscn" id="1_uum5p"] [ext_resource type="Script" uid="uid://cgbd6grygtxvj" path="res://src/main_camera.ts" id="2_0n32s"] @@ -7,6 +7,7 @@ [ext_resource type="Script" uid="uid://1w0aiix6vgbc" path="res://src/interactable/door.ts" id="3_imxmk"] [ext_resource type="Resource" uid="uid://5odv3n0dp2nn" path="res://resources/items/key.tres" id="4_3rynd"] [ext_resource type="Script" uid="uid://c7s3k1qy8pg3s" path="res://src/item_pickup.ts" id="6_qe67v"] +[ext_resource type="Script" uid="uid://bccrrtp3mlw5i" path="res://src/health.ts" id="8_cptob"] [sub_resource type="WorldBoundaryShape3D" id="WorldBoundaryShape3D_y41n8"] @@ -26,6 +27,8 @@ albedo_color = Color(0.490196, 0, 0.686275, 1) [sub_resource type="StandardMaterial3D" id="StandardMaterial3D_l2jpa"] albedo_color = Color(1, 0, 0, 1) +[sub_resource type="CapsuleShape3D" id="CapsuleShape3D_cptob"] + [node name="Node3D" type="Node3D"] [node name="level" parent="." instance=ExtResource("2_i3oty")] @@ -98,12 +101,19 @@ text = "door key" font_size = 128 outline_size = 32 -[node name="Target" type="Node3D" parent="."] +[node name="Target" type="StaticBody3D" parent="."] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -6, 1, -6) +[node name="Health" type="Node" parent="Target"] +script = ExtResource("8_cptob") +metadata/_custom_type_script = "uid://bccrrtp3mlw5i" + [node name="MeshInstance3D" type="MeshInstance3D" parent="Target"] mesh = SubResource("CapsuleMesh_8d4wu") surface_material_override/0 = SubResource("StandardMaterial3D_l2jpa") +[node name="CollisionShape3D" type="CollisionShape3D" parent="Target"] +shape = SubResource("CapsuleShape3D_cptob") + [connection signal="interacted" from="Door/Interactable" to="Door" method="open"] [connection signal="interacted" from="DoorKey/Area3D" to="DoorKey" method="add_to_inventory"] diff --git a/scenes/player.tscn b/scenes/player.tscn index 90dae7a..1e98353 100644 --- a/scenes/player.tscn +++ b/scenes/player.tscn @@ -4,7 +4,7 @@ [ext_resource type="Script" uid="uid://hm6oqbvcmigk" path="res://src/player_animation.ts" id="3_26yay"] [ext_resource type="Script" uid="uid://ny0p0jkmlrv8" path="res://src/player_input.ts" id="3_x6527"] [ext_resource type="Script" uid="uid://kjthk4tj8qof" path="res://src/interactor.ts" id="5_uk7c1"] -[ext_resource type="Script" uid="uid://dkvbawcldnok5" path="res://src/equipped_weapon.ts" id="6_eg2om"] +[ext_resource type="Script" uid="uid://dkvbawcldnok5" path="res://src/equipped_weapon.ts" id="6_fjrip"] [ext_resource type="Script" uid="uid://dbrjcvaqkca21" path="res://src/inventory.ts" id="6_jscba"] [ext_resource type="PackedScene" uid="uid://sgc1gxq4osag" path="res://scenes/player_mesh3.tscn" id="7_fjrip"] @@ -131,63 +131,8 @@ script = ExtResource("2_pdrhn") [node name="Mesh" parent="." instance=ExtResource("7_fjrip")] -[node name="Skeleton3D" parent="Mesh/AuxScene/Scene/Armature" index="0"] -bones/0/position = Vector3(-1.34296, 99.233, 1.4959) -bones/0/rotation = Quaternion(0.0438457, -0.453154, -0.0426107, 0.889333) -bones/2/rotation = Quaternion(-0.0580086, 0.0574482, 0.0299733, 0.996211) -bones/4/rotation = Quaternion(0.023142, 0.0682831, 0.00805779, 0.997365) -bones/6/rotation = Quaternion(0.0366486, 0.0685247, 0.00561944, 0.99696) -bones/8/rotation = Quaternion(-0.412947, 0.510846, -0.570029, -0.493537) -bones/10/rotation = Quaternion(0.366708, 0.091387, -0.824325, 0.421499) -bones/12/rotation = Quaternion(-3.39933e-08, 5.02926e-08, -0.244577, 0.96963) -bones/14/rotation = Quaternion(-0.218999, 0.389096, 0.162682, 0.879874) -bones/16/rotation = Quaternion(0.491661, 0.0186145, 0.04132, 0.869607) -bones/18/rotation = Quaternion(0.583947, 9.22009e-08, 0.0475734, 0.810396) -bones/20/rotation = Quaternion(0.435138, -7.46222e-08, 0.03545, 0.899666) -bones/24/rotation = Quaternion(0.430214, -0.0354484, 0.142206, 0.89075) -bones/26/rotation = Quaternion(0.825171, 1.546e-07, 0.0672255, 0.560868) -bones/28/rotation = Quaternion(0.16276, -6.10016e-08, 0.0132598, 0.986577) -bones/32/rotation = Quaternion(0.478969, 0.00176994, 0.0701699, 0.875021) -bones/34/rotation = Quaternion(0.753736, -9.22009e-08, 0.0614057, 0.654303) -bones/36/rotation = Quaternion(0.4171, 5.03496e-09, 0.0339805, 0.908225) -bones/40/rotation = Quaternion(0.21981, 0.00370957, 0.0385759, 0.974773) -bones/42/rotation = Quaternion(0.420375, -1.93715e-07, 0.0342473, 0.906704) -bones/44/rotation = Quaternion(0.430986, -3.23344e-08, 0.0351118, 0.901675) -bones/48/rotation = Quaternion(0.349343, 0.0283774, -0.150582, 0.92438) -bones/50/rotation = Quaternion(-0.112075, -0.188988, 0.210821, 0.952511) -bones/52/rotation = Quaternion(-0.271577, -0.018948, 0.408217, 0.871347) -bones/56/rotation = Quaternion(0.103598, 0.0666441, -0.0240849, 0.992092) -bones/58/rotation = Quaternion(0.00749621, 0.164595, 0.0896287, 0.982252) -bones/61/rotation = Quaternion(-0.515646, -0.558738, 0.572809, -0.306285) -bones/63/rotation = Quaternion(0.255191, -0.248185, 0.504518, 0.786602) -bones/65/rotation = Quaternion(-4.35393e-08, 4.86605e-09, 0.655273, 0.755392) -bones/67/rotation = Quaternion(-0.18199, -0.388089, -0.336697, 0.838393) -bones/69/rotation = Quaternion(0.128107, -0.173846, 0.152522, 0.964419) -bones/71/rotation = Quaternion(-0.0940495, 0.0712352, 0.0315575, 0.992514) -bones/73/rotation = Quaternion(0.0268879, 0.0186427, 0.218404, 0.97531) -bones/77/rotation = Quaternion(0.271488, -0.0129037, -0.019735, 0.962153) -bones/79/rotation = Quaternion(0.51229, -8.40984e-07, -0.0524978, 0.857207) -bones/81/rotation = Quaternion(0.207034, -1.16677e-07, -0.0212163, 0.978104) -bones/85/rotation = Quaternion(0.354152, -0.0251767, -0.00660215, 0.934826) -bones/87/rotation = Quaternion(0.500314, -8.10251e-07, -0.0512706, 0.864325) -bones/89/rotation = Quaternion(0.335131, -4.84986e-07, -0.0343432, 0.941546) -bones/93/rotation = Quaternion(0.420833, -0.0472764, 0.0235745, 0.905598) -bones/95/rotation = Quaternion(0.50818, -8.50763e-07, -0.0520767, 0.859675) -bones/97/rotation = Quaternion(0.173011, 1.41736e-08, -0.0177296, 0.98476) -bones/101/rotation = Quaternion(0.324573, -0.049477, 0.0773928, 0.94139) -bones/103/rotation = Quaternion(0.491491, -5.96046e-07, -0.0503663, 0.869425) -bones/105/rotation = Quaternion(0.273046, -6.9337e-07, -0.0279808, 0.961594) -bones/109/rotation = Quaternion(-0.127311, 0.113785, 0.983303, 0.0629229) -bones/111/rotation = Quaternion(-0.199275, -0.0738388, 0.000908459, 0.977157) -bones/113/rotation = Quaternion(0.503553, 0.125908, 0.0705691, 0.851823) -bones/115/rotation = Quaternion(0.335242, -6.35498e-08, 2.67434e-07, 0.942132) -bones/119/rotation = Quaternion(0.124542, 0.250518, 0.945838, -0.164682) -bones/121/rotation = Quaternion(-0.248302, -0.0864232, 0.020511, 0.964602) -bones/123/rotation = Quaternion(0.421959, -0.0804281, -0.0458337, 0.901877) -bones/125/rotation = Quaternion(0.335241, -2.57727e-08, 5.75265e-09, 0.942132) - [node name="RightHand" parent="Mesh/AuxScene/Scene/Armature/Skeleton3D" index="2"] -transform = Transform3D(0.288251, 0.477446, -0.830034, 0.9427, 0.0105974, 0.333473, 0.168011, -0.878596, -0.447034, -2.98473, 141.91, 59.327) +transform = Transform3D(0.678924, 0.327226, -0.657255, 0.571861, 0.325755, 0.752899, 0.460473, -0.88702, 0.0340353, -5.60212, 89.2255, 32.2557) [node name="Node3D" type="Node3D" parent="Mesh/AuxScene/Scene/Armature/Skeleton3D/RightHand" index="0"] @@ -211,14 +156,6 @@ shape = SubResource("SphereShape3D_64co4") [node name="Inventory" type="Node" parent="."] script = ExtResource("6_jscba") -[node name="EquippedWeapon" type="Node" parent="."] -script = ExtResource("6_eg2om") -starting_weapon = "uid://c15pu3ela0g6k" -_transform_parent = NodePath("../Mesh/AuxScene/Scene/Armature/Skeleton3D/RightHand/Node3D") - -[node name="FireRate" type="Timer" parent="EquippedWeapon"] -one_shot = true - [node name="AnimationTree" type="AnimationTree" parent="."] root_node = NodePath("../Mesh") tree_root = SubResource("AnimationNodeStateMachine_5lvsk") @@ -230,4 +167,14 @@ parameters/Unarmed/blend_position = 0.872134 script = ExtResource("3_26yay") move_speed_expression = "move_speed()" +[node name="EquippedWeapon" type="Node3D" parent="."] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.5, 0.5) +script = ExtResource("6_fjrip") +starting_weapon = "uid://c15pu3ela0g6k" +_transform_parent = NodePath("../Mesh/AuxScene/Scene/Armature/Skeleton3D/RightHand/Node3D") +metadata/_custom_type_script = "uid://dkvbawcldnok5" + +[node name="FireRate" type="Timer" parent="EquippedWeapon"] +one_shot = true + [editable path="Mesh"] diff --git a/src/annotations.ts b/src/annotations.ts index 93da92b..fcad5f3 100644 --- a/src/annotations.ts +++ b/src/annotations.ts @@ -5,10 +5,11 @@ const get_node_from_key = (key: string, node: Node) => { const path = node.get(key) if (path == null) { - throw new Error(`${key} is null`) + console.warn(`${node.get_name()}::${key} is null, can't export node`) + return } - return node.get_node(path) + return node.get_node_or_null(path) } export function export_scene() { @@ -26,7 +27,7 @@ export function export_expression() { export function export_node(defaultNode?: string) { return function(target: T, key: string) { const meta_key = `_${key}` - //Reflect.set(target, meta_key, defaultNode || '') + Reflect.set(target, meta_key, defaultNode || '') export_(Variant.Type.TYPE_NODE_PATH)(target, meta_key) onready((node: Node) => get_node_from_key(meta_key, node))(target, key) @@ -57,7 +58,7 @@ export function onready( Reflect.defineProperty(target, '_ready', { value: function() { for (const { evaluator, property } of handlers) { - this[property] = evaluator(this) + this[property] = evaluator?.(this) } old_ready.call(this) diff --git a/src/debug_draw.ts b/src/debug_draw.ts index a0ac789..eb0b050 100644 --- a/src/debug_draw.ts +++ b/src/debug_draw.ts @@ -1,4 +1,4 @@ -import { BaseMaterial3D, Color, ImmediateMesh, Mesh, MeshInstance3D, Node, Node3D, PackedVector3Array, StandardMaterial3D, Vector3 } from 'godot' +import { BaseMaterial3D, Color, ImmediateMesh, Mesh, MeshInstance3D, Node, Node3D, PackedVector3Array, PhysicsRayQueryParameters3D, StandardMaterial3D, Vector3 } from 'godot' function createDefaultMaterial(): StandardMaterial3D { const material = new StandardMaterial3D() @@ -84,6 +84,10 @@ export default class DebugDraw extends Node { DebugDraw.instance._draw_lines(points, color) } + static draw_ray(query: PhysicsRayQueryParameters3D, color: Color = Color.CYAN) { + DebugDraw.draw_line(query.from, query.to, color) + } + _draw_lines(points: PackedVector3Array, color: Color = Color.CYAN) { const instance = this.pool.get() const mesh = instance.instance.mesh as ImmediateMesh @@ -94,7 +98,7 @@ export default class DebugDraw extends Node { const len = points.size() for (let i = 0; i < len; i++) { - mesh.surface_add_vertex(points.get_indexed(i)) + mesh.surface_add_vertex(points.get(i)) } mesh.surface_end() diff --git a/src/entity.ts.uid b/src/entity.ts.uid new file mode 100644 index 0000000..5226e1f --- /dev/null +++ b/src/entity.ts.uid @@ -0,0 +1 @@ +uid://dk1oc431swny1 diff --git a/src/equipped_weapon.ts b/src/equipped_weapon.ts index 02002c2..3804c73 100644 --- a/src/equipped_weapon.ts +++ b/src/equipped_weapon.ts @@ -1,16 +1,22 @@ -import { GArray, Node, Node3D, PackedScene, Signal1, Timer, Vector3 } from 'godot' +import { Color, GArray, Node, Node3D, PackedScene, PhysicsBody3D, PhysicsRayQueryParameters3D, Signal1, Timer, Vector3 } from 'godot' import { export_file, signal } from 'godot.annotations' import { export_node, onready } from './annotations' import Weapon from './weapon' import AsyncResourceLoader from './async_resource_loader' +import { forward } from './vec' +import DebugDraw from './debug_draw' +import { find_in_anscestors, find_in_descendents, implements_interface } from './node' +import { Damageable } from './health' -export default class EquippedWeapon extends Node { +const { MULTIPLY: mul, ADD: add } = Vector3 + +export default class EquippedWeapon extends Node3D { @export_file('*.tres') starting_weapon?: string _starting_weapon?: Weapon @export_node() - transform_parent!: Node + transform_parent!: Node3D _equipped_weapon?: Weapon _has_equipped_weapon: boolean = false @@ -69,8 +75,24 @@ export default class EquippedWeapon extends Node { } fire(): boolean { - if (this._fire_rate_timer.time_left <= 0) { + if (this._equipped_weapon && this._fire_rate_timer.time_left <= 0) { this._fire_rate_timer.start() + const space_state = this.get_world_3d().direct_space_state + const origin = this.global_position + const end = add(origin, mul(forward(this.global_transform), this._equipped_weapon.range)) + const query = PhysicsRayQueryParameters3D.create(origin, end) + const result = space_state.intersect_ray(query) + + if (!result.is_empty()) { + DebugDraw.draw_ray(query, Color.DARK_RED) + const root = find_in_anscestors(result.get('collider'), n => n instanceof PhysicsBody3D) + const health = find_in_descendents(root, n => implements_interface(['apply_damage'], n)) + if (health != null) { + health.apply_damage(this, this._equipped_weapon.damage) + } + } else { + DebugDraw.draw_ray(query, Color.DARK_GREEN) + } return true } else { return false diff --git a/src/health.ts b/src/health.ts index f1f229c..b47c086 100644 --- a/src/health.ts +++ b/src/health.ts @@ -16,6 +16,10 @@ export default class Health extends Node implements Damageable, Recoverable { @export_(Variant.Type.TYPE_FLOAT) private _current_health: number = 0 + _ready() { + this._current_health = this._max_health + } + apply_damage(_source: any, amount: number): void { this._current_health = Math.max(0, this._current_health - amount) } diff --git a/src/node.ts b/src/node.ts new file mode 100644 index 0000000..c6409f4 --- /dev/null +++ b/src/node.ts @@ -0,0 +1,48 @@ +import { GArray, Node, Object, StringName } from 'godot' + +interface Predicate { + (value: T): boolean +} + +export function queue_free_children(node: T) { + const children: GArray = node.get_children() + for (const child of children) { + child.queue_free() + } +} + +export function implements_interface(method_names: StringName[], obj: Object): obj is Object & T { + return method_names.every(name => obj.has_method(name)) +} + +export function find_in_anscestors(root: T | null | undefined, predicate: Predicate, height: number = Infinity): T | null | undefined { + if (height < 0 || root == null) { + return + } + + if (predicate(root)) { + return root + } + + return find_in_anscestors(root.get_parent(), predicate, height - 1) as T +} + +export function find_in_descendents(root: T, predicate: Predicate, depth: number = Infinity): T | null | undefined { + if (depth < 0) { + return + } + + if (predicate(root)) { + return root + } + + const count = root.get_child_count() + for (let i = 0; i < count; i++) { + const child = root.get_child(i) + const found = find_in_descendents(child, predicate, depth - 1) + + if (found != null) { + return found as T + } + } +} diff --git a/src/vec.ts b/src/vec.ts new file mode 100644 index 0000000..225a815 --- /dev/null +++ b/src/vec.ts @@ -0,0 +1,6 @@ +import { Transform3D, Vector3 } from 'godot' + +export function forward(transform: Transform3D): Vector3 { + return transform.basis.z +} + diff --git a/src/vec.ts.uid b/src/vec.ts.uid new file mode 100644 index 0000000..5c0fe3f --- /dev/null +++ b/src/vec.ts.uid @@ -0,0 +1 @@ +uid://gi1kkj5kpt63 diff --git a/src/weapon.ts b/src/weapon.ts index 16a4dfa..1fd5866 100644 --- a/src/weapon.ts +++ b/src/weapon.ts @@ -7,6 +7,12 @@ export default class Weapon extends Item { @export_scene() readonly scene!: string + @export_(Variant.Type.TYPE_FLOAT) + readonly damage: number = 1 + + @export_(Variant.Type.TYPE_FLOAT) + readonly range: number = 100 + @export_(Variant.Type.TYPE_FLOAT) readonly fire_rate!: number diff --git a/tsconfig.json b/tsconfig.json index 81c6899..24032f0 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -14,7 +14,7 @@ "target": "es2016", /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */ // "lib": [], /* Specify a set of bundled library declaration files that describe the target runtime environment. */ // "jsx": "preserve", /* Specify what JSX code is generated. */ - "experimentalDecorators": true, /* Enable experimental support for legacy experimental decorators. */ + "experimentalDecorators": true, /* Enable experimental support for legacy experimental decorators. */ // "emitDecoratorMetadata": true, /* Emit design-type metadata for decorated declarations in source files. */ // "jsxFactory": "", /* Specify the JSX factory function used when targeting React JSX emit, e.g. 'React.createElement' or 'h'. */ // "jsxFragmentFactory": "", /* Specify the JSX Fragment reference used for fragments when targeting React JSX emit e.g. 'React.Fragment' or 'Fragment'. */ @@ -26,7 +26,7 @@ /* Modules */ "module": "CommonJS", /* Specify what module code is generated. */ - "rootDir": "./", /* Specify the root folder within your source files. */ + "rootDir": "./", /* Specify the root folder within your source files. */ // "moduleResolution": "node10", /* Specify how TypeScript looks up a file from a given module specifier. */ // "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */ // "paths": {}, /* Specify a set of entries that re-map imports to additional lookup locations. */ @@ -55,13 +55,13 @@ /* Emit */ // "declaration": true, /* Generate .d.ts files from TypeScript and JavaScript files in your project. */ // "declarationMap": true, /* Create sourcemaps for d.ts files. */ - "emitDeclarationOnly": false, /* Only output d.ts files and not JavaScript files. */ + // "emitDeclarationOnly": true, /* Only output d.ts files and not JavaScript files. */ "sourceMap": true, /* Create source map files for emitted JavaScript files. */ // "inlineSourceMap": true, /* Include sourcemap files inside the emitted JavaScript. */ // "outFile": "./", /* Specify a file that bundles all outputs into one JavaScript file. If 'declaration' is true, also designates a file that bundles all .d.ts output. */ "outDir": ".godot/GodotJS", /* Specify an output folder for all emitted files. */ // "removeComments": true, /* Disable emitting comments. */ - "noEmit": false, /* Disable emitting files from a compilation. */ + // "noEmit": true, /* Disable emitting files from a compilation. */ // "importHelpers": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */ // "importsNotUsedAsValues": "remove", /* Specify emit/checking behavior for imports that are only used for types. */ // "downlevelIteration": true, /* Emit more compliant, but verbose and less performant JavaScript for iteration. */ diff --git a/typings/addons/dev_console/console.nodes.gen.d.ts b/typings/addons/dev_console/console.nodes.gen.d.ts index 8824e0a..16acdf7 100644 --- a/typings/addons/dev_console/console.nodes.gen.d.ts +++ b/typings/addons/dev_console/console.nodes.gen.d.ts @@ -8,7 +8,7 @@ declare module "godot" { { Output: RichTextLabel< { - "@VScrollBar@46002": VScrollBar<{}>, + "@VScrollBar@22678": VScrollBar<{}>, } >, Input: LineEdit< diff --git a/typings/addons/dev_console/output_line.nodes.gen.d.ts b/typings/addons/dev_console/output_line.nodes.gen.d.ts new file mode 100644 index 0000000..b94c8ce --- /dev/null +++ b/typings/addons/dev_console/output_line.nodes.gen.d.ts @@ -0,0 +1,7 @@ +declare module "godot" { + interface SceneNodes { + "addons/dev_console/output_line.tscn": { + "@VScrollBar@22679": VScrollBar<{}>, + }, + } +} diff --git a/typings/assets/Glock 17 Gen 4/Glock17.fbx b/typings/assets/Glock 17 Gen 4/Glock17.fbx new file mode 100644 index 0000000..faed2ae --- /dev/null +++ b/typings/assets/Glock 17 Gen 4/Glock17.fbx @@ -0,0 +1,13 @@ +declare module "godot" { + interface SceneNodes { + "assets/Glock 17 Gen 4/Glock17.fbx": { + Slide: MeshInstance3D<{}>, + Reference: Node3D<{}>, + Receiver: MeshInstance3D<{}>, + Trigger: MeshInstance3D<{}>, + "Internal Chamber in Slide": MeshInstance3D<{}>, + Cylinder: MeshInstance3D<{}>, + Magazine: MeshInstance3D<{}>, + }, + } +} diff --git a/typings/assets/Glock 17 Gen 4/MagazineOnly.blend b/typings/assets/Glock 17 Gen 4/MagazineOnly.blend new file mode 100644 index 0000000..b41477e --- /dev/null +++ b/typings/assets/Glock 17 Gen 4/MagazineOnly.blend @@ -0,0 +1,8 @@ +declare module "godot" { + interface SceneNodes { + "assets/Glock 17 Gen 4/MagazineOnly.blend": { + Reference: Node3D<{}>, + Model_0: MeshInstance3D<{}>, + }, + } +} diff --git a/typings/assets/Glock 17 Gen 4/MagazineOnly.fbx b/typings/assets/Glock 17 Gen 4/MagazineOnly.fbx new file mode 100644 index 0000000..81b6a54 --- /dev/null +++ b/typings/assets/Glock 17 Gen 4/MagazineOnly.fbx @@ -0,0 +1,8 @@ +declare module "godot" { + interface SceneNodes { + "assets/Glock 17 Gen 4/MagazineOnly.fbx": { + Reference: Node3D<{}>, + Model_0: MeshInstance3D<{}>, + }, + } +} diff --git a/typings/assets/Glock 17 Gen 4/Main.blend b/typings/assets/Glock 17 Gen 4/Main.blend new file mode 100644 index 0000000..c0fc0e1 --- /dev/null +++ b/typings/assets/Glock 17 Gen 4/Main.blend @@ -0,0 +1,13 @@ +declare module "godot" { + interface SceneNodes { + "assets/Glock 17 Gen 4/Main.blend": { + Slide: MeshInstance3D<{}>, + Reference: Node3D<{}>, + Receiver: MeshInstance3D<{}>, + Trigger: MeshInstance3D<{}>, + "Internal Chamber in Slide": MeshInstance3D<{}>, + Cylinder: MeshInstance3D<{}>, + Magazine: MeshInstance3D<{}>, + }, + } +} diff --git a/typings/assets/Glock 17 Gen 4/Main.glb b/typings/assets/Glock 17 Gen 4/Main.glb new file mode 100644 index 0000000..9883593 --- /dev/null +++ b/typings/assets/Glock 17 Gen 4/Main.glb @@ -0,0 +1,13 @@ +declare module "godot" { + interface SceneNodes { + "assets/Glock 17 Gen 4/Main.glb": { + Slide: MeshInstance3D<{}>, + Reference: Node3D<{}>, + Receiver: MeshInstance3D<{}>, + Trigger: MeshInstance3D<{}>, + "Internal Chamber in Slide": MeshInstance3D<{}>, + Cylinder: MeshInstance3D<{}>, + Magazine: MeshInstance3D<{}>, + }, + } +} diff --git a/typings/assets/level.glb b/typings/assets/level.glb new file mode 100644 index 0000000..603594b --- /dev/null +++ b/typings/assets/level.glb @@ -0,0 +1,9 @@ +declare module "godot" { + interface SceneNodes { + "assets/level.glb": { + Plane: MeshInstance3D<{}>, + Cube: MeshInstance3D<{}>, + Cube_001: MeshInstance3D<{}>, + }, + } +} diff --git a/typings/assets/player.glb b/typings/assets/player.glb new file mode 100644 index 0000000..471053a --- /dev/null +++ b/typings/assets/player.glb @@ -0,0 +1,17 @@ +declare module "godot" { + interface SceneNodes { + "assets/player.glb": { + Armature: Node3D< + { + Skeleton3D: Skeleton3D< + { + Beta_Joints: MeshInstance3D<{}>, + Beta_Surface: MeshInstance3D<{}>, + } + >, + } + >, + AnimationPlayer: AnimationPlayer<{}>, + }, + } +} diff --git a/typings/assets/player2.glb b/typings/assets/player2.glb new file mode 100644 index 0000000..3370fcd --- /dev/null +++ b/typings/assets/player2.glb @@ -0,0 +1,25 @@ +declare module "godot" { + interface SceneNodes { + "assets/player2.glb": { + AuxScene: Node3D< + { + Scene: Node3D< + { + Armature: Node3D< + { + Skeleton3D: Skeleton3D< + { + Beta_Joints: MeshInstance3D<{}>, + Beta_Surface: MeshInstance3D<{}>, + } + >, + } + >, + } + >, + } + >, + AnimationPlayer: AnimationPlayer<{}>, + }, + } +} diff --git a/typings/godot.mix.d.ts b/typings/godot.mix.d.ts index 0e1581f..9d8e1ba 100644 --- a/typings/godot.mix.d.ts +++ b/typings/godot.mix.d.ts @@ -1,5 +1,8 @@ /// declare module "godot" { + export const IntegerType: unique symbol; + export const FloatType: unique symbol; + /** A built-in type representing a method or a standalone function. * * @link https://docs.godotengine.org/en/4.2/classes/class_callable.html @@ -183,4 +186,72 @@ declare module "godot" { as_promise(): Promise; } -} \ No newline at end of file + type NodePathMap = { [K in string]?: Node }; + + type StaticNodePath = (keyof Map & string) | { + [K in keyof Map & string]: Map[K] extends Node + ? `${K}/${StaticNodePath}` + : never + }[keyof Map & string]; + + type ResolveNodePath = Path extends keyof Map + ? Map[Path] + : Path extends `${infer Key extends keyof Map & string}/${infer SubPath}` + ? Map[Key] extends Node + ? ResolveNodePath + : Default + : Default; + + /** + * GArray elements are exposed with a subset of JavaScript's standard Array API. Array indexes are exposed as + * enumerable properties, thus if you want to perform more complex operations you can convert to a regular + * JavaScript array with [...g_array.proxy()]. + */ + class GArrayProxy { + [Symbol.iterator](): IteratorObject>; + /** + * Gets the length of the array. This is a number one higher than the highest index in the array. + */ + get length(): number; + /** + * Removes the last element from an array and returns it. + * If the array is empty, undefined is returned and the array is not modified. + */ + pop(): T | undefined; + /** + * Appends new elements to the end of an array, and returns the new length of the array. + * @param items New elements to add to the array. + */ + push(...items: Array>): number; + /** + * Returns the index of the first occurrence of a value in an array, or -1 if it is not present. + * @param searchElement The value to locate in the array. + * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the search starts at index 0. + */ + indexOf(searchElement: T, fromIndex?: number): number; + /** + * Determines whether an array includes a certain element, returning true or false as appropriate. + * @param searchElement The element to search for. + */ + includes(searchElement: T): boolean; + toJSON(key?: any): any; + toString(): string; + [n: number]: T | GProxyValueWrap; // More accurate get type blocked by https://github.com/microsoft/TypeScript/issues/43826 + } + + // Ideally this would be a class, but TS currently doesn't provide a way to type a class with mapped properties. + /** + * GObject entries are exposed as enumerable properties, so Object.keys(), Object.entries() etc. will work. + */ + type GDictionaryProxy = { + [K in keyof T & string]: T[K] | GProxyValueWrap; // More accurate get type blocked by https://github.com/microsoft/TypeScript/issues/43826 + } & ('toString' extends keyof T ? {} : { + toString(): string; + }); + + type GProxyValueWrap = V extends GArray + ? GArrayProxy + : V extends GDictionary + ? GDictionaryProxy + : V; +} diff --git a/typings/godot0.gen.d.ts b/typings/godot0.gen.d.ts index 590af7f..5c11437 100644 --- a/typings/godot0.gen.d.ts +++ b/typings/godot0.gen.d.ts @@ -111,13 +111,31 @@ declare module "godot" { /** Number of navigation mesh polygon edges that could not be merged in the [NavigationServer3D]. The edges still may be connected by edge proximity or with links. */ NAVIGATION_EDGE_FREE_COUNT = 32, + /** Number of active navigation obstacles in the [NavigationServer3D]. */ + NAVIGATION_OBSTACLE_COUNT = 33, + + /** Number of pipeline compilations that were triggered by the 2D canvas renderer. */ + PIPELINE_COMPILATIONS_CANVAS = 34, + + /** Number of pipeline compilations that were triggered by loading meshes. These compilations will show up as longer loading times the first time a user runs the game and the pipeline is required. */ + PIPELINE_COMPILATIONS_MESH = 35, + + /** Number of pipeline compilations that were triggered by building the surface cache before rendering the scene. These compilations will show up as a stutter when loading an scene the first time a user runs the game and the pipeline is required. */ + PIPELINE_COMPILATIONS_SURFACE = 36, + + /** Number of pipeline compilations that were triggered while drawing the scene. These compilations will show up as stutters during gameplay the first time a user runs the game and the pipeline is required. */ + PIPELINE_COMPILATIONS_DRAW = 37, + + /** Number of pipeline compilations that were triggered to optimize the current scene. These compilations are done in the background and should not cause any stutters whatsoever. */ + PIPELINE_COMPILATIONS_SPECIALIZATION = 38, + /** Represents the size of the [enum Monitor] enum. */ - MONITOR_MAX = 33, + MONITOR_MAX = 39, } } /** Exposes performance-related data. * - * @link https://docs.godotengine.org/en/4.3/classes/class_performance.html + * @link https://docs.godotengine.org/en/4.4/classes/class_performance.html */ class Performance extends Object { /** Returns the value of one of the available built-in monitors. You should provide one of the [enum Monitor] constants as the argument, like this: @@ -148,106 +166,229 @@ declare module "godot" { /** Returns the names of active custom monitors in an [Array]. */ static get_custom_monitor_names(): GArray } - // _singleton_class_: TextServerManager - /** A singleton for managing [TextServer] implementations. + // _singleton_class_: Engine + /** Provides access to engine properties. * - * @link https://docs.godotengine.org/en/4.3/classes/class_textservermanager.html + * @link https://docs.godotengine.org/en/4.4/classes/class_engine.html */ - class TextServerManager extends Object { - /** Registers a [TextServer] interface. */ - static add_interface(interface: TextServer): void + class Engine extends Object { + /** Returns the fraction through the current physics tick we are at the time of rendering the frame. This can be used to implement fixed timestep interpolation. */ + static get_physics_interpolation_fraction(): float64 - /** Returns the number of interfaces currently registered. */ - static get_interface_count(): int64 - - /** Removes an interface. All fonts and shaped text caches should be freed before removing an interface. */ - static remove_interface(interface: TextServer): void - - /** Returns the interface registered at a given index. */ - static get_interface(idx: int64): TextServer - - /** Returns a list of available interfaces, with the index and name of each interface. */ - static get_interfaces(): GArray - - /** Finds an interface by its [param name]. */ - static find_interface(name: string): TextServer - - /** Sets the primary [TextServer] interface. */ - static set_primary_interface(index: TextServer): void - - /** Returns the primary [TextServer] interface currently in use. */ - static get_primary_interface(): TextServer - - /** Emitted when a new interface has been added. */ - static readonly interface_added: Signal1 - - /** Emitted when an interface is removed. */ - static readonly interface_removed: Signal1 - } - // _singleton_class_: PhysicsServer2DManager - /** A singleton for managing [PhysicsServer2D] implementations. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_physicsserver2dmanager.html - */ - class PhysicsServer2DManager extends Object { - /** Register a [PhysicsServer2D] implementation by passing a [param name] and a [Callable] that returns a [PhysicsServer2D] object. */ - static register_server(name: string, create_callback: Callable): void - - /** Set the default [PhysicsServer2D] implementation to the one identified by [param name], if [param priority] is greater than the priority of the current default implementation. */ - static set_default_server(name: string, priority: int64): void - } - // _singleton_class_: PhysicsServer3DManager - /** A singleton for managing [PhysicsServer3D] implementations. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_physicsserver3dmanager.html - */ - class PhysicsServer3DManager extends Object { - /** Register a [PhysicsServer3D] implementation by passing a [param name] and a [Callable] that returns a [PhysicsServer3D] object. */ - static register_server(name: string, create_callback: Callable): void - - /** Set the default [PhysicsServer3D] implementation to the one identified by [param name], if [param priority] is greater than the priority of the current default implementation. */ - static set_default_server(name: string, priority: int64): void - } - // _singleton_class_: NavigationMeshGenerator - /** Helper class for creating and clearing navigation meshes. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_navigationmeshgenerator.html - */ - class NavigationMeshGenerator extends Object { - /** Bakes the [param navigation_mesh] with source geometry collected starting from the [param root_node]. */ - static bake(navigation_mesh: NavigationMesh, root_node: Node): void - - /** Removes all polygons and vertices from the provided [param navigation_mesh] resource. */ - static clear(navigation_mesh: NavigationMesh): void - - /** Parses the [SceneTree] for source geometry according to the properties of [param navigation_mesh]. Updates the provided [param source_geometry_data] resource with the resulting data. The resource can then be used to bake a navigation mesh with [method bake_from_source_geometry_data]. After the process is finished the optional [param callback] will be called. + /** Returns the total number of frames drawn since the engine started. * - * **Note:** This function needs to run on the main thread or with a deferred call as the SceneTree is not thread-safe. - * **Performance:** While convenient, reading data arrays from [Mesh] resources can affect the frame rate negatively. The data needs to be received from the GPU, stalling the [RenderingServer] in the process. For performance prefer the use of e.g. collision shapes or creating the data arrays entirely in code. + * **Note:** On headless platforms, or if rendering is disabled with `--disable-render-loop` via command line, this method always returns `0`. See also [method get_process_frames]. */ - static parse_source_geometry_data(navigation_mesh: NavigationMesh, source_geometry_data: NavigationMeshSourceGeometryData3D, root_node: Node, callback: Callable = new Callable()): void + static get_frames_drawn(): int64 - /** Bakes the provided [param navigation_mesh] with the data from the provided [param source_geometry_data]. After the process is finished the optional [param callback] will be called. */ - static bake_from_source_geometry_data(navigation_mesh: NavigationMesh, source_geometry_data: NavigationMeshSourceGeometryData3D, callback: Callable = new Callable()): void + /** Returns the average frames rendered every second (FPS), also known as the framerate. */ + static get_frames_per_second(): float64 + + /** Returns the total number of frames passed since the engine started. This number is increased every **physics frame**. See also [method get_process_frames]. + * This method can be used to run expensive logic less often without relying on a [Timer]: + * + */ + static get_physics_frames(): int64 + + /** Returns the total number of frames passed since the engine started. This number is increased every **process frame**, regardless of whether the render loop is enabled. See also [method get_frames_drawn] and [method get_physics_frames]. + * This method can be used to run expensive logic less often without relying on a [Timer]: + * + */ + static get_process_frames(): int64 + + /** Returns the instance of the [MainLoop]. This is usually the main [SceneTree] and is the same as [method Node.get_tree]. + * + * **Note:** The type instantiated as the main loop can changed with [member ProjectSettings.application/run/main_loop_type]. + */ + static get_main_loop(): MainLoop + + /** Returns the current engine version information as a [Dictionary] containing the following entries: + * - `major` - Major version number as an int; + * - `minor` - Minor version number as an int; + * - `patch` - Patch version number as an int; + * - `hex` - Full version encoded as a hexadecimal int with one byte (2 hex digits) per number (see example below); + * - `status` - Status (such as "beta", "rc1", "rc2", "stable", etc.) as a String; + * - `build` - Build name (e.g. "custom_build") as a String; + * - `hash` - Full Git commit hash as a String; + * - `timestamp` - Holds the Git commit date UNIX timestamp in seconds as an int, or `0` if unavailable; + * - `string` - `major`, `minor`, `patch`, `status`, and `build` in a single String. + * The `hex` value is encoded as follows, from left to right: one byte for the major, one byte for the minor, one byte for the patch version. For example, "3.1.12" would be `0x03010C`. + * + * **Note:** The `hex` value is still an [int] internally, and printing it will give you its decimal representation, which is not particularly meaningful. Use hexadecimal literals for quick version comparisons from code: + * + */ + static get_version_info(): GDictionary + + /** Returns the engine author information as a [Dictionary], where each entry is an [Array] of strings with the names of notable contributors to the Godot Engine: `lead_developers`, `founders`, `project_managers`, and `developers`. */ + static get_author_info(): GDictionary + + /** Returns an [Array] of dictionaries with copyright information for every component of Godot's source code. + * Every [Dictionary] contains a `name` identifier, and a `parts` array of dictionaries. It describes the component in detail with the following entries: + * - `files` - [Array] of file paths from the source code affected by this component; + * - `copyright` - [Array] of owners of this component; + * - `license` - The license applied to this component (such as "[url=https://en.wikipedia.org/wiki/MIT_License#Ambiguity_and_variants]Expat[/url]" or "[url=https://creativecommons.org/licenses/by/4.0/]CC-BY-4.0[/url]"). + */ + static get_copyright_info(): GArray + + /** Returns a [Dictionary] of categorized donor names. Each entry is an [Array] of strings: + * {`platinum_sponsors`, `gold_sponsors`, `silver_sponsors`, `bronze_sponsors`, `mini_sponsors`, `gold_donors`, `silver_donors`, `bronze_donors`} + */ + static get_donor_info(): GDictionary + + /** Returns a [Dictionary] of licenses used by Godot and included third party components. Each entry is a license name (such as "[url=https://en.wikipedia.org/wiki/MIT_License#Ambiguity_and_variants]Expat[/url]") and its associated text. */ + static get_license_info(): GDictionary + + /** Returns the full Godot license text. */ + static get_license_text(): string + + /** Returns the name of the CPU architecture the Godot binary was built for. Possible return values include `"x86_64"`, `"x86_32"`, `"arm64"`, `"arm32"`, `"rv64"`, `"riscv"`, `"ppc64"`, `"ppc"`, `"wasm64"`, and `"wasm32"`. + * To detect whether the current build is 64-bit, or the type of architecture, don't use the architecture name. Instead, use [method OS.has_feature] to check for the `"64"` feature tag, or tags such as `"x86"` or `"arm"`. See the [url=https://docs.godotengine.org/en/4.4/tutorials/export/feature_tags.html]Feature Tags[/url] documentation for more details. + * + * **Note:** This method does *not* return the name of the system's CPU architecture (like [method OS.get_processor_name]). For example, when running an `x86_32` Godot binary on an `x86_64` system, the returned value will still be `"x86_32"`. + */ + static get_architecture_name(): string + + /** Returns `true` if the engine is inside the fixed physics process step of the main loop. + * + */ + static is_in_physics_frame(): boolean + + /** Returns `true` if a singleton with the given [param name] exists in the global scope. See also [method get_singleton]. + * + * + * **Note:** Global singletons are not the same as autoloaded nodes, which are configurable in the project settings. + */ + static has_singleton(name: StringName): boolean + + /** Returns the global singleton with the given [param name], or `null` if it does not exist. Often used for plugins. See also [method has_singleton] and [method get_singleton_list]. + * + * **Note:** Global singletons are not the same as autoloaded nodes, which are configurable in the project settings. + */ + static get_singleton(name: StringName): Object + + /** Registers the given [Object] [param instance] as a singleton, available globally under [param name]. Useful for plugins. */ + static register_singleton(name: StringName, instance: Object): void + + /** Removes the singleton registered under [param name]. The singleton object is *not* freed. Only works with user-defined singletons registered with [method register_singleton]. */ + static unregister_singleton(name: StringName): void + + /** Returns a list of names of all available global singletons. See also [method get_singleton]. */ + static get_singleton_list(): PackedStringArray + + /** Registers a [ScriptLanguage] instance to be available with `ScriptServer`. + * Returns: + * - [constant OK] on success; + * - [constant ERR_UNAVAILABLE] if `ScriptServer` has reached the limit and cannot register any new language; + * - [constant ERR_ALREADY_EXISTS] if `ScriptServer` already contains a language with similar extension/name/type. + */ + static register_script_language(language: ScriptLanguage): GError + + /** Unregisters the [ScriptLanguage] instance from `ScriptServer`. + * Returns: + * - [constant OK] on success; + * - [constant ERR_DOES_NOT_EXIST] if the language is not registered in `ScriptServer`. + */ + static unregister_script_language(language: ScriptLanguage): GError + + /** Returns the number of available script languages. Use with [method get_script_language]. */ + static get_script_language_count(): int64 + + /** Returns an instance of a [ScriptLanguage] with the given [param index]. */ + static get_script_language(index: int64): ScriptLanguage + + /** Returns `true` if the script is currently running inside the editor, otherwise returns `false`. This is useful for `@tool` scripts to conditionally draw editor helpers, or prevent accidentally running "game" code that would affect the scene state while in the editor: + * + * See [url=https://docs.godotengine.org/en/4.4/tutorials/plugins/running_code_in_the_editor.html]Running code in the editor[/url] in the documentation for more information. + * + * **Note:** To detect whether the script is running on an editor *build* (such as when pressing [kbd]F5[/kbd]), use [method OS.has_feature] with the `"editor"` argument instead. `OS.has_feature("editor")` evaluate to `true` both when the script is running in the editor and when running the project from the editor, but returns `false` when run from an exported project. + */ + static is_editor_hint(): boolean + + /** Returns `true` if the engine is running embedded in the editor. This is useful to prevent attempting to update window mode or window flags that are not supported when running the project embedded in the editor. */ + static is_embedded_in_editor(): boolean + + /** Returns the path to the [MovieWriter]'s output file, or an empty string if the engine wasn't started in Movie Maker mode. The default path can be changed in [member ProjectSettings.editor/movie_writer/movie_file]. */ + static get_write_movie_path(): string + + /** If `false`, stops printing error and warning messages to the console and editor Output log. This can be used to hide error and warning messages during unit test suite runs. This property is equivalent to the [member ProjectSettings.application/run/disable_stderr] project setting. + * + * **Note:** This property does not impact the editor's Errors tab when running a project from the editor. + * **Warning:** If set to `false` anywhere in the project, important error messages may be hidden even if they are emitted from other scripts. In a `@tool` script, this will also impact the editor itself. Do *not* report bugs before ensuring error messages are enabled (as they are by default). + */ + get print_error_messages(): boolean + set print_error_messages(value: boolean) + + /** If `false`, stops printing messages (for example using [method @GlobalScope.print]) to the console, log files, and editor Output log. This property is equivalent to the [member ProjectSettings.application/run/disable_stdout] project setting. + * + * **Note:** This does not stop printing errors or warnings produced by scripts to the console or log files, for more details see [member print_error_messages]. + */ + get print_to_stdout(): boolean + set print_to_stdout(value: boolean) + + /** The number of fixed iterations per second. This controls how often physics simulation and [method Node._physics_process] methods are run. This value should generally always be set to `60` or above, as Godot doesn't interpolate the physics step. As a result, values lower than `60` will look stuttery. This value can be increased to make input more reactive or work around collision tunneling issues, but keep in mind doing so will increase CPU usage. See also [member max_fps] and [member ProjectSettings.physics/common/physics_ticks_per_second]. + * + * **Note:** Only [member max_physics_steps_per_frame] physics ticks may be simulated per rendered frame at most. If more physics ticks have to be simulated per rendered frame to keep up with rendering, the project will appear to slow down (even if `delta` is used consistently in physics calculations). Therefore, it is recommended to also increase [member max_physics_steps_per_frame] if increasing [member physics_ticks_per_second] significantly above its default value. + */ + get physics_ticks_per_second(): int64 + set physics_ticks_per_second(value: int64) + + /** The maximum number of physics steps that can be simulated each rendered frame. + * + * **Note:** The default value is tuned to prevent expensive physics simulations from triggering even more expensive simulations indefinitely. However, the game will appear to slow down if the rendering FPS is less than `1 / max_physics_steps_per_frame` of [member physics_ticks_per_second]. This occurs even if `delta` is consistently used in physics calculations. To avoid this, increase [member max_physics_steps_per_frame] if you have increased [member physics_ticks_per_second] significantly above its default value. + */ + get max_physics_steps_per_frame(): int64 + set max_physics_steps_per_frame(value: int64) + + /** The maximum number of frames that can be rendered every second (FPS). A value of `0` means the framerate is uncapped. + * Limiting the FPS can be useful to reduce the host machine's power consumption, which reduces heat, noise emissions, and improves battery life. + * If [member ProjectSettings.display/window/vsync/vsync_mode] is **Enabled** or **Adaptive**, the setting takes precedence and the max FPS number cannot exceed the monitor's refresh rate. + * If [member ProjectSettings.display/window/vsync/vsync_mode] is **Enabled**, on monitors with variable refresh rate enabled (G-Sync/FreeSync), using an FPS limit a few frames lower than the monitor's refresh rate will [url=https://blurbusters.com/howto-low-lag-vsync-on/]reduce input lag while avoiding tearing[/url]. + * See also [member physics_ticks_per_second] and [member ProjectSettings.application/run/max_fps]. + * + * **Note:** The actual number of frames per second may still be below this value if the CPU or GPU cannot keep up with the project's logic and rendering. + * + * **Note:** If [member ProjectSettings.display/window/vsync/vsync_mode] is **Disabled**, limiting the FPS to a high value that can be consistently reached on the system can reduce input lag compared to an uncapped framerate. Since this works by ensuring the GPU load is lower than 100%, this latency reduction is only effective in GPU-bottlenecked scenarios, not CPU-bottlenecked scenarios. + */ + get max_fps(): int64 + set max_fps(value: int64) + + /** The speed multiplier at which the in-game clock updates, compared to real time. For example, if set to `2.0` the game runs twice as fast, and if set to `0.5` the game runs half as fast. + * This value affects [Timer], [SceneTreeTimer], and all other simulations that make use of `delta` time (such as [method Node._process] and [method Node._physics_process]). + * + * **Note:** It's recommended to keep this property above `0.0`, as the game may behave unexpectedly otherwise. + * + * **Note:** This does not affect audio playback speed. Use [member AudioServer.playback_speed_scale] to adjust audio playback speed independently of [member Engine.time_scale]. + * + * **Note:** This does not automatically adjust [member physics_ticks_per_second]. With values above `1.0` physics simulation may become less precise, as each physics tick will stretch over a larger period of engine time. If you're modifying [member Engine.time_scale] to speed up simulation by a large factor, consider also increasing [member physics_ticks_per_second] to make the simulation more reliable. + */ + get time_scale(): float64 + set time_scale(value: float64) + + /** How much physics ticks are synchronized with real time. If `0` or less, the ticks are fully synchronized. Higher values cause the in-game clock to deviate more from the real clock, but they smooth out framerate jitters. + * + * **Note:** The default value of `0.5` should be good enough for most cases; values above `2` could cause the game to react to dropped frames with a noticeable delay and are not recommended. + * + * **Note:** When using a custom physics interpolation solution, or within a network game, it's recommended to disable the physics jitter fix by setting this property to `0`. + */ + get physics_jitter_fix(): float64 + set physics_jitter_fix(value: float64) } // _singleton_class_: ProjectSettings /** Stores globally-accessible variables. * - * @link https://docs.godotengine.org/en/4.3/classes/class_projectsettings.html + * @link https://docs.godotengine.org/en/4.4/classes/class_projectsettings.html */ class ProjectSettings extends Object { /** Returns `true` if a configuration value is present. */ static has_setting(name: string): boolean /** Sets the value of a setting. - * **Example:** * * This can also be used to erase custom project settings. To do this change the setting value to `null`. */ static set_setting(name: string, value: any): void /** Returns the value of the setting identified by [param name]. If the setting doesn't exist and [param default_value] is specified, the value of [param default_value] is returned. Otherwise, `null` is returned. - * **Example:** * * * **Note:** This method doesn't take potential feature overrides into account automatically. Use [method get_setting_with_override] to handle seamlessly. @@ -255,10 +396,8 @@ declare module "godot" { static get_setting(name: string, default_value: any = {}): any /** Similar to [method get_setting], but applies feature tag overrides if any exists and is valid. - * **Example:** - * If the following setting override exists "application/config/name.windows", and the following code is executed: + * **Example:** If the setting override `"application/config/name.windows"` exists, and the following code is executed on a *Windows* operating system, the overridden setting is printed instead: * - * Then the overridden setting will be returned instead if the project is running on the *Windows* operating system. */ static get_setting_with_override(name: StringName): any @@ -292,7 +431,6 @@ declare module "godot" { * - `"name"`: [String] (the property's name) * - `"type"`: [int] (see [enum Variant.Type]) * - optionally `"hint"`: [int] (see [enum PropertyHint]) and `"hint_string"`: [String] - * **Example:** * */ static add_property_info(hint: GDictionary): void @@ -309,7 +447,7 @@ declare module "godot" { /** Returns the localized path (starting with `res://`) corresponding to the absolute, native OS [param path]. See also [method globalize_path]. */ static localize_path(path: string): string - /** Returns the absolute, native OS path corresponding to the localized [param path] (starting with `res://` or `user://`). The returned path will vary depending on the operating system and user preferences. See [url=https://docs.godotengine.org/en/4.3/tutorials/io/data_paths.html]File paths in Godot projects[/url] to see what those paths convert to. See also [method localize_path]. + /** Returns the absolute, native OS path corresponding to the localized [param path] (starting with `res://` or `user://`). The returned path will vary depending on the operating system and user preferences. See [url=https://docs.godotengine.org/en/4.4/tutorials/io/data_paths.html]File paths in Godot projects[/url] to see what those paths convert to. See also [method localize_path]. * * **Note:** [method globalize_path] with `res://` will not work in an exported project. Instead, prepend the executable's base directory to the path when running from an exported project: * @@ -327,6 +465,8 @@ declare module "godot" { * **Note:** If a file from [param pack] shares the same path as a file already in the resource filesystem, any attempts to load that file will use the file from [param pack] unless [param replace_files] is set to `false`. * * **Note:** The optional [param offset] parameter can be used to specify the offset in bytes to the start of the resource pack. This is only supported for .pck files. + * + * **Note:** [DirAccess] will not show changes made to the contents of `res://` after calling this function. */ static load_resource_pack(pack: string, replace_files: boolean = true, offset: int64 = 0): boolean @@ -336,427 +476,6 @@ declare module "godot" { /** Emitted when any setting is changed, up to once per process frame. */ static readonly settings_changed: Signal0 } - // _singleton_class_: IP - namespace IP { - enum ResolverStatus { - /** DNS hostname resolver status: No status. */ - RESOLVER_STATUS_NONE = 0, - - /** DNS hostname resolver status: Waiting. */ - RESOLVER_STATUS_WAITING = 1, - - /** DNS hostname resolver status: Done. */ - RESOLVER_STATUS_DONE = 2, - - /** DNS hostname resolver status: Error. */ - RESOLVER_STATUS_ERROR = 3, - } - enum Type { - /** Address type: None. */ - TYPE_NONE = 0, - - /** Address type: Internet protocol version 4 (IPv4). */ - TYPE_IPV4 = 1, - - /** Address type: Internet protocol version 6 (IPv6). */ - TYPE_IPV6 = 2, - - /** Address type: Any. */ - TYPE_ANY = 3, - } - } - /** Internet protocol (IP) support functions such as DNS resolution. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_ip.html - */ - class IP extends Object { - /** Maximum number of concurrent DNS resolver queries allowed, [constant RESOLVER_INVALID_ID] is returned if exceeded. */ - static readonly RESOLVER_MAX_QUERIES = 256 - - /** Invalid ID constant. Returned if [constant RESOLVER_MAX_QUERIES] is exceeded. */ - static readonly RESOLVER_INVALID_ID = -1 - - /** Returns a given hostname's IPv4 or IPv6 address when resolved (blocking-type method). The address type returned depends on the [enum Type] constant given as [param ip_type]. */ - static resolve_hostname(host: string, ip_type: IP.Type = 3): string - - /** Resolves a given hostname in a blocking way. Addresses are returned as an [Array] of IPv4 or IPv6 addresses depending on [param ip_type]. */ - static resolve_hostname_addresses(host: string, ip_type: IP.Type = 3): PackedStringArray - - /** Creates a queue item to resolve a hostname to an IPv4 or IPv6 address depending on the [enum Type] constant given as [param ip_type]. Returns the queue ID if successful, or [constant RESOLVER_INVALID_ID] on error. */ - static resolve_hostname_queue_item(host: string, ip_type: IP.Type = 3): int64 - - /** Returns a queued hostname's status as a [enum ResolverStatus] constant, given its queue [param id]. */ - static get_resolve_item_status(id: int64): IP.ResolverStatus - - /** Returns a queued hostname's IP address, given its queue [param id]. Returns an empty string on error or if resolution hasn't happened yet (see [method get_resolve_item_status]). */ - static get_resolve_item_address(id: int64): string - - /** Returns resolved addresses, or an empty array if an error happened or resolution didn't happen yet (see [method get_resolve_item_status]). */ - static get_resolve_item_addresses(id: int64): GArray - - /** Removes a given item [param id] from the queue. This should be used to free a queue after it has completed to enable more queries to happen. */ - static erase_resolve_item(id: int64): void - - /** Returns all the user's current IPv4 and IPv6 addresses as an array. */ - static get_local_addresses(): PackedStringArray - - /** Returns all network adapters as an array. - * Each adapter is a dictionary of the form: - * - */ - static get_local_interfaces(): GArray - - /** Removes all of a [param hostname]'s cached references. If no [param hostname] is given, all cached IP addresses are removed. */ - static clear_cache(hostname: string = ''): void - } - // _singleton_class_: Geometry2D - namespace Geometry2D { - enum PolyBooleanOperation { - /** Create regions where either subject or clip polygons (or both) are filled. */ - OPERATION_UNION = 0, - - /** Create regions where subject polygons are filled except where clip polygons are filled. */ - OPERATION_DIFFERENCE = 1, - - /** Create regions where both subject and clip polygons are filled. */ - OPERATION_INTERSECTION = 2, - - /** Create regions where either subject or clip polygons are filled but not where both are filled. */ - OPERATION_XOR = 3, - } - enum PolyJoinType { - /** Squaring is applied uniformally at all convex edge joins at `1 * delta`. */ - JOIN_SQUARE = 0, - - /** While flattened paths can never perfectly trace an arc, they are approximated by a series of arc chords. */ - JOIN_ROUND = 1, - - /** There's a necessary limit to mitered joins since offsetting edges that join at very acute angles will produce excessively long and narrow "spikes". For any given edge join, when miter offsetting would exceed that maximum distance, "square" joining is applied. */ - JOIN_MITER = 2, - } - enum PolyEndType { - /** Endpoints are joined using the [enum PolyJoinType] value and the path filled as a polygon. */ - END_POLYGON = 0, - - /** Endpoints are joined using the [enum PolyJoinType] value and the path filled as a polyline. */ - END_JOINED = 1, - - /** Endpoints are squared off with no extension. */ - END_BUTT = 2, - - /** Endpoints are squared off and extended by `delta` units. */ - END_SQUARE = 3, - - /** Endpoints are rounded off and extended by `delta` units. */ - END_ROUND = 4, - } - } - /** Provides methods for some common 2D geometric operations. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_geometry2d.html - */ - class Geometry2D extends Object { - /** Returns `true` if [param point] is inside the circle or if it's located exactly *on* the circle's boundary, otherwise returns `false`. */ - static is_point_in_circle(point: Vector2, circle_position: Vector2, circle_radius: float64): boolean - - /** Given the 2D segment ([param segment_from], [param segment_to]), returns the position on the segment (as a number between 0 and 1) at which the segment hits the circle that is located at position [param circle_position] and has radius [param circle_radius]. If the segment does not intersect the circle, -1 is returned (this is also the case if the line extending the segment would intersect the circle, but the segment does not). */ - static segment_intersects_circle(segment_from: Vector2, segment_to: Vector2, circle_position: Vector2, circle_radius: float64): float64 - - /** Checks if the two segments ([param from_a], [param to_a]) and ([param from_b], [param to_b]) intersect. If yes, return the point of intersection as [Vector2]. If no intersection takes place, returns `null`. */ - static segment_intersects_segment(from_a: Vector2, to_a: Vector2, from_b: Vector2, to_b: Vector2): any - - /** Checks if the two lines ([param from_a], [param dir_a]) and ([param from_b], [param dir_b]) intersect. If yes, return the point of intersection as [Vector2]. If no intersection takes place, returns `null`. - * - * **Note:** The lines are specified using direction vectors, not end points. - */ - static line_intersects_line(from_a: Vector2, dir_a: Vector2, from_b: Vector2, dir_b: Vector2): any - - /** Given the two 2D segments ([param p1], [param q1]) and ([param p2], [param q2]), finds those two points on the two segments that are closest to each other. Returns a [PackedVector2Array] that contains this point on ([param p1], [param q1]) as well the accompanying point on ([param p2], [param q2]). */ - static get_closest_points_between_segments(p1: Vector2, q1: Vector2, p2: Vector2, q2: Vector2): PackedVector2Array - - /** Returns the 2D point on the 2D segment ([param s1], [param s2]) that is closest to [param point]. The returned point will always be inside the specified segment. */ - static get_closest_point_to_segment(point: Vector2, s1: Vector2, s2: Vector2): Vector2 - - /** Returns the 2D point on the 2D line defined by ([param s1], [param s2]) that is closest to [param point]. The returned point can be inside the segment ([param s1], [param s2]) or outside of it, i.e. somewhere on the line extending from the segment. */ - static get_closest_point_to_segment_uncapped(point: Vector2, s1: Vector2, s2: Vector2): Vector2 - - /** Returns if [param point] is inside the triangle specified by [param a], [param b] and [param c]. */ - static point_is_inside_triangle(point: Vector2, a: Vector2, b: Vector2, c: Vector2): boolean - - /** Returns `true` if [param polygon]'s vertices are ordered in clockwise order, otherwise returns `false`. - * - * **Note:** Assumes a Cartesian coordinate system where `+x` is right and `+y` is up. If using screen coordinates (`+y` is down), the result will need to be flipped (i.e. a `true` result will indicate counter-clockwise). - */ - static is_polygon_clockwise(polygon: PackedVector2Array | Vector2[]): boolean - - /** Returns `true` if [param point] is inside [param polygon] or if it's located exactly *on* polygon's boundary, otherwise returns `false`. */ - static is_point_in_polygon(point: Vector2, polygon: PackedVector2Array | Vector2[]): boolean - - /** Triangulates the polygon specified by the points in [param polygon]. Returns a [PackedInt32Array] where each triangle consists of three consecutive point indices into [param polygon] (i.e. the returned array will have `n * 3` elements, with `n` being the number of found triangles). Output triangles will always be counter clockwise, and the contour will be flipped if it's clockwise. If the triangulation did not succeed, an empty [PackedInt32Array] is returned. */ - static triangulate_polygon(polygon: PackedVector2Array | Vector2[]): PackedInt32Array - - /** Triangulates the area specified by discrete set of [param points] such that no point is inside the circumcircle of any resulting triangle. Returns a [PackedInt32Array] where each triangle consists of three consecutive point indices into [param points] (i.e. the returned array will have `n * 3` elements, with `n` being the number of found triangles). If the triangulation did not succeed, an empty [PackedInt32Array] is returned. */ - static triangulate_delaunay(points: PackedVector2Array | Vector2[]): PackedInt32Array - - /** Given an array of [Vector2]s, returns the convex hull as a list of points in counterclockwise order. The last point is the same as the first one. */ - static convex_hull(points: PackedVector2Array | Vector2[]): PackedVector2Array - - /** Decomposes the [param polygon] into multiple convex hulls and returns an array of [PackedVector2Array]. */ - static decompose_polygon_in_convex(polygon: PackedVector2Array | Vector2[]): GArray - - /** Merges (combines) [param polygon_a] and [param polygon_b] and returns an array of merged polygons. This performs [constant OPERATION_UNION] between polygons. - * The operation may result in an outer polygon (boundary) and multiple inner polygons (holes) produced which could be distinguished by calling [method is_polygon_clockwise]. - */ - static merge_polygons(polygon_a: PackedVector2Array | Vector2[], polygon_b: PackedVector2Array | Vector2[]): GArray - - /** Clips [param polygon_a] against [param polygon_b] and returns an array of clipped polygons. This performs [constant OPERATION_DIFFERENCE] between polygons. Returns an empty array if [param polygon_b] completely overlaps [param polygon_a]. - * If [param polygon_b] is enclosed by [param polygon_a], returns an outer polygon (boundary) and inner polygon (hole) which could be distinguished by calling [method is_polygon_clockwise]. - */ - static clip_polygons(polygon_a: PackedVector2Array | Vector2[], polygon_b: PackedVector2Array | Vector2[]): GArray - - /** Intersects [param polygon_a] with [param polygon_b] and returns an array of intersected polygons. This performs [constant OPERATION_INTERSECTION] between polygons. In other words, returns common area shared by polygons. Returns an empty array if no intersection occurs. - * The operation may result in an outer polygon (boundary) and inner polygon (hole) produced which could be distinguished by calling [method is_polygon_clockwise]. - */ - static intersect_polygons(polygon_a: PackedVector2Array | Vector2[], polygon_b: PackedVector2Array | Vector2[]): GArray - - /** Mutually excludes common area defined by intersection of [param polygon_a] and [param polygon_b] (see [method intersect_polygons]) and returns an array of excluded polygons. This performs [constant OPERATION_XOR] between polygons. In other words, returns all but common area between polygons. - * The operation may result in an outer polygon (boundary) and inner polygon (hole) produced which could be distinguished by calling [method is_polygon_clockwise]. - */ - static exclude_polygons(polygon_a: PackedVector2Array | Vector2[], polygon_b: PackedVector2Array | Vector2[]): GArray - - /** Clips [param polyline] against [param polygon] and returns an array of clipped polylines. This performs [constant OPERATION_DIFFERENCE] between the polyline and the polygon. This operation can be thought of as cutting a line with a closed shape. */ - static clip_polyline_with_polygon(polyline: PackedVector2Array | Vector2[], polygon: PackedVector2Array | Vector2[]): GArray - - /** Intersects [param polyline] with [param polygon] and returns an array of intersected polylines. This performs [constant OPERATION_INTERSECTION] between the polyline and the polygon. This operation can be thought of as chopping a line with a closed shape. */ - static intersect_polyline_with_polygon(polyline: PackedVector2Array | Vector2[], polygon: PackedVector2Array | Vector2[]): GArray - - /** Inflates or deflates [param polygon] by [param delta] units (pixels). If [param delta] is positive, makes the polygon grow outward. If [param delta] is negative, shrinks the polygon inward. Returns an array of polygons because inflating/deflating may result in multiple discrete polygons. Returns an empty array if [param delta] is negative and the absolute value of it approximately exceeds the minimum bounding rectangle dimensions of the polygon. - * Each polygon's vertices will be rounded as determined by [param join_type], see [enum PolyJoinType]. - * The operation may result in an outer polygon (boundary) and inner polygon (hole) produced which could be distinguished by calling [method is_polygon_clockwise]. - * - * **Note:** To translate the polygon's vertices specifically, multiply them to a [Transform2D]: - * - */ - static offset_polygon(polygon: PackedVector2Array | Vector2[], delta: float64, join_type: Geometry2D.PolyJoinType = 0): GArray - - /** Inflates or deflates [param polyline] by [param delta] units (pixels), producing polygons. If [param delta] is positive, makes the polyline grow outward. Returns an array of polygons because inflating/deflating may result in multiple discrete polygons. If [param delta] is negative, returns an empty array. - * Each polygon's vertices will be rounded as determined by [param join_type], see [enum PolyJoinType]. - * Each polygon's endpoints will be rounded as determined by [param end_type], see [enum PolyEndType]. - * The operation may result in an outer polygon (boundary) and inner polygon (hole) produced which could be distinguished by calling [method is_polygon_clockwise]. - */ - static offset_polyline(polyline: PackedVector2Array | Vector2[], delta: float64, join_type: Geometry2D.PolyJoinType = 0, end_type: Geometry2D.PolyEndType = 3): GArray - - /** Given an array of [Vector2]s representing tiles, builds an atlas. The returned dictionary has two keys: `points` is a [PackedVector2Array] that specifies the positions of each tile, `size` contains the overall size of the whole atlas as [Vector2i]. */ - static make_atlas(sizes: PackedVector2Array | Vector2[]): GDictionary - } - // _singleton_class_: Geometry3D - /** Provides methods for some common 3D geometric operations. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_geometry3d.html - */ - class Geometry3D extends Object { - /** Calculates and returns all the vertex points of a convex shape defined by an array of [param planes]. */ - static compute_convex_mesh_points(planes: GArray): PackedVector3Array - - /** Returns an array with 6 [Plane]s that describe the sides of a box centered at the origin. The box size is defined by [param extents], which represents one (positive) corner of the box (i.e. half its actual size). */ - static build_box_planes(extents: Vector3): GArray - - /** Returns an array of [Plane]s closely bounding a faceted cylinder centered at the origin with radius [param radius] and height [param height]. The parameter [param sides] defines how many planes will be generated for the round part of the cylinder. The parameter [param axis] describes the axis along which the cylinder is oriented (0 for X, 1 for Y, 2 for Z). */ - static build_cylinder_planes(radius: float64, height: float64, sides: int64, axis: Vector3.Axis = 2): GArray - - /** Returns an array of [Plane]s closely bounding a faceted capsule centered at the origin with radius [param radius] and height [param height]. The parameter [param sides] defines how many planes will be generated for the side part of the capsule, whereas [param lats] gives the number of latitudinal steps at the bottom and top of the capsule. The parameter [param axis] describes the axis along which the capsule is oriented (0 for X, 1 for Y, 2 for Z). */ - static build_capsule_planes(radius: float64, height: float64, sides: int64, lats: int64, axis: Vector3.Axis = 2): GArray - - /** Given the two 3D segments ([param p1], [param p2]) and ([param q1], [param q2]), finds those two points on the two segments that are closest to each other. Returns a [PackedVector3Array] that contains this point on ([param p1], [param p2]) as well the accompanying point on ([param q1], [param q2]). */ - static get_closest_points_between_segments(p1: Vector3, p2: Vector3, q1: Vector3, q2: Vector3): PackedVector3Array - - /** Returns the 3D point on the 3D segment ([param s1], [param s2]) that is closest to [param point]. The returned point will always be inside the specified segment. */ - static get_closest_point_to_segment(point: Vector3, s1: Vector3, s2: Vector3): Vector3 - - /** Returns the 3D point on the 3D line defined by ([param s1], [param s2]) that is closest to [param point]. The returned point can be inside the segment ([param s1], [param s2]) or outside of it, i.e. somewhere on the line extending from the segment. */ - static get_closest_point_to_segment_uncapped(point: Vector3, s1: Vector3, s2: Vector3): Vector3 - - /** Returns a [Vector3] containing weights based on how close a 3D position ([param point]) is to a triangle's different vertices ([param a], [param b] and [param c]). This is useful for interpolating between the data of different vertices in a triangle. One example use case is using this to smoothly rotate over a mesh instead of relying solely on face normals. - * [url=https://en.wikipedia.org/wiki/Barycentric_coordinate_system]Here is a more detailed explanation of barycentric coordinates.[/url] - */ - static get_triangle_barycentric_coords(point: Vector3, a: Vector3, b: Vector3, c: Vector3): Vector3 - - /** Tests if the 3D ray starting at [param from] with the direction of [param dir] intersects the triangle specified by [param a], [param b] and [param c]. If yes, returns the point of intersection as [Vector3]. If no intersection takes place, returns `null`. */ - static ray_intersects_triangle(from: Vector3, dir: Vector3, a: Vector3, b: Vector3, c: Vector3): any - - /** Tests if the segment ([param from], [param to]) intersects the triangle [param a], [param b], [param c]. If yes, returns the point of intersection as [Vector3]. If no intersection takes place, returns `null`. */ - static segment_intersects_triangle(from: Vector3, to: Vector3, a: Vector3, b: Vector3, c: Vector3): any - - /** Checks if the segment ([param from], [param to]) intersects the sphere that is located at [param sphere_position] and has radius [param sphere_radius]. If no, returns an empty [PackedVector3Array]. If yes, returns a [PackedVector3Array] containing the point of intersection and the sphere's normal at the point of intersection. */ - static segment_intersects_sphere(from: Vector3, to: Vector3, sphere_position: Vector3, sphere_radius: float64): PackedVector3Array - - /** Checks if the segment ([param from], [param to]) intersects the cylinder with height [param height] that is centered at the origin and has radius [param radius]. If no, returns an empty [PackedVector3Array]. If an intersection takes place, the returned array contains the point of intersection and the cylinder's normal at the point of intersection. */ - static segment_intersects_cylinder(from: Vector3, to: Vector3, height: float64, radius: float64): PackedVector3Array - - /** Given a convex hull defined though the [Plane]s in the array [param planes], tests if the segment ([param from], [param to]) intersects with that hull. If an intersection is found, returns a [PackedVector3Array] containing the point the intersection and the hull's normal. Otherwise, returns an empty array. */ - static segment_intersects_convex(from: Vector3, to: Vector3, planes: GArray): PackedVector3Array - - /** Clips the polygon defined by the points in [param points] against the [param plane] and returns the points of the clipped polygon. */ - static clip_polygon(points: PackedVector3Array | Vector3[], plane: Plane): PackedVector3Array - - /** Tetrahedralizes the volume specified by a discrete set of [param points] in 3D space, ensuring that no point lies within the circumsphere of any resulting tetrahedron. The method returns a [PackedInt32Array] where each tetrahedron consists of four consecutive point indices into the [param points] array (resulting in an array with `n * 4` elements, where `n` is the number of tetrahedra found). If the tetrahedralization is unsuccessful, an empty [PackedInt32Array] is returned. */ - static tetrahedralize_delaunay(points: PackedVector3Array | Vector3[]): PackedInt32Array - } - // _singleton_class_: ResourceLoader - namespace ResourceLoader { - enum ThreadLoadStatus { - /** The resource is invalid, or has not been loaded with [method load_threaded_request]. */ - THREAD_LOAD_INVALID_RESOURCE = 0, - - /** The resource is still being loaded. */ - THREAD_LOAD_IN_PROGRESS = 1, - - /** Some error occurred during loading and it failed. */ - THREAD_LOAD_FAILED = 2, - - /** The resource was loaded successfully and can be accessed via [method load_threaded_get]. */ - THREAD_LOAD_LOADED = 3, - } - enum CacheMode { - /** Neither the main resource (the one requested to be loaded) nor any of its subresources are retrieved from cache nor stored into it. Dependencies (external resources) are loaded with [constant CACHE_MODE_REUSE]. */ - CACHE_MODE_IGNORE = 0, - - /** The main resource (the one requested to be loaded), its subresources, and its dependencies (external resources) are retrieved from cache if present, instead of loaded. Those not cached are loaded and then stored into the cache. The same rules are propagated recursively down the tree of dependencies (external resources). */ - CACHE_MODE_REUSE = 1, - - /** Like [constant CACHE_MODE_REUSE], but the cache is checked for the main resource (the one requested to be loaded) as well as for each of its subresources. Those already in the cache, as long as the loaded and cached types match, have their data refreshed from storage into the already existing instances. Otherwise, they are recreated as completely new objects. */ - CACHE_MODE_REPLACE = 2, - - /** Like [constant CACHE_MODE_IGNORE], but propagated recursively down the tree of dependencies (external resources). */ - CACHE_MODE_IGNORE_DEEP = 3, - - /** Like [constant CACHE_MODE_REPLACE], but propagated recursively down the tree of dependencies (external resources). */ - CACHE_MODE_REPLACE_DEEP = 4, - } - } - /** A singleton for loading resource files. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_resourceloader.html - */ - class ResourceLoader extends Object { - /** Loads the resource using threads. If [param use_sub_threads] is `true`, multiple threads will be used to load the resource, which makes loading faster, but may affect the main thread (and thus cause game slowdowns). - * The [param cache_mode] property defines whether and how the cache should be used or updated when loading the resource. See [enum CacheMode] for details. - */ - static load_threaded_request(path: string, type_hint: string = '', use_sub_threads: boolean = false, cache_mode: ResourceLoader.CacheMode = 1): GError - - /** Returns the status of a threaded loading operation started with [method load_threaded_request] for the resource at [param path]. See [enum ThreadLoadStatus] for possible return values. - * An array variable can optionally be passed via [param progress], and will return a one-element array containing the percentage of completion of the threaded loading. - * - * **Note:** The recommended way of using this method is to call it during different frames (e.g., in [method Node._process], instead of a loop). - */ - static load_threaded_get_status(path: string, progress: GArray = []): ResourceLoader.ThreadLoadStatus - - /** Returns the resource loaded by [method load_threaded_request]. - * If this is called before the loading thread is done (i.e. [method load_threaded_get_status] is not [constant THREAD_LOAD_LOADED]), the calling thread will be blocked until the resource has finished loading. However, it's recommended to use [method load_threaded_get_status] to known when the load has actually completed. - */ - static load_threaded_get(path: string): Resource - - /** Loads a resource at the given [param path], caching the result for further access. - * The registered [ResourceFormatLoader]s are queried sequentially to find the first one which can handle the file's extension, and then attempt loading. If loading fails, the remaining ResourceFormatLoaders are also attempted. - * An optional [param type_hint] can be used to further specify the [Resource] type that should be handled by the [ResourceFormatLoader]. Anything that inherits from [Resource] can be used as a type hint, for example [Image]. - * The [param cache_mode] property defines whether and how the cache should be used or updated when loading the resource. See [enum CacheMode] for details. - * Returns an empty resource if no [ResourceFormatLoader] could handle the file, and prints an error if no file is found at the specified path. - * GDScript has a simplified [method @GDScript.load] built-in method which can be used in most situations, leaving the use of [ResourceLoader] for more advanced scenarios. - * - * **Note:** If [member ProjectSettings.editor/export/convert_text_resources_to_binary] is `true`, [method @GDScript.load] will not be able to read converted files in an exported project. If you rely on run-time loading of files present within the PCK, set [member ProjectSettings.editor/export/convert_text_resources_to_binary] to `false`. - * - * **Note:** Relative paths will be prefixed with `"res://"` before loading, to avoid unexpected results make sure your paths are absolute. - */ - static load(path: string, type_hint: string = '', cache_mode: ResourceLoader.CacheMode = 1): Resource - - /** Returns the list of recognized extensions for a resource type. */ - static get_recognized_extensions_for_type(type: string): PackedStringArray - - /** Registers a new [ResourceFormatLoader]. The ResourceLoader will use the ResourceFormatLoader as described in [method load]. - * This method is performed implicitly for ResourceFormatLoaders written in GDScript (see [ResourceFormatLoader] for more information). - */ - static add_resource_format_loader(format_loader: ResourceFormatLoader, at_front: boolean = false): void - - /** Unregisters the given [ResourceFormatLoader]. */ - static remove_resource_format_loader(format_loader: ResourceFormatLoader): void - - /** Changes the behavior on missing sub-resources. The default behavior is to abort loading. */ - static set_abort_on_missing_resources(abort: boolean): void - - /** Returns the dependencies for the resource at the given [param path]. - * - * **Note:** The dependencies are returned with slices separated by `::`. You can use [method String.get_slice] to get their components. - * - */ - static get_dependencies(path: string): PackedStringArray - - /** Returns whether a cached resource is available for the given [param path]. - * Once a resource has been loaded by the engine, it is cached in memory for faster access, and future calls to the [method load] method will use the cached version. The cached resource can be overridden by using [method Resource.take_over_path] on a new resource for that same path. - */ - static has_cached(path: string): boolean - - /** Returns whether a recognized resource exists for the given [param path]. - * An optional [param type_hint] can be used to further specify the [Resource] type that should be handled by the [ResourceFormatLoader]. Anything that inherits from [Resource] can be used as a type hint, for example [Image]. - * - * **Note:** If you use [method Resource.take_over_path], this method will return `true` for the taken path even if the resource wasn't saved (i.e. exists only in resource cache). - */ - static exists(path: string, type_hint: string = ''): boolean - - /** Returns the ID associated with a given resource path, or `-1` when no such ID exists. */ - static get_resource_uid(path: string): int64 - } - // _singleton_class_: ResourceSaver - namespace ResourceSaver { - enum SaverFlags { - /** No resource saving option. */ - FLAG_NONE = 0, - - /** Save the resource with a path relative to the scene which uses it. */ - FLAG_RELATIVE_PATHS = 1, - - /** Bundles external resources. */ - FLAG_BUNDLE_RESOURCES = 2, - - /** Changes the [member Resource.resource_path] of the saved resource to match its new location. */ - FLAG_CHANGE_PATH = 4, - - /** Do not save editor-specific metadata (identified by their `__editor` prefix). */ - FLAG_OMIT_EDITOR_PROPERTIES = 8, - - /** Save as big endian (see [member FileAccess.big_endian]). */ - FLAG_SAVE_BIG_ENDIAN = 16, - - /** Compress the resource on save using [constant FileAccess.COMPRESSION_ZSTD]. Only available for binary resource types. */ - FLAG_COMPRESS = 32, - - /** Take over the paths of the saved subresources (see [method Resource.take_over_path]). */ - FLAG_REPLACE_SUBRESOURCE_PATHS = 64, - } - } - /** A singleton for saving [Resource]s to the filesystem. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_resourcesaver.html - */ - class ResourceSaver extends Object { - /** Saves a resource to disk to the given path, using a [ResourceFormatSaver] that recognizes the resource object. If [param path] is empty, [ResourceSaver] will try to use [member Resource.resource_path]. - * The [param flags] bitmask can be specified to customize the save behavior using [enum SaverFlags] flags. - * Returns [constant OK] on success. - * - * **Note:** When the project is running, any generated UID associated with the resource will not be saved as the required code is only executed in editor mode. - */ - static save(resource: Resource, path: string = '', flags: ResourceSaver.SaverFlags = 0): GError - - /** Returns the list of extensions available for saving a resource of a given type. */ - static get_recognized_extensions(type: Resource): PackedStringArray - - /** Registers a new [ResourceFormatSaver]. The ResourceSaver will use the ResourceFormatSaver as described in [method save]. - * This method is performed implicitly for ResourceFormatSavers written in GDScript (see [ResourceFormatSaver] for more information). - */ - static add_resource_format_saver(format_saver: ResourceFormatSaver, at_front: boolean = false): void - - /** Unregisters the given [ResourceFormatSaver]. */ - static remove_resource_format_saver(format_saver: ResourceFormatSaver): void - } // _singleton_class_: OS namespace OS { enum RenderingDriver { @@ -768,6 +487,9 @@ declare module "godot" { /** The Direct3D 12 rendering driver. */ RENDERING_DRIVER_D3D12 = 2, + + /** The Metal rendering driver. */ + RENDERING_DRIVER_METAL = 3, } enum SystemDir { /** Refers to the Desktop directory path. */ @@ -794,10 +516,26 @@ declare module "godot" { /** Refers to the Ringtones directory path. */ SYSTEM_DIR_RINGTONES = 7, } + enum StdHandleType { + /** Standard I/O device is invalid. No data can be received from or sent to these standard I/O devices. */ + STD_HANDLE_INVALID = 0, + + /** Standard I/O device is a console. This typically occurs when Godot is run from a terminal with no redirection. This is also used for all standard I/O devices when running Godot from the editor, at least on desktop platforms. */ + STD_HANDLE_CONSOLE = 1, + + /** Standard I/O device is a regular file. This typically occurs with redirection from a terminal, e.g. `godot > stdout.txt`, `godot < stdin.txt` or `godot > stdout_stderr.txt 2>&1`. */ + STD_HANDLE_FILE = 2, + + /** Standard I/O device is a FIFO/pipe. This typically occurs with pipe usage from a terminal, e.g. `echo "Hello" | godot`. */ + STD_HANDLE_PIPE = 3, + + /** Standard I/O device type is unknown. */ + STD_HANDLE_UNKNOWN = 4, + } } /** Provides access to common operating system functionalities. * - * @link https://docs.godotengine.org/en/4.3/classes/class_os.html + * @link https://docs.godotengine.org/en/4.4/classes/class_os.html */ class OS extends Object { /** Generates a [PackedByteArray] of cryptographically secure random bytes with given [param size]. @@ -811,19 +549,27 @@ declare module "godot" { /** Returns an array of connected MIDI device names, if they exist. Returns an empty array if the system MIDI driver has not previously been initialized with [method open_midi_inputs]. See also [method close_midi_inputs]. * - * **Note:** This method is implemented on Linux, macOS and Windows. + * **Note:** This method is implemented on Linux, macOS, Windows, and Web. + * + * **Note:** On the Web platform, Web MIDI needs to be supported by the browser. [url=https://caniuse.com/midi]For the time being[/url], it is currently supported by all major browsers, except Safari. + * + * **Note:** On the Web platform, using MIDI input requires a browser permission to be granted first. This permission request is performed when calling [method open_midi_inputs]. The browser will refrain from processing MIDI input until the user accepts the permission request. */ static get_connected_midi_inputs(): PackedStringArray /** Initializes the singleton for the system MIDI driver, allowing Godot to receive [InputEventMIDI]. See also [method get_connected_midi_inputs] and [method close_midi_inputs]. * - * **Note:** This method is implemented on Linux, macOS and Windows. + * **Note:** This method is implemented on Linux, macOS, Windows, and Web. + * + * **Note:** On the Web platform, Web MIDI needs to be supported by the browser. [url=https://caniuse.com/midi]For the time being[/url], it is currently supported by all major browsers, except Safari. + * + * **Note:** On the Web platform, using MIDI input requires a browser permission to be granted first. This permission request is performed when calling [method open_midi_inputs]. The browser will refrain from processing MIDI input until the user accepts the permission request. */ static open_midi_inputs(): void /** Shuts down the system MIDI driver. Godot will no longer receive [InputEventMIDI]. See also [method open_midi_inputs] and [method get_connected_midi_inputs]. * - * **Note:** This method is implemented on Linux, macOS and Windows. + * **Note:** This method is implemented on Linux, macOS, Windows, and Web. */ static close_midi_inputs(): void @@ -877,13 +623,38 @@ declare module "godot" { */ static get_executable_path(): string - /** Reads a user input string from the standard input (usually the terminal). This operation is *blocking* , which causes the window to freeze if [method read_string_from_stdin] is called on the main thread. The thread calling [method read_string_from_stdin] will block until the program receives a line break in standard input (usually by the user pressing [kbd]Enter[/kbd]). + /** Reads a user input as a UTF-8 encoded string from the standard input. This operation can be *blocking* , which causes the window to freeze if [method read_string_from_stdin] is called on the main thread. + * - If standard input is console, this method will block until the program receives a line break in standard input (usually by the user pressing [kbd]Enter[/kbd]). + * - If standard input is pipe, this method will block until a specific amount of data is read or pipe is closed. + * - If standard input is a file, this method will read a specific amount of data (or less if end-of-file is reached) and return immediately. * - * **Note:** This method is implemented on Linux, macOS and Windows. + * **Note:** This method automatically replaces `\r\n` line breaks with `\n` and removes them from the end of the string. Use [method read_buffer_from_stdin] to read the unprocessed data. * - * **Note:** On exported Windows builds, run the console wrapper executable to access the terminal. Otherwise, the standard input will not work correctly. If you need a single executable with console support, use a custom build compiled with the `windows_subsystem=console` flag. + * **Note:** This method is implemented on Linux, macOS, and Windows. + * + * **Note:** On exported Windows builds, run the console wrapper executable to access the terminal. If standard input is console, calling this method without console wrapped will freeze permanently. If standard input is pipe or file, it can be used without console wrapper. If you need a single executable with full console support, use a custom build compiled with the `windows_subsystem=console` flag. */ - static read_string_from_stdin(): string + static read_string_from_stdin(buffer_size: int64): string + + /** Reads a user input as raw data from the standard input. This operation can be *blocking* , which causes the window to freeze if [method read_string_from_stdin] is called on the main thread. + * - If standard input is console, this method will block until the program receives a line break in standard input (usually by the user pressing [kbd]Enter[/kbd]). + * - If standard input is pipe, this method will block until a specific amount of data is read or pipe is closed. + * - If standard input is a file, this method will read a specific amount of data (or less if end-of-file is reached) and return immediately. + * + * **Note:** This method is implemented on Linux, macOS, and Windows. + * + * **Note:** On exported Windows builds, run the console wrapper executable to access the terminal. If standard input is console, calling this method without console wrapped will freeze permanently. If standard input is pipe or file, it can be used without console wrapper. If you need a single executable with full console support, use a custom build compiled with the `windows_subsystem=console` flag. + */ + static read_buffer_from_stdin(buffer_size: int64): PackedByteArray + + /** Returns type of the standard input device. */ + static get_stdin_type(): OS.StdHandleType + + /** Returns type of the standard output device. */ + static get_stdout_type(): OS.StdHandleType + + /** Returns type of the standard error device. */ + static get_stderr_type(): OS.StdHandleType /** Executes the given process in a *blocking* way. The file specified in [param path] must exist and be executable. The system path resolution will be used. The [param arguments] are used in the given order, separated by spaces, and wrapped in quotes. * If an [param output] array is provided, the complete shell output of the process is appended to [param output] as a single [String] element. If [param read_stderr] is `true`, the output to the standard error stream is also appended to the array. @@ -911,6 +682,7 @@ declare module "godot" { static execute(path: string, arguments_: PackedStringArray | string[], output: GArray = [], read_stderr: boolean = false, open_console: boolean = false): int64 /** Creates a new process that runs independently of Godot with redirected IO. It will not terminate when Godot terminates. The path specified in [param path] must exist and be an executable file or macOS `.app` bundle. The path is resolved based on the current platform. The [param arguments] are used in the given order and separated by a space. + * If [param blocking] is `false`, created pipes work in non-blocking mode, i.e. read and write operations will return immediately. Use [method FileAccess.get_error] to check if the last read/write operation was successful. * If the process cannot be created, this method returns an empty [Dictionary]. Otherwise, this method returns a [Dictionary] with the following keys: * - `"stdio"` - [FileAccess] to access the process stdin and stdout pipes (read/write). * - `"stderr"` - [FileAccess] to access the process stderr pipe (read only). @@ -926,12 +698,12 @@ declare module "godot" { * * **Note:** On macOS, sandboxed applications are limited to run only embedded helper executables, specified during export or system .app bundle, system .app bundles will ignore arguments. */ - static execute_with_pipe(path: string, arguments_: PackedStringArray | string[]): GDictionary + static execute_with_pipe(path: string, arguments_: PackedStringArray | string[], blocking: boolean = true): GDictionary /** Creates a new process that runs independently of Godot. It will not terminate when Godot terminates. The path specified in [param path] must exist and be an executable file or macOS `.app` bundle. The path is resolved based on the current platform. The [param arguments] are used in the given order and separated by a space. * On Windows, if [param open_console] is `true` and the process is a console app, a new terminal window will be opened. * If the process is successfully created, this method returns its process ID, which you can use to monitor the process (and potentially terminate it with [method kill]). Otherwise, this method returns `-1`. - * For example, running another instance of the project: + * **Example:** Run another instance of the project: * * See [method execute] if you wish to run an external command and retrieve the results. * @@ -958,7 +730,8 @@ declare module "godot" { static kill(pid: int64): GError /** Requests the OS to open a resource identified by [param uri] with the most appropriate program. For example: - * - `OS.shell_open("C:\\Users\name\Downloads")` on Windows opens the file explorer at the user's Downloads folder. + * - `OS.shell_open("C:\\Users\\name\\Downloads")` on Windows opens the file explorer at the user's Downloads folder. + * - `OS.shell_open("C:/Users/name/Downloads")` also works on Windows and opens the file explorer at the user's Downloads folder. * - `OS.shell_open("https://godotengine.org")` opens the default web browser on the official Godot website. * - `OS.shell_open("mailto:example@example.com")` opens the default email client with the "To" field set to `example@example.com`. See [url=https://datatracker.ietf.org/doc/html/rfc2368]RFC 2368 - The `mailto` URL scheme[/url] for a list of fields that can be added. * Use [method ProjectSettings.globalize_path] to convert a `res://` or `user://` project path into a system path for use with this method. @@ -1058,11 +831,17 @@ declare module "godot" { */ static get_version(): string + /** Returns the branded version used in marketing, followed by the build number (on Windows) or the version number (on macOS). Examples include `11 (build 22000)` and `Sequoia (15.0.0)`. This value can then be appended to [method get_name] to get a full, human-readable operating system name and version combination for the operating system. Windows feature updates such as 24H2 are not contained in the resulting string, but Windows Server is recognized as such (e.g. `2025 (build 26100)` for Windows Server 2025). + * + * **Note:** This method is only supported on Windows and macOS. On other operating systems, it returns the same value as [method get_version]. + */ + static get_version_alias(): string + /** Returns the command-line arguments passed to the engine. * Command-line arguments can be written in any form, including both `--key value` and `--key=value` forms so they can be properly parsed, as long as custom command-line arguments do not conflict with engine arguments. * You can also incorporate environment variables using the [method get_environment] method. * You can set [member ProjectSettings.editor/run/main_run_args] to define command-line arguments to be passed by the editor when running the project. - * Here's a minimal example on how to parse command-line arguments into a [Dictionary] using the `--key=value` form for arguments: + * **Example:** Parse command-line arguments into a [Dictionary] using the `--key=value` form for arguments: * * * **Note:** Passing custom user arguments directly is not recommended, as the engine may discard or modify them. Instead, pass the standard UNIX double dash (`--`) and then the custom arguments, which the engine will ignore by design. These can be read via [method get_cmdline_user_args]. @@ -1131,7 +910,7 @@ declare module "godot" { /** Returns the model name of the current device. * - * **Note:** This method is implemented on Android and iOS. Returns `"GenericDevice"` on unsupported platforms. + * **Note:** This method is implemented on Android, iOS, macOS, and Windows. Returns `"GenericDevice"` on unsupported platforms. */ static get_model_name(): string @@ -1195,23 +974,26 @@ declare module "godot" { static get_system_dir(dir: OS.SystemDir, shared_storage: boolean = true): string /** Returns the *global* user configuration directory according to the operating system's standards. - * On the Linux/BSD platform, this path can be overridden by setting the `XDG_CONFIG_HOME` environment variable before starting the project. See [url=https://docs.godotengine.org/en/4.3/tutorials/io/data_paths.html]File paths in Godot projects[/url] in the documentation for more information. See also [method get_cache_dir] and [method get_data_dir]. + * On the Linux/BSD platform, this path can be overridden by setting the `XDG_CONFIG_HOME` environment variable before starting the project. See [url=https://docs.godotengine.org/en/4.4/tutorials/io/data_paths.html]File paths in Godot projects[/url] in the documentation for more information. See also [method get_cache_dir] and [method get_data_dir]. * Not to be confused with [method get_user_data_dir], which returns the *project-specific* user data path. */ static get_config_dir(): string /** Returns the *global* user data directory according to the operating system's standards. - * On the Linux/BSD platform, this path can be overridden by setting the `XDG_DATA_HOME` environment variable before starting the project. See [url=https://docs.godotengine.org/en/4.3/tutorials/io/data_paths.html]File paths in Godot projects[/url] in the documentation for more information. See also [method get_cache_dir] and [method get_config_dir]. + * On the Linux/BSD platform, this path can be overridden by setting the `XDG_DATA_HOME` environment variable before starting the project. See [url=https://docs.godotengine.org/en/4.4/tutorials/io/data_paths.html]File paths in Godot projects[/url] in the documentation for more information. See also [method get_cache_dir] and [method get_config_dir]. * Not to be confused with [method get_user_data_dir], which returns the *project-specific* user data path. */ static get_data_dir(): string /** Returns the *global* cache data directory according to the operating system's standards. - * On the Linux/BSD platform, this path can be overridden by setting the `XDG_CACHE_HOME` environment variable before starting the project. See [url=https://docs.godotengine.org/en/4.3/tutorials/io/data_paths.html]File paths in Godot projects[/url] in the documentation for more information. See also [method get_config_dir] and [method get_data_dir]. + * On the Linux/BSD platform, this path can be overridden by setting the `XDG_CACHE_HOME` environment variable before starting the project. See [url=https://docs.godotengine.org/en/4.4/tutorials/io/data_paths.html]File paths in Godot projects[/url] in the documentation for more information. See also [method get_config_dir] and [method get_data_dir]. * Not to be confused with [method get_user_data_dir], which returns the *project-specific* user data path. */ static get_cache_dir(): string + /** Returns the *global* temporary data directory according to the operating system's standards. */ + static get_temp_dir(): string + /** Returns a string that is unique to the device. * * **Note:** This string may change without notice if the user reinstalls their operating system, upgrades it, or modifies their hardware. This means it should generally not be used to encrypt persistent data, as the data saved before an unexpected ID change would become inaccessible. The returned string may also be falsified using external programs, so do not rely on the string returned by this method for security purposes. @@ -1257,7 +1039,7 @@ declare module "godot" { */ static get_main_thread_id(): int64 - /** Returns `true` if the feature for the given feature tag is supported in the currently running instance, depending on the platform, build, etc. Can be used to check whether you're currently running a debug build, on a certain platform or arch, etc. Refer to the [url=https://docs.godotengine.org/en/4.3/tutorials/export/feature_tags.html]Feature Tags[/url] documentation for more details. + /** Returns `true` if the feature for the given feature tag is supported in the currently running instance, depending on the platform, build, etc. Can be used to check whether you're currently running a debug build, on a certain platform or arch, etc. Refer to the [url=https://docs.godotengine.org/en/4.4/tutorials/export/feature_tags.html]Feature Tags[/url] documentation for more details. * * **Note:** Tag names are case-sensitive. * @@ -1271,13 +1053,20 @@ declare module "godot" { */ static is_sandboxed(): boolean - /** Requests permission from the OS for the given [param name]. Returns `true` if the permission has been successfully granted. + /** Requests permission from the OS for the given [param name]. Returns `true` if the permission has already been granted. See also [signal MainLoop.on_request_permissions_result]. + * The [param name] must be the full permission name. For example: + * - `OS.request_permission("android.permission.READ_EXTERNAL_STORAGE")` + * - `OS.request_permission("android.permission.POST_NOTIFICATIONS")` * - * **Note:** This method is currently only implemented on Android, to specifically request permission for `"RECORD_AUDIO"` by `AudioDriverOpenSL`. + * **Note:** Permission must be checked during export. + * + * **Note:** This method is only implemented on Android. */ static request_permission(name: string): boolean - /** Requests *dangerous* permissions from the OS. Returns `true` if permissions have been successfully granted. + /** Requests *dangerous* permissions from the OS. Returns `true` if permissions have already been granted. See also [signal MainLoop.on_request_permissions_result]. + * + * **Note:** Permissions must be checked during export. * * **Note:** This method is only implemented on Android. Normal permissions are automatically granted at install time in Android applications. */ @@ -1312,894 +1101,6 @@ declare module "godot" { get delta_smoothing(): boolean set delta_smoothing(value: boolean) } - // _singleton_class_: Engine - /** Provides access to engine properties. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_engine.html - */ - class Engine extends Object { - /** Returns the fraction through the current physics tick we are at the time of rendering the frame. This can be used to implement fixed timestep interpolation. */ - static get_physics_interpolation_fraction(): float64 - - /** Returns the total number of frames drawn since the engine started. - * - * **Note:** On headless platforms, or if rendering is disabled with `--disable-render-loop` via command line, this method always returns `0`. See also [method get_process_frames]. - */ - static get_frames_drawn(): int64 - - /** Returns the average frames rendered every second (FPS), also known as the framerate. */ - static get_frames_per_second(): float64 - - /** Returns the total number of frames passed since the engine started. This number is increased every **physics frame**. See also [method get_process_frames]. - * This method can be used to run expensive logic less often without relying on a [Timer]: - * - */ - static get_physics_frames(): int64 - - /** Returns the total number of frames passed since the engine started. This number is increased every **process frame**, regardless of whether the render loop is enabled. See also [method get_frames_drawn] and [method get_physics_frames]. - * This method can be used to run expensive logic less often without relying on a [Timer]: - * - */ - static get_process_frames(): int64 - - /** Returns the instance of the [MainLoop]. This is usually the main [SceneTree] and is the same as [method Node.get_tree]. - * - * **Note:** The type instantiated as the main loop can changed with [member ProjectSettings.application/run/main_loop_type]. - */ - static get_main_loop(): MainLoop - - /** Returns the current engine version information as a [Dictionary] containing the following entries: - * - `major` - Major version number as an int; - * - `minor` - Minor version number as an int; - * - `patch` - Patch version number as an int; - * - `hex` - Full version encoded as a hexadecimal int with one byte (2 hex digits) per number (see example below); - * - `status` - Status (such as "beta", "rc1", "rc2", "stable", etc.) as a String; - * - `build` - Build name (e.g. "custom_build") as a String; - * - `hash` - Full Git commit hash as a String; - * - `timestamp` - Holds the Git commit date UNIX timestamp in seconds as an int, or `0` if unavailable; - * - `string` - `major`, `minor`, `patch`, `status`, and `build` in a single String. - * The `hex` value is encoded as follows, from left to right: one byte for the major, one byte for the minor, one byte for the patch version. For example, "3.1.12" would be `0x03010C`. - * - * **Note:** The `hex` value is still an [int] internally, and printing it will give you its decimal representation, which is not particularly meaningful. Use hexadecimal literals for quick version comparisons from code: - * - */ - static get_version_info(): GDictionary - - /** Returns the engine author information as a [Dictionary], where each entry is an [Array] of strings with the names of notable contributors to the Godot Engine: `lead_developers`, `founders`, `project_managers`, and `developers`. */ - static get_author_info(): GDictionary - - /** Returns an [Array] of dictionaries with copyright information for every component of Godot's source code. - * Every [Dictionary] contains a `name` identifier, and a `parts` array of dictionaries. It describes the component in detail with the following entries: - * - `files` - [Array] of file paths from the source code affected by this component; - * - `copyright` - [Array] of owners of this component; - * - `license` - The license applied to this component (such as "[url=https://en.wikipedia.org/wiki/MIT_License#Ambiguity_and_variants]Expat[/url]" or "[url=https://creativecommons.org/licenses/by/4.0/]CC-BY-4.0[/url]"). - */ - static get_copyright_info(): GArray - - /** Returns a [Dictionary] of categorized donor names. Each entry is an [Array] of strings: - * {`platinum_sponsors`, `gold_sponsors`, `silver_sponsors`, `bronze_sponsors`, `mini_sponsors`, `gold_donors`, `silver_donors`, `bronze_donors`} - */ - static get_donor_info(): GDictionary - - /** Returns a [Dictionary] of licenses used by Godot and included third party components. Each entry is a license name (such as "[url=https://en.wikipedia.org/wiki/MIT_License#Ambiguity_and_variants]Expat[/url]") and its associated text. */ - static get_license_info(): GDictionary - - /** Returns the full Godot license text. */ - static get_license_text(): string - - /** Returns the name of the CPU architecture the Godot binary was built for. Possible return values include `"x86_64"`, `"x86_32"`, `"arm64"`, `"arm32"`, `"rv64"`, `"riscv"`, `"ppc64"`, `"ppc"`, `"wasm64"`, and `"wasm32"`. - * To detect whether the current build is 64-bit, you can use the fact that all 64-bit architecture names contain `64` in their name: - * - * - * **Note:** This method does *not* return the name of the system's CPU architecture (like [method OS.get_processor_name]). For example, when running an `x86_32` Godot binary on an `x86_64` system, the returned value will still be `"x86_32"`. - */ - static get_architecture_name(): string - - /** Returns `true` if the engine is inside the fixed physics process step of the main loop. - * - */ - static is_in_physics_frame(): boolean - - /** Returns `true` if a singleton with the given [param name] exists in the global scope. See also [method get_singleton]. - * - * - * **Note:** Global singletons are not the same as autoloaded nodes, which are configurable in the project settings. - */ - static has_singleton(name: StringName): boolean - - /** Returns the global singleton with the given [param name], or `null` if it does not exist. Often used for plugins. See also [method has_singleton] and [method get_singleton_list]. - * - * **Note:** Global singletons are not the same as autoloaded nodes, which are configurable in the project settings. - */ - static get_singleton(name: StringName): Object - - /** Registers the given [Object] [param instance] as a singleton, available globally under [param name]. Useful for plugins. */ - static register_singleton(name: StringName, instance: Object): void - - /** Removes the singleton registered under [param name]. The singleton object is *not* freed. Only works with user-defined singletons registered with [method register_singleton]. */ - static unregister_singleton(name: StringName): void - - /** Returns a list of names of all available global singletons. See also [method get_singleton]. */ - static get_singleton_list(): PackedStringArray - - /** Registers a [ScriptLanguage] instance to be available with `ScriptServer`. - * Returns: - * - [constant OK] on success; - * - [constant ERR_UNAVAILABLE] if `ScriptServer` has reached the limit and cannot register any new language; - * - [constant ERR_ALREADY_EXISTS] if `ScriptServer` already contains a language with similar extension/name/type. - */ - static register_script_language(language: ScriptLanguage): GError - - /** Unregisters the [ScriptLanguage] instance from `ScriptServer`. - * Returns: - * - [constant OK] on success; - * - [constant ERR_DOES_NOT_EXIST] if the language is not registered in `ScriptServer`. - */ - static unregister_script_language(language: ScriptLanguage): GError - - /** Returns the number of available script languages. Use with [method get_script_language]. */ - static get_script_language_count(): int64 - - /** Returns an instance of a [ScriptLanguage] with the given [param index]. */ - static get_script_language(index: int64): ScriptLanguage - - /** Returns `true` if the script is currently running inside the editor, otherwise returns `false`. This is useful for `@tool` scripts to conditionally draw editor helpers, or prevent accidentally running "game" code that would affect the scene state while in the editor: - * - * See [url=https://docs.godotengine.org/en/4.3/tutorials/plugins/running_code_in_the_editor.html]Running code in the editor[/url] in the documentation for more information. - * - * **Note:** To detect whether the script is running on an editor *build* (such as when pressing [kbd]F5[/kbd]), use [method OS.has_feature] with the `"editor"` argument instead. `OS.has_feature("editor")` evaluate to `true` both when the script is running in the editor and when running the project from the editor, but returns `false` when run from an exported project. - */ - static is_editor_hint(): boolean - - /** Returns the path to the [MovieWriter]'s output file, or an empty string if the engine wasn't started in Movie Maker mode. The default path can be changed in [member ProjectSettings.editor/movie_writer/movie_file]. */ - static get_write_movie_path(): string - - /** If `false`, stops printing error and warning messages to the console and editor Output log. This can be used to hide error and warning messages during unit test suite runs. This property is equivalent to the [member ProjectSettings.application/run/disable_stderr] project setting. - * - * **Note:** This property does not impact the editor's Errors tab when running a project from the editor. - * **Warning:** If set to `false` anywhere in the project, important error messages may be hidden even if they are emitted from other scripts. In a `@tool` script, this will also impact the editor itself. Do *not* report bugs before ensuring error messages are enabled (as they are by default). - */ - get print_error_messages(): boolean - set print_error_messages(value: boolean) - - /** The number of fixed iterations per second. This controls how often physics simulation and [method Node._physics_process] methods are run. This value should generally always be set to `60` or above, as Godot doesn't interpolate the physics step. As a result, values lower than `60` will look stuttery. This value can be increased to make input more reactive or work around collision tunneling issues, but keep in mind doing so will increase CPU usage. See also [member max_fps] and [member ProjectSettings.physics/common/physics_ticks_per_second]. - * - * **Note:** Only [member max_physics_steps_per_frame] physics ticks may be simulated per rendered frame at most. If more physics ticks have to be simulated per rendered frame to keep up with rendering, the project will appear to slow down (even if `delta` is used consistently in physics calculations). Therefore, it is recommended to also increase [member max_physics_steps_per_frame] if increasing [member physics_ticks_per_second] significantly above its default value. - */ - get physics_ticks_per_second(): int64 - set physics_ticks_per_second(value: int64) - - /** The maximum number of physics steps that can be simulated each rendered frame. - * - * **Note:** The default value is tuned to prevent expensive physics simulations from triggering even more expensive simulations indefinitely. However, the game will appear to slow down if the rendering FPS is less than `1 / max_physics_steps_per_frame` of [member physics_ticks_per_second]. This occurs even if `delta` is consistently used in physics calculations. To avoid this, increase [member max_physics_steps_per_frame] if you have increased [member physics_ticks_per_second] significantly above its default value. - */ - get max_physics_steps_per_frame(): int64 - set max_physics_steps_per_frame(value: int64) - - /** The maximum number of frames that can be rendered every second (FPS). A value of `0` means the framerate is uncapped. - * Limiting the FPS can be useful to reduce the host machine's power consumption, which reduces heat, noise emissions, and improves battery life. - * If [member ProjectSettings.display/window/vsync/vsync_mode] is **Enabled** or **Adaptive**, the setting takes precedence and the max FPS number cannot exceed the monitor's refresh rate. - * If [member ProjectSettings.display/window/vsync/vsync_mode] is **Enabled**, on monitors with variable refresh rate enabled (G-Sync/FreeSync), using an FPS limit a few frames lower than the monitor's refresh rate will [url=https://blurbusters.com/howto-low-lag-vsync-on/]reduce input lag while avoiding tearing[/url]. - * See also [member physics_ticks_per_second] and [member ProjectSettings.application/run/max_fps]. - * - * **Note:** The actual number of frames per second may still be below this value if the CPU or GPU cannot keep up with the project's logic and rendering. - * - * **Note:** If [member ProjectSettings.display/window/vsync/vsync_mode] is **Disabled**, limiting the FPS to a high value that can be consistently reached on the system can reduce input lag compared to an uncapped framerate. Since this works by ensuring the GPU load is lower than 100%, this latency reduction is only effective in GPU-bottlenecked scenarios, not CPU-bottlenecked scenarios. - */ - get max_fps(): int64 - set max_fps(value: int64) - - /** The speed multiplier at which the in-game clock updates, compared to real time. For example, if set to `2.0` the game runs twice as fast, and if set to `0.5` the game runs half as fast. - * This value affects [Timer], [SceneTreeTimer], and all other simulations that make use of `delta` time (such as [method Node._process] and [method Node._physics_process]). - * - * **Note:** It's recommended to keep this property above `0.0`, as the game may behave unexpectedly otherwise. - * - * **Note:** This does not affect audio playback speed. Use [member AudioServer.playback_speed_scale] to adjust audio playback speed independently of [member Engine.time_scale]. - * - * **Note:** This does not automatically adjust [member physics_ticks_per_second]. With values above `1.0` physics simulation may become less precise, as each physics tick will stretch over a larger period of engine time. If you're modifying [member Engine.time_scale] to speed up simulation by a large factor, consider also increasing [member physics_ticks_per_second] to make the simulation more reliable. - */ - get time_scale(): float64 - set time_scale(value: float64) - - /** How much physics ticks are synchronized with real time. If `0` or less, the ticks are fully synchronized. Higher values cause the in-game clock to deviate more from the real clock, but they smooth out framerate jitters. - * - * **Note:** The default value of `0.5` should be good enough for most cases; values above `2` could cause the game to react to dropped frames with a noticeable delay and are not recommended. - * - * **Note:** When using a custom physics interpolation solution, or within a network game, it's recommended to disable the physics jitter fix by setting this property to `0`. - */ - get physics_jitter_fix(): float64 - set physics_jitter_fix(value: float64) - } - // _singleton_class_: ClassDB - /** A class information repository. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_classdb.html - */ - class ClassDB extends Object { - /** Returns the names of all the classes available. */ - static get_class_list(): PackedStringArray - - /** Returns the names of all the classes that directly or indirectly inherit from [param class]. */ - static get_inheriters_from_class(class_: StringName): PackedStringArray - - /** Returns the parent class of [param class]. */ - static get_parent_class(class_: StringName): StringName - - /** Returns whether the specified [param class] is available or not. */ - static class_exists(class_: StringName): boolean - - /** Returns whether [param inherits] is an ancestor of [param class] or not. */ - static is_parent_class(class_: StringName, inherits: StringName): boolean - - /** Returns `true` if objects can be instantiated from the specified [param class], otherwise returns `false`. */ - static can_instantiate(class_: StringName): boolean - - /** Creates an instance of [param class]. */ - static instantiate(class_: StringName): any - - /** Returns whether [param class] or its ancestry has a signal called [param signal] or not. */ - static class_has_signal(class_: StringName, signal: StringName): boolean - - /** Returns the [param signal] data of [param class] or its ancestry. The returned value is a [Dictionary] with the following keys: `args`, `default_args`, `flags`, `id`, `name`, `return: (class_name, hint, hint_string, name, type, usage)`. */ - static class_get_signal(class_: StringName, signal: StringName): GDictionary - - /** Returns an array with all the signals of [param class] or its ancestry if [param no_inheritance] is `false`. Every element of the array is a [Dictionary] as described in [method class_get_signal]. */ - static class_get_signal_list(class_: StringName, no_inheritance: boolean = false): GArray - - /** Returns an array with all the properties of [param class] or its ancestry if [param no_inheritance] is `false`. */ - static class_get_property_list(class_: StringName, no_inheritance: boolean = false): GArray - - /** Returns the value of [param property] of [param object] or its ancestry. */ - static class_get_property(object: Object, property: StringName): any - - /** Sets [param property] value of [param object] to [param value]. */ - static class_set_property(object: Object, property: StringName, value: any): GError - - /** Returns the default value of [param property] of [param class] or its ancestor classes. */ - static class_get_property_default_value(class_: StringName, property: StringName): any - - /** Returns whether [param class] (or its ancestry if [param no_inheritance] is `false`) has a method called [param method] or not. */ - static class_has_method(class_: StringName, method: StringName, no_inheritance: boolean = false): boolean - - /** Returns the number of arguments of the method [param method] of [param class] or its ancestry if [param no_inheritance] is `false`. */ - static class_get_method_argument_count(class_: StringName, method: StringName, no_inheritance: boolean = false): int64 - - /** Returns an array with all the methods of [param class] or its ancestry if [param no_inheritance] is `false`. Every element of the array is a [Dictionary] with the following keys: `args`, `default_args`, `flags`, `id`, `name`, `return: (class_name, hint, hint_string, name, type, usage)`. - * - * **Note:** In exported release builds the debug info is not available, so the returned dictionaries will contain only method names. - */ - static class_get_method_list(class_: StringName, no_inheritance: boolean = false): GArray - - /** Returns an array with the names all the integer constants of [param class] or its ancestry. */ - static class_get_integer_constant_list(class_: StringName, no_inheritance: boolean = false): PackedStringArray - - /** Returns whether [param class] or its ancestry has an integer constant called [param name] or not. */ - static class_has_integer_constant(class_: StringName, name: StringName): boolean - - /** Returns the value of the integer constant [param name] of [param class] or its ancestry. Always returns 0 when the constant could not be found. */ - static class_get_integer_constant(class_: StringName, name: StringName): int64 - - /** Returns whether [param class] or its ancestry has an enum called [param name] or not. */ - static class_has_enum(class_: StringName, name: StringName, no_inheritance: boolean = false): boolean - - /** Returns an array with all the enums of [param class] or its ancestry. */ - static class_get_enum_list(class_: StringName, no_inheritance: boolean = false): PackedStringArray - - /** Returns an array with all the keys in [param enum] of [param class] or its ancestry. */ - static class_get_enum_constants(class_: StringName, enum_: StringName, no_inheritance: boolean = false): PackedStringArray - - /** Returns which enum the integer constant [param name] of [param class] or its ancestry belongs to. */ - static class_get_integer_constant_enum(class_: StringName, name: StringName, no_inheritance: boolean = false): StringName - - /** Returns whether [param class] (or its ancestor classes if [param no_inheritance] is `false`) has an enum called [param enum] that is a bitfield. */ - static is_class_enum_bitfield(class_: StringName, enum_: StringName, no_inheritance: boolean = false): boolean - - /** Returns whether this [param class] is enabled or not. */ - static is_class_enabled(class_: StringName): boolean - } - // _singleton_class_: Marshalls - /** Data transformation (marshaling) and encoding helpers. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_marshalls.html - */ - class Marshalls extends Object { - /** Returns a Base64-encoded string of the [Variant] [param variant]. If [param full_objects] is `true`, encoding objects is allowed (and can potentially include code). - * Internally, this uses the same encoding mechanism as the [method @GlobalScope.var_to_bytes] method. - */ - static variant_to_base64(variant: any, full_objects: boolean = false): string - - /** Returns a decoded [Variant] corresponding to the Base64-encoded string [param base64_str]. If [param allow_objects] is `true`, decoding objects is allowed. - * Internally, this uses the same decoding mechanism as the [method @GlobalScope.bytes_to_var] method. - * **Warning:** Deserialized objects can contain code which gets executed. Do not use this option if the serialized object comes from untrusted sources to avoid potential security threats such as remote code execution. - */ - static base64_to_variant(base64_str: string, allow_objects: boolean = false): any - - /** Returns a Base64-encoded string of a given [PackedByteArray]. */ - static raw_to_base64(array: PackedByteArray | byte[] | ArrayBuffer): string - - /** Returns a decoded [PackedByteArray] corresponding to the Base64-encoded string [param base64_str]. */ - static base64_to_raw(base64_str: string): PackedByteArray - - /** Returns a Base64-encoded string of the UTF-8 string [param utf8_str]. */ - static utf8_to_base64(utf8_str: string): string - - /** Returns a decoded string corresponding to the Base64-encoded string [param base64_str]. */ - static base64_to_utf8(base64_str: string): string - } - // _singleton_class_: TranslationServer - /** The server responsible for language translations. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_translationserver.html - */ - class TranslationServer extends Object { - /** Sets the locale of the project. The [param locale] string will be standardized to match known locales (e.g. `en-US` would be matched to `en_US`). - * If translations have been loaded beforehand for the new locale, they will be applied. - */ - static set_locale(locale: string): void - - /** Returns the current locale of the project. - * See also [method OS.get_locale] and [method OS.get_locale_language] to query the locale of the user system. - */ - static get_locale(): string - - /** Returns the current locale of the editor. - * - * **Note:** When called from an exported project returns the same value as [method get_locale]. - */ - static get_tool_locale(): string - - /** Compares two locales and returns a similarity score between `0` (no match) and `10` (full match). */ - static compare_locales(locale_a: string, locale_b: string): int64 - - /** Returns a [param locale] string standardized to match known locales (e.g. `en-US` would be matched to `en_US`). */ - static standardize_locale(locale: string): string - - /** Returns array of known language codes. */ - static get_all_languages(): PackedStringArray - - /** Returns a readable language name for the [param language] code. */ - static get_language_name(language: string): string - - /** Returns an array of known script codes. */ - static get_all_scripts(): PackedStringArray - - /** Returns a readable script name for the [param script] code. */ - static get_script_name(script: string): string - - /** Returns an array of known country codes. */ - static get_all_countries(): PackedStringArray - - /** Returns a readable country name for the [param country] code. */ - static get_country_name(country: string): string - - /** Returns a locale's language and its variant (e.g. `"en_US"` would return `"English (United States)"`). */ - static get_locale_name(locale: string): string - - /** Returns the current locale's translation for the given message (key) and context. */ - static translate(message: StringName, context: StringName = ''): StringName - - /** Returns the current locale's translation for the given message (key), plural message and context. - * The number [param n] is the number or quantity of the plural object. It will be used to guide the translation system to fetch the correct plural form for the selected language. - */ - static translate_plural(message: StringName, plural_message: StringName, n: int64, context: StringName = ''): StringName - - /** Adds a [Translation] resource. */ - static add_translation(translation: Translation): void - - /** Removes the given translation from the server. */ - static remove_translation(translation: Translation): void - - /** Returns the [Translation] instance based on the [param locale] passed in. - * It will return `null` if there is no [Translation] instance that matches the [param locale]. - */ - static get_translation_object(locale: string): Translation - - /** Clears the server from all translations. */ - static clear(): void - - /** Returns an array of all loaded locales of the project. */ - static get_loaded_locales(): PackedStringArray - - /** Reparses the pseudolocalization options and reloads the translation. */ - static reload_pseudolocalization(): void - - /** Returns the pseudolocalized string based on the [param message] passed in. */ - static pseudolocalize(message: StringName): StringName - - /** If `true`, enables the use of pseudolocalization. See [member ProjectSettings.internationalization/pseudolocalization/use_pseudolocalization] for details. */ - get pseudolocalization_enabled(): boolean - set pseudolocalization_enabled(value: boolean) - } - // _singleton_class_: Input - namespace Input { - enum MouseMode { - /** Makes the mouse cursor visible if it is hidden. */ - MOUSE_MODE_VISIBLE = 0, - - /** Makes the mouse cursor hidden if it is visible. */ - MOUSE_MODE_HIDDEN = 1, - - /** Captures the mouse. The mouse will be hidden and its position locked at the center of the window manager's window. - * - * **Note:** If you want to process the mouse's movement in this mode, you need to use [member InputEventMouseMotion.relative]. - */ - MOUSE_MODE_CAPTURED = 2, - - /** Confines the mouse cursor to the game window, and make it visible. */ - MOUSE_MODE_CONFINED = 3, - - /** Confines the mouse cursor to the game window, and make it hidden. */ - MOUSE_MODE_CONFINED_HIDDEN = 4, - } - enum CursorShape { - /** Arrow cursor. Standard, default pointing cursor. */ - CURSOR_ARROW = 0, - - /** I-beam cursor. Usually used to show where the text cursor will appear when the mouse is clicked. */ - CURSOR_IBEAM = 1, - - /** Pointing hand cursor. Usually used to indicate the pointer is over a link or other interactable item. */ - CURSOR_POINTING_HAND = 2, - - /** Cross cursor. Typically appears over regions in which a drawing operation can be performed or for selections. */ - CURSOR_CROSS = 3, - - /** Wait cursor. Indicates that the application is busy performing an operation, and that it cannot be used during the operation (e.g. something is blocking its main thread). */ - CURSOR_WAIT = 4, - - /** Busy cursor. Indicates that the application is busy performing an operation, and that it is still usable during the operation. */ - CURSOR_BUSY = 5, - - /** Drag cursor. Usually displayed when dragging something. - * - * **Note:** Windows lacks a dragging cursor, so [constant CURSOR_DRAG] is the same as [constant CURSOR_MOVE] for this platform. - */ - CURSOR_DRAG = 6, - - /** Can drop cursor. Usually displayed when dragging something to indicate that it can be dropped at the current position. */ - CURSOR_CAN_DROP = 7, - - /** Forbidden cursor. Indicates that the current action is forbidden (for example, when dragging something) or that the control at a position is disabled. */ - CURSOR_FORBIDDEN = 8, - - /** Vertical resize mouse cursor. A double-headed vertical arrow. It tells the user they can resize the window or the panel vertically. */ - CURSOR_VSIZE = 9, - - /** Horizontal resize mouse cursor. A double-headed horizontal arrow. It tells the user they can resize the window or the panel horizontally. */ - CURSOR_HSIZE = 10, - - /** Window resize mouse cursor. The cursor is a double-headed arrow that goes from the bottom left to the top right. It tells the user they can resize the window or the panel both horizontally and vertically. */ - CURSOR_BDIAGSIZE = 11, - - /** Window resize mouse cursor. The cursor is a double-headed arrow that goes from the top left to the bottom right, the opposite of [constant CURSOR_BDIAGSIZE]. It tells the user they can resize the window or the panel both horizontally and vertically. */ - CURSOR_FDIAGSIZE = 12, - - /** Move cursor. Indicates that something can be moved. */ - CURSOR_MOVE = 13, - - /** Vertical split mouse cursor. On Windows, it's the same as [constant CURSOR_VSIZE]. */ - CURSOR_VSPLIT = 14, - - /** Horizontal split mouse cursor. On Windows, it's the same as [constant CURSOR_HSIZE]. */ - CURSOR_HSPLIT = 15, - - /** Help cursor. Usually a question mark. */ - CURSOR_HELP = 16, - } - } - /** A singleton for handling inputs. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_input.html - */ - class Input extends Object { - /** Returns `true` if any action, key, joypad button, or mouse button is being pressed. This will also return `true` if any action is simulated via code by calling [method action_press]. */ - static is_anything_pressed(): boolean - - /** Returns `true` if you are pressing the Latin key in the current keyboard layout. You can pass a [enum Key] constant. - * [method is_key_pressed] is only recommended over [method is_physical_key_pressed] in non-game applications. This ensures that shortcut keys behave as expected depending on the user's keyboard layout, as keyboard shortcuts are generally dependent on the keyboard layout in non-game applications. If in doubt, use [method is_physical_key_pressed]. - * - * **Note:** Due to keyboard ghosting, [method is_key_pressed] may return `false` even if one of the action's keys is pressed. See [url=https://docs.godotengine.org/en/4.3/tutorials/inputs/input_examples.html#keyboard-events]Input examples[/url] in the documentation for more information. - */ - static is_key_pressed(keycode: Key): boolean - - /** Returns `true` if you are pressing the key in the physical location on the 101/102-key US QWERTY keyboard. You can pass a [enum Key] constant. - * [method is_physical_key_pressed] is recommended over [method is_key_pressed] for in-game actions, as it will make [kbd]W[/kbd]/[kbd]A[/kbd]/[kbd]S[/kbd]/[kbd]D[/kbd] layouts work regardless of the user's keyboard layout. [method is_physical_key_pressed] will also ensure that the top row number keys work on any keyboard layout. If in doubt, use [method is_physical_key_pressed]. - * - * **Note:** Due to keyboard ghosting, [method is_physical_key_pressed] may return `false` even if one of the action's keys is pressed. See [url=https://docs.godotengine.org/en/4.3/tutorials/inputs/input_examples.html#keyboard-events]Input examples[/url] in the documentation for more information. - */ - static is_physical_key_pressed(keycode: Key): boolean - - /** Returns `true` if you are pressing the key with the [param keycode] printed on it. You can pass a [enum Key] constant or any Unicode character code. */ - static is_key_label_pressed(keycode: Key): boolean - - /** Returns `true` if you are pressing the mouse button specified with [enum MouseButton]. */ - static is_mouse_button_pressed(button: MouseButton): boolean - - /** Returns `true` if you are pressing the joypad button (see [enum JoyButton]). */ - static is_joy_button_pressed(device: int64, button: JoyButton): boolean - - /** Returns `true` if you are pressing the action event. - * If [param exact_match] is `false`, it ignores additional input modifiers for [InputEventKey] and [InputEventMouseButton] events, and the direction for [InputEventJoypadMotion] events. - * - * **Note:** Due to keyboard ghosting, [method is_action_pressed] may return `false` even if one of the action's keys is pressed. See [url=https://docs.godotengine.org/en/4.3/tutorials/inputs/input_examples.html#keyboard-events]Input examples[/url] in the documentation for more information. - */ - static is_action_pressed(action: StringName, exact_match: boolean = false): boolean - - /** Returns `true` when the user has *started* pressing the action event in the current frame or physics tick. It will only return `true` on the frame or tick that the user pressed down the button. - * This is useful for code that needs to run only once when an action is pressed, instead of every frame while it's pressed. - * If [param exact_match] is `false`, it ignores additional input modifiers for [InputEventKey] and [InputEventMouseButton] events, and the direction for [InputEventJoypadMotion] events. - * - * **Note:** Returning `true` does not imply that the action is *still* pressed. An action can be pressed and released again rapidly, and `true` will still be returned so as not to miss input. - * - * **Note:** Due to keyboard ghosting, [method is_action_just_pressed] may return `false` even if one of the action's keys is pressed. See [url=https://docs.godotengine.org/en/4.3/tutorials/inputs/input_examples.html#keyboard-events]Input examples[/url] in the documentation for more information. - * - * **Note:** During input handling (e.g. [method Node._input]), use [method InputEvent.is_action_pressed] instead to query the action state of the current event. - */ - static is_action_just_pressed(action: StringName, exact_match: boolean = false): boolean - - /** Returns `true` when the user *stops* pressing the action event in the current frame or physics tick. It will only return `true` on the frame or tick that the user releases the button. - * - * **Note:** Returning `true` does not imply that the action is *still* not pressed. An action can be released and pressed again rapidly, and `true` will still be returned so as not to miss input. - * If [param exact_match] is `false`, it ignores additional input modifiers for [InputEventKey] and [InputEventMouseButton] events, and the direction for [InputEventJoypadMotion] events. - * - * **Note:** During input handling (e.g. [method Node._input]), use [method InputEvent.is_action_released] instead to query the action state of the current event. - */ - static is_action_just_released(action: StringName, exact_match: boolean = false): boolean - - /** Returns a value between 0 and 1 representing the intensity of the given action. In a joypad, for example, the further away the axis (analog sticks or L2, R2 triggers) is from the dead zone, the closer the value will be to 1. If the action is mapped to a control that has no axis such as the keyboard, the value returned will be 0 or 1. - * If [param exact_match] is `false`, it ignores additional input modifiers for [InputEventKey] and [InputEventMouseButton] events, and the direction for [InputEventJoypadMotion] events. - */ - static get_action_strength(action: StringName, exact_match: boolean = false): float64 - - /** Returns a value between 0 and 1 representing the raw intensity of the given action, ignoring the action's deadzone. In most cases, you should use [method get_action_strength] instead. - * If [param exact_match] is `false`, it ignores additional input modifiers for [InputEventKey] and [InputEventMouseButton] events, and the direction for [InputEventJoypadMotion] events. - */ - static get_action_raw_strength(action: StringName, exact_match: boolean = false): float64 - - /** Get axis input by specifying two actions, one negative and one positive. - * This is a shorthand for writing `Input.get_action_strength("positive_action") - Input.get_action_strength("negative_action")`. - */ - static get_axis(negative_action: StringName, positive_action: StringName): float64 - - /** Gets an input vector by specifying four actions for the positive and negative X and Y axes. - * This method is useful when getting vector input, such as from a joystick, directional pad, arrows, or WASD. The vector has its length limited to 1 and has a circular deadzone, which is useful for using vector input as movement. - * By default, the deadzone is automatically calculated from the average of the action deadzones. However, you can override the deadzone to be whatever you want (on the range of 0 to 1). - */ - static get_vector(negative_x: StringName, positive_x: StringName, negative_y: StringName, positive_y: StringName, deadzone: float64 = -1): Vector2 - - /** Adds a new mapping entry (in SDL2 format) to the mapping database. Optionally update already connected devices. */ - static add_joy_mapping(mapping: string, update_existing: boolean = false): void - - /** Removes all mappings from the internal database that match the given GUID. */ - static remove_joy_mapping(guid: string): void - - /** Returns `true` if the system knows the specified device. This means that it sets all button and axis indices. Unknown joypads are not expected to match these constants, but you can still retrieve events from them. */ - static is_joy_known(device: int64): boolean - - /** Returns the current value of the joypad axis at given index (see [enum JoyAxis]). */ - static get_joy_axis(device: int64, axis: JoyAxis): float64 - - /** Returns the name of the joypad at the specified device index, e.g. `PS4 Controller`. Godot uses the [url=https://github.com/gabomdq/SDL_GameControllerDB]SDL2 game controller database[/url] to determine gamepad names. */ - static get_joy_name(device: int64): string - - /** Returns an SDL2-compatible device GUID on platforms that use gamepad remapping, e.g. `030000004c050000c405000000010000`. Returns `"Default Gamepad"` otherwise. Godot uses the [url=https://github.com/gabomdq/SDL_GameControllerDB]SDL2 game controller database[/url] to determine gamepad names and mappings based on this GUID. */ - static get_joy_guid(device: int64): string - - /** Returns a dictionary with extra platform-specific information about the device, e.g. the raw gamepad name from the OS or the Steam Input index. - * On Windows the dictionary contains the following fields: - * `xinput_index`: The index of the controller in the XInput system. - * On Linux: - * `raw_name`: The name of the controller as it came from the OS, before getting renamed by the godot controller database. - * `vendor_id`: The USB vendor ID of the device. - * `product_id`: The USB product ID of the device. - * `steam_input_index`: The Steam Input gamepad index, if the device is not a Steam Input device this key won't be present. - */ - static get_joy_info(device: int64): GDictionary - - /** Queries whether an input device should be ignored or not. Devices can be ignored by setting the environment variable `SDL_GAMECONTROLLER_IGNORE_DEVICES`. Read the [url=https://wiki.libsdl.org/SDL2]SDL documentation[/url] for more information. - * - * **Note:** Some 3rd party tools can contribute to the list of ignored devices. For example, *SteamInput* creates virtual devices from physical devices for remapping purposes. To avoid handling the same input device twice, the original device is added to the ignore list. - */ - static should_ignore_device(vendor_id: int64, product_id: int64): boolean - - /** Returns an [Array] containing the device IDs of all currently connected joypads. */ - static get_connected_joypads(): GArray - - /** Returns the strength of the joypad vibration: x is the strength of the weak motor, and y is the strength of the strong motor. */ - static get_joy_vibration_strength(device: int64): Vector2 - - /** Returns the duration of the current vibration effect in seconds. */ - static get_joy_vibration_duration(device: int64): float64 - - /** Starts to vibrate the joypad. Joypads usually come with two rumble motors, a strong and a weak one. [param weak_magnitude] is the strength of the weak motor (between 0 and 1) and [param strong_magnitude] is the strength of the strong motor (between 0 and 1). [param duration] is the duration of the effect in seconds (a duration of 0 will try to play the vibration indefinitely). The vibration can be stopped early by calling [method stop_joy_vibration]. - * - * **Note:** Not every hardware is compatible with long effect durations; it is recommended to restart an effect if it has to be played for more than a few seconds. - * - * **Note:** For macOS, vibration is only supported in macOS 11 and later. - */ - static start_joy_vibration(device: int64, weak_magnitude: float64, strong_magnitude: float64, duration: float64 = 0): void - - /** Stops the vibration of the joypad started with [method start_joy_vibration]. */ - static stop_joy_vibration(device: int64): void - - /** Vibrate the handheld device for the specified duration in milliseconds. - * [param amplitude] is the strength of the vibration, as a value between `0.0` and `1.0`. If set to `-1.0`, the default vibration strength of the device is used. - * - * **Note:** This method is implemented on Android, iOS, and Web. It has no effect on other platforms. - * - * **Note:** For Android, [method vibrate_handheld] requires enabling the `VIBRATE` permission in the export preset. Otherwise, [method vibrate_handheld] will have no effect. - * - * **Note:** For iOS, specifying the duration is only supported in iOS 13 and later. - * - * **Note:** For Web, the amplitude cannot be changed. - * - * **Note:** Some web browsers such as Safari and Firefox for Android do not support [method vibrate_handheld]. - */ - static vibrate_handheld(duration_ms: int64 = 500, amplitude: float64 = -1): void - - /** Returns the gravity in m/s² of the device's accelerometer sensor, if the device has one. Otherwise, the method returns [constant Vector3.ZERO]. - * - * **Note:** This method only works on Android and iOS. On other platforms, it always returns [constant Vector3.ZERO]. - */ - static get_gravity(): Vector3 - - /** Returns the acceleration in m/s² of the device's accelerometer sensor, if the device has one. Otherwise, the method returns [constant Vector3.ZERO]. - * Note this method returns an empty [Vector3] when running from the editor even when your device has an accelerometer. You must export your project to a supported device to read values from the accelerometer. - * - * **Note:** This method only works on Android and iOS. On other platforms, it always returns [constant Vector3.ZERO]. - */ - static get_accelerometer(): Vector3 - - /** Returns the magnetic field strength in micro-Tesla for all axes of the device's magnetometer sensor, if the device has one. Otherwise, the method returns [constant Vector3.ZERO]. - * - * **Note:** This method only works on Android and iOS. On other platforms, it always returns [constant Vector3.ZERO]. - */ - static get_magnetometer(): Vector3 - - /** Returns the rotation rate in rad/s around a device's X, Y, and Z axes of the gyroscope sensor, if the device has one. Otherwise, the method returns [constant Vector3.ZERO]. - * - * **Note:** This method only works on Android and iOS. On other platforms, it always returns [constant Vector3.ZERO]. - */ - static get_gyroscope(): Vector3 - - /** Sets the gravity value of the accelerometer sensor. Can be used for debugging on devices without a hardware sensor, for example in an editor on a PC. - * - * **Note:** This value can be immediately overwritten by the hardware sensor value on Android and iOS. - */ - static set_gravity(value: Vector3): void - - /** Sets the acceleration value of the accelerometer sensor. Can be used for debugging on devices without a hardware sensor, for example in an editor on a PC. - * - * **Note:** This value can be immediately overwritten by the hardware sensor value on Android and iOS. - */ - static set_accelerometer(value: Vector3): void - - /** Sets the value of the magnetic field of the magnetometer sensor. Can be used for debugging on devices without a hardware sensor, for example in an editor on a PC. - * - * **Note:** This value can be immediately overwritten by the hardware sensor value on Android and iOS. - */ - static set_magnetometer(value: Vector3): void - - /** Sets the value of the rotation rate of the gyroscope sensor. Can be used for debugging on devices without a hardware sensor, for example in an editor on a PC. - * - * **Note:** This value can be immediately overwritten by the hardware sensor value on Android and iOS. - */ - static set_gyroscope(value: Vector3): void - - /** Returns the last mouse velocity. To provide a precise and jitter-free velocity, mouse velocity is only calculated every 0.1s. Therefore, mouse velocity will lag mouse movements. */ - static get_last_mouse_velocity(): Vector2 - - /** Returns the last mouse velocity in screen coordinates. To provide a precise and jitter-free velocity, mouse velocity is only calculated every 0.1s. Therefore, mouse velocity will lag mouse movements. */ - static get_last_mouse_screen_velocity(): Vector2 - - /** Returns mouse buttons as a bitmask. If multiple mouse buttons are pressed at the same time, the bits are added together. Equivalent to [method DisplayServer.mouse_get_button_state]. */ - static get_mouse_button_mask(): MouseButtonMask - - /** Sets the mouse position to the specified vector, provided in pixels and relative to an origin at the upper left corner of the currently focused Window Manager game window. - * Mouse position is clipped to the limits of the screen resolution, or to the limits of the game window if [enum MouseMode] is set to [constant MOUSE_MODE_CONFINED] or [constant MOUSE_MODE_CONFINED_HIDDEN]. - * - * **Note:** [method warp_mouse] is only supported on Windows, macOS and Linux. It has no effect on Android, iOS and Web. - */ - static warp_mouse(position: Vector2): void - - /** This will simulate pressing the specified action. - * The strength can be used for non-boolean actions, it's ranged between 0 and 1 representing the intensity of the given action. - * - * **Note:** This method will not cause any [method Node._input] calls. It is intended to be used with [method is_action_pressed] and [method is_action_just_pressed]. If you want to simulate `_input`, use [method parse_input_event] instead. - */ - static action_press(action: StringName, strength: float64 = 1): void - - /** If the specified action is already pressed, this will release it. */ - static action_release(action: StringName): void - - /** Sets the default cursor shape to be used in the viewport instead of [constant CURSOR_ARROW]. - * - * **Note:** If you want to change the default cursor shape for [Control]'s nodes, use [member Control.mouse_default_cursor_shape] instead. - * - * **Note:** This method generates an [InputEventMouseMotion] to update cursor immediately. - */ - static set_default_cursor_shape(shape: Input.CursorShape = 0): void - - /** Returns the currently assigned cursor shape (see [enum CursorShape]). */ - static get_current_cursor_shape(): Input.CursorShape - - /** Sets a custom mouse cursor image, which is only visible inside the game window. The hotspot can also be specified. Passing `null` to the image parameter resets to the system cursor. See [enum CursorShape] for the list of shapes. - * [param image] can be either [Texture2D] or [Image] and its size must be lower than or equal to 256×256. To avoid rendering issues, sizes lower than or equal to 128×128 are recommended. - * [param hotspot] must be within [param image]'s size. - * - * **Note:** [AnimatedTexture]s aren't supported as custom mouse cursors. If using an [AnimatedTexture], only the first frame will be displayed. - * - * **Note:** The **Lossless**, **Lossy** or **Uncompressed** compression modes are recommended. The **Video RAM** compression mode can be used, but it will be decompressed on the CPU, which means loading times are slowed down and no memory is saved compared to lossless modes. - * - * **Note:** On the web platform, the maximum allowed cursor image size is 128×128. Cursor images larger than 32×32 will also only be displayed if the mouse cursor image is entirely located within the page for [url=https://chromestatus.com/feature/5825971391299584]security reasons[/url]. - */ - static set_custom_mouse_cursor(image: Resource, shape: Input.CursorShape = 0, hotspot: Vector2 = Vector2.ZERO): void - - /** Feeds an [InputEvent] to the game. Can be used to artificially trigger input events from code. Also generates [method Node._input] calls. - * **Example:** - * - * - * **Note:** Calling this function has no influence on the operating system. So for example sending an [InputEventMouseMotion] will not move the OS mouse cursor to the specified position (use [method warp_mouse] instead) and sending [kbd]Alt/Cmd + Tab[/kbd] as [InputEventKey] won't toggle between active windows. - */ - static parse_input_event(event: InputEvent): void - - /** Sends all input events which are in the current buffer to the game loop. These events may have been buffered as a result of accumulated input ([member use_accumulated_input]) or agile input flushing ([member ProjectSettings.input_devices/buffering/agile_event_flushing]). - * The engine will already do this itself at key execution points (at least once per frame). However, this can be useful in advanced cases where you want precise control over the timing of event handling. - */ - static flush_buffered_events(): void - - /** Controls the mouse mode. See [enum MouseMode] for more information. */ - get mouse_mode(): int64 - set mouse_mode(value: int64) - - /** If `true`, similar input events sent by the operating system are accumulated. When input accumulation is enabled, all input events generated during a frame will be merged and emitted when the frame is done rendering. Therefore, this limits the number of input method calls per second to the rendering FPS. - * Input accumulation can be disabled to get slightly more precise/reactive input at the cost of increased CPU usage. In applications where drawing freehand lines is required, input accumulation should generally be disabled while the user is drawing the line to get results that closely follow the actual input. - * - * **Note:** Input accumulation is *enabled* by default. - */ - get use_accumulated_input(): boolean - set use_accumulated_input(value: boolean) - - /** If `true`, sends mouse input events when tapping or swiping on the touchscreen. See also [member ProjectSettings.input_devices/pointing/emulate_mouse_from_touch]. */ - get emulate_mouse_from_touch(): boolean - set emulate_mouse_from_touch(value: boolean) - - /** If `true`, sends touch input events when clicking or dragging the mouse. See also [member ProjectSettings.input_devices/pointing/emulate_touch_from_mouse]. */ - get emulate_touch_from_mouse(): boolean - set emulate_touch_from_mouse(value: boolean) - - /** Emitted when a joypad device has been connected or disconnected. */ - static readonly joy_connection_changed: Signal2 - } - // _singleton_class_: InputMap - /** A singleton that manages all [InputEventAction]s. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_inputmap.html - */ - class InputMap extends Object { - /** Returns `true` if the [InputMap] has a registered action with the given name. */ - static has_action(action: StringName): boolean - - /** Returns an array of all actions in the [InputMap]. */ - static get_actions(): GArray - - /** Adds an empty action to the [InputMap] with a configurable [param deadzone]. - * An [InputEvent] can then be added to this action with [method action_add_event]. - */ - static add_action(action: StringName, deadzone: float64 = 0.5): void - - /** Removes an action from the [InputMap]. */ - static erase_action(action: StringName): void - - /** Sets a deadzone value for the action. */ - static action_set_deadzone(action: StringName, deadzone: float64): void - - /** Returns a deadzone value for the action. */ - static action_get_deadzone(action: StringName): float64 - - /** Adds an [InputEvent] to an action. This [InputEvent] will trigger the action. */ - static action_add_event(action: StringName, event: InputEvent): void - - /** Returns `true` if the action has the given [InputEvent] associated with it. */ - static action_has_event(action: StringName, event: InputEvent): boolean - - /** Removes an [InputEvent] from an action. */ - static action_erase_event(action: StringName, event: InputEvent): void - - /** Removes all events from an action. */ - static action_erase_events(action: StringName): void - - /** Returns an array of [InputEvent]s associated with a given action. - * - * **Note:** When used in the editor (e.g. a tool script or [EditorPlugin]), this method will return events for the editor action. If you want to access your project's input binds from the editor, read the `input/*` settings from [ProjectSettings]. - */ - static action_get_events(action: StringName): GArray - - /** Returns `true` if the given event is part of an existing action. This method ignores keyboard modifiers if the given [InputEvent] is not pressed (for proper release detection). See [method action_has_event] if you don't want this behavior. - * If [param exact_match] is `false`, it ignores additional input modifiers for [InputEventKey] and [InputEventMouseButton] events, and the direction for [InputEventJoypadMotion] events. - */ - static event_is_action(event: InputEvent, action: StringName, exact_match: boolean = false): boolean - - /** Clears all [InputEventAction] in the [InputMap] and load it anew from [ProjectSettings]. */ - static load_from_project_settings(): void - } - // _singleton_class_: EngineDebugger - /** Exposes the internal debugger. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_enginedebugger.html - */ - class EngineDebugger extends Object { - /** Returns `true` if the debugger is active otherwise `false`. */ - static is_active(): boolean - - /** Registers a profiler with the given [param name]. See [EngineProfiler] for more information. */ - static register_profiler(name: StringName, profiler: EngineProfiler): void - - /** Unregisters a profiler with given [param name]. */ - static unregister_profiler(name: StringName): void - - /** Returns `true` if a profiler with the given name is present and active otherwise `false`. */ - static is_profiling(name: StringName): boolean - - /** Returns `true` if a profiler with the given name is present otherwise `false`. */ - static has_profiler(name: StringName): boolean - - /** Calls the `add` callable of the profiler with given [param name] and [param data]. */ - static profiler_add_frame_data(name: StringName, data: GArray): void - - /** Calls the `toggle` callable of the profiler with given [param name] and [param arguments]. Enables/Disables the same profiler depending on [param enable] argument. */ - static profiler_enable(name: StringName, enable: boolean, arguments_: GArray = []): void - - /** Registers a message capture with given [param name]. If [param name] is "my_message" then messages starting with "my_message:" will be called with the given callable. - * Callable must accept a message string and a data array as argument. If the message and data are valid then callable must return `true` otherwise `false`. - */ - static register_message_capture(name: StringName, callable: Callable): void - - /** Unregisters the message capture with given [param name]. */ - static unregister_message_capture(name: StringName): void - - /** Returns `true` if a capture with the given name is present otherwise `false`. */ - static has_capture(name: StringName): boolean - - /** Forces a processing loop of debugger events. The purpose of this method is just processing events every now and then when the script might get too busy, so that bugs like infinite loops can be caught */ - static line_poll(): void - - /** Sends a message with given [param message] and [param data] array. */ - static send_message(message: string, data: GArray): void - - /** Starts a debug break in script execution, optionally specifying whether the program can continue based on [param can_continue] and whether the break was due to a breakpoint. */ - static debug(can_continue: boolean = true, is_error_breakpoint: boolean = false): void - - /** Starts a debug break in script execution, optionally specifying whether the program can continue based on [param can_continue] and whether the break was due to a breakpoint. */ - static script_debug(language: ScriptLanguage, can_continue: boolean = true, is_error_breakpoint: boolean = false): void - - /** Sets the current debugging lines that remain. */ - static set_lines_left(lines: int64): void - - /** Returns the number of lines that remain. */ - static get_lines_left(): int64 - - /** Sets the current debugging depth. */ - static set_depth(depth: int64): void - - /** Returns the current debug depth. */ - static get_depth(): int64 - - /** Returns `true` if the given [param source] and [param line] represent an existing breakpoint. */ - static is_breakpoint(line: int64, source: StringName): boolean - - /** Returns `true` if the debugger is skipping breakpoints otherwise `false`. */ - static is_skipping_breakpoints(): boolean - - /** Inserts a new breakpoint with the given [param source] and [param line]. */ - static insert_breakpoint(line: int64, source: StringName): void - - /** Removes a breakpoint with the given [param source] and [param line]. */ - static remove_breakpoint(line: int64, source: StringName): void - - /** Clears all breakpoints. */ - static clear_breakpoints(): void - } // _singleton_class_: Time namespace Time { enum Month { @@ -2264,7 +1165,7 @@ declare module "godot" { } /** A singleton for working with time data. * - * @link https://docs.godotengine.org/en/4.3/classes/class_time.html + * @link https://docs.godotengine.org/en/4.4/classes/class_time.html */ class Time extends Object { /** Converts the given Unix timestamp to a dictionary of keys: `year`, `month`, `day`, `weekday`, `hour`, `minute`, and `second`. @@ -2374,6 +1275,1285 @@ declare module "godot" { */ static get_ticks_usec(): int64 } + // _singleton_class_: TextServerManager + /** A singleton for managing [TextServer] implementations. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_textservermanager.html + */ + class TextServerManager extends Object { + /** Registers a [TextServer] interface. */ + static add_interface(interface: TextServer): void + + /** Returns the number of interfaces currently registered. */ + static get_interface_count(): int64 + + /** Removes an interface. All fonts and shaped text caches should be freed before removing an interface. */ + static remove_interface(interface: TextServer): void + + /** Returns the interface registered at a given index. */ + static get_interface(idx: int64): TextServer + + /** Returns a list of available interfaces, with the index and name of each interface. */ + static get_interfaces(): GArray + + /** Finds an interface by its [param name]. */ + static find_interface(name: string): TextServer + + /** Sets the primary [TextServer] interface. */ + static set_primary_interface(index: TextServer): void + + /** Returns the primary [TextServer] interface currently in use. */ + static get_primary_interface(): TextServer + + /** Emitted when a new interface has been added. */ + static readonly interface_added: Signal1 + + /** Emitted when an interface is removed. */ + static readonly interface_removed: Signal1 + } + // _singleton_class_: PhysicsServer2DManager + /** A singleton for managing [PhysicsServer2D] implementations. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_physicsserver2dmanager.html + */ + class PhysicsServer2DManager extends Object { + /** Register a [PhysicsServer2D] implementation by passing a [param name] and a [Callable] that returns a [PhysicsServer2D] object. */ + static register_server(name: string, create_callback: Callable): void + + /** Set the default [PhysicsServer2D] implementation to the one identified by [param name], if [param priority] is greater than the priority of the current default implementation. */ + static set_default_server(name: string, priority: int64): void + } + // _singleton_class_: PhysicsServer3DManager + /** A singleton for managing [PhysicsServer3D] implementations. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_physicsserver3dmanager.html + */ + class PhysicsServer3DManager extends Object { + /** Register a [PhysicsServer3D] implementation by passing a [param name] and a [Callable] that returns a [PhysicsServer3D] object. */ + static register_server(name: string, create_callback: Callable): void + + /** Set the default [PhysicsServer3D] implementation to the one identified by [param name], if [param priority] is greater than the priority of the current default implementation. */ + static set_default_server(name: string, priority: int64): void + } + // _singleton_class_: NavigationMeshGenerator + /** Helper class for creating and clearing navigation meshes. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_navigationmeshgenerator.html + */ + class NavigationMeshGenerator extends Object { + /** Bakes the [param navigation_mesh] with source geometry collected starting from the [param root_node]. */ + static bake(navigation_mesh: NavigationMesh, root_node: Node): void + + /** Removes all polygons and vertices from the provided [param navigation_mesh] resource. */ + static clear(navigation_mesh: NavigationMesh): void + + /** Parses the [SceneTree] for source geometry according to the properties of [param navigation_mesh]. Updates the provided [param source_geometry_data] resource with the resulting data. The resource can then be used to bake a navigation mesh with [method bake_from_source_geometry_data]. After the process is finished the optional [param callback] will be called. + * + * **Note:** This function needs to run on the main thread or with a deferred call as the SceneTree is not thread-safe. + * **Performance:** While convenient, reading data arrays from [Mesh] resources can affect the frame rate negatively. The data needs to be received from the GPU, stalling the [RenderingServer] in the process. For performance prefer the use of e.g. collision shapes or creating the data arrays entirely in code. + */ + static parse_source_geometry_data(navigation_mesh: NavigationMesh, source_geometry_data: NavigationMeshSourceGeometryData3D, root_node: Node, callback: Callable = new Callable()): void + + /** Bakes the provided [param navigation_mesh] with the data from the provided [param source_geometry_data]. After the process is finished the optional [param callback] will be called. */ + static bake_from_source_geometry_data(navigation_mesh: NavigationMesh, source_geometry_data: NavigationMeshSourceGeometryData3D, callback: Callable = new Callable()): void + } + // _singleton_class_: IP + namespace IP { + enum ResolverStatus { + /** DNS hostname resolver status: No status. */ + RESOLVER_STATUS_NONE = 0, + + /** DNS hostname resolver status: Waiting. */ + RESOLVER_STATUS_WAITING = 1, + + /** DNS hostname resolver status: Done. */ + RESOLVER_STATUS_DONE = 2, + + /** DNS hostname resolver status: Error. */ + RESOLVER_STATUS_ERROR = 3, + } + enum Type { + /** Address type: None. */ + TYPE_NONE = 0, + + /** Address type: Internet protocol version 4 (IPv4). */ + TYPE_IPV4 = 1, + + /** Address type: Internet protocol version 6 (IPv6). */ + TYPE_IPV6 = 2, + + /** Address type: Any. */ + TYPE_ANY = 3, + } + } + /** Internet protocol (IP) support functions such as DNS resolution. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_ip.html + */ + class IP extends Object { + /** Maximum number of concurrent DNS resolver queries allowed, [constant RESOLVER_INVALID_ID] is returned if exceeded. */ + static readonly RESOLVER_MAX_QUERIES = 256 + + /** Invalid ID constant. Returned if [constant RESOLVER_MAX_QUERIES] is exceeded. */ + static readonly RESOLVER_INVALID_ID = -1 + + /** Returns a given hostname's IPv4 or IPv6 address when resolved (blocking-type method). The address type returned depends on the [enum Type] constant given as [param ip_type]. */ + static resolve_hostname(host: string, ip_type: IP.Type = 3): string + + /** Resolves a given hostname in a blocking way. Addresses are returned as an [Array] of IPv4 or IPv6 addresses depending on [param ip_type]. */ + static resolve_hostname_addresses(host: string, ip_type: IP.Type = 3): PackedStringArray + + /** Creates a queue item to resolve a hostname to an IPv4 or IPv6 address depending on the [enum Type] constant given as [param ip_type]. Returns the queue ID if successful, or [constant RESOLVER_INVALID_ID] on error. */ + static resolve_hostname_queue_item(host: string, ip_type: IP.Type = 3): int64 + + /** Returns a queued hostname's status as a [enum ResolverStatus] constant, given its queue [param id]. */ + static get_resolve_item_status(id: int64): IP.ResolverStatus + + /** Returns a queued hostname's IP address, given its queue [param id]. Returns an empty string on error or if resolution hasn't happened yet (see [method get_resolve_item_status]). */ + static get_resolve_item_address(id: int64): string + + /** Returns resolved addresses, or an empty array if an error happened or resolution didn't happen yet (see [method get_resolve_item_status]). */ + static get_resolve_item_addresses(id: int64): GArray + + /** Removes a given item [param id] from the queue. This should be used to free a queue after it has completed to enable more queries to happen. */ + static erase_resolve_item(id: int64): void + + /** Returns all the user's current IPv4 and IPv6 addresses as an array. */ + static get_local_addresses(): PackedStringArray + + /** Returns all network adapters as an array. + * Each adapter is a dictionary of the form: + * + */ + static get_local_interfaces(): GArray + + /** Removes all of a [param hostname]'s cached references. If no [param hostname] is given, all cached IP addresses are removed. */ + static clear_cache(hostname: string = ''): void + } + // _singleton_class_: Geometry2D + namespace Geometry2D { + enum PolyBooleanOperation { + /** Create regions where either subject or clip polygons (or both) are filled. */ + OPERATION_UNION = 0, + + /** Create regions where subject polygons are filled except where clip polygons are filled. */ + OPERATION_DIFFERENCE = 1, + + /** Create regions where both subject and clip polygons are filled. */ + OPERATION_INTERSECTION = 2, + + /** Create regions where either subject or clip polygons are filled but not where both are filled. */ + OPERATION_XOR = 3, + } + enum PolyJoinType { + /** Squaring is applied uniformally at all convex edge joins at `1 * delta`. */ + JOIN_SQUARE = 0, + + /** While flattened paths can never perfectly trace an arc, they are approximated by a series of arc chords. */ + JOIN_ROUND = 1, + + /** There's a necessary limit to mitered joins since offsetting edges that join at very acute angles will produce excessively long and narrow "spikes". For any given edge join, when miter offsetting would exceed that maximum distance, "square" joining is applied. */ + JOIN_MITER = 2, + } + enum PolyEndType { + /** Endpoints are joined using the [enum PolyJoinType] value and the path filled as a polygon. */ + END_POLYGON = 0, + + /** Endpoints are joined using the [enum PolyJoinType] value and the path filled as a polyline. */ + END_JOINED = 1, + + /** Endpoints are squared off with no extension. */ + END_BUTT = 2, + + /** Endpoints are squared off and extended by `delta` units. */ + END_SQUARE = 3, + + /** Endpoints are rounded off and extended by `delta` units. */ + END_ROUND = 4, + } + } + /** Provides methods for some common 2D geometric operations. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_geometry2d.html + */ + class Geometry2D extends Object { + /** Returns `true` if [param point] is inside the circle or if it's located exactly *on* the circle's boundary, otherwise returns `false`. */ + static is_point_in_circle(point: Vector2, circle_position: Vector2, circle_radius: float64): boolean + + /** Given the 2D segment ([param segment_from], [param segment_to]), returns the position on the segment (as a number between 0 and 1) at which the segment hits the circle that is located at position [param circle_position] and has radius [param circle_radius]. If the segment does not intersect the circle, -1 is returned (this is also the case if the line extending the segment would intersect the circle, but the segment does not). */ + static segment_intersects_circle(segment_from: Vector2, segment_to: Vector2, circle_position: Vector2, circle_radius: float64): float64 + + /** Checks if the two segments ([param from_a], [param to_a]) and ([param from_b], [param to_b]) intersect. If yes, return the point of intersection as [Vector2]. If no intersection takes place, returns `null`. */ + static segment_intersects_segment(from_a: Vector2, to_a: Vector2, from_b: Vector2, to_b: Vector2): any + + /** Returns the point of intersection between the two lines ([param from_a], [param dir_a]) and ([param from_b], [param dir_b]). Returns a [Vector2], or `null` if the lines are parallel. + * `from` and `dir` are *not* endpoints of a line segment or ray but the slope (`dir`) and a known point (`from`) on that line. + * + */ + static line_intersects_line(from_a: Vector2, dir_a: Vector2, from_b: Vector2, dir_b: Vector2): any + + /** Given the two 2D segments ([param p1], [param q1]) and ([param p2], [param q2]), finds those two points on the two segments that are closest to each other. Returns a [PackedVector2Array] that contains this point on ([param p1], [param q1]) as well the accompanying point on ([param p2], [param q2]). */ + static get_closest_points_between_segments(p1: Vector2, q1: Vector2, p2: Vector2, q2: Vector2): PackedVector2Array + + /** Returns the 2D point on the 2D segment ([param s1], [param s2]) that is closest to [param point]. The returned point will always be inside the specified segment. */ + static get_closest_point_to_segment(point: Vector2, s1: Vector2, s2: Vector2): Vector2 + + /** Returns the 2D point on the 2D line defined by ([param s1], [param s2]) that is closest to [param point]. The returned point can be inside the segment ([param s1], [param s2]) or outside of it, i.e. somewhere on the line extending from the segment. */ + static get_closest_point_to_segment_uncapped(point: Vector2, s1: Vector2, s2: Vector2): Vector2 + + /** Returns if [param point] is inside the triangle specified by [param a], [param b] and [param c]. */ + static point_is_inside_triangle(point: Vector2, a: Vector2, b: Vector2, c: Vector2): boolean + + /** Returns `true` if [param polygon]'s vertices are ordered in clockwise order, otherwise returns `false`. + * + * **Note:** Assumes a Cartesian coordinate system where `+x` is right and `+y` is up. If using screen coordinates (`+y` is down), the result will need to be flipped (i.e. a `true` result will indicate counter-clockwise). + */ + static is_polygon_clockwise(polygon: PackedVector2Array | Vector2[]): boolean + + /** Returns `true` if [param point] is inside [param polygon] or if it's located exactly *on* polygon's boundary, otherwise returns `false`. */ + static is_point_in_polygon(point: Vector2, polygon: PackedVector2Array | Vector2[]): boolean + + /** Triangulates the polygon specified by the points in [param polygon]. Returns a [PackedInt32Array] where each triangle consists of three consecutive point indices into [param polygon] (i.e. the returned array will have `n * 3` elements, with `n` being the number of found triangles). Output triangles will always be counter clockwise, and the contour will be flipped if it's clockwise. If the triangulation did not succeed, an empty [PackedInt32Array] is returned. */ + static triangulate_polygon(polygon: PackedVector2Array | Vector2[]): PackedInt32Array + + /** Triangulates the area specified by discrete set of [param points] such that no point is inside the circumcircle of any resulting triangle. Returns a [PackedInt32Array] where each triangle consists of three consecutive point indices into [param points] (i.e. the returned array will have `n * 3` elements, with `n` being the number of found triangles). If the triangulation did not succeed, an empty [PackedInt32Array] is returned. */ + static triangulate_delaunay(points: PackedVector2Array | Vector2[]): PackedInt32Array + + /** Given an array of [Vector2]s, returns the convex hull as a list of points in counterclockwise order. The last point is the same as the first one. */ + static convex_hull(points: PackedVector2Array | Vector2[]): PackedVector2Array + + /** Decomposes the [param polygon] into multiple convex hulls and returns an array of [PackedVector2Array]. */ + static decompose_polygon_in_convex(polygon: PackedVector2Array | Vector2[]): GArray + + /** Merges (combines) [param polygon_a] and [param polygon_b] and returns an array of merged polygons. This performs [constant OPERATION_UNION] between polygons. + * The operation may result in an outer polygon (boundary) and multiple inner polygons (holes) produced which could be distinguished by calling [method is_polygon_clockwise]. + */ + static merge_polygons(polygon_a: PackedVector2Array | Vector2[], polygon_b: PackedVector2Array | Vector2[]): GArray + + /** Clips [param polygon_a] against [param polygon_b] and returns an array of clipped polygons. This performs [constant OPERATION_DIFFERENCE] between polygons. Returns an empty array if [param polygon_b] completely overlaps [param polygon_a]. + * If [param polygon_b] is enclosed by [param polygon_a], returns an outer polygon (boundary) and inner polygon (hole) which could be distinguished by calling [method is_polygon_clockwise]. + */ + static clip_polygons(polygon_a: PackedVector2Array | Vector2[], polygon_b: PackedVector2Array | Vector2[]): GArray + + /** Intersects [param polygon_a] with [param polygon_b] and returns an array of intersected polygons. This performs [constant OPERATION_INTERSECTION] between polygons. In other words, returns common area shared by polygons. Returns an empty array if no intersection occurs. + * The operation may result in an outer polygon (boundary) and inner polygon (hole) produced which could be distinguished by calling [method is_polygon_clockwise]. + */ + static intersect_polygons(polygon_a: PackedVector2Array | Vector2[], polygon_b: PackedVector2Array | Vector2[]): GArray + + /** Mutually excludes common area defined by intersection of [param polygon_a] and [param polygon_b] (see [method intersect_polygons]) and returns an array of excluded polygons. This performs [constant OPERATION_XOR] between polygons. In other words, returns all but common area between polygons. + * The operation may result in an outer polygon (boundary) and inner polygon (hole) produced which could be distinguished by calling [method is_polygon_clockwise]. + */ + static exclude_polygons(polygon_a: PackedVector2Array | Vector2[], polygon_b: PackedVector2Array | Vector2[]): GArray + + /** Clips [param polyline] against [param polygon] and returns an array of clipped polylines. This performs [constant OPERATION_DIFFERENCE] between the polyline and the polygon. This operation can be thought of as cutting a line with a closed shape. */ + static clip_polyline_with_polygon(polyline: PackedVector2Array | Vector2[], polygon: PackedVector2Array | Vector2[]): GArray + + /** Intersects [param polyline] with [param polygon] and returns an array of intersected polylines. This performs [constant OPERATION_INTERSECTION] between the polyline and the polygon. This operation can be thought of as chopping a line with a closed shape. */ + static intersect_polyline_with_polygon(polyline: PackedVector2Array | Vector2[], polygon: PackedVector2Array | Vector2[]): GArray + + /** Inflates or deflates [param polygon] by [param delta] units (pixels). If [param delta] is positive, makes the polygon grow outward. If [param delta] is negative, shrinks the polygon inward. Returns an array of polygons because inflating/deflating may result in multiple discrete polygons. Returns an empty array if [param delta] is negative and the absolute value of it approximately exceeds the minimum bounding rectangle dimensions of the polygon. + * Each polygon's vertices will be rounded as determined by [param join_type], see [enum PolyJoinType]. + * The operation may result in an outer polygon (boundary) and inner polygon (hole) produced which could be distinguished by calling [method is_polygon_clockwise]. + * + * **Note:** To translate the polygon's vertices specifically, multiply them to a [Transform2D]: + * + */ + static offset_polygon(polygon: PackedVector2Array | Vector2[], delta: float64, join_type: Geometry2D.PolyJoinType = 0): GArray + + /** Inflates or deflates [param polyline] by [param delta] units (pixels), producing polygons. If [param delta] is positive, makes the polyline grow outward. Returns an array of polygons because inflating/deflating may result in multiple discrete polygons. If [param delta] is negative, returns an empty array. + * Each polygon's vertices will be rounded as determined by [param join_type], see [enum PolyJoinType]. + * Each polygon's endpoints will be rounded as determined by [param end_type], see [enum PolyEndType]. + * The operation may result in an outer polygon (boundary) and inner polygon (hole) produced which could be distinguished by calling [method is_polygon_clockwise]. + */ + static offset_polyline(polyline: PackedVector2Array | Vector2[], delta: float64, join_type: Geometry2D.PolyJoinType = 0, end_type: Geometry2D.PolyEndType = 3): GArray + + /** Given an array of [Vector2]s representing tiles, builds an atlas. The returned dictionary has two keys: `points` is a [PackedVector2Array] that specifies the positions of each tile, `size` contains the overall size of the whole atlas as [Vector2i]. */ + static make_atlas(sizes: PackedVector2Array | Vector2[]): GDictionary + + /** Returns the [url=https://en.wikipedia.org/wiki/Bresenham%27s_line_algorithm]Bresenham line[/url] between the [param from] and [param to] points. A Bresenham line is a series of pixels that draws a line and is always 1-pixel thick on every row and column of the drawing (never more, never less). + * Example code to draw a line between two [Marker2D] nodes using a series of [method CanvasItem.draw_rect] calls: + * + */ + static bresenham_line(from: Vector2i, to: Vector2i): GArray + } + // _singleton_class_: Geometry3D + /** Provides methods for some common 3D geometric operations. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_geometry3d.html + */ + class Geometry3D extends Object { + /** Calculates and returns all the vertex points of a convex shape defined by an array of [param planes]. */ + static compute_convex_mesh_points(planes: GArray): PackedVector3Array + + /** Returns an array with 6 [Plane]s that describe the sides of a box centered at the origin. The box size is defined by [param extents], which represents one (positive) corner of the box (i.e. half its actual size). */ + static build_box_planes(extents: Vector3): GArray + + /** Returns an array of [Plane]s closely bounding a faceted cylinder centered at the origin with radius [param radius] and height [param height]. The parameter [param sides] defines how many planes will be generated for the round part of the cylinder. The parameter [param axis] describes the axis along which the cylinder is oriented (0 for X, 1 for Y, 2 for Z). */ + static build_cylinder_planes(radius: float64, height: float64, sides: int64, axis: Vector3.Axis = 2): GArray + + /** Returns an array of [Plane]s closely bounding a faceted capsule centered at the origin with radius [param radius] and height [param height]. The parameter [param sides] defines how many planes will be generated for the side part of the capsule, whereas [param lats] gives the number of latitudinal steps at the bottom and top of the capsule. The parameter [param axis] describes the axis along which the capsule is oriented (0 for X, 1 for Y, 2 for Z). */ + static build_capsule_planes(radius: float64, height: float64, sides: int64, lats: int64, axis: Vector3.Axis = 2): GArray + + /** Given the two 3D segments ([param p1], [param p2]) and ([param q1], [param q2]), finds those two points on the two segments that are closest to each other. Returns a [PackedVector3Array] that contains this point on ([param p1], [param p2]) as well the accompanying point on ([param q1], [param q2]). */ + static get_closest_points_between_segments(p1: Vector3, p2: Vector3, q1: Vector3, q2: Vector3): PackedVector3Array + + /** Returns the 3D point on the 3D segment ([param s1], [param s2]) that is closest to [param point]. The returned point will always be inside the specified segment. */ + static get_closest_point_to_segment(point: Vector3, s1: Vector3, s2: Vector3): Vector3 + + /** Returns the 3D point on the 3D line defined by ([param s1], [param s2]) that is closest to [param point]. The returned point can be inside the segment ([param s1], [param s2]) or outside of it, i.e. somewhere on the line extending from the segment. */ + static get_closest_point_to_segment_uncapped(point: Vector3, s1: Vector3, s2: Vector3): Vector3 + + /** Returns a [Vector3] containing weights based on how close a 3D position ([param point]) is to a triangle's different vertices ([param a], [param b] and [param c]). This is useful for interpolating between the data of different vertices in a triangle. One example use case is using this to smoothly rotate over a mesh instead of relying solely on face normals. + * [url=https://en.wikipedia.org/wiki/Barycentric_coordinate_system]Here is a more detailed explanation of barycentric coordinates.[/url] + */ + static get_triangle_barycentric_coords(point: Vector3, a: Vector3, b: Vector3, c: Vector3): Vector3 + + /** Tests if the 3D ray starting at [param from] with the direction of [param dir] intersects the triangle specified by [param a], [param b] and [param c]. If yes, returns the point of intersection as [Vector3]. If no intersection takes place, returns `null`. */ + static ray_intersects_triangle(from: Vector3, dir: Vector3, a: Vector3, b: Vector3, c: Vector3): any + + /** Tests if the segment ([param from], [param to]) intersects the triangle [param a], [param b], [param c]. If yes, returns the point of intersection as [Vector3]. If no intersection takes place, returns `null`. */ + static segment_intersects_triangle(from: Vector3, to: Vector3, a: Vector3, b: Vector3, c: Vector3): any + + /** Checks if the segment ([param from], [param to]) intersects the sphere that is located at [param sphere_position] and has radius [param sphere_radius]. If no, returns an empty [PackedVector3Array]. If yes, returns a [PackedVector3Array] containing the point of intersection and the sphere's normal at the point of intersection. */ + static segment_intersects_sphere(from: Vector3, to: Vector3, sphere_position: Vector3, sphere_radius: float64): PackedVector3Array + + /** Checks if the segment ([param from], [param to]) intersects the cylinder with height [param height] that is centered at the origin and has radius [param radius]. If no, returns an empty [PackedVector3Array]. If an intersection takes place, the returned array contains the point of intersection and the cylinder's normal at the point of intersection. */ + static segment_intersects_cylinder(from: Vector3, to: Vector3, height: float64, radius: float64): PackedVector3Array + + /** Given a convex hull defined though the [Plane]s in the array [param planes], tests if the segment ([param from], [param to]) intersects with that hull. If an intersection is found, returns a [PackedVector3Array] containing the point the intersection and the hull's normal. Otherwise, returns an empty array. */ + static segment_intersects_convex(from: Vector3, to: Vector3, planes: GArray): PackedVector3Array + + /** Clips the polygon defined by the points in [param points] against the [param plane] and returns the points of the clipped polygon. */ + static clip_polygon(points: PackedVector3Array | Vector3[], plane: Plane): PackedVector3Array + + /** Tetrahedralizes the volume specified by a discrete set of [param points] in 3D space, ensuring that no point lies within the circumsphere of any resulting tetrahedron. The method returns a [PackedInt32Array] where each tetrahedron consists of four consecutive point indices into the [param points] array (resulting in an array with `n * 4` elements, where `n` is the number of tetrahedra found). If the tetrahedralization is unsuccessful, an empty [PackedInt32Array] is returned. */ + static tetrahedralize_delaunay(points: PackedVector3Array | Vector3[]): PackedInt32Array + } + // _singleton_class_: ResourceLoader + namespace ResourceLoader { + enum ThreadLoadStatus { + /** The resource is invalid, or has not been loaded with [method load_threaded_request]. */ + THREAD_LOAD_INVALID_RESOURCE = 0, + + /** The resource is still being loaded. */ + THREAD_LOAD_IN_PROGRESS = 1, + + /** Some error occurred during loading and it failed. */ + THREAD_LOAD_FAILED = 2, + + /** The resource was loaded successfully and can be accessed via [method load_threaded_get]. */ + THREAD_LOAD_LOADED = 3, + } + enum CacheMode { + /** Neither the main resource (the one requested to be loaded) nor any of its subresources are retrieved from cache nor stored into it. Dependencies (external resources) are loaded with [constant CACHE_MODE_REUSE]. */ + CACHE_MODE_IGNORE = 0, + + /** The main resource (the one requested to be loaded), its subresources, and its dependencies (external resources) are retrieved from cache if present, instead of loaded. Those not cached are loaded and then stored into the cache. The same rules are propagated recursively down the tree of dependencies (external resources). */ + CACHE_MODE_REUSE = 1, + + /** Like [constant CACHE_MODE_REUSE], but the cache is checked for the main resource (the one requested to be loaded) as well as for each of its subresources. Those already in the cache, as long as the loaded and cached types match, have their data refreshed from storage into the already existing instances. Otherwise, they are recreated as completely new objects. */ + CACHE_MODE_REPLACE = 2, + + /** Like [constant CACHE_MODE_IGNORE], but propagated recursively down the tree of dependencies (external resources). */ + CACHE_MODE_IGNORE_DEEP = 3, + + /** Like [constant CACHE_MODE_REPLACE], but propagated recursively down the tree of dependencies (external resources). */ + CACHE_MODE_REPLACE_DEEP = 4, + } + } + /** A singleton for loading resource files. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_resourceloader.html + */ + class ResourceLoader extends Object { + /** Loads the resource using threads. If [param use_sub_threads] is `true`, multiple threads will be used to load the resource, which makes loading faster, but may affect the main thread (and thus cause game slowdowns). + * The [param cache_mode] property defines whether and how the cache should be used or updated when loading the resource. See [enum CacheMode] for details. + */ + static load_threaded_request(path: string, type_hint: string = '', use_sub_threads: boolean = false, cache_mode: ResourceLoader.CacheMode = 1): GError + + /** Returns the status of a threaded loading operation started with [method load_threaded_request] for the resource at [param path]. See [enum ThreadLoadStatus] for possible return values. + * An array variable can optionally be passed via [param progress], and will return a one-element array containing the ratio of completion of the threaded loading (between `0.0` and `1.0`). + * + * **Note:** The recommended way of using this method is to call it during different frames (e.g., in [method Node._process], instead of a loop). + */ + static load_threaded_get_status(path: string, progress: GArray = []): ResourceLoader.ThreadLoadStatus + + /** Returns the resource loaded by [method load_threaded_request]. + * If this is called before the loading thread is done (i.e. [method load_threaded_get_status] is not [constant THREAD_LOAD_LOADED]), the calling thread will be blocked until the resource has finished loading. However, it's recommended to use [method load_threaded_get_status] to known when the load has actually completed. + */ + static load_threaded_get(path: string): Resource + + /** Loads a resource at the given [param path], caching the result for further access. + * The registered [ResourceFormatLoader]s are queried sequentially to find the first one which can handle the file's extension, and then attempt loading. If loading fails, the remaining ResourceFormatLoaders are also attempted. + * An optional [param type_hint] can be used to further specify the [Resource] type that should be handled by the [ResourceFormatLoader]. Anything that inherits from [Resource] can be used as a type hint, for example [Image]. + * The [param cache_mode] property defines whether and how the cache should be used or updated when loading the resource. See [enum CacheMode] for details. + * Returns an empty resource if no [ResourceFormatLoader] could handle the file, and prints an error if no file is found at the specified path. + * GDScript has a simplified [method @GDScript.load] built-in method which can be used in most situations, leaving the use of [ResourceLoader] for more advanced scenarios. + * + * **Note:** If [member ProjectSettings.editor/export/convert_text_resources_to_binary] is `true`, [method @GDScript.load] will not be able to read converted files in an exported project. If you rely on run-time loading of files present within the PCK, set [member ProjectSettings.editor/export/convert_text_resources_to_binary] to `false`. + * + * **Note:** Relative paths will be prefixed with `"res://"` before loading, to avoid unexpected results make sure your paths are absolute. + */ + static load(path: string, type_hint: string = '', cache_mode: ResourceLoader.CacheMode = 1): Resource + + /** Returns the list of recognized extensions for a resource type. */ + static get_recognized_extensions_for_type(type: string): PackedStringArray + + /** Registers a new [ResourceFormatLoader]. The ResourceLoader will use the ResourceFormatLoader as described in [method load]. + * This method is performed implicitly for ResourceFormatLoaders written in GDScript (see [ResourceFormatLoader] for more information). + */ + static add_resource_format_loader(format_loader: ResourceFormatLoader, at_front: boolean = false): void + + /** Unregisters the given [ResourceFormatLoader]. */ + static remove_resource_format_loader(format_loader: ResourceFormatLoader): void + + /** Changes the behavior on missing sub-resources. The default behavior is to abort loading. */ + static set_abort_on_missing_resources(abort: boolean): void + + /** Returns the dependencies for the resource at the given [param path]. + * + * **Note:** The dependencies are returned with slices separated by `::`. You can use [method String.get_slice] to get their components. + * + */ + static get_dependencies(path: string): PackedStringArray + + /** Returns whether a cached resource is available for the given [param path]. + * Once a resource has been loaded by the engine, it is cached in memory for faster access, and future calls to the [method load] method will use the cached version. The cached resource can be overridden by using [method Resource.take_over_path] on a new resource for that same path. + */ + static has_cached(path: string): boolean + + /** Returns the cached resource reference for the given [param path]. + * + * **Note:** If the resource is not cached, the returned [Resource] will be invalid. + */ + static get_cached_ref(path: string): Resource + + /** Returns whether a recognized resource exists for the given [param path]. + * An optional [param type_hint] can be used to further specify the [Resource] type that should be handled by the [ResourceFormatLoader]. Anything that inherits from [Resource] can be used as a type hint, for example [Image]. + * + * **Note:** If you use [method Resource.take_over_path], this method will return `true` for the taken path even if the resource wasn't saved (i.e. exists only in resource cache). + */ + static exists(path: string, type_hint: string = ''): boolean + + /** Returns the ID associated with a given resource path, or `-1` when no such ID exists. */ + static get_resource_uid(path: string): int64 + + /** Lists a directory (as example: "res://assets/enemies"), returning all resources contained within. The resource files are the original file names as visible in the editor before exporting. */ + static list_directory(directory_path: string): PackedStringArray + } + // _singleton_class_: ResourceSaver + namespace ResourceSaver { + enum SaverFlags { + /** No resource saving option. */ + FLAG_NONE = 0, + + /** Save the resource with a path relative to the scene which uses it. */ + FLAG_RELATIVE_PATHS = 1, + + /** Bundles external resources. */ + FLAG_BUNDLE_RESOURCES = 2, + + /** Changes the [member Resource.resource_path] of the saved resource to match its new location. */ + FLAG_CHANGE_PATH = 4, + + /** Do not save editor-specific metadata (identified by their `__editor` prefix). */ + FLAG_OMIT_EDITOR_PROPERTIES = 8, + + /** Save as big endian (see [member FileAccess.big_endian]). */ + FLAG_SAVE_BIG_ENDIAN = 16, + + /** Compress the resource on save using [constant FileAccess.COMPRESSION_ZSTD]. Only available for binary resource types. */ + FLAG_COMPRESS = 32, + + /** Take over the paths of the saved subresources (see [method Resource.take_over_path]). */ + FLAG_REPLACE_SUBRESOURCE_PATHS = 64, + } + } + /** A singleton for saving [Resource]s to the filesystem. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_resourcesaver.html + */ + class ResourceSaver extends Object { + /** Saves a resource to disk to the given path, using a [ResourceFormatSaver] that recognizes the resource object. If [param path] is empty, [ResourceSaver] will try to use [member Resource.resource_path]. + * The [param flags] bitmask can be specified to customize the save behavior using [enum SaverFlags] flags. + * Returns [constant OK] on success. + * + * **Note:** When the project is running, any generated UID associated with the resource will not be saved as the required code is only executed in editor mode. + */ + static save(resource: Resource, path: string = '', flags: ResourceSaver.SaverFlags = 0): GError + + /** Returns the list of extensions available for saving a resource of a given type. */ + static get_recognized_extensions(type: Resource): PackedStringArray + + /** Registers a new [ResourceFormatSaver]. The ResourceSaver will use the ResourceFormatSaver as described in [method save]. + * This method is performed implicitly for ResourceFormatSavers written in GDScript (see [ResourceFormatSaver] for more information). + */ + static add_resource_format_saver(format_saver: ResourceFormatSaver, at_front: boolean = false): void + + /** Unregisters the given [ResourceFormatSaver]. */ + static remove_resource_format_saver(format_saver: ResourceFormatSaver): void + + /** Returns the resource ID for the given path. If [param generate] is `true`, a new resource ID will be generated if one for the path is not found. If [param generate] is `false` and the path is not found, [constant ResourceUID.INVALID_ID] is returned. */ + static get_resource_id_for_path(path: string, generate: boolean = false): int64 + } + // _singleton_class_: ClassDB + namespace ClassDB { + enum APIType { + /** Native Core class type. */ + API_CORE = 0, + + /** Native Editor class type. */ + API_EDITOR = 1, + + /** GDExtension class type. */ + API_EXTENSION = 2, + + /** GDExtension Editor class type. */ + API_EDITOR_EXTENSION = 3, + + /** Unknown class type. */ + API_NONE = 4, + } + } + /** A class information repository. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_classdb.html + */ + class ClassDB extends Object { + /** Returns the names of all the classes available. */ + static get_class_list(): PackedStringArray + + /** Returns the names of all the classes that directly or indirectly inherit from [param class]. */ + static get_inheriters_from_class(class_: StringName): PackedStringArray + + /** Returns the parent class of [param class]. */ + static get_parent_class(class_: StringName): StringName + + /** Returns whether the specified [param class] is available or not. */ + static class_exists(class_: StringName): boolean + + /** Returns whether [param inherits] is an ancestor of [param class] or not. */ + static is_parent_class(class_: StringName, inherits: StringName): boolean + + /** Returns `true` if objects can be instantiated from the specified [param class], otherwise returns `false`. */ + static can_instantiate(class_: StringName): boolean + + /** Creates an instance of [param class]. */ + static instantiate(class_: StringName): any + + /** Returns the API type of [param class]. See [enum APIType]. */ + static class_get_api_type(class_: StringName): ClassDB.APIType + + /** Returns whether [param class] or its ancestry has a signal called [param signal] or not. */ + static class_has_signal(class_: StringName, signal: StringName): boolean + + /** Returns the [param signal] data of [param class] or its ancestry. The returned value is a [Dictionary] with the following keys: `args`, `default_args`, `flags`, `id`, `name`, `return: (class_name, hint, hint_string, name, type, usage)`. */ + static class_get_signal(class_: StringName, signal: StringName): GDictionary + + /** Returns an array with all the signals of [param class] or its ancestry if [param no_inheritance] is `false`. Every element of the array is a [Dictionary] as described in [method class_get_signal]. */ + static class_get_signal_list(class_: StringName, no_inheritance: boolean = false): GArray + + /** Returns an array with all the properties of [param class] or its ancestry if [param no_inheritance] is `false`. */ + static class_get_property_list(class_: StringName, no_inheritance: boolean = false): GArray + + /** Returns the getter method name of [param property] of [param class]. */ + static class_get_property_getter(class_: StringName, property: StringName): StringName + + /** Returns the setter method name of [param property] of [param class]. */ + static class_get_property_setter(class_: StringName, property: StringName): StringName + + /** Returns the value of [param property] of [param object] or its ancestry. */ + static class_get_property(object: Object, property: StringName): any + + /** Sets [param property] value of [param object] to [param value]. */ + static class_set_property(object: Object, property: StringName, value: any): GError + + /** Returns the default value of [param property] of [param class] or its ancestor classes. */ + static class_get_property_default_value(class_: StringName, property: StringName): any + + /** Returns whether [param class] (or its ancestry if [param no_inheritance] is `false`) has a method called [param method] or not. */ + static class_has_method(class_: StringName, method: StringName, no_inheritance: boolean = false): boolean + + /** Returns the number of arguments of the method [param method] of [param class] or its ancestry if [param no_inheritance] is `false`. */ + static class_get_method_argument_count(class_: StringName, method: StringName, no_inheritance: boolean = false): int64 + + /** Returns an array with all the methods of [param class] or its ancestry if [param no_inheritance] is `false`. Every element of the array is a [Dictionary] with the following keys: `args`, `default_args`, `flags`, `id`, `name`, `return: (class_name, hint, hint_string, name, type, usage)`. + * + * **Note:** In exported release builds the debug info is not available, so the returned dictionaries will contain only method names. + */ + static class_get_method_list(class_: StringName, no_inheritance: boolean = false): GArray + + /** Calls a static method on a class. */ + static class_call_static(class_: StringName, method: StringName, ...vargargs: any[]): any + + /** Returns an array with the names all the integer constants of [param class] or its ancestry. */ + static class_get_integer_constant_list(class_: StringName, no_inheritance: boolean = false): PackedStringArray + + /** Returns whether [param class] or its ancestry has an integer constant called [param name] or not. */ + static class_has_integer_constant(class_: StringName, name: StringName): boolean + + /** Returns the value of the integer constant [param name] of [param class] or its ancestry. Always returns 0 when the constant could not be found. */ + static class_get_integer_constant(class_: StringName, name: StringName): int64 + + /** Returns whether [param class] or its ancestry has an enum called [param name] or not. */ + static class_has_enum(class_: StringName, name: StringName, no_inheritance: boolean = false): boolean + + /** Returns an array with all the enums of [param class] or its ancestry. */ + static class_get_enum_list(class_: StringName, no_inheritance: boolean = false): PackedStringArray + + /** Returns an array with all the keys in [param enum] of [param class] or its ancestry. */ + static class_get_enum_constants(class_: StringName, enum_: StringName, no_inheritance: boolean = false): PackedStringArray + + /** Returns which enum the integer constant [param name] of [param class] or its ancestry belongs to. */ + static class_get_integer_constant_enum(class_: StringName, name: StringName, no_inheritance: boolean = false): StringName + + /** Returns whether [param class] (or its ancestor classes if [param no_inheritance] is `false`) has an enum called [param enum] that is a bitfield. */ + static is_class_enum_bitfield(class_: StringName, enum_: StringName, no_inheritance: boolean = false): boolean + + /** Returns whether this [param class] is enabled or not. */ + static is_class_enabled(class_: StringName): boolean + } + // _singleton_class_: Marshalls + /** Data transformation (marshaling) and encoding helpers. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_marshalls.html + */ + class Marshalls extends Object { + /** Returns a Base64-encoded string of the [Variant] [param variant]. If [param full_objects] is `true`, encoding objects is allowed (and can potentially include code). + * Internally, this uses the same encoding mechanism as the [method @GlobalScope.var_to_bytes] method. + */ + static variant_to_base64(variant: any, full_objects: boolean = false): string + + /** Returns a decoded [Variant] corresponding to the Base64-encoded string [param base64_str]. If [param allow_objects] is `true`, decoding objects is allowed. + * Internally, this uses the same decoding mechanism as the [method @GlobalScope.bytes_to_var] method. + * **Warning:** Deserialized objects can contain code which gets executed. Do not use this option if the serialized object comes from untrusted sources to avoid potential security threats such as remote code execution. + */ + static base64_to_variant(base64_str: string, allow_objects: boolean = false): any + + /** Returns a Base64-encoded string of a given [PackedByteArray]. */ + static raw_to_base64(array: PackedByteArray | byte[] | ArrayBuffer): string + + /** Returns a decoded [PackedByteArray] corresponding to the Base64-encoded string [param base64_str]. */ + static base64_to_raw(base64_str: string): PackedByteArray + + /** Returns a Base64-encoded string of the UTF-8 string [param utf8_str]. */ + static utf8_to_base64(utf8_str: string): string + + /** Returns a decoded string corresponding to the Base64-encoded string [param base64_str]. */ + static base64_to_utf8(base64_str: string): string + } + // _singleton_class_: TranslationServer + /** The server responsible for language translations. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_translationserver.html + */ + class TranslationServer extends Object { + /** Sets the locale of the project. The [param locale] string will be standardized to match known locales (e.g. `en-US` would be matched to `en_US`). + * If translations have been loaded beforehand for the new locale, they will be applied. + */ + static set_locale(locale: string): void + + /** Returns the current locale of the project. + * See also [method OS.get_locale] and [method OS.get_locale_language] to query the locale of the user system. + */ + static get_locale(): string + + /** Returns the current locale of the editor. + * + * **Note:** When called from an exported project returns the same value as [method get_locale]. + */ + static get_tool_locale(): string + + /** Compares two locales and returns a similarity score between `0` (no match) and `10` (full match). */ + static compare_locales(locale_a: string, locale_b: string): int64 + + /** Returns a [param locale] string standardized to match known locales (e.g. `en-US` would be matched to `en_US`). If [param add_defaults] is `true`, the locale may have a default script or country added. */ + static standardize_locale(locale: string, add_defaults: boolean = false): string + + /** Returns array of known language codes. */ + static get_all_languages(): PackedStringArray + + /** Returns a readable language name for the [param language] code. */ + static get_language_name(language: string): string + + /** Returns an array of known script codes. */ + static get_all_scripts(): PackedStringArray + + /** Returns a readable script name for the [param script] code. */ + static get_script_name(script: string): string + + /** Returns an array of known country codes. */ + static get_all_countries(): PackedStringArray + + /** Returns a readable country name for the [param country] code. */ + static get_country_name(country: string): string + + /** Returns a locale's language and its variant (e.g. `"en_US"` would return `"English (United States)"`). */ + static get_locale_name(locale: string): string + + /** Returns the current locale's translation for the given message and context. + * + * **Note:** This method always uses the main translation domain. + */ + static translate(message: StringName, context: StringName = ''): StringName + + /** Returns the current locale's translation for the given message, plural message and context. + * The number [param n] is the number or quantity of the plural object. It will be used to guide the translation system to fetch the correct plural form for the selected language. + * + * **Note:** This method always uses the main translation domain. + */ + static translate_plural(message: StringName, plural_message: StringName, n: int64, context: StringName = ''): StringName + + /** Adds a translation to the main translation domain. */ + static add_translation(translation: Translation): void + + /** Removes the given translation from the main translation domain. */ + static remove_translation(translation: Translation): void + + /** Returns the [Translation] instance that best matches [param locale] in the main translation domain. Returns `null` if there are no matches. */ + static get_translation_object(locale: string): Translation + + /** Returns `true` if a translation domain with the specified name exists. */ + static has_domain(domain: StringName): boolean + + /** Returns the translation domain with the specified name. An empty translation domain will be created and added if it does not exist. */ + static get_or_add_domain(domain: StringName): TranslationDomain + + /** Removes the translation domain with the specified name. + * + * **Note:** Trying to remove the main translation domain is an error. + */ + static remove_domain(domain: StringName): void + + /** Removes all translations from the main translation domain. */ + static clear(): void + + /** Returns an array of all loaded locales of the project. */ + static get_loaded_locales(): PackedStringArray + + /** Reparses the pseudolocalization options and reloads the translation for the main translation domain. */ + static reload_pseudolocalization(): void + + /** Returns the pseudolocalized string based on the [param message] passed in. + * + * **Note:** This method always uses the main translation domain. + */ + static pseudolocalize(message: StringName): StringName + + /** If `true`, enables the use of pseudolocalization on the main translation domain. See [member ProjectSettings.internationalization/pseudolocalization/use_pseudolocalization] for details. */ + get pseudolocalization_enabled(): boolean + set pseudolocalization_enabled(value: boolean) + } + // _singleton_class_: Input + namespace Input { + enum MouseMode { + /** Makes the mouse cursor visible if it is hidden. */ + MOUSE_MODE_VISIBLE = 0, + + /** Makes the mouse cursor hidden if it is visible. */ + MOUSE_MODE_HIDDEN = 1, + + /** Captures the mouse. The mouse will be hidden and its position locked at the center of the window manager's window. + * + * **Note:** If you want to process the mouse's movement in this mode, you need to use [member InputEventMouseMotion.relative]. + */ + MOUSE_MODE_CAPTURED = 2, + + /** Confines the mouse cursor to the game window, and make it visible. */ + MOUSE_MODE_CONFINED = 3, + + /** Confines the mouse cursor to the game window, and make it hidden. */ + MOUSE_MODE_CONFINED_HIDDEN = 4, + + /** Max value of the [enum MouseMode]. */ + MOUSE_MODE_MAX = 5, + } + enum CursorShape { + /** Arrow cursor. Standard, default pointing cursor. */ + CURSOR_ARROW = 0, + + /** I-beam cursor. Usually used to show where the text cursor will appear when the mouse is clicked. */ + CURSOR_IBEAM = 1, + + /** Pointing hand cursor. Usually used to indicate the pointer is over a link or other interactable item. */ + CURSOR_POINTING_HAND = 2, + + /** Cross cursor. Typically appears over regions in which a drawing operation can be performed or for selections. */ + CURSOR_CROSS = 3, + + /** Wait cursor. Indicates that the application is busy performing an operation, and that it cannot be used during the operation (e.g. something is blocking its main thread). */ + CURSOR_WAIT = 4, + + /** Busy cursor. Indicates that the application is busy performing an operation, and that it is still usable during the operation. */ + CURSOR_BUSY = 5, + + /** Drag cursor. Usually displayed when dragging something. + * + * **Note:** Windows lacks a dragging cursor, so [constant CURSOR_DRAG] is the same as [constant CURSOR_MOVE] for this platform. + */ + CURSOR_DRAG = 6, + + /** Can drop cursor. Usually displayed when dragging something to indicate that it can be dropped at the current position. */ + CURSOR_CAN_DROP = 7, + + /** Forbidden cursor. Indicates that the current action is forbidden (for example, when dragging something) or that the control at a position is disabled. */ + CURSOR_FORBIDDEN = 8, + + /** Vertical resize mouse cursor. A double-headed vertical arrow. It tells the user they can resize the window or the panel vertically. */ + CURSOR_VSIZE = 9, + + /** Horizontal resize mouse cursor. A double-headed horizontal arrow. It tells the user they can resize the window or the panel horizontally. */ + CURSOR_HSIZE = 10, + + /** Window resize mouse cursor. The cursor is a double-headed arrow that goes from the bottom left to the top right. It tells the user they can resize the window or the panel both horizontally and vertically. */ + CURSOR_BDIAGSIZE = 11, + + /** Window resize mouse cursor. The cursor is a double-headed arrow that goes from the top left to the bottom right, the opposite of [constant CURSOR_BDIAGSIZE]. It tells the user they can resize the window or the panel both horizontally and vertically. */ + CURSOR_FDIAGSIZE = 12, + + /** Move cursor. Indicates that something can be moved. */ + CURSOR_MOVE = 13, + + /** Vertical split mouse cursor. On Windows, it's the same as [constant CURSOR_VSIZE]. */ + CURSOR_VSPLIT = 14, + + /** Horizontal split mouse cursor. On Windows, it's the same as [constant CURSOR_HSIZE]. */ + CURSOR_HSPLIT = 15, + + /** Help cursor. Usually a question mark. */ + CURSOR_HELP = 16, + } + } + /** A singleton for handling inputs. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_input.html + */ + class Input extends Object { + /** Returns `true` if any action, key, joypad button, or mouse button is being pressed. This will also return `true` if any action is simulated via code by calling [method action_press]. */ + static is_anything_pressed(): boolean + + /** Returns `true` if you are pressing the Latin key in the current keyboard layout. You can pass a [enum Key] constant. + * [method is_key_pressed] is only recommended over [method is_physical_key_pressed] in non-game applications. This ensures that shortcut keys behave as expected depending on the user's keyboard layout, as keyboard shortcuts are generally dependent on the keyboard layout in non-game applications. If in doubt, use [method is_physical_key_pressed]. + * + * **Note:** Due to keyboard ghosting, [method is_key_pressed] may return `false` even if one of the action's keys is pressed. See [url=https://docs.godotengine.org/en/4.4/tutorials/inputs/input_examples.html#keyboard-events]Input examples[/url] in the documentation for more information. + */ + static is_key_pressed(keycode: Key): boolean + + /** Returns `true` if you are pressing the key in the physical location on the 101/102-key US QWERTY keyboard. You can pass a [enum Key] constant. + * [method is_physical_key_pressed] is recommended over [method is_key_pressed] for in-game actions, as it will make [kbd]W[/kbd]/[kbd]A[/kbd]/[kbd]S[/kbd]/[kbd]D[/kbd] layouts work regardless of the user's keyboard layout. [method is_physical_key_pressed] will also ensure that the top row number keys work on any keyboard layout. If in doubt, use [method is_physical_key_pressed]. + * + * **Note:** Due to keyboard ghosting, [method is_physical_key_pressed] may return `false` even if one of the action's keys is pressed. See [url=https://docs.godotengine.org/en/4.4/tutorials/inputs/input_examples.html#keyboard-events]Input examples[/url] in the documentation for more information. + */ + static is_physical_key_pressed(keycode: Key): boolean + + /** Returns `true` if you are pressing the key with the [param keycode] printed on it. You can pass a [enum Key] constant or any Unicode character code. */ + static is_key_label_pressed(keycode: Key): boolean + + /** Returns `true` if you are pressing the mouse button specified with [enum MouseButton]. */ + static is_mouse_button_pressed(button: MouseButton): boolean + + /** Returns `true` if you are pressing the joypad button (see [enum JoyButton]). */ + static is_joy_button_pressed(device: int64, button: JoyButton): boolean + + /** Returns `true` if you are pressing the action event. + * If [param exact_match] is `false`, it ignores additional input modifiers for [InputEventKey] and [InputEventMouseButton] events, and the direction for [InputEventJoypadMotion] events. + * + * **Note:** Due to keyboard ghosting, [method is_action_pressed] may return `false` even if one of the action's keys is pressed. See [url=https://docs.godotengine.org/en/4.4/tutorials/inputs/input_examples.html#keyboard-events]Input examples[/url] in the documentation for more information. + */ + static is_action_pressed(action: StringName, exact_match: boolean = false): boolean + + /** Returns `true` when the user has *started* pressing the action event in the current frame or physics tick. It will only return `true` on the frame or tick that the user pressed down the button. + * This is useful for code that needs to run only once when an action is pressed, instead of every frame while it's pressed. + * If [param exact_match] is `false`, it ignores additional input modifiers for [InputEventKey] and [InputEventMouseButton] events, and the direction for [InputEventJoypadMotion] events. + * + * **Note:** Returning `true` does not imply that the action is *still* pressed. An action can be pressed and released again rapidly, and `true` will still be returned so as not to miss input. + * + * **Note:** Due to keyboard ghosting, [method is_action_just_pressed] may return `false` even if one of the action's keys is pressed. See [url=https://docs.godotengine.org/en/4.4/tutorials/inputs/input_examples.html#keyboard-events]Input examples[/url] in the documentation for more information. + * + * **Note:** During input handling (e.g. [method Node._input]), use [method InputEvent.is_action_pressed] instead to query the action state of the current event. + */ + static is_action_just_pressed(action: StringName, exact_match: boolean = false): boolean + + /** Returns `true` when the user *stops* pressing the action event in the current frame or physics tick. It will only return `true` on the frame or tick that the user releases the button. + * + * **Note:** Returning `true` does not imply that the action is *still* not pressed. An action can be released and pressed again rapidly, and `true` will still be returned so as not to miss input. + * If [param exact_match] is `false`, it ignores additional input modifiers for [InputEventKey] and [InputEventMouseButton] events, and the direction for [InputEventJoypadMotion] events. + * + * **Note:** During input handling (e.g. [method Node._input]), use [method InputEvent.is_action_released] instead to query the action state of the current event. + */ + static is_action_just_released(action: StringName, exact_match: boolean = false): boolean + + /** Returns a value between 0 and 1 representing the intensity of the given action. In a joypad, for example, the further away the axis (analog sticks or L2, R2 triggers) is from the dead zone, the closer the value will be to 1. If the action is mapped to a control that has no axis such as the keyboard, the value returned will be 0 or 1. + * If [param exact_match] is `false`, it ignores additional input modifiers for [InputEventKey] and [InputEventMouseButton] events, and the direction for [InputEventJoypadMotion] events. + */ + static get_action_strength(action: StringName, exact_match: boolean = false): float64 + + /** Returns a value between 0 and 1 representing the raw intensity of the given action, ignoring the action's deadzone. In most cases, you should use [method get_action_strength] instead. + * If [param exact_match] is `false`, it ignores additional input modifiers for [InputEventKey] and [InputEventMouseButton] events, and the direction for [InputEventJoypadMotion] events. + */ + static get_action_raw_strength(action: StringName, exact_match: boolean = false): float64 + + /** Get axis input by specifying two actions, one negative and one positive. + * This is a shorthand for writing `Input.get_action_strength("positive_action") - Input.get_action_strength("negative_action")`. + */ + static get_axis(negative_action: StringName, positive_action: StringName): float64 + + /** Gets an input vector by specifying four actions for the positive and negative X and Y axes. + * This method is useful when getting vector input, such as from a joystick, directional pad, arrows, or WASD. The vector has its length limited to 1 and has a circular deadzone, which is useful for using vector input as movement. + * By default, the deadzone is automatically calculated from the average of the action deadzones. However, you can override the deadzone to be whatever you want (on the range of 0 to 1). + */ + static get_vector(negative_x: StringName, positive_x: StringName, negative_y: StringName, positive_y: StringName, deadzone: float64 = -1): Vector2 + + /** Adds a new mapping entry (in SDL2 format) to the mapping database. Optionally update already connected devices. */ + static add_joy_mapping(mapping: string, update_existing: boolean = false): void + + /** Removes all mappings from the internal database that match the given GUID. All currently connected joypads that use this GUID will become unmapped. + * On Android, Godot will map to an internal fallback mapping. + */ + static remove_joy_mapping(guid: string): void + + /** Returns `true` if the system knows the specified device. This means that it sets all button and axis indices. Unknown joypads are not expected to match these constants, but you can still retrieve events from them. */ + static is_joy_known(device: int64): boolean + + /** Returns the current value of the joypad axis at given index (see [enum JoyAxis]). */ + static get_joy_axis(device: int64, axis: JoyAxis): float64 + + /** Returns the name of the joypad at the specified device index, e.g. `PS4 Controller`. Godot uses the [url=https://github.com/gabomdq/SDL_GameControllerDB]SDL2 game controller database[/url] to determine gamepad names. */ + static get_joy_name(device: int64): string + + /** Returns an SDL2-compatible device GUID on platforms that use gamepad remapping, e.g. `030000004c050000c405000000010000`. Returns an empty string if it cannot be found. Godot uses the [url=https://github.com/gabomdq/SDL_GameControllerDB]SDL2 game controller database[/url] to determine gamepad names and mappings based on this GUID. + * On Windows, all XInput joypad GUIDs will be overridden by Godot to `__XINPUT_DEVICE__`, because their mappings are the same. + */ + static get_joy_guid(device: int64): string + + /** Returns a dictionary with extra platform-specific information about the device, e.g. the raw gamepad name from the OS or the Steam Input index. + * On Windows, the dictionary contains the following fields: + * `xinput_index`: The index of the controller in the XInput system. Undefined for DirectInput devices. + * `vendor_id`: The USB vendor ID of the device. + * `product_id`: The USB product ID of the device. + * On Linux: + * `raw_name`: The name of the controller as it came from the OS, before getting renamed by the godot controller database. + * `vendor_id`: The USB vendor ID of the device. + * `product_id`: The USB product ID of the device. + * `steam_input_index`: The Steam Input gamepad index, if the device is not a Steam Input device this key won't be present. + * + * **Note:** The returned dictionary is always empty on Web, iOS, Android, and macOS. + */ + static get_joy_info(device: int64): GDictionary + + /** Queries whether an input device should be ignored or not. Devices can be ignored by setting the environment variable `SDL_GAMECONTROLLER_IGNORE_DEVICES`. Read the [url=https://wiki.libsdl.org/SDL2]SDL documentation[/url] for more information. + * + * **Note:** Some 3rd party tools can contribute to the list of ignored devices. For example, *SteamInput* creates virtual devices from physical devices for remapping purposes. To avoid handling the same input device twice, the original device is added to the ignore list. + */ + static should_ignore_device(vendor_id: int64, product_id: int64): boolean + + /** Returns an [Array] containing the device IDs of all currently connected joypads. */ + static get_connected_joypads(): GArray + + /** Returns the strength of the joypad vibration: x is the strength of the weak motor, and y is the strength of the strong motor. */ + static get_joy_vibration_strength(device: int64): Vector2 + + /** Returns the duration of the current vibration effect in seconds. */ + static get_joy_vibration_duration(device: int64): float64 + + /** Starts to vibrate the joypad. Joypads usually come with two rumble motors, a strong and a weak one. [param weak_magnitude] is the strength of the weak motor (between 0 and 1) and [param strong_magnitude] is the strength of the strong motor (between 0 and 1). [param duration] is the duration of the effect in seconds (a duration of 0 will try to play the vibration indefinitely). The vibration can be stopped early by calling [method stop_joy_vibration]. + * + * **Note:** Not every hardware is compatible with long effect durations; it is recommended to restart an effect if it has to be played for more than a few seconds. + * + * **Note:** For macOS, vibration is only supported in macOS 11 and later. + */ + static start_joy_vibration(device: int64, weak_magnitude: float64, strong_magnitude: float64, duration: float64 = 0): void + + /** Stops the vibration of the joypad started with [method start_joy_vibration]. */ + static stop_joy_vibration(device: int64): void + + /** Vibrate the handheld device for the specified duration in milliseconds. + * [param amplitude] is the strength of the vibration, as a value between `0.0` and `1.0`. If set to `-1.0`, the default vibration strength of the device is used. + * + * **Note:** This method is implemented on Android, iOS, and Web. It has no effect on other platforms. + * + * **Note:** For Android, [method vibrate_handheld] requires enabling the `VIBRATE` permission in the export preset. Otherwise, [method vibrate_handheld] will have no effect. + * + * **Note:** For iOS, specifying the duration is only supported in iOS 13 and later. + * + * **Note:** For Web, the amplitude cannot be changed. + * + * **Note:** Some web browsers such as Safari and Firefox for Android do not support [method vibrate_handheld]. + */ + static vibrate_handheld(duration_ms: int64 = 500, amplitude: float64 = -1): void + + /** Returns the gravity in m/s² of the device's accelerometer sensor, if the device has one. Otherwise, the method returns [constant Vector3.ZERO]. + * + * **Note:** This method only works on Android and iOS. On other platforms, it always returns [constant Vector3.ZERO]. + * + * **Note:** For Android, [member ProjectSettings.input_devices/sensors/enable_gravity] must be enabled. + */ + static get_gravity(): Vector3 + + /** Returns the acceleration in m/s² of the device's accelerometer sensor, if the device has one. Otherwise, the method returns [constant Vector3.ZERO]. + * Note this method returns an empty [Vector3] when running from the editor even when your device has an accelerometer. You must export your project to a supported device to read values from the accelerometer. + * + * **Note:** This method only works on Android and iOS. On other platforms, it always returns [constant Vector3.ZERO]. + * + * **Note:** For Android, [member ProjectSettings.input_devices/sensors/enable_accelerometer] must be enabled. + */ + static get_accelerometer(): Vector3 + + /** Returns the magnetic field strength in micro-Tesla for all axes of the device's magnetometer sensor, if the device has one. Otherwise, the method returns [constant Vector3.ZERO]. + * + * **Note:** This method only works on Android and iOS. On other platforms, it always returns [constant Vector3.ZERO]. + * + * **Note:** For Android, [member ProjectSettings.input_devices/sensors/enable_magnetometer] must be enabled. + */ + static get_magnetometer(): Vector3 + + /** Returns the rotation rate in rad/s around a device's X, Y, and Z axes of the gyroscope sensor, if the device has one. Otherwise, the method returns [constant Vector3.ZERO]. + * + * **Note:** This method only works on Android and iOS. On other platforms, it always returns [constant Vector3.ZERO]. + * + * **Note:** For Android, [member ProjectSettings.input_devices/sensors/enable_gyroscope] must be enabled. + */ + static get_gyroscope(): Vector3 + + /** Sets the gravity value of the accelerometer sensor. Can be used for debugging on devices without a hardware sensor, for example in an editor on a PC. + * + * **Note:** This value can be immediately overwritten by the hardware sensor value on Android and iOS. + */ + static set_gravity(value: Vector3): void + + /** Sets the acceleration value of the accelerometer sensor. Can be used for debugging on devices without a hardware sensor, for example in an editor on a PC. + * + * **Note:** This value can be immediately overwritten by the hardware sensor value on Android and iOS. + */ + static set_accelerometer(value: Vector3): void + + /** Sets the value of the magnetic field of the magnetometer sensor. Can be used for debugging on devices without a hardware sensor, for example in an editor on a PC. + * + * **Note:** This value can be immediately overwritten by the hardware sensor value on Android and iOS. + */ + static set_magnetometer(value: Vector3): void + + /** Sets the value of the rotation rate of the gyroscope sensor. Can be used for debugging on devices without a hardware sensor, for example in an editor on a PC. + * + * **Note:** This value can be immediately overwritten by the hardware sensor value on Android and iOS. + */ + static set_gyroscope(value: Vector3): void + + /** Returns the last mouse velocity. To provide a precise and jitter-free velocity, mouse velocity is only calculated every 0.1s. Therefore, mouse velocity will lag mouse movements. */ + static get_last_mouse_velocity(): Vector2 + + /** Returns the last mouse velocity in screen coordinates. To provide a precise and jitter-free velocity, mouse velocity is only calculated every 0.1s. Therefore, mouse velocity will lag mouse movements. */ + static get_last_mouse_screen_velocity(): Vector2 + + /** Returns mouse buttons as a bitmask. If multiple mouse buttons are pressed at the same time, the bits are added together. Equivalent to [method DisplayServer.mouse_get_button_state]. */ + static get_mouse_button_mask(): MouseButtonMask + + /** Sets the mouse position to the specified vector, provided in pixels and relative to an origin at the upper left corner of the currently focused Window Manager game window. + * Mouse position is clipped to the limits of the screen resolution, or to the limits of the game window if [enum MouseMode] is set to [constant MOUSE_MODE_CONFINED] or [constant MOUSE_MODE_CONFINED_HIDDEN]. + * + * **Note:** [method warp_mouse] is only supported on Windows, macOS and Linux. It has no effect on Android, iOS and Web. + */ + static warp_mouse(position: Vector2): void + + /** This will simulate pressing the specified action. + * The strength can be used for non-boolean actions, it's ranged between 0 and 1 representing the intensity of the given action. + * + * **Note:** This method will not cause any [method Node._input] calls. It is intended to be used with [method is_action_pressed] and [method is_action_just_pressed]. If you want to simulate `_input`, use [method parse_input_event] instead. + */ + static action_press(action: StringName, strength: float64 = 1): void + + /** If the specified action is already pressed, this will release it. */ + static action_release(action: StringName): void + + /** Sets the default cursor shape to be used in the viewport instead of [constant CURSOR_ARROW]. + * + * **Note:** If you want to change the default cursor shape for [Control]'s nodes, use [member Control.mouse_default_cursor_shape] instead. + * + * **Note:** This method generates an [InputEventMouseMotion] to update cursor immediately. + */ + static set_default_cursor_shape(shape: Input.CursorShape = 0): void + + /** Returns the currently assigned cursor shape (see [enum CursorShape]). */ + static get_current_cursor_shape(): Input.CursorShape + + /** Sets a custom mouse cursor image, which is only visible inside the game window. The hotspot can also be specified. Passing `null` to the image parameter resets to the system cursor. See [enum CursorShape] for the list of shapes. + * [param image] can be either [Texture2D] or [Image] and its size must be lower than or equal to 256×256. To avoid rendering issues, sizes lower than or equal to 128×128 are recommended. + * [param hotspot] must be within [param image]'s size. + * + * **Note:** [AnimatedTexture]s aren't supported as custom mouse cursors. If using an [AnimatedTexture], only the first frame will be displayed. + * + * **Note:** The **Lossless**, **Lossy** or **Uncompressed** compression modes are recommended. The **Video RAM** compression mode can be used, but it will be decompressed on the CPU, which means loading times are slowed down and no memory is saved compared to lossless modes. + * + * **Note:** On the web platform, the maximum allowed cursor image size is 128×128. Cursor images larger than 32×32 will also only be displayed if the mouse cursor image is entirely located within the page for [url=https://chromestatus.com/feature/5825971391299584]security reasons[/url]. + */ + static set_custom_mouse_cursor(image: Resource, shape: Input.CursorShape = 0, hotspot: Vector2 = Vector2.ZERO): void + + /** Feeds an [InputEvent] to the game. Can be used to artificially trigger input events from code. Also generates [method Node._input] calls. + * + * + * **Note:** Calling this function has no influence on the operating system. So for example sending an [InputEventMouseMotion] will not move the OS mouse cursor to the specified position (use [method warp_mouse] instead) and sending [kbd]Alt/Cmd + Tab[/kbd] as [InputEventKey] won't toggle between active windows. + */ + static parse_input_event(event: InputEvent): void + + /** Sends all input events which are in the current buffer to the game loop. These events may have been buffered as a result of accumulated input ([member use_accumulated_input]) or agile input flushing ([member ProjectSettings.input_devices/buffering/agile_event_flushing]). + * The engine will already do this itself at key execution points (at least once per frame). However, this can be useful in advanced cases where you want precise control over the timing of event handling. + */ + static flush_buffered_events(): void + + /** Controls the mouse mode. See [enum MouseMode] for more information. */ + get mouse_mode(): int64 + set mouse_mode(value: int64) + + /** If `true`, similar input events sent by the operating system are accumulated. When input accumulation is enabled, all input events generated during a frame will be merged and emitted when the frame is done rendering. Therefore, this limits the number of input method calls per second to the rendering FPS. + * Input accumulation can be disabled to get slightly more precise/reactive input at the cost of increased CPU usage. In applications where drawing freehand lines is required, input accumulation should generally be disabled while the user is drawing the line to get results that closely follow the actual input. + * + * **Note:** Input accumulation is *enabled* by default. + */ + get use_accumulated_input(): boolean + set use_accumulated_input(value: boolean) + + /** If `true`, sends mouse input events when tapping or swiping on the touchscreen. See also [member ProjectSettings.input_devices/pointing/emulate_mouse_from_touch]. */ + get emulate_mouse_from_touch(): boolean + set emulate_mouse_from_touch(value: boolean) + + /** If `true`, sends touch input events when clicking or dragging the mouse. See also [member ProjectSettings.input_devices/pointing/emulate_touch_from_mouse]. */ + get emulate_touch_from_mouse(): boolean + set emulate_touch_from_mouse(value: boolean) + + /** Emitted when a joypad device has been connected or disconnected. */ + static readonly joy_connection_changed: Signal2 + } + // _singleton_class_: InputMap + /** A singleton that manages all [InputEventAction]s. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_inputmap.html + */ + class InputMap extends Object { + /** Returns `true` if the [InputMap] has a registered action with the given name. */ + static has_action(action: StringName): boolean + + /** Returns an array of all actions in the [InputMap]. */ + static get_actions(): GArray + + /** Adds an empty action to the [InputMap] with a configurable [param deadzone]. + * An [InputEvent] can then be added to this action with [method action_add_event]. + */ + static add_action(action: StringName, deadzone: float64 = 0.20000000298023224): void + + /** Removes an action from the [InputMap]. */ + static erase_action(action: StringName): void + + /** Sets a deadzone value for the action. */ + static action_set_deadzone(action: StringName, deadzone: float64): void + + /** Returns a deadzone value for the action. */ + static action_get_deadzone(action: StringName): float64 + + /** Adds an [InputEvent] to an action. This [InputEvent] will trigger the action. */ + static action_add_event(action: StringName, event: InputEvent): void + + /** Returns `true` if the action has the given [InputEvent] associated with it. */ + static action_has_event(action: StringName, event: InputEvent): boolean + + /** Removes an [InputEvent] from an action. */ + static action_erase_event(action: StringName, event: InputEvent): void + + /** Removes all events from an action. */ + static action_erase_events(action: StringName): void + + /** Returns an array of [InputEvent]s associated with a given action. + * + * **Note:** When used in the editor (e.g. a tool script or [EditorPlugin]), this method will return events for the editor action. If you want to access your project's input binds from the editor, read the `input/*` settings from [ProjectSettings]. + */ + static action_get_events(action: StringName): GArray + + /** Returns `true` if the given event is part of an existing action. This method ignores keyboard modifiers if the given [InputEvent] is not pressed (for proper release detection). See [method action_has_event] if you don't want this behavior. + * If [param exact_match] is `false`, it ignores additional input modifiers for [InputEventKey] and [InputEventMouseButton] events, and the direction for [InputEventJoypadMotion] events. + */ + static event_is_action(event: InputEvent, action: StringName, exact_match: boolean = false): boolean + + /** Clears all [InputEventAction] in the [InputMap] and load it anew from [ProjectSettings]. */ + static load_from_project_settings(): void + } + // _singleton_class_: EngineDebugger + /** Exposes the internal debugger. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_enginedebugger.html + */ + class EngineDebugger extends Object { + /** Returns `true` if the debugger is active otherwise `false`. */ + static is_active(): boolean + + /** Registers a profiler with the given [param name]. See [EngineProfiler] for more information. */ + static register_profiler(name: StringName, profiler: EngineProfiler): void + + /** Unregisters a profiler with given [param name]. */ + static unregister_profiler(name: StringName): void + + /** Returns `true` if a profiler with the given name is present and active otherwise `false`. */ + static is_profiling(name: StringName): boolean + + /** Returns `true` if a profiler with the given name is present otherwise `false`. */ + static has_profiler(name: StringName): boolean + + /** Calls the `add` callable of the profiler with given [param name] and [param data]. */ + static profiler_add_frame_data(name: StringName, data: GArray): void + + /** Calls the `toggle` callable of the profiler with given [param name] and [param arguments]. Enables/Disables the same profiler depending on [param enable] argument. */ + static profiler_enable(name: StringName, enable: boolean, arguments_: GArray = []): void + + /** Registers a message capture with given [param name]. If [param name] is "my_message" then messages starting with "my_message:" will be called with the given callable. + * The callable must accept a message string and a data array as argument. The callable should return `true` if the message is recognized. + * + * **Note:** The callable will receive the message with the prefix stripped, unlike [method EditorDebuggerPlugin._capture]. See the [EditorDebuggerPlugin] description for an example. + */ + static register_message_capture(name: StringName, callable: Callable): void + + /** Unregisters the message capture with given [param name]. */ + static unregister_message_capture(name: StringName): void + + /** Returns `true` if a capture with the given name is present otherwise `false`. */ + static has_capture(name: StringName): boolean + + /** Forces a processing loop of debugger events. The purpose of this method is just processing events every now and then when the script might get too busy, so that bugs like infinite loops can be caught. */ + static line_poll(): void + + /** Sends a message with given [param message] and [param data] array. */ + static send_message(message: string, data: GArray): void + + /** Starts a debug break in script execution, optionally specifying whether the program can continue based on [param can_continue] and whether the break was due to a breakpoint. */ + static debug(can_continue: boolean = true, is_error_breakpoint: boolean = false): void + + /** Starts a debug break in script execution, optionally specifying whether the program can continue based on [param can_continue] and whether the break was due to a breakpoint. */ + static script_debug(language: ScriptLanguage, can_continue: boolean = true, is_error_breakpoint: boolean = false): void + + /** Sets the current debugging lines that remain. */ + static set_lines_left(lines: int64): void + + /** Returns the number of lines that remain. */ + static get_lines_left(): int64 + + /** Sets the current debugging depth. */ + static set_depth(depth: int64): void + + /** Returns the current debug depth. */ + static get_depth(): int64 + + /** Returns `true` if the given [param source] and [param line] represent an existing breakpoint. */ + static is_breakpoint(line: int64, source: StringName): boolean + + /** Returns `true` if the debugger is skipping breakpoints otherwise `false`. */ + static is_skipping_breakpoints(): boolean + + /** Inserts a new breakpoint with the given [param source] and [param line]. */ + static insert_breakpoint(line: int64, source: StringName): void + + /** Removes a breakpoint with the given [param source] and [param line]. */ + static remove_breakpoint(line: int64, source: StringName): void + + /** Clears all breakpoints. */ + static clear_breakpoints(): void + } // _singleton_class_: GDExtensionManager namespace GDExtensionManager { enum LoadStatus { @@ -2395,7 +2575,7 @@ declare module "godot" { } /** Provides access to GDExtension functionality. * - * @link https://docs.godotengine.org/en/4.3/classes/class_gdextensionmanager.html + * @link https://docs.godotengine.org/en/4.4/classes/class_gdextensionmanager.html */ class GDExtensionManager extends Object { /** Loads an extension by absolute file path. The [param path] needs to point to a valid [GDExtension]. Returns [constant LOAD_STATUS_OK] if successful. */ @@ -2421,11 +2601,23 @@ declare module "godot" { /** Emitted after the editor has finished reloading one or more extensions. */ static readonly extensions_reloaded: Signal0 + + /** Emitted after the editor has finished loading a new extension. + * + * **Note:** This signal is only emitted in editor builds. + */ + static readonly extension_loaded: Signal1 + + /** Emitted before the editor starts unloading an extension. + * + * **Note:** This signal is only emitted in editor builds. + */ + static readonly extension_unloading: Signal1 } // _singleton_class_: ResourceUID /** A singleton that manages the unique identifiers of all resources within a project. * - * @link https://docs.godotengine.org/en/4.3/classes/class_resourceuid.html + * @link https://docs.godotengine.org/en/4.4/classes/class_resourceuid.html */ class ResourceUID extends Object { /** The value to use for an invalid UID, for example if the resource could not be loaded. @@ -2470,7 +2662,7 @@ declare module "godot" { // _singleton_class_: WorkerThreadPool /** A singleton that allocates some [Thread]s on startup, used to offload tasks to these threads. * - * @link https://docs.godotengine.org/en/4.3/classes/class_workerthreadpool.html + * @link https://docs.godotengine.org/en/4.4/classes/class_workerthreadpool.html */ class WorkerThreadPool extends Object { /** Adds [param action] as a task to be executed by a worker thread. [param high_priority] determines if the task has a high priority or a low priority (default). You can optionally provide a [param description] to help with debugging. @@ -2517,7 +2709,7 @@ declare module "godot" { // _singleton_class_: ThemeDB /** A singleton that provides access to static information about [Theme] resources used by the engine and by your project. * - * @link https://docs.godotengine.org/en/4.3/classes/class_themedb.html + * @link https://docs.godotengine.org/en/4.4/classes/class_themedb.html */ class ThemeDB extends Object { /** Returns a reference to the default engine [Theme]. This theme resource is responsible for the out-of-the-box look of [Control] nodes and cannot be overridden. */ @@ -2560,7 +2752,7 @@ declare module "godot" { // _singleton_class_: EditorInterface /** Godot editor's interface. * - * @link https://docs.godotengine.org/en/4.3/classes/class_editorinterface.html + * @link https://docs.godotengine.org/en/4.4/classes/class_editorinterface.html */ class EditorInterface extends Object { /** Restarts the editor. This closes the editor and then opens the same project. If [param save] is `true`, the project will be saved before restarting. */ @@ -2586,6 +2778,12 @@ declare module "godot" { /** Returns the editor's [EditorSettings] instance. */ static get_editor_settings(): EditorSettings + /** Returns the editor's [EditorToaster]. */ + static get_editor_toaster(): EditorToaster + + /** Returns the editor's [EditorUndoRedoManager]. */ + static get_editor_undo_redo(): EditorUndoRedoManager + /** Returns mesh previews rendered at the given size as an [Array] of [Texture2D]s. */ static make_mesh_previews(meshes: GArray, preview_size: int64): GArray @@ -2630,7 +2828,7 @@ declare module "godot" { /** Returns `true` if multiple window support is enabled in the editor. Multiple window support is enabled if *all* of these statements are true: * - [member EditorSettings.interface/multi_window/enable] is `true`. * - [member EditorSettings.interface/editor/single_window_mode] is `false`. - * - [member Viewport.gui_embed_subwindows] is `false`. This is forced to `true` on platforms that don't support multiple windows such as Web, or when the `--single-window` [url=https://docs.godotengine.org/en/4.3/tutorials/editor/command_line_tutorial.html]command line argument[/url] is used. + * - [member Viewport.gui_embed_subwindows] is `false`. This is forced to `true` on platforms that don't support multiple windows such as Web, or when the `--single-window` [url=https://docs.godotengine.org/en/4.4/tutorials/editor/command_line_tutorial.html]command line argument[/url] is used. */ static is_multi_window_enabled(): boolean @@ -2674,17 +2872,33 @@ declare module "godot" { */ static set_current_feature_profile(profile_name: string): void - /** Pops up an editor dialog for selecting a [Node] from the edited scene. The [param callback] must take a single argument of type [NodePath]. It is called on the selected [NodePath] or the empty path `^""` if the dialog is canceled. If [param valid_types] is provided, the dialog will only show Nodes that match one of the listed Node types. - * **Example:** + /** Pops up an editor dialog for selecting a [Node] from the edited scene. The [param callback] must take a single argument of type [NodePath]. It is called on the selected [NodePath] or the empty path `^""` if the dialog is canceled. If [param valid_types] is provided, the dialog will only show Nodes that match one of the listed Node types. If [param current_value] is provided, the Node will be automatically selected in the tree, if it exists. + * **Example:** Display the node selection dialog as soon as this node is added to the tree for the first time: * */ - static popup_node_selector(callback: Callable, valid_types: GArray = []): void + static popup_node_selector(callback: Callable, valid_types: GArray = [], current_value: Node = undefined): void - /** Pops up an editor dialog for selecting properties from [param object]. The [param callback] must take a single argument of type [NodePath]. It is called on the selected property path (see [method NodePath.get_as_property_path]) or the empty path `^""` if the dialog is canceled. If [param type_filter] is provided, the dialog will only show properties that match one of the listed [enum Variant.Type] values. - * **Example:** + /** Pops up an editor dialog for selecting properties from [param object]. The [param callback] must take a single argument of type [NodePath]. It is called on the selected property path (see [method NodePath.get_as_property_path]) or the empty path `^""` if the dialog is canceled. If [param type_filter] is provided, the dialog will only show properties that match one of the listed [enum Variant.Type] values. If [param current_value] is provided, the property will be selected automatically in the property list, if it exists. * */ - static popup_property_selector(object: Object, callback: Callable, type_filter: PackedInt32Array | int32[] = []): void + static popup_property_selector(object: Object, callback: Callable, type_filter: PackedInt32Array | int32[] = [], current_value: string = ''): void + + /** Pops up an editor dialog for selecting a method from [param object]. The [param callback] must take a single argument of type [String] which will contain the name of the selected method or be empty if the dialog is canceled. If [param current_value] is provided, the method will be selected automatically in the method list, if it exists. */ + static popup_method_selector(object: Object, callback: Callable, current_value: string = ''): void + + /** Pops up an editor dialog for quick selecting a resource file. The [param callback] must take a single argument of type [String] which will contain the path of the selected resource or be empty if the dialog is canceled. If [param base_types] is provided, the dialog will only show resources that match these types. Only types deriving from [Resource] are supported. */ + static popup_quick_open(callback: Callable, base_types: GArray = []): void + + /** Pops up an editor dialog for creating an object. + * The [param callback] must take a single argument of type [StringName] which will contain the type name of the selected object or be empty if no item is selected. + * The [param base_type] specifies the base type of objects to display. For example, if you set this to "Resource", all types derived from [Resource] will display in the create dialog. + * The [param current_type] will be passed in the search box of the create dialog, and the specified type can be immediately selected when the dialog pops up. If the [param current_type] is not derived from [param base_type], there will be no result of the type in the dialog. + * The [param dialog_title] allows you to define a custom title for the dialog. This is useful if you want to accurately hint the usage of the dialog. If the [param dialog_title] is an empty string, the dialog will use "Create New 'Base Type'" as the default title. + * The [param type_blocklist] contains a list of type names, and the types in the blocklist will be hidden from the create dialog. + * + * **Note:** Trying to list the base type in the [param type_blocklist] will hide all types derived from the base type from the create dialog. + */ + static popup_create_dialog(callback: Callable, base_type: StringName = '', current_type: string = '', dialog_title: string = '', type_blocklist: GArray = []): void /** Returns the editor's [FileSystemDock] instance. * **Warning:** Removing and freeing this node will render a part of the editor useless and may cause a crash. @@ -2720,8 +2934,8 @@ declare module "godot" { /** Edits the given [Script]. The line and column on which to open the script can also be specified. The script will be open with the user-configured editor for the script's language which may be an external editor. */ static edit_script(script: Script, line: int64 = -1, column: int64 = 0, grab_focus: boolean = true): void - /** Opens the scene at the given path. */ - static open_scene_from_path(scene_filepath: string): void + /** Opens the scene at the given path. If [param set_inherited] is `true`, creates a new inherited scene. */ + static open_scene_from_path(scene_filepath: string, set_inherited: boolean = false): void /** Reloads the scene at the given path. */ static reload_scene_from_path(scene_filepath: string): void @@ -2773,7 +2987,7 @@ declare module "godot" { // _singleton_class_: JavaClassWrapper /** Provides access to the Java Native Interface. * - * @link https://docs.godotengine.org/en/4.3/classes/class_javaclasswrapper.html + * @link https://docs.godotengine.org/en/4.4/classes/class_javaclasswrapper.html */ class JavaClassWrapper extends Object { /** Wraps a class defined in Java, and returns it as a [JavaClass] [Object] type that Godot can interact with. @@ -2781,11 +2995,17 @@ declare module "godot" { * **Note:** This method only works on Android. On every other platform, this method does nothing and returns an empty [JavaClass]. */ static wrap(name: string): JavaClass + + /** Returns the Java exception from the last call into a Java class. If there was no exception, it will return `null`. + * + * **Note:** This method only works on Android. On every other platform, this method will always return `null`. + */ + static get_exception(): JavaObject } // _singleton_class_: JavaScriptBridge /** Singleton that connects the engine with the browser's JavaScript context in Web export. * - * @link https://docs.godotengine.org/en/4.3/classes/class_javascriptbridge.html + * @link https://docs.godotengine.org/en/4.4/classes/class_javascriptbridge.html */ class JavaScriptBridge extends Object { /** Execute the string [param code] as JavaScript code within the browser window. This is a call to the actual global JavaScript function [code skip-lint]eval()`. @@ -2796,9 +3016,18 @@ declare module "godot" { /** Returns an interface to a JavaScript object that can be used by scripts. The [param interface] must be a valid property of the JavaScript `window`. The callback must accept a single [Array] argument, which will contain the JavaScript `arguments`. See [JavaScriptObject] for usage. */ static get_interface(interface: string): JavaScriptObject - /** Creates a reference to a [Callable] that can be used as a callback by JavaScript. The reference must be kept until the callback happens, or it won't be called at all. See [JavaScriptObject] for usage. */ + /** Creates a reference to a [Callable] that can be used as a callback by JavaScript. The reference must be kept until the callback happens, or it won't be called at all. See [JavaScriptObject] for usage. + * + * **Note:** The callback function must take exactly one [Array] argument, which is going to be the JavaScript [url=https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/arguments]arguments object[/url] converted to an array. + */ static create_callback(callable: Callable): JavaScriptObject + /** Returns `true` if the given [param javascript_object] is of type [url=https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer]`ArrayBuffer`[/url], [url=https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView]`DataView`[/url], or one of the many [url=https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray]typed array objects[/url]. */ + static is_js_buffer(javascript_object: JavaScriptObject): boolean + + /** Returns a copy of [param javascript_buffer]'s contents as a [PackedByteArray]. See also [method is_js_buffer]. */ + static js_buffer_to_packed_byte_array(javascript_buffer: JavaScriptObject): PackedByteArray + /** Creates a new JavaScript object using the `new` constructor. The [param object] must a valid property of the JavaScript `window`. See [JavaScriptObject] for usage. */ static create_object(object: string, ...vargargs: any[]): any @@ -2871,7 +3100,7 @@ declare module "godot" { } /** Server interface for low-level audio access. * - * @link https://docs.godotengine.org/en/4.3/classes/class_audioserver.html + * @link https://docs.godotengine.org/en/4.4/classes/class_audioserver.html */ class AudioServer extends Object { /** Removes the bus at index [param index]. */ @@ -2895,12 +3124,24 @@ declare module "godot" { /** Returns the number of channels of the bus at index [param bus_idx]. */ static get_bus_channels(bus_idx: int64): int64 - /** Sets the volume of the bus at index [param bus_idx] to [param volume_db]. */ + /** Sets the volume in decibels of the bus at index [param bus_idx] to [param volume_db]. */ static set_bus_volume_db(bus_idx: int64, volume_db: float64): void /** Returns the volume of the bus at index [param bus_idx] in dB. */ static get_bus_volume_db(bus_idx: int64): float64 + /** Sets the volume as a linear value of the bus at index [param bus_idx] to [param volume_linear]. + * + * **Note:** Using this method is equivalent to calling [method set_bus_volume_db] with the result of [method @GlobalScope.linear_to_db] on a value. + */ + static set_bus_volume_linear(bus_idx: int64, volume_linear: float64): void + + /** Returns the volume of the bus at index [param bus_idx] as a linear value. + * + * **Note:** The returned value is equivalent to the result of [method @GlobalScope.db_to_linear] on the result of [method get_bus_volume_db]. + */ + static get_bus_volume_linear(bus_idx: int64): float64 + /** Connects the output of the bus at [param bus_idx] to the bus named [param send]. */ static set_bus_send(bus_idx: int64, send: StringName): void @@ -2970,6 +3211,12 @@ declare module "godot" { /** Returns the sample rate at the output of the [AudioServer]. */ static get_mix_rate(): float64 + /** Returns the sample rate at the input of the [AudioServer]. */ + static get_input_mix_rate(): float64 + + /** Returns the name of the current audio driver. The default usually depends on the operating system, but may be overridden via the `--audio-driver` [url=https://docs.godotengine.org/en/4.4/tutorials/editor/command_line_tutorial.html]command line argument[/url]. `--headless` also automatically sets the audio driver to `Dummy`. See also [member ProjectSettings.audio/driver/driver]. */ + static get_driver_name(): string + /** Returns the names of all audio output devices detected on the system. */ static get_output_device_list(): PackedStringArray @@ -3057,7 +3304,7 @@ declare module "godot" { } /** Server keeping track of different cameras accessible in Godot. * - * @link https://docs.godotengine.org/en/4.3/classes/class_cameraserver.html + * @link https://docs.godotengine.org/en/4.4/classes/class_cameraserver.html */ class CameraServer extends Object { /** Returns the [CameraFeed] corresponding to the camera with the given [param index]. */ @@ -3156,8 +3403,26 @@ declare module "godot" { /** Display server supports spawning text input dialogs using the operating system's native look-and-feel. See [method dialog_input_text]. **Windows, macOS** */ FEATURE_NATIVE_DIALOG_INPUT = 24, - /** Display server supports spawning dialogs for selecting files or directories using the operating system's native look-and-feel. See [method file_dialog_show] and [method file_dialog_with_options_show]. **Windows, macOS, Linux (X11/Wayland)** */ + /** Display server supports spawning dialogs for selecting files or directories using the operating system's native look-and-feel. See [method file_dialog_show]. **Windows, macOS, Linux (X11/Wayland), Android** */ FEATURE_NATIVE_DIALOG_FILE = 25, + + /** The display server supports all features of [constant FEATURE_NATIVE_DIALOG_FILE], with the added functionality of Options and native dialog file access to `res://` and `user://` paths. See [method file_dialog_show] and [method file_dialog_with_options_show]. **Windows, macOS, Linux (X11/Wayland)** */ + FEATURE_NATIVE_DIALOG_FILE_EXTRA = 26, + + /** The display server supports initiating window drag and resize operations on demand. See [method window_start_drag] and [method window_start_resize]. */ + FEATURE_WINDOW_DRAG = 27, + + /** Display server supports [constant WINDOW_FLAG_EXCLUDE_FROM_CAPTURE] window flag. */ + FEATURE_SCREEN_EXCLUDE_FROM_CAPTURE = 28, + + /** Display server supports embedding a window from another process. **Windows, Linux (X11)** */ + FEATURE_WINDOW_EMBEDDING = 29, + + /** Native file selection dialog supports MIME types as filters. */ + FEATURE_NATIVE_DIALOG_FILE_MIME = 30, + + /** Display server supports system emoji and symbol picker. **Windows, macOS** */ + FEATURE_EMOJI_AND_SYMBOL_PICKER = 31, } enum MouseMode { /** Makes the mouse cursor visible if it is hidden. */ @@ -3177,6 +3442,9 @@ declare module "godot" { /** Confines the mouse cursor to the game window, and make it hidden. */ MOUSE_MODE_CONFINED_HIDDEN = 4, + + /** Max value of the [enum MouseMode]. */ + MOUSE_MODE_MAX = 5, } enum ScreenOrientation { /** Default landscape orientation. */ @@ -3311,20 +3579,23 @@ declare module "godot" { /** Full screen mode with full multi-window support. * Full screen window covers the entire display area of a screen and has no decorations. The display's video mode is not changed. + * **On Android:** This enables immersive mode. * **On Windows:** Multi-window full-screen mode has a 1px border of the [member ProjectSettings.rendering/environment/defaults/default_clear_color] color. * **On macOS:** A new desktop is used to display the running project. * - * **Note:** Regardless of the platform, enabling full screen will change the window size to match the monitor's size. Therefore, make sure your project supports [url=https://docs.godotengine.org/en/4.3/tutorials/rendering/multiple_resolutions.html]multiple resolutions[/url] when enabling full screen mode. + * **Note:** Regardless of the platform, enabling full screen will change the window size to match the monitor's size. Therefore, make sure your project supports [url=https://docs.godotengine.org/en/4.4/tutorials/rendering/multiple_resolutions.html]multiple resolutions[/url] when enabling full screen mode. */ WINDOW_MODE_FULLSCREEN = 3, /** A single window full screen mode. This mode has less overhead, but only one window can be open on a given screen at a time (opening a child window or application switching will trigger a full screen transition). * Full screen window covers the entire display area of a screen and has no border or decorations. The display's video mode is not changed. + * **On Android:** This enables immersive mode. * **On Windows:** Depending on video driver, full screen transition might cause screens to go black for a moment. * **On macOS:** A new desktop is used to display the running project. Exclusive full screen mode prevents Dock and Menu from showing up when the mouse pointer is hovering the edge of the screen. * **On Linux (X11):** Exclusive full screen mode bypasses compositor. + * **On Linux (Wayland):** Equivalent to [constant WINDOW_MODE_FULLSCREEN]. * - * **Note:** Regardless of the platform, enabling full screen will change the window size to match the monitor's size. Therefore, make sure your project supports [url=https://docs.godotengine.org/en/4.3/tutorials/rendering/multiple_resolutions.html]multiple resolutions[/url] when enabling full screen mode. + * **Note:** Regardless of the platform, enabling full screen will change the window size to match the monitor's size. Therefore, make sure your project supports [url=https://docs.godotengine.org/en/4.4/tutorials/rendering/multiple_resolutions.html]multiple resolutions[/url] when enabling full screen mode. */ WINDOW_MODE_EXCLUSIVE_FULLSCREEN = 4, } @@ -3363,8 +3634,22 @@ declare module "godot" { /** All mouse events are passed to the underlying window of the same application. */ WINDOW_FLAG_MOUSE_PASSTHROUGH = 7, + /** Window style is overridden, forcing sharp corners. + * + * **Note:** This flag is implemented only on Windows (11). + */ + WINDOW_FLAG_SHARP_CORNERS = 8, + + /** Windows is excluded from screenshots taken by [method screen_get_image], [method screen_get_image_rect], and [method screen_get_pixel]. + * + * **Note:** This flag is implemented on macOS and Windows. + * + * **Note:** Setting this flag will **NOT** prevent other apps from capturing an image, it should not be used as a security measure. + */ + WINDOW_FLAG_EXCLUDE_FROM_CAPTURE = 9, + /** Max value of the [enum WindowFlags]. */ - WINDOW_FLAG_MAX = 8, + WINDOW_FLAG_MAX = 10, } enum WindowEvent { /** Sent when the mouse pointer enters the window. */ @@ -3400,6 +3685,34 @@ declare module "godot" { */ WINDOW_EVENT_TITLEBAR_CHANGE = 7, } + enum WindowResizeEdge { + /** Top-left edge of a window. */ + WINDOW_EDGE_TOP_LEFT = 0, + + /** Top edge of a window. */ + WINDOW_EDGE_TOP = 1, + + /** Top-right edge of a window. */ + WINDOW_EDGE_TOP_RIGHT = 2, + + /** Left edge of a window. */ + WINDOW_EDGE_LEFT = 3, + + /** Right edge of a window. */ + WINDOW_EDGE_RIGHT = 4, + + /** Bottom-left edge of a window. */ + WINDOW_EDGE_BOTTOM_LEFT = 5, + + /** Bottom edge of a window. */ + WINDOW_EDGE_BOTTOM = 6, + + /** Bottom-right edge of a window. */ + WINDOW_EDGE_BOTTOM_RIGHT = 7, + + /** Represents the size of the [enum WindowResizeEdge] enum. */ + WINDOW_EDGE_MAX = 8, + } enum VSyncMode { /** No vertical synchronization, which means the engine will display frames as fast as possible (tearing may be visible). Framerate is unlimited (regardless of [member Engine.max_fps]). */ VSYNC_DISABLED = 0, @@ -3418,6 +3731,7 @@ declare module "godot" { enum HandleType { /** Display handle: * - Linux (X11): `X11::Display*` for the display. + * - Linux (Wayland): `wl_display` for the display. * - Android: `EGLDisplay` for the display. */ DISPLAY_HANDLE = 0, @@ -3425,6 +3739,7 @@ declare module "godot" { /** Window handle: * - Windows: `HWND` for the window. * - Linux (X11): `X11::Window*` for the window. + * - Linux (Wayland): `wl_surface` for the window. * - macOS: `NSWindow*` for the window. * - iOS: `UIViewController*` for the view controller. * - Android: `jObject` for the activity. @@ -3432,19 +3747,32 @@ declare module "godot" { WINDOW_HANDLE = 1, /** Window view: - * - Windows: `HDC` for the window (only with the GL Compatibility renderer). + * - Windows: `HDC` for the window (only with the Compatibility renderer). * - macOS: `NSView*` for the window main view. * - iOS: `UIView*` for the window main view. */ WINDOW_VIEW = 2, - /** OpenGL context (only with the GL Compatibility renderer): + /** OpenGL context (only with the Compatibility renderer): * - Windows: `HGLRC` for the window (native GL), or `EGLContext` for the window (ANGLE). * - Linux (X11): `GLXContext*` for the window. + * - Linux (Wayland): `EGLContext` for the window. * - macOS: `NSOpenGLContext*` for the window (native GL), or `EGLContext` for the window (ANGLE). * - Android: `EGLContext` for the window. */ OPENGL_CONTEXT = 3, + + /** - Windows: `EGLDisplay` for the window (ANGLE). + * - macOS: `EGLDisplay` for the window (ANGLE). + * - Linux (Wayland): `EGLDisplay` for the window. + */ + EGL_DISPLAY = 4, + + /** - Windows: `EGLConfig` for the window (ANGLE). + * - macOS: `EGLConfig` for the window (ANGLE). + * - Linux (Wayland): `EGLConfig` for the window. + */ + EGL_CONFIG = 5, } enum TTSUtteranceEvent { /** Utterance has begun to be spoken. */ @@ -3462,7 +3790,7 @@ declare module "godot" { } /** A server interface for low-level window management. * - * @link https://docs.godotengine.org/en/4.3/classes/class_displayserver.html + * @link https://docs.godotengine.org/en/4.4/classes/class_displayserver.html */ class DisplayServer extends Object { /** Represents the screen containing the mouse pointer. @@ -3502,7 +3830,7 @@ declare module "godot" { static has_feature(feature: DisplayServer.Feature): boolean /** Returns the name of the [DisplayServer] currently in use. Most operating systems only have a single [DisplayServer], but Linux has access to more than one [DisplayServer] (currently X11 and Wayland). - * The names of built-in display servers are `Windows`, `macOS`, `X11` (Linux), `Wayland` (Linux), `Android`, `iOS`, `web` (HTML5), and `headless` (when started with the `--headless` [url=https://docs.godotengine.org/en/4.3/tutorials/editor/command_line_tutorial.html]command line argument[/url]). + * The names of built-in display servers are `Windows`, `macOS`, `X11` (Linux), `Wayland` (Linux), `Android`, `iOS`, `web` (HTML5), and `headless` (when started with the `--headless` [url=https://docs.godotengine.org/en/4.4/tutorials/editor/command_line_tutorial.html]command line argument[/url]). */ static get_name(): string @@ -4043,13 +4371,13 @@ declare module "godot" { /** Returns OS theme accent color. Returns `Color(0, 0, 0, 0)`, if accent color is unknown. * - * **Note:** This method is implemented on macOS and Windows. + * **Note:** This method is implemented on macOS, Windows, and Android. */ static get_accent_color(): Color /** Returns the OS theme base color (default control background). Returns `Color(0, 0, 0, 0)` if the base color is unknown. * - * **Note:** This method is implemented on macOS and Windows. + * **Note:** This method is implemented on macOS, Windows, and Android. */ static get_base_color(): Color @@ -4113,7 +4441,10 @@ declare module "godot" { */ static get_display_cutouts(): GArray - /** Returns the unobscured area of the display where interactive controls should be rendered. See also [method get_display_cutouts]. */ + /** Returns the unobscured area of the display where interactive controls should be rendered. See also [method get_display_cutouts]. + * + * **Note:** Currently only implemented on Android and iOS. On other platforms, `screen_get_usable_rect(SCREEN_OF_MAIN_WINDOW)` will be returned as a fallback. See also [method screen_get_usable_rect]. + */ static get_display_safe_area(): Rect2i /** Returns the number of displays available. */ @@ -4125,7 +4456,7 @@ declare module "godot" { /** Returns the index of the screen containing the window with the keyboard focus, or the primary screen if there's no focused window. */ static get_keyboard_focus_screen(): int64 - /** Returns index of the screen which contains specified rectangle. */ + /** Returns the index of the screen that overlaps the most with the given rectangle. Returns `-1` if the rectangle doesn't overlap with any screen or has no area. */ static get_screen_from_rect(rect: Rect2): int64 /** Returns the screen's top-left corner position in pixels. On multi-monitor setups, the screen position is relative to the virtual desktop area. On multi-monitor setups with different screen resolutions or orientations, the origin may be located outside any display like this: @@ -4173,7 +4504,7 @@ declare module "godot" { * * **Note:** On Linux (Wayland), the returned value is accurate only when [param screen] is [constant SCREEN_OF_MAIN_WINDOW]. Due to API limitations, passing a direct index will return a rounded-up integer, if the screen has a fractional scale (e.g. `1.25` would get rounded up to `2.0`). * - * **Note:** This method is implemented only on macOS and Linux (Wayland). + * **Note:** This method is implemented on Android, iOS, Web, macOS, and Linux (Wayland). */ static screen_get_scale(screen: int64 = -1): float64 @@ -4212,6 +4543,14 @@ declare module "godot" { */ static screen_get_image(screen: int64 = -1): Image + /** Returns screenshot of the screen [param rect]. + * + * **Note:** This method is implemented on macOS and Windows. + * + * **Note:** On macOS, this method requires "Screen Recording" permission, if permission is not granted it will return desktop wallpaper color. + */ + static screen_get_image_rect(rect: Rect2i): Image + /** Sets the [param screen]'s [param orientation]. See also [method screen_get_orientation]. * * **Note:** On iOS, this method has no effect if [member ProjectSettings.display/window/handheld/orientation] is not set to [constant SCREEN_SENSOR]. @@ -4386,6 +4725,8 @@ declare module "godot" { static window_get_mode(window_id: int64 = 0): DisplayServer.WindowMode /** Sets window mode for the given window to [param mode]. See [enum WindowMode] for possible values and how each mode behaves. + * + * **Note:** On Android, setting it to [constant WINDOW_MODE_FULLSCREEN] or [constant WINDOW_MODE_EXCLUSIVE_FULLSCREEN] will enable immersive mode. * * **Note:** Setting the window to full screen forcibly sets the borderless flag to `true`, so make sure to set it back to `false` when not wanted. */ @@ -4418,7 +4759,7 @@ declare module "godot" { /** Returns `true` if anything can be drawn in the window specified by [param window_id], `false` otherwise. Using the `--disable-render-loop` command line argument or a headless build will return `false`. */ static window_can_draw(window_id: int64 = 0): boolean - /** Sets window transient parent. Transient window is will be destroyed with its transient parent and will return focus to their parent when closed. The transient window is displayed on top of a non-exclusive full-screen parent window. Transient windows can't enter full-screen mode. + /** Sets window transient parent. Transient window will be destroyed with its transient parent and will return focus to their parent when closed. The transient window is displayed on top of a non-exclusive full-screen parent window. Transient windows can't enter full-screen mode. * * **Note:** It's recommended to change this value using [member Window.transient] instead. * @@ -4466,6 +4807,18 @@ declare module "godot" { */ static window_minimize_on_title_dbl_click(): boolean + /** Starts an interactive drag operation on the window with the given [param window_id], using the current mouse position. Call this method when handling a mouse button being pressed to simulate a pressed event on the window's title bar. Using this method allows the window to participate in space switching, tiling, and other system features. + * + * **Note:** This method is implemented on Linux (X11/Wayland), macOS, and Windows. + */ + static window_start_drag(window_id: int64 = 0): void + + /** Starts an interactive resize operation on the window with the given [param window_id], using the current mouse position. Call this method when handling a mouse button being pressed to simulate a pressed event on the window's edge. + * + * **Note:** This method is implemented on Linux (X11/Wayland), macOS, and Windows. + */ + static window_start_resize(edge: DisplayServer.WindowResizeEdge, window_id: int64 = 0): void + /** Returns the text selection in the [url=https://en.wikipedia.org/wiki/Input_method]Input Method Editor[/url] composition string, with the [Vector2i]'s `x` component being the caret position and `y` being the length of the selection. * * **Note:** This method is implemented only on macOS. @@ -4496,6 +4849,12 @@ declare module "godot" { /** Returns the on-screen keyboard's height in pixels. Returns 0 if there is no keyboard or if it is currently hidden. */ static virtual_keyboard_get_height(): int64 + /** Returns `true` if hardware keyboard is connected. + * + * **Note:** This method is implemented on Android and iOS, on other platforms this method always returns `true`. + */ + static has_hardware_keyboard(): boolean + /** Sets the default mouse cursor shape. The cursor's appearance will vary depending on the user's operating system and mouse cursor theme. See also [method cursor_get_shape] and [method cursor_set_custom_image]. */ static cursor_set_shape(shape: DisplayServer.CursorShape): void @@ -4521,44 +4880,48 @@ declare module "godot" { /** Shows a text dialog which uses the operating system's native look-and-feel. [param callback] should accept a single [int] parameter which corresponds to the index of the pressed button. * - * **Note:** This method is implemented if the display server has the [constant FEATURE_NATIVE_DIALOG] feature. Supported platforms include macOS and Windows. + * **Note:** This method is implemented if the display server has the [constant FEATURE_NATIVE_DIALOG] feature. Supported platforms include macOS, Windows, and Android. */ static dialog_show(title: string, description: string, buttons: PackedStringArray | string[], callback: Callable): GError /** Shows a text input dialog which uses the operating system's native look-and-feel. [param callback] should accept a single [String] parameter which contains the text field's contents. * - * **Note:** This method is implemented if the display server has the [constant FEATURE_NATIVE_DIALOG_INPUT] feature. Supported platforms include macOS and Windows. + * **Note:** This method is implemented if the display server has the [constant FEATURE_NATIVE_DIALOG_INPUT] feature. Supported platforms include macOS, Windows, and Android. */ static dialog_input_text(title: string, description: string, existing_text: string, callback: Callable): GError /** Displays OS native dialog for selecting files or directories in the file system. - * Each filter string in the [param filters] array should be formatted like this: `*.txt,*.doc;Text Files`. The description text of the filter is optional and can be omitted. See also [member FileDialog.filters]. - * Callbacks have the following arguments: `status: bool, selected_paths: PackedStringArray, selected_filter_index: int`. + * Each filter string in the [param filters] array should be formatted like this: `*.png,*.jpg,*.jpeg;Image Files;image/png,image/jpeg`. The description text of the filter is optional and can be omitted. It is recommended to set both file extension and MIME type. See also [member FileDialog.filters]. + * Callbacks have the following arguments: `status: bool, selected_paths: PackedStringArray, selected_filter_index: int`. **On Android,** callback argument `selected_filter_index` is always zero. * - * **Note:** This method is implemented if the display server has the [constant FEATURE_NATIVE_DIALOG_FILE] feature. Supported platforms include Linux (X11/Wayland), Windows, and macOS. + * **Note:** This method is implemented if the display server has the [constant FEATURE_NATIVE_DIALOG_FILE] feature. Supported platforms include Linux (X11/Wayland), Windows, macOS, and Android. * * **Note:** [param current_directory] might be ignored. * - * **Note:** On Linux, [param show_hidden] is ignored. + * **Note:** Embedded file dialog and Windows file dialog support only file extensions, while Android, Linux, and macOS file dialogs also support MIME types. * - * **Note:** On macOS, native file dialogs have no title. + * **Note:** On Android and Linux, [param show_hidden] is ignored. + * + * **Note:** On Android and macOS, native file dialogs have no title. * * **Note:** On macOS, sandboxed apps will save security-scoped bookmarks to retain access to the opened folders across multiple sessions. Use [method OS.get_granted_permissions] to get a list of saved bookmarks. */ static file_dialog_show(title: string, current_directory: string, filename: string, show_hidden: boolean, mode: DisplayServer.FileDialogMode, filters: PackedStringArray | string[], callback: Callable): GError /** Displays OS native dialog for selecting files or directories in the file system with additional user selectable options. - * Each filter string in the [param filters] array should be formatted like this: `*.txt,*.doc;Text Files`. The description text of the filter is optional and can be omitted. See also [member FileDialog.filters]. + * Each filter string in the [param filters] array should be formatted like this: `*.png,*.jpg,*.jpeg;Image Files;image/png,image/jpeg`. The description text of the filter is optional and can be omitted. It is recommended to set both file extension and MIME type. See also [member FileDialog.filters]. * [param options] is array of [Dictionary]s with the following keys: * - `"name"` - option's name [String]. * - `"values"` - [PackedStringArray] of values. If empty, boolean option (check box) is used. * - `"default"` - default selected option index ([int]) or default boolean value ([bool]). * Callbacks have the following arguments: `status: bool, selected_paths: PackedStringArray, selected_filter_index: int, selected_option: Dictionary`. * - * **Note:** This method is implemented if the display server has the [constant FEATURE_NATIVE_DIALOG_FILE] feature. Supported platforms include Linux (X11/Wayland), Windows, and macOS. + * **Note:** This method is implemented if the display server has the [constant FEATURE_NATIVE_DIALOG_FILE_EXTRA] feature. Supported platforms include Linux (X11/Wayland), Windows, and macOS. * * **Note:** [param current_directory] might be ignored. * + * **Note:** Embedded file dialog and Windows file dialog support only file extensions, while Android, Linux, and macOS file dialogs also support MIME types. + * * **Note:** On Linux (X11), [param show_hidden] is ignored. * * **Note:** On macOS, native file dialogs have no title. @@ -4567,6 +4930,12 @@ declare module "godot" { */ static file_dialog_with_options_show(title: string, current_directory: string, root: string, filename: string, show_hidden: boolean, mode: DisplayServer.FileDialogMode, filters: PackedStringArray | string[], options: GArray, callback: Callable): GError + /** Plays the beep sound from the operative system, if possible. Because it comes from the OS, the beep sound will be audible even if the application is muted. It may also be disabled for the entire OS by the user. + * + * **Note:** This method is implemented on macOS, Linux (X11/Wayland), and Windows. + */ + static beep(): void + /** Returns the number of keyboard layouts. * * **Note:** This method is implemented on Linux (X11/Wayland), macOS and Windows. @@ -4609,6 +4978,12 @@ declare module "godot" { */ static keyboard_get_label_from_physical(keycode: Key): Key + /** Opens system emoji and symbol picker. + * + * **Note:** This method is implemented on macOS and Windows. + */ + static show_emoji_and_symbol_picker(): void + /** Perform window manager processing, including input flushing. See also [method force_process_and_drop_events], [method Input.flush_buffered_events] and [member Input.use_accumulated_input]. */ static process_events(): void @@ -4754,7 +5129,7 @@ declare module "godot" { } /** A server interface for OS native menus. * - * @link https://docs.godotengine.org/en/4.3/classes/class_nativemenu.html + * @link https://docs.godotengine.org/en/4.4/classes/class_nativemenu.html */ class NativeMenu extends Object { /** Returns `true` if the specified [param feature] is supported by the current [NativeMenu], `false` otherwise. @@ -4824,7 +5199,8 @@ declare module "godot" { static set_popup_open_callback(rid: RID, callback: Callable): void /** Returns global menu open callback. - * b]Note:** This method is implemented only on macOS. + * + * **Note:** This method is implemented only on macOS. */ static get_popup_open_callback(rid: RID): Callable @@ -4832,12 +5208,13 @@ declare module "godot" { * * **Note:** The OS can simulate menu opening to track menu item changes and global shortcuts, in which case the corresponding close callback is not triggered. Use [method is_opened] to check if the menu is currently opened. * - * **Note:** This method is implemented only on macOS. + * **Note:** This method is implemented on macOS and Windows. */ static set_popup_close_callback(rid: RID, callback: Callable): void /** Returns global menu close callback. - * b]Note:** This method is implemented only on macOS. + * + * **Note:** This method is implemented on macOS and Windows. */ static get_popup_close_callback(rid: RID): Callable @@ -5223,7 +5600,7 @@ declare module "godot" { // _singleton_class_: NavigationServer2D /** A server interface for low-level 2D navigation access. * - * @link https://docs.godotengine.org/en/4.3/classes/class_navigationserver2d.html + * @link https://docs.godotengine.org/en/4.4/classes/class_navigationserver2d.html */ class NavigationServer2D extends Object { /** Returns all created navigation map [RID]s on the NavigationServer. This returns both 2D and 3D created navigation maps as there is technically no distinction between them. */ @@ -5235,7 +5612,7 @@ declare module "godot" { /** Sets the map active. */ static map_set_active(map: RID, active: boolean): void - /** Returns true if the map is active. */ + /** Returns `true` if the map is active. */ static map_is_active(map: RID): boolean /** Sets the map cell size used to rasterize the navigation mesh vertices. Must match with the cell size of the used navigation meshes. */ @@ -5265,10 +5642,10 @@ declare module "godot" { /** Returns the navigation path to reach the destination from the origin. [param navigation_layers] is a bitmask of all region navigation layers that are allowed to be in the path. */ static map_get_path(map: RID, origin: Vector2, destination: Vector2, optimize: boolean, navigation_layers: int64 = 1): PackedVector2Array - /** Returns the point closest to the provided [param to_point] on the navigation mesh surface. */ + /** Returns the navigation mesh surface point closest to the provided [param to_point] on the navigation [param map]. */ static map_get_closest_point(map: RID, to_point: Vector2): Vector2 - /** Returns the owner region RID for the point returned by [method map_get_closest_point]. */ + /** Returns the owner region RID for the navigation mesh surface point closest to the provided [param to_point] on the navigation [param map]. */ static map_get_closest_point_owner(map: RID, to_point: Vector2): RID /** Returns all navigation link [RID]s that are currently assigned to the requested navigation [param map]. */ @@ -5297,14 +5674,20 @@ declare module "godot" { */ static map_get_iteration_id(map: RID): int64 + /** If [param enabled] is `true` the [param map] synchronization uses an async process that runs on a background thread. */ + static map_set_use_async_iterations(map: RID, enabled: boolean): void + + /** Returns `true` if the [param map] synchronization uses an async process that runs on a background thread. */ + static map_get_use_async_iterations(map: RID): boolean + /** Returns a random position picked from all map region polygons with matching [param navigation_layers]. * If [param uniformly] is `true`, all map regions, polygons, and faces are weighted by their surface area (slower). * If [param uniformly] is `false`, just a random region and a random polygon are picked (faster). */ static map_get_random_point(map: RID, navigation_layers: int64, uniformly: boolean): Vector2 - /** Queries a path in a given navigation map. Start and target position and other parameters are defined through [NavigationPathQueryParameters2D]. Updates the provided [NavigationPathQueryResult2D] result object with the path among other results requested by the query. */ - static query_path(parameters: NavigationPathQueryParameters2D, result: NavigationPathQueryResult2D): void + /** Queries a path in a given navigation map. Start and target position and other parameters are defined through [NavigationPathQueryParameters2D]. Updates the provided [NavigationPathQueryResult2D] result object with the path among other results requested by the query. After the process is finished the optional [param callback] will be called. */ + static query_path(parameters: NavigationPathQueryParameters2D, result: NavigationPathQueryResult2D, callback: Callable = new Callable()): void /** Creates a new region. */ static region_create(): RID @@ -5376,12 +5759,18 @@ declare module "godot" { /** Returns the ending point of a connection door. [param connection] is an index between 0 and the return value of [method region_get_connections_count]. */ static region_get_connection_pathway_end(region: RID, connection: int64): Vector2 + /** Returns the navigation mesh surface point closest to the provided [param to_point] on the navigation [param region]. */ + static region_get_closest_point(region: RID, to_point: Vector2): Vector2 + /** Returns a random position picked from all region polygons with matching [param navigation_layers]. * If [param uniformly] is `true`, all region polygons and faces are weighted by their surface area (slower). * If [param uniformly] is `false`, just a random polygon and face is picked (faster). */ static region_get_random_point(region: RID, navigation_layers: int64, uniformly: boolean): Vector2 + /** Returns the axis-aligned rectangle for the [param region]'s transformed navigation mesh. */ + static region_get_bounds(region: RID): Rect2 + /** Create a new link between two positions on a map. */ static link_create(): RID @@ -5454,7 +5843,7 @@ declare module "godot" { /** Returns the navigation map [RID] the requested [param agent] is currently assigned to. */ static agent_get_map(agent: RID): RID - /** If [param paused] is true the specified [param agent] will not be processed, e.g. calculate avoidance velocities or receive avoidance callbacks. */ + /** If [param paused] is `true` the specified [param agent] will not be processed, e.g. calculate avoidance velocities or receive avoidance callbacks. */ static agent_set_paused(agent: RID, paused: boolean): void /** Returns `true` if the specified [param agent] is paused. */ @@ -5511,7 +5900,7 @@ declare module "godot" { /** Returns the position of the specified [param agent] in world space. */ static agent_get_position(agent: RID): Vector2 - /** Returns true if the map got changed the previous frame. */ + /** Returns `true` if the map got changed the previous frame. */ static agent_is_map_changed(agent: RID): boolean /** Sets the callback [Callable] that gets called after each avoidance processing step for the [param agent]. The calculated `safe_velocity` will be dispatched with a signal to the object just before the physics calculations. @@ -5558,7 +5947,7 @@ declare module "godot" { /** Returns the navigation map [RID] the requested [param obstacle] is currently assigned to. */ static obstacle_get_map(obstacle: RID): RID - /** If [param paused] is true the specified [param obstacle] will not be processed, e.g. affect avoidance velocities. */ + /** If [param paused] is `true` the specified [param obstacle] will not be processed, e.g. affect avoidance velocities. */ static obstacle_set_paused(obstacle: RID, paused: boolean): void /** Returns `true` if the specified [param obstacle] is paused. */ @@ -5669,11 +6058,14 @@ declare module "godot" { /** Constant to get the number of navigation mesh polygon edges that could not be merged but may be still connected by edge proximity or with links. */ INFO_EDGE_FREE_COUNT = 8, + + /** Constant to get the number of active navigation obstacles. */ + INFO_OBSTACLE_COUNT = 9, } } /** A server interface for low-level 3D navigation access. * - * @link https://docs.godotengine.org/en/4.3/classes/class_navigationserver3d.html + * @link https://docs.godotengine.org/en/4.4/classes/class_navigationserver3d.html */ class NavigationServer3D extends Object { /** Returns all created navigation map [RID]s on the NavigationServer. This returns both 2D and 3D created navigation maps as there is technically no distinction between them. */ @@ -5685,7 +6077,7 @@ declare module "godot" { /** Sets the map active. */ static map_set_active(map: RID, active: boolean): void - /** Returns true if the map is active. */ + /** Returns `true` if the map is active. */ static map_is_active(map: RID): boolean /** Sets the map up direction. */ @@ -5715,7 +6107,7 @@ declare module "godot" { /** Set the navigation [param map] edge connection use. If [param enabled] is `true`, the navigation map allows navigation regions to use edge connections to connect with other navigation regions within proximity of the navigation map edge connection margin. */ static map_set_use_edge_connections(map: RID, enabled: boolean): void - /** Returns true if the navigation [param map] allows navigation regions to use edge connections to connect with other navigation regions within proximity of the navigation map edge connection margin. */ + /** Returns `true` if the navigation [param map] allows navigation regions to use edge connections to connect with other navigation regions within proximity of the navigation map edge connection margin. */ static map_get_use_edge_connections(map: RID): boolean /** Set the map edge connection margin used to weld the compatible region edges. */ @@ -5733,16 +6125,18 @@ declare module "godot" { /** Returns the navigation path to reach the destination from the origin. [param navigation_layers] is a bitmask of all region navigation layers that are allowed to be in the path. */ static map_get_path(map: RID, origin: Vector3, destination: Vector3, optimize: boolean, navigation_layers: int64 = 1): PackedVector3Array - /** Returns the closest point between the navigation surface and the segment. */ + /** Returns the navigation mesh surface point closest to the provided [param start] and [param end] segment on the navigation [param map]. + * If [param use_collision] is `true`, a closest point test is only done when the segment intersects with the navigation mesh surface. + */ static map_get_closest_point_to_segment(map: RID, start: Vector3, end: Vector3, use_collision: boolean = false): Vector3 - /** Returns the point closest to the provided [param to_point] on the navigation mesh surface. */ + /** Returns the navigation mesh surface point closest to the provided [param to_point] on the navigation [param map]. */ static map_get_closest_point(map: RID, to_point: Vector3): Vector3 - /** Returns the normal for the point returned by [method map_get_closest_point]. */ + /** Returns the navigation mesh surface normal closest to the provided [param to_point] on the navigation [param map]. */ static map_get_closest_point_normal(map: RID, to_point: Vector3): Vector3 - /** Returns the owner region RID for the point returned by [method map_get_closest_point]. */ + /** Returns the owner region RID for the navigation mesh surface point closest to the provided [param to_point] on the navigation [param map]. */ static map_get_closest_point_owner(map: RID, to_point: Vector3): RID /** Returns all navigation link [RID]s that are currently assigned to the requested navigation [param map]. */ @@ -5771,14 +6165,20 @@ declare module "godot" { */ static map_get_iteration_id(map: RID): int64 + /** If [param enabled] is `true` the [param map] synchronization uses an async process that runs on a background thread. */ + static map_set_use_async_iterations(map: RID, enabled: boolean): void + + /** Returns `true` if the [param map] synchronization uses an async process that runs on a background thread. */ + static map_get_use_async_iterations(map: RID): boolean + /** Returns a random position picked from all map region polygons with matching [param navigation_layers]. * If [param uniformly] is `true`, all map regions, polygons, and faces are weighted by their surface area (slower). * If [param uniformly] is `false`, just a random region and a random polygon are picked (faster). */ static map_get_random_point(map: RID, navigation_layers: int64, uniformly: boolean): Vector3 - /** Queries a path in a given navigation map. Start and target position and other parameters are defined through [NavigationPathQueryParameters3D]. Updates the provided [NavigationPathQueryResult3D] result object with the path among other results requested by the query. */ - static query_path(parameters: NavigationPathQueryParameters3D, result: NavigationPathQueryResult3D): void + /** Queries a path in a given navigation map. Start and target position and other parameters are defined through [NavigationPathQueryParameters3D]. Updates the provided [NavigationPathQueryResult3D] result object with the path among other results requested by the query. After the process is finished the optional [param callback] will be called. */ + static query_path(parameters: NavigationPathQueryParameters3D, result: NavigationPathQueryResult3D, callback: Callable = new Callable()): void /** Creates a new region. */ static region_create(): RID @@ -5792,7 +6192,7 @@ declare module "godot" { /** If [param enabled] is `true`, the navigation [param region] will use edge connections to connect with other navigation regions within proximity of the navigation map edge connection margin. */ static region_set_use_edge_connections(region: RID, enabled: boolean): void - /** Returns true if the navigation [param region] is set to use edge connections to connect with other navigation regions within proximity of the navigation map edge connection margin. */ + /** Returns `true` if the navigation [param region] is set to use edge connections to connect with other navigation regions within proximity of the navigation map edge connection margin. */ static region_get_use_edge_connections(region: RID): boolean /** Sets the [param enter_cost] for this [param region]. */ @@ -5853,12 +6253,26 @@ declare module "godot" { /** Returns the ending point of a connection door. [param connection] is an index between 0 and the return value of [method region_get_connections_count]. */ static region_get_connection_pathway_end(region: RID, connection: int64): Vector3 + /** Returns the navigation mesh surface point closest to the provided [param start] and [param end] segment on the navigation [param region]. + * If [param use_collision] is `true`, a closest point test is only done when the segment intersects with the navigation mesh surface. + */ + static region_get_closest_point_to_segment(region: RID, start: Vector3, end: Vector3, use_collision: boolean = false): Vector3 + + /** Returns the navigation mesh surface point closest to the provided [param to_point] on the navigation [param region]. */ + static region_get_closest_point(region: RID, to_point: Vector3): Vector3 + + /** Returns the navigation mesh surface normal closest to the provided [param to_point] on the navigation [param region]. */ + static region_get_closest_point_normal(region: RID, to_point: Vector3): Vector3 + /** Returns a random position picked from all region polygons with matching [param navigation_layers]. * If [param uniformly] is `true`, all region polygons and faces are weighted by their surface area (slower). * If [param uniformly] is `false`, just a random polygon and face is picked (faster). */ static region_get_random_point(region: RID, navigation_layers: int64, uniformly: boolean): Vector3 + /** Returns the axis-aligned bounding box for the [param region]'s transformed navigation mesh. */ + static region_get_bounds(region: RID): AABB + /** Create a new link between two positions on a map. */ static link_create(): RID @@ -5940,7 +6354,7 @@ declare module "godot" { /** Returns the navigation map [RID] the requested [param agent] is currently assigned to. */ static agent_get_map(agent: RID): RID - /** If [param paused] is true the specified [param agent] will not be processed, e.g. calculate avoidance velocities or receive avoidance callbacks. */ + /** If [param paused] is `true` the specified [param agent] will not be processed, e.g. calculate avoidance velocities or receive avoidance callbacks. */ static agent_set_paused(agent: RID, paused: boolean): void /** Returns `true` if the specified [param agent] is paused. */ @@ -6003,7 +6417,7 @@ declare module "godot" { /** Returns the position of the specified [param agent] in world space. */ static agent_get_position(agent: RID): Vector3 - /** Returns true if the map got changed the previous frame. */ + /** Returns `true` if the map got changed the previous frame. */ static agent_is_map_changed(agent: RID): boolean /** Sets the callback [Callable] that gets called after each avoidance processing step for the [param agent]. The calculated `safe_velocity` will be dispatched with a signal to the object just before the physics calculations. @@ -6056,7 +6470,7 @@ declare module "godot" { /** Returns the navigation map [RID] the requested [param obstacle] is currently assigned to. */ static obstacle_get_map(obstacle: RID): RID - /** If [param paused] is true the specified [param obstacle] will not be processed, e.g. affect avoidance velocities. */ + /** If [param paused] is `true` the specified [param obstacle] will not be processed, e.g. affect avoidance velocities. */ static obstacle_set_paused(obstacle: RID, paused: boolean): void /** Returns `true` if the specified [param obstacle] is paused. */ @@ -6155,6 +6569,16 @@ declare module "godot" { } // _singleton_class_: RenderingServer namespace RenderingServer { + enum TextureType { + /** 2D texture. */ + TEXTURE_TYPE_2D = 0, + + /** Layered texture. */ + TEXTURE_TYPE_LAYERED = 1, + + /** 3D texture. */ + TEXTURE_TYPE_3D = 2, + } enum TextureLayeredType { /** Array of 2-dimensional textures (see [Texture2DArray]). */ TEXTURE_LAYERED_2D_ARRAY = 0, @@ -6313,18 +6737,38 @@ declare module "godot" { /** Flag used to mark an index array. */ ARRAY_FORMAT_INDEX = 4096, + + /** Mask of mesh channels permitted in blend shapes. */ ARRAY_FORMAT_BLEND_SHAPE_MASK = 7, + + /** Shift of first custom channel. */ ARRAY_FORMAT_CUSTOM_BASE = 13, + + /** Number of format bits per custom channel. See [enum ArrayCustomFormat]. */ ARRAY_FORMAT_CUSTOM_BITS = 3, + + /** Amount to shift [enum ArrayCustomFormat] for custom channel index 0. */ ARRAY_FORMAT_CUSTOM0_SHIFT = 13, + + /** Amount to shift [enum ArrayCustomFormat] for custom channel index 1. */ ARRAY_FORMAT_CUSTOM1_SHIFT = 16, + + /** Amount to shift [enum ArrayCustomFormat] for custom channel index 2. */ ARRAY_FORMAT_CUSTOM2_SHIFT = 19, + + /** Amount to shift [enum ArrayCustomFormat] for custom channel index 3. */ ARRAY_FORMAT_CUSTOM3_SHIFT = 22, + + /** Mask of custom format bits per custom channel. Must be shifted by one of the SHIFT constants. See [enum ArrayCustomFormat]. */ ARRAY_FORMAT_CUSTOM_MASK = 7, + + /** Shift of first compress flag. Compress flags should be passed to [method ArrayMesh.add_surface_from_arrays] and [method SurfaceTool.commit]. */ ARRAY_COMPRESS_FLAGS_BASE = 25, /** Flag used to mark that the array contains 2D vertices. */ ARRAY_FLAG_USE_2D_VERTICES = 33554432, + + /** Flag indices that the mesh data will use `GL_DYNAMIC_DRAW` on GLES. Unused on Vulkan. */ ARRAY_FLAG_USE_DYNAMIC_UPDATE = 67108864, /** Flag used to mark that the array uses 8 bone weights instead of 4. */ @@ -6387,6 +6831,13 @@ declare module "godot" { /** Use [Transform3D] to store MultiMesh transform. */ MULTIMESH_TRANSFORM_3D = 1, } + enum MultimeshPhysicsInterpolationQuality { + /** MultiMesh physics interpolation favors speed over quality. */ + MULTIMESH_INTERP_QUALITY_FAST = 0, + + /** MultiMesh physics interpolation favors quality over speed. */ + MULTIMESH_INTERP_QUALITY_HIGH = 1, + } enum LightProjectorFilter { /** Nearest-neighbor filter for light projectors (use for pixel art light projectors). No mipmaps are used for rendering, which means light projectors at a distance will look sharp but grainy. This has roughly the same performance cost as using mipmaps. */ LIGHT_PROJECTOR_FILTER_NEAREST = 0, @@ -6677,8 +7128,20 @@ declare module "godot" { /** Use AMD FidelityFX Super Resolution 2.2 upscaling for the viewport's 3D buffer. The amount of scaling can be set using [member Viewport.scaling_3d_scale]. Values less than `1.0` will be result in the viewport being upscaled using FSR2. Values greater than `1.0` are not supported and bilinear downsampling will be used instead. A value of `1.0` will use FSR2 at native resolution as a TAA solution. */ VIEWPORT_SCALING_3D_MODE_FSR2 = 2, + /** Use MetalFX spatial upscaling for the viewport's 3D buffer. The amount of scaling can be set using [member Viewport.scaling_3d_scale]. Values less than `1.0` will be result in the viewport being upscaled using MetalFX. Values greater than `1.0` are not supported and bilinear downsampling will be used instead. A value of `1.0` disables scaling. + * + * **Note:** Only supported when the Metal rendering driver is in use, which limits this scaling mode to macOS and iOS. + */ + VIEWPORT_SCALING_3D_MODE_METALFX_SPATIAL = 3, + + /** Use MetalFX temporal upscaling for the viewport's 3D buffer. The amount of scaling can be set using [member Viewport.scaling_3d_scale]. Values less than `1.0` will be result in the viewport being upscaled using MetalFX. Values greater than `1.0` are not supported and bilinear downsampling will be used instead. A value of `1.0` will use MetalFX at native resolution as a TAA solution. + * + * **Note:** Only supported when the Metal rendering driver is in use, which limits this scaling mode to macOS and iOS. + */ + VIEWPORT_SCALING_3D_MODE_METALFX_TEMPORAL = 4, + /** Represents the size of the [enum ViewportScaling3DMode] enum. */ - VIEWPORT_SCALING_3D_MODE_MAX = 3, + VIEWPORT_SCALING_3D_MODE_MAX = 5, } enum ViewportUpdateMode { /** Do not update the viewport's render target. */ @@ -6764,6 +7227,25 @@ declare module "godot" { /** Represents the size of the [enum ViewportMSAA] enum. */ VIEWPORT_MSAA_MAX = 4, } + enum ViewportAnisotropicFiltering { + /** Anisotropic filtering is disabled. */ + VIEWPORT_ANISOTROPY_DISABLED = 0, + + /** Use 2× anisotropic filtering. */ + VIEWPORT_ANISOTROPY_2X = 1, + + /** Use 4× anisotropic filtering. This is the default value. */ + VIEWPORT_ANISOTROPY_4X = 2, + + /** Use 8× anisotropic filtering. */ + VIEWPORT_ANISOTROPY_8X = 3, + + /** Use 16× anisotropic filtering. */ + VIEWPORT_ANISOTROPY_16X = 4, + + /** Represents the size of the [enum ViewportAnisotropicFiltering] enum. */ + VIEWPORT_ANISOTROPY_MAX = 5, + } enum ViewportScreenSpaceAA { /** Do not perform any antialiasing in the full screen post-process. */ VIEWPORT_SCREEN_SPACE_AA_DISABLED = 0, @@ -6826,7 +7308,10 @@ declare module "godot" { */ VIEWPORT_DEBUG_DRAW_OVERDRAW = 3, - /** Debug draw draws objects in wireframe. */ + /** Debug draw draws objects in wireframe. + * + * **Note:** [method set_debug_generate_wireframes] must be called before loading any meshes for wireframes to be visible when using the Compatibility renderer. + */ VIEWPORT_DEBUG_DRAW_WIREFRAME = 4, /** Normal buffer is drawn instead of regular scene so you can see the per-pixel normals that will be used by post-processing effects. */ @@ -6969,7 +7454,7 @@ declare module "godot" { /** The callback is called before our transparent rendering pass, but after our sky is rendered and we've created our back buffers. */ COMPOSITOR_EFFECT_CALLBACK_TYPE_PRE_TRANSPARENT = 3, - /** The callback is called after our transparent rendering pass, but before any build in post effects and output to our render target. */ + /** The callback is called after our transparent rendering pass, but before any built-in post-processing effects and output to our render target. */ COMPOSITOR_EFFECT_CALLBACK_TYPE_POST_TRANSPARENT = 4, COMPOSITOR_EFFECT_CALLBACK_TYPE_ANY = -1, } @@ -7042,20 +7527,29 @@ declare module "godot" { ENV_FOG_MODE_DEPTH = 1, } enum EnvironmentToneMapper { - /** Output color as they came in. This can cause bright lighting to look blown out, with noticeable clipping in the output colors. */ + /** Does not modify color data, resulting in a linear tonemapping curve which unnaturally clips bright values, causing bright lighting to look blown out. The simplest and fastest tonemapper. */ ENV_TONE_MAPPER_LINEAR = 0, - /** Use the Reinhard tonemapper. Performs a variation on rendered pixels' colors by this formula: `color = color / (1 + color)`. This avoids clipping bright highlights, but the resulting image can look a bit dull. */ + /** A simple tonemapping curve that rolls off bright values to prevent clipping. This results in an image that can appear dull and low contrast. Slower than [constant ENV_TONE_MAPPER_LINEAR]. + * + * **Note:** When [member Environment.tonemap_white] is left at the default value of `1.0`, [constant ENV_TONE_MAPPER_REINHARD] produces an identical image to [constant ENV_TONE_MAPPER_LINEAR]. + */ ENV_TONE_MAPPER_REINHARD = 1, - /** Use the filmic tonemapper. This avoids clipping bright highlights, with a resulting image that usually looks more vivid than [constant ENV_TONE_MAPPER_REINHARD]. */ + /** Uses a film-like tonemapping curve to prevent clipping of bright values and provide better contrast than [constant ENV_TONE_MAPPER_REINHARD]. Slightly slower than [constant ENV_TONE_MAPPER_REINHARD]. */ ENV_TONE_MAPPER_FILMIC = 2, - /** Use the Academy Color Encoding System tonemapper. ACES is slightly more expensive than other options, but it handles bright lighting in a more realistic fashion by desaturating it as it becomes brighter. ACES typically has a more contrasted output compared to [constant ENV_TONE_MAPPER_REINHARD] and [constant ENV_TONE_MAPPER_FILMIC]. + /** Uses a high-contrast film-like tonemapping curve and desaturates bright values for a more realistic appearance. Slightly slower than [constant ENV_TONE_MAPPER_FILMIC]. * * **Note:** This tonemapping operator is called "ACES Fitted" in Godot 3.x. */ ENV_TONE_MAPPER_ACES = 3, + + /** Uses a film-like tonemapping curve and desaturates bright values for a more realistic appearance. Better than other tonemappers at maintaining the hue of colors as they become brighter. The slowest tonemapping option. + * + * **Note:** [member Environment.tonemap_white] is fixed at a value of `16.29`, which makes [constant ENV_TONE_MAPPER_AGX] unsuitable for use with the Mobile rendering method. + */ + ENV_TONE_MAPPER_AGX = 4, } enum EnvironmentSSRRoughnessQuality { /** Lowest quality of roughness filter for screen-space reflections. Rough materials will not have blurrier screen-space reflections compared to smooth (non-rough) materials. This is the fastest option. */ @@ -7519,8 +8013,11 @@ declare module "godot" { /** Cubemap sampler global shader parameter (`global uniform samplerCube ...`). Exposed as a [Cubemap] in the editor UI. */ GLOBAL_VAR_TYPE_SAMPLERCUBE = 27, + /** External sampler global shader parameter (`global uniform samplerExternalOES ...`). Exposed as a [ExternalTexture] in the editor UI. */ + GLOBAL_VAR_TYPE_SAMPLEREXT = 28, + /** Represents the size of the [enum GlobalShaderParameterType] enum. */ - GLOBAL_VAR_TYPE_MAX = 28, + GLOBAL_VAR_TYPE_MAX = 29, } enum RenderingInfo { /** Number of objects rendered in the current 3D scene. This varies depending on camera position and rotation. */ @@ -7538,8 +8035,42 @@ declare module "godot" { /** Buffer memory used (in bytes). This includes vertex data, uniform buffers, and many miscellaneous buffer types used internally. */ RENDERING_INFO_BUFFER_MEM_USED = 4, - /** Video memory used (in bytes). When using the Forward+ or mobile rendering backends, this is always greater than the sum of [constant RENDERING_INFO_TEXTURE_MEM_USED] and [constant RENDERING_INFO_BUFFER_MEM_USED], since there is miscellaneous data not accounted for by those two metrics. When using the GL Compatibility backend, this is equal to the sum of [constant RENDERING_INFO_TEXTURE_MEM_USED] and [constant RENDERING_INFO_BUFFER_MEM_USED]. */ + /** Video memory used (in bytes). When using the Forward+ or Mobile renderers, this is always greater than the sum of [constant RENDERING_INFO_TEXTURE_MEM_USED] and [constant RENDERING_INFO_BUFFER_MEM_USED], since there is miscellaneous data not accounted for by those two metrics. When using the Compatibility renderer, this is equal to the sum of [constant RENDERING_INFO_TEXTURE_MEM_USED] and [constant RENDERING_INFO_BUFFER_MEM_USED]. */ RENDERING_INFO_VIDEO_MEM_USED = 5, + + /** Number of pipeline compilations that were triggered by the 2D canvas renderer. */ + RENDERING_INFO_PIPELINE_COMPILATIONS_CANVAS = 6, + + /** Number of pipeline compilations that were triggered by loading meshes. These compilations will show up as longer loading times the first time a user runs the game and the pipeline is required. */ + RENDERING_INFO_PIPELINE_COMPILATIONS_MESH = 7, + + /** Number of pipeline compilations that were triggered by building the surface cache before rendering the scene. These compilations will show up as a stutter when loading an scene the first time a user runs the game and the pipeline is required. */ + RENDERING_INFO_PIPELINE_COMPILATIONS_SURFACE = 8, + + /** Number of pipeline compilations that were triggered while drawing the scene. These compilations will show up as stutters during gameplay the first time a user runs the game and the pipeline is required. */ + RENDERING_INFO_PIPELINE_COMPILATIONS_DRAW = 9, + + /** Number of pipeline compilations that were triggered to optimize the current scene. These compilations are done in the background and should not cause any stutters whatsoever. */ + RENDERING_INFO_PIPELINE_COMPILATIONS_SPECIALIZATION = 10, + } + enum PipelineSource { + /** Pipeline compilation that was triggered by the 2D canvas renderer. */ + PIPELINE_SOURCE_CANVAS = 0, + + /** Pipeline compilation that was triggered by loading a mesh. */ + PIPELINE_SOURCE_MESH = 1, + + /** Pipeline compilation that was triggered by building the surface cache before rendering the scene. */ + PIPELINE_SOURCE_SURFACE = 2, + + /** Pipeline compilation that was triggered while drawing the scene. */ + PIPELINE_SOURCE_DRAW = 3, + + /** Pipeline compilation that was triggered to optimize the current scene. */ + PIPELINE_SOURCE_SPECIALIZATION = 4, + + /** Represents the size of the [enum PipelineSource] enum. */ + PIPELINE_SOURCE_MAX = 5, } enum Features { FEATURE_SHADERS = 0, @@ -7548,7 +8079,7 @@ declare module "godot" { } /** Server for anything visible. * - * @link https://docs.godotengine.org/en/4.3/classes/class_renderingserver.html + * @link https://docs.godotengine.org/en/4.4/classes/class_renderingserver.html */ class RenderingServer extends Object { /** Marks an error that shows that the index array is empty. */ @@ -7611,6 +8142,12 @@ declare module "godot" { /** This method does nothing and always returns an invalid [RID]. */ static texture_proxy_create(base: RID): RID + /** Creates a texture based on a native handle that was created outside of Godot's renderer. + * + * **Note:** If using only the rendering device renderer, it's recommend to use [method RenderingDevice.texture_create_from_extension] together with [method RenderingServer.texture_rd_create], rather than this method. It will give you much more control over the texture's format and usage. + */ + static texture_create_from_native_handle(type: RenderingServer.TextureType, format: Image.Format, native_handle: int64, width: int64, height: int64, depth: int64, layers: int64 = 1, layered_type: RenderingServer.TextureLayeredType = 0): RID + /** Updates the texture specified by the [param texture] [RID] with the data in [param image]. A [param layer] must also be specified, which should be `0` when updating a single-layer texture ([Texture2D]). * * **Note:** The [param image] must have the same width, height and format as the current [param texture] data. Otherwise, an error will be printed and the original texture won't be modified. If you need to use different width, height or format, use [method texture_replace] instead. @@ -7626,7 +8163,7 @@ declare module "godot" { /** This method does nothing. */ static texture_proxy_update(texture: RID, proxy_to: RID): void - /** Creates a placeholder for a 2-dimensional layered texture and adds it to the RenderingServer. It can be accessed with the RID that is returned. This RID will be used in all `texture_2d_layered_*` RenderingServer functions, although it does nothing when used. See also [method texture_2d_layered_placeholder_create] + /** Creates a placeholder for a 2-dimensional layered texture and adds it to the RenderingServer. It can be accessed with the RID that is returned. This RID will be used in all `texture_2d_layered_*` RenderingServer functions, although it does nothing when used. See also [method texture_2d_layered_placeholder_create]. * Once finished with your RID, you will want to free the RID using the RenderingServer's [method free_rid] method. * * **Note:** The equivalent resource is [PlaceholderTexture2D]. @@ -7647,7 +8184,7 @@ declare module "godot" { static texture_3d_placeholder_create(): RID /** Returns an [Image] instance from the given [param texture] [RID]. - * Example of getting the test texture from [method get_test_texture] and applying it to a [Sprite2D] node: + * **Example:** Get the test texture from [method get_test_texture] and apply it to a [Sprite2D] node: * */ static texture_2d_get(texture: RID): Image @@ -7793,6 +8330,9 @@ declare module "godot" { /** Returns a mesh's custom aabb. */ static mesh_get_custom_aabb(mesh: RID): AABB + /** Removes the surface at the given index from the Mesh, shifting surfaces with higher index down by one. */ + static mesh_surface_remove(mesh: RID, surface: int64): void + /** Removes all surfaces from a mesh. */ static mesh_clear(mesh: RID): void static mesh_surface_update_vertex_region(mesh: RID, surface: int64, offset: int64, data: PackedByteArray | byte[] | ArrayBuffer): void @@ -7807,7 +8347,7 @@ declare module "godot" { * **Note:** The equivalent resource is [MultiMesh]. */ static multimesh_create(): RID - static multimesh_allocate_data(multimesh: RID, instances: int64, transform_format: RenderingServer.MultimeshTransformFormat, color_format: boolean = false, custom_data_format: boolean = false): void + static multimesh_allocate_data(multimesh: RID, instances: int64, transform_format: RenderingServer.MultimeshTransformFormat, color_format: boolean = false, custom_data_format: boolean = false, use_indirect: boolean = false): void /** Returns the number of instances allocated for this multimesh. */ static multimesh_get_instance_count(multimesh: RID): int64 @@ -7871,15 +8411,59 @@ declare module "godot" { * - Position + Custom data: 16 floats (12 floats for Transform3D, 4 floats of custom data) * - Position + Vertex color + Custom data: 20 floats (12 floats for Transform3D, 4 floats for Color, 4 floats of custom data) * [/codeblock] + * Instance transforms are in row-major order. Specifically: + * - For [Transform2D] the float-order is: `(x.x, y.x, padding_float, origin.x, x.y, y.y, padding_float, origin.y)`. + * - For [Transform3D] the float-order is: `(basis.x.x, basis.y.x, basis.z.x, origin.x, basis.x.y, basis.y.y, basis.z.y, origin.y, basis.x.z, basis.y.z, basis.z.z, origin.z)`. */ static multimesh_set_buffer(multimesh: RID, buffer: PackedFloat32Array | float32[]): void + /** Returns the [RenderingDevice] [RID] handle of the [MultiMesh] command buffer. This [RID] is only valid if `use_indirect` is set to `true` when allocating data through [method multimesh_allocate_data]. It can be used to directly modify the instance count via buffer. + * The data structure is dependent on both how many surfaces the mesh contains and whether it is indexed or not, the buffer has 5 integers in it, with the last unused if the mesh is not indexed. + * Each of the values in the buffer correspond to these options: + * [codeblock lang=text] + * Indexed: + * 0 - indexCount; + * 1 - instanceCount; + * 2 - firstIndex; + * 3 - vertexOffset; + * 4 - firstInstance; + * Non Indexed: + * 0 - vertexCount; + * 1 - instanceCount; + * 2 - firstVertex; + * 3 - firstInstance; + * 4 - unused; + * [/codeblock] + */ + static multimesh_get_command_buffer_rd_rid(multimesh: RID): RID + + /** Returns the [RenderingDevice] [RID] handle of the [MultiMesh], which can be used as any other buffer on the Rendering Device. */ + static multimesh_get_buffer_rd_rid(multimesh: RID): RID + /** Returns the MultiMesh data (such as instance transforms, colors, etc.). See [method multimesh_set_buffer] for details on the returned data. * * **Note:** If the buffer is in the engine's internal cache, it will have to be fetched from GPU memory and possibly decompressed. This means [method multimesh_get_buffer] is potentially a slow operation and should be avoided whenever possible. */ static multimesh_get_buffer(multimesh: RID): PackedFloat32Array + /** Alternative version of [method multimesh_set_buffer] for use with physics interpolation. + * Takes both an array of current data and an array of data for the previous physics tick. + */ + static multimesh_set_buffer_interpolated(multimesh: RID, buffer: PackedFloat32Array | float32[], buffer_previous: PackedFloat32Array | float32[]): void + + /** Turns on and off physics interpolation for this MultiMesh resource. */ + static multimesh_set_physics_interpolated(multimesh: RID, interpolated: boolean): void + + /** Sets the physics interpolation quality for the [MultiMesh]. + * A value of [constant MULTIMESH_INTERP_QUALITY_FAST] gives fast but low quality interpolation, a value of [constant MULTIMESH_INTERP_QUALITY_HIGH] gives slower but higher quality interpolation. + */ + static multimesh_set_physics_interpolation_quality(multimesh: RID, quality: RenderingServer.MultimeshPhysicsInterpolationQuality): void + + /** Prevents physics interpolation for the specified instance during the current physics tick. + * This is useful when moving an instance to a new location, to give an instantaneous change rather than interpolation from the previous location. + */ + static multimesh_instance_reset_physics_interpolation(multimesh: RID, index: int64): void + /** Creates a skeleton and adds it to the RenderingServer. It can be accessed with the RID that is returned. This RID will be used in all `skeleton_*` RenderingServer functions. * Once finished with your RID, you will want to free the RID using the RenderingServer's [method free_rid] method. */ @@ -7948,6 +8532,9 @@ declare module "godot" { /** If `true`, reverses the backface culling of the mesh. This can be useful when you have a flat mesh that has a light behind it. If you need to cast a shadow on both sides of the mesh, set the mesh to use double-sided shadows with [method instance_geometry_set_cast_shadows_setting]. Equivalent to [member Light3D.shadow_reverse_cull_face]. */ static light_set_reverse_cull_face_mode(light: RID, enabled: boolean): void + /** Sets the shadow caster mask for this 3D light. Shadows will only be cast using objects in the selected layers. Equivalent to [member Light3D.shadow_caster_mask]. */ + static light_set_shadow_caster_mask(light: RID, mask: int64): void + /** Sets the bake mode to use for the specified 3D light. Equivalent to [member Light3D.light_bake_mode]. */ static light_set_bake_mode(light: RID, bake_mode: RenderingServer.LightBakeMode): void @@ -7969,6 +8556,9 @@ declare module "godot" { /** Sets the texture filter mode to use when rendering light projectors. This parameter is global and cannot be set on a per-light basis. */ static light_projectors_set_filter(filter: RenderingServer.LightProjectorFilter): void + /** Toggles whether a bicubic filter should be used when lightmaps are sampled. This smoothens their appearance at a performance cost. */ + static lightmaps_set_bicubic_filter(enable: boolean): void + /** Sets the filter quality for omni and spot light shadows in 3D. See also [member ProjectSettings.rendering/lights_and_shadows/positional_shadow/soft_shadow_filter_quality]. This parameter is global and cannot be set on a per-viewport basis. */ static positional_soft_shadow_filter_set_quality(quality: RenderingServer.ShadowQuality): void @@ -7992,6 +8582,9 @@ declare module "godot" { /** Sets the intensity of the reflection probe. Intensity modulates the strength of the reflection. Equivalent to [member ReflectionProbe.intensity]. */ static reflection_probe_set_intensity(probe: RID, intensity: float64): void + /** Sets the distance in meters over which a probe blends into the scene. */ + static reflection_probe_set_blend_distance(probe: RID, blend_distance: float64): void + /** Sets the reflection probe's ambient light mode. Equivalent to [member ReflectionProbe.ambient_mode]. */ static reflection_probe_set_ambient_mode(probe: RID, mode: RenderingServer.ReflectionProbeAmbientMode): void @@ -8147,7 +8740,7 @@ declare module "godot" { /** Sets whether the GPU particles specified by the [param particles] RID should be rendered in 2D or 3D according to [param mode]. */ static particles_set_mode(particles: RID, mode: RenderingServer.ParticlesMode): void - /** If `true`, particles will emit over time. Setting to false does not reset the particles, but only stops their emission. Equivalent to [member GPUParticles3D.emitting]. */ + /** If `true`, particles will emit over time. Setting to `false` does not reset the particles, but only stops their emission. Equivalent to [member GPUParticles3D.emitting]. */ static particles_set_emitting(particles: RID, emitting: boolean): void /** Returns `true` if particles are currently set to emitting. */ @@ -8168,6 +8761,9 @@ declare module "godot" { /** Sets the preprocess time for the particles' animation. This lets you delay starting an animation until after the particles have begun emitting. Equivalent to [member GPUParticles3D.preprocess]. */ static particles_set_pre_process_time(particles: RID, time: float64): void + /** Requests particles to process for extra process time during a single frame. */ + static particles_request_process_time(particles: RID, time: float64): void + /** Sets the explosiveness ratio. Equivalent to [member GPUParticles3D.explosiveness]. */ static particles_set_explosiveness_ratio(particles: RID, ratio: float64): void @@ -8272,6 +8868,9 @@ declare module "godot" { /** Sets the heightmap [param resolution] for the 3D GPU particles heightfield collision specified by the [param particles_collision] RID. Equivalent to [member GPUParticlesCollisionHeightField3D.resolution]. */ static particles_collision_set_height_field_resolution(particles_collision: RID, resolution: RenderingServer.ParticlesCollisionHeightfieldResolution): void + /** Sets the heightfield [param mask] for the 3D GPU particles heightfield collision specified by the [param particles_collision] RID. Equivalent to [member GPUParticlesCollisionHeightField3D.heightfield_mask]. */ + static particles_collision_set_height_field_mask(particles_collision: RID, mask: int64): void + /** Creates a new fog volume and adds it to the RenderingServer. It can be accessed with the RID that is returned. This RID will be used in all `fog_volume_*` RenderingServer functions. * Once finished with your RID, you will want to free the RID using the RenderingServer's [method free_rid] method. * @@ -8290,7 +8889,7 @@ declare module "godot" { /** Creates a new 3D visibility notifier object and adds it to the RenderingServer. It can be accessed with the RID that is returned. This RID will be used in all `visibility_notifier_*` RenderingServer functions. * Once finished with your RID, you will want to free the RID using the RenderingServer's [method free_rid] method. - * To place in a scene, attach this mesh to an instance using [method instance_set_base] using the returned RID. + * To place in a scene, attach this notifier to an instance using [method instance_set_base] using the returned RID. * * **Note:** The equivalent node is [VisibleOnScreenNotifier3D]. */ @@ -8363,7 +8962,6 @@ declare module "godot" { /** Copies the viewport to a region of the screen specified by [param rect]. If [method viewport_set_render_direct_to_screen] is `true`, then the viewport does not use a framebuffer and the contents of the viewport are rendered directly to screen. However, note that the root viewport is drawn last, therefore it will draw over the screen. Accordingly, you must set the root viewport to an area that does not cover the area that you have attached this viewport to. * For example, you can set the root viewport to not render at all with the following code: - * FIXME: The method seems to be non-existent. * * Using this can result in significant optimization, especially on lower-end devices. However, it comes at the cost of having to manage your viewports manually. For further optimization, see [method viewport_set_render_direct_to_screen]. */ @@ -8392,6 +8990,15 @@ declare module "godot" { */ static viewport_set_texture_mipmap_bias(viewport: RID, mipmap_bias: float64): void + /** Sets the maximum number of samples to take when using anisotropic filtering on textures (as a power of two). A higher sample count will result in sharper textures at oblique angles, but is more expensive to compute. A value of `0` forcibly disables anisotropic filtering, even on materials where it is enabled. + * The anisotropic filtering level also affects decals and light projectors if they are configured to use anisotropic filtering. See [member ProjectSettings.rendering/textures/decals/filter] and [member ProjectSettings.rendering/textures/light_projectors/filter]. + * + * **Note:** In 3D, for this setting to have an effect, set [member BaseMaterial3D.texture_filter] to [constant BaseMaterial3D.TEXTURE_FILTER_LINEAR_WITH_MIPMAPS_ANISOTROPIC] or [constant BaseMaterial3D.TEXTURE_FILTER_NEAREST_WITH_MIPMAPS_ANISOTROPIC] on materials. + * + * **Note:** In 2D, for this setting to have an effect, set [member CanvasItem.texture_filter] to [constant CanvasItem.TEXTURE_FILTER_LINEAR_WITH_MIPMAPS_ANISOTROPIC] or [constant CanvasItem.TEXTURE_FILTER_NEAREST_WITH_MIPMAPS_ANISOTROPIC] on the [CanvasItem] node displaying the texture (or in [CanvasTexture]). However, anisotropic filtering is rarely useful in 2D, so only enable it for textures in 2D if it makes a meaningful visual difference. + */ + static viewport_set_anisotropic_filtering_level(viewport: RID, anisotropic_filtering_level: RenderingServer.ViewportAnisotropicFiltering): void + /** Sets when the viewport should be updated. See [enum ViewportUpdateMode] constants for options. */ static viewport_set_update_mode(viewport: RID, update_mode: RenderingServer.ViewportUpdateMode): void @@ -8468,25 +9075,25 @@ declare module "godot" { /** Sets the number of subdivisions to use in the specified shadow atlas [param quadrant] for omni and spot shadows. See also [method Viewport.set_positional_shadow_atlas_quadrant_subdiv]. */ static viewport_set_positional_shadow_atlas_quadrant_subdivision(viewport: RID, quadrant: int64, subdivision: int64): void - /** Sets the multisample anti-aliasing mode for 3D on the specified [param viewport] RID. See [enum ViewportMSAA] for options. */ + /** Sets the multisample antialiasing mode for 3D on the specified [param viewport] RID. See [enum ViewportMSAA] for options. Equivalent to [member ProjectSettings.rendering/anti_aliasing/quality/msaa_3d] or [member Viewport.msaa_3d]. */ static viewport_set_msaa_3d(viewport: RID, msaa: RenderingServer.ViewportMSAA): void - /** Sets the multisample anti-aliasing mode for 2D/Canvas on the specified [param viewport] RID. See [enum ViewportMSAA] for options. */ + /** Sets the multisample antialiasing mode for 2D/Canvas on the specified [param viewport] RID. See [enum ViewportMSAA] for options. Equivalent to [member ProjectSettings.rendering/anti_aliasing/quality/msaa_2d] or [member Viewport.msaa_2d]. */ static viewport_set_msaa_2d(viewport: RID, msaa: RenderingServer.ViewportMSAA): void /** If `true`, 2D rendering will use a high dynamic range (HDR) format framebuffer matching the bit depth of the 3D framebuffer. When using the Forward+ renderer this will be an `RGBA16` framebuffer, while when using the Mobile renderer it will be an `RGB10_A2` framebuffer. Additionally, 2D rendering will take place in linear color space and will be converted to sRGB space immediately before blitting to the screen (if the Viewport is attached to the screen). Practically speaking, this means that the end result of the Viewport will not be clamped into the `0-1` range and can be used in 3D rendering without color space adjustments. This allows 2D rendering to take advantage of effects requiring high dynamic range (e.g. 2D glow) as well as substantially improves the appearance of effects requiring highly detailed gradients. This setting has the same effect as [member Viewport.use_hdr_2d]. * - * **Note:** This setting will have no effect when using the GL Compatibility renderer as the GL Compatibility renderer always renders in low dynamic range for performance reasons. + * **Note:** This setting will have no effect when using the Compatibility renderer, which always renders in low dynamic range for performance reasons. */ static viewport_set_use_hdr_2d(viewport: RID, enabled: boolean): void - /** Sets the viewport's screen-space antialiasing mode. */ + /** Sets the viewport's screen-space antialiasing mode. Equivalent to [member ProjectSettings.rendering/anti_aliasing/quality/screen_space_aa] or [member Viewport.screen_space_aa]. */ static viewport_set_screen_space_aa(viewport: RID, mode: RenderingServer.ViewportScreenSpaceAA): void - /** If `true`, use Temporal Anti-Aliasing. Equivalent to [member ProjectSettings.rendering/anti_aliasing/quality/use_taa]. */ + /** If `true`, use temporal antialiasing. Equivalent to [member ProjectSettings.rendering/anti_aliasing/quality/use_taa] or [member Viewport.use_taa]. */ static viewport_set_use_taa(viewport: RID, enable: boolean): void - /** If `true`, enables debanding on the specified viewport. Equivalent to [member ProjectSettings.rendering/anti_aliasing/quality/use_debanding]. */ + /** If `true`, enables debanding on the specified viewport. Equivalent to [member ProjectSettings.rendering/anti_aliasing/quality/use_debanding] or [member Viewport.use_debanding]. */ static viewport_set_use_debanding(viewport: RID, enable: boolean): void /** If `true`, enables occlusion culling on the specified viewport. Equivalent to [member ProjectSettings.rendering/occlusion_culling/use_occlusion_culling]. */ @@ -8518,7 +9125,7 @@ declare module "godot" { */ static viewport_get_measured_render_time_cpu(viewport: RID): float64 - /** Returns the GPU time taken to render the last frame in milliseconds. To get a complete readout of GPU time spent to render the scene, sum the render times of all viewports that are drawn every frame. Unlike [method Engine.get_frames_per_second], this method accurately reflects GPU utilization even if framerate is capped via V-Sync or [member Engine.max_fps]. See also [method viewport_get_measured_render_time_gpu]. + /** Returns the GPU time taken to render the last frame in milliseconds. To get a complete readout of GPU time spent to render the scene, sum the render times of all viewports that are drawn every frame. Unlike [method Engine.get_frames_per_second], this method accurately reflects GPU utilization even if framerate is capped via V-Sync or [member Engine.max_fps]. See also [method viewport_get_measured_render_time_cpu]. * * **Note:** Requires measurements to be enabled on the specified [param viewport] using [method viewport_set_measure_render_time]. Otherwise, this method returns `0.0`. * @@ -8591,6 +9198,9 @@ declare module "godot" { /** Sets the environment's background mode. Equivalent to [member Environment.background_mode]. */ static environment_set_background(env: RID, bg: RenderingServer.EnvironmentBG): void + /** Sets the camera ID to be used as environment background. */ + static environment_set_camera_id(env: RID, id: int64): void + /** Sets the [Sky] to be used as the environment's background when using *BGMode* sky. Equivalent to [member Environment.sky]. */ static environment_set_sky(env: RID, sky: RID): void @@ -8610,7 +9220,7 @@ declare module "godot" { static environment_set_canvas_max_layer(env: RID, max_layer: int64): void /** Sets the values to be used for ambient light rendering. See [Environment] for more details. */ - static environment_set_ambient_light(env: RID, color: Color, ambient: RenderingServer.EnvironmentAmbientSource = 0, energy: float64 = 1, sky_contibution: float64 = 0, reflection_source: RenderingServer.EnvironmentReflectionSource = 0): void + static environment_set_ambient_light(env: RID, color: Color, ambient: RenderingServer.EnvironmentAmbientSource = 0, energy: float64 = 1, sky_contribution: float64 = 0, reflection_source: RenderingServer.EnvironmentReflectionSource = 0): void /** Configures glow for the specified environment RID. See `glow_*` properties in [Environment] for more information. */ static environment_set_glow(env: RID, enable: boolean, levels: PackedFloat32Array | float32[], intensity: float64, strength: float64, mix: float64, bloom_threshold: float64, blend_mode: RenderingServer.EnvironmentGlowBlendMode, hdr_bleed_threshold: float64, hdr_bleed_scale: float64, hdr_luminance_cap: float64, glow_map_strength: float64, glow_map: RID): void @@ -8751,6 +9361,14 @@ declare module "godot" { /** Sets the world space transform of the instance. Equivalent to [member Node3D.global_transform]. */ static instance_set_transform(instance: RID, transform: Transform3D): void + /** Turns on and off physics interpolation for the instance. */ + static instance_set_interpolated(instance: RID, interpolated: boolean): void + + /** Prevents physics interpolation for the current physics tick. + * This is useful when moving an instance to a new location, to give an instantaneous change rather than interpolation from the previous location. + */ + static instance_reset_physics_interpolation(instance: RID): void + /** Attaches a unique Object ID to instance. Object ID must be attached to instance for proper culling with [method instances_cull_aabb], [method instances_cull_convex], and [method instances_cull_ray]. */ static instance_attach_object_instance_id(instance: RID, id: int64): void @@ -8973,7 +9591,10 @@ declare module "godot" { /** Draws a 2D primitive on the [CanvasItem] pointed to by the [param item] [RID]. See also [method CanvasItem.draw_primitive]. */ static canvas_item_add_primitive(item: RID, points: PackedVector2Array | Vector2[], colors: PackedColorArray | Color[], uvs: PackedVector2Array | Vector2[], texture: RID): void - /** Draws a 2D polygon on the [CanvasItem] pointed to by the [param item] [RID]. If you need more flexibility (such as being able to use bones), use [method canvas_item_add_triangle_array] instead. See also [method CanvasItem.draw_polygon]. */ + /** Draws a 2D polygon on the [CanvasItem] pointed to by the [param item] [RID]. If you need more flexibility (such as being able to use bones), use [method canvas_item_add_triangle_array] instead. See also [method CanvasItem.draw_polygon]. + * + * **Note:** If you frequently redraw the same polygon with a large number of vertices, consider pre-calculating the triangulation with [method Geometry2D.triangulate_polygon] and using [method CanvasItem.draw_mesh], [method CanvasItem.draw_multimesh], or [method canvas_item_add_triangle_array]. + */ static canvas_item_add_polygon(item: RID, points: PackedVector2Array | Vector2[], colors: PackedColorArray | Color[], uvs: PackedVector2Array | Vector2[] = [], texture: RID = new RID()): void /** Draws a triangle array on the [CanvasItem] pointed to by the [param item] [RID]. This is internally used by [Line2D] and [StyleBoxFlat] for rendering. [method canvas_item_add_triangle_array] is highly flexible, but more complex to use than [method canvas_item_add_polygon]. @@ -8994,7 +9615,7 @@ declare module "godot" { /** Sets a [Transform2D] that will be used to transform subsequent canvas item commands. */ static canvas_item_add_set_transform(item: RID, transform: Transform2D): void - /** If [param ignore] is `true`, ignore clipping on items drawn with this canvas item until this is called again with [param ignore] set to false. */ + /** If [param ignore] is `true`, ignore clipping on items drawn with this canvas item until this is called again with [param ignore] set to `false`. */ static canvas_item_add_clip_ignore(item: RID, ignore: boolean): void /** Subsequent drawing commands will be ignored unless they fall within the specified animation slice. This is a faster way to implement animations that loop on background rather than redrawing constantly. */ @@ -9012,6 +9633,9 @@ declare module "godot" { /** Sets the [CanvasItem] to copy a rect to the backbuffer. */ static canvas_item_set_copy_to_backbuffer(item: RID, enabled: boolean, rect: Rect2): void + /** Attaches a skeleton to the [CanvasItem]. Removes the previous skeleton. */ + static canvas_item_attach_skeleton(item: RID, skeleton: RID): void + /** Clears the [CanvasItem] and removes all commands in it. */ static canvas_item_clear(item: RID): void @@ -9024,6 +9648,20 @@ declare module "godot" { /** Sets if the [CanvasItem] uses its parent's material. */ static canvas_item_set_use_parent_material(item: RID, enabled: boolean): void + /** Sets the per-instance shader uniform on the specified canvas item instance. Equivalent to [method CanvasItem.set_instance_shader_parameter]. */ + static canvas_item_set_instance_shader_parameter(instance: RID, parameter: StringName, value: any): void + + /** Returns the value of the per-instance shader uniform from the specified canvas item instance. Equivalent to [method CanvasItem.get_instance_shader_parameter]. */ + static canvas_item_get_instance_shader_parameter(instance: RID, parameter: StringName): any + + /** Returns the default value of the per-instance shader uniform from the specified canvas item instance. Equivalent to [method CanvasItem.get_instance_shader_parameter]. */ + static canvas_item_get_instance_shader_parameter_default_value(instance: RID, parameter: StringName): any + + /** Returns a dictionary of per-instance shader uniform names of the per-instance shader uniform from the specified canvas item instance. + * The returned dictionary is in PropertyInfo format, with the keys `name`, `class_name`, `type`, `hint`, `hint_string`, and `usage`. + */ + static canvas_item_get_instance_shader_parameter_list(instance: RID): GArray + /** Sets the given [CanvasItem] as visibility notifier. [param area] defines the area of detecting visibility. [param enter_callable] is called when the [CanvasItem] enters the screen, [param exit_callable] is called when the [CanvasItem] exits the screen. If [param enable] is `false`, the item will no longer function as notifier. * This method can be used to manually mimic [VisibleOnScreenNotifier2D]. */ @@ -9113,7 +9751,7 @@ declare module "godot" { static canvas_light_reset_physics_interpolation(light: RID): void /** Transforms both the current and previous stored transform for a canvas light. - * This allows transforming a light without creating a "glitch" in the interpolation, which is is particularly useful for large worlds utilizing a shifting origin. + * This allows transforming a light without creating a "glitch" in the interpolation, which is particularly useful for large worlds utilizing a shifting origin. */ static canvas_light_transform_physics_interpolation(light: RID, transform: Transform2D): void @@ -9236,7 +9874,7 @@ declare module "godot" { /** Returns the type of the video adapter. Since dedicated graphics cards from a given generation will *usually* be significantly faster than integrated graphics made in the same generation, the device type can be used as a basis for automatic graphics settings adjustment. However, this is not always true, so make sure to provide users with a way to manually override graphics settings. * - * **Note:** When using the OpenGL backend or when running in headless mode, this function always returns [constant RenderingDevice.DEVICE_TYPE_OTHER]. + * **Note:** When using the OpenGL rendering driver or when running in headless mode, this function always returns [constant RenderingDevice.DEVICE_TYPE_OTHER]. */ static get_video_adapter_type(): RenderingDevice.DeviceType @@ -9246,6 +9884,16 @@ declare module "godot" { */ static get_video_adapter_api_version(): string + /** Returns the name of the current rendering driver. This can be `vulkan`, `d3d12`, `metal`, `opengl3`, `opengl3_es`, or `opengl3_angle`. See also [method get_current_rendering_method]. + * The rendering driver is determined by [member ProjectSettings.rendering/rendering_device/driver], the `--rendering-driver` command line argument that overrides this project setting, or an automatic fallback that is applied depending on the hardware. + */ + static get_current_rendering_driver_name(): string + + /** Returns the name of the current rendering method. This can be `forward_plus`, `mobile`, or `gl_compatibility`. See also [method get_current_rendering_driver_name]. + * The rendering method is determined by [member ProjectSettings.rendering/renderer/rendering_method], the `--rendering-method` command line argument that overrides this project setting, or an automatic fallback that is applied depending on the hardware. + */ + static get_current_rendering_method(): string + /** Returns a mesh of a sphere with the given number of horizontal subdivisions, vertical subdivisions and radius. See also [method get_test_cube]. */ static make_sphere_mesh(latitudes: int64, longitudes: int64, radius: float64): RID @@ -9253,13 +9901,13 @@ declare module "godot" { static get_test_cube(): RID /** Returns the RID of a 256×256 texture with a testing pattern on it (in [constant Image.FORMAT_RGB8] format). This texture will be created and returned on the first call to [method get_test_texture], then it will be cached for subsequent calls. See also [method get_white_texture]. - * Example of getting the test texture and applying it to a [Sprite2D] node: + * **Example:** Get the test texture and apply it to a [Sprite2D] node: * */ static get_test_texture(): RID /** Returns the ID of a 4×4 white texture (in [constant Image.FORMAT_RGB8] format). This texture will be created and returned on the first call to [method get_white_texture], then it will be cached for subsequent calls. See also [method get_test_texture]. - * Example of getting the white texture and applying it to a [Sprite2D] node: + * **Example:** Get the white texture and apply it to a [Sprite2D] node: * */ static get_white_texture(): RID @@ -9276,7 +9924,10 @@ declare module "godot" { /** Returns `true` if the OS supports a certain [param feature]. Features might be `s3tc`, `etc`, and `etc2`. */ static has_os_feature(feature: string): boolean - /** This method is currently unimplemented and does nothing if called with [param generate] set to `true`. */ + /** If [param generate] is `true`, generates debug wireframes for all meshes that are loaded when using the Compatibility renderer. By default, the engine does not generate debug wireframes at runtime, since they slow down loading of assets and take up VRAM. + * + * **Note:** You must call this method before loading any meshes when using the Compatibility renderer, otherwise wireframes will not be used. + */ static set_debug_generate_wireframes(generate: boolean): void /** Returns the time taken to setup rendering on the CPU in milliseconds. This value is shared across all viewports and does *not* require [method viewport_set_measure_render_time] to be enabled on a viewport to be queried. See also [method viewport_get_measured_render_time_cpu]. */ @@ -9290,13 +9941,13 @@ declare module "godot" { /** Returns the global RenderingDevice. * - * **Note:** When using the OpenGL backend or when running in headless mode, this function always returns `null`. + * **Note:** When using the OpenGL rendering driver or when running in headless mode, this function always returns `null`. */ static get_rendering_device(): RenderingDevice /** Creates a RenderingDevice that can be used to do draw and compute operations on a separate thread. Cannot draw to the screen nor share data with the global RenderingDevice. * - * **Note:** When using the OpenGL backend or when running in headless mode, this function always returns `null`. + * **Note:** When using the OpenGL rendering driver or when running in headless mode, this function always returns `null`. */ static create_local_rendering_device(): RenderingDevice @@ -9319,1854 +9970,4 @@ declare module "godot" { /** Emitted at the end of the frame, after the RenderingServer has finished updating all the Viewports. */ static readonly frame_post_draw: Signal0 } - // _singleton_class_: PhysicsServer2D - namespace PhysicsServer2D { - enum SpaceParameter { - /** Constant to set/get the maximum distance a pair of bodies has to move before their collision status has to be recalculated. The default value of this parameter is [member ProjectSettings.physics/2d/solver/contact_recycle_radius]. */ - SPACE_PARAM_CONTACT_RECYCLE_RADIUS = 0, - - /** Constant to set/get the maximum distance a shape can be from another before they are considered separated and the contact is discarded. The default value of this parameter is [member ProjectSettings.physics/2d/solver/contact_max_separation]. */ - SPACE_PARAM_CONTACT_MAX_SEPARATION = 1, - - /** Constant to set/get the maximum distance a shape can penetrate another shape before it is considered a collision. The default value of this parameter is [member ProjectSettings.physics/2d/solver/contact_max_allowed_penetration]. */ - SPACE_PARAM_CONTACT_MAX_ALLOWED_PENETRATION = 2, - - /** Constant to set/get the default solver bias for all physics contacts. A solver bias is a factor controlling how much two objects "rebound", after overlapping, to avoid leaving them in that state because of numerical imprecision. The default value of this parameter is [member ProjectSettings.physics/2d/solver/default_contact_bias]. */ - SPACE_PARAM_CONTACT_DEFAULT_BIAS = 3, - - /** Constant to set/get the threshold linear velocity of activity. A body marked as potentially inactive for both linear and angular velocity will be put to sleep after the time given. The default value of this parameter is [member ProjectSettings.physics/2d/sleep_threshold_linear]. */ - SPACE_PARAM_BODY_LINEAR_VELOCITY_SLEEP_THRESHOLD = 4, - - /** Constant to set/get the threshold angular velocity of activity. A body marked as potentially inactive for both linear and angular velocity will be put to sleep after the time given. The default value of this parameter is [member ProjectSettings.physics/2d/sleep_threshold_angular]. */ - SPACE_PARAM_BODY_ANGULAR_VELOCITY_SLEEP_THRESHOLD = 5, - - /** Constant to set/get the maximum time of activity. A body marked as potentially inactive for both linear and angular velocity will be put to sleep after this time. The default value of this parameter is [member ProjectSettings.physics/2d/time_before_sleep]. */ - SPACE_PARAM_BODY_TIME_TO_SLEEP = 6, - - /** Constant to set/get the default solver bias for all physics constraints. A solver bias is a factor controlling how much two objects "rebound", after violating a constraint, to avoid leaving them in that state because of numerical imprecision. The default value of this parameter is [member ProjectSettings.physics/2d/solver/default_constraint_bias]. */ - SPACE_PARAM_CONSTRAINT_DEFAULT_BIAS = 7, - - /** Constant to set/get the number of solver iterations for all contacts and constraints. The greater the number of iterations, the more accurate the collisions will be. However, a greater number of iterations requires more CPU power, which can decrease performance. The default value of this parameter is [member ProjectSettings.physics/2d/solver/solver_iterations]. */ - SPACE_PARAM_SOLVER_ITERATIONS = 8, - } - enum ShapeType { - /** This is the constant for creating world boundary shapes. A world boundary shape is an *infinite* line with an origin point, and a normal. Thus, it can be used for front/behind checks. */ - SHAPE_WORLD_BOUNDARY = 0, - - /** This is the constant for creating separation ray shapes. A separation ray is defined by a length and separates itself from what is touching its far endpoint. Useful for character controllers. */ - SHAPE_SEPARATION_RAY = 1, - - /** This is the constant for creating segment shapes. A segment shape is a *finite* line from a point A to a point B. It can be checked for intersections. */ - SHAPE_SEGMENT = 2, - - /** This is the constant for creating circle shapes. A circle shape only has a radius. It can be used for intersections and inside/outside checks. */ - SHAPE_CIRCLE = 3, - - /** This is the constant for creating rectangle shapes. A rectangle shape is defined by a width and a height. It can be used for intersections and inside/outside checks. */ - SHAPE_RECTANGLE = 4, - - /** This is the constant for creating capsule shapes. A capsule shape is defined by a radius and a length. It can be used for intersections and inside/outside checks. */ - SHAPE_CAPSULE = 5, - - /** This is the constant for creating convex polygon shapes. A polygon is defined by a list of points. It can be used for intersections and inside/outside checks. */ - SHAPE_CONVEX_POLYGON = 6, - - /** This is the constant for creating concave polygon shapes. A polygon is defined by a list of points. It can be used for intersections checks, but not for inside/outside checks. */ - SHAPE_CONCAVE_POLYGON = 7, - - /** This constant is used internally by the engine. Any attempt to create this kind of shape results in an error. */ - SHAPE_CUSTOM = 8, - } - enum AreaParameter { - /** Constant to set/get gravity override mode in an area. See [enum AreaSpaceOverrideMode] for possible values. The default value of this parameter is [constant AREA_SPACE_OVERRIDE_DISABLED]. */ - AREA_PARAM_GRAVITY_OVERRIDE_MODE = 0, - - /** Constant to set/get gravity strength in an area. The default value of this parameter is `9.80665`. */ - AREA_PARAM_GRAVITY = 1, - - /** Constant to set/get gravity vector/center in an area. The default value of this parameter is `Vector2(0, -1)`. */ - AREA_PARAM_GRAVITY_VECTOR = 2, - - /** Constant to set/get whether the gravity vector of an area is a direction, or a center point. The default value of this parameter is `false`. */ - AREA_PARAM_GRAVITY_IS_POINT = 3, - - /** Constant to set/get the distance at which the gravity strength is equal to the gravity controlled by [constant AREA_PARAM_GRAVITY]. For example, on a planet 100 pixels in radius with a surface gravity of 4.0 px/s², set the gravity to 4.0 and the unit distance to 100.0. The gravity will have falloff according to the inverse square law, so in the example, at 200 pixels from the center the gravity will be 1.0 px/s² (twice the distance, 1/4th the gravity), at 50 pixels it will be 16.0 px/s² (half the distance, 4x the gravity), and so on. - * The above is true only when the unit distance is a positive number. When the unit distance is set to 0.0, the gravity will be constant regardless of distance. The default value of this parameter is `0.0`. - */ - AREA_PARAM_GRAVITY_POINT_UNIT_DISTANCE = 4, - - /** Constant to set/get linear damping override mode in an area. See [enum AreaSpaceOverrideMode] for possible values. The default value of this parameter is [constant AREA_SPACE_OVERRIDE_DISABLED]. */ - AREA_PARAM_LINEAR_DAMP_OVERRIDE_MODE = 5, - - /** Constant to set/get the linear damping factor of an area. The default value of this parameter is `0.1`. */ - AREA_PARAM_LINEAR_DAMP = 6, - - /** Constant to set/get angular damping override mode in an area. See [enum AreaSpaceOverrideMode] for possible values. The default value of this parameter is [constant AREA_SPACE_OVERRIDE_DISABLED]. */ - AREA_PARAM_ANGULAR_DAMP_OVERRIDE_MODE = 7, - - /** Constant to set/get the angular damping factor of an area. The default value of this parameter is `1.0`. */ - AREA_PARAM_ANGULAR_DAMP = 8, - - /** Constant to set/get the priority (order of processing) of an area. The default value of this parameter is `0`. */ - AREA_PARAM_PRIORITY = 9, - } - enum AreaSpaceOverrideMode { - /** This area does not affect gravity/damp. These are generally areas that exist only to detect collisions, and objects entering or exiting them. */ - AREA_SPACE_OVERRIDE_DISABLED = 0, - - /** This area adds its gravity/damp values to whatever has been calculated so far. This way, many overlapping areas can combine their physics to make interesting effects. */ - AREA_SPACE_OVERRIDE_COMBINE = 1, - - /** This area adds its gravity/damp values to whatever has been calculated so far. Then stops taking into account the rest of the areas, even the default one. */ - AREA_SPACE_OVERRIDE_COMBINE_REPLACE = 2, - - /** This area replaces any gravity/damp, even the default one, and stops taking into account the rest of the areas. */ - AREA_SPACE_OVERRIDE_REPLACE = 3, - - /** This area replaces any gravity/damp calculated so far, but keeps calculating the rest of the areas, down to the default one. */ - AREA_SPACE_OVERRIDE_REPLACE_COMBINE = 4, - } - enum BodyMode { - /** Constant for static bodies. In this mode, a body can be only moved by user code and doesn't collide with other bodies along its path when moved. */ - BODY_MODE_STATIC = 0, - - /** Constant for kinematic bodies. In this mode, a body can be only moved by user code and collides with other bodies along its path. */ - BODY_MODE_KINEMATIC = 1, - - /** Constant for rigid bodies. In this mode, a body can be pushed by other bodies and has forces applied. */ - BODY_MODE_RIGID = 2, - - /** Constant for linear rigid bodies. In this mode, a body can not rotate, and only its linear velocity is affected by external forces. */ - BODY_MODE_RIGID_LINEAR = 3, - } - enum BodyParameter { - /** Constant to set/get a body's bounce factor. The default value of this parameter is `0.0`. */ - BODY_PARAM_BOUNCE = 0, - - /** Constant to set/get a body's friction. The default value of this parameter is `1.0`. */ - BODY_PARAM_FRICTION = 1, - - /** Constant to set/get a body's mass. The default value of this parameter is `1.0`. If the body's mode is set to [constant BODY_MODE_RIGID], then setting this parameter will have the following additional effects: - * - If the parameter [constant BODY_PARAM_CENTER_OF_MASS] has never been set explicitly, then the value of that parameter will be recalculated based on the body's shapes. - * - If the parameter [constant BODY_PARAM_INERTIA] is set to a value `<= 0.0`, then the value of that parameter will be recalculated based on the body's shapes, mass, and center of mass. - */ - BODY_PARAM_MASS = 2, - - /** Constant to set/get a body's inertia. The default value of this parameter is `0.0`. If the body's inertia is set to a value `<= 0.0`, then the inertia will be recalculated based on the body's shapes, mass, and center of mass. */ - BODY_PARAM_INERTIA = 3, - - /** Constant to set/get a body's center of mass position in the body's local coordinate system. The default value of this parameter is `Vector2(0,0)`. If this parameter is never set explicitly, then it is recalculated based on the body's shapes when setting the parameter [constant BODY_PARAM_MASS] or when calling [method body_set_space]. */ - BODY_PARAM_CENTER_OF_MASS = 4, - - /** Constant to set/get a body's gravity multiplier. The default value of this parameter is `1.0`. */ - BODY_PARAM_GRAVITY_SCALE = 5, - - /** Constant to set/get a body's linear damping mode. See [enum BodyDampMode] for possible values. The default value of this parameter is [constant BODY_DAMP_MODE_COMBINE]. */ - BODY_PARAM_LINEAR_DAMP_MODE = 6, - - /** Constant to set/get a body's angular damping mode. See [enum BodyDampMode] for possible values. The default value of this parameter is [constant BODY_DAMP_MODE_COMBINE]. */ - BODY_PARAM_ANGULAR_DAMP_MODE = 7, - - /** Constant to set/get a body's linear damping factor. The default value of this parameter is `0.0`. */ - BODY_PARAM_LINEAR_DAMP = 8, - - /** Constant to set/get a body's angular damping factor. The default value of this parameter is `0.0`. */ - BODY_PARAM_ANGULAR_DAMP = 9, - - /** Represents the size of the [enum BodyParameter] enum. */ - BODY_PARAM_MAX = 10, - } - enum BodyDampMode { - /** The body's damping value is added to any value set in areas or the default value. */ - BODY_DAMP_MODE_COMBINE = 0, - - /** The body's damping value replaces any value set in areas or the default value. */ - BODY_DAMP_MODE_REPLACE = 1, - } - enum BodyState { - /** Constant to set/get the current transform matrix of the body. */ - BODY_STATE_TRANSFORM = 0, - - /** Constant to set/get the current linear velocity of the body. */ - BODY_STATE_LINEAR_VELOCITY = 1, - - /** Constant to set/get the current angular velocity of the body. */ - BODY_STATE_ANGULAR_VELOCITY = 2, - - /** Constant to sleep/wake up a body, or to get whether it is sleeping. */ - BODY_STATE_SLEEPING = 3, - - /** Constant to set/get whether the body can sleep. */ - BODY_STATE_CAN_SLEEP = 4, - } - enum JointType { - /** Constant to create pin joints. */ - JOINT_TYPE_PIN = 0, - - /** Constant to create groove joints. */ - JOINT_TYPE_GROOVE = 1, - - /** Constant to create damped spring joints. */ - JOINT_TYPE_DAMPED_SPRING = 2, - - /** Represents the size of the [enum JointType] enum. */ - JOINT_TYPE_MAX = 3, - } - enum JointParam { - /** Constant to set/get how fast the joint pulls the bodies back to satisfy the joint constraint. The lower the value, the more the two bodies can pull on the joint. The default value of this parameter is `0.0`. - * - * **Note:** In Godot Physics, this parameter is only used for pin joints and groove joints. - */ - JOINT_PARAM_BIAS = 0, - - /** Constant to set/get the maximum speed with which the joint can apply corrections. The default value of this parameter is `3.40282e+38`. - * - * **Note:** In Godot Physics, this parameter is only used for groove joints. - */ - JOINT_PARAM_MAX_BIAS = 1, - - /** Constant to set/get the maximum force that the joint can use to act on the two bodies. The default value of this parameter is `3.40282e+38`. - * - * **Note:** In Godot Physics, this parameter is only used for groove joints. - */ - JOINT_PARAM_MAX_FORCE = 2, - } - enum PinJointParam { - /** Constant to set/get a how much the bond of the pin joint can flex. The default value of this parameter is `0.0`. */ - PIN_JOINT_SOFTNESS = 0, - - /** The maximum rotation around the pin. */ - PIN_JOINT_LIMIT_UPPER = 1, - - /** The minimum rotation around the pin. */ - PIN_JOINT_LIMIT_LOWER = 2, - - /** Target speed for the motor. In radians per second. */ - PIN_JOINT_MOTOR_TARGET_VELOCITY = 3, - } - enum PinJointFlag { - /** If `true`, the pin has a maximum and a minimum rotation. */ - PIN_JOINT_FLAG_ANGULAR_LIMIT_ENABLED = 0, - - /** If `true`, a motor turns the pin. */ - PIN_JOINT_FLAG_MOTOR_ENABLED = 1, - } - enum DampedSpringParam { - /** Sets the resting length of the spring joint. The joint will always try to go to back this length when pulled apart. The default value of this parameter is the distance between the joint's anchor points. */ - DAMPED_SPRING_REST_LENGTH = 0, - - /** Sets the stiffness of the spring joint. The joint applies a force equal to the stiffness times the distance from its resting length. The default value of this parameter is `20.0`. */ - DAMPED_SPRING_STIFFNESS = 1, - - /** Sets the damping ratio of the spring joint. A value of 0 indicates an undamped spring, while 1 causes the system to reach equilibrium as fast as possible (critical damping). The default value of this parameter is `1.5`. */ - DAMPED_SPRING_DAMPING = 2, - } - enum CCDMode { - /** Disables continuous collision detection. This is the fastest way to detect body collisions, but it can miss small and/or fast-moving objects. */ - CCD_MODE_DISABLED = 0, - - /** Enables continuous collision detection by raycasting. It is faster than shapecasting, but less precise. */ - CCD_MODE_CAST_RAY = 1, - - /** Enables continuous collision detection by shapecasting. It is the slowest CCD method, and the most precise. */ - CCD_MODE_CAST_SHAPE = 2, - } - enum AreaBodyStatus { - /** The value of the first parameter and area callback function receives, when an object enters one of its shapes. */ - AREA_BODY_ADDED = 0, - - /** The value of the first parameter and area callback function receives, when an object exits one of its shapes. */ - AREA_BODY_REMOVED = 1, - } - enum ProcessInfo { - /** Constant to get the number of objects that are not sleeping. */ - INFO_ACTIVE_OBJECTS = 0, - - /** Constant to get the number of possible collisions. */ - INFO_COLLISION_PAIRS = 1, - - /** Constant to get the number of space regions where a collision could occur. */ - INFO_ISLAND_COUNT = 2, - } - } - /** A server interface for low-level 2D physics access. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_physicsserver2d.html - */ - class PhysicsServer2D extends Object { - /** Creates a 2D world boundary shape in the physics server, and returns the [RID] that identifies it. Use [method shape_set_data] to set the shape's normal direction and distance properties. */ - static world_boundary_shape_create(): RID - - /** Creates a 2D separation ray shape in the physics server, and returns the [RID] that identifies it. Use [method shape_set_data] to set the shape's `length` and `slide_on_slope` properties. */ - static separation_ray_shape_create(): RID - - /** Creates a 2D segment shape in the physics server, and returns the [RID] that identifies it. Use [method shape_set_data] to set the segment's start and end points. */ - static segment_shape_create(): RID - - /** Creates a 2D circle shape in the physics server, and returns the [RID] that identifies it. Use [method shape_set_data] to set the circle's radius. */ - static circle_shape_create(): RID - - /** Creates a 2D rectangle shape in the physics server, and returns the [RID] that identifies it. Use [method shape_set_data] to set the rectangle's half-extents. */ - static rectangle_shape_create(): RID - - /** Creates a 2D capsule shape in the physics server, and returns the [RID] that identifies it. Use [method shape_set_data] to set the capsule's height and radius. */ - static capsule_shape_create(): RID - - /** Creates a 2D convex polygon shape in the physics server, and returns the [RID] that identifies it. Use [method shape_set_data] to set the convex polygon's points. */ - static convex_polygon_shape_create(): RID - - /** Creates a 2D concave polygon shape in the physics server, and returns the [RID] that identifies it. Use [method shape_set_data] to set the concave polygon's segments. */ - static concave_polygon_shape_create(): RID - - /** Sets the shape data that defines the configuration of the shape. The [param data] to be passed depends on the shape's type (see [method shape_get_type]): - * - [constant SHAPE_WORLD_BOUNDARY]: an array of length two containing a [Vector2] `normal` direction and a [float] distance `d`, - * - [constant SHAPE_SEPARATION_RAY]: a dictionary containing the key `length` with a [float] value and the key `slide_on_slope` with a [bool] value, - * - [constant SHAPE_SEGMENT]: a [Rect2] `rect` containing the first point of the segment in `rect.position` and the second point of the segment in `rect.size`, - * - [constant SHAPE_CIRCLE]: a [float] `radius`, - * - [constant SHAPE_RECTANGLE]: a [Vector2] `half_extents`, - * - [constant SHAPE_CAPSULE]: an array of length two (or a [Vector2]) containing a [float] `height` and a [float] `radius`, - * - [constant SHAPE_CONVEX_POLYGON]: either a [PackedVector2Array] of points defining a convex polygon in counterclockwise order (the clockwise outward normal of each segment formed by consecutive points is calculated internally), or a [PackedFloat32Array] of length divisible by four so that every 4-tuple of [float]s contains the coordinates of a point followed by the coordinates of the clockwise outward normal vector to the segment between the current point and the next point, - * - [constant SHAPE_CONCAVE_POLYGON]: a [PackedVector2Array] of length divisible by two (each pair of points forms one segment). - * **Warning:** In the case of [constant SHAPE_CONVEX_POLYGON], this method does not check if the points supplied actually form a convex polygon (unlike the [member CollisionPolygon2D.polygon] property). - */ - static shape_set_data(shape: RID, data: any): void - - /** Returns the shape's type (see [enum ShapeType]). */ - static shape_get_type(shape: RID): PhysicsServer2D.ShapeType - - /** Returns the shape data that defines the configuration of the shape, such as the half-extents of a rectangle or the segments of a concave shape. See [method shape_set_data] for the precise format of this data in each case. */ - static shape_get_data(shape: RID): any - - /** Creates a 2D space in the physics server, and returns the [RID] that identifies it. A space contains bodies and areas, and controls the stepping of the physics simulation of the objects in it. */ - static space_create(): RID - - /** Activates or deactivates the space. If [param active] is `false`, then the physics server will not do anything with this space in its physics step. */ - static space_set_active(space: RID, active: boolean): void - - /** Returns `true` if the space is active. */ - static space_is_active(space: RID): boolean - - /** Sets the value of the given space parameter. See [enum SpaceParameter] for the list of available parameters. */ - static space_set_param(space: RID, param: PhysicsServer2D.SpaceParameter, value: float64): void - - /** Returns the value of the given space parameter. See [enum SpaceParameter] for the list of available parameters. */ - static space_get_param(space: RID, param: PhysicsServer2D.SpaceParameter): float64 - - /** Returns the state of a space, a [PhysicsDirectSpaceState2D]. This object can be used for collision/intersection queries. */ - static space_get_direct_state(space: RID): PhysicsDirectSpaceState2D - - /** Creates a 2D area object in the physics server, and returns the [RID] that identifies it. The default settings for the created area include a collision layer and mask set to `1`, and `monitorable` set to `false`. - * Use [method area_add_shape] to add shapes to it, use [method area_set_transform] to set its transform, and use [method area_set_space] to add the area to a space. If you want the area to be detectable use [method area_set_monitorable]. - */ - static area_create(): RID - - /** Adds the area to the given space, after removing the area from the previously assigned space (if any). - * - * **Note:** To remove an area from a space without immediately adding it back elsewhere, use `PhysicsServer2D.area_set_space(area, RID())`. - */ - static area_set_space(area: RID, space: RID): void - - /** Returns the [RID] of the space assigned to the area. Returns an empty [RID] if no space is assigned. */ - static area_get_space(area: RID): RID - - /** Adds a shape to the area, with the given local transform. The shape (together with its [param transform] and [param disabled] properties) is added to an array of shapes, and the shapes of an area are usually referenced by their index in this array. */ - static area_add_shape(area: RID, shape: RID, transform: Transform2D = new Transform2D(), disabled: boolean = false): void - - /** Replaces the area's shape at the given index by another shape, while not affecting the `transform` and `disabled` properties at the same index. */ - static area_set_shape(area: RID, shape_idx: int64, shape: RID): void - - /** Sets the local transform matrix of the area's shape with the given index. */ - static area_set_shape_transform(area: RID, shape_idx: int64, transform: Transform2D): void - - /** Sets the disabled property of the area's shape with the given index. If [param disabled] is `true`, then the shape will not detect any other shapes entering or exiting it. */ - static area_set_shape_disabled(area: RID, shape_idx: int64, disabled: boolean): void - - /** Returns the number of shapes added to the area. */ - static area_get_shape_count(area: RID): int64 - - /** Returns the [RID] of the shape with the given index in the area's array of shapes. */ - static area_get_shape(area: RID, shape_idx: int64): RID - - /** Returns the local transform matrix of the shape with the given index in the area's array of shapes. */ - static area_get_shape_transform(area: RID, shape_idx: int64): Transform2D - - /** Removes the shape with the given index from the area's array of shapes. The shape itself is not deleted, so it can continue to be used elsewhere or added back later. As a result of this operation, the area's shapes which used to have indices higher than [param shape_idx] will have their index decreased by one. */ - static area_remove_shape(area: RID, shape_idx: int64): void - - /** Removes all shapes from the area. This does not delete the shapes themselves, so they can continue to be used elsewhere or added back later. */ - static area_clear_shapes(area: RID): void - - /** Assigns the area to one or many physics layers, via a bitmask. */ - static area_set_collision_layer(area: RID, layer: int64): void - - /** Returns the physics layer or layers the area belongs to, as a bitmask. */ - static area_get_collision_layer(area: RID): int64 - - /** Sets which physics layers the area will monitor, via a bitmask. */ - static area_set_collision_mask(area: RID, mask: int64): void - - /** Returns the physics layer or layers the area can contact with, as a bitmask. */ - static area_get_collision_mask(area: RID): int64 - - /** Sets the value of the given area parameter. See [enum AreaParameter] for the list of available parameters. */ - static area_set_param(area: RID, param: PhysicsServer2D.AreaParameter, value: any): void - - /** Sets the transform matrix of the area. */ - static area_set_transform(area: RID, transform: Transform2D): void - - /** Returns the value of the given area parameter. See [enum AreaParameter] for the list of available parameters. */ - static area_get_param(area: RID, param: PhysicsServer2D.AreaParameter): any - - /** Returns the transform matrix of the area. */ - static area_get_transform(area: RID): Transform2D - - /** Attaches the `ObjectID` of an [Object] to the area. Use [method Object.get_instance_id] to get the `ObjectID` of a [CollisionObject2D]. */ - static area_attach_object_instance_id(area: RID, id: int64): void - - /** Returns the `ObjectID` attached to the area. Use [method @GlobalScope.instance_from_id] to retrieve an [Object] from a nonzero `ObjectID`. */ - static area_get_object_instance_id(area: RID): int64 - - /** Attaches the `ObjectID` of a canvas to the area. Use [method Object.get_instance_id] to get the `ObjectID` of a [CanvasLayer]. */ - static area_attach_canvas_instance_id(area: RID, id: int64): void - - /** Returns the `ObjectID` of the canvas attached to the area. Use [method @GlobalScope.instance_from_id] to retrieve a [CanvasLayer] from a nonzero `ObjectID`. */ - static area_get_canvas_instance_id(area: RID): int64 - - /** Sets the area's body monitor callback. This callback will be called when any other (shape of a) body enters or exits (a shape of) the given area, and must take the following five parameters: - * 1. an integer `status`: either [constant AREA_BODY_ADDED] or [constant AREA_BODY_REMOVED] depending on whether the other body shape entered or exited the area, - * 2. an [RID] `body_rid`: the [RID] of the body that entered or exited the area, - * 3. an integer `instance_id`: the `ObjectID` attached to the body, - * 4. an integer `body_shape_idx`: the index of the shape of the body that entered or exited the area, - * 5. an integer `self_shape_idx`: the index of the shape of the area where the body entered or exited. - * By counting (or keeping track of) the shapes that enter and exit, it can be determined if a body (with all its shapes) is entering for the first time or exiting for the last time. - */ - static area_set_monitor_callback(area: RID, callback: Callable): void - - /** Sets the area's area monitor callback. This callback will be called when any other (shape of an) area enters or exits (a shape of) the given area, and must take the following five parameters: - * 1. an integer `status`: either [constant AREA_BODY_ADDED] or [constant AREA_BODY_REMOVED] depending on whether the other area's shape entered or exited the area, - * 2. an [RID] `area_rid`: the [RID] of the other area that entered or exited the area, - * 3. an integer `instance_id`: the `ObjectID` attached to the other area, - * 4. an integer `area_shape_idx`: the index of the shape of the other area that entered or exited the area, - * 5. an integer `self_shape_idx`: the index of the shape of the area where the other area entered or exited. - * By counting (or keeping track of) the shapes that enter and exit, it can be determined if an area (with all its shapes) is entering for the first time or exiting for the last time. - */ - static area_set_area_monitor_callback(area: RID, callback: Callable): void - - /** Sets whether the area is monitorable or not. If [param monitorable] is `true`, the area monitoring callback of other areas will be called when this area enters or exits them. */ - static area_set_monitorable(area: RID, monitorable: boolean): void - - /** Creates a 2D body object in the physics server, and returns the [RID] that identifies it. The default settings for the created area include a collision layer and mask set to `1`, and body mode set to [constant BODY_MODE_RIGID]. - * Use [method body_add_shape] to add shapes to it, use [method body_set_state] to set its transform, and use [method body_set_space] to add the body to a space. - */ - static body_create(): RID - - /** Adds the body to the given space, after removing the body from the previously assigned space (if any). If the body's mode is set to [constant BODY_MODE_RIGID], then adding the body to a space will have the following additional effects: - * - If the parameter [constant BODY_PARAM_CENTER_OF_MASS] has never been set explicitly, then the value of that parameter will be recalculated based on the body's shapes. - * - If the parameter [constant BODY_PARAM_INERTIA] is set to a value `<= 0.0`, then the value of that parameter will be recalculated based on the body's shapes, mass, and center of mass. - * - * **Note:** To remove a body from a space without immediately adding it back elsewhere, use `PhysicsServer2D.body_set_space(body, RID())`. - */ - static body_set_space(body: RID, space: RID): void - - /** Returns the [RID] of the space assigned to the body. Returns an empty [RID] if no space is assigned. */ - static body_get_space(body: RID): RID - - /** Sets the body's mode. See [enum BodyMode] for the list of available modes. */ - static body_set_mode(body: RID, mode: PhysicsServer2D.BodyMode): void - - /** Returns the body's mode (see [enum BodyMode]). */ - static body_get_mode(body: RID): PhysicsServer2D.BodyMode - - /** Adds a shape to the area, with the given local transform. The shape (together with its [param transform] and [param disabled] properties) is added to an array of shapes, and the shapes of a body are usually referenced by their index in this array. */ - static body_add_shape(body: RID, shape: RID, transform: Transform2D = new Transform2D(), disabled: boolean = false): void - - /** Replaces the body's shape at the given index by another shape, while not affecting the `transform`, `disabled`, and one-way collision properties at the same index. */ - static body_set_shape(body: RID, shape_idx: int64, shape: RID): void - - /** Sets the local transform matrix of the body's shape with the given index. */ - static body_set_shape_transform(body: RID, shape_idx: int64, transform: Transform2D): void - - /** Returns the number of shapes added to the body. */ - static body_get_shape_count(body: RID): int64 - - /** Returns the [RID] of the shape with the given index in the body's array of shapes. */ - static body_get_shape(body: RID, shape_idx: int64): RID - - /** Returns the local transform matrix of the shape with the given index in the area's array of shapes. */ - static body_get_shape_transform(body: RID, shape_idx: int64): Transform2D - - /** Removes the shape with the given index from the body's array of shapes. The shape itself is not deleted, so it can continue to be used elsewhere or added back later. As a result of this operation, the body's shapes which used to have indices higher than [param shape_idx] will have their index decreased by one. */ - static body_remove_shape(body: RID, shape_idx: int64): void - - /** Removes all shapes from the body. This does not delete the shapes themselves, so they can continue to be used elsewhere or added back later. */ - static body_clear_shapes(body: RID): void - - /** Sets the disabled property of the body's shape with the given index. If [param disabled] is `true`, then the shape will be ignored in all collision detection. */ - static body_set_shape_disabled(body: RID, shape_idx: int64, disabled: boolean): void - - /** Sets the one-way collision properties of the body's shape with the given index. If [param enable] is `true`, the one-way collision direction given by the shape's local upward axis `body_get_shape_transform(body, shape_idx).y` will be used to ignore collisions with the shape in the opposite direction, and to ensure depenetration of kinematic bodies happens in this direction. */ - static body_set_shape_as_one_way_collision(body: RID, shape_idx: int64, enable: boolean, margin: float64): void - - /** Attaches the `ObjectID` of an [Object] to the body. Use [method Object.get_instance_id] to get the `ObjectID` of a [CollisionObject2D]. */ - static body_attach_object_instance_id(body: RID, id: int64): void - - /** Returns the `ObjectID` attached to the body. Use [method @GlobalScope.instance_from_id] to retrieve an [Object] from a nonzero `ObjectID`. */ - static body_get_object_instance_id(body: RID): int64 - - /** Attaches the `ObjectID` of a canvas to the body. Use [method Object.get_instance_id] to get the `ObjectID` of a [CanvasLayer]. */ - static body_attach_canvas_instance_id(body: RID, id: int64): void - - /** Returns the `ObjectID` of the canvas attached to the body. Use [method @GlobalScope.instance_from_id] to retrieve a [CanvasLayer] from a nonzero `ObjectID`. */ - static body_get_canvas_instance_id(body: RID): int64 - - /** Sets the continuous collision detection mode using one of the [enum CCDMode] constants. - * Continuous collision detection tries to predict where a moving body would collide in between physics updates, instead of moving it and correcting its movement if it collided. - */ - static body_set_continuous_collision_detection_mode(body: RID, mode: PhysicsServer2D.CCDMode): void - - /** Returns the body's continuous collision detection mode (see [enum CCDMode]). */ - static body_get_continuous_collision_detection_mode(body: RID): PhysicsServer2D.CCDMode - - /** Sets the physics layer or layers the body belongs to, via a bitmask. */ - static body_set_collision_layer(body: RID, layer: int64): void - - /** Returns the physics layer or layers the body belongs to, as a bitmask. */ - static body_get_collision_layer(body: RID): int64 - - /** Sets the physics layer or layers the body can collide with, via a bitmask. */ - static body_set_collision_mask(body: RID, mask: int64): void - - /** Returns the physics layer or layers the body can collide with, as a bitmask. */ - static body_get_collision_mask(body: RID): int64 - - /** Sets the body's collision priority. This is used in the depenetration phase of [method body_test_motion]. The higher the priority is, the lower the penetration into the body will be. */ - static body_set_collision_priority(body: RID, priority: float64): void - - /** Returns the body's collision priority. This is used in the depenetration phase of [method body_test_motion]. The higher the priority is, the lower the penetration into the body will be. */ - static body_get_collision_priority(body: RID): float64 - - /** Sets the value of the given body parameter. See [enum BodyParameter] for the list of available parameters. */ - static body_set_param(body: RID, param: PhysicsServer2D.BodyParameter, value: any): void - - /** Returns the value of the given body parameter. See [enum BodyParameter] for the list of available parameters. */ - static body_get_param(body: RID, param: PhysicsServer2D.BodyParameter): any - - /** Restores the default inertia and center of mass of the body based on its shapes. This undoes any custom values previously set using [method body_set_param]. */ - static body_reset_mass_properties(body: RID): void - - /** Sets the value of a body's state. See [enum BodyState] for the list of available states. - * - * **Note:** The state change doesn't take effect immediately. The state will change on the next physics frame. - */ - static body_set_state(body: RID, state: PhysicsServer2D.BodyState, value: any): void - - /** Returns the value of the given state of the body. See [enum BodyState] for the list of available states. */ - static body_get_state(body: RID, state: PhysicsServer2D.BodyState): any - - /** Applies a directional impulse to the body, at the body's center of mass. The impulse does not affect rotation. - * An impulse is time-independent! Applying an impulse every frame would result in a framerate-dependent force. For this reason, it should only be used when simulating one-time impacts (use the "_force" functions otherwise). - * This is equivalent to using [method body_apply_impulse] at the body's center of mass. - */ - static body_apply_central_impulse(body: RID, impulse: Vector2): void - - /** Applies a rotational impulse to the body. The impulse does not affect position. - * An impulse is time-independent! Applying an impulse every frame would result in a framerate-dependent force. For this reason, it should only be used when simulating one-time impacts (use the "_force" functions otherwise). - */ - static body_apply_torque_impulse(body: RID, impulse: float64): void - - /** Applies a positioned impulse to the body. The impulse can affect rotation if [param position] is different from the body's center of mass. - * An impulse is time-independent! Applying an impulse every frame would result in a framerate-dependent force. For this reason, it should only be used when simulating one-time impacts (use the "_force" functions otherwise). - * [param position] is the offset from the body origin in global coordinates. - */ - static body_apply_impulse(body: RID, impulse: Vector2, position: Vector2 = Vector2.ZERO): void - - /** Applies a directional force to the body, at the body's center of mass. The force does not affect rotation. A force is time dependent and meant to be applied every physics update. - * This is equivalent to using [method body_apply_force] at the body's center of mass. - */ - static body_apply_central_force(body: RID, force: Vector2): void - - /** Applies a positioned force to the body. The force can affect rotation if [param position] is different from the body's center of mass. A force is time dependent and meant to be applied every physics update. - * [param position] is the offset from the body origin in global coordinates. - */ - static body_apply_force(body: RID, force: Vector2, position: Vector2 = Vector2.ZERO): void - - /** Applies a rotational force to the body. The force does not affect position. A force is time dependent and meant to be applied every physics update. */ - static body_apply_torque(body: RID, torque: float64): void - - /** Adds a constant directional force to the body. The force does not affect rotation. The force remains applied over time until cleared with `PhysicsServer2D.body_set_constant_force(body, Vector2(0, 0))`. - * This is equivalent to using [method body_add_constant_force] at the body's center of mass. - */ - static body_add_constant_central_force(body: RID, force: Vector2): void - - /** Adds a constant positioned force to the body. The force can affect rotation if [param position] is different from the body's center of mass. The force remains applied over time until cleared with `PhysicsServer2D.body_set_constant_force(body, Vector2(0, 0))`. - * [param position] is the offset from the body origin in global coordinates. - */ - static body_add_constant_force(body: RID, force: Vector2, position: Vector2 = Vector2.ZERO): void - - /** Adds a constant rotational force to the body. The force does not affect position. The force remains applied over time until cleared with `PhysicsServer2D.body_set_constant_torque(body, 0)`. */ - static body_add_constant_torque(body: RID, torque: float64): void - - /** Sets the body's total constant positional force applied during each physics update. - * See [method body_add_constant_force] and [method body_add_constant_central_force]. - */ - static body_set_constant_force(body: RID, force: Vector2): void - - /** Returns the body's total constant positional force applied during each physics update. - * See [method body_add_constant_force] and [method body_add_constant_central_force]. - */ - static body_get_constant_force(body: RID): Vector2 - - /** Sets the body's total constant rotational force applied during each physics update. - * See [method body_add_constant_torque]. - */ - static body_set_constant_torque(body: RID, torque: float64): void - - /** Returns the body's total constant rotational force applied during each physics update. - * See [method body_add_constant_torque]. - */ - static body_get_constant_torque(body: RID): float64 - - /** Modifies the body's linear velocity so that its projection to the axis `axis_velocity.normalized()` is exactly `axis_velocity.length()`. This is useful for jumping behavior. */ - static body_set_axis_velocity(body: RID, axis_velocity: Vector2): void - - /** Adds [param excepted_body] to the body's list of collision exceptions, so that collisions with it are ignored. */ - static body_add_collision_exception(body: RID, excepted_body: RID): void - - /** Removes [param excepted_body] from the body's list of collision exceptions, so that collisions with it are no longer ignored. */ - static body_remove_collision_exception(body: RID, excepted_body: RID): void - - /** Sets the maximum number of contacts that the body can report. If [param amount] is greater than zero, then the body will keep track of at most this many contacts with other bodies. */ - static body_set_max_contacts_reported(body: RID, amount: int64): void - - /** Returns the maximum number of contacts that the body can report. See [method body_set_max_contacts_reported]. */ - static body_get_max_contacts_reported(body: RID): int64 - - /** Sets whether the body omits the standard force integration. If [param enable] is `true`, the body will not automatically use applied forces, torques, and damping to update the body's linear and angular velocity. In this case, [method body_set_force_integration_callback] can be used to manually update the linear and angular velocity instead. - * This method is called when the property [member RigidBody2D.custom_integrator] is set. - */ - static body_set_omit_force_integration(body: RID, enable: boolean): void - - /** Returns `true` if the body is omitting the standard force integration. See [method body_set_omit_force_integration]. */ - static body_is_omitting_force_integration(body: RID): boolean - - /** Sets the body's state synchronization callback function to [param callable]. Use an empty [Callable] ([code skip-lint]Callable()`) to clear the callback. - * The function [param callable] will be called every physics frame, assuming that the body was active during the previous physics tick, and can be used to fetch the latest state from the physics server. - * The function [param callable] must take the following parameters: - * 1. `state`: a [PhysicsDirectBodyState2D], used to retrieve the body's state. - */ - static body_set_state_sync_callback(body: RID, callable: Callable): void - - /** Sets the body's custom force integration callback function to [param callable]. Use an empty [Callable] ([code skip-lint]Callable()`) to clear the custom callback. - * The function [param callable] will be called every physics tick, before the standard force integration (see [method body_set_omit_force_integration]). It can be used for example to update the body's linear and angular velocity based on contact with other bodies. - * If [param userdata] is not `null`, the function [param callable] must take the following two parameters: - * 1. `state`: a [PhysicsDirectBodyState2D] used to retrieve and modify the body's state, - * 2. [code skip-lint]userdata`: a [Variant]; its value will be the [param userdata] passed into this method. - * If [param userdata] is `null`, then [param callable] must take only the `state` parameter. - */ - static body_set_force_integration_callback(body: RID, callable: Callable, userdata: any = {}): void - - /** Returns `true` if a collision would result from moving the body along a motion vector from a given point in space. See [PhysicsTestMotionParameters2D] for the available motion parameters. Optionally a [PhysicsTestMotionResult2D] object can be passed, which will be used to store the information about the resulting collision. */ - static body_test_motion(body: RID, parameters: PhysicsTestMotionParameters2D, result: PhysicsTestMotionResult2D = undefined): boolean - - /** Returns the [PhysicsDirectBodyState2D] of the body. Returns `null` if the body is destroyed or not assigned to a space. */ - static body_get_direct_state(body: RID): PhysicsDirectBodyState2D - - /** Creates a 2D joint in the physics server, and returns the [RID] that identifies it. To set the joint type, use [method joint_make_damped_spring], [method joint_make_groove] or [method joint_make_pin]. Use [method joint_set_param] to set generic joint parameters. */ - static joint_create(): RID - - /** Destroys the joint with the given [RID], creates a new uninitialized joint, and makes the [RID] refer to this new joint. */ - static joint_clear(joint: RID): void - - /** Sets the value of the given joint parameter. See [enum JointParam] for the list of available parameters. */ - static joint_set_param(joint: RID, param: PhysicsServer2D.JointParam, value: float64): void - - /** Returns the value of the given joint parameter. See [enum JointParam] for the list of available parameters. */ - static joint_get_param(joint: RID, param: PhysicsServer2D.JointParam): float64 - - /** Sets whether the bodies attached to the [Joint2D] will collide with each other. */ - static joint_disable_collisions_between_bodies(joint: RID, disable: boolean): void - - /** Returns whether the bodies attached to the [Joint2D] will collide with each other. */ - static joint_is_disabled_collisions_between_bodies(joint: RID): boolean - - /** Makes the joint a pin joint. If [param body_b] is an empty [RID], then [param body_a] is pinned to the point [param anchor] (given in global coordinates); otherwise, [param body_a] is pinned to [param body_b] at the point [param anchor] (given in global coordinates). To set the parameters which are specific to the pin joint, see [method pin_joint_set_param]. */ - static joint_make_pin(joint: RID, anchor: Vector2, body_a: RID, body_b: RID = new RID()): void - - /** Makes the joint a groove joint. */ - static joint_make_groove(joint: RID, groove1_a: Vector2, groove2_a: Vector2, anchor_b: Vector2, body_a: RID = new RID(), body_b: RID = new RID()): void - - /** Makes the joint a damped spring joint, attached at the point [param anchor_a] (given in global coordinates) on the body [param body_a] and at the point [param anchor_b] (given in global coordinates) on the body [param body_b]. To set the parameters which are specific to the damped spring, see [method damped_spring_joint_set_param]. */ - static joint_make_damped_spring(joint: RID, anchor_a: Vector2, anchor_b: Vector2, body_a: RID, body_b: RID = new RID()): void - - /** Sets a pin joint flag (see [enum PinJointFlag] constants). */ - static pin_joint_set_flag(joint: RID, flag: PhysicsServer2D.PinJointFlag, enabled: boolean): void - - /** Gets a pin joint flag (see [enum PinJointFlag] constants). */ - static pin_joint_get_flag(joint: RID, flag: PhysicsServer2D.PinJointFlag): boolean - - /** Sets a pin joint parameter. See [enum PinJointParam] for a list of available parameters. */ - static pin_joint_set_param(joint: RID, param: PhysicsServer2D.PinJointParam, value: float64): void - - /** Returns the value of a pin joint parameter. See [enum PinJointParam] for a list of available parameters. */ - static pin_joint_get_param(joint: RID, param: PhysicsServer2D.PinJointParam): float64 - - /** Sets the value of the given damped spring joint parameter. See [enum DampedSpringParam] for the list of available parameters. */ - static damped_spring_joint_set_param(joint: RID, param: PhysicsServer2D.DampedSpringParam, value: float64): void - - /** Returns the value of the given damped spring joint parameter. See [enum DampedSpringParam] for the list of available parameters. */ - static damped_spring_joint_get_param(joint: RID, param: PhysicsServer2D.DampedSpringParam): float64 - - /** Returns the joint's type (see [enum JointType]). */ - static joint_get_type(joint: RID): PhysicsServer2D.JointType - - /** Destroys any of the objects created by PhysicsServer2D. If the [RID] passed is not one of the objects that can be created by PhysicsServer2D, an error will be printed to the console. */ - static free_rid(rid: RID): void - - /** Activates or deactivates the 2D physics server. If [param active] is `false`, then the physics server will not do anything in its physics step. */ - static set_active(active: boolean): void - - /** Returns information about the current state of the 2D physics engine. See [enum ProcessInfo] for the list of available states. */ - static get_process_info(process_info: PhysicsServer2D.ProcessInfo): int64 - } - // _singleton_class_: PhysicsServer3D - namespace PhysicsServer3D { - enum JointType { - /** The [Joint3D] is a [PinJoint3D]. */ - JOINT_TYPE_PIN = 0, - - /** The [Joint3D] is a [HingeJoint3D]. */ - JOINT_TYPE_HINGE = 1, - - /** The [Joint3D] is a [SliderJoint3D]. */ - JOINT_TYPE_SLIDER = 2, - - /** The [Joint3D] is a [ConeTwistJoint3D]. */ - JOINT_TYPE_CONE_TWIST = 3, - - /** The [Joint3D] is a [Generic6DOFJoint3D]. */ - JOINT_TYPE_6DOF = 4, - - /** Represents the size of the [enum JointType] enum. */ - JOINT_TYPE_MAX = 5, - } - enum PinJointParam { - /** The strength with which the pinned objects try to stay in positional relation to each other. - * The higher, the stronger. - */ - PIN_JOINT_BIAS = 0, - - /** The strength with which the pinned objects try to stay in velocity relation to each other. - * The higher, the stronger. - */ - PIN_JOINT_DAMPING = 1, - - /** If above 0, this value is the maximum value for an impulse that this Joint3D puts on its ends. */ - PIN_JOINT_IMPULSE_CLAMP = 2, - } - enum HingeJointParam { - /** The speed with which the two bodies get pulled together when they move in different directions. */ - HINGE_JOINT_BIAS = 0, - - /** The maximum rotation across the Hinge. */ - HINGE_JOINT_LIMIT_UPPER = 1, - - /** The minimum rotation across the Hinge. */ - HINGE_JOINT_LIMIT_LOWER = 2, - - /** The speed with which the rotation across the axis perpendicular to the hinge gets corrected. */ - HINGE_JOINT_LIMIT_BIAS = 3, - HINGE_JOINT_LIMIT_SOFTNESS = 4, - - /** The lower this value, the more the rotation gets slowed down. */ - HINGE_JOINT_LIMIT_RELAXATION = 5, - - /** Target speed for the motor. */ - HINGE_JOINT_MOTOR_TARGET_VELOCITY = 6, - - /** Maximum acceleration for the motor. */ - HINGE_JOINT_MOTOR_MAX_IMPULSE = 7, - } - enum HingeJointFlag { - /** If `true`, the Hinge has a maximum and a minimum rotation. */ - HINGE_JOINT_FLAG_USE_LIMIT = 0, - - /** If `true`, a motor turns the Hinge. */ - HINGE_JOINT_FLAG_ENABLE_MOTOR = 1, - } - enum SliderJointParam { - /** The maximum difference between the pivot points on their X axis before damping happens. */ - SLIDER_JOINT_LINEAR_LIMIT_UPPER = 0, - - /** The minimum difference between the pivot points on their X axis before damping happens. */ - SLIDER_JOINT_LINEAR_LIMIT_LOWER = 1, - - /** A factor applied to the movement across the slider axis once the limits get surpassed. The lower, the slower the movement. */ - SLIDER_JOINT_LINEAR_LIMIT_SOFTNESS = 2, - - /** The amount of restitution once the limits are surpassed. The lower, the more velocity-energy gets lost. */ - SLIDER_JOINT_LINEAR_LIMIT_RESTITUTION = 3, - - /** The amount of damping once the slider limits are surpassed. */ - SLIDER_JOINT_LINEAR_LIMIT_DAMPING = 4, - - /** A factor applied to the movement across the slider axis as long as the slider is in the limits. The lower, the slower the movement. */ - SLIDER_JOINT_LINEAR_MOTION_SOFTNESS = 5, - - /** The amount of restitution inside the slider limits. */ - SLIDER_JOINT_LINEAR_MOTION_RESTITUTION = 6, - - /** The amount of damping inside the slider limits. */ - SLIDER_JOINT_LINEAR_MOTION_DAMPING = 7, - - /** A factor applied to the movement across axes orthogonal to the slider. */ - SLIDER_JOINT_LINEAR_ORTHOGONAL_SOFTNESS = 8, - - /** The amount of restitution when movement is across axes orthogonal to the slider. */ - SLIDER_JOINT_LINEAR_ORTHOGONAL_RESTITUTION = 9, - - /** The amount of damping when movement is across axes orthogonal to the slider. */ - SLIDER_JOINT_LINEAR_ORTHOGONAL_DAMPING = 10, - - /** The upper limit of rotation in the slider. */ - SLIDER_JOINT_ANGULAR_LIMIT_UPPER = 11, - - /** The lower limit of rotation in the slider. */ - SLIDER_JOINT_ANGULAR_LIMIT_LOWER = 12, - - /** A factor applied to the all rotation once the limit is surpassed. */ - SLIDER_JOINT_ANGULAR_LIMIT_SOFTNESS = 13, - - /** The amount of restitution of the rotation when the limit is surpassed. */ - SLIDER_JOINT_ANGULAR_LIMIT_RESTITUTION = 14, - - /** The amount of damping of the rotation when the limit is surpassed. */ - SLIDER_JOINT_ANGULAR_LIMIT_DAMPING = 15, - - /** A factor that gets applied to the all rotation in the limits. */ - SLIDER_JOINT_ANGULAR_MOTION_SOFTNESS = 16, - - /** The amount of restitution of the rotation in the limits. */ - SLIDER_JOINT_ANGULAR_MOTION_RESTITUTION = 17, - - /** The amount of damping of the rotation in the limits. */ - SLIDER_JOINT_ANGULAR_MOTION_DAMPING = 18, - - /** A factor that gets applied to the all rotation across axes orthogonal to the slider. */ - SLIDER_JOINT_ANGULAR_ORTHOGONAL_SOFTNESS = 19, - - /** The amount of restitution of the rotation across axes orthogonal to the slider. */ - SLIDER_JOINT_ANGULAR_ORTHOGONAL_RESTITUTION = 20, - - /** The amount of damping of the rotation across axes orthogonal to the slider. */ - SLIDER_JOINT_ANGULAR_ORTHOGONAL_DAMPING = 21, - - /** Represents the size of the [enum SliderJointParam] enum. */ - SLIDER_JOINT_MAX = 22, - } - enum ConeTwistJointParam { - /** Swing is rotation from side to side, around the axis perpendicular to the twist axis. - * The swing span defines, how much rotation will not get corrected along the swing axis. - * Could be defined as looseness in the [ConeTwistJoint3D]. - * If below 0.05, this behavior is locked. - */ - CONE_TWIST_JOINT_SWING_SPAN = 0, - - /** Twist is the rotation around the twist axis, this value defined how far the joint can twist. - * Twist is locked if below 0.05. - */ - CONE_TWIST_JOINT_TWIST_SPAN = 1, - - /** The speed with which the swing or twist will take place. - * The higher, the faster. - */ - CONE_TWIST_JOINT_BIAS = 2, - - /** The ease with which the Joint3D twists, if it's too low, it takes more force to twist the joint. */ - CONE_TWIST_JOINT_SOFTNESS = 3, - - /** Defines, how fast the swing- and twist-speed-difference on both sides gets synced. */ - CONE_TWIST_JOINT_RELAXATION = 4, - } - enum G6DOFJointAxisParam { - /** The minimum difference between the pivot points' axes. */ - G6DOF_JOINT_LINEAR_LOWER_LIMIT = 0, - - /** The maximum difference between the pivot points' axes. */ - G6DOF_JOINT_LINEAR_UPPER_LIMIT = 1, - - /** A factor that gets applied to the movement across the axes. The lower, the slower the movement. */ - G6DOF_JOINT_LINEAR_LIMIT_SOFTNESS = 2, - - /** The amount of restitution on the axes movement. The lower, the more velocity-energy gets lost. */ - G6DOF_JOINT_LINEAR_RESTITUTION = 3, - - /** The amount of damping that happens at the linear motion across the axes. */ - G6DOF_JOINT_LINEAR_DAMPING = 4, - - /** The velocity that the joint's linear motor will attempt to reach. */ - G6DOF_JOINT_LINEAR_MOTOR_TARGET_VELOCITY = 5, - - /** The maximum force that the linear motor can apply while trying to reach the target velocity. */ - G6DOF_JOINT_LINEAR_MOTOR_FORCE_LIMIT = 6, - G6DOF_JOINT_LINEAR_SPRING_STIFFNESS = 7, - G6DOF_JOINT_LINEAR_SPRING_DAMPING = 8, - G6DOF_JOINT_LINEAR_SPRING_EQUILIBRIUM_POINT = 9, - - /** The minimum rotation in negative direction to break loose and rotate around the axes. */ - G6DOF_JOINT_ANGULAR_LOWER_LIMIT = 10, - - /** The minimum rotation in positive direction to break loose and rotate around the axes. */ - G6DOF_JOINT_ANGULAR_UPPER_LIMIT = 11, - - /** A factor that gets multiplied onto all rotations across the axes. */ - G6DOF_JOINT_ANGULAR_LIMIT_SOFTNESS = 12, - - /** The amount of rotational damping across the axes. The lower, the more damping occurs. */ - G6DOF_JOINT_ANGULAR_DAMPING = 13, - - /** The amount of rotational restitution across the axes. The lower, the more restitution occurs. */ - G6DOF_JOINT_ANGULAR_RESTITUTION = 14, - - /** The maximum amount of force that can occur, when rotating around the axes. */ - G6DOF_JOINT_ANGULAR_FORCE_LIMIT = 15, - - /** When correcting the crossing of limits in rotation across the axes, this error tolerance factor defines how much the correction gets slowed down. The lower, the slower. */ - G6DOF_JOINT_ANGULAR_ERP = 16, - - /** Target speed for the motor at the axes. */ - G6DOF_JOINT_ANGULAR_MOTOR_TARGET_VELOCITY = 17, - - /** Maximum acceleration for the motor at the axes. */ - G6DOF_JOINT_ANGULAR_MOTOR_FORCE_LIMIT = 18, - G6DOF_JOINT_ANGULAR_SPRING_STIFFNESS = 19, - G6DOF_JOINT_ANGULAR_SPRING_DAMPING = 20, - G6DOF_JOINT_ANGULAR_SPRING_EQUILIBRIUM_POINT = 21, - - /** Represents the size of the [enum G6DOFJointAxisParam] enum. */ - G6DOF_JOINT_MAX = 22, - } - enum G6DOFJointAxisFlag { - /** If set, linear motion is possible within the given limits. */ - G6DOF_JOINT_FLAG_ENABLE_LINEAR_LIMIT = 0, - - /** If set, rotational motion is possible. */ - G6DOF_JOINT_FLAG_ENABLE_ANGULAR_LIMIT = 1, - G6DOF_JOINT_FLAG_ENABLE_ANGULAR_SPRING = 2, - G6DOF_JOINT_FLAG_ENABLE_LINEAR_SPRING = 3, - - /** If set, there is a rotational motor across these axes. */ - G6DOF_JOINT_FLAG_ENABLE_MOTOR = 4, - - /** If set, there is a linear motor on this axis that targets a specific velocity. */ - G6DOF_JOINT_FLAG_ENABLE_LINEAR_MOTOR = 5, - - /** Represents the size of the [enum G6DOFJointAxisFlag] enum. */ - G6DOF_JOINT_FLAG_MAX = 6, - } - enum ShapeType { - /** The [Shape3D] is a [WorldBoundaryShape3D]. */ - SHAPE_WORLD_BOUNDARY = 0, - - /** The [Shape3D] is a [SeparationRayShape3D]. */ - SHAPE_SEPARATION_RAY = 1, - - /** The [Shape3D] is a [SphereShape3D]. */ - SHAPE_SPHERE = 2, - - /** The [Shape3D] is a [BoxShape3D]. */ - SHAPE_BOX = 3, - - /** The [Shape3D] is a [CapsuleShape3D]. */ - SHAPE_CAPSULE = 4, - - /** The [Shape3D] is a [CylinderShape3D]. */ - SHAPE_CYLINDER = 5, - - /** The [Shape3D] is a [ConvexPolygonShape3D]. */ - SHAPE_CONVEX_POLYGON = 6, - - /** The [Shape3D] is a [ConcavePolygonShape3D]. */ - SHAPE_CONCAVE_POLYGON = 7, - - /** The [Shape3D] is a [HeightMapShape3D]. */ - SHAPE_HEIGHTMAP = 8, - - /** The [Shape3D] is used internally for a soft body. Any attempt to create this kind of shape results in an error. */ - SHAPE_SOFT_BODY = 9, - - /** This constant is used internally by the engine. Any attempt to create this kind of shape results in an error. */ - SHAPE_CUSTOM = 10, - } - enum AreaParameter { - /** Constant to set/get gravity override mode in an area. See [enum AreaSpaceOverrideMode] for possible values. */ - AREA_PARAM_GRAVITY_OVERRIDE_MODE = 0, - - /** Constant to set/get gravity strength in an area. */ - AREA_PARAM_GRAVITY = 1, - - /** Constant to set/get gravity vector/center in an area. */ - AREA_PARAM_GRAVITY_VECTOR = 2, - - /** Constant to set/get whether the gravity vector of an area is a direction, or a center point. */ - AREA_PARAM_GRAVITY_IS_POINT = 3, - - /** Constant to set/get the distance at which the gravity strength is equal to the gravity controlled by [constant AREA_PARAM_GRAVITY]. For example, on a planet 100 meters in radius with a surface gravity of 4.0 m/s², set the gravity to 4.0 and the unit distance to 100.0. The gravity will have falloff according to the inverse square law, so in the example, at 200 meters from the center the gravity will be 1.0 m/s² (twice the distance, 1/4th the gravity), at 50 meters it will be 16.0 m/s² (half the distance, 4x the gravity), and so on. - * The above is true only when the unit distance is a positive number. When this is set to 0.0, the gravity will be constant regardless of distance. - */ - AREA_PARAM_GRAVITY_POINT_UNIT_DISTANCE = 4, - - /** Constant to set/get linear damping override mode in an area. See [enum AreaSpaceOverrideMode] for possible values. */ - AREA_PARAM_LINEAR_DAMP_OVERRIDE_MODE = 5, - - /** Constant to set/get the linear damping factor of an area. */ - AREA_PARAM_LINEAR_DAMP = 6, - - /** Constant to set/get angular damping override mode in an area. See [enum AreaSpaceOverrideMode] for possible values. */ - AREA_PARAM_ANGULAR_DAMP_OVERRIDE_MODE = 7, - - /** Constant to set/get the angular damping factor of an area. */ - AREA_PARAM_ANGULAR_DAMP = 8, - - /** Constant to set/get the priority (order of processing) of an area. */ - AREA_PARAM_PRIORITY = 9, - - /** Constant to set/get the magnitude of area-specific wind force. This wind force only applies to [SoftBody3D] nodes. Other physics bodies are currently not affected by wind. */ - AREA_PARAM_WIND_FORCE_MAGNITUDE = 10, - - /** Constant to set/get the 3D vector that specifies the origin from which an area-specific wind blows. */ - AREA_PARAM_WIND_SOURCE = 11, - - /** Constant to set/get the 3D vector that specifies the direction in which an area-specific wind blows. */ - AREA_PARAM_WIND_DIRECTION = 12, - - /** Constant to set/get the exponential rate at which wind force decreases with distance from its origin. */ - AREA_PARAM_WIND_ATTENUATION_FACTOR = 13, - } - enum AreaSpaceOverrideMode { - /** This area does not affect gravity/damp. These are generally areas that exist only to detect collisions, and objects entering or exiting them. */ - AREA_SPACE_OVERRIDE_DISABLED = 0, - - /** This area adds its gravity/damp values to whatever has been calculated so far. This way, many overlapping areas can combine their physics to make interesting effects. */ - AREA_SPACE_OVERRIDE_COMBINE = 1, - - /** This area adds its gravity/damp values to whatever has been calculated so far. Then stops taking into account the rest of the areas, even the default one. */ - AREA_SPACE_OVERRIDE_COMBINE_REPLACE = 2, - - /** This area replaces any gravity/damp, even the default one, and stops taking into account the rest of the areas. */ - AREA_SPACE_OVERRIDE_REPLACE = 3, - - /** This area replaces any gravity/damp calculated so far, but keeps calculating the rest of the areas, down to the default one. */ - AREA_SPACE_OVERRIDE_REPLACE_COMBINE = 4, - } - enum BodyMode { - /** Constant for static bodies. In this mode, a body can be only moved by user code and doesn't collide with other bodies along its path when moved. */ - BODY_MODE_STATIC = 0, - - /** Constant for kinematic bodies. In this mode, a body can be only moved by user code and collides with other bodies along its path. */ - BODY_MODE_KINEMATIC = 1, - - /** Constant for rigid bodies. In this mode, a body can be pushed by other bodies and has forces applied. */ - BODY_MODE_RIGID = 2, - - /** Constant for linear rigid bodies. In this mode, a body can not rotate, and only its linear velocity is affected by external forces. */ - BODY_MODE_RIGID_LINEAR = 3, - } - enum BodyParameter { - /** Constant to set/get a body's bounce factor. */ - BODY_PARAM_BOUNCE = 0, - - /** Constant to set/get a body's friction. */ - BODY_PARAM_FRICTION = 1, - - /** Constant to set/get a body's mass. */ - BODY_PARAM_MASS = 2, - - /** Constant to set/get a body's inertia. */ - BODY_PARAM_INERTIA = 3, - - /** Constant to set/get a body's center of mass position in the body's local coordinate system. */ - BODY_PARAM_CENTER_OF_MASS = 4, - - /** Constant to set/get a body's gravity multiplier. */ - BODY_PARAM_GRAVITY_SCALE = 5, - - /** Constant to set/get a body's linear damping mode. See [enum BodyDampMode] for possible values. */ - BODY_PARAM_LINEAR_DAMP_MODE = 6, - - /** Constant to set/get a body's angular damping mode. See [enum BodyDampMode] for possible values. */ - BODY_PARAM_ANGULAR_DAMP_MODE = 7, - - /** Constant to set/get a body's linear damping factor. */ - BODY_PARAM_LINEAR_DAMP = 8, - - /** Constant to set/get a body's angular damping factor. */ - BODY_PARAM_ANGULAR_DAMP = 9, - - /** Represents the size of the [enum BodyParameter] enum. */ - BODY_PARAM_MAX = 10, - } - enum BodyDampMode { - /** The body's damping value is added to any value set in areas or the default value. */ - BODY_DAMP_MODE_COMBINE = 0, - - /** The body's damping value replaces any value set in areas or the default value. */ - BODY_DAMP_MODE_REPLACE = 1, - } - enum BodyState { - /** Constant to set/get the current transform matrix of the body. */ - BODY_STATE_TRANSFORM = 0, - - /** Constant to set/get the current linear velocity of the body. */ - BODY_STATE_LINEAR_VELOCITY = 1, - - /** Constant to set/get the current angular velocity of the body. */ - BODY_STATE_ANGULAR_VELOCITY = 2, - - /** Constant to sleep/wake up a body, or to get whether it is sleeping. */ - BODY_STATE_SLEEPING = 3, - - /** Constant to set/get whether the body can sleep. */ - BODY_STATE_CAN_SLEEP = 4, - } - enum AreaBodyStatus { - /** The value of the first parameter and area callback function receives, when an object enters one of its shapes. */ - AREA_BODY_ADDED = 0, - - /** The value of the first parameter and area callback function receives, when an object exits one of its shapes. */ - AREA_BODY_REMOVED = 1, - } - enum ProcessInfo { - /** Constant to get the number of objects that are not sleeping. */ - INFO_ACTIVE_OBJECTS = 0, - - /** Constant to get the number of possible collisions. */ - INFO_COLLISION_PAIRS = 1, - - /** Constant to get the number of space regions where a collision could occur. */ - INFO_ISLAND_COUNT = 2, - } - enum SpaceParameter { - /** Constant to set/get the maximum distance a pair of bodies has to move before their collision status has to be recalculated. */ - SPACE_PARAM_CONTACT_RECYCLE_RADIUS = 0, - - /** Constant to set/get the maximum distance a shape can be from another before they are considered separated and the contact is discarded. */ - SPACE_PARAM_CONTACT_MAX_SEPARATION = 1, - - /** Constant to set/get the maximum distance a shape can penetrate another shape before it is considered a collision. */ - SPACE_PARAM_CONTACT_MAX_ALLOWED_PENETRATION = 2, - - /** Constant to set/get the default solver bias for all physics contacts. A solver bias is a factor controlling how much two objects "rebound", after overlapping, to avoid leaving them in that state because of numerical imprecision. */ - SPACE_PARAM_CONTACT_DEFAULT_BIAS = 3, - - /** Constant to set/get the threshold linear velocity of activity. A body marked as potentially inactive for both linear and angular velocity will be put to sleep after the time given. */ - SPACE_PARAM_BODY_LINEAR_VELOCITY_SLEEP_THRESHOLD = 4, - - /** Constant to set/get the threshold angular velocity of activity. A body marked as potentially inactive for both linear and angular velocity will be put to sleep after the time given. */ - SPACE_PARAM_BODY_ANGULAR_VELOCITY_SLEEP_THRESHOLD = 5, - - /** Constant to set/get the maximum time of activity. A body marked as potentially inactive for both linear and angular velocity will be put to sleep after this time. */ - SPACE_PARAM_BODY_TIME_TO_SLEEP = 6, - - /** Constant to set/get the number of solver iterations for contacts and constraints. The greater the number of iterations, the more accurate the collisions and constraints will be. However, a greater number of iterations requires more CPU power, which can decrease performance. */ - SPACE_PARAM_SOLVER_ITERATIONS = 7, - } - enum BodyAxis { - BODY_AXIS_LINEAR_X = 1, - BODY_AXIS_LINEAR_Y = 2, - BODY_AXIS_LINEAR_Z = 4, - BODY_AXIS_ANGULAR_X = 8, - BODY_AXIS_ANGULAR_Y = 16, - BODY_AXIS_ANGULAR_Z = 32, - } - } - /** A server interface for low-level 3D physics access. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_physicsserver3d.html - */ - class PhysicsServer3D extends Object { - static world_boundary_shape_create(): RID - static separation_ray_shape_create(): RID - static sphere_shape_create(): RID - static box_shape_create(): RID - static capsule_shape_create(): RID - static cylinder_shape_create(): RID - static convex_polygon_shape_create(): RID - static concave_polygon_shape_create(): RID - static heightmap_shape_create(): RID - static custom_shape_create(): RID - - /** Sets the shape data that defines its shape and size. The data to be passed depends on the kind of shape created [method shape_get_type]. */ - static shape_set_data(shape: RID, data: any): void - - /** Sets the collision margin for the shape. - * - * **Note:** This is not used in Godot Physics. - */ - static shape_set_margin(shape: RID, margin: float64): void - - /** Returns the type of shape (see [enum ShapeType] constants). */ - static shape_get_type(shape: RID): PhysicsServer3D.ShapeType - - /** Returns the shape data. */ - static shape_get_data(shape: RID): any - - /** Returns the collision margin for the shape. - * - * **Note:** This is not used in Godot Physics, so will always return `0`. - */ - static shape_get_margin(shape: RID): float64 - - /** Creates a space. A space is a collection of parameters for the physics engine that can be assigned to an area or a body. It can be assigned to an area with [method area_set_space], or to a body with [method body_set_space]. */ - static space_create(): RID - - /** Marks a space as active. It will not have an effect, unless it is assigned to an area or body. */ - static space_set_active(space: RID, active: boolean): void - - /** Returns whether the space is active. */ - static space_is_active(space: RID): boolean - - /** Sets the value for a space parameter. A list of available parameters is on the [enum SpaceParameter] constants. */ - static space_set_param(space: RID, param: PhysicsServer3D.SpaceParameter, value: float64): void - - /** Returns the value of a space parameter. */ - static space_get_param(space: RID, param: PhysicsServer3D.SpaceParameter): float64 - - /** Returns the state of a space, a [PhysicsDirectSpaceState3D]. This object can be used to make collision/intersection queries. */ - static space_get_direct_state(space: RID): PhysicsDirectSpaceState3D - - /** Creates a 3D area object in the physics server, and returns the [RID] that identifies it. The default settings for the created area include a collision layer and mask set to `1`, and `monitorable` set to `false`. - * Use [method area_add_shape] to add shapes to it, use [method area_set_transform] to set its transform, and use [method area_set_space] to add the area to a space. If you want the area to be detectable use [method area_set_monitorable]. - */ - static area_create(): RID - - /** Assigns a space to the area. */ - static area_set_space(area: RID, space: RID): void - - /** Returns the space assigned to the area. */ - static area_get_space(area: RID): RID - - /** Adds a shape to the area, along with a transform matrix. Shapes are usually referenced by their index, so you should track which shape has a given index. */ - static area_add_shape(area: RID, shape: RID, transform: Transform3D = new Transform3D(), disabled: boolean = false): void - - /** Substitutes a given area shape by another. The old shape is selected by its index, the new one by its [RID]. */ - static area_set_shape(area: RID, shape_idx: int64, shape: RID): void - - /** Sets the transform matrix for an area shape. */ - static area_set_shape_transform(area: RID, shape_idx: int64, transform: Transform3D): void - static area_set_shape_disabled(area: RID, shape_idx: int64, disabled: boolean): void - - /** Returns the number of shapes assigned to an area. */ - static area_get_shape_count(area: RID): int64 - - /** Returns the [RID] of the nth shape of an area. */ - static area_get_shape(area: RID, shape_idx: int64): RID - - /** Returns the transform matrix of a shape within an area. */ - static area_get_shape_transform(area: RID, shape_idx: int64): Transform3D - - /** Removes a shape from an area. It does not delete the shape, so it can be reassigned later. */ - static area_remove_shape(area: RID, shape_idx: int64): void - - /** Removes all shapes from an area. It does not delete the shapes, so they can be reassigned later. */ - static area_clear_shapes(area: RID): void - - /** Assigns the area to one or many physics layers. */ - static area_set_collision_layer(area: RID, layer: int64): void - - /** Returns the physics layer or layers an area belongs to. */ - static area_get_collision_layer(area: RID): int64 - - /** Sets which physics layers the area will monitor. */ - static area_set_collision_mask(area: RID, mask: int64): void - - /** Returns the physics layer or layers an area can contact with. */ - static area_get_collision_mask(area: RID): int64 - - /** Sets the value for an area parameter. A list of available parameters is on the [enum AreaParameter] constants. */ - static area_set_param(area: RID, param: PhysicsServer3D.AreaParameter, value: any): void - - /** Sets the transform matrix for an area. */ - static area_set_transform(area: RID, transform: Transform3D): void - - /** Returns an area parameter value. A list of available parameters is on the [enum AreaParameter] constants. */ - static area_get_param(area: RID, param: PhysicsServer3D.AreaParameter): any - - /** Returns the transform matrix for an area. */ - static area_get_transform(area: RID): Transform3D - - /** Assigns the area to a descendant of [Object], so it can exist in the node tree. */ - static area_attach_object_instance_id(area: RID, id: int64): void - - /** Gets the instance ID of the object the area is assigned to. */ - static area_get_object_instance_id(area: RID): int64 - - /** Sets the area's body monitor callback. This callback will be called when any other (shape of a) body enters or exits (a shape of) the given area, and must take the following five parameters: - * 1. an integer `status`: either [constant AREA_BODY_ADDED] or [constant AREA_BODY_REMOVED] depending on whether the other body shape entered or exited the area, - * 2. an [RID] `body_rid`: the [RID] of the body that entered or exited the area, - * 3. an integer `instance_id`: the `ObjectID` attached to the body, - * 4. an integer `body_shape_idx`: the index of the shape of the body that entered or exited the area, - * 5. an integer `self_shape_idx`: the index of the shape of the area where the body entered or exited. - * By counting (or keeping track of) the shapes that enter and exit, it can be determined if a body (with all its shapes) is entering for the first time or exiting for the last time. - */ - static area_set_monitor_callback(area: RID, callback: Callable): void - - /** Sets the area's area monitor callback. This callback will be called when any other (shape of an) area enters or exits (a shape of) the given area, and must take the following five parameters: - * 1. an integer `status`: either [constant AREA_BODY_ADDED] or [constant AREA_BODY_REMOVED] depending on whether the other area's shape entered or exited the area, - * 2. an [RID] `area_rid`: the [RID] of the other area that entered or exited the area, - * 3. an integer `instance_id`: the `ObjectID` attached to the other area, - * 4. an integer `area_shape_idx`: the index of the shape of the other area that entered or exited the area, - * 5. an integer `self_shape_idx`: the index of the shape of the area where the other area entered or exited. - * By counting (or keeping track of) the shapes that enter and exit, it can be determined if an area (with all its shapes) is entering for the first time or exiting for the last time. - */ - static area_set_area_monitor_callback(area: RID, callback: Callable): void - static area_set_monitorable(area: RID, monitorable: boolean): void - - /** Sets object pickable with rays. */ - static area_set_ray_pickable(area: RID, enable: boolean): void - - /** Creates a 3D body object in the physics server, and returns the [RID] that identifies it. The default settings for the created area include a collision layer and mask set to `1`, and body mode set to [constant BODY_MODE_RIGID]. - * Use [method body_add_shape] to add shapes to it, use [method body_set_state] to set its transform, and use [method body_set_space] to add the body to a space. - */ - static body_create(): RID - - /** Assigns a space to the body (see [method space_create]). */ - static body_set_space(body: RID, space: RID): void - - /** Returns the [RID] of the space assigned to a body. */ - static body_get_space(body: RID): RID - - /** Sets the body mode, from one of the [enum BodyMode] constants. */ - static body_set_mode(body: RID, mode: PhysicsServer3D.BodyMode): void - - /** Returns the body mode. */ - static body_get_mode(body: RID): PhysicsServer3D.BodyMode - - /** Sets the physics layer or layers a body belongs to. */ - static body_set_collision_layer(body: RID, layer: int64): void - - /** Returns the physics layer or layers a body belongs to. */ - static body_get_collision_layer(body: RID): int64 - - /** Sets the physics layer or layers a body can collide with. */ - static body_set_collision_mask(body: RID, mask: int64): void - - /** Returns the physics layer or layers a body can collide with. */ - static body_get_collision_mask(body: RID): int64 - - /** Sets the body's collision priority. */ - static body_set_collision_priority(body: RID, priority: float64): void - - /** Returns the body's collision priority. */ - static body_get_collision_priority(body: RID): float64 - - /** Adds a shape to the body, along with a transform matrix. Shapes are usually referenced by their index, so you should track which shape has a given index. */ - static body_add_shape(body: RID, shape: RID, transform: Transform3D = new Transform3D(), disabled: boolean = false): void - - /** Substitutes a given body shape by another. The old shape is selected by its index, the new one by its [RID]. */ - static body_set_shape(body: RID, shape_idx: int64, shape: RID): void - - /** Sets the transform matrix for a body shape. */ - static body_set_shape_transform(body: RID, shape_idx: int64, transform: Transform3D): void - static body_set_shape_disabled(body: RID, shape_idx: int64, disabled: boolean): void - - /** Returns the number of shapes assigned to a body. */ - static body_get_shape_count(body: RID): int64 - - /** Returns the [RID] of the nth shape of a body. */ - static body_get_shape(body: RID, shape_idx: int64): RID - - /** Returns the transform matrix of a body shape. */ - static body_get_shape_transform(body: RID, shape_idx: int64): Transform3D - - /** Removes a shape from a body. The shape is not deleted, so it can be reused afterwards. */ - static body_remove_shape(body: RID, shape_idx: int64): void - - /** Removes all shapes from a body. */ - static body_clear_shapes(body: RID): void - - /** Assigns the area to a descendant of [Object], so it can exist in the node tree. */ - static body_attach_object_instance_id(body: RID, id: int64): void - - /** Gets the instance ID of the object the area is assigned to. */ - static body_get_object_instance_id(body: RID): int64 - - /** If `true`, the continuous collision detection mode is enabled. - * Continuous collision detection tries to predict where a moving body will collide, instead of moving it and correcting its movement if it collided. - */ - static body_set_enable_continuous_collision_detection(body: RID, enable: boolean): void - - /** If `true`, the continuous collision detection mode is enabled. */ - static body_is_continuous_collision_detection_enabled(body: RID): boolean - - /** Sets a body parameter. A list of available parameters is on the [enum BodyParameter] constants. */ - static body_set_param(body: RID, param: PhysicsServer3D.BodyParameter, value: any): void - - /** Returns the value of a body parameter. A list of available parameters is on the [enum BodyParameter] constants. */ - static body_get_param(body: RID, param: PhysicsServer3D.BodyParameter): any - - /** Restores the default inertia and center of mass based on shapes to cancel any custom values previously set using [method body_set_param]. */ - static body_reset_mass_properties(body: RID): void - - /** Sets a body state (see [enum BodyState] constants). */ - static body_set_state(body: RID, state: PhysicsServer3D.BodyState, value: any): void - - /** Returns a body state. */ - static body_get_state(body: RID, state: PhysicsServer3D.BodyState): any - - /** Applies a directional impulse without affecting rotation. - * An impulse is time-independent! Applying an impulse every frame would result in a framerate-dependent force. For this reason, it should only be used when simulating one-time impacts (use the "_force" functions otherwise). - * This is equivalent to using [method body_apply_impulse] at the body's center of mass. - */ - static body_apply_central_impulse(body: RID, impulse: Vector3): void - - /** Applies a positioned impulse to the body. - * An impulse is time-independent! Applying an impulse every frame would result in a framerate-dependent force. For this reason, it should only be used when simulating one-time impacts (use the "_force" functions otherwise). - * [param position] is the offset from the body origin in global coordinates. - */ - static body_apply_impulse(body: RID, impulse: Vector3, position: Vector3 = new Vector3(0, 0, 0)): void - - /** Applies a rotational impulse to the body without affecting the position. - * An impulse is time-independent! Applying an impulse every frame would result in a framerate-dependent force. For this reason, it should only be used when simulating one-time impacts (use the "_force" functions otherwise). - */ - static body_apply_torque_impulse(body: RID, impulse: Vector3): void - - /** Applies a directional force without affecting rotation. A force is time dependent and meant to be applied every physics update. - * This is equivalent to using [method body_apply_force] at the body's center of mass. - */ - static body_apply_central_force(body: RID, force: Vector3): void - - /** Applies a positioned force to the body. A force is time dependent and meant to be applied every physics update. - * [param position] is the offset from the body origin in global coordinates. - */ - static body_apply_force(body: RID, force: Vector3, position: Vector3 = new Vector3(0, 0, 0)): void - - /** Applies a rotational force without affecting position. A force is time dependent and meant to be applied every physics update. */ - static body_apply_torque(body: RID, torque: Vector3): void - - /** Adds a constant directional force without affecting rotation that keeps being applied over time until cleared with `body_set_constant_force(body, Vector3(0, 0, 0))`. - * This is equivalent to using [method body_add_constant_force] at the body's center of mass. - */ - static body_add_constant_central_force(body: RID, force: Vector3): void - - /** Adds a constant positioned force to the body that keeps being applied over time until cleared with `body_set_constant_force(body, Vector3(0, 0, 0))`. - * [param position] is the offset from the body origin in global coordinates. - */ - static body_add_constant_force(body: RID, force: Vector3, position: Vector3 = new Vector3(0, 0, 0)): void - - /** Adds a constant rotational force without affecting position that keeps being applied over time until cleared with `body_set_constant_torque(body, Vector3(0, 0, 0))`. */ - static body_add_constant_torque(body: RID, torque: Vector3): void - - /** Sets the body's total constant positional forces applied during each physics update. - * See [method body_add_constant_force] and [method body_add_constant_central_force]. - */ - static body_set_constant_force(body: RID, force: Vector3): void - - /** Returns the body's total constant positional forces applied during each physics update. - * See [method body_add_constant_force] and [method body_add_constant_central_force]. - */ - static body_get_constant_force(body: RID): Vector3 - - /** Sets the body's total constant rotational forces applied during each physics update. - * See [method body_add_constant_torque]. - */ - static body_set_constant_torque(body: RID, torque: Vector3): void - - /** Returns the body's total constant rotational forces applied during each physics update. - * See [method body_add_constant_torque]. - */ - static body_get_constant_torque(body: RID): Vector3 - - /** Sets an axis velocity. The velocity in the given vector axis will be set as the given vector length. This is useful for jumping behavior. */ - static body_set_axis_velocity(body: RID, axis_velocity: Vector3): void - static body_set_axis_lock(body: RID, axis: PhysicsServer3D.BodyAxis, lock: boolean): void - static body_is_axis_locked(body: RID, axis: PhysicsServer3D.BodyAxis): boolean - - /** Adds a body to the list of bodies exempt from collisions. */ - static body_add_collision_exception(body: RID, excepted_body: RID): void - - /** Removes a body from the list of bodies exempt from collisions. - * Continuous collision detection tries to predict where a moving body will collide, instead of moving it and correcting its movement if it collided. - */ - static body_remove_collision_exception(body: RID, excepted_body: RID): void - - /** Sets the maximum contacts to report. Bodies can keep a log of the contacts with other bodies. This is enabled by setting the maximum number of contacts reported to a number greater than 0. */ - static body_set_max_contacts_reported(body: RID, amount: int64): void - - /** Returns the maximum contacts that can be reported. See [method body_set_max_contacts_reported]. */ - static body_get_max_contacts_reported(body: RID): int64 - - /** Sets whether the body omits the standard force integration. If [param enable] is `true`, the body will not automatically use applied forces, torques, and damping to update the body's linear and angular velocity. In this case, [method body_set_force_integration_callback] can be used to manually update the linear and angular velocity instead. - * This method is called when the property [member RigidBody3D.custom_integrator] is set. - */ - static body_set_omit_force_integration(body: RID, enable: boolean): void - - /** Returns `true` if the body is omitting the standard force integration. See [method body_set_omit_force_integration]. */ - static body_is_omitting_force_integration(body: RID): boolean - - /** Sets the body's state synchronization callback function to [param callable]. Use an empty [Callable] ([code skip-lint]Callable()`) to clear the callback. - * The function [param callable] will be called every physics frame, assuming that the body was active during the previous physics tick, and can be used to fetch the latest state from the physics server. - * The function [param callable] must take the following parameters: - * 1. `state`: a [PhysicsDirectBodyState3D], used to retrieve the body's state. - */ - static body_set_state_sync_callback(body: RID, callable: Callable): void - - /** Sets the body's custom force integration callback function to [param callable]. Use an empty [Callable] ([code skip-lint]Callable()`) to clear the custom callback. - * The function [param callable] will be called every physics tick, before the standard force integration (see [method body_set_omit_force_integration]). It can be used for example to update the body's linear and angular velocity based on contact with other bodies. - * If [param userdata] is not `null`, the function [param callable] must take the following two parameters: - * 1. `state`: a [PhysicsDirectBodyState3D], used to retrieve and modify the body's state, - * 2. [code skip-lint]userdata`: a [Variant]; its value will be the [param userdata] passed into this method. - * If [param userdata] is `null`, then [param callable] must take only the `state` parameter. - */ - static body_set_force_integration_callback(body: RID, callable: Callable, userdata: any = {}): void - - /** Sets the body pickable with rays if [param enable] is set. */ - static body_set_ray_pickable(body: RID, enable: boolean): void - - /** Returns `true` if a collision would result from moving along a motion vector from a given point in space. [PhysicsTestMotionParameters3D] is passed to set motion parameters. [PhysicsTestMotionResult3D] can be passed to return additional information. */ - static body_test_motion(body: RID, parameters: PhysicsTestMotionParameters3D, result: PhysicsTestMotionResult3D = undefined): boolean - - /** Returns the [PhysicsDirectBodyState3D] of the body. Returns `null` if the body is destroyed or removed from the physics space. */ - static body_get_direct_state(body: RID): PhysicsDirectBodyState3D - - /** Creates a new soft body and returns its internal [RID]. */ - static soft_body_create(): RID - - /** Requests that the physics server updates the rendering server with the latest positions of the given soft body's points through the [param rendering_server_handler] interface. */ - static soft_body_update_rendering_server(body: RID, rendering_server_handler: PhysicsServer3DRenderingServerHandler): void - - /** Assigns a space to the given soft body (see [method space_create]). */ - static soft_body_set_space(body: RID, space: RID): void - - /** Returns the [RID] of the space assigned to the given soft body. */ - static soft_body_get_space(body: RID): RID - - /** Sets the mesh of the given soft body. */ - static soft_body_set_mesh(body: RID, mesh: RID): void - - /** Returns the bounds of the given soft body in global coordinates. */ - static soft_body_get_bounds(body: RID): AABB - - /** Sets the physics layer or layers the given soft body belongs to. */ - static soft_body_set_collision_layer(body: RID, layer: int64): void - - /** Returns the physics layer or layers that the given soft body belongs to. */ - static soft_body_get_collision_layer(body: RID): int64 - - /** Sets the physics layer or layers the given soft body can collide with. */ - static soft_body_set_collision_mask(body: RID, mask: int64): void - - /** Returns the physics layer or layers that the given soft body can collide with. */ - static soft_body_get_collision_mask(body: RID): int64 - - /** Adds the given body to the list of bodies exempt from collisions. */ - static soft_body_add_collision_exception(body: RID, body_b: RID): void - - /** Removes the given body from the list of bodies exempt from collisions. */ - static soft_body_remove_collision_exception(body: RID, body_b: RID): void - - /** Sets the given body state for the given body (see [enum BodyState] constants). - * - * **Note:** Godot's default physics implementation does not support [constant BODY_STATE_LINEAR_VELOCITY], [constant BODY_STATE_ANGULAR_VELOCITY], [constant BODY_STATE_SLEEPING], or [constant BODY_STATE_CAN_SLEEP]. - */ - static soft_body_set_state(body: RID, state: PhysicsServer3D.BodyState, variant: any): void - - /** Returns the given soft body state (see [enum BodyState] constants). - * - * **Note:** Godot's default physics implementation does not support [constant BODY_STATE_LINEAR_VELOCITY], [constant BODY_STATE_ANGULAR_VELOCITY], [constant BODY_STATE_SLEEPING], or [constant BODY_STATE_CAN_SLEEP]. - */ - static soft_body_get_state(body: RID, state: PhysicsServer3D.BodyState): any - - /** Sets the global transform of the given soft body. */ - static soft_body_set_transform(body: RID, transform: Transform3D): void - - /** Sets whether the given soft body will be pickable when using object picking. */ - static soft_body_set_ray_pickable(body: RID, enable: boolean): void - - /** Sets the simulation precision of the given soft body. Increasing this value will improve the resulting simulation, but can affect performance. Use with care. */ - static soft_body_set_simulation_precision(body: RID, simulation_precision: int64): void - - /** Returns the simulation precision of the given soft body. */ - static soft_body_get_simulation_precision(body: RID): int64 - - /** Sets the total mass for the given soft body. */ - static soft_body_set_total_mass(body: RID, total_mass: float64): void - - /** Returns the total mass assigned to the given soft body. */ - static soft_body_get_total_mass(body: RID): float64 - - /** Sets the linear stiffness of the given soft body. Higher values will result in a stiffer body, while lower values will increase the body's ability to bend. The value can be between `0.0` and `1.0` (inclusive). */ - static soft_body_set_linear_stiffness(body: RID, stiffness: float64): void - - /** Returns the linear stiffness of the given soft body. */ - static soft_body_get_linear_stiffness(body: RID): float64 - - /** Sets the pressure coefficient of the given soft body. Simulates pressure build-up from inside this body. Higher values increase the strength of this effect. */ - static soft_body_set_pressure_coefficient(body: RID, pressure_coefficient: float64): void - - /** Returns the pressure coefficient of the given soft body. */ - static soft_body_get_pressure_coefficient(body: RID): float64 - - /** Sets the damping coefficient of the given soft body. Higher values will slow down the body more noticeably when forces are applied. */ - static soft_body_set_damping_coefficient(body: RID, damping_coefficient: float64): void - - /** Returns the damping coefficient of the given soft body. */ - static soft_body_get_damping_coefficient(body: RID): float64 - - /** Sets the drag coefficient of the given soft body. Higher values increase this body's air resistance. - * - * **Note:** This value is currently unused by Godot's default physics implementation. - */ - static soft_body_set_drag_coefficient(body: RID, drag_coefficient: float64): void - - /** Returns the drag coefficient of the given soft body. */ - static soft_body_get_drag_coefficient(body: RID): float64 - - /** Moves the given soft body point to a position in global coordinates. */ - static soft_body_move_point(body: RID, point_index: int64, global_position: Vector3): void - - /** Returns the current position of the given soft body point in global coordinates. */ - static soft_body_get_point_global_position(body: RID, point_index: int64): Vector3 - - /** Unpins all points of the given soft body. */ - static soft_body_remove_all_pinned_points(body: RID): void - - /** Pins or unpins the given soft body point based on the value of [param pin]. - * - * **Note:** Pinning a point effectively makes it kinematic, preventing it from being affected by forces, but you can still move it using [method soft_body_move_point]. - */ - static soft_body_pin_point(body: RID, point_index: int64, pin: boolean): void - - /** Returns whether the given soft body point is pinned. */ - static soft_body_is_point_pinned(body: RID, point_index: int64): boolean - static joint_create(): RID - static joint_clear(joint: RID): void - static joint_make_pin(joint: RID, body_A: RID, local_A: Vector3, body_B: RID, local_B: Vector3): void - - /** Sets a pin_joint parameter (see [enum PinJointParam] constants). */ - static pin_joint_set_param(joint: RID, param: PhysicsServer3D.PinJointParam, value: float64): void - - /** Gets a pin_joint parameter (see [enum PinJointParam] constants). */ - static pin_joint_get_param(joint: RID, param: PhysicsServer3D.PinJointParam): float64 - - /** Sets position of the joint in the local space of body a of the joint. */ - static pin_joint_set_local_a(joint: RID, local_A: Vector3): void - - /** Returns position of the joint in the local space of body a of the joint. */ - static pin_joint_get_local_a(joint: RID): Vector3 - - /** Sets position of the joint in the local space of body b of the joint. */ - static pin_joint_set_local_b(joint: RID, local_B: Vector3): void - - /** Returns position of the joint in the local space of body b of the joint. */ - static pin_joint_get_local_b(joint: RID): Vector3 - static joint_make_hinge(joint: RID, body_A: RID, hinge_A: Transform3D, body_B: RID, hinge_B: Transform3D): void - - /** Sets a hinge_joint parameter (see [enum HingeJointParam] constants). */ - static hinge_joint_set_param(joint: RID, param: PhysicsServer3D.HingeJointParam, value: float64): void - - /** Gets a hinge_joint parameter (see [enum HingeJointParam]). */ - static hinge_joint_get_param(joint: RID, param: PhysicsServer3D.HingeJointParam): float64 - - /** Sets a hinge_joint flag (see [enum HingeJointFlag] constants). */ - static hinge_joint_set_flag(joint: RID, flag: PhysicsServer3D.HingeJointFlag, enabled: boolean): void - - /** Gets a hinge_joint flag (see [enum HingeJointFlag] constants). */ - static hinge_joint_get_flag(joint: RID, flag: PhysicsServer3D.HingeJointFlag): boolean - static joint_make_slider(joint: RID, body_A: RID, local_ref_A: Transform3D, body_B: RID, local_ref_B: Transform3D): void - - /** Gets a slider_joint parameter (see [enum SliderJointParam] constants). */ - static slider_joint_set_param(joint: RID, param: PhysicsServer3D.SliderJointParam, value: float64): void - - /** Gets a slider_joint parameter (see [enum SliderJointParam] constants). */ - static slider_joint_get_param(joint: RID, param: PhysicsServer3D.SliderJointParam): float64 - static joint_make_cone_twist(joint: RID, body_A: RID, local_ref_A: Transform3D, body_B: RID, local_ref_B: Transform3D): void - - /** Sets a cone_twist_joint parameter (see [enum ConeTwistJointParam] constants). */ - static cone_twist_joint_set_param(joint: RID, param: PhysicsServer3D.ConeTwistJointParam, value: float64): void - - /** Gets a cone_twist_joint parameter (see [enum ConeTwistJointParam] constants). */ - static cone_twist_joint_get_param(joint: RID, param: PhysicsServer3D.ConeTwistJointParam): float64 - - /** Returns the type of the Joint3D. */ - static joint_get_type(joint: RID): PhysicsServer3D.JointType - - /** Sets the priority value of the Joint3D. */ - static joint_set_solver_priority(joint: RID, priority: int64): void - - /** Gets the priority value of the Joint3D. */ - static joint_get_solver_priority(joint: RID): int64 - - /** Sets whether the bodies attached to the [Joint3D] will collide with each other. */ - static joint_disable_collisions_between_bodies(joint: RID, disable: boolean): void - - /** Returns whether the bodies attached to the [Joint3D] will collide with each other. */ - static joint_is_disabled_collisions_between_bodies(joint: RID): boolean - - /** Make the joint a generic six degrees of freedom (6DOF) joint. Use [method generic_6dof_joint_set_flag] and [method generic_6dof_joint_set_param] to set the joint's flags and parameters respectively. */ - static joint_make_generic_6dof(joint: RID, body_A: RID, local_ref_A: Transform3D, body_B: RID, local_ref_B: Transform3D): void - - /** Sets the value of a given generic 6DOF joint parameter. See [enum G6DOFJointAxisParam] for the list of available parameters. */ - static generic_6dof_joint_set_param(joint: RID, axis: Vector3.Axis, param: PhysicsServer3D.G6DOFJointAxisParam, value: float64): void - - /** Returns the value of a generic 6DOF joint parameter. See [enum G6DOFJointAxisParam] for the list of available parameters. */ - static generic_6dof_joint_get_param(joint: RID, axis: Vector3.Axis, param: PhysicsServer3D.G6DOFJointAxisParam): float64 - - /** Sets the value of a given generic 6DOF joint flag. See [enum G6DOFJointAxisFlag] for the list of available flags. */ - static generic_6dof_joint_set_flag(joint: RID, axis: Vector3.Axis, flag: PhysicsServer3D.G6DOFJointAxisFlag, enable: boolean): void - - /** Returns the value of a generic 6DOF joint flag. See [enum G6DOFJointAxisFlag] for the list of available flags. */ - static generic_6dof_joint_get_flag(joint: RID, axis: Vector3.Axis, flag: PhysicsServer3D.G6DOFJointAxisFlag): boolean - - /** Destroys any of the objects created by PhysicsServer3D. If the [RID] passed is not one of the objects that can be created by PhysicsServer3D, an error will be sent to the console. */ - static free_rid(rid: RID): void - - /** Activates or deactivates the 3D physics engine. */ - static set_active(active: boolean): void - - /** Returns information about the current state of the 3D physics engine. See [enum ProcessInfo] for a list of available states. */ - static get_process_info(process_info: PhysicsServer3D.ProcessInfo): int64 - } - // _singleton_class_: XRServer - namespace XRServer { - enum TrackerType { - /** The tracker tracks the location of the players head. This is usually a location centered between the players eyes. Note that for handheld AR devices this can be the current location of the device. */ - TRACKER_HEAD = 1, - - /** The tracker tracks the location of a controller. */ - TRACKER_CONTROLLER = 2, - - /** The tracker tracks the location of a base station. */ - TRACKER_BASESTATION = 4, - - /** The tracker tracks the location and size of an AR anchor. */ - TRACKER_ANCHOR = 8, - - /** The tracker tracks the location and joints of a hand. */ - TRACKER_HAND = 16, - - /** The tracker tracks the location and joints of a body. */ - TRACKER_BODY = 32, - - /** The tracker tracks the expressions of a face. */ - TRACKER_FACE = 64, - - /** Used internally to filter trackers of any known type. */ - TRACKER_ANY_KNOWN = 127, - - /** Used internally if we haven't set the tracker type yet. */ - TRACKER_UNKNOWN = 128, - - /** Used internally to select all trackers. */ - TRACKER_ANY = 255, - } - enum RotationMode { - /** Fully reset the orientation of the HMD. Regardless of what direction the user is looking to in the real world. The user will look dead ahead in the virtual world. */ - RESET_FULL_ROTATION = 0, - - /** Resets the orientation but keeps the tilt of the device. So if we're looking down, we keep looking down but heading will be reset. */ - RESET_BUT_KEEP_TILT = 1, - - /** Does not reset the orientation of the HMD, only the position of the player gets centered. */ - DONT_RESET_ROTATION = 2, - } - } - /** Server for AR and VR features. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_xrserver.html - */ - class XRServer extends Object { - /** Returns the reference frame transform. Mostly used internally and exposed for GDExtension build interfaces. */ - static get_reference_frame(): Transform3D - - /** Clears the reference frame that was set by previous calls to [method center_on_hmd]. */ - static clear_reference_frame(): void - - /** This is an important function to understand correctly. AR and VR platforms all handle positioning slightly differently. - * For platforms that do not offer spatial tracking, our origin point (0, 0, 0) is the location of our HMD, but you have little control over the direction the player is facing in the real world. - * For platforms that do offer spatial tracking, our origin point depends very much on the system. For OpenVR, our origin point is usually the center of the tracking space, on the ground. For other platforms, it's often the location of the tracking camera. - * This method allows you to center your tracker on the location of the HMD. It will take the current location of the HMD and use that to adjust all your tracking data; in essence, realigning the real world to your player's current position in the game world. - * For this method to produce usable results, tracking information must be available. This often takes a few frames after starting your game. - * You should call this method after a few seconds have passed. For example, when the user requests a realignment of the display holding a designated button on a controller for a short period of time, or when implementing a teleport mechanism. - */ - static center_on_hmd(rotation_mode: XRServer.RotationMode, keep_height: boolean): void - - /** Returns the primary interface's transformation. */ - static get_hmd_transform(): Transform3D - - /** Registers an [XRInterface] object. */ - static add_interface(interface: XRInterface): void - - /** Returns the number of interfaces currently registered with the AR/VR server. If your project supports multiple AR/VR platforms, you can look through the available interface, and either present the user with a selection or simply try to initialize each interface and use the first one that returns `true`. */ - static get_interface_count(): int64 - - /** Removes this [param interface]. */ - static remove_interface(interface: XRInterface): void - - /** Returns the interface registered at the given [param idx] index in the list of interfaces. */ - static get_interface(idx: int64): XRInterface - - /** Returns a list of available interfaces the ID and name of each interface. */ - static get_interfaces(): GArray - - /** Finds an interface by its [param name]. For example, if your project uses capabilities of an AR/VR platform, you can find the interface for that platform by name and initialize it. */ - static find_interface(name: string): XRInterface - - /** Registers a new [XRTracker] that tracks a physical object. */ - static add_tracker(tracker: XRTracker): void - - /** Removes this [param tracker]. */ - static remove_tracker(tracker: XRTracker): void - - /** Returns a dictionary of trackers for [param tracker_types]. */ - static get_trackers(tracker_types: int64): GDictionary - - /** Returns the positional tracker with the given [param tracker_name]. */ - static get_tracker(tracker_name: StringName): XRTracker - - /** The scale of the game world compared to the real world. By default, most AR/VR platforms assume that 1 game unit corresponds to 1 real world meter. */ - get world_scale(): float64 - set world_scale(value: float64) - - /** The current origin of our tracking space in the virtual world. This is used by the renderer to properly position the camera with new tracking data. - * - * **Note:** This property is managed by the current [XROrigin3D] node. It is exposed for access from GDExtensions. - */ - get world_origin(): Vector3 - set world_origin(value: Vector3) - - /** The primary [XRInterface] currently bound to the [XRServer]. */ - get primary_interface(): Object - set primary_interface(value: Object) - - /** Emitted when the reference frame transform changes. */ - static readonly reference_frame_changed: Signal0 - - /** Emitted when a new interface has been added. */ - static readonly interface_added: Signal1 - - /** Emitted when an interface is removed. */ - static readonly interface_removed: Signal1 - - /** Emitted when a new tracker has been added. If you don't use a fixed number of controllers or if you're using [XRAnchor3D]s for an AR solution, it is important to react to this signal to add the appropriate [XRController3D] or [XRAnchor3D] nodes related to this new tracker. */ - static readonly tracker_added: Signal2 - - /** Emitted when an existing tracker has been updated. This can happen if the user switches controllers. */ - static readonly tracker_updated: Signal2 - - /** Emitted when a tracker is removed. You should remove any [XRController3D] or [XRAnchor3D] points if applicable. This is not mandatory, the nodes simply become inactive and will be made active again when a new tracker becomes available (i.e. a new controller is switched on that takes the place of the previous one). */ - static readonly tracker_removed: Signal2 - } - // _singleton_class_: GDScriptLanguageProtocol - /** @link https://docs.godotengine.org/en/4.3/classes/class_gdscriptlanguageprotocol.html */ - class GDScriptLanguageProtocol extends JSONRPC { - static initialize(params: GDictionary): GDictionary - static initialized(params: any): void - static on_client_connected(): GError - static on_client_disconnected(_unnamed_arg0: int64): void - static notify_client(method: string, params: any = {}, client_id: int64 = -1): void - static is_smart_resolve_enabled(): boolean - static get_text_document(): GDScriptTextDocument - static get_workspace(): GDScriptWorkspace - static is_initialized(): boolean - } } diff --git a/typings/godot1.gen.d.ts b/typings/godot1.gen.d.ts index 752ce51..34c75ad 100644 --- a/typings/godot1.gen.d.ts +++ b/typings/godot1.gen.d.ts @@ -1,6 +1,1863 @@ // AUTO-GENERATED /// declare module "godot" { + // _singleton_class_: PhysicsServer2D + namespace PhysicsServer2D { + enum SpaceParameter { + /** Constant to set/get the maximum distance a pair of bodies has to move before their collision status has to be recalculated. The default value of this parameter is [member ProjectSettings.physics/2d/solver/contact_recycle_radius]. */ + SPACE_PARAM_CONTACT_RECYCLE_RADIUS = 0, + + /** Constant to set/get the maximum distance a shape can be from another before they are considered separated and the contact is discarded. The default value of this parameter is [member ProjectSettings.physics/2d/solver/contact_max_separation]. */ + SPACE_PARAM_CONTACT_MAX_SEPARATION = 1, + + /** Constant to set/get the maximum distance a shape can penetrate another shape before it is considered a collision. The default value of this parameter is [member ProjectSettings.physics/2d/solver/contact_max_allowed_penetration]. */ + SPACE_PARAM_CONTACT_MAX_ALLOWED_PENETRATION = 2, + + /** Constant to set/get the default solver bias for all physics contacts. A solver bias is a factor controlling how much two objects "rebound", after overlapping, to avoid leaving them in that state because of numerical imprecision. The default value of this parameter is [member ProjectSettings.physics/2d/solver/default_contact_bias]. */ + SPACE_PARAM_CONTACT_DEFAULT_BIAS = 3, + + /** Constant to set/get the threshold linear velocity of activity. A body marked as potentially inactive for both linear and angular velocity will be put to sleep after the time given. The default value of this parameter is [member ProjectSettings.physics/2d/sleep_threshold_linear]. */ + SPACE_PARAM_BODY_LINEAR_VELOCITY_SLEEP_THRESHOLD = 4, + + /** Constant to set/get the threshold angular velocity of activity. A body marked as potentially inactive for both linear and angular velocity will be put to sleep after the time given. The default value of this parameter is [member ProjectSettings.physics/2d/sleep_threshold_angular]. */ + SPACE_PARAM_BODY_ANGULAR_VELOCITY_SLEEP_THRESHOLD = 5, + + /** Constant to set/get the maximum time of activity. A body marked as potentially inactive for both linear and angular velocity will be put to sleep after this time. The default value of this parameter is [member ProjectSettings.physics/2d/time_before_sleep]. */ + SPACE_PARAM_BODY_TIME_TO_SLEEP = 6, + + /** Constant to set/get the default solver bias for all physics constraints. A solver bias is a factor controlling how much two objects "rebound", after violating a constraint, to avoid leaving them in that state because of numerical imprecision. The default value of this parameter is [member ProjectSettings.physics/2d/solver/default_constraint_bias]. */ + SPACE_PARAM_CONSTRAINT_DEFAULT_BIAS = 7, + + /** Constant to set/get the number of solver iterations for all contacts and constraints. The greater the number of iterations, the more accurate the collisions will be. However, a greater number of iterations requires more CPU power, which can decrease performance. The default value of this parameter is [member ProjectSettings.physics/2d/solver/solver_iterations]. */ + SPACE_PARAM_SOLVER_ITERATIONS = 8, + } + enum ShapeType { + /** This is the constant for creating world boundary shapes. A world boundary shape is an *infinite* line with an origin point, and a normal. Thus, it can be used for front/behind checks. */ + SHAPE_WORLD_BOUNDARY = 0, + + /** This is the constant for creating separation ray shapes. A separation ray is defined by a length and separates itself from what is touching its far endpoint. Useful for character controllers. */ + SHAPE_SEPARATION_RAY = 1, + + /** This is the constant for creating segment shapes. A segment shape is a *finite* line from a point A to a point B. It can be checked for intersections. */ + SHAPE_SEGMENT = 2, + + /** This is the constant for creating circle shapes. A circle shape only has a radius. It can be used for intersections and inside/outside checks. */ + SHAPE_CIRCLE = 3, + + /** This is the constant for creating rectangle shapes. A rectangle shape is defined by a width and a height. It can be used for intersections and inside/outside checks. */ + SHAPE_RECTANGLE = 4, + + /** This is the constant for creating capsule shapes. A capsule shape is defined by a radius and a length. It can be used for intersections and inside/outside checks. */ + SHAPE_CAPSULE = 5, + + /** This is the constant for creating convex polygon shapes. A polygon is defined by a list of points. It can be used for intersections and inside/outside checks. */ + SHAPE_CONVEX_POLYGON = 6, + + /** This is the constant for creating concave polygon shapes. A polygon is defined by a list of points. It can be used for intersections checks, but not for inside/outside checks. */ + SHAPE_CONCAVE_POLYGON = 7, + + /** This constant is used internally by the engine. Any attempt to create this kind of shape results in an error. */ + SHAPE_CUSTOM = 8, + } + enum AreaParameter { + /** Constant to set/get gravity override mode in an area. See [enum AreaSpaceOverrideMode] for possible values. The default value of this parameter is [constant AREA_SPACE_OVERRIDE_DISABLED]. */ + AREA_PARAM_GRAVITY_OVERRIDE_MODE = 0, + + /** Constant to set/get gravity strength in an area. The default value of this parameter is `9.80665`. */ + AREA_PARAM_GRAVITY = 1, + + /** Constant to set/get gravity vector/center in an area. The default value of this parameter is `Vector2(0, -1)`. */ + AREA_PARAM_GRAVITY_VECTOR = 2, + + /** Constant to set/get whether the gravity vector of an area is a direction, or a center point. The default value of this parameter is `false`. */ + AREA_PARAM_GRAVITY_IS_POINT = 3, + + /** Constant to set/get the distance at which the gravity strength is equal to the gravity controlled by [constant AREA_PARAM_GRAVITY]. For example, on a planet 100 pixels in radius with a surface gravity of 4.0 px/s², set the gravity to 4.0 and the unit distance to 100.0. The gravity will have falloff according to the inverse square law, so in the example, at 200 pixels from the center the gravity will be 1.0 px/s² (twice the distance, 1/4th the gravity), at 50 pixels it will be 16.0 px/s² (half the distance, 4x the gravity), and so on. + * The above is true only when the unit distance is a positive number. When the unit distance is set to 0.0, the gravity will be constant regardless of distance. The default value of this parameter is `0.0`. + */ + AREA_PARAM_GRAVITY_POINT_UNIT_DISTANCE = 4, + + /** Constant to set/get linear damping override mode in an area. See [enum AreaSpaceOverrideMode] for possible values. The default value of this parameter is [constant AREA_SPACE_OVERRIDE_DISABLED]. */ + AREA_PARAM_LINEAR_DAMP_OVERRIDE_MODE = 5, + + /** Constant to set/get the linear damping factor of an area. The default value of this parameter is `0.1`. */ + AREA_PARAM_LINEAR_DAMP = 6, + + /** Constant to set/get angular damping override mode in an area. See [enum AreaSpaceOverrideMode] for possible values. The default value of this parameter is [constant AREA_SPACE_OVERRIDE_DISABLED]. */ + AREA_PARAM_ANGULAR_DAMP_OVERRIDE_MODE = 7, + + /** Constant to set/get the angular damping factor of an area. The default value of this parameter is `1.0`. */ + AREA_PARAM_ANGULAR_DAMP = 8, + + /** Constant to set/get the priority (order of processing) of an area. The default value of this parameter is `0`. */ + AREA_PARAM_PRIORITY = 9, + } + enum AreaSpaceOverrideMode { + /** This area does not affect gravity/damp. These are generally areas that exist only to detect collisions, and objects entering or exiting them. */ + AREA_SPACE_OVERRIDE_DISABLED = 0, + + /** This area adds its gravity/damp values to whatever has been calculated so far. This way, many overlapping areas can combine their physics to make interesting effects. */ + AREA_SPACE_OVERRIDE_COMBINE = 1, + + /** This area adds its gravity/damp values to whatever has been calculated so far. Then stops taking into account the rest of the areas, even the default one. */ + AREA_SPACE_OVERRIDE_COMBINE_REPLACE = 2, + + /** This area replaces any gravity/damp, even the default one, and stops taking into account the rest of the areas. */ + AREA_SPACE_OVERRIDE_REPLACE = 3, + + /** This area replaces any gravity/damp calculated so far, but keeps calculating the rest of the areas, down to the default one. */ + AREA_SPACE_OVERRIDE_REPLACE_COMBINE = 4, + } + enum BodyMode { + /** Constant for static bodies. In this mode, a body can be only moved by user code and doesn't collide with other bodies along its path when moved. */ + BODY_MODE_STATIC = 0, + + /** Constant for kinematic bodies. In this mode, a body can be only moved by user code and collides with other bodies along its path. */ + BODY_MODE_KINEMATIC = 1, + + /** Constant for rigid bodies. In this mode, a body can be pushed by other bodies and has forces applied. */ + BODY_MODE_RIGID = 2, + + /** Constant for linear rigid bodies. In this mode, a body can not rotate, and only its linear velocity is affected by external forces. */ + BODY_MODE_RIGID_LINEAR = 3, + } + enum BodyParameter { + /** Constant to set/get a body's bounce factor. The default value of this parameter is `0.0`. */ + BODY_PARAM_BOUNCE = 0, + + /** Constant to set/get a body's friction. The default value of this parameter is `1.0`. */ + BODY_PARAM_FRICTION = 1, + + /** Constant to set/get a body's mass. The default value of this parameter is `1.0`. If the body's mode is set to [constant BODY_MODE_RIGID], then setting this parameter will have the following additional effects: + * - If the parameter [constant BODY_PARAM_CENTER_OF_MASS] has never been set explicitly, then the value of that parameter will be recalculated based on the body's shapes. + * - If the parameter [constant BODY_PARAM_INERTIA] is set to a value `<= 0.0`, then the value of that parameter will be recalculated based on the body's shapes, mass, and center of mass. + */ + BODY_PARAM_MASS = 2, + + /** Constant to set/get a body's inertia. The default value of this parameter is `0.0`. If the body's inertia is set to a value `<= 0.0`, then the inertia will be recalculated based on the body's shapes, mass, and center of mass. */ + BODY_PARAM_INERTIA = 3, + + /** Constant to set/get a body's center of mass position in the body's local coordinate system. The default value of this parameter is `Vector2(0,0)`. If this parameter is never set explicitly, then it is recalculated based on the body's shapes when setting the parameter [constant BODY_PARAM_MASS] or when calling [method body_set_space]. */ + BODY_PARAM_CENTER_OF_MASS = 4, + + /** Constant to set/get a body's gravity multiplier. The default value of this parameter is `1.0`. */ + BODY_PARAM_GRAVITY_SCALE = 5, + + /** Constant to set/get a body's linear damping mode. See [enum BodyDampMode] for possible values. The default value of this parameter is [constant BODY_DAMP_MODE_COMBINE]. */ + BODY_PARAM_LINEAR_DAMP_MODE = 6, + + /** Constant to set/get a body's angular damping mode. See [enum BodyDampMode] for possible values. The default value of this parameter is [constant BODY_DAMP_MODE_COMBINE]. */ + BODY_PARAM_ANGULAR_DAMP_MODE = 7, + + /** Constant to set/get a body's linear damping factor. The default value of this parameter is `0.0`. */ + BODY_PARAM_LINEAR_DAMP = 8, + + /** Constant to set/get a body's angular damping factor. The default value of this parameter is `0.0`. */ + BODY_PARAM_ANGULAR_DAMP = 9, + + /** Represents the size of the [enum BodyParameter] enum. */ + BODY_PARAM_MAX = 10, + } + enum BodyDampMode { + /** The body's damping value is added to any value set in areas or the default value. */ + BODY_DAMP_MODE_COMBINE = 0, + + /** The body's damping value replaces any value set in areas or the default value. */ + BODY_DAMP_MODE_REPLACE = 1, + } + enum BodyState { + /** Constant to set/get the current transform matrix of the body. */ + BODY_STATE_TRANSFORM = 0, + + /** Constant to set/get the current linear velocity of the body. */ + BODY_STATE_LINEAR_VELOCITY = 1, + + /** Constant to set/get the current angular velocity of the body. */ + BODY_STATE_ANGULAR_VELOCITY = 2, + + /** Constant to sleep/wake up a body, or to get whether it is sleeping. */ + BODY_STATE_SLEEPING = 3, + + /** Constant to set/get whether the body can sleep. */ + BODY_STATE_CAN_SLEEP = 4, + } + enum JointType { + /** Constant to create pin joints. */ + JOINT_TYPE_PIN = 0, + + /** Constant to create groove joints. */ + JOINT_TYPE_GROOVE = 1, + + /** Constant to create damped spring joints. */ + JOINT_TYPE_DAMPED_SPRING = 2, + + /** Represents the size of the [enum JointType] enum. */ + JOINT_TYPE_MAX = 3, + } + enum JointParam { + /** Constant to set/get how fast the joint pulls the bodies back to satisfy the joint constraint. The lower the value, the more the two bodies can pull on the joint. The default value of this parameter is `0.0`. + * + * **Note:** In Godot Physics, this parameter is only used for pin joints and groove joints. + */ + JOINT_PARAM_BIAS = 0, + + /** Constant to set/get the maximum speed with which the joint can apply corrections. The default value of this parameter is `3.40282e+38`. + * + * **Note:** In Godot Physics, this parameter is only used for groove joints. + */ + JOINT_PARAM_MAX_BIAS = 1, + + /** Constant to set/get the maximum force that the joint can use to act on the two bodies. The default value of this parameter is `3.40282e+38`. + * + * **Note:** In Godot Physics, this parameter is only used for groove joints. + */ + JOINT_PARAM_MAX_FORCE = 2, + } + enum PinJointParam { + /** Constant to set/get a how much the bond of the pin joint can flex. The default value of this parameter is `0.0`. */ + PIN_JOINT_SOFTNESS = 0, + + /** The maximum rotation around the pin. */ + PIN_JOINT_LIMIT_UPPER = 1, + + /** The minimum rotation around the pin. */ + PIN_JOINT_LIMIT_LOWER = 2, + + /** Target speed for the motor. In radians per second. */ + PIN_JOINT_MOTOR_TARGET_VELOCITY = 3, + } + enum PinJointFlag { + /** If `true`, the pin has a maximum and a minimum rotation. */ + PIN_JOINT_FLAG_ANGULAR_LIMIT_ENABLED = 0, + + /** If `true`, a motor turns the pin. */ + PIN_JOINT_FLAG_MOTOR_ENABLED = 1, + } + enum DampedSpringParam { + /** Sets the resting length of the spring joint. The joint will always try to go to back this length when pulled apart. The default value of this parameter is the distance between the joint's anchor points. */ + DAMPED_SPRING_REST_LENGTH = 0, + + /** Sets the stiffness of the spring joint. The joint applies a force equal to the stiffness times the distance from its resting length. The default value of this parameter is `20.0`. */ + DAMPED_SPRING_STIFFNESS = 1, + + /** Sets the damping ratio of the spring joint. A value of 0 indicates an undamped spring, while 1 causes the system to reach equilibrium as fast as possible (critical damping). The default value of this parameter is `1.5`. */ + DAMPED_SPRING_DAMPING = 2, + } + enum CCDMode { + /** Disables continuous collision detection. This is the fastest way to detect body collisions, but it can miss small and/or fast-moving objects. */ + CCD_MODE_DISABLED = 0, + + /** Enables continuous collision detection by raycasting. It is faster than shapecasting, but less precise. */ + CCD_MODE_CAST_RAY = 1, + + /** Enables continuous collision detection by shapecasting. It is the slowest CCD method, and the most precise. */ + CCD_MODE_CAST_SHAPE = 2, + } + enum AreaBodyStatus { + /** The value of the first parameter and area callback function receives, when an object enters one of its shapes. */ + AREA_BODY_ADDED = 0, + + /** The value of the first parameter and area callback function receives, when an object exits one of its shapes. */ + AREA_BODY_REMOVED = 1, + } + enum ProcessInfo { + /** Constant to get the number of objects that are not sleeping. */ + INFO_ACTIVE_OBJECTS = 0, + + /** Constant to get the number of possible collisions. */ + INFO_COLLISION_PAIRS = 1, + + /** Constant to get the number of space regions where a collision could occur. */ + INFO_ISLAND_COUNT = 2, + } + } + /** A server interface for low-level 2D physics access. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_physicsserver2d.html + */ + class PhysicsServer2D extends Object { + /** Creates a 2D world boundary shape in the physics server, and returns the [RID] that identifies it. Use [method shape_set_data] to set the shape's normal direction and distance properties. */ + static world_boundary_shape_create(): RID + + /** Creates a 2D separation ray shape in the physics server, and returns the [RID] that identifies it. Use [method shape_set_data] to set the shape's `length` and `slide_on_slope` properties. */ + static separation_ray_shape_create(): RID + + /** Creates a 2D segment shape in the physics server, and returns the [RID] that identifies it. Use [method shape_set_data] to set the segment's start and end points. */ + static segment_shape_create(): RID + + /** Creates a 2D circle shape in the physics server, and returns the [RID] that identifies it. Use [method shape_set_data] to set the circle's radius. */ + static circle_shape_create(): RID + + /** Creates a 2D rectangle shape in the physics server, and returns the [RID] that identifies it. Use [method shape_set_data] to set the rectangle's half-extents. */ + static rectangle_shape_create(): RID + + /** Creates a 2D capsule shape in the physics server, and returns the [RID] that identifies it. Use [method shape_set_data] to set the capsule's height and radius. */ + static capsule_shape_create(): RID + + /** Creates a 2D convex polygon shape in the physics server, and returns the [RID] that identifies it. Use [method shape_set_data] to set the convex polygon's points. */ + static convex_polygon_shape_create(): RID + + /** Creates a 2D concave polygon shape in the physics server, and returns the [RID] that identifies it. Use [method shape_set_data] to set the concave polygon's segments. */ + static concave_polygon_shape_create(): RID + + /** Sets the shape data that defines the configuration of the shape. The [param data] to be passed depends on the shape's type (see [method shape_get_type]): + * - [constant SHAPE_WORLD_BOUNDARY]: an array of length two containing a [Vector2] `normal` direction and a [float] distance `d`, + * - [constant SHAPE_SEPARATION_RAY]: a dictionary containing the key `length` with a [float] value and the key `slide_on_slope` with a [bool] value, + * - [constant SHAPE_SEGMENT]: a [Rect2] `rect` containing the first point of the segment in `rect.position` and the second point of the segment in `rect.size`, + * - [constant SHAPE_CIRCLE]: a [float] `radius`, + * - [constant SHAPE_RECTANGLE]: a [Vector2] `half_extents`, + * - [constant SHAPE_CAPSULE]: an array of length two (or a [Vector2]) containing a [float] `height` and a [float] `radius`, + * - [constant SHAPE_CONVEX_POLYGON]: either a [PackedVector2Array] of points defining a convex polygon in counterclockwise order (the clockwise outward normal of each segment formed by consecutive points is calculated internally), or a [PackedFloat32Array] of length divisible by four so that every 4-tuple of [float]s contains the coordinates of a point followed by the coordinates of the clockwise outward normal vector to the segment between the current point and the next point, + * - [constant SHAPE_CONCAVE_POLYGON]: a [PackedVector2Array] of length divisible by two (each pair of points forms one segment). + * **Warning:** In the case of [constant SHAPE_CONVEX_POLYGON], this method does not check if the points supplied actually form a convex polygon (unlike the [member CollisionPolygon2D.polygon] property). + */ + static shape_set_data(shape: RID, data: any): void + + /** Returns the shape's type (see [enum ShapeType]). */ + static shape_get_type(shape: RID): PhysicsServer2D.ShapeType + + /** Returns the shape data that defines the configuration of the shape, such as the half-extents of a rectangle or the segments of a concave shape. See [method shape_set_data] for the precise format of this data in each case. */ + static shape_get_data(shape: RID): any + + /** Creates a 2D space in the physics server, and returns the [RID] that identifies it. A space contains bodies and areas, and controls the stepping of the physics simulation of the objects in it. */ + static space_create(): RID + + /** Activates or deactivates the space. If [param active] is `false`, then the physics server will not do anything with this space in its physics step. */ + static space_set_active(space: RID, active: boolean): void + + /** Returns `true` if the space is active. */ + static space_is_active(space: RID): boolean + + /** Sets the value of the given space parameter. See [enum SpaceParameter] for the list of available parameters. */ + static space_set_param(space: RID, param: PhysicsServer2D.SpaceParameter, value: float64): void + + /** Returns the value of the given space parameter. See [enum SpaceParameter] for the list of available parameters. */ + static space_get_param(space: RID, param: PhysicsServer2D.SpaceParameter): float64 + + /** Returns the state of a space, a [PhysicsDirectSpaceState2D]. This object can be used for collision/intersection queries. */ + static space_get_direct_state(space: RID): PhysicsDirectSpaceState2D + + /** Creates a 2D area object in the physics server, and returns the [RID] that identifies it. The default settings for the created area include a collision layer and mask set to `1`, and `monitorable` set to `false`. + * Use [method area_add_shape] to add shapes to it, use [method area_set_transform] to set its transform, and use [method area_set_space] to add the area to a space. If you want the area to be detectable use [method area_set_monitorable]. + */ + static area_create(): RID + + /** Adds the area to the given space, after removing the area from the previously assigned space (if any). + * + * **Note:** To remove an area from a space without immediately adding it back elsewhere, use `PhysicsServer2D.area_set_space(area, RID())`. + */ + static area_set_space(area: RID, space: RID): void + + /** Returns the [RID] of the space assigned to the area. Returns an empty [RID] if no space is assigned. */ + static area_get_space(area: RID): RID + + /** Adds a shape to the area, with the given local transform. The shape (together with its [param transform] and [param disabled] properties) is added to an array of shapes, and the shapes of an area are usually referenced by their index in this array. */ + static area_add_shape(area: RID, shape: RID, transform: Transform2D = new Transform2D(), disabled: boolean = false): void + + /** Replaces the area's shape at the given index by another shape, while not affecting the `transform` and `disabled` properties at the same index. */ + static area_set_shape(area: RID, shape_idx: int64, shape: RID): void + + /** Sets the local transform matrix of the area's shape with the given index. */ + static area_set_shape_transform(area: RID, shape_idx: int64, transform: Transform2D): void + + /** Sets the disabled property of the area's shape with the given index. If [param disabled] is `true`, then the shape will not detect any other shapes entering or exiting it. */ + static area_set_shape_disabled(area: RID, shape_idx: int64, disabled: boolean): void + + /** Returns the number of shapes added to the area. */ + static area_get_shape_count(area: RID): int64 + + /** Returns the [RID] of the shape with the given index in the area's array of shapes. */ + static area_get_shape(area: RID, shape_idx: int64): RID + + /** Returns the local transform matrix of the shape with the given index in the area's array of shapes. */ + static area_get_shape_transform(area: RID, shape_idx: int64): Transform2D + + /** Removes the shape with the given index from the area's array of shapes. The shape itself is not deleted, so it can continue to be used elsewhere or added back later. As a result of this operation, the area's shapes which used to have indices higher than [param shape_idx] will have their index decreased by one. */ + static area_remove_shape(area: RID, shape_idx: int64): void + + /** Removes all shapes from the area. This does not delete the shapes themselves, so they can continue to be used elsewhere or added back later. */ + static area_clear_shapes(area: RID): void + + /** Assigns the area to one or many physics layers, via a bitmask. */ + static area_set_collision_layer(area: RID, layer: int64): void + + /** Returns the physics layer or layers the area belongs to, as a bitmask. */ + static area_get_collision_layer(area: RID): int64 + + /** Sets which physics layers the area will monitor, via a bitmask. */ + static area_set_collision_mask(area: RID, mask: int64): void + + /** Returns the physics layer or layers the area can contact with, as a bitmask. */ + static area_get_collision_mask(area: RID): int64 + + /** Sets the value of the given area parameter. See [enum AreaParameter] for the list of available parameters. */ + static area_set_param(area: RID, param: PhysicsServer2D.AreaParameter, value: any): void + + /** Sets the transform matrix of the area. */ + static area_set_transform(area: RID, transform: Transform2D): void + + /** Returns the value of the given area parameter. See [enum AreaParameter] for the list of available parameters. */ + static area_get_param(area: RID, param: PhysicsServer2D.AreaParameter): any + + /** Returns the transform matrix of the area. */ + static area_get_transform(area: RID): Transform2D + + /** Attaches the `ObjectID` of an [Object] to the area. Use [method Object.get_instance_id] to get the `ObjectID` of a [CollisionObject2D]. */ + static area_attach_object_instance_id(area: RID, id: int64): void + + /** Returns the `ObjectID` attached to the area. Use [method @GlobalScope.instance_from_id] to retrieve an [Object] from a nonzero `ObjectID`. */ + static area_get_object_instance_id(area: RID): int64 + + /** Attaches the `ObjectID` of a canvas to the area. Use [method Object.get_instance_id] to get the `ObjectID` of a [CanvasLayer]. */ + static area_attach_canvas_instance_id(area: RID, id: int64): void + + /** Returns the `ObjectID` of the canvas attached to the area. Use [method @GlobalScope.instance_from_id] to retrieve a [CanvasLayer] from a nonzero `ObjectID`. */ + static area_get_canvas_instance_id(area: RID): int64 + + /** Sets the area's body monitor callback. This callback will be called when any other (shape of a) body enters or exits (a shape of) the given area, and must take the following five parameters: + * 1. an integer `status`: either [constant AREA_BODY_ADDED] or [constant AREA_BODY_REMOVED] depending on whether the other body shape entered or exited the area, + * 2. an [RID] `body_rid`: the [RID] of the body that entered or exited the area, + * 3. an integer `instance_id`: the `ObjectID` attached to the body, + * 4. an integer `body_shape_idx`: the index of the shape of the body that entered or exited the area, + * 5. an integer `self_shape_idx`: the index of the shape of the area where the body entered or exited. + * By counting (or keeping track of) the shapes that enter and exit, it can be determined if a body (with all its shapes) is entering for the first time or exiting for the last time. + */ + static area_set_monitor_callback(area: RID, callback: Callable): void + + /** Sets the area's area monitor callback. This callback will be called when any other (shape of an) area enters or exits (a shape of) the given area, and must take the following five parameters: + * 1. an integer `status`: either [constant AREA_BODY_ADDED] or [constant AREA_BODY_REMOVED] depending on whether the other area's shape entered or exited the area, + * 2. an [RID] `area_rid`: the [RID] of the other area that entered or exited the area, + * 3. an integer `instance_id`: the `ObjectID` attached to the other area, + * 4. an integer `area_shape_idx`: the index of the shape of the other area that entered or exited the area, + * 5. an integer `self_shape_idx`: the index of the shape of the area where the other area entered or exited. + * By counting (or keeping track of) the shapes that enter and exit, it can be determined if an area (with all its shapes) is entering for the first time or exiting for the last time. + */ + static area_set_area_monitor_callback(area: RID, callback: Callable): void + + /** Sets whether the area is monitorable or not. If [param monitorable] is `true`, the area monitoring callback of other areas will be called when this area enters or exits them. */ + static area_set_monitorable(area: RID, monitorable: boolean): void + + /** Creates a 2D body object in the physics server, and returns the [RID] that identifies it. The default settings for the created area include a collision layer and mask set to `1`, and body mode set to [constant BODY_MODE_RIGID]. + * Use [method body_add_shape] to add shapes to it, use [method body_set_state] to set its transform, and use [method body_set_space] to add the body to a space. + */ + static body_create(): RID + + /** Adds the body to the given space, after removing the body from the previously assigned space (if any). If the body's mode is set to [constant BODY_MODE_RIGID], then adding the body to a space will have the following additional effects: + * - If the parameter [constant BODY_PARAM_CENTER_OF_MASS] has never been set explicitly, then the value of that parameter will be recalculated based on the body's shapes. + * - If the parameter [constant BODY_PARAM_INERTIA] is set to a value `<= 0.0`, then the value of that parameter will be recalculated based on the body's shapes, mass, and center of mass. + * + * **Note:** To remove a body from a space without immediately adding it back elsewhere, use `PhysicsServer2D.body_set_space(body, RID())`. + */ + static body_set_space(body: RID, space: RID): void + + /** Returns the [RID] of the space assigned to the body. Returns an empty [RID] if no space is assigned. */ + static body_get_space(body: RID): RID + + /** Sets the body's mode. See [enum BodyMode] for the list of available modes. */ + static body_set_mode(body: RID, mode: PhysicsServer2D.BodyMode): void + + /** Returns the body's mode (see [enum BodyMode]). */ + static body_get_mode(body: RID): PhysicsServer2D.BodyMode + + /** Adds a shape to the area, with the given local transform. The shape (together with its [param transform] and [param disabled] properties) is added to an array of shapes, and the shapes of a body are usually referenced by their index in this array. */ + static body_add_shape(body: RID, shape: RID, transform: Transform2D = new Transform2D(), disabled: boolean = false): void + + /** Replaces the body's shape at the given index by another shape, while not affecting the `transform`, `disabled`, and one-way collision properties at the same index. */ + static body_set_shape(body: RID, shape_idx: int64, shape: RID): void + + /** Sets the local transform matrix of the body's shape with the given index. */ + static body_set_shape_transform(body: RID, shape_idx: int64, transform: Transform2D): void + + /** Returns the number of shapes added to the body. */ + static body_get_shape_count(body: RID): int64 + + /** Returns the [RID] of the shape with the given index in the body's array of shapes. */ + static body_get_shape(body: RID, shape_idx: int64): RID + + /** Returns the local transform matrix of the shape with the given index in the area's array of shapes. */ + static body_get_shape_transform(body: RID, shape_idx: int64): Transform2D + + /** Removes the shape with the given index from the body's array of shapes. The shape itself is not deleted, so it can continue to be used elsewhere or added back later. As a result of this operation, the body's shapes which used to have indices higher than [param shape_idx] will have their index decreased by one. */ + static body_remove_shape(body: RID, shape_idx: int64): void + + /** Removes all shapes from the body. This does not delete the shapes themselves, so they can continue to be used elsewhere or added back later. */ + static body_clear_shapes(body: RID): void + + /** Sets the disabled property of the body's shape with the given index. If [param disabled] is `true`, then the shape will be ignored in all collision detection. */ + static body_set_shape_disabled(body: RID, shape_idx: int64, disabled: boolean): void + + /** Sets the one-way collision properties of the body's shape with the given index. If [param enable] is `true`, the one-way collision direction given by the shape's local upward axis `body_get_shape_transform(body, shape_idx).y` will be used to ignore collisions with the shape in the opposite direction, and to ensure depenetration of kinematic bodies happens in this direction. */ + static body_set_shape_as_one_way_collision(body: RID, shape_idx: int64, enable: boolean, margin: float64): void + + /** Attaches the `ObjectID` of an [Object] to the body. Use [method Object.get_instance_id] to get the `ObjectID` of a [CollisionObject2D]. */ + static body_attach_object_instance_id(body: RID, id: int64): void + + /** Returns the `ObjectID` attached to the body. Use [method @GlobalScope.instance_from_id] to retrieve an [Object] from a nonzero `ObjectID`. */ + static body_get_object_instance_id(body: RID): int64 + + /** Attaches the `ObjectID` of a canvas to the body. Use [method Object.get_instance_id] to get the `ObjectID` of a [CanvasLayer]. */ + static body_attach_canvas_instance_id(body: RID, id: int64): void + + /** Returns the `ObjectID` of the canvas attached to the body. Use [method @GlobalScope.instance_from_id] to retrieve a [CanvasLayer] from a nonzero `ObjectID`. */ + static body_get_canvas_instance_id(body: RID): int64 + + /** Sets the continuous collision detection mode using one of the [enum CCDMode] constants. + * Continuous collision detection tries to predict where a moving body would collide in between physics updates, instead of moving it and correcting its movement if it collided. + */ + static body_set_continuous_collision_detection_mode(body: RID, mode: PhysicsServer2D.CCDMode): void + + /** Returns the body's continuous collision detection mode (see [enum CCDMode]). */ + static body_get_continuous_collision_detection_mode(body: RID): PhysicsServer2D.CCDMode + + /** Sets the physics layer or layers the body belongs to, via a bitmask. */ + static body_set_collision_layer(body: RID, layer: int64): void + + /** Returns the physics layer or layers the body belongs to, as a bitmask. */ + static body_get_collision_layer(body: RID): int64 + + /** Sets the physics layer or layers the body can collide with, via a bitmask. */ + static body_set_collision_mask(body: RID, mask: int64): void + + /** Returns the physics layer or layers the body can collide with, as a bitmask. */ + static body_get_collision_mask(body: RID): int64 + + /** Sets the body's collision priority. This is used in the depenetration phase of [method body_test_motion]. The higher the priority is, the lower the penetration into the body will be. */ + static body_set_collision_priority(body: RID, priority: float64): void + + /** Returns the body's collision priority. This is used in the depenetration phase of [method body_test_motion]. The higher the priority is, the lower the penetration into the body will be. */ + static body_get_collision_priority(body: RID): float64 + + /** Sets the value of the given body parameter. See [enum BodyParameter] for the list of available parameters. */ + static body_set_param(body: RID, param: PhysicsServer2D.BodyParameter, value: any): void + + /** Returns the value of the given body parameter. See [enum BodyParameter] for the list of available parameters. */ + static body_get_param(body: RID, param: PhysicsServer2D.BodyParameter): any + + /** Restores the default inertia and center of mass of the body based on its shapes. This undoes any custom values previously set using [method body_set_param]. */ + static body_reset_mass_properties(body: RID): void + + /** Sets the value of a body's state. See [enum BodyState] for the list of available states. + * + * **Note:** The state change doesn't take effect immediately. The state will change on the next physics frame. + */ + static body_set_state(body: RID, state: PhysicsServer2D.BodyState, value: any): void + + /** Returns the value of the given state of the body. See [enum BodyState] for the list of available states. */ + static body_get_state(body: RID, state: PhysicsServer2D.BodyState): any + + /** Applies a directional impulse to the body, at the body's center of mass. The impulse does not affect rotation. + * An impulse is time-independent! Applying an impulse every frame would result in a framerate-dependent force. For this reason, it should only be used when simulating one-time impacts (use the "_force" functions otherwise). + * This is equivalent to using [method body_apply_impulse] at the body's center of mass. + */ + static body_apply_central_impulse(body: RID, impulse: Vector2): void + + /** Applies a rotational impulse to the body. The impulse does not affect position. + * An impulse is time-independent! Applying an impulse every frame would result in a framerate-dependent force. For this reason, it should only be used when simulating one-time impacts (use the "_force" functions otherwise). + */ + static body_apply_torque_impulse(body: RID, impulse: float64): void + + /** Applies a positioned impulse to the body. The impulse can affect rotation if [param position] is different from the body's center of mass. + * An impulse is time-independent! Applying an impulse every frame would result in a framerate-dependent force. For this reason, it should only be used when simulating one-time impacts (use the "_force" functions otherwise). + * [param position] is the offset from the body origin in global coordinates. + */ + static body_apply_impulse(body: RID, impulse: Vector2, position: Vector2 = Vector2.ZERO): void + + /** Applies a directional force to the body, at the body's center of mass. The force does not affect rotation. A force is time dependent and meant to be applied every physics update. + * This is equivalent to using [method body_apply_force] at the body's center of mass. + */ + static body_apply_central_force(body: RID, force: Vector2): void + + /** Applies a positioned force to the body. The force can affect rotation if [param position] is different from the body's center of mass. A force is time dependent and meant to be applied every physics update. + * [param position] is the offset from the body origin in global coordinates. + */ + static body_apply_force(body: RID, force: Vector2, position: Vector2 = Vector2.ZERO): void + + /** Applies a rotational force to the body. The force does not affect position. A force is time dependent and meant to be applied every physics update. */ + static body_apply_torque(body: RID, torque: float64): void + + /** Adds a constant directional force to the body. The force does not affect rotation. The force remains applied over time until cleared with `PhysicsServer2D.body_set_constant_force(body, Vector2(0, 0))`. + * This is equivalent to using [method body_add_constant_force] at the body's center of mass. + */ + static body_add_constant_central_force(body: RID, force: Vector2): void + + /** Adds a constant positioned force to the body. The force can affect rotation if [param position] is different from the body's center of mass. The force remains applied over time until cleared with `PhysicsServer2D.body_set_constant_force(body, Vector2(0, 0))`. + * [param position] is the offset from the body origin in global coordinates. + */ + static body_add_constant_force(body: RID, force: Vector2, position: Vector2 = Vector2.ZERO): void + + /** Adds a constant rotational force to the body. The force does not affect position. The force remains applied over time until cleared with `PhysicsServer2D.body_set_constant_torque(body, 0)`. */ + static body_add_constant_torque(body: RID, torque: float64): void + + /** Sets the body's total constant positional force applied during each physics update. + * See [method body_add_constant_force] and [method body_add_constant_central_force]. + */ + static body_set_constant_force(body: RID, force: Vector2): void + + /** Returns the body's total constant positional force applied during each physics update. + * See [method body_add_constant_force] and [method body_add_constant_central_force]. + */ + static body_get_constant_force(body: RID): Vector2 + + /** Sets the body's total constant rotational force applied during each physics update. + * See [method body_add_constant_torque]. + */ + static body_set_constant_torque(body: RID, torque: float64): void + + /** Returns the body's total constant rotational force applied during each physics update. + * See [method body_add_constant_torque]. + */ + static body_get_constant_torque(body: RID): float64 + + /** Modifies the body's linear velocity so that its projection to the axis `axis_velocity.normalized()` is exactly `axis_velocity.length()`. This is useful for jumping behavior. */ + static body_set_axis_velocity(body: RID, axis_velocity: Vector2): void + + /** Adds [param excepted_body] to the body's list of collision exceptions, so that collisions with it are ignored. */ + static body_add_collision_exception(body: RID, excepted_body: RID): void + + /** Removes [param excepted_body] from the body's list of collision exceptions, so that collisions with it are no longer ignored. */ + static body_remove_collision_exception(body: RID, excepted_body: RID): void + + /** Sets the maximum number of contacts that the body can report. If [param amount] is greater than zero, then the body will keep track of at most this many contacts with other bodies. */ + static body_set_max_contacts_reported(body: RID, amount: int64): void + + /** Returns the maximum number of contacts that the body can report. See [method body_set_max_contacts_reported]. */ + static body_get_max_contacts_reported(body: RID): int64 + + /** Sets whether the body omits the standard force integration. If [param enable] is `true`, the body will not automatically use applied forces, torques, and damping to update the body's linear and angular velocity. In this case, [method body_set_force_integration_callback] can be used to manually update the linear and angular velocity instead. + * This method is called when the property [member RigidBody2D.custom_integrator] is set. + */ + static body_set_omit_force_integration(body: RID, enable: boolean): void + + /** Returns `true` if the body is omitting the standard force integration. See [method body_set_omit_force_integration]. */ + static body_is_omitting_force_integration(body: RID): boolean + + /** Sets the body's state synchronization callback function to [param callable]. Use an empty [Callable] ([code skip-lint]Callable()`) to clear the callback. + * The function [param callable] will be called every physics frame, assuming that the body was active during the previous physics tick, and can be used to fetch the latest state from the physics server. + * The function [param callable] must take the following parameters: + * 1. `state`: a [PhysicsDirectBodyState2D], used to retrieve the body's state. + */ + static body_set_state_sync_callback(body: RID, callable: Callable): void + + /** Sets the body's custom force integration callback function to [param callable]. Use an empty [Callable] ([code skip-lint]Callable()`) to clear the custom callback. + * The function [param callable] will be called every physics tick, before the standard force integration (see [method body_set_omit_force_integration]). It can be used for example to update the body's linear and angular velocity based on contact with other bodies. + * If [param userdata] is not `null`, the function [param callable] must take the following two parameters: + * 1. `state`: a [PhysicsDirectBodyState2D] used to retrieve and modify the body's state, + * 2. [code skip-lint]userdata`: a [Variant]; its value will be the [param userdata] passed into this method. + * If [param userdata] is `null`, then [param callable] must take only the `state` parameter. + */ + static body_set_force_integration_callback(body: RID, callable: Callable, userdata: any = {}): void + + /** Returns `true` if a collision would result from moving the body along a motion vector from a given point in space. See [PhysicsTestMotionParameters2D] for the available motion parameters. Optionally a [PhysicsTestMotionResult2D] object can be passed, which will be used to store the information about the resulting collision. */ + static body_test_motion(body: RID, parameters: PhysicsTestMotionParameters2D, result: PhysicsTestMotionResult2D = undefined): boolean + + /** Returns the [PhysicsDirectBodyState2D] of the body. Returns `null` if the body is destroyed or not assigned to a space. */ + static body_get_direct_state(body: RID): PhysicsDirectBodyState2D + + /** Creates a 2D joint in the physics server, and returns the [RID] that identifies it. To set the joint type, use [method joint_make_damped_spring], [method joint_make_groove] or [method joint_make_pin]. Use [method joint_set_param] to set generic joint parameters. */ + static joint_create(): RID + + /** Destroys the joint with the given [RID], creates a new uninitialized joint, and makes the [RID] refer to this new joint. */ + static joint_clear(joint: RID): void + + /** Sets the value of the given joint parameter. See [enum JointParam] for the list of available parameters. */ + static joint_set_param(joint: RID, param: PhysicsServer2D.JointParam, value: float64): void + + /** Returns the value of the given joint parameter. See [enum JointParam] for the list of available parameters. */ + static joint_get_param(joint: RID, param: PhysicsServer2D.JointParam): float64 + + /** Sets whether the bodies attached to the [Joint2D] will collide with each other. */ + static joint_disable_collisions_between_bodies(joint: RID, disable: boolean): void + + /** Returns whether the bodies attached to the [Joint2D] will collide with each other. */ + static joint_is_disabled_collisions_between_bodies(joint: RID): boolean + + /** Makes the joint a pin joint. If [param body_b] is an empty [RID], then [param body_a] is pinned to the point [param anchor] (given in global coordinates); otherwise, [param body_a] is pinned to [param body_b] at the point [param anchor] (given in global coordinates). To set the parameters which are specific to the pin joint, see [method pin_joint_set_param]. */ + static joint_make_pin(joint: RID, anchor: Vector2, body_a: RID, body_b: RID = new RID()): void + + /** Makes the joint a groove joint. */ + static joint_make_groove(joint: RID, groove1_a: Vector2, groove2_a: Vector2, anchor_b: Vector2, body_a: RID = new RID(), body_b: RID = new RID()): void + + /** Makes the joint a damped spring joint, attached at the point [param anchor_a] (given in global coordinates) on the body [param body_a] and at the point [param anchor_b] (given in global coordinates) on the body [param body_b]. To set the parameters which are specific to the damped spring, see [method damped_spring_joint_set_param]. */ + static joint_make_damped_spring(joint: RID, anchor_a: Vector2, anchor_b: Vector2, body_a: RID, body_b: RID = new RID()): void + + /** Sets a pin joint flag (see [enum PinJointFlag] constants). */ + static pin_joint_set_flag(joint: RID, flag: PhysicsServer2D.PinJointFlag, enabled: boolean): void + + /** Gets a pin joint flag (see [enum PinJointFlag] constants). */ + static pin_joint_get_flag(joint: RID, flag: PhysicsServer2D.PinJointFlag): boolean + + /** Sets a pin joint parameter. See [enum PinJointParam] for a list of available parameters. */ + static pin_joint_set_param(joint: RID, param: PhysicsServer2D.PinJointParam, value: float64): void + + /** Returns the value of a pin joint parameter. See [enum PinJointParam] for a list of available parameters. */ + static pin_joint_get_param(joint: RID, param: PhysicsServer2D.PinJointParam): float64 + + /** Sets the value of the given damped spring joint parameter. See [enum DampedSpringParam] for the list of available parameters. */ + static damped_spring_joint_set_param(joint: RID, param: PhysicsServer2D.DampedSpringParam, value: float64): void + + /** Returns the value of the given damped spring joint parameter. See [enum DampedSpringParam] for the list of available parameters. */ + static damped_spring_joint_get_param(joint: RID, param: PhysicsServer2D.DampedSpringParam): float64 + + /** Returns the joint's type (see [enum JointType]). */ + static joint_get_type(joint: RID): PhysicsServer2D.JointType + + /** Destroys any of the objects created by PhysicsServer2D. If the [RID] passed is not one of the objects that can be created by PhysicsServer2D, an error will be printed to the console. */ + static free_rid(rid: RID): void + + /** Activates or deactivates the 2D physics server. If [param active] is `false`, then the physics server will not do anything in its physics step. */ + static set_active(active: boolean): void + + /** Returns information about the current state of the 2D physics engine. See [enum ProcessInfo] for the list of available states. */ + static get_process_info(process_info: PhysicsServer2D.ProcessInfo): int64 + } + // _singleton_class_: PhysicsServer3D + namespace PhysicsServer3D { + enum JointType { + /** The [Joint3D] is a [PinJoint3D]. */ + JOINT_TYPE_PIN = 0, + + /** The [Joint3D] is a [HingeJoint3D]. */ + JOINT_TYPE_HINGE = 1, + + /** The [Joint3D] is a [SliderJoint3D]. */ + JOINT_TYPE_SLIDER = 2, + + /** The [Joint3D] is a [ConeTwistJoint3D]. */ + JOINT_TYPE_CONE_TWIST = 3, + + /** The [Joint3D] is a [Generic6DOFJoint3D]. */ + JOINT_TYPE_6DOF = 4, + + /** Represents the size of the [enum JointType] enum. */ + JOINT_TYPE_MAX = 5, + } + enum PinJointParam { + /** The strength with which the pinned objects try to stay in positional relation to each other. + * The higher, the stronger. + */ + PIN_JOINT_BIAS = 0, + + /** The strength with which the pinned objects try to stay in velocity relation to each other. + * The higher, the stronger. + */ + PIN_JOINT_DAMPING = 1, + + /** If above 0, this value is the maximum value for an impulse that this Joint3D puts on its ends. */ + PIN_JOINT_IMPULSE_CLAMP = 2, + } + enum HingeJointParam { + /** The speed with which the two bodies get pulled together when they move in different directions. */ + HINGE_JOINT_BIAS = 0, + + /** The maximum rotation across the Hinge. */ + HINGE_JOINT_LIMIT_UPPER = 1, + + /** The minimum rotation across the Hinge. */ + HINGE_JOINT_LIMIT_LOWER = 2, + + /** The speed with which the rotation across the axis perpendicular to the hinge gets corrected. */ + HINGE_JOINT_LIMIT_BIAS = 3, + HINGE_JOINT_LIMIT_SOFTNESS = 4, + + /** The lower this value, the more the rotation gets slowed down. */ + HINGE_JOINT_LIMIT_RELAXATION = 5, + + /** Target speed for the motor. */ + HINGE_JOINT_MOTOR_TARGET_VELOCITY = 6, + + /** Maximum acceleration for the motor. */ + HINGE_JOINT_MOTOR_MAX_IMPULSE = 7, + } + enum HingeJointFlag { + /** If `true`, the Hinge has a maximum and a minimum rotation. */ + HINGE_JOINT_FLAG_USE_LIMIT = 0, + + /** If `true`, a motor turns the Hinge. */ + HINGE_JOINT_FLAG_ENABLE_MOTOR = 1, + } + enum SliderJointParam { + /** The maximum difference between the pivot points on their X axis before damping happens. */ + SLIDER_JOINT_LINEAR_LIMIT_UPPER = 0, + + /** The minimum difference between the pivot points on their X axis before damping happens. */ + SLIDER_JOINT_LINEAR_LIMIT_LOWER = 1, + + /** A factor applied to the movement across the slider axis once the limits get surpassed. The lower, the slower the movement. */ + SLIDER_JOINT_LINEAR_LIMIT_SOFTNESS = 2, + + /** The amount of restitution once the limits are surpassed. The lower, the more velocity-energy gets lost. */ + SLIDER_JOINT_LINEAR_LIMIT_RESTITUTION = 3, + + /** The amount of damping once the slider limits are surpassed. */ + SLIDER_JOINT_LINEAR_LIMIT_DAMPING = 4, + + /** A factor applied to the movement across the slider axis as long as the slider is in the limits. The lower, the slower the movement. */ + SLIDER_JOINT_LINEAR_MOTION_SOFTNESS = 5, + + /** The amount of restitution inside the slider limits. */ + SLIDER_JOINT_LINEAR_MOTION_RESTITUTION = 6, + + /** The amount of damping inside the slider limits. */ + SLIDER_JOINT_LINEAR_MOTION_DAMPING = 7, + + /** A factor applied to the movement across axes orthogonal to the slider. */ + SLIDER_JOINT_LINEAR_ORTHOGONAL_SOFTNESS = 8, + + /** The amount of restitution when movement is across axes orthogonal to the slider. */ + SLIDER_JOINT_LINEAR_ORTHOGONAL_RESTITUTION = 9, + + /** The amount of damping when movement is across axes orthogonal to the slider. */ + SLIDER_JOINT_LINEAR_ORTHOGONAL_DAMPING = 10, + + /** The upper limit of rotation in the slider. */ + SLIDER_JOINT_ANGULAR_LIMIT_UPPER = 11, + + /** The lower limit of rotation in the slider. */ + SLIDER_JOINT_ANGULAR_LIMIT_LOWER = 12, + + /** A factor applied to the all rotation once the limit is surpassed. */ + SLIDER_JOINT_ANGULAR_LIMIT_SOFTNESS = 13, + + /** The amount of restitution of the rotation when the limit is surpassed. */ + SLIDER_JOINT_ANGULAR_LIMIT_RESTITUTION = 14, + + /** The amount of damping of the rotation when the limit is surpassed. */ + SLIDER_JOINT_ANGULAR_LIMIT_DAMPING = 15, + + /** A factor that gets applied to the all rotation in the limits. */ + SLIDER_JOINT_ANGULAR_MOTION_SOFTNESS = 16, + + /** The amount of restitution of the rotation in the limits. */ + SLIDER_JOINT_ANGULAR_MOTION_RESTITUTION = 17, + + /** The amount of damping of the rotation in the limits. */ + SLIDER_JOINT_ANGULAR_MOTION_DAMPING = 18, + + /** A factor that gets applied to the all rotation across axes orthogonal to the slider. */ + SLIDER_JOINT_ANGULAR_ORTHOGONAL_SOFTNESS = 19, + + /** The amount of restitution of the rotation across axes orthogonal to the slider. */ + SLIDER_JOINT_ANGULAR_ORTHOGONAL_RESTITUTION = 20, + + /** The amount of damping of the rotation across axes orthogonal to the slider. */ + SLIDER_JOINT_ANGULAR_ORTHOGONAL_DAMPING = 21, + + /** Represents the size of the [enum SliderJointParam] enum. */ + SLIDER_JOINT_MAX = 22, + } + enum ConeTwistJointParam { + /** Swing is rotation from side to side, around the axis perpendicular to the twist axis. + * The swing span defines, how much rotation will not get corrected along the swing axis. + * Could be defined as looseness in the [ConeTwistJoint3D]. + * If below 0.05, this behavior is locked. + */ + CONE_TWIST_JOINT_SWING_SPAN = 0, + + /** Twist is the rotation around the twist axis, this value defined how far the joint can twist. + * Twist is locked if below 0.05. + */ + CONE_TWIST_JOINT_TWIST_SPAN = 1, + + /** The speed with which the swing or twist will take place. + * The higher, the faster. + */ + CONE_TWIST_JOINT_BIAS = 2, + + /** The ease with which the Joint3D twists, if it's too low, it takes more force to twist the joint. */ + CONE_TWIST_JOINT_SOFTNESS = 3, + + /** Defines, how fast the swing- and twist-speed-difference on both sides gets synced. */ + CONE_TWIST_JOINT_RELAXATION = 4, + } + enum G6DOFJointAxisParam { + /** The minimum difference between the pivot points' axes. */ + G6DOF_JOINT_LINEAR_LOWER_LIMIT = 0, + + /** The maximum difference between the pivot points' axes. */ + G6DOF_JOINT_LINEAR_UPPER_LIMIT = 1, + + /** A factor that gets applied to the movement across the axes. The lower, the slower the movement. */ + G6DOF_JOINT_LINEAR_LIMIT_SOFTNESS = 2, + + /** The amount of restitution on the axes movement. The lower, the more velocity-energy gets lost. */ + G6DOF_JOINT_LINEAR_RESTITUTION = 3, + + /** The amount of damping that happens at the linear motion across the axes. */ + G6DOF_JOINT_LINEAR_DAMPING = 4, + + /** The velocity that the joint's linear motor will attempt to reach. */ + G6DOF_JOINT_LINEAR_MOTOR_TARGET_VELOCITY = 5, + + /** The maximum force that the linear motor can apply while trying to reach the target velocity. */ + G6DOF_JOINT_LINEAR_MOTOR_FORCE_LIMIT = 6, + G6DOF_JOINT_LINEAR_SPRING_STIFFNESS = 7, + G6DOF_JOINT_LINEAR_SPRING_DAMPING = 8, + G6DOF_JOINT_LINEAR_SPRING_EQUILIBRIUM_POINT = 9, + + /** The minimum rotation in negative direction to break loose and rotate around the axes. */ + G6DOF_JOINT_ANGULAR_LOWER_LIMIT = 10, + + /** The minimum rotation in positive direction to break loose and rotate around the axes. */ + G6DOF_JOINT_ANGULAR_UPPER_LIMIT = 11, + + /** A factor that gets multiplied onto all rotations across the axes. */ + G6DOF_JOINT_ANGULAR_LIMIT_SOFTNESS = 12, + + /** The amount of rotational damping across the axes. The lower, the more damping occurs. */ + G6DOF_JOINT_ANGULAR_DAMPING = 13, + + /** The amount of rotational restitution across the axes. The lower, the more restitution occurs. */ + G6DOF_JOINT_ANGULAR_RESTITUTION = 14, + + /** The maximum amount of force that can occur, when rotating around the axes. */ + G6DOF_JOINT_ANGULAR_FORCE_LIMIT = 15, + + /** When correcting the crossing of limits in rotation across the axes, this error tolerance factor defines how much the correction gets slowed down. The lower, the slower. */ + G6DOF_JOINT_ANGULAR_ERP = 16, + + /** Target speed for the motor at the axes. */ + G6DOF_JOINT_ANGULAR_MOTOR_TARGET_VELOCITY = 17, + + /** Maximum acceleration for the motor at the axes. */ + G6DOF_JOINT_ANGULAR_MOTOR_FORCE_LIMIT = 18, + G6DOF_JOINT_ANGULAR_SPRING_STIFFNESS = 19, + G6DOF_JOINT_ANGULAR_SPRING_DAMPING = 20, + G6DOF_JOINT_ANGULAR_SPRING_EQUILIBRIUM_POINT = 21, + + /** Represents the size of the [enum G6DOFJointAxisParam] enum. */ + G6DOF_JOINT_MAX = 22, + } + enum G6DOFJointAxisFlag { + /** If set, linear motion is possible within the given limits. */ + G6DOF_JOINT_FLAG_ENABLE_LINEAR_LIMIT = 0, + + /** If set, rotational motion is possible. */ + G6DOF_JOINT_FLAG_ENABLE_ANGULAR_LIMIT = 1, + G6DOF_JOINT_FLAG_ENABLE_ANGULAR_SPRING = 2, + G6DOF_JOINT_FLAG_ENABLE_LINEAR_SPRING = 3, + + /** If set, there is a rotational motor across these axes. */ + G6DOF_JOINT_FLAG_ENABLE_MOTOR = 4, + + /** If set, there is a linear motor on this axis that targets a specific velocity. */ + G6DOF_JOINT_FLAG_ENABLE_LINEAR_MOTOR = 5, + + /** Represents the size of the [enum G6DOFJointAxisFlag] enum. */ + G6DOF_JOINT_FLAG_MAX = 6, + } + enum ShapeType { + /** The [Shape3D] is a [WorldBoundaryShape3D]. */ + SHAPE_WORLD_BOUNDARY = 0, + + /** The [Shape3D] is a [SeparationRayShape3D]. */ + SHAPE_SEPARATION_RAY = 1, + + /** The [Shape3D] is a [SphereShape3D]. */ + SHAPE_SPHERE = 2, + + /** The [Shape3D] is a [BoxShape3D]. */ + SHAPE_BOX = 3, + + /** The [Shape3D] is a [CapsuleShape3D]. */ + SHAPE_CAPSULE = 4, + + /** The [Shape3D] is a [CylinderShape3D]. */ + SHAPE_CYLINDER = 5, + + /** The [Shape3D] is a [ConvexPolygonShape3D]. */ + SHAPE_CONVEX_POLYGON = 6, + + /** The [Shape3D] is a [ConcavePolygonShape3D]. */ + SHAPE_CONCAVE_POLYGON = 7, + + /** The [Shape3D] is a [HeightMapShape3D]. */ + SHAPE_HEIGHTMAP = 8, + + /** The [Shape3D] is used internally for a soft body. Any attempt to create this kind of shape results in an error. */ + SHAPE_SOFT_BODY = 9, + + /** This constant is used internally by the engine. Any attempt to create this kind of shape results in an error. */ + SHAPE_CUSTOM = 10, + } + enum AreaParameter { + /** Constant to set/get gravity override mode in an area. See [enum AreaSpaceOverrideMode] for possible values. */ + AREA_PARAM_GRAVITY_OVERRIDE_MODE = 0, + + /** Constant to set/get gravity strength in an area. */ + AREA_PARAM_GRAVITY = 1, + + /** Constant to set/get gravity vector/center in an area. */ + AREA_PARAM_GRAVITY_VECTOR = 2, + + /** Constant to set/get whether the gravity vector of an area is a direction, or a center point. */ + AREA_PARAM_GRAVITY_IS_POINT = 3, + + /** Constant to set/get the distance at which the gravity strength is equal to the gravity controlled by [constant AREA_PARAM_GRAVITY]. For example, on a planet 100 meters in radius with a surface gravity of 4.0 m/s², set the gravity to 4.0 and the unit distance to 100.0. The gravity will have falloff according to the inverse square law, so in the example, at 200 meters from the center the gravity will be 1.0 m/s² (twice the distance, 1/4th the gravity), at 50 meters it will be 16.0 m/s² (half the distance, 4x the gravity), and so on. + * The above is true only when the unit distance is a positive number. When this is set to 0.0, the gravity will be constant regardless of distance. + */ + AREA_PARAM_GRAVITY_POINT_UNIT_DISTANCE = 4, + + /** Constant to set/get linear damping override mode in an area. See [enum AreaSpaceOverrideMode] for possible values. */ + AREA_PARAM_LINEAR_DAMP_OVERRIDE_MODE = 5, + + /** Constant to set/get the linear damping factor of an area. */ + AREA_PARAM_LINEAR_DAMP = 6, + + /** Constant to set/get angular damping override mode in an area. See [enum AreaSpaceOverrideMode] for possible values. */ + AREA_PARAM_ANGULAR_DAMP_OVERRIDE_MODE = 7, + + /** Constant to set/get the angular damping factor of an area. */ + AREA_PARAM_ANGULAR_DAMP = 8, + + /** Constant to set/get the priority (order of processing) of an area. */ + AREA_PARAM_PRIORITY = 9, + + /** Constant to set/get the magnitude of area-specific wind force. This wind force only applies to [SoftBody3D] nodes. Other physics bodies are currently not affected by wind. */ + AREA_PARAM_WIND_FORCE_MAGNITUDE = 10, + + /** Constant to set/get the 3D vector that specifies the origin from which an area-specific wind blows. */ + AREA_PARAM_WIND_SOURCE = 11, + + /** Constant to set/get the 3D vector that specifies the direction in which an area-specific wind blows. */ + AREA_PARAM_WIND_DIRECTION = 12, + + /** Constant to set/get the exponential rate at which wind force decreases with distance from its origin. */ + AREA_PARAM_WIND_ATTENUATION_FACTOR = 13, + } + enum AreaSpaceOverrideMode { + /** This area does not affect gravity/damp. These are generally areas that exist only to detect collisions, and objects entering or exiting them. */ + AREA_SPACE_OVERRIDE_DISABLED = 0, + + /** This area adds its gravity/damp values to whatever has been calculated so far. This way, many overlapping areas can combine their physics to make interesting effects. */ + AREA_SPACE_OVERRIDE_COMBINE = 1, + + /** This area adds its gravity/damp values to whatever has been calculated so far. Then stops taking into account the rest of the areas, even the default one. */ + AREA_SPACE_OVERRIDE_COMBINE_REPLACE = 2, + + /** This area replaces any gravity/damp, even the default one, and stops taking into account the rest of the areas. */ + AREA_SPACE_OVERRIDE_REPLACE = 3, + + /** This area replaces any gravity/damp calculated so far, but keeps calculating the rest of the areas, down to the default one. */ + AREA_SPACE_OVERRIDE_REPLACE_COMBINE = 4, + } + enum BodyMode { + /** Constant for static bodies. In this mode, a body can be only moved by user code and doesn't collide with other bodies along its path when moved. */ + BODY_MODE_STATIC = 0, + + /** Constant for kinematic bodies. In this mode, a body can be only moved by user code and collides with other bodies along its path. */ + BODY_MODE_KINEMATIC = 1, + + /** Constant for rigid bodies. In this mode, a body can be pushed by other bodies and has forces applied. */ + BODY_MODE_RIGID = 2, + + /** Constant for linear rigid bodies. In this mode, a body can not rotate, and only its linear velocity is affected by external forces. */ + BODY_MODE_RIGID_LINEAR = 3, + } + enum BodyParameter { + /** Constant to set/get a body's bounce factor. */ + BODY_PARAM_BOUNCE = 0, + + /** Constant to set/get a body's friction. */ + BODY_PARAM_FRICTION = 1, + + /** Constant to set/get a body's mass. */ + BODY_PARAM_MASS = 2, + + /** Constant to set/get a body's inertia. */ + BODY_PARAM_INERTIA = 3, + + /** Constant to set/get a body's center of mass position in the body's local coordinate system. */ + BODY_PARAM_CENTER_OF_MASS = 4, + + /** Constant to set/get a body's gravity multiplier. */ + BODY_PARAM_GRAVITY_SCALE = 5, + + /** Constant to set/get a body's linear damping mode. See [enum BodyDampMode] for possible values. */ + BODY_PARAM_LINEAR_DAMP_MODE = 6, + + /** Constant to set/get a body's angular damping mode. See [enum BodyDampMode] for possible values. */ + BODY_PARAM_ANGULAR_DAMP_MODE = 7, + + /** Constant to set/get a body's linear damping factor. */ + BODY_PARAM_LINEAR_DAMP = 8, + + /** Constant to set/get a body's angular damping factor. */ + BODY_PARAM_ANGULAR_DAMP = 9, + + /** Represents the size of the [enum BodyParameter] enum. */ + BODY_PARAM_MAX = 10, + } + enum BodyDampMode { + /** The body's damping value is added to any value set in areas or the default value. */ + BODY_DAMP_MODE_COMBINE = 0, + + /** The body's damping value replaces any value set in areas or the default value. */ + BODY_DAMP_MODE_REPLACE = 1, + } + enum BodyState { + /** Constant to set/get the current transform matrix of the body. */ + BODY_STATE_TRANSFORM = 0, + + /** Constant to set/get the current linear velocity of the body. */ + BODY_STATE_LINEAR_VELOCITY = 1, + + /** Constant to set/get the current angular velocity of the body. */ + BODY_STATE_ANGULAR_VELOCITY = 2, + + /** Constant to sleep/wake up a body, or to get whether it is sleeping. */ + BODY_STATE_SLEEPING = 3, + + /** Constant to set/get whether the body can sleep. */ + BODY_STATE_CAN_SLEEP = 4, + } + enum AreaBodyStatus { + /** The value of the first parameter and area callback function receives, when an object enters one of its shapes. */ + AREA_BODY_ADDED = 0, + + /** The value of the first parameter and area callback function receives, when an object exits one of its shapes. */ + AREA_BODY_REMOVED = 1, + } + enum ProcessInfo { + /** Constant to get the number of objects that are not sleeping. */ + INFO_ACTIVE_OBJECTS = 0, + + /** Constant to get the number of possible collisions. */ + INFO_COLLISION_PAIRS = 1, + + /** Constant to get the number of space regions where a collision could occur. */ + INFO_ISLAND_COUNT = 2, + } + enum SpaceParameter { + /** Constant to set/get the maximum distance a pair of bodies has to move before their collision status has to be recalculated. */ + SPACE_PARAM_CONTACT_RECYCLE_RADIUS = 0, + + /** Constant to set/get the maximum distance a shape can be from another before they are considered separated and the contact is discarded. */ + SPACE_PARAM_CONTACT_MAX_SEPARATION = 1, + + /** Constant to set/get the maximum distance a shape can penetrate another shape before it is considered a collision. */ + SPACE_PARAM_CONTACT_MAX_ALLOWED_PENETRATION = 2, + + /** Constant to set/get the default solver bias for all physics contacts. A solver bias is a factor controlling how much two objects "rebound", after overlapping, to avoid leaving them in that state because of numerical imprecision. */ + SPACE_PARAM_CONTACT_DEFAULT_BIAS = 3, + + /** Constant to set/get the threshold linear velocity of activity. A body marked as potentially inactive for both linear and angular velocity will be put to sleep after the time given. */ + SPACE_PARAM_BODY_LINEAR_VELOCITY_SLEEP_THRESHOLD = 4, + + /** Constant to set/get the threshold angular velocity of activity. A body marked as potentially inactive for both linear and angular velocity will be put to sleep after the time given. */ + SPACE_PARAM_BODY_ANGULAR_VELOCITY_SLEEP_THRESHOLD = 5, + + /** Constant to set/get the maximum time of activity. A body marked as potentially inactive for both linear and angular velocity will be put to sleep after this time. */ + SPACE_PARAM_BODY_TIME_TO_SLEEP = 6, + + /** Constant to set/get the number of solver iterations for contacts and constraints. The greater the number of iterations, the more accurate the collisions and constraints will be. However, a greater number of iterations requires more CPU power, which can decrease performance. */ + SPACE_PARAM_SOLVER_ITERATIONS = 7, + } + enum BodyAxis { + BODY_AXIS_LINEAR_X = 1, + BODY_AXIS_LINEAR_Y = 2, + BODY_AXIS_LINEAR_Z = 4, + BODY_AXIS_ANGULAR_X = 8, + BODY_AXIS_ANGULAR_Y = 16, + BODY_AXIS_ANGULAR_Z = 32, + } + } + /** A server interface for low-level 3D physics access. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_physicsserver3d.html + */ + class PhysicsServer3D extends Object { + static world_boundary_shape_create(): RID + static separation_ray_shape_create(): RID + static sphere_shape_create(): RID + static box_shape_create(): RID + static capsule_shape_create(): RID + static cylinder_shape_create(): RID + static convex_polygon_shape_create(): RID + static concave_polygon_shape_create(): RID + static heightmap_shape_create(): RID + static custom_shape_create(): RID + + /** Sets the shape data that defines its shape and size. The data to be passed depends on the kind of shape created [method shape_get_type]. */ + static shape_set_data(shape: RID, data: any): void + + /** Sets the collision margin for the shape. + * + * **Note:** This is not used in Godot Physics. + */ + static shape_set_margin(shape: RID, margin: float64): void + + /** Returns the type of shape (see [enum ShapeType] constants). */ + static shape_get_type(shape: RID): PhysicsServer3D.ShapeType + + /** Returns the shape data. */ + static shape_get_data(shape: RID): any + + /** Returns the collision margin for the shape. + * + * **Note:** This is not used in Godot Physics, so will always return `0`. + */ + static shape_get_margin(shape: RID): float64 + + /** Creates a space. A space is a collection of parameters for the physics engine that can be assigned to an area or a body. It can be assigned to an area with [method area_set_space], or to a body with [method body_set_space]. */ + static space_create(): RID + + /** Marks a space as active. It will not have an effect, unless it is assigned to an area or body. */ + static space_set_active(space: RID, active: boolean): void + + /** Returns whether the space is active. */ + static space_is_active(space: RID): boolean + + /** Sets the value for a space parameter. A list of available parameters is on the [enum SpaceParameter] constants. */ + static space_set_param(space: RID, param: PhysicsServer3D.SpaceParameter, value: float64): void + + /** Returns the value of a space parameter. */ + static space_get_param(space: RID, param: PhysicsServer3D.SpaceParameter): float64 + + /** Returns the state of a space, a [PhysicsDirectSpaceState3D]. This object can be used to make collision/intersection queries. */ + static space_get_direct_state(space: RID): PhysicsDirectSpaceState3D + + /** Creates a 3D area object in the physics server, and returns the [RID] that identifies it. The default settings for the created area include a collision layer and mask set to `1`, and `monitorable` set to `false`. + * Use [method area_add_shape] to add shapes to it, use [method area_set_transform] to set its transform, and use [method area_set_space] to add the area to a space. If you want the area to be detectable use [method area_set_monitorable]. + */ + static area_create(): RID + + /** Assigns a space to the area. */ + static area_set_space(area: RID, space: RID): void + + /** Returns the space assigned to the area. */ + static area_get_space(area: RID): RID + + /** Adds a shape to the area, along with a transform matrix. Shapes are usually referenced by their index, so you should track which shape has a given index. */ + static area_add_shape(area: RID, shape: RID, transform: Transform3D = new Transform3D(), disabled: boolean = false): void + + /** Substitutes a given area shape by another. The old shape is selected by its index, the new one by its [RID]. */ + static area_set_shape(area: RID, shape_idx: int64, shape: RID): void + + /** Sets the transform matrix for an area shape. */ + static area_set_shape_transform(area: RID, shape_idx: int64, transform: Transform3D): void + static area_set_shape_disabled(area: RID, shape_idx: int64, disabled: boolean): void + + /** Returns the number of shapes assigned to an area. */ + static area_get_shape_count(area: RID): int64 + + /** Returns the [RID] of the nth shape of an area. */ + static area_get_shape(area: RID, shape_idx: int64): RID + + /** Returns the transform matrix of a shape within an area. */ + static area_get_shape_transform(area: RID, shape_idx: int64): Transform3D + + /** Removes a shape from an area. It does not delete the shape, so it can be reassigned later. */ + static area_remove_shape(area: RID, shape_idx: int64): void + + /** Removes all shapes from an area. It does not delete the shapes, so they can be reassigned later. */ + static area_clear_shapes(area: RID): void + + /** Assigns the area to one or many physics layers. */ + static area_set_collision_layer(area: RID, layer: int64): void + + /** Returns the physics layer or layers an area belongs to. */ + static area_get_collision_layer(area: RID): int64 + + /** Sets which physics layers the area will monitor. */ + static area_set_collision_mask(area: RID, mask: int64): void + + /** Returns the physics layer or layers an area can contact with. */ + static area_get_collision_mask(area: RID): int64 + + /** Sets the value for an area parameter. A list of available parameters is on the [enum AreaParameter] constants. */ + static area_set_param(area: RID, param: PhysicsServer3D.AreaParameter, value: any): void + + /** Sets the transform matrix for an area. */ + static area_set_transform(area: RID, transform: Transform3D): void + + /** Returns an area parameter value. A list of available parameters is on the [enum AreaParameter] constants. */ + static area_get_param(area: RID, param: PhysicsServer3D.AreaParameter): any + + /** Returns the transform matrix for an area. */ + static area_get_transform(area: RID): Transform3D + + /** Assigns the area to a descendant of [Object], so it can exist in the node tree. */ + static area_attach_object_instance_id(area: RID, id: int64): void + + /** Gets the instance ID of the object the area is assigned to. */ + static area_get_object_instance_id(area: RID): int64 + + /** Sets the area's body monitor callback. This callback will be called when any other (shape of a) body enters or exits (a shape of) the given area, and must take the following five parameters: + * 1. an integer `status`: either [constant AREA_BODY_ADDED] or [constant AREA_BODY_REMOVED] depending on whether the other body shape entered or exited the area, + * 2. an [RID] `body_rid`: the [RID] of the body that entered or exited the area, + * 3. an integer `instance_id`: the `ObjectID` attached to the body, + * 4. an integer `body_shape_idx`: the index of the shape of the body that entered or exited the area, + * 5. an integer `self_shape_idx`: the index of the shape of the area where the body entered or exited. + * By counting (or keeping track of) the shapes that enter and exit, it can be determined if a body (with all its shapes) is entering for the first time or exiting for the last time. + */ + static area_set_monitor_callback(area: RID, callback: Callable): void + + /** Sets the area's area monitor callback. This callback will be called when any other (shape of an) area enters or exits (a shape of) the given area, and must take the following five parameters: + * 1. an integer `status`: either [constant AREA_BODY_ADDED] or [constant AREA_BODY_REMOVED] depending on whether the other area's shape entered or exited the area, + * 2. an [RID] `area_rid`: the [RID] of the other area that entered or exited the area, + * 3. an integer `instance_id`: the `ObjectID` attached to the other area, + * 4. an integer `area_shape_idx`: the index of the shape of the other area that entered or exited the area, + * 5. an integer `self_shape_idx`: the index of the shape of the area where the other area entered or exited. + * By counting (or keeping track of) the shapes that enter and exit, it can be determined if an area (with all its shapes) is entering for the first time or exiting for the last time. + */ + static area_set_area_monitor_callback(area: RID, callback: Callable): void + static area_set_monitorable(area: RID, monitorable: boolean): void + + /** Sets object pickable with rays. */ + static area_set_ray_pickable(area: RID, enable: boolean): void + + /** Creates a 3D body object in the physics server, and returns the [RID] that identifies it. The default settings for the created area include a collision layer and mask set to `1`, and body mode set to [constant BODY_MODE_RIGID]. + * Use [method body_add_shape] to add shapes to it, use [method body_set_state] to set its transform, and use [method body_set_space] to add the body to a space. + */ + static body_create(): RID + + /** Assigns a space to the body (see [method space_create]). */ + static body_set_space(body: RID, space: RID): void + + /** Returns the [RID] of the space assigned to a body. */ + static body_get_space(body: RID): RID + + /** Sets the body mode, from one of the [enum BodyMode] constants. */ + static body_set_mode(body: RID, mode: PhysicsServer3D.BodyMode): void + + /** Returns the body mode. */ + static body_get_mode(body: RID): PhysicsServer3D.BodyMode + + /** Sets the physics layer or layers a body belongs to. */ + static body_set_collision_layer(body: RID, layer: int64): void + + /** Returns the physics layer or layers a body belongs to. */ + static body_get_collision_layer(body: RID): int64 + + /** Sets the physics layer or layers a body can collide with. */ + static body_set_collision_mask(body: RID, mask: int64): void + + /** Returns the physics layer or layers a body can collide with. */ + static body_get_collision_mask(body: RID): int64 + + /** Sets the body's collision priority. */ + static body_set_collision_priority(body: RID, priority: float64): void + + /** Returns the body's collision priority. */ + static body_get_collision_priority(body: RID): float64 + + /** Adds a shape to the body, along with a transform matrix. Shapes are usually referenced by their index, so you should track which shape has a given index. */ + static body_add_shape(body: RID, shape: RID, transform: Transform3D = new Transform3D(), disabled: boolean = false): void + + /** Substitutes a given body shape by another. The old shape is selected by its index, the new one by its [RID]. */ + static body_set_shape(body: RID, shape_idx: int64, shape: RID): void + + /** Sets the transform matrix for a body shape. */ + static body_set_shape_transform(body: RID, shape_idx: int64, transform: Transform3D): void + static body_set_shape_disabled(body: RID, shape_idx: int64, disabled: boolean): void + + /** Returns the number of shapes assigned to a body. */ + static body_get_shape_count(body: RID): int64 + + /** Returns the [RID] of the nth shape of a body. */ + static body_get_shape(body: RID, shape_idx: int64): RID + + /** Returns the transform matrix of a body shape. */ + static body_get_shape_transform(body: RID, shape_idx: int64): Transform3D + + /** Removes a shape from a body. The shape is not deleted, so it can be reused afterwards. */ + static body_remove_shape(body: RID, shape_idx: int64): void + + /** Removes all shapes from a body. */ + static body_clear_shapes(body: RID): void + + /** Assigns the area to a descendant of [Object], so it can exist in the node tree. */ + static body_attach_object_instance_id(body: RID, id: int64): void + + /** Gets the instance ID of the object the area is assigned to. */ + static body_get_object_instance_id(body: RID): int64 + + /** If `true`, the continuous collision detection mode is enabled. + * Continuous collision detection tries to predict where a moving body will collide, instead of moving it and correcting its movement if it collided. + */ + static body_set_enable_continuous_collision_detection(body: RID, enable: boolean): void + + /** If `true`, the continuous collision detection mode is enabled. */ + static body_is_continuous_collision_detection_enabled(body: RID): boolean + + /** Sets a body parameter. A list of available parameters is on the [enum BodyParameter] constants. */ + static body_set_param(body: RID, param: PhysicsServer3D.BodyParameter, value: any): void + + /** Returns the value of a body parameter. A list of available parameters is on the [enum BodyParameter] constants. */ + static body_get_param(body: RID, param: PhysicsServer3D.BodyParameter): any + + /** Restores the default inertia and center of mass based on shapes to cancel any custom values previously set using [method body_set_param]. */ + static body_reset_mass_properties(body: RID): void + + /** Sets a body state (see [enum BodyState] constants). */ + static body_set_state(body: RID, state: PhysicsServer3D.BodyState, value: any): void + + /** Returns a body state. */ + static body_get_state(body: RID, state: PhysicsServer3D.BodyState): any + + /** Applies a directional impulse without affecting rotation. + * An impulse is time-independent! Applying an impulse every frame would result in a framerate-dependent force. For this reason, it should only be used when simulating one-time impacts (use the "_force" functions otherwise). + * This is equivalent to using [method body_apply_impulse] at the body's center of mass. + */ + static body_apply_central_impulse(body: RID, impulse: Vector3): void + + /** Applies a positioned impulse to the body. + * An impulse is time-independent! Applying an impulse every frame would result in a framerate-dependent force. For this reason, it should only be used when simulating one-time impacts (use the "_force" functions otherwise). + * [param position] is the offset from the body origin in global coordinates. + */ + static body_apply_impulse(body: RID, impulse: Vector3, position: Vector3 = new Vector3(0, 0, 0)): void + + /** Applies a rotational impulse to the body without affecting the position. + * An impulse is time-independent! Applying an impulse every frame would result in a framerate-dependent force. For this reason, it should only be used when simulating one-time impacts (use the "_force" functions otherwise). + */ + static body_apply_torque_impulse(body: RID, impulse: Vector3): void + + /** Applies a directional force without affecting rotation. A force is time dependent and meant to be applied every physics update. + * This is equivalent to using [method body_apply_force] at the body's center of mass. + */ + static body_apply_central_force(body: RID, force: Vector3): void + + /** Applies a positioned force to the body. A force is time dependent and meant to be applied every physics update. + * [param position] is the offset from the body origin in global coordinates. + */ + static body_apply_force(body: RID, force: Vector3, position: Vector3 = new Vector3(0, 0, 0)): void + + /** Applies a rotational force without affecting position. A force is time dependent and meant to be applied every physics update. */ + static body_apply_torque(body: RID, torque: Vector3): void + + /** Adds a constant directional force without affecting rotation that keeps being applied over time until cleared with `body_set_constant_force(body, Vector3(0, 0, 0))`. + * This is equivalent to using [method body_add_constant_force] at the body's center of mass. + */ + static body_add_constant_central_force(body: RID, force: Vector3): void + + /** Adds a constant positioned force to the body that keeps being applied over time until cleared with `body_set_constant_force(body, Vector3(0, 0, 0))`. + * [param position] is the offset from the body origin in global coordinates. + */ + static body_add_constant_force(body: RID, force: Vector3, position: Vector3 = new Vector3(0, 0, 0)): void + + /** Adds a constant rotational force without affecting position that keeps being applied over time until cleared with `body_set_constant_torque(body, Vector3(0, 0, 0))`. */ + static body_add_constant_torque(body: RID, torque: Vector3): void + + /** Sets the body's total constant positional forces applied during each physics update. + * See [method body_add_constant_force] and [method body_add_constant_central_force]. + */ + static body_set_constant_force(body: RID, force: Vector3): void + + /** Returns the body's total constant positional forces applied during each physics update. + * See [method body_add_constant_force] and [method body_add_constant_central_force]. + */ + static body_get_constant_force(body: RID): Vector3 + + /** Sets the body's total constant rotational forces applied during each physics update. + * See [method body_add_constant_torque]. + */ + static body_set_constant_torque(body: RID, torque: Vector3): void + + /** Returns the body's total constant rotational forces applied during each physics update. + * See [method body_add_constant_torque]. + */ + static body_get_constant_torque(body: RID): Vector3 + + /** Sets an axis velocity. The velocity in the given vector axis will be set as the given vector length. This is useful for jumping behavior. */ + static body_set_axis_velocity(body: RID, axis_velocity: Vector3): void + static body_set_axis_lock(body: RID, axis: PhysicsServer3D.BodyAxis, lock: boolean): void + static body_is_axis_locked(body: RID, axis: PhysicsServer3D.BodyAxis): boolean + + /** Adds a body to the list of bodies exempt from collisions. */ + static body_add_collision_exception(body: RID, excepted_body: RID): void + + /** Removes a body from the list of bodies exempt from collisions. + * Continuous collision detection tries to predict where a moving body will collide, instead of moving it and correcting its movement if it collided. + */ + static body_remove_collision_exception(body: RID, excepted_body: RID): void + + /** Sets the maximum contacts to report. Bodies can keep a log of the contacts with other bodies. This is enabled by setting the maximum number of contacts reported to a number greater than 0. */ + static body_set_max_contacts_reported(body: RID, amount: int64): void + + /** Returns the maximum contacts that can be reported. See [method body_set_max_contacts_reported]. */ + static body_get_max_contacts_reported(body: RID): int64 + + /** Sets whether the body omits the standard force integration. If [param enable] is `true`, the body will not automatically use applied forces, torques, and damping to update the body's linear and angular velocity. In this case, [method body_set_force_integration_callback] can be used to manually update the linear and angular velocity instead. + * This method is called when the property [member RigidBody3D.custom_integrator] is set. + */ + static body_set_omit_force_integration(body: RID, enable: boolean): void + + /** Returns `true` if the body is omitting the standard force integration. See [method body_set_omit_force_integration]. */ + static body_is_omitting_force_integration(body: RID): boolean + + /** Sets the body's state synchronization callback function to [param callable]. Use an empty [Callable] ([code skip-lint]Callable()`) to clear the callback. + * The function [param callable] will be called every physics frame, assuming that the body was active during the previous physics tick, and can be used to fetch the latest state from the physics server. + * The function [param callable] must take the following parameters: + * 1. `state`: a [PhysicsDirectBodyState3D], used to retrieve the body's state. + */ + static body_set_state_sync_callback(body: RID, callable: Callable): void + + /** Sets the body's custom force integration callback function to [param callable]. Use an empty [Callable] ([code skip-lint]Callable()`) to clear the custom callback. + * The function [param callable] will be called every physics tick, before the standard force integration (see [method body_set_omit_force_integration]). It can be used for example to update the body's linear and angular velocity based on contact with other bodies. + * If [param userdata] is not `null`, the function [param callable] must take the following two parameters: + * 1. `state`: a [PhysicsDirectBodyState3D], used to retrieve and modify the body's state, + * 2. [code skip-lint]userdata`: a [Variant]; its value will be the [param userdata] passed into this method. + * If [param userdata] is `null`, then [param callable] must take only the `state` parameter. + */ + static body_set_force_integration_callback(body: RID, callable: Callable, userdata: any = {}): void + + /** Sets the body pickable with rays if [param enable] is set. */ + static body_set_ray_pickable(body: RID, enable: boolean): void + + /** Returns `true` if a collision would result from moving along a motion vector from a given point in space. [PhysicsTestMotionParameters3D] is passed to set motion parameters. [PhysicsTestMotionResult3D] can be passed to return additional information. */ + static body_test_motion(body: RID, parameters: PhysicsTestMotionParameters3D, result: PhysicsTestMotionResult3D = undefined): boolean + + /** Returns the [PhysicsDirectBodyState3D] of the body. Returns `null` if the body is destroyed or removed from the physics space. */ + static body_get_direct_state(body: RID): PhysicsDirectBodyState3D + + /** Creates a new soft body and returns its internal [RID]. */ + static soft_body_create(): RID + + /** Requests that the physics server updates the rendering server with the latest positions of the given soft body's points through the [param rendering_server_handler] interface. */ + static soft_body_update_rendering_server(body: RID, rendering_server_handler: PhysicsServer3DRenderingServerHandler): void + + /** Assigns a space to the given soft body (see [method space_create]). */ + static soft_body_set_space(body: RID, space: RID): void + + /** Returns the [RID] of the space assigned to the given soft body. */ + static soft_body_get_space(body: RID): RID + + /** Sets the mesh of the given soft body. */ + static soft_body_set_mesh(body: RID, mesh: RID): void + + /** Returns the bounds of the given soft body in global coordinates. */ + static soft_body_get_bounds(body: RID): AABB + + /** Sets the physics layer or layers the given soft body belongs to. */ + static soft_body_set_collision_layer(body: RID, layer: int64): void + + /** Returns the physics layer or layers that the given soft body belongs to. */ + static soft_body_get_collision_layer(body: RID): int64 + + /** Sets the physics layer or layers the given soft body can collide with. */ + static soft_body_set_collision_mask(body: RID, mask: int64): void + + /** Returns the physics layer or layers that the given soft body can collide with. */ + static soft_body_get_collision_mask(body: RID): int64 + + /** Adds the given body to the list of bodies exempt from collisions. */ + static soft_body_add_collision_exception(body: RID, body_b: RID): void + + /** Removes the given body from the list of bodies exempt from collisions. */ + static soft_body_remove_collision_exception(body: RID, body_b: RID): void + + /** Sets the given body state for the given body (see [enum BodyState] constants). + * + * **Note:** Godot's default physics implementation does not support [constant BODY_STATE_LINEAR_VELOCITY], [constant BODY_STATE_ANGULAR_VELOCITY], [constant BODY_STATE_SLEEPING], or [constant BODY_STATE_CAN_SLEEP]. + */ + static soft_body_set_state(body: RID, state: PhysicsServer3D.BodyState, variant: any): void + + /** Returns the given soft body state (see [enum BodyState] constants). + * + * **Note:** Godot's default physics implementation does not support [constant BODY_STATE_LINEAR_VELOCITY], [constant BODY_STATE_ANGULAR_VELOCITY], [constant BODY_STATE_SLEEPING], or [constant BODY_STATE_CAN_SLEEP]. + */ + static soft_body_get_state(body: RID, state: PhysicsServer3D.BodyState): any + + /** Sets the global transform of the given soft body. */ + static soft_body_set_transform(body: RID, transform: Transform3D): void + + /** Sets whether the given soft body will be pickable when using object picking. */ + static soft_body_set_ray_pickable(body: RID, enable: boolean): void + + /** Sets the simulation precision of the given soft body. Increasing this value will improve the resulting simulation, but can affect performance. Use with care. */ + static soft_body_set_simulation_precision(body: RID, simulation_precision: int64): void + + /** Returns the simulation precision of the given soft body. */ + static soft_body_get_simulation_precision(body: RID): int64 + + /** Sets the total mass for the given soft body. */ + static soft_body_set_total_mass(body: RID, total_mass: float64): void + + /** Returns the total mass assigned to the given soft body. */ + static soft_body_get_total_mass(body: RID): float64 + + /** Sets the linear stiffness of the given soft body. Higher values will result in a stiffer body, while lower values will increase the body's ability to bend. The value can be between `0.0` and `1.0` (inclusive). */ + static soft_body_set_linear_stiffness(body: RID, stiffness: float64): void + + /** Returns the linear stiffness of the given soft body. */ + static soft_body_get_linear_stiffness(body: RID): float64 + + /** Sets the pressure coefficient of the given soft body. Simulates pressure build-up from inside this body. Higher values increase the strength of this effect. */ + static soft_body_set_pressure_coefficient(body: RID, pressure_coefficient: float64): void + + /** Returns the pressure coefficient of the given soft body. */ + static soft_body_get_pressure_coefficient(body: RID): float64 + + /** Sets the damping coefficient of the given soft body. Higher values will slow down the body more noticeably when forces are applied. */ + static soft_body_set_damping_coefficient(body: RID, damping_coefficient: float64): void + + /** Returns the damping coefficient of the given soft body. */ + static soft_body_get_damping_coefficient(body: RID): float64 + + /** Sets the drag coefficient of the given soft body. Higher values increase this body's air resistance. + * + * **Note:** This value is currently unused by Godot's default physics implementation. + */ + static soft_body_set_drag_coefficient(body: RID, drag_coefficient: float64): void + + /** Returns the drag coefficient of the given soft body. */ + static soft_body_get_drag_coefficient(body: RID): float64 + + /** Moves the given soft body point to a position in global coordinates. */ + static soft_body_move_point(body: RID, point_index: int64, global_position: Vector3): void + + /** Returns the current position of the given soft body point in global coordinates. */ + static soft_body_get_point_global_position(body: RID, point_index: int64): Vector3 + + /** Unpins all points of the given soft body. */ + static soft_body_remove_all_pinned_points(body: RID): void + + /** Pins or unpins the given soft body point based on the value of [param pin]. + * + * **Note:** Pinning a point effectively makes it kinematic, preventing it from being affected by forces, but you can still move it using [method soft_body_move_point]. + */ + static soft_body_pin_point(body: RID, point_index: int64, pin: boolean): void + + /** Returns whether the given soft body point is pinned. */ + static soft_body_is_point_pinned(body: RID, point_index: int64): boolean + static joint_create(): RID + static joint_clear(joint: RID): void + static joint_make_pin(joint: RID, body_A: RID, local_A: Vector3, body_B: RID, local_B: Vector3): void + + /** Sets a pin_joint parameter (see [enum PinJointParam] constants). */ + static pin_joint_set_param(joint: RID, param: PhysicsServer3D.PinJointParam, value: float64): void + + /** Gets a pin_joint parameter (see [enum PinJointParam] constants). */ + static pin_joint_get_param(joint: RID, param: PhysicsServer3D.PinJointParam): float64 + + /** Sets position of the joint in the local space of body a of the joint. */ + static pin_joint_set_local_a(joint: RID, local_A: Vector3): void + + /** Returns position of the joint in the local space of body a of the joint. */ + static pin_joint_get_local_a(joint: RID): Vector3 + + /** Sets position of the joint in the local space of body b of the joint. */ + static pin_joint_set_local_b(joint: RID, local_B: Vector3): void + + /** Returns position of the joint in the local space of body b of the joint. */ + static pin_joint_get_local_b(joint: RID): Vector3 + static joint_make_hinge(joint: RID, body_A: RID, hinge_A: Transform3D, body_B: RID, hinge_B: Transform3D): void + + /** Sets a hinge_joint parameter (see [enum HingeJointParam] constants). */ + static hinge_joint_set_param(joint: RID, param: PhysicsServer3D.HingeJointParam, value: float64): void + + /** Gets a hinge_joint parameter (see [enum HingeJointParam]). */ + static hinge_joint_get_param(joint: RID, param: PhysicsServer3D.HingeJointParam): float64 + + /** Sets a hinge_joint flag (see [enum HingeJointFlag] constants). */ + static hinge_joint_set_flag(joint: RID, flag: PhysicsServer3D.HingeJointFlag, enabled: boolean): void + + /** Gets a hinge_joint flag (see [enum HingeJointFlag] constants). */ + static hinge_joint_get_flag(joint: RID, flag: PhysicsServer3D.HingeJointFlag): boolean + static joint_make_slider(joint: RID, body_A: RID, local_ref_A: Transform3D, body_B: RID, local_ref_B: Transform3D): void + + /** Gets a slider_joint parameter (see [enum SliderJointParam] constants). */ + static slider_joint_set_param(joint: RID, param: PhysicsServer3D.SliderJointParam, value: float64): void + + /** Gets a slider_joint parameter (see [enum SliderJointParam] constants). */ + static slider_joint_get_param(joint: RID, param: PhysicsServer3D.SliderJointParam): float64 + static joint_make_cone_twist(joint: RID, body_A: RID, local_ref_A: Transform3D, body_B: RID, local_ref_B: Transform3D): void + + /** Sets a cone_twist_joint parameter (see [enum ConeTwistJointParam] constants). */ + static cone_twist_joint_set_param(joint: RID, param: PhysicsServer3D.ConeTwistJointParam, value: float64): void + + /** Gets a cone_twist_joint parameter (see [enum ConeTwistJointParam] constants). */ + static cone_twist_joint_get_param(joint: RID, param: PhysicsServer3D.ConeTwistJointParam): float64 + + /** Returns the type of the Joint3D. */ + static joint_get_type(joint: RID): PhysicsServer3D.JointType + + /** Sets the priority value of the Joint3D. */ + static joint_set_solver_priority(joint: RID, priority: int64): void + + /** Gets the priority value of the Joint3D. */ + static joint_get_solver_priority(joint: RID): int64 + + /** Sets whether the bodies attached to the [Joint3D] will collide with each other. */ + static joint_disable_collisions_between_bodies(joint: RID, disable: boolean): void + + /** Returns whether the bodies attached to the [Joint3D] will collide with each other. */ + static joint_is_disabled_collisions_between_bodies(joint: RID): boolean + + /** Make the joint a generic six degrees of freedom (6DOF) joint. Use [method generic_6dof_joint_set_flag] and [method generic_6dof_joint_set_param] to set the joint's flags and parameters respectively. */ + static joint_make_generic_6dof(joint: RID, body_A: RID, local_ref_A: Transform3D, body_B: RID, local_ref_B: Transform3D): void + + /** Sets the value of a given generic 6DOF joint parameter. See [enum G6DOFJointAxisParam] for the list of available parameters. */ + static generic_6dof_joint_set_param(joint: RID, axis: Vector3.Axis, param: PhysicsServer3D.G6DOFJointAxisParam, value: float64): void + + /** Returns the value of a generic 6DOF joint parameter. See [enum G6DOFJointAxisParam] for the list of available parameters. */ + static generic_6dof_joint_get_param(joint: RID, axis: Vector3.Axis, param: PhysicsServer3D.G6DOFJointAxisParam): float64 + + /** Sets the value of a given generic 6DOF joint flag. See [enum G6DOFJointAxisFlag] for the list of available flags. */ + static generic_6dof_joint_set_flag(joint: RID, axis: Vector3.Axis, flag: PhysicsServer3D.G6DOFJointAxisFlag, enable: boolean): void + + /** Returns the value of a generic 6DOF joint flag. See [enum G6DOFJointAxisFlag] for the list of available flags. */ + static generic_6dof_joint_get_flag(joint: RID, axis: Vector3.Axis, flag: PhysicsServer3D.G6DOFJointAxisFlag): boolean + + /** Destroys any of the objects created by PhysicsServer3D. If the [RID] passed is not one of the objects that can be created by PhysicsServer3D, an error will be sent to the console. */ + static free_rid(rid: RID): void + + /** Activates or deactivates the 3D physics engine. */ + static set_active(active: boolean): void + + /** Returns information about the current state of the 3D physics engine. See [enum ProcessInfo] for a list of available states. */ + static get_process_info(process_info: PhysicsServer3D.ProcessInfo): int64 + } + // _singleton_class_: XRServer + namespace XRServer { + enum TrackerType { + /** The tracker tracks the location of the players head. This is usually a location centered between the players eyes. Note that for handheld AR devices this can be the current location of the device. */ + TRACKER_HEAD = 1, + + /** The tracker tracks the location of a controller. */ + TRACKER_CONTROLLER = 2, + + /** The tracker tracks the location of a base station. */ + TRACKER_BASESTATION = 4, + + /** The tracker tracks the location and size of an AR anchor. */ + TRACKER_ANCHOR = 8, + + /** The tracker tracks the location and joints of a hand. */ + TRACKER_HAND = 16, + + /** The tracker tracks the location and joints of a body. */ + TRACKER_BODY = 32, + + /** The tracker tracks the expressions of a face. */ + TRACKER_FACE = 64, + + /** Used internally to filter trackers of any known type. */ + TRACKER_ANY_KNOWN = 127, + + /** Used internally if we haven't set the tracker type yet. */ + TRACKER_UNKNOWN = 128, + + /** Used internally to select all trackers. */ + TRACKER_ANY = 255, + } + enum RotationMode { + /** Fully reset the orientation of the HMD. Regardless of what direction the user is looking to in the real world. The user will look dead ahead in the virtual world. */ + RESET_FULL_ROTATION = 0, + + /** Resets the orientation but keeps the tilt of the device. So if we're looking down, we keep looking down but heading will be reset. */ + RESET_BUT_KEEP_TILT = 1, + + /** Does not reset the orientation of the HMD, only the position of the player gets centered. */ + DONT_RESET_ROTATION = 2, + } + } + /** Server for AR and VR features. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_xrserver.html + */ + class XRServer extends Object { + /** Returns the reference frame transform. Mostly used internally and exposed for GDExtension build interfaces. */ + static get_reference_frame(): Transform3D + + /** Clears the reference frame that was set by previous calls to [method center_on_hmd]. */ + static clear_reference_frame(): void + + /** This is an important function to understand correctly. AR and VR platforms all handle positioning slightly differently. + * For platforms that do not offer spatial tracking, our origin point (0, 0, 0) is the location of our HMD, but you have little control over the direction the player is facing in the real world. + * For platforms that do offer spatial tracking, our origin point depends very much on the system. For OpenVR, our origin point is usually the center of the tracking space, on the ground. For other platforms, it's often the location of the tracking camera. + * This method allows you to center your tracker on the location of the HMD. It will take the current location of the HMD and use that to adjust all your tracking data; in essence, realigning the real world to your player's current position in the game world. + * For this method to produce usable results, tracking information must be available. This often takes a few frames after starting your game. + * You should call this method after a few seconds have passed. For example, when the user requests a realignment of the display holding a designated button on a controller for a short period of time, or when implementing a teleport mechanism. + */ + static center_on_hmd(rotation_mode: XRServer.RotationMode, keep_height: boolean): void + + /** Returns the primary interface's transformation. */ + static get_hmd_transform(): Transform3D + + /** Registers an [XRInterface] object. */ + static add_interface(interface: XRInterface): void + + /** Returns the number of interfaces currently registered with the AR/VR server. If your project supports multiple AR/VR platforms, you can look through the available interface, and either present the user with a selection or simply try to initialize each interface and use the first one that returns `true`. */ + static get_interface_count(): int64 + + /** Removes this [param interface]. */ + static remove_interface(interface: XRInterface): void + + /** Returns the interface registered at the given [param idx] index in the list of interfaces. */ + static get_interface(idx: int64): XRInterface + + /** Returns a list of available interfaces the ID and name of each interface. */ + static get_interfaces(): GArray + + /** Finds an interface by its [param name]. For example, if your project uses capabilities of an AR/VR platform, you can find the interface for that platform by name and initialize it. */ + static find_interface(name: string): XRInterface + + /** Registers a new [XRTracker] that tracks a physical object. */ + static add_tracker(tracker: XRTracker): void + + /** Removes this [param tracker]. */ + static remove_tracker(tracker: XRTracker): void + + /** Returns a dictionary of trackers for [param tracker_types]. */ + static get_trackers(tracker_types: int64): GDictionary + + /** Returns the positional tracker with the given [param tracker_name]. */ + static get_tracker(tracker_name: StringName): XRTracker + + /** The scale of the game world compared to the real world. By default, most AR/VR platforms assume that 1 game unit corresponds to 1 real world meter. */ + get world_scale(): float64 + set world_scale(value: float64) + + /** The current origin of our tracking space in the virtual world. This is used by the renderer to properly position the camera with new tracking data. + * + * **Note:** This property is managed by the current [XROrigin3D] node. It is exposed for access from GDExtensions. + */ + get world_origin(): Vector3 + set world_origin(value: Vector3) + + /** If set to `true`, the scene will be rendered as if the camera is locked to the [XROrigin3D]. + * + * **Note:** This doesn't provide a very comfortable experience for users. This setting exists for doing benchmarking or automated testing, where you want to control what is rendered via code. + */ + get camera_locked_to_origin(): boolean + set camera_locked_to_origin(value: boolean) + + /** The primary [XRInterface] currently bound to the [XRServer]. */ + get primary_interface(): Object + set primary_interface(value: Object) + + /** Emitted when the reference frame transform changes. */ + static readonly reference_frame_changed: Signal0 + + /** Emitted when a new interface has been added. */ + static readonly interface_added: Signal1 + + /** Emitted when an interface is removed. */ + static readonly interface_removed: Signal1 + + /** Emitted when a new tracker has been added. If you don't use a fixed number of controllers or if you're using [XRAnchor3D]s for an AR solution, it is important to react to this signal to add the appropriate [XRController3D] or [XRAnchor3D] nodes related to this new tracker. */ + static readonly tracker_added: Signal2 + + /** Emitted when an existing tracker has been updated. This can happen if the user switches controllers. */ + static readonly tracker_updated: Signal2 + + /** Emitted when a tracker is removed. You should remove any [XRController3D] or [XRAnchor3D] points if applicable. This is not mandatory, the nodes simply become inactive and will be made active again when a new tracker becomes available (i.e. a new controller is switched on that takes the place of the previous one). */ + static readonly tracker_removed: Signal2 + } + // _singleton_class_: GDScriptLanguageProtocol + /** @link https://docs.godotengine.org/en/4.4/classes/class_gdscriptlanguageprotocol.html */ + class GDScriptLanguageProtocol extends JSONRPC { + static initialize(params: GDictionary): GDictionary + static initialized(params: any): void + static on_client_connected(): GError + static on_client_disconnected(_unnamed_arg0: int64): void + static notify_client(method: string, params: any = {}, client_id: int64 = -1): void + static is_smart_resolve_enabled(): boolean + static get_text_document(): GDScriptTextDocument + static get_workspace(): GDScriptWorkspace + static is_initialized(): boolean + } namespace AESContext { enum Mode { /** AES electronic codebook encryption mode. */ @@ -21,7 +1878,7 @@ declare module "godot" { } /** Provides access to AES encryption/decryption of raw data. * - * @link https://docs.godotengine.org/en/4.3/classes/class_aescontext.html + * @link https://docs.godotengine.org/en/4.4/classes/class_aescontext.html */ class AESContext extends RefCounted { constructor(identifier?: any) @@ -45,14 +1902,14 @@ declare module "godot" { } /** An implementation of A* for finding the shortest path between two vertices on a connected graph in 2D space. * - * @link https://docs.godotengine.org/en/4.3/classes/class_astar2d.html + * @link https://docs.godotengine.org/en/4.4/classes/class_astar2d.html */ class AStar2D extends RefCounted { constructor(identifier?: any) /** Called when estimating the cost between a point and the path's ending point. * Note that this function is hidden in the default [AStar2D] class. */ - /* gdvirtual */ _estimate_cost(from_id: int64, to_id: int64): float64 + /* gdvirtual */ _estimate_cost(from_id: int64, end_id: int64): float64 /** Called when computing the cost between two connected points. * Note that this function is hidden in the default [AStar2D] class. @@ -118,7 +1975,7 @@ declare module "godot" { /** Returns the capacity of the structure backing the points, useful in conjunction with [method reserve_space]. */ get_point_capacity(): int64 - /** Reserves space internally for [param num_nodes] points, useful if you're adding a known large number of points at once, such as points on a grid. New capacity must be greater or equals to old capacity. */ + /** Reserves space internally for [param num_nodes] points. Useful if you're adding a known large number of points at once, such as points on a grid. The new capacity must be greater or equal to the old capacity. */ reserve_space(num_nodes: int64): void /** Clears all the points and segments. */ @@ -140,11 +1997,14 @@ declare module "godot" { * If there is no valid path to the target, and [param allow_partial_path] is `true`, returns a path to the point closest to the target that can be reached. * * **Note:** This method is not thread-safe. If called from a [Thread], it will return an empty array and will print an error message. + * Additionally, when [param allow_partial_path] is `true` and [param to_id] is disabled the search may take an unusually long time to finish. */ get_point_path(from_id: int64, to_id: int64, allow_partial_path: boolean = false): PackedVector2Array /** Returns an array with the IDs of the points that form the path found by AStar2D between the given points. The array is ordered from the starting point to the ending point of the path. * If there is no valid path to the target, and [param allow_partial_path] is `true`, returns a path to the point closest to the target that can be reached. + * + * **Note:** When [param allow_partial_path] is `true` and [param to_id] is disabled the search may take an unusually long time to finish. * * If you change the 2nd point's weight to 3, then the result will be `[1, 4, 3]` instead, because now even though the distance is longer, it's "easier" to get through point 4 than through point 2. */ @@ -152,14 +2012,14 @@ declare module "godot" { } /** An implementation of A* for finding the shortest path between two vertices on a connected graph in 3D space. * - * @link https://docs.godotengine.org/en/4.3/classes/class_astar3d.html + * @link https://docs.godotengine.org/en/4.4/classes/class_astar3d.html */ class AStar3D extends RefCounted { constructor(identifier?: any) /** Called when estimating the cost between a point and the path's ending point. * Note that this function is hidden in the default [AStar3D] class. */ - /* gdvirtual */ _estimate_cost(from_id: int64, to_id: int64): float64 + /* gdvirtual */ _estimate_cost(from_id: int64, end_id: int64): float64 /** Called when computing the cost between two connected points. * Note that this function is hidden in the default [AStar3D] class. @@ -247,11 +2107,14 @@ declare module "godot" { * If there is no valid path to the target, and [param allow_partial_path] is `true`, returns a path to the point closest to the target that can be reached. * * **Note:** This method is not thread-safe. If called from a [Thread], it will return an empty array and will print an error message. + * Additionally, when [param allow_partial_path] is `true` and [param to_id] is disabled the search may take an unusually long time to finish. */ get_point_path(from_id: int64, to_id: int64, allow_partial_path: boolean = false): PackedVector3Array /** Returns an array with the IDs of the points that form the path found by AStar3D between the given points. The array is ordered from the starting point to the ending point of the path. * If there is no valid path to the target, and [param allow_partial_path] is `true`, returns a path to the point closest to the target that can be reached. + * + * **Note:** When [param allow_partial_path] is `true` and [param to_id] is disabled the search may take an unusually long time to finish. * * If you change the 2nd point's weight to 3, then the result will be `[1, 4, 3]` instead, because now even though the distance is longer, it's "easier" to get through point 4 than through point 2. */ @@ -318,14 +2181,14 @@ declare module "godot" { } /** An implementation of A* for finding the shortest path between two points on a partial 2D grid. * - * @link https://docs.godotengine.org/en/4.3/classes/class_astargrid2d.html + * @link https://docs.godotengine.org/en/4.4/classes/class_astargrid2d.html */ class AStarGrid2D extends RefCounted { constructor(identifier?: any) /** Called when estimating the cost between a point and the path's ending point. * Note that this function is hidden in the default [AStarGrid2D] class. */ - /* gdvirtual */ _estimate_cost(from_id: Vector2i, to_id: Vector2i): float64 + /* gdvirtual */ _estimate_cost(from_id: Vector2i, end_id: Vector2i): float64 /** Called when computing the cost between two connected points. * Note that this function is hidden in the default [AStarGrid2D] class. @@ -383,15 +2246,21 @@ declare module "godot" { /** Returns the position of the point associated with the given [param id]. */ get_point_position(id: Vector2i): Vector2 + /** Returns an array of dictionaries with point data (`id`: [Vector2i], `position`: [Vector2], `solid`: [bool], `weight_scale`: [float]) within a [param region]. */ + get_point_data_in_region(region: Rect2i): GArray + /** Returns an array with the points that are in the path found by [AStarGrid2D] between the given points. The array is ordered from the starting point to the ending point of the path. * If there is no valid path to the target, and [param allow_partial_path] is `true`, returns a path to the point closest to the target that can be reached. * * **Note:** This method is not thread-safe. If called from a [Thread], it will return an empty array and will print an error message. + * Additionally, when [param allow_partial_path] is `true` and [param to_id] is solid the search may take an unusually long time to finish. */ get_point_path(from_id: Vector2i, to_id: Vector2i, allow_partial_path: boolean = false): PackedVector2Array /** Returns an array with the IDs of the points that form the path found by AStar2D between the given points. The array is ordered from the starting point to the ending point of the path. * If there is no valid path to the target, and [param allow_partial_path] is `true`, returns a path to the point closest to the target that can be reached. + * + * **Note:** When [param allow_partial_path] is `true` and [param to_id] is solid the search may take an unusually long time to finish. */ get_id_path(from_id: Vector2i, to_id: Vector2i, allow_partial_path: boolean = false): GArray @@ -434,17 +2303,17 @@ declare module "godot" { get diagonal_mode(): int64 set diagonal_mode(value: int64) } - class AbstractPolygon2DEditor extends HBoxContainer { + class AbstractPolygon2DEditor = Record> extends HBoxContainer { constructor(identifier?: any) } - class AbstractPolygon2DEditorPlugin extends EditorPlugin { + class AbstractPolygon2DEditorPlugin = Record> extends EditorPlugin { constructor(identifier?: any) } /** A base dialog used for user notification. * - * @link https://docs.godotengine.org/en/4.3/classes/class_acceptdialog.html + * @link https://docs.godotengine.org/en/4.4/classes/class_acceptdialog.html */ - class AcceptDialog extends Window { + class AcceptDialog = Record> extends Window { constructor(identifier?: any) /** Returns the OK [Button] instance. * **Warning:** This is a required internal node, removing and freeing it may cause a crash. If you wish to hide it or any of its children, use their [member CanvasItem.visible] property. @@ -505,7 +2374,7 @@ declare module "godot" { /** Emitted when a custom button is pressed. See [method add_button]. */ readonly custom_action: Signal1 } - class ActionMapEditor extends Control { + class ActionMapEditor = Record> extends Control { constructor(identifier?: any) readonly action_added: Signal1 readonly action_edited: Signal2 @@ -515,15 +2384,15 @@ declare module "godot" { readonly filter_focused: Signal0 readonly filter_unfocused: Signal0 } - class AnchorPresetPicker extends ControlEditorPresetPicker { + class AnchorPresetPicker = Record> extends ControlEditorPresetPicker { constructor(identifier?: any) readonly anchors_preset_selected: Signal1 } /** A 2D physics body that can't be moved by external forces. When moved manually, it affects other bodies in its path. * - * @link https://docs.godotengine.org/en/4.3/classes/class_animatablebody2d.html + * @link https://docs.godotengine.org/en/4.4/classes/class_animatablebody2d.html */ - class AnimatableBody2D extends StaticBody2D { + class AnimatableBody2D = Record> extends StaticBody2D { constructor(identifier?: any) /** If `true`, the body's movement will be synchronized to the physics frame. This is useful when animating movement via [AnimationPlayer], for example on moving platforms. Do **not** use together with [method PhysicsBody2D.move_and_collide]. */ get sync_to_physics(): boolean @@ -531,9 +2400,9 @@ declare module "godot" { } /** A 3D physics body that can't be moved by external forces. When moved manually, it affects other bodies in its path. * - * @link https://docs.godotengine.org/en/4.3/classes/class_animatablebody3d.html + * @link https://docs.godotengine.org/en/4.4/classes/class_animatablebody3d.html */ - class AnimatableBody3D extends StaticBody3D { + class AnimatableBody3D = Record> extends StaticBody3D { constructor(identifier?: any) /** If `true`, the body's movement will be synchronized to the physics frame. This is useful when animating movement via [AnimationPlayer], for example on moving platforms. Do **not** use together with [method PhysicsBody3D.move_and_collide]. */ get sync_to_physics(): boolean @@ -541,9 +2410,9 @@ declare module "godot" { } /** Sprite node that contains multiple textures as frames to play for animation. * - * @link https://docs.godotengine.org/en/4.3/classes/class_animatedsprite2d.html + * @link https://docs.godotengine.org/en/4.4/classes/class_animatedsprite2d.html */ - class AnimatedSprite2D extends Node2D { + class AnimatedSprite2D = Record> extends Node2D { constructor(identifier?: any) /** Returns `true` if an animation is currently playing (even if [member speed_scale] and/or `custom_speed` are `0`). */ is_playing(): boolean @@ -566,9 +2435,8 @@ declare module "godot" { /** Stops the currently playing animation. The animation position is reset to `0` and the `custom_speed` is reset to `1.0`. See also [method pause]. */ stop(): void - /** The setter of [member frame] resets the [member frame_progress] to `0.0` implicitly, but this method avoids that. - * This is useful when you want to carry over the current [member frame_progress] to another [member frame]. - * **Example:** + /** Sets [member frame] the [member frame_progress] to the given values. Unlike setting [member frame], this method does not reset the [member frame_progress] to `0.0` implicitly. + * **Example:** Change the animation while keeping the same [member frame] and [member frame_progress]: * */ set_frame_and_progress(frame: int64, progress: float64): void @@ -643,9 +2511,9 @@ declare module "godot" { } /** 2D sprite node in 3D world, that can use multiple 2D textures for animation. * - * @link https://docs.godotengine.org/en/4.3/classes/class_animatedsprite3d.html + * @link https://docs.godotengine.org/en/4.4/classes/class_animatedsprite3d.html */ - class AnimatedSprite3D extends SpriteBase3D { + class AnimatedSprite3D = Record> extends SpriteBase3D { constructor(identifier?: any) /** Returns `true` if an animation is currently playing (even if [member speed_scale] and/or `custom_speed` are `0`). */ is_playing(): boolean @@ -668,9 +2536,8 @@ declare module "godot" { /** Stops the currently playing animation. The animation position is reset to `0` and the `custom_speed` is reset to `1.0`. See also [method pause]. */ stop(): void - /** The setter of [member frame] resets the [member frame_progress] to `0.0` implicitly, but this method avoids that. - * This is useful when you want to carry over the current [member frame_progress] to another [member frame]. - * **Example:** + /** Sets [member frame] the [member frame_progress] to the given values. Unlike setting [member frame], this method does not reset the [member frame_progress] to `0.0` implicitly. + * **Example:** Change the animation while keeping the same [member frame] and [member frame_progress]: * */ set_frame_and_progress(frame: int64, progress: float64): void @@ -727,7 +2594,7 @@ declare module "godot" { } /** Proxy texture for simple frame-based animations. * - * @link https://docs.godotengine.org/en/4.3/classes/class_animatedtexture.html + * @link https://docs.godotengine.org/en/4.4/classes/class_animatedtexture.html */ class AnimatedTexture extends Texture2D { /** The maximum number of frames supported by [AnimatedTexture]. If you need more frames in your animation, use [AnimationPlayer] or [AnimatedSprite2D]. */ @@ -767,6 +2634,1030 @@ declare module "godot" { /** The animation speed is multiplied by this value. If set to a negative value, the animation is played in reverse. */ get speed_scale(): float64 set speed_scale(value: float64) + get "frame_0/texture"(): Texture2D + set "frame_0/texture"(value: Texture2D) + get "frame_0/duration"(): float64 + set "frame_0/duration"(value: float64) + get "frame_1/texture"(): Texture2D + set "frame_1/texture"(value: Texture2D) + get "frame_1/duration"(): float64 + set "frame_1/duration"(value: float64) + get "frame_2/texture"(): Texture2D + set "frame_2/texture"(value: Texture2D) + get "frame_2/duration"(): float64 + set "frame_2/duration"(value: float64) + get "frame_3/texture"(): Texture2D + set "frame_3/texture"(value: Texture2D) + get "frame_3/duration"(): float64 + set "frame_3/duration"(value: float64) + get "frame_4/texture"(): Texture2D + set "frame_4/texture"(value: Texture2D) + get "frame_4/duration"(): float64 + set "frame_4/duration"(value: float64) + get "frame_5/texture"(): Texture2D + set "frame_5/texture"(value: Texture2D) + get "frame_5/duration"(): float64 + set "frame_5/duration"(value: float64) + get "frame_6/texture"(): Texture2D + set "frame_6/texture"(value: Texture2D) + get "frame_6/duration"(): float64 + set "frame_6/duration"(value: float64) + get "frame_7/texture"(): Texture2D + set "frame_7/texture"(value: Texture2D) + get "frame_7/duration"(): float64 + set "frame_7/duration"(value: float64) + get "frame_8/texture"(): Texture2D + set "frame_8/texture"(value: Texture2D) + get "frame_8/duration"(): float64 + set "frame_8/duration"(value: float64) + get "frame_9/texture"(): Texture2D + set "frame_9/texture"(value: Texture2D) + get "frame_9/duration"(): float64 + set "frame_9/duration"(value: float64) + get "frame_10/texture"(): Texture2D + set "frame_10/texture"(value: Texture2D) + get "frame_10/duration"(): float64 + set "frame_10/duration"(value: float64) + get "frame_11/texture"(): Texture2D + set "frame_11/texture"(value: Texture2D) + get "frame_11/duration"(): float64 + set "frame_11/duration"(value: float64) + get "frame_12/texture"(): Texture2D + set "frame_12/texture"(value: Texture2D) + get "frame_12/duration"(): float64 + set "frame_12/duration"(value: float64) + get "frame_13/texture"(): Texture2D + set "frame_13/texture"(value: Texture2D) + get "frame_13/duration"(): float64 + set "frame_13/duration"(value: float64) + get "frame_14/texture"(): Texture2D + set "frame_14/texture"(value: Texture2D) + get "frame_14/duration"(): float64 + set "frame_14/duration"(value: float64) + get "frame_15/texture"(): Texture2D + set "frame_15/texture"(value: Texture2D) + get "frame_15/duration"(): float64 + set "frame_15/duration"(value: float64) + get "frame_16/texture"(): Texture2D + set "frame_16/texture"(value: Texture2D) + get "frame_16/duration"(): float64 + set "frame_16/duration"(value: float64) + get "frame_17/texture"(): Texture2D + set "frame_17/texture"(value: Texture2D) + get "frame_17/duration"(): float64 + set "frame_17/duration"(value: float64) + get "frame_18/texture"(): Texture2D + set "frame_18/texture"(value: Texture2D) + get "frame_18/duration"(): float64 + set "frame_18/duration"(value: float64) + get "frame_19/texture"(): Texture2D + set "frame_19/texture"(value: Texture2D) + get "frame_19/duration"(): float64 + set "frame_19/duration"(value: float64) + get "frame_20/texture"(): Texture2D + set "frame_20/texture"(value: Texture2D) + get "frame_20/duration"(): float64 + set "frame_20/duration"(value: float64) + get "frame_21/texture"(): Texture2D + set "frame_21/texture"(value: Texture2D) + get "frame_21/duration"(): float64 + set "frame_21/duration"(value: float64) + get "frame_22/texture"(): Texture2D + set "frame_22/texture"(value: Texture2D) + get "frame_22/duration"(): float64 + set "frame_22/duration"(value: float64) + get "frame_23/texture"(): Texture2D + set "frame_23/texture"(value: Texture2D) + get "frame_23/duration"(): float64 + set "frame_23/duration"(value: float64) + get "frame_24/texture"(): Texture2D + set "frame_24/texture"(value: Texture2D) + get "frame_24/duration"(): float64 + set "frame_24/duration"(value: float64) + get "frame_25/texture"(): Texture2D + set "frame_25/texture"(value: Texture2D) + get "frame_25/duration"(): float64 + set "frame_25/duration"(value: float64) + get "frame_26/texture"(): Texture2D + set "frame_26/texture"(value: Texture2D) + get "frame_26/duration"(): float64 + set "frame_26/duration"(value: float64) + get "frame_27/texture"(): Texture2D + set "frame_27/texture"(value: Texture2D) + get "frame_27/duration"(): float64 + set "frame_27/duration"(value: float64) + get "frame_28/texture"(): Texture2D + set "frame_28/texture"(value: Texture2D) + get "frame_28/duration"(): float64 + set "frame_28/duration"(value: float64) + get "frame_29/texture"(): Texture2D + set "frame_29/texture"(value: Texture2D) + get "frame_29/duration"(): float64 + set "frame_29/duration"(value: float64) + get "frame_30/texture"(): Texture2D + set "frame_30/texture"(value: Texture2D) + get "frame_30/duration"(): float64 + set "frame_30/duration"(value: float64) + get "frame_31/texture"(): Texture2D + set "frame_31/texture"(value: Texture2D) + get "frame_31/duration"(): float64 + set "frame_31/duration"(value: float64) + get "frame_32/texture"(): Texture2D + set "frame_32/texture"(value: Texture2D) + get "frame_32/duration"(): float64 + set "frame_32/duration"(value: float64) + get "frame_33/texture"(): Texture2D + set "frame_33/texture"(value: Texture2D) + get "frame_33/duration"(): float64 + set "frame_33/duration"(value: float64) + get "frame_34/texture"(): Texture2D + set "frame_34/texture"(value: Texture2D) + get "frame_34/duration"(): float64 + set "frame_34/duration"(value: float64) + get "frame_35/texture"(): Texture2D + set "frame_35/texture"(value: Texture2D) + get "frame_35/duration"(): float64 + set "frame_35/duration"(value: float64) + get "frame_36/texture"(): Texture2D + set "frame_36/texture"(value: Texture2D) + get "frame_36/duration"(): float64 + set "frame_36/duration"(value: float64) + get "frame_37/texture"(): Texture2D + set "frame_37/texture"(value: Texture2D) + get "frame_37/duration"(): float64 + set "frame_37/duration"(value: float64) + get "frame_38/texture"(): Texture2D + set "frame_38/texture"(value: Texture2D) + get "frame_38/duration"(): float64 + set "frame_38/duration"(value: float64) + get "frame_39/texture"(): Texture2D + set "frame_39/texture"(value: Texture2D) + get "frame_39/duration"(): float64 + set "frame_39/duration"(value: float64) + get "frame_40/texture"(): Texture2D + set "frame_40/texture"(value: Texture2D) + get "frame_40/duration"(): float64 + set "frame_40/duration"(value: float64) + get "frame_41/texture"(): Texture2D + set "frame_41/texture"(value: Texture2D) + get "frame_41/duration"(): float64 + set "frame_41/duration"(value: float64) + get "frame_42/texture"(): Texture2D + set "frame_42/texture"(value: Texture2D) + get "frame_42/duration"(): float64 + set "frame_42/duration"(value: float64) + get "frame_43/texture"(): Texture2D + set "frame_43/texture"(value: Texture2D) + get "frame_43/duration"(): float64 + set "frame_43/duration"(value: float64) + get "frame_44/texture"(): Texture2D + set "frame_44/texture"(value: Texture2D) + get "frame_44/duration"(): float64 + set "frame_44/duration"(value: float64) + get "frame_45/texture"(): Texture2D + set "frame_45/texture"(value: Texture2D) + get "frame_45/duration"(): float64 + set "frame_45/duration"(value: float64) + get "frame_46/texture"(): Texture2D + set "frame_46/texture"(value: Texture2D) + get "frame_46/duration"(): float64 + set "frame_46/duration"(value: float64) + get "frame_47/texture"(): Texture2D + set "frame_47/texture"(value: Texture2D) + get "frame_47/duration"(): float64 + set "frame_47/duration"(value: float64) + get "frame_48/texture"(): Texture2D + set "frame_48/texture"(value: Texture2D) + get "frame_48/duration"(): float64 + set "frame_48/duration"(value: float64) + get "frame_49/texture"(): Texture2D + set "frame_49/texture"(value: Texture2D) + get "frame_49/duration"(): float64 + set "frame_49/duration"(value: float64) + get "frame_50/texture"(): Texture2D + set "frame_50/texture"(value: Texture2D) + get "frame_50/duration"(): float64 + set "frame_50/duration"(value: float64) + get "frame_51/texture"(): Texture2D + set "frame_51/texture"(value: Texture2D) + get "frame_51/duration"(): float64 + set "frame_51/duration"(value: float64) + get "frame_52/texture"(): Texture2D + set "frame_52/texture"(value: Texture2D) + get "frame_52/duration"(): float64 + set "frame_52/duration"(value: float64) + get "frame_53/texture"(): Texture2D + set "frame_53/texture"(value: Texture2D) + get "frame_53/duration"(): float64 + set "frame_53/duration"(value: float64) + get "frame_54/texture"(): Texture2D + set "frame_54/texture"(value: Texture2D) + get "frame_54/duration"(): float64 + set "frame_54/duration"(value: float64) + get "frame_55/texture"(): Texture2D + set "frame_55/texture"(value: Texture2D) + get "frame_55/duration"(): float64 + set "frame_55/duration"(value: float64) + get "frame_56/texture"(): Texture2D + set "frame_56/texture"(value: Texture2D) + get "frame_56/duration"(): float64 + set "frame_56/duration"(value: float64) + get "frame_57/texture"(): Texture2D + set "frame_57/texture"(value: Texture2D) + get "frame_57/duration"(): float64 + set "frame_57/duration"(value: float64) + get "frame_58/texture"(): Texture2D + set "frame_58/texture"(value: Texture2D) + get "frame_58/duration"(): float64 + set "frame_58/duration"(value: float64) + get "frame_59/texture"(): Texture2D + set "frame_59/texture"(value: Texture2D) + get "frame_59/duration"(): float64 + set "frame_59/duration"(value: float64) + get "frame_60/texture"(): Texture2D + set "frame_60/texture"(value: Texture2D) + get "frame_60/duration"(): float64 + set "frame_60/duration"(value: float64) + get "frame_61/texture"(): Texture2D + set "frame_61/texture"(value: Texture2D) + get "frame_61/duration"(): float64 + set "frame_61/duration"(value: float64) + get "frame_62/texture"(): Texture2D + set "frame_62/texture"(value: Texture2D) + get "frame_62/duration"(): float64 + set "frame_62/duration"(value: float64) + get "frame_63/texture"(): Texture2D + set "frame_63/texture"(value: Texture2D) + get "frame_63/duration"(): float64 + set "frame_63/duration"(value: float64) + get "frame_64/texture"(): Texture2D + set "frame_64/texture"(value: Texture2D) + get "frame_64/duration"(): float64 + set "frame_64/duration"(value: float64) + get "frame_65/texture"(): Texture2D + set "frame_65/texture"(value: Texture2D) + get "frame_65/duration"(): float64 + set "frame_65/duration"(value: float64) + get "frame_66/texture"(): Texture2D + set "frame_66/texture"(value: Texture2D) + get "frame_66/duration"(): float64 + set "frame_66/duration"(value: float64) + get "frame_67/texture"(): Texture2D + set "frame_67/texture"(value: Texture2D) + get "frame_67/duration"(): float64 + set "frame_67/duration"(value: float64) + get "frame_68/texture"(): Texture2D + set "frame_68/texture"(value: Texture2D) + get "frame_68/duration"(): float64 + set "frame_68/duration"(value: float64) + get "frame_69/texture"(): Texture2D + set "frame_69/texture"(value: Texture2D) + get "frame_69/duration"(): float64 + set "frame_69/duration"(value: float64) + get "frame_70/texture"(): Texture2D + set "frame_70/texture"(value: Texture2D) + get "frame_70/duration"(): float64 + set "frame_70/duration"(value: float64) + get "frame_71/texture"(): Texture2D + set "frame_71/texture"(value: Texture2D) + get "frame_71/duration"(): float64 + set "frame_71/duration"(value: float64) + get "frame_72/texture"(): Texture2D + set "frame_72/texture"(value: Texture2D) + get "frame_72/duration"(): float64 + set "frame_72/duration"(value: float64) + get "frame_73/texture"(): Texture2D + set "frame_73/texture"(value: Texture2D) + get "frame_73/duration"(): float64 + set "frame_73/duration"(value: float64) + get "frame_74/texture"(): Texture2D + set "frame_74/texture"(value: Texture2D) + get "frame_74/duration"(): float64 + set "frame_74/duration"(value: float64) + get "frame_75/texture"(): Texture2D + set "frame_75/texture"(value: Texture2D) + get "frame_75/duration"(): float64 + set "frame_75/duration"(value: float64) + get "frame_76/texture"(): Texture2D + set "frame_76/texture"(value: Texture2D) + get "frame_76/duration"(): float64 + set "frame_76/duration"(value: float64) + get "frame_77/texture"(): Texture2D + set "frame_77/texture"(value: Texture2D) + get "frame_77/duration"(): float64 + set "frame_77/duration"(value: float64) + get "frame_78/texture"(): Texture2D + set "frame_78/texture"(value: Texture2D) + get "frame_78/duration"(): float64 + set "frame_78/duration"(value: float64) + get "frame_79/texture"(): Texture2D + set "frame_79/texture"(value: Texture2D) + get "frame_79/duration"(): float64 + set "frame_79/duration"(value: float64) + get "frame_80/texture"(): Texture2D + set "frame_80/texture"(value: Texture2D) + get "frame_80/duration"(): float64 + set "frame_80/duration"(value: float64) + get "frame_81/texture"(): Texture2D + set "frame_81/texture"(value: Texture2D) + get "frame_81/duration"(): float64 + set "frame_81/duration"(value: float64) + get "frame_82/texture"(): Texture2D + set "frame_82/texture"(value: Texture2D) + get "frame_82/duration"(): float64 + set "frame_82/duration"(value: float64) + get "frame_83/texture"(): Texture2D + set "frame_83/texture"(value: Texture2D) + get "frame_83/duration"(): float64 + set "frame_83/duration"(value: float64) + get "frame_84/texture"(): Texture2D + set "frame_84/texture"(value: Texture2D) + get "frame_84/duration"(): float64 + set "frame_84/duration"(value: float64) + get "frame_85/texture"(): Texture2D + set "frame_85/texture"(value: Texture2D) + get "frame_85/duration"(): float64 + set "frame_85/duration"(value: float64) + get "frame_86/texture"(): Texture2D + set "frame_86/texture"(value: Texture2D) + get "frame_86/duration"(): float64 + set "frame_86/duration"(value: float64) + get "frame_87/texture"(): Texture2D + set "frame_87/texture"(value: Texture2D) + get "frame_87/duration"(): float64 + set "frame_87/duration"(value: float64) + get "frame_88/texture"(): Texture2D + set "frame_88/texture"(value: Texture2D) + get "frame_88/duration"(): float64 + set "frame_88/duration"(value: float64) + get "frame_89/texture"(): Texture2D + set "frame_89/texture"(value: Texture2D) + get "frame_89/duration"(): float64 + set "frame_89/duration"(value: float64) + get "frame_90/texture"(): Texture2D + set "frame_90/texture"(value: Texture2D) + get "frame_90/duration"(): float64 + set "frame_90/duration"(value: float64) + get "frame_91/texture"(): Texture2D + set "frame_91/texture"(value: Texture2D) + get "frame_91/duration"(): float64 + set "frame_91/duration"(value: float64) + get "frame_92/texture"(): Texture2D + set "frame_92/texture"(value: Texture2D) + get "frame_92/duration"(): float64 + set "frame_92/duration"(value: float64) + get "frame_93/texture"(): Texture2D + set "frame_93/texture"(value: Texture2D) + get "frame_93/duration"(): float64 + set "frame_93/duration"(value: float64) + get "frame_94/texture"(): Texture2D + set "frame_94/texture"(value: Texture2D) + get "frame_94/duration"(): float64 + set "frame_94/duration"(value: float64) + get "frame_95/texture"(): Texture2D + set "frame_95/texture"(value: Texture2D) + get "frame_95/duration"(): float64 + set "frame_95/duration"(value: float64) + get "frame_96/texture"(): Texture2D + set "frame_96/texture"(value: Texture2D) + get "frame_96/duration"(): float64 + set "frame_96/duration"(value: float64) + get "frame_97/texture"(): Texture2D + set "frame_97/texture"(value: Texture2D) + get "frame_97/duration"(): float64 + set "frame_97/duration"(value: float64) + get "frame_98/texture"(): Texture2D + set "frame_98/texture"(value: Texture2D) + get "frame_98/duration"(): float64 + set "frame_98/duration"(value: float64) + get "frame_99/texture"(): Texture2D + set "frame_99/texture"(value: Texture2D) + get "frame_99/duration"(): float64 + set "frame_99/duration"(value: float64) + get "frame_100/texture"(): Texture2D + set "frame_100/texture"(value: Texture2D) + get "frame_100/duration"(): float64 + set "frame_100/duration"(value: float64) + get "frame_101/texture"(): Texture2D + set "frame_101/texture"(value: Texture2D) + get "frame_101/duration"(): float64 + set "frame_101/duration"(value: float64) + get "frame_102/texture"(): Texture2D + set "frame_102/texture"(value: Texture2D) + get "frame_102/duration"(): float64 + set "frame_102/duration"(value: float64) + get "frame_103/texture"(): Texture2D + set "frame_103/texture"(value: Texture2D) + get "frame_103/duration"(): float64 + set "frame_103/duration"(value: float64) + get "frame_104/texture"(): Texture2D + set "frame_104/texture"(value: Texture2D) + get "frame_104/duration"(): float64 + set "frame_104/duration"(value: float64) + get "frame_105/texture"(): Texture2D + set "frame_105/texture"(value: Texture2D) + get "frame_105/duration"(): float64 + set "frame_105/duration"(value: float64) + get "frame_106/texture"(): Texture2D + set "frame_106/texture"(value: Texture2D) + get "frame_106/duration"(): float64 + set "frame_106/duration"(value: float64) + get "frame_107/texture"(): Texture2D + set "frame_107/texture"(value: Texture2D) + get "frame_107/duration"(): float64 + set "frame_107/duration"(value: float64) + get "frame_108/texture"(): Texture2D + set "frame_108/texture"(value: Texture2D) + get "frame_108/duration"(): float64 + set "frame_108/duration"(value: float64) + get "frame_109/texture"(): Texture2D + set "frame_109/texture"(value: Texture2D) + get "frame_109/duration"(): float64 + set "frame_109/duration"(value: float64) + get "frame_110/texture"(): Texture2D + set "frame_110/texture"(value: Texture2D) + get "frame_110/duration"(): float64 + set "frame_110/duration"(value: float64) + get "frame_111/texture"(): Texture2D + set "frame_111/texture"(value: Texture2D) + get "frame_111/duration"(): float64 + set "frame_111/duration"(value: float64) + get "frame_112/texture"(): Texture2D + set "frame_112/texture"(value: Texture2D) + get "frame_112/duration"(): float64 + set "frame_112/duration"(value: float64) + get "frame_113/texture"(): Texture2D + set "frame_113/texture"(value: Texture2D) + get "frame_113/duration"(): float64 + set "frame_113/duration"(value: float64) + get "frame_114/texture"(): Texture2D + set "frame_114/texture"(value: Texture2D) + get "frame_114/duration"(): float64 + set "frame_114/duration"(value: float64) + get "frame_115/texture"(): Texture2D + set "frame_115/texture"(value: Texture2D) + get "frame_115/duration"(): float64 + set "frame_115/duration"(value: float64) + get "frame_116/texture"(): Texture2D + set "frame_116/texture"(value: Texture2D) + get "frame_116/duration"(): float64 + set "frame_116/duration"(value: float64) + get "frame_117/texture"(): Texture2D + set "frame_117/texture"(value: Texture2D) + get "frame_117/duration"(): float64 + set "frame_117/duration"(value: float64) + get "frame_118/texture"(): Texture2D + set "frame_118/texture"(value: Texture2D) + get "frame_118/duration"(): float64 + set "frame_118/duration"(value: float64) + get "frame_119/texture"(): Texture2D + set "frame_119/texture"(value: Texture2D) + get "frame_119/duration"(): float64 + set "frame_119/duration"(value: float64) + get "frame_120/texture"(): Texture2D + set "frame_120/texture"(value: Texture2D) + get "frame_120/duration"(): float64 + set "frame_120/duration"(value: float64) + get "frame_121/texture"(): Texture2D + set "frame_121/texture"(value: Texture2D) + get "frame_121/duration"(): float64 + set "frame_121/duration"(value: float64) + get "frame_122/texture"(): Texture2D + set "frame_122/texture"(value: Texture2D) + get "frame_122/duration"(): float64 + set "frame_122/duration"(value: float64) + get "frame_123/texture"(): Texture2D + set "frame_123/texture"(value: Texture2D) + get "frame_123/duration"(): float64 + set "frame_123/duration"(value: float64) + get "frame_124/texture"(): Texture2D + set "frame_124/texture"(value: Texture2D) + get "frame_124/duration"(): float64 + set "frame_124/duration"(value: float64) + get "frame_125/texture"(): Texture2D + set "frame_125/texture"(value: Texture2D) + get "frame_125/duration"(): float64 + set "frame_125/duration"(value: float64) + get "frame_126/texture"(): Texture2D + set "frame_126/texture"(value: Texture2D) + get "frame_126/duration"(): float64 + set "frame_126/duration"(value: float64) + get "frame_127/texture"(): Texture2D + set "frame_127/texture"(value: Texture2D) + get "frame_127/duration"(): float64 + set "frame_127/duration"(value: float64) + get "frame_128/texture"(): Texture2D + set "frame_128/texture"(value: Texture2D) + get "frame_128/duration"(): float64 + set "frame_128/duration"(value: float64) + get "frame_129/texture"(): Texture2D + set "frame_129/texture"(value: Texture2D) + get "frame_129/duration"(): float64 + set "frame_129/duration"(value: float64) + get "frame_130/texture"(): Texture2D + set "frame_130/texture"(value: Texture2D) + get "frame_130/duration"(): float64 + set "frame_130/duration"(value: float64) + get "frame_131/texture"(): Texture2D + set "frame_131/texture"(value: Texture2D) + get "frame_131/duration"(): float64 + set "frame_131/duration"(value: float64) + get "frame_132/texture"(): Texture2D + set "frame_132/texture"(value: Texture2D) + get "frame_132/duration"(): float64 + set "frame_132/duration"(value: float64) + get "frame_133/texture"(): Texture2D + set "frame_133/texture"(value: Texture2D) + get "frame_133/duration"(): float64 + set "frame_133/duration"(value: float64) + get "frame_134/texture"(): Texture2D + set "frame_134/texture"(value: Texture2D) + get "frame_134/duration"(): float64 + set "frame_134/duration"(value: float64) + get "frame_135/texture"(): Texture2D + set "frame_135/texture"(value: Texture2D) + get "frame_135/duration"(): float64 + set "frame_135/duration"(value: float64) + get "frame_136/texture"(): Texture2D + set "frame_136/texture"(value: Texture2D) + get "frame_136/duration"(): float64 + set "frame_136/duration"(value: float64) + get "frame_137/texture"(): Texture2D + set "frame_137/texture"(value: Texture2D) + get "frame_137/duration"(): float64 + set "frame_137/duration"(value: float64) + get "frame_138/texture"(): Texture2D + set "frame_138/texture"(value: Texture2D) + get "frame_138/duration"(): float64 + set "frame_138/duration"(value: float64) + get "frame_139/texture"(): Texture2D + set "frame_139/texture"(value: Texture2D) + get "frame_139/duration"(): float64 + set "frame_139/duration"(value: float64) + get "frame_140/texture"(): Texture2D + set "frame_140/texture"(value: Texture2D) + get "frame_140/duration"(): float64 + set "frame_140/duration"(value: float64) + get "frame_141/texture"(): Texture2D + set "frame_141/texture"(value: Texture2D) + get "frame_141/duration"(): float64 + set "frame_141/duration"(value: float64) + get "frame_142/texture"(): Texture2D + set "frame_142/texture"(value: Texture2D) + get "frame_142/duration"(): float64 + set "frame_142/duration"(value: float64) + get "frame_143/texture"(): Texture2D + set "frame_143/texture"(value: Texture2D) + get "frame_143/duration"(): float64 + set "frame_143/duration"(value: float64) + get "frame_144/texture"(): Texture2D + set "frame_144/texture"(value: Texture2D) + get "frame_144/duration"(): float64 + set "frame_144/duration"(value: float64) + get "frame_145/texture"(): Texture2D + set "frame_145/texture"(value: Texture2D) + get "frame_145/duration"(): float64 + set "frame_145/duration"(value: float64) + get "frame_146/texture"(): Texture2D + set "frame_146/texture"(value: Texture2D) + get "frame_146/duration"(): float64 + set "frame_146/duration"(value: float64) + get "frame_147/texture"(): Texture2D + set "frame_147/texture"(value: Texture2D) + get "frame_147/duration"(): float64 + set "frame_147/duration"(value: float64) + get "frame_148/texture"(): Texture2D + set "frame_148/texture"(value: Texture2D) + get "frame_148/duration"(): float64 + set "frame_148/duration"(value: float64) + get "frame_149/texture"(): Texture2D + set "frame_149/texture"(value: Texture2D) + get "frame_149/duration"(): float64 + set "frame_149/duration"(value: float64) + get "frame_150/texture"(): Texture2D + set "frame_150/texture"(value: Texture2D) + get "frame_150/duration"(): float64 + set "frame_150/duration"(value: float64) + get "frame_151/texture"(): Texture2D + set "frame_151/texture"(value: Texture2D) + get "frame_151/duration"(): float64 + set "frame_151/duration"(value: float64) + get "frame_152/texture"(): Texture2D + set "frame_152/texture"(value: Texture2D) + get "frame_152/duration"(): float64 + set "frame_152/duration"(value: float64) + get "frame_153/texture"(): Texture2D + set "frame_153/texture"(value: Texture2D) + get "frame_153/duration"(): float64 + set "frame_153/duration"(value: float64) + get "frame_154/texture"(): Texture2D + set "frame_154/texture"(value: Texture2D) + get "frame_154/duration"(): float64 + set "frame_154/duration"(value: float64) + get "frame_155/texture"(): Texture2D + set "frame_155/texture"(value: Texture2D) + get "frame_155/duration"(): float64 + set "frame_155/duration"(value: float64) + get "frame_156/texture"(): Texture2D + set "frame_156/texture"(value: Texture2D) + get "frame_156/duration"(): float64 + set "frame_156/duration"(value: float64) + get "frame_157/texture"(): Texture2D + set "frame_157/texture"(value: Texture2D) + get "frame_157/duration"(): float64 + set "frame_157/duration"(value: float64) + get "frame_158/texture"(): Texture2D + set "frame_158/texture"(value: Texture2D) + get "frame_158/duration"(): float64 + set "frame_158/duration"(value: float64) + get "frame_159/texture"(): Texture2D + set "frame_159/texture"(value: Texture2D) + get "frame_159/duration"(): float64 + set "frame_159/duration"(value: float64) + get "frame_160/texture"(): Texture2D + set "frame_160/texture"(value: Texture2D) + get "frame_160/duration"(): float64 + set "frame_160/duration"(value: float64) + get "frame_161/texture"(): Texture2D + set "frame_161/texture"(value: Texture2D) + get "frame_161/duration"(): float64 + set "frame_161/duration"(value: float64) + get "frame_162/texture"(): Texture2D + set "frame_162/texture"(value: Texture2D) + get "frame_162/duration"(): float64 + set "frame_162/duration"(value: float64) + get "frame_163/texture"(): Texture2D + set "frame_163/texture"(value: Texture2D) + get "frame_163/duration"(): float64 + set "frame_163/duration"(value: float64) + get "frame_164/texture"(): Texture2D + set "frame_164/texture"(value: Texture2D) + get "frame_164/duration"(): float64 + set "frame_164/duration"(value: float64) + get "frame_165/texture"(): Texture2D + set "frame_165/texture"(value: Texture2D) + get "frame_165/duration"(): float64 + set "frame_165/duration"(value: float64) + get "frame_166/texture"(): Texture2D + set "frame_166/texture"(value: Texture2D) + get "frame_166/duration"(): float64 + set "frame_166/duration"(value: float64) + get "frame_167/texture"(): Texture2D + set "frame_167/texture"(value: Texture2D) + get "frame_167/duration"(): float64 + set "frame_167/duration"(value: float64) + get "frame_168/texture"(): Texture2D + set "frame_168/texture"(value: Texture2D) + get "frame_168/duration"(): float64 + set "frame_168/duration"(value: float64) + get "frame_169/texture"(): Texture2D + set "frame_169/texture"(value: Texture2D) + get "frame_169/duration"(): float64 + set "frame_169/duration"(value: float64) + get "frame_170/texture"(): Texture2D + set "frame_170/texture"(value: Texture2D) + get "frame_170/duration"(): float64 + set "frame_170/duration"(value: float64) + get "frame_171/texture"(): Texture2D + set "frame_171/texture"(value: Texture2D) + get "frame_171/duration"(): float64 + set "frame_171/duration"(value: float64) + get "frame_172/texture"(): Texture2D + set "frame_172/texture"(value: Texture2D) + get "frame_172/duration"(): float64 + set "frame_172/duration"(value: float64) + get "frame_173/texture"(): Texture2D + set "frame_173/texture"(value: Texture2D) + get "frame_173/duration"(): float64 + set "frame_173/duration"(value: float64) + get "frame_174/texture"(): Texture2D + set "frame_174/texture"(value: Texture2D) + get "frame_174/duration"(): float64 + set "frame_174/duration"(value: float64) + get "frame_175/texture"(): Texture2D + set "frame_175/texture"(value: Texture2D) + get "frame_175/duration"(): float64 + set "frame_175/duration"(value: float64) + get "frame_176/texture"(): Texture2D + set "frame_176/texture"(value: Texture2D) + get "frame_176/duration"(): float64 + set "frame_176/duration"(value: float64) + get "frame_177/texture"(): Texture2D + set "frame_177/texture"(value: Texture2D) + get "frame_177/duration"(): float64 + set "frame_177/duration"(value: float64) + get "frame_178/texture"(): Texture2D + set "frame_178/texture"(value: Texture2D) + get "frame_178/duration"(): float64 + set "frame_178/duration"(value: float64) + get "frame_179/texture"(): Texture2D + set "frame_179/texture"(value: Texture2D) + get "frame_179/duration"(): float64 + set "frame_179/duration"(value: float64) + get "frame_180/texture"(): Texture2D + set "frame_180/texture"(value: Texture2D) + get "frame_180/duration"(): float64 + set "frame_180/duration"(value: float64) + get "frame_181/texture"(): Texture2D + set "frame_181/texture"(value: Texture2D) + get "frame_181/duration"(): float64 + set "frame_181/duration"(value: float64) + get "frame_182/texture"(): Texture2D + set "frame_182/texture"(value: Texture2D) + get "frame_182/duration"(): float64 + set "frame_182/duration"(value: float64) + get "frame_183/texture"(): Texture2D + set "frame_183/texture"(value: Texture2D) + get "frame_183/duration"(): float64 + set "frame_183/duration"(value: float64) + get "frame_184/texture"(): Texture2D + set "frame_184/texture"(value: Texture2D) + get "frame_184/duration"(): float64 + set "frame_184/duration"(value: float64) + get "frame_185/texture"(): Texture2D + set "frame_185/texture"(value: Texture2D) + get "frame_185/duration"(): float64 + set "frame_185/duration"(value: float64) + get "frame_186/texture"(): Texture2D + set "frame_186/texture"(value: Texture2D) + get "frame_186/duration"(): float64 + set "frame_186/duration"(value: float64) + get "frame_187/texture"(): Texture2D + set "frame_187/texture"(value: Texture2D) + get "frame_187/duration"(): float64 + set "frame_187/duration"(value: float64) + get "frame_188/texture"(): Texture2D + set "frame_188/texture"(value: Texture2D) + get "frame_188/duration"(): float64 + set "frame_188/duration"(value: float64) + get "frame_189/texture"(): Texture2D + set "frame_189/texture"(value: Texture2D) + get "frame_189/duration"(): float64 + set "frame_189/duration"(value: float64) + get "frame_190/texture"(): Texture2D + set "frame_190/texture"(value: Texture2D) + get "frame_190/duration"(): float64 + set "frame_190/duration"(value: float64) + get "frame_191/texture"(): Texture2D + set "frame_191/texture"(value: Texture2D) + get "frame_191/duration"(): float64 + set "frame_191/duration"(value: float64) + get "frame_192/texture"(): Texture2D + set "frame_192/texture"(value: Texture2D) + get "frame_192/duration"(): float64 + set "frame_192/duration"(value: float64) + get "frame_193/texture"(): Texture2D + set "frame_193/texture"(value: Texture2D) + get "frame_193/duration"(): float64 + set "frame_193/duration"(value: float64) + get "frame_194/texture"(): Texture2D + set "frame_194/texture"(value: Texture2D) + get "frame_194/duration"(): float64 + set "frame_194/duration"(value: float64) + get "frame_195/texture"(): Texture2D + set "frame_195/texture"(value: Texture2D) + get "frame_195/duration"(): float64 + set "frame_195/duration"(value: float64) + get "frame_196/texture"(): Texture2D + set "frame_196/texture"(value: Texture2D) + get "frame_196/duration"(): float64 + set "frame_196/duration"(value: float64) + get "frame_197/texture"(): Texture2D + set "frame_197/texture"(value: Texture2D) + get "frame_197/duration"(): float64 + set "frame_197/duration"(value: float64) + get "frame_198/texture"(): Texture2D + set "frame_198/texture"(value: Texture2D) + get "frame_198/duration"(): float64 + set "frame_198/duration"(value: float64) + get "frame_199/texture"(): Texture2D + set "frame_199/texture"(value: Texture2D) + get "frame_199/duration"(): float64 + set "frame_199/duration"(value: float64) + get "frame_200/texture"(): Texture2D + set "frame_200/texture"(value: Texture2D) + get "frame_200/duration"(): float64 + set "frame_200/duration"(value: float64) + get "frame_201/texture"(): Texture2D + set "frame_201/texture"(value: Texture2D) + get "frame_201/duration"(): float64 + set "frame_201/duration"(value: float64) + get "frame_202/texture"(): Texture2D + set "frame_202/texture"(value: Texture2D) + get "frame_202/duration"(): float64 + set "frame_202/duration"(value: float64) + get "frame_203/texture"(): Texture2D + set "frame_203/texture"(value: Texture2D) + get "frame_203/duration"(): float64 + set "frame_203/duration"(value: float64) + get "frame_204/texture"(): Texture2D + set "frame_204/texture"(value: Texture2D) + get "frame_204/duration"(): float64 + set "frame_204/duration"(value: float64) + get "frame_205/texture"(): Texture2D + set "frame_205/texture"(value: Texture2D) + get "frame_205/duration"(): float64 + set "frame_205/duration"(value: float64) + get "frame_206/texture"(): Texture2D + set "frame_206/texture"(value: Texture2D) + get "frame_206/duration"(): float64 + set "frame_206/duration"(value: float64) + get "frame_207/texture"(): Texture2D + set "frame_207/texture"(value: Texture2D) + get "frame_207/duration"(): float64 + set "frame_207/duration"(value: float64) + get "frame_208/texture"(): Texture2D + set "frame_208/texture"(value: Texture2D) + get "frame_208/duration"(): float64 + set "frame_208/duration"(value: float64) + get "frame_209/texture"(): Texture2D + set "frame_209/texture"(value: Texture2D) + get "frame_209/duration"(): float64 + set "frame_209/duration"(value: float64) + get "frame_210/texture"(): Texture2D + set "frame_210/texture"(value: Texture2D) + get "frame_210/duration"(): float64 + set "frame_210/duration"(value: float64) + get "frame_211/texture"(): Texture2D + set "frame_211/texture"(value: Texture2D) + get "frame_211/duration"(): float64 + set "frame_211/duration"(value: float64) + get "frame_212/texture"(): Texture2D + set "frame_212/texture"(value: Texture2D) + get "frame_212/duration"(): float64 + set "frame_212/duration"(value: float64) + get "frame_213/texture"(): Texture2D + set "frame_213/texture"(value: Texture2D) + get "frame_213/duration"(): float64 + set "frame_213/duration"(value: float64) + get "frame_214/texture"(): Texture2D + set "frame_214/texture"(value: Texture2D) + get "frame_214/duration"(): float64 + set "frame_214/duration"(value: float64) + get "frame_215/texture"(): Texture2D + set "frame_215/texture"(value: Texture2D) + get "frame_215/duration"(): float64 + set "frame_215/duration"(value: float64) + get "frame_216/texture"(): Texture2D + set "frame_216/texture"(value: Texture2D) + get "frame_216/duration"(): float64 + set "frame_216/duration"(value: float64) + get "frame_217/texture"(): Texture2D + set "frame_217/texture"(value: Texture2D) + get "frame_217/duration"(): float64 + set "frame_217/duration"(value: float64) + get "frame_218/texture"(): Texture2D + set "frame_218/texture"(value: Texture2D) + get "frame_218/duration"(): float64 + set "frame_218/duration"(value: float64) + get "frame_219/texture"(): Texture2D + set "frame_219/texture"(value: Texture2D) + get "frame_219/duration"(): float64 + set "frame_219/duration"(value: float64) + get "frame_220/texture"(): Texture2D + set "frame_220/texture"(value: Texture2D) + get "frame_220/duration"(): float64 + set "frame_220/duration"(value: float64) + get "frame_221/texture"(): Texture2D + set "frame_221/texture"(value: Texture2D) + get "frame_221/duration"(): float64 + set "frame_221/duration"(value: float64) + get "frame_222/texture"(): Texture2D + set "frame_222/texture"(value: Texture2D) + get "frame_222/duration"(): float64 + set "frame_222/duration"(value: float64) + get "frame_223/texture"(): Texture2D + set "frame_223/texture"(value: Texture2D) + get "frame_223/duration"(): float64 + set "frame_223/duration"(value: float64) + get "frame_224/texture"(): Texture2D + set "frame_224/texture"(value: Texture2D) + get "frame_224/duration"(): float64 + set "frame_224/duration"(value: float64) + get "frame_225/texture"(): Texture2D + set "frame_225/texture"(value: Texture2D) + get "frame_225/duration"(): float64 + set "frame_225/duration"(value: float64) + get "frame_226/texture"(): Texture2D + set "frame_226/texture"(value: Texture2D) + get "frame_226/duration"(): float64 + set "frame_226/duration"(value: float64) + get "frame_227/texture"(): Texture2D + set "frame_227/texture"(value: Texture2D) + get "frame_227/duration"(): float64 + set "frame_227/duration"(value: float64) + get "frame_228/texture"(): Texture2D + set "frame_228/texture"(value: Texture2D) + get "frame_228/duration"(): float64 + set "frame_228/duration"(value: float64) + get "frame_229/texture"(): Texture2D + set "frame_229/texture"(value: Texture2D) + get "frame_229/duration"(): float64 + set "frame_229/duration"(value: float64) + get "frame_230/texture"(): Texture2D + set "frame_230/texture"(value: Texture2D) + get "frame_230/duration"(): float64 + set "frame_230/duration"(value: float64) + get "frame_231/texture"(): Texture2D + set "frame_231/texture"(value: Texture2D) + get "frame_231/duration"(): float64 + set "frame_231/duration"(value: float64) + get "frame_232/texture"(): Texture2D + set "frame_232/texture"(value: Texture2D) + get "frame_232/duration"(): float64 + set "frame_232/duration"(value: float64) + get "frame_233/texture"(): Texture2D + set "frame_233/texture"(value: Texture2D) + get "frame_233/duration"(): float64 + set "frame_233/duration"(value: float64) + get "frame_234/texture"(): Texture2D + set "frame_234/texture"(value: Texture2D) + get "frame_234/duration"(): float64 + set "frame_234/duration"(value: float64) + get "frame_235/texture"(): Texture2D + set "frame_235/texture"(value: Texture2D) + get "frame_235/duration"(): float64 + set "frame_235/duration"(value: float64) + get "frame_236/texture"(): Texture2D + set "frame_236/texture"(value: Texture2D) + get "frame_236/duration"(): float64 + set "frame_236/duration"(value: float64) + get "frame_237/texture"(): Texture2D + set "frame_237/texture"(value: Texture2D) + get "frame_237/duration"(): float64 + set "frame_237/duration"(value: float64) + get "frame_238/texture"(): Texture2D + set "frame_238/texture"(value: Texture2D) + get "frame_238/duration"(): float64 + set "frame_238/duration"(value: float64) + get "frame_239/texture"(): Texture2D + set "frame_239/texture"(value: Texture2D) + get "frame_239/duration"(): float64 + set "frame_239/duration"(value: float64) + get "frame_240/texture"(): Texture2D + set "frame_240/texture"(value: Texture2D) + get "frame_240/duration"(): float64 + set "frame_240/duration"(value: float64) + get "frame_241/texture"(): Texture2D + set "frame_241/texture"(value: Texture2D) + get "frame_241/duration"(): float64 + set "frame_241/duration"(value: float64) + get "frame_242/texture"(): Texture2D + set "frame_242/texture"(value: Texture2D) + get "frame_242/duration"(): float64 + set "frame_242/duration"(value: float64) + get "frame_243/texture"(): Texture2D + set "frame_243/texture"(value: Texture2D) + get "frame_243/duration"(): float64 + set "frame_243/duration"(value: float64) + get "frame_244/texture"(): Texture2D + set "frame_244/texture"(value: Texture2D) + get "frame_244/duration"(): float64 + set "frame_244/duration"(value: float64) + get "frame_245/texture"(): Texture2D + set "frame_245/texture"(value: Texture2D) + get "frame_245/duration"(): float64 + set "frame_245/duration"(value: float64) + get "frame_246/texture"(): Texture2D + set "frame_246/texture"(value: Texture2D) + get "frame_246/duration"(): float64 + set "frame_246/duration"(value: float64) + get "frame_247/texture"(): Texture2D + set "frame_247/texture"(value: Texture2D) + get "frame_247/duration"(): float64 + set "frame_247/duration"(value: float64) + get "frame_248/texture"(): Texture2D + set "frame_248/texture"(value: Texture2D) + get "frame_248/duration"(): float64 + set "frame_248/duration"(value: float64) + get "frame_249/texture"(): Texture2D + set "frame_249/texture"(value: Texture2D) + get "frame_249/duration"(): float64 + set "frame_249/duration"(value: float64) + get "frame_250/texture"(): Texture2D + set "frame_250/texture"(value: Texture2D) + get "frame_250/duration"(): float64 + set "frame_250/duration"(value: float64) + get "frame_251/texture"(): Texture2D + set "frame_251/texture"(value: Texture2D) + get "frame_251/duration"(): float64 + set "frame_251/duration"(value: float64) + get "frame_252/texture"(): Texture2D + set "frame_252/texture"(value: Texture2D) + get "frame_252/duration"(): float64 + set "frame_252/duration"(value: float64) + get "frame_253/texture"(): Texture2D + set "frame_253/texture"(value: Texture2D) + get "frame_253/duration"(): float64 + set "frame_253/duration"(value: float64) + get "frame_254/texture"(): Texture2D + set "frame_254/texture"(value: Texture2D) + get "frame_254/duration"(): float64 + set "frame_254/duration"(value: float64) + get "frame_255/texture"(): Texture2D + set "frame_255/texture"(value: Texture2D) + get "frame_255/duration"(): float64 + set "frame_255/duration"(value: float64) } namespace Animation { enum TrackType { @@ -862,7 +3753,7 @@ declare module "godot" { } /** Holds data that can be used to animate anything in the engine. * - * @link https://docs.godotengine.org/en/4.3/classes/class_animation.html + * @link https://docs.godotengine.org/en/4.4/classes/class_animation.html */ class Animation extends Resource { constructor(identifier?: any) @@ -1074,12 +3965,45 @@ declare module "godot" { /** Returns the animation name at the key identified by [param key_idx]. The [param track_idx] must be the index of an Animation Track. */ animation_track_get_key_animation(track_idx: int64, key_idx: int64): StringName + /** Adds a marker to this Animation. */ + add_marker(name: StringName, time: float64): void + + /** Removes the marker with the given name from this Animation. */ + remove_marker(name: StringName): void + + /** Returns `true` if this Animation contains a marker with the given name. */ + has_marker(name: StringName): boolean + + /** Returns the name of the marker located at the given time. */ + get_marker_at_time(time: float64): StringName + + /** Returns the closest marker that comes after the given time. If no such marker exists, an empty string is returned. */ + get_next_marker(time: float64): StringName + + /** Returns the closest marker that comes before the given time. If no such marker exists, an empty string is returned. */ + get_prev_marker(time: float64): StringName + + /** Returns the given marker's time. */ + get_marker_time(name: StringName): float64 + + /** Returns every marker in this Animation, sorted ascending by time. */ + get_marker_names(): PackedStringArray + + /** Returns the given marker's color. */ + get_marker_color(name: StringName): Color + + /** Sets the given marker's color. */ + set_marker_color(name: StringName, color: Color): void + /** Clear the animation (clear all tracks and reset all). */ clear(): void /** Adds a new track to [param to_animation] that is a copy of the given track from this animation. */ copy_track(track_idx: int64, to_animation: Animation): void + /** Optimize the animation and all its tracks in-place. This will preserve only as many keys as are necessary to keep the animation within the specified bounds. */ + optimize(allowed_velocity_err: float64 = 0.01, allowed_angular_err: float64 = 0.01, precision: int64 = 3): void + /** Compress the animation and all its tracks in-place. This will make [method track_is_compressed] return `true` once called on this [Animation]. Compressed tracks require less memory to be played, and are designed to be used for complex 3D animations (such as cutscenes) imported from external 3D software. Compression is lossy, but the difference is usually not noticeable in real world conditions. * * **Note:** Compressed tracks have various limitations (such as not being editable from the editor), so only use compressed animations if you actually need them. @@ -1104,7 +4028,7 @@ declare module "godot" { /** Returns `true` if the capture track is included. This is a cached readonly value for performance. */ get capture_included(): boolean } - class AnimationBezierTrackEdit extends Control { + class AnimationBezierTrackEdit = Record> extends Control { constructor(identifier?: any) _clear_selection(): void _clear_selection_for_anim(_unnamed_arg0: Animation): void @@ -1118,7 +4042,7 @@ declare module "godot" { } /** Container for [Animation] resources. * - * @link https://docs.godotengine.org/en/4.3/classes/class_animationlibrary.html + * @link https://docs.godotengine.org/en/4.4/classes/class_animationlibrary.html */ class AnimationLibrary extends Resource { constructor(identifier?: any) @@ -1139,6 +4063,9 @@ declare module "godot" { /** Returns the keys for the [Animation]s stored in the library. */ get_animation_list(): GArray + + /** Returns the key count for the [Animation]s stored in the library. */ + get_animation_list_size(): int64 get _data(): GDictionary set _data(value: GDictionary) @@ -1156,11 +4083,20 @@ declare module "godot" { */ readonly animation_changed: Signal1 } - class AnimationLibraryEditor extends AcceptDialog { + class AnimationLibraryEditor = Record> extends AcceptDialog { constructor(identifier?: any) _update_editor(mixer: Object): void readonly update_editor: Signal0 } + class AnimationMarkerEdit = Record> extends Control { + constructor(identifier?: any) + _clear_selection_for_anim(_unnamed_arg0: Animation): void + _select_key(_unnamed_arg0: StringName, _unnamed_arg1: boolean): void + _deselect_key(_unnamed_arg0: StringName): void + } + class AnimationMarkerKeyEditEditorPlugin = Record> extends EditorPlugin { + constructor(identifier?: any) + } namespace AnimationMixer { enum AnimationCallbackModeProcess { /** Process animation during physics frames (see [constant Node.NOTIFICATION_INTERNAL_PHYSICS_PROCESS]). This is especially useful when animating physics bodies. */ @@ -1187,16 +4123,28 @@ declare module "godot" { ANIMATION_CALLBACK_MODE_DISCRETE_RECESSIVE = 1, /** Always treat the [constant Animation.UPDATE_DISCRETE] track value as [constant Animation.UPDATE_CONTINUOUS] with [constant Animation.INTERPOLATION_NEAREST]. This is the default behavior for [AnimationTree]. - * If a value track has non-numeric type key values, it is internally converted to use [constant ANIMATION_CALLBACK_MODE_DISCRETE_RECESSIVE] with [constant Animation.UPDATE_DISCRETE]. + * If a value track has un-interpolatable type key values, it is internally converted to use [constant ANIMATION_CALLBACK_MODE_DISCRETE_RECESSIVE] with [constant Animation.UPDATE_DISCRETE]. + * Un-interpolatable type list: + * - [constant @GlobalScope.TYPE_NIL] + * - [constant @GlobalScope.TYPE_NODE_PATH] + * - [constant @GlobalScope.TYPE_RID] + * - [constant @GlobalScope.TYPE_OBJECT] + * - [constant @GlobalScope.TYPE_CALLABLE] + * - [constant @GlobalScope.TYPE_SIGNAL] + * - [constant @GlobalScope.TYPE_DICTIONARY] + * - [constant @GlobalScope.TYPE_PACKED_BYTE_ARRAY] + * [constant @GlobalScope.TYPE_BOOL] and [constant @GlobalScope.TYPE_INT] are treated as [constant @GlobalScope.TYPE_FLOAT] during blending and rounded when the result is retrieved. + * It is same for arrays and vectors with them such as [constant @GlobalScope.TYPE_PACKED_INT32_ARRAY] or [constant @GlobalScope.TYPE_VECTOR2I], they are treated as [constant @GlobalScope.TYPE_PACKED_FLOAT32_ARRAY] or [constant @GlobalScope.TYPE_VECTOR2]. Also note that for arrays, the size is also interpolated. + * [constant @GlobalScope.TYPE_STRING] and [constant @GlobalScope.TYPE_STRING_NAME] are interpolated between character codes and lengths, but note that there is a difference in algorithm between interpolation between keys and interpolation by blending. */ ANIMATION_CALLBACK_MODE_DISCRETE_FORCE_CONTINUOUS = 2, } } /** Base class for [AnimationPlayer] and [AnimationTree]. * - * @link https://docs.godotengine.org/en/4.3/classes/class_animationmixer.html + * @link https://docs.godotengine.org/en/4.4/classes/class_animationmixer.html */ - class AnimationMixer extends Node { + class AnimationMixer = Record> extends Node { constructor(identifier?: any) /** A virtual function for processing after getting a key during playback. */ /* gdvirtual */ _post_process_key_value(animation: Animation, track: int64, value: any, object_id: int64, object_sub_idx: int64): any @@ -1240,6 +4188,9 @@ declare module "godot" { * * By using this in combination with [method get_root_motion_rotation_accumulator], you can apply the root motion position more correctly to account for the rotation of the node. * + * If [member root_motion_local] is `true`, return the pre-multiplied translation value with the inverted rotation. + * In this case, the code can be written as follows: + * */ get_root_motion_position(): Vector3 @@ -1334,6 +4285,10 @@ declare module "godot" { get root_motion_track(): NodePath set root_motion_track(value: NodePath | string) + /** If `true`, [method get_root_motion_position] value is extracted as a local translation value before blending. In other words, it is treated like the translation is done after the rotation. */ + get root_motion_local(): boolean + set root_motion_local(value: boolean) + /** The number of possible simultaneous sounds for each of the assigned AudioStreamPlayers. * For example, if this value is `32` and the animation has two audio tracks, the two [AudioStreamPlayer]s assigned can play simultaneously up to `32` voices each. */ @@ -1396,7 +4351,7 @@ declare module "godot" { } /** Base class for [AnimationTree] nodes. Not related to scene nodes. * - * @link https://docs.godotengine.org/en/4.3/classes/class_animationnode.html + * @link https://docs.godotengine.org/en/4.4/classes/class_animationnode.html */ class AnimationNode extends Resource { constructor(identifier?: any) @@ -1448,9 +4403,18 @@ declare module "godot" { /** Adds or removes a path for the filter. */ set_filter_path(path: NodePath | string, enable: boolean): void - /** Returns whether the given path is filtered. */ + /** Returns `true` if the given path is filtered. */ is_path_filtered(path: NodePath | string): boolean + /** Returns the object id of the [AnimationTree] that owns this node. + * + * **Note:** This method should only be called from within the [method AnimationNodeExtension._process_animation_node] method, and will return an invalid id otherwise. + */ + get_processing_animation_tree_instance_id(): int64 + + /** Returns `true` if this animation node is being processed in test-only mode. */ + is_process_testing(): boolean + /** Blend an animation by [param blend] amount (name must be valid in the linked [AnimationPlayer]). A [param time] and [param delta] may be passed, as well as whether [param seeked] happened. * A [param looped_flag] is used by internal processing immediately after the loop. See also [enum Animation.LoopedFlag]. */ @@ -1485,14 +4449,14 @@ declare module "godot" { } /** Blends two animations additively inside of an [AnimationNodeBlendTree]. * - * @link https://docs.godotengine.org/en/4.3/classes/class_animationnodeadd2.html + * @link https://docs.godotengine.org/en/4.4/classes/class_animationnodeadd2.html */ class AnimationNodeAdd2 extends AnimationNodeSync { constructor(identifier?: any) } /** Blends two of three animations additively inside of an [AnimationNodeBlendTree]. * - * @link https://docs.godotengine.org/en/4.3/classes/class_animationnodeadd3.html + * @link https://docs.godotengine.org/en/4.4/classes/class_animationnodeadd3.html */ class AnimationNodeAdd3 extends AnimationNodeSync { constructor(identifier?: any) @@ -1508,7 +4472,7 @@ declare module "godot" { } /** An input animation for an [AnimationNodeBlendTree]. * - * @link https://docs.godotengine.org/en/4.3/classes/class_animationnodeanimation.html + * @link https://docs.godotengine.org/en/4.4/classes/class_animationnodeanimation.html */ class AnimationNodeAnimation extends AnimationRootNode { constructor(identifier?: any) @@ -1520,6 +4484,12 @@ declare module "godot" { get play_mode(): int64 set play_mode(value: int64) + /** If `true`, on receiving a request to play an animation from the start, the first frame is not drawn, but only processed, and playback starts from the next frame. + * See also the notes of [method AnimationPlayer.play]. + */ + get advance_on_start(): boolean + set advance_on_start(value: boolean) + /** If `true`, [AnimationNode] provides an animation based on the [Animation] resource with some parameters adjusted. */ get use_custom_timeline(): boolean set use_custom_timeline(value: boolean) @@ -1550,14 +4520,14 @@ declare module "godot" { } /** Blends two animations linearly inside of an [AnimationNodeBlendTree]. * - * @link https://docs.godotengine.org/en/4.3/classes/class_animationnodeblend2.html + * @link https://docs.godotengine.org/en/4.4/classes/class_animationnodeblend2.html */ class AnimationNodeBlend2 extends AnimationNodeSync { constructor(identifier?: any) } /** Blends two of three animations linearly inside of an [AnimationNodeBlendTree]. * - * @link https://docs.godotengine.org/en/4.3/classes/class_animationnodeblend3.html + * @link https://docs.godotengine.org/en/4.4/classes/class_animationnodeblend3.html */ class AnimationNodeBlend3 extends AnimationNodeSync { constructor(identifier?: any) @@ -1576,7 +4546,7 @@ declare module "godot" { } /** A set of [AnimationRootNode]s placed on a virtual axis, crossfading between the two adjacent ones. Used by [AnimationTree]. * - * @link https://docs.godotengine.org/en/4.3/classes/class_animationnodeblendspace1d.html + * @link https://docs.godotengine.org/en/4.4/classes/class_animationnodeblendspace1d.html */ class AnimationNodeBlendSpace1D extends AnimationRootNode { constructor(identifier?: any) @@ -1601,6 +4571,262 @@ declare module "godot" { /** Returns the number of points on the blend axis. */ get_blend_point_count(): int64 _add_blend_point(index: int64, node: AnimationRootNode): void + get "blend_point_0/node"(): AnimationRootNode + set "blend_point_0/node"(value: AnimationRootNode) + get "blend_point_0/pos"(): float64 + set "blend_point_0/pos"(value: float64) + get "blend_point_1/node"(): AnimationRootNode + set "blend_point_1/node"(value: AnimationRootNode) + get "blend_point_1/pos"(): float64 + set "blend_point_1/pos"(value: float64) + get "blend_point_2/node"(): AnimationRootNode + set "blend_point_2/node"(value: AnimationRootNode) + get "blend_point_2/pos"(): float64 + set "blend_point_2/pos"(value: float64) + get "blend_point_3/node"(): AnimationRootNode + set "blend_point_3/node"(value: AnimationRootNode) + get "blend_point_3/pos"(): float64 + set "blend_point_3/pos"(value: float64) + get "blend_point_4/node"(): AnimationRootNode + set "blend_point_4/node"(value: AnimationRootNode) + get "blend_point_4/pos"(): float64 + set "blend_point_4/pos"(value: float64) + get "blend_point_5/node"(): AnimationRootNode + set "blend_point_5/node"(value: AnimationRootNode) + get "blend_point_5/pos"(): float64 + set "blend_point_5/pos"(value: float64) + get "blend_point_6/node"(): AnimationRootNode + set "blend_point_6/node"(value: AnimationRootNode) + get "blend_point_6/pos"(): float64 + set "blend_point_6/pos"(value: float64) + get "blend_point_7/node"(): AnimationRootNode + set "blend_point_7/node"(value: AnimationRootNode) + get "blend_point_7/pos"(): float64 + set "blend_point_7/pos"(value: float64) + get "blend_point_8/node"(): AnimationRootNode + set "blend_point_8/node"(value: AnimationRootNode) + get "blend_point_8/pos"(): float64 + set "blend_point_8/pos"(value: float64) + get "blend_point_9/node"(): AnimationRootNode + set "blend_point_9/node"(value: AnimationRootNode) + get "blend_point_9/pos"(): float64 + set "blend_point_9/pos"(value: float64) + get "blend_point_10/node"(): AnimationRootNode + set "blend_point_10/node"(value: AnimationRootNode) + get "blend_point_10/pos"(): float64 + set "blend_point_10/pos"(value: float64) + get "blend_point_11/node"(): AnimationRootNode + set "blend_point_11/node"(value: AnimationRootNode) + get "blend_point_11/pos"(): float64 + set "blend_point_11/pos"(value: float64) + get "blend_point_12/node"(): AnimationRootNode + set "blend_point_12/node"(value: AnimationRootNode) + get "blend_point_12/pos"(): float64 + set "blend_point_12/pos"(value: float64) + get "blend_point_13/node"(): AnimationRootNode + set "blend_point_13/node"(value: AnimationRootNode) + get "blend_point_13/pos"(): float64 + set "blend_point_13/pos"(value: float64) + get "blend_point_14/node"(): AnimationRootNode + set "blend_point_14/node"(value: AnimationRootNode) + get "blend_point_14/pos"(): float64 + set "blend_point_14/pos"(value: float64) + get "blend_point_15/node"(): AnimationRootNode + set "blend_point_15/node"(value: AnimationRootNode) + get "blend_point_15/pos"(): float64 + set "blend_point_15/pos"(value: float64) + get "blend_point_16/node"(): AnimationRootNode + set "blend_point_16/node"(value: AnimationRootNode) + get "blend_point_16/pos"(): float64 + set "blend_point_16/pos"(value: float64) + get "blend_point_17/node"(): AnimationRootNode + set "blend_point_17/node"(value: AnimationRootNode) + get "blend_point_17/pos"(): float64 + set "blend_point_17/pos"(value: float64) + get "blend_point_18/node"(): AnimationRootNode + set "blend_point_18/node"(value: AnimationRootNode) + get "blend_point_18/pos"(): float64 + set "blend_point_18/pos"(value: float64) + get "blend_point_19/node"(): AnimationRootNode + set "blend_point_19/node"(value: AnimationRootNode) + get "blend_point_19/pos"(): float64 + set "blend_point_19/pos"(value: float64) + get "blend_point_20/node"(): AnimationRootNode + set "blend_point_20/node"(value: AnimationRootNode) + get "blend_point_20/pos"(): float64 + set "blend_point_20/pos"(value: float64) + get "blend_point_21/node"(): AnimationRootNode + set "blend_point_21/node"(value: AnimationRootNode) + get "blend_point_21/pos"(): float64 + set "blend_point_21/pos"(value: float64) + get "blend_point_22/node"(): AnimationRootNode + set "blend_point_22/node"(value: AnimationRootNode) + get "blend_point_22/pos"(): float64 + set "blend_point_22/pos"(value: float64) + get "blend_point_23/node"(): AnimationRootNode + set "blend_point_23/node"(value: AnimationRootNode) + get "blend_point_23/pos"(): float64 + set "blend_point_23/pos"(value: float64) + get "blend_point_24/node"(): AnimationRootNode + set "blend_point_24/node"(value: AnimationRootNode) + get "blend_point_24/pos"(): float64 + set "blend_point_24/pos"(value: float64) + get "blend_point_25/node"(): AnimationRootNode + set "blend_point_25/node"(value: AnimationRootNode) + get "blend_point_25/pos"(): float64 + set "blend_point_25/pos"(value: float64) + get "blend_point_26/node"(): AnimationRootNode + set "blend_point_26/node"(value: AnimationRootNode) + get "blend_point_26/pos"(): float64 + set "blend_point_26/pos"(value: float64) + get "blend_point_27/node"(): AnimationRootNode + set "blend_point_27/node"(value: AnimationRootNode) + get "blend_point_27/pos"(): float64 + set "blend_point_27/pos"(value: float64) + get "blend_point_28/node"(): AnimationRootNode + set "blend_point_28/node"(value: AnimationRootNode) + get "blend_point_28/pos"(): float64 + set "blend_point_28/pos"(value: float64) + get "blend_point_29/node"(): AnimationRootNode + set "blend_point_29/node"(value: AnimationRootNode) + get "blend_point_29/pos"(): float64 + set "blend_point_29/pos"(value: float64) + get "blend_point_30/node"(): AnimationRootNode + set "blend_point_30/node"(value: AnimationRootNode) + get "blend_point_30/pos"(): float64 + set "blend_point_30/pos"(value: float64) + get "blend_point_31/node"(): AnimationRootNode + set "blend_point_31/node"(value: AnimationRootNode) + get "blend_point_31/pos"(): float64 + set "blend_point_31/pos"(value: float64) + get "blend_point_32/node"(): AnimationRootNode + set "blend_point_32/node"(value: AnimationRootNode) + get "blend_point_32/pos"(): float64 + set "blend_point_32/pos"(value: float64) + get "blend_point_33/node"(): AnimationRootNode + set "blend_point_33/node"(value: AnimationRootNode) + get "blend_point_33/pos"(): float64 + set "blend_point_33/pos"(value: float64) + get "blend_point_34/node"(): AnimationRootNode + set "blend_point_34/node"(value: AnimationRootNode) + get "blend_point_34/pos"(): float64 + set "blend_point_34/pos"(value: float64) + get "blend_point_35/node"(): AnimationRootNode + set "blend_point_35/node"(value: AnimationRootNode) + get "blend_point_35/pos"(): float64 + set "blend_point_35/pos"(value: float64) + get "blend_point_36/node"(): AnimationRootNode + set "blend_point_36/node"(value: AnimationRootNode) + get "blend_point_36/pos"(): float64 + set "blend_point_36/pos"(value: float64) + get "blend_point_37/node"(): AnimationRootNode + set "blend_point_37/node"(value: AnimationRootNode) + get "blend_point_37/pos"(): float64 + set "blend_point_37/pos"(value: float64) + get "blend_point_38/node"(): AnimationRootNode + set "blend_point_38/node"(value: AnimationRootNode) + get "blend_point_38/pos"(): float64 + set "blend_point_38/pos"(value: float64) + get "blend_point_39/node"(): AnimationRootNode + set "blend_point_39/node"(value: AnimationRootNode) + get "blend_point_39/pos"(): float64 + set "blend_point_39/pos"(value: float64) + get "blend_point_40/node"(): AnimationRootNode + set "blend_point_40/node"(value: AnimationRootNode) + get "blend_point_40/pos"(): float64 + set "blend_point_40/pos"(value: float64) + get "blend_point_41/node"(): AnimationRootNode + set "blend_point_41/node"(value: AnimationRootNode) + get "blend_point_41/pos"(): float64 + set "blend_point_41/pos"(value: float64) + get "blend_point_42/node"(): AnimationRootNode + set "blend_point_42/node"(value: AnimationRootNode) + get "blend_point_42/pos"(): float64 + set "blend_point_42/pos"(value: float64) + get "blend_point_43/node"(): AnimationRootNode + set "blend_point_43/node"(value: AnimationRootNode) + get "blend_point_43/pos"(): float64 + set "blend_point_43/pos"(value: float64) + get "blend_point_44/node"(): AnimationRootNode + set "blend_point_44/node"(value: AnimationRootNode) + get "blend_point_44/pos"(): float64 + set "blend_point_44/pos"(value: float64) + get "blend_point_45/node"(): AnimationRootNode + set "blend_point_45/node"(value: AnimationRootNode) + get "blend_point_45/pos"(): float64 + set "blend_point_45/pos"(value: float64) + get "blend_point_46/node"(): AnimationRootNode + set "blend_point_46/node"(value: AnimationRootNode) + get "blend_point_46/pos"(): float64 + set "blend_point_46/pos"(value: float64) + get "blend_point_47/node"(): AnimationRootNode + set "blend_point_47/node"(value: AnimationRootNode) + get "blend_point_47/pos"(): float64 + set "blend_point_47/pos"(value: float64) + get "blend_point_48/node"(): AnimationRootNode + set "blend_point_48/node"(value: AnimationRootNode) + get "blend_point_48/pos"(): float64 + set "blend_point_48/pos"(value: float64) + get "blend_point_49/node"(): AnimationRootNode + set "blend_point_49/node"(value: AnimationRootNode) + get "blend_point_49/pos"(): float64 + set "blend_point_49/pos"(value: float64) + get "blend_point_50/node"(): AnimationRootNode + set "blend_point_50/node"(value: AnimationRootNode) + get "blend_point_50/pos"(): float64 + set "blend_point_50/pos"(value: float64) + get "blend_point_51/node"(): AnimationRootNode + set "blend_point_51/node"(value: AnimationRootNode) + get "blend_point_51/pos"(): float64 + set "blend_point_51/pos"(value: float64) + get "blend_point_52/node"(): AnimationRootNode + set "blend_point_52/node"(value: AnimationRootNode) + get "blend_point_52/pos"(): float64 + set "blend_point_52/pos"(value: float64) + get "blend_point_53/node"(): AnimationRootNode + set "blend_point_53/node"(value: AnimationRootNode) + get "blend_point_53/pos"(): float64 + set "blend_point_53/pos"(value: float64) + get "blend_point_54/node"(): AnimationRootNode + set "blend_point_54/node"(value: AnimationRootNode) + get "blend_point_54/pos"(): float64 + set "blend_point_54/pos"(value: float64) + get "blend_point_55/node"(): AnimationRootNode + set "blend_point_55/node"(value: AnimationRootNode) + get "blend_point_55/pos"(): float64 + set "blend_point_55/pos"(value: float64) + get "blend_point_56/node"(): AnimationRootNode + set "blend_point_56/node"(value: AnimationRootNode) + get "blend_point_56/pos"(): float64 + set "blend_point_56/pos"(value: float64) + get "blend_point_57/node"(): AnimationRootNode + set "blend_point_57/node"(value: AnimationRootNode) + get "blend_point_57/pos"(): float64 + set "blend_point_57/pos"(value: float64) + get "blend_point_58/node"(): AnimationRootNode + set "blend_point_58/node"(value: AnimationRootNode) + get "blend_point_58/pos"(): float64 + set "blend_point_58/pos"(value: float64) + get "blend_point_59/node"(): AnimationRootNode + set "blend_point_59/node"(value: AnimationRootNode) + get "blend_point_59/pos"(): float64 + set "blend_point_59/pos"(value: float64) + get "blend_point_60/node"(): AnimationRootNode + set "blend_point_60/node"(value: AnimationRootNode) + get "blend_point_60/pos"(): float64 + set "blend_point_60/pos"(value: float64) + get "blend_point_61/node"(): AnimationRootNode + set "blend_point_61/node"(value: AnimationRootNode) + get "blend_point_61/pos"(): float64 + set "blend_point_61/pos"(value: float64) + get "blend_point_62/node"(): AnimationRootNode + set "blend_point_62/node"(value: AnimationRootNode) + get "blend_point_62/pos"(): float64 + set "blend_point_62/pos"(value: float64) + get "blend_point_63/node"(): AnimationRootNode + set "blend_point_63/node"(value: AnimationRootNode) + get "blend_point_63/pos"(): float64 + set "blend_point_63/pos"(value: float64) /** The blend space's axis's lower limit for the points' position. See [method add_blend_point]. */ get min_space(): float64 @@ -1628,7 +4854,7 @@ declare module "godot" { get sync(): boolean set sync(value: boolean) } - class AnimationNodeBlendSpace1DEditor extends AnimationTreeNodeEditorPlugin { + class AnimationNodeBlendSpace1DEditor = Record> extends AnimationTreeNodeEditorPlugin { constructor(identifier?: any) _update_space(): void _update_tool_erase(): void @@ -1648,7 +4874,7 @@ declare module "godot" { } /** A set of [AnimationRootNode]s placed on 2D coordinates, crossfading between the three adjacent ones. Used by [AnimationTree]. * - * @link https://docs.godotengine.org/en/4.3/classes/class_animationnodeblendspace2d.html + * @link https://docs.godotengine.org/en/4.4/classes/class_animationnodeblendspace2d.html */ class AnimationNodeBlendSpace2D extends AnimationRootNode { constructor(identifier?: any) @@ -1689,6 +4915,262 @@ declare module "godot" { /** If `true`, the blend space is triangulated automatically. The mesh updates every time you add or remove points with [method add_blend_point] and [method remove_blend_point]. */ get auto_triangles(): boolean set auto_triangles(value: boolean) + get "blend_point_0/node"(): AnimationRootNode + set "blend_point_0/node"(value: AnimationRootNode) + get "blend_point_0/pos"(): Vector2 + set "blend_point_0/pos"(value: Vector2) + get "blend_point_1/node"(): AnimationRootNode + set "blend_point_1/node"(value: AnimationRootNode) + get "blend_point_1/pos"(): Vector2 + set "blend_point_1/pos"(value: Vector2) + get "blend_point_2/node"(): AnimationRootNode + set "blend_point_2/node"(value: AnimationRootNode) + get "blend_point_2/pos"(): Vector2 + set "blend_point_2/pos"(value: Vector2) + get "blend_point_3/node"(): AnimationRootNode + set "blend_point_3/node"(value: AnimationRootNode) + get "blend_point_3/pos"(): Vector2 + set "blend_point_3/pos"(value: Vector2) + get "blend_point_4/node"(): AnimationRootNode + set "blend_point_4/node"(value: AnimationRootNode) + get "blend_point_4/pos"(): Vector2 + set "blend_point_4/pos"(value: Vector2) + get "blend_point_5/node"(): AnimationRootNode + set "blend_point_5/node"(value: AnimationRootNode) + get "blend_point_5/pos"(): Vector2 + set "blend_point_5/pos"(value: Vector2) + get "blend_point_6/node"(): AnimationRootNode + set "blend_point_6/node"(value: AnimationRootNode) + get "blend_point_6/pos"(): Vector2 + set "blend_point_6/pos"(value: Vector2) + get "blend_point_7/node"(): AnimationRootNode + set "blend_point_7/node"(value: AnimationRootNode) + get "blend_point_7/pos"(): Vector2 + set "blend_point_7/pos"(value: Vector2) + get "blend_point_8/node"(): AnimationRootNode + set "blend_point_8/node"(value: AnimationRootNode) + get "blend_point_8/pos"(): Vector2 + set "blend_point_8/pos"(value: Vector2) + get "blend_point_9/node"(): AnimationRootNode + set "blend_point_9/node"(value: AnimationRootNode) + get "blend_point_9/pos"(): Vector2 + set "blend_point_9/pos"(value: Vector2) + get "blend_point_10/node"(): AnimationRootNode + set "blend_point_10/node"(value: AnimationRootNode) + get "blend_point_10/pos"(): Vector2 + set "blend_point_10/pos"(value: Vector2) + get "blend_point_11/node"(): AnimationRootNode + set "blend_point_11/node"(value: AnimationRootNode) + get "blend_point_11/pos"(): Vector2 + set "blend_point_11/pos"(value: Vector2) + get "blend_point_12/node"(): AnimationRootNode + set "blend_point_12/node"(value: AnimationRootNode) + get "blend_point_12/pos"(): Vector2 + set "blend_point_12/pos"(value: Vector2) + get "blend_point_13/node"(): AnimationRootNode + set "blend_point_13/node"(value: AnimationRootNode) + get "blend_point_13/pos"(): Vector2 + set "blend_point_13/pos"(value: Vector2) + get "blend_point_14/node"(): AnimationRootNode + set "blend_point_14/node"(value: AnimationRootNode) + get "blend_point_14/pos"(): Vector2 + set "blend_point_14/pos"(value: Vector2) + get "blend_point_15/node"(): AnimationRootNode + set "blend_point_15/node"(value: AnimationRootNode) + get "blend_point_15/pos"(): Vector2 + set "blend_point_15/pos"(value: Vector2) + get "blend_point_16/node"(): AnimationRootNode + set "blend_point_16/node"(value: AnimationRootNode) + get "blend_point_16/pos"(): Vector2 + set "blend_point_16/pos"(value: Vector2) + get "blend_point_17/node"(): AnimationRootNode + set "blend_point_17/node"(value: AnimationRootNode) + get "blend_point_17/pos"(): Vector2 + set "blend_point_17/pos"(value: Vector2) + get "blend_point_18/node"(): AnimationRootNode + set "blend_point_18/node"(value: AnimationRootNode) + get "blend_point_18/pos"(): Vector2 + set "blend_point_18/pos"(value: Vector2) + get "blend_point_19/node"(): AnimationRootNode + set "blend_point_19/node"(value: AnimationRootNode) + get "blend_point_19/pos"(): Vector2 + set "blend_point_19/pos"(value: Vector2) + get "blend_point_20/node"(): AnimationRootNode + set "blend_point_20/node"(value: AnimationRootNode) + get "blend_point_20/pos"(): Vector2 + set "blend_point_20/pos"(value: Vector2) + get "blend_point_21/node"(): AnimationRootNode + set "blend_point_21/node"(value: AnimationRootNode) + get "blend_point_21/pos"(): Vector2 + set "blend_point_21/pos"(value: Vector2) + get "blend_point_22/node"(): AnimationRootNode + set "blend_point_22/node"(value: AnimationRootNode) + get "blend_point_22/pos"(): Vector2 + set "blend_point_22/pos"(value: Vector2) + get "blend_point_23/node"(): AnimationRootNode + set "blend_point_23/node"(value: AnimationRootNode) + get "blend_point_23/pos"(): Vector2 + set "blend_point_23/pos"(value: Vector2) + get "blend_point_24/node"(): AnimationRootNode + set "blend_point_24/node"(value: AnimationRootNode) + get "blend_point_24/pos"(): Vector2 + set "blend_point_24/pos"(value: Vector2) + get "blend_point_25/node"(): AnimationRootNode + set "blend_point_25/node"(value: AnimationRootNode) + get "blend_point_25/pos"(): Vector2 + set "blend_point_25/pos"(value: Vector2) + get "blend_point_26/node"(): AnimationRootNode + set "blend_point_26/node"(value: AnimationRootNode) + get "blend_point_26/pos"(): Vector2 + set "blend_point_26/pos"(value: Vector2) + get "blend_point_27/node"(): AnimationRootNode + set "blend_point_27/node"(value: AnimationRootNode) + get "blend_point_27/pos"(): Vector2 + set "blend_point_27/pos"(value: Vector2) + get "blend_point_28/node"(): AnimationRootNode + set "blend_point_28/node"(value: AnimationRootNode) + get "blend_point_28/pos"(): Vector2 + set "blend_point_28/pos"(value: Vector2) + get "blend_point_29/node"(): AnimationRootNode + set "blend_point_29/node"(value: AnimationRootNode) + get "blend_point_29/pos"(): Vector2 + set "blend_point_29/pos"(value: Vector2) + get "blend_point_30/node"(): AnimationRootNode + set "blend_point_30/node"(value: AnimationRootNode) + get "blend_point_30/pos"(): Vector2 + set "blend_point_30/pos"(value: Vector2) + get "blend_point_31/node"(): AnimationRootNode + set "blend_point_31/node"(value: AnimationRootNode) + get "blend_point_31/pos"(): Vector2 + set "blend_point_31/pos"(value: Vector2) + get "blend_point_32/node"(): AnimationRootNode + set "blend_point_32/node"(value: AnimationRootNode) + get "blend_point_32/pos"(): Vector2 + set "blend_point_32/pos"(value: Vector2) + get "blend_point_33/node"(): AnimationRootNode + set "blend_point_33/node"(value: AnimationRootNode) + get "blend_point_33/pos"(): Vector2 + set "blend_point_33/pos"(value: Vector2) + get "blend_point_34/node"(): AnimationRootNode + set "blend_point_34/node"(value: AnimationRootNode) + get "blend_point_34/pos"(): Vector2 + set "blend_point_34/pos"(value: Vector2) + get "blend_point_35/node"(): AnimationRootNode + set "blend_point_35/node"(value: AnimationRootNode) + get "blend_point_35/pos"(): Vector2 + set "blend_point_35/pos"(value: Vector2) + get "blend_point_36/node"(): AnimationRootNode + set "blend_point_36/node"(value: AnimationRootNode) + get "blend_point_36/pos"(): Vector2 + set "blend_point_36/pos"(value: Vector2) + get "blend_point_37/node"(): AnimationRootNode + set "blend_point_37/node"(value: AnimationRootNode) + get "blend_point_37/pos"(): Vector2 + set "blend_point_37/pos"(value: Vector2) + get "blend_point_38/node"(): AnimationRootNode + set "blend_point_38/node"(value: AnimationRootNode) + get "blend_point_38/pos"(): Vector2 + set "blend_point_38/pos"(value: Vector2) + get "blend_point_39/node"(): AnimationRootNode + set "blend_point_39/node"(value: AnimationRootNode) + get "blend_point_39/pos"(): Vector2 + set "blend_point_39/pos"(value: Vector2) + get "blend_point_40/node"(): AnimationRootNode + set "blend_point_40/node"(value: AnimationRootNode) + get "blend_point_40/pos"(): Vector2 + set "blend_point_40/pos"(value: Vector2) + get "blend_point_41/node"(): AnimationRootNode + set "blend_point_41/node"(value: AnimationRootNode) + get "blend_point_41/pos"(): Vector2 + set "blend_point_41/pos"(value: Vector2) + get "blend_point_42/node"(): AnimationRootNode + set "blend_point_42/node"(value: AnimationRootNode) + get "blend_point_42/pos"(): Vector2 + set "blend_point_42/pos"(value: Vector2) + get "blend_point_43/node"(): AnimationRootNode + set "blend_point_43/node"(value: AnimationRootNode) + get "blend_point_43/pos"(): Vector2 + set "blend_point_43/pos"(value: Vector2) + get "blend_point_44/node"(): AnimationRootNode + set "blend_point_44/node"(value: AnimationRootNode) + get "blend_point_44/pos"(): Vector2 + set "blend_point_44/pos"(value: Vector2) + get "blend_point_45/node"(): AnimationRootNode + set "blend_point_45/node"(value: AnimationRootNode) + get "blend_point_45/pos"(): Vector2 + set "blend_point_45/pos"(value: Vector2) + get "blend_point_46/node"(): AnimationRootNode + set "blend_point_46/node"(value: AnimationRootNode) + get "blend_point_46/pos"(): Vector2 + set "blend_point_46/pos"(value: Vector2) + get "blend_point_47/node"(): AnimationRootNode + set "blend_point_47/node"(value: AnimationRootNode) + get "blend_point_47/pos"(): Vector2 + set "blend_point_47/pos"(value: Vector2) + get "blend_point_48/node"(): AnimationRootNode + set "blend_point_48/node"(value: AnimationRootNode) + get "blend_point_48/pos"(): Vector2 + set "blend_point_48/pos"(value: Vector2) + get "blend_point_49/node"(): AnimationRootNode + set "blend_point_49/node"(value: AnimationRootNode) + get "blend_point_49/pos"(): Vector2 + set "blend_point_49/pos"(value: Vector2) + get "blend_point_50/node"(): AnimationRootNode + set "blend_point_50/node"(value: AnimationRootNode) + get "blend_point_50/pos"(): Vector2 + set "blend_point_50/pos"(value: Vector2) + get "blend_point_51/node"(): AnimationRootNode + set "blend_point_51/node"(value: AnimationRootNode) + get "blend_point_51/pos"(): Vector2 + set "blend_point_51/pos"(value: Vector2) + get "blend_point_52/node"(): AnimationRootNode + set "blend_point_52/node"(value: AnimationRootNode) + get "blend_point_52/pos"(): Vector2 + set "blend_point_52/pos"(value: Vector2) + get "blend_point_53/node"(): AnimationRootNode + set "blend_point_53/node"(value: AnimationRootNode) + get "blend_point_53/pos"(): Vector2 + set "blend_point_53/pos"(value: Vector2) + get "blend_point_54/node"(): AnimationRootNode + set "blend_point_54/node"(value: AnimationRootNode) + get "blend_point_54/pos"(): Vector2 + set "blend_point_54/pos"(value: Vector2) + get "blend_point_55/node"(): AnimationRootNode + set "blend_point_55/node"(value: AnimationRootNode) + get "blend_point_55/pos"(): Vector2 + set "blend_point_55/pos"(value: Vector2) + get "blend_point_56/node"(): AnimationRootNode + set "blend_point_56/node"(value: AnimationRootNode) + get "blend_point_56/pos"(): Vector2 + set "blend_point_56/pos"(value: Vector2) + get "blend_point_57/node"(): AnimationRootNode + set "blend_point_57/node"(value: AnimationRootNode) + get "blend_point_57/pos"(): Vector2 + set "blend_point_57/pos"(value: Vector2) + get "blend_point_58/node"(): AnimationRootNode + set "blend_point_58/node"(value: AnimationRootNode) + get "blend_point_58/pos"(): Vector2 + set "blend_point_58/pos"(value: Vector2) + get "blend_point_59/node"(): AnimationRootNode + set "blend_point_59/node"(value: AnimationRootNode) + get "blend_point_59/pos"(): Vector2 + set "blend_point_59/pos"(value: Vector2) + get "blend_point_60/node"(): AnimationRootNode + set "blend_point_60/node"(value: AnimationRootNode) + get "blend_point_60/pos"(): Vector2 + set "blend_point_60/pos"(value: Vector2) + get "blend_point_61/node"(): AnimationRootNode + set "blend_point_61/node"(value: AnimationRootNode) + get "blend_point_61/pos"(): Vector2 + set "blend_point_61/pos"(value: Vector2) + get "blend_point_62/node"(): AnimationRootNode + set "blend_point_62/node"(value: AnimationRootNode) + get "blend_point_62/pos"(): Vector2 + set "blend_point_62/pos"(value: Vector2) + get "blend_point_63/node"(): AnimationRootNode + set "blend_point_63/node"(value: AnimationRootNode) + get "blend_point_63/pos"(): Vector2 + set "blend_point_63/pos"(value: Vector2) get triangles(): PackedInt32Array set triangles(value: PackedInt32Array | int32[]) @@ -1725,7 +5207,7 @@ declare module "godot" { /** Emitted every time the blend space's triangles are created, removed, or when one of their vertices changes position. */ readonly triangles_updated: Signal0 } - class AnimationNodeBlendSpace2DEditor extends AnimationTreeNodeEditorPlugin { + class AnimationNodeBlendSpace2DEditor = Record> extends AnimationTreeNodeEditorPlugin { constructor(identifier?: any) _update_space(): void _update_tool_erase(): void @@ -1733,7 +5215,7 @@ declare module "godot" { } /** A sub-tree of many type [AnimationNode]s used for complex animations. Used by [AnimationTree]. * - * @link https://docs.godotengine.org/en/4.3/classes/class_animationnodeblendtree.html + * @link https://docs.godotengine.org/en/4.4/classes/class_animationnodeblendtree.html */ class AnimationNodeBlendTree extends AnimationRootNode { /** The connection was successful. */ @@ -1789,7 +5271,7 @@ declare module "godot" { /** Emitted when the input port information is changed. */ readonly node_changed: Signal1 } - class AnimationNodeBlendTreeEditor extends AnimationTreeNodeEditorPlugin { + class AnimationNodeBlendTreeEditor = Record> extends AnimationTreeNodeEditorPlugin { constructor(identifier?: any) update_graph(): void _update_filters(_unnamed_arg0: AnimationNode): boolean @@ -1797,6 +5279,24 @@ declare module "godot" { class AnimationNodeEndState extends AnimationRootNode { constructor(identifier?: any) } + /** Base class for extending [AnimationRootNode]s from GDScript, C#, or C++. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_animationnodeextension.html + */ + class AnimationNodeExtension extends AnimationNode { + constructor(identifier?: any) + /** A version of the [method AnimationNode._process] method that is meant to be overridden by custom nodes. It returns a [PackedFloat32Array] with the processed animation data. + * The [PackedFloat64Array] parameter contains the playback information, containing the following values encoded as floating point numbers (in order): playback time and delta, start and end times, whether a seek was requested (encoded as a float greater than `0`), whether the seek request was externally requested (encoded as a float greater than `0`), the current [enum Animation.LoopedFlag] (encoded as a float), and the current blend weight. + * The function must return a [PackedFloat32Array] of the node's time info, containing the following values (in order): animation length, time position, delta, [enum Animation.LoopMode] (encoded as a float), whether the animation is about to end (encoded as a float greater than `0`) and whether the animation is infinite (encoded as a float greater than `0`). All values must be included in the returned array. + */ + /* gdvirtual */ _process_animation_node(playback_info: PackedFloat64Array | float64[], test_only: boolean): PackedFloat32Array + + /** Returns `true` if the animation for the given [param node_info] is looping. */ + static is_looping(node_info: PackedFloat32Array | float32[]): boolean + + /** Returns the animation's remaining time for the given node info. For looping animations, it will only return the remaining time if [param break_loop] is `true`, a large integer value will be returned otherwise. */ + static get_remaining_time(node_info: PackedFloat32Array | float32[], break_loop: boolean): float64 + } namespace AnimationNodeOneShot { enum OneShotRequest { /** The default state of the request. Nothing is done. */ @@ -1821,7 +5321,7 @@ declare module "godot" { } /** Plays an animation once in an [AnimationNodeBlendTree]. * - * @link https://docs.godotengine.org/en/4.3/classes/class_animationnodeoneshot.html + * @link https://docs.godotengine.org/en/4.4/classes/class_animationnodeoneshot.html */ class AnimationNodeOneShot extends AnimationNodeSync { constructor(identifier?: any) @@ -1836,7 +5336,7 @@ declare module "godot" { get fadein_time(): float64 set fadein_time(value: float64) - /** Determines how cross-fading between animations is eased. If empty, the transition will be linear. */ + /** Determines how cross-fading between animations is eased. If empty, the transition will be linear. Should be a unit [Curve]. */ get fadein_curve(): Curve set fadein_curve(value: Curve) @@ -1847,7 +5347,7 @@ declare module "godot" { get fadeout_time(): float64 set fadeout_time(value: float64) - /** Determines how cross-fading between animations is eased. If empty, the transition will be linear. */ + /** Determines how cross-fading between animations is eased. If empty, the transition will be linear. Should be a unit [Curve]. */ get fadeout_curve(): Curve set fadeout_curve(value: Curve) @@ -1871,7 +5371,7 @@ declare module "godot" { } /** The animation output node of an [AnimationNodeBlendTree]. * - * @link https://docs.godotengine.org/en/4.3/classes/class_animationnodeoutput.html + * @link https://docs.godotengine.org/en/4.4/classes/class_animationnodeoutput.html */ class AnimationNodeOutput extends AnimationNode { constructor(identifier?: any) @@ -1893,7 +5393,7 @@ declare module "godot" { } /** A state machine with multiple [AnimationRootNode]s, used by [AnimationTree]. * - * @link https://docs.godotengine.org/en/4.3/classes/class_animationnodestatemachine.html + * @link https://docs.godotengine.org/en/4.4/classes/class_animationnodestatemachine.html */ class AnimationNodeStateMachine extends AnimationRootNode { constructor(identifier?: any) @@ -1968,13 +5468,13 @@ declare module "godot" { get reset_ends(): boolean set reset_ends(value: boolean) } - class AnimationNodeStateMachineEditor extends AnimationTreeNodeEditorPlugin { + class AnimationNodeStateMachineEditor = Record> extends AnimationTreeNodeEditorPlugin { constructor(identifier?: any) _update_graph(): void } /** Provides playback control for an [AnimationNodeStateMachine]. * - * @link https://docs.godotengine.org/en/4.3/classes/class_animationnodestatemachineplayback.html + * @link https://docs.godotengine.org/en/4.4/classes/class_animationnodestatemachineplayback.html */ class AnimationNodeStateMachinePlayback extends Resource { constructor(identifier?: any) @@ -2037,13 +5537,13 @@ declare module "godot" { /** Only use this transition during [method AnimationNodeStateMachinePlayback.travel]. */ ADVANCE_MODE_ENABLED = 1, - /** Automatically use this transition if the [member advance_condition] and [member advance_expression] checks are true (if assigned). */ + /** Automatically use this transition if the [member advance_condition] and [member advance_expression] checks are `true` (if assigned). */ ADVANCE_MODE_AUTO = 2, } } /** A transition within an [AnimationNodeStateMachine] connecting two [AnimationRootNode]s. * - * @link https://docs.godotengine.org/en/4.3/classes/class_animationnodestatemachinetransition.html + * @link https://docs.godotengine.org/en/4.4/classes/class_animationnodestatemachinetransition.html */ class AnimationNodeStateMachineTransition extends Resource { constructor(identifier?: any) @@ -2054,7 +5554,7 @@ declare module "godot" { get xfade_time(): float64 set xfade_time(value: float64) - /** Ease curve for better control over cross-fade between this state and the next. */ + /** Ease curve for better control over cross-fade between this state and the next. Should be a unit [Curve]. */ get xfade_curve(): Curve set xfade_curve(value: Curve) @@ -2074,11 +5574,11 @@ declare module "godot" { get switch_mode(): int64 set switch_mode(value: int64) - /** Determines whether the transition should disabled, enabled when using [method AnimationNodeStateMachinePlayback.travel], or traversed automatically if the [member advance_condition] and [member advance_expression] checks are true (if assigned). */ + /** Determines whether the transition should be disabled, enabled when using [method AnimationNodeStateMachinePlayback.travel], or traversed automatically if the [member advance_condition] and [member advance_expression] checks are `true` (if assigned). */ get advance_mode(): int64 set advance_mode(value: int64) - /** Turn on auto advance when this condition is set. The provided name will become a boolean parameter on the [AnimationTree] that can be controlled from code (see [url=https://docs.godotengine.org/en/4.3/tutorials/animation/animation_tree.html#controlling-from-code]Using AnimationTree[/url]). For example, if [member AnimationTree.tree_root] is an [AnimationNodeStateMachine] and [member advance_condition] is set to `"idle"`: + /** Turn on auto advance when this condition is set. The provided name will become a boolean parameter on the [AnimationTree] that can be controlled from code (see [url=https://docs.godotengine.org/en/4.4/tutorials/animation/animation_tree.html#controlling-from-code]Using AnimationTree[/url]). For example, if [member AnimationTree.tree_root] is an [AnimationNodeStateMachine] and [member advance_condition] is set to `"idle"`: * */ get advance_condition(): StringName @@ -2093,14 +5593,14 @@ declare module "godot" { } /** Blends two animations subtractively inside of an [AnimationNodeBlendTree]. * - * @link https://docs.godotengine.org/en/4.3/classes/class_animationnodesub2.html + * @link https://docs.godotengine.org/en/4.4/classes/class_animationnodesub2.html */ class AnimationNodeSub2 extends AnimationNodeSync { constructor(identifier?: any) } /** Base class for [AnimationNode]s with multiple input ports that must be synchronized. * - * @link https://docs.godotengine.org/en/4.3/classes/class_animationnodesync.html + * @link https://docs.godotengine.org/en/4.4/classes/class_animationnodesync.html */ class AnimationNodeSync extends AnimationNode { constructor(identifier?: any) @@ -2112,21 +5612,24 @@ declare module "godot" { } /** A time-scaling animation node used in [AnimationTree]. * - * @link https://docs.godotengine.org/en/4.3/classes/class_animationnodetimescale.html + * @link https://docs.godotengine.org/en/4.4/classes/class_animationnodetimescale.html */ class AnimationNodeTimeScale extends AnimationNode { constructor(identifier?: any) } /** A time-seeking animation node used in [AnimationTree]. * - * @link https://docs.godotengine.org/en/4.3/classes/class_animationnodetimeseek.html + * @link https://docs.godotengine.org/en/4.4/classes/class_animationnodetimeseek.html */ class AnimationNodeTimeSeek extends AnimationNode { constructor(identifier?: any) + /** If `true`, some processes are executed to handle keys between seeks, such as calculating root motion and finding the nearest discrete key. */ + get explicit_elapse(): boolean + set explicit_elapse(value: boolean) } /** A transition within an [AnimationTree] connecting two [AnimationNode]s. * - * @link https://docs.godotengine.org/en/4.3/classes/class_animationnodetransition.html + * @link https://docs.godotengine.org/en/4.4/classes/class_animationnodetransition.html */ class AnimationNodeTransition extends AnimationNodeSync { constructor(identifier?: any) @@ -2155,7 +5658,7 @@ declare module "godot" { get xfade_time(): float64 set xfade_time(value: float64) - /** Determines how cross-fading between animations is eased. If empty, the transition will be linear. */ + /** Determines how cross-fading between animations is eased. If empty, the transition will be linear. Should be a unit [Curve]. */ get xfade_curve(): Curve set xfade_curve(value: Curve) @@ -2180,9 +5683,9 @@ declare module "godot" { } /** A node used for animation playback. * - * @link https://docs.godotengine.org/en/4.3/classes/class_animationplayer.html + * @link https://docs.godotengine.org/en/4.4/classes/class_animationplayer.html */ - class AnimationPlayer extends AnimationMixer { + class AnimationPlayer = Record> extends AnimationMixer { constructor(identifier?: any) /** Triggers the [param animation_to] animation when the [param animation_from] animation completes. */ animation_set_next(animation_from: StringName, animation_to: StringName): void @@ -2204,11 +5707,31 @@ declare module "godot" { */ play(name: StringName = '', custom_blend: float64 = -1, custom_speed: float64 = 1, from_end: boolean = false): void + /** Plays the animation with key [param name] and the section starting from [param start_marker] and ending on [param end_marker]. + * If the start marker is empty, the section starts from the beginning of the animation. If the end marker is empty, the section ends on the end of the animation. See also [method play]. + */ + play_section_with_markers(name: StringName = '', start_marker: StringName = '', end_marker: StringName = '', custom_blend: float64 = -1, custom_speed: float64 = 1, from_end: boolean = false): void + + /** Plays the animation with key [param name] and the section starting from [param start_time] and ending on [param end_time]. See also [method play]. + * Setting [param start_time] to a value outside the range of the animation means the start of the animation will be used instead, and setting [param end_time] to a value outside the range of the animation means the end of the animation will be used instead. [param start_time] cannot be equal to [param end_time]. + */ + play_section(name: StringName = '', start_time: float64 = -1, end_time: float64 = -1, custom_blend: float64 = -1, custom_speed: float64 = 1, from_end: boolean = false): void + /** Plays the animation with key [param name] in reverse. * This method is a shorthand for [method play] with `custom_speed = -1.0` and `from_end = true`, so see its description for more information. */ play_backwards(name: StringName = '', custom_blend: float64 = -1): void + /** Plays the animation with key [param name] and the section starting from [param start_marker] and ending on [param end_marker] in reverse. + * This method is a shorthand for [method play_section_with_markers] with `custom_speed = -1.0` and `from_end = true`, see its description for more information. + */ + play_section_with_markers_backwards(name: StringName = '', start_marker: StringName = '', end_marker: StringName = '', custom_blend: float64 = -1): void + + /** Plays the animation with key [param name] and the section starting from [param start_time] and ending on [param end_time] in reverse. + * This method is a shorthand for [method play_section] with `custom_speed = -1.0` and `from_end = true`, see its description for more information. + */ + play_section_backwards(name: StringName = '', start_time: float64 = -1, end_time: float64 = -1, custom_blend: float64 = -1): void + /** See also [method AnimationMixer.capture]. * You can use this method to use more detailed options for capture than those performed by [member playback_auto_capture]. When [member playback_auto_capture] is `false`, this method is almost the same as the following: * @@ -2251,6 +5774,26 @@ declare module "godot" { */ get_playing_speed(): float64 + /** Changes the start and end markers of the section being played. The current playback position will be clamped within the new section. See also [method play_section_with_markers]. + * If the argument is empty, the section uses the beginning or end of the animation. If both are empty, it means that the section is not set. + */ + set_section_with_markers(start_marker: StringName = '', end_marker: StringName = ''): void + + /** Changes the start and end times of the section being played. The current playback position will be clamped within the new section. See also [method play_section]. */ + set_section(start_time: float64 = -1, end_time: float64 = -1): void + + /** Resets the current section if section is set. */ + reset_section(): void + + /** Returns the start time of the section currently being played. */ + get_section_start_time(): float64 + + /** Returns the end time of the section currently being played. */ + get_section_end_time(): float64 + + /** Returns `true` if an animation is currently playing with section. */ + has_section(): boolean + /** Seeks the animation to the [param seconds] point in time (in seconds). If [param update] is `true`, the animation updates too, otherwise it updates at process time. Events between the current frame and [param seconds] are skipped. * If [param update_only] is `true`, the method / audio / animation playback tracks will not be processed. * @@ -2344,24 +5887,25 @@ declare module "godot" { */ readonly animation_changed: Signal2 } - class AnimationPlayerEditor extends VBoxContainer { + class AnimationPlayerEditor = Record> extends VBoxContainer { constructor(identifier?: any) _animation_player_changed(_unnamed_arg0: Object): void + _animation_update_key_frame(): void _start_onion_skinning(): void _stop_onion_skinning(): void readonly animation_selected: Signal1 } - class AnimationPlayerEditorPlugin extends EditorPlugin { + class AnimationPlayerEditorPlugin = Record> extends EditorPlugin { constructor(identifier?: any) } /** Base class for [AnimationNode]s that hold one or multiple composite animations. Usually used for [member AnimationTree.tree_root]. * - * @link https://docs.godotengine.org/en/4.3/classes/class_animationrootnode.html + * @link https://docs.godotengine.org/en/4.4/classes/class_animationrootnode.html */ class AnimationRootNode extends AnimationNode { constructor(identifier?: any) } - class AnimationTimelineEdit extends Range { + class AnimationTimelineEdit = Record> extends Range { constructor(identifier?: any) update_values(): void readonly zoom_changed: Signal0 @@ -2376,7 +5920,7 @@ declare module "godot" { class AnimationTrackEditPlugin extends RefCounted { constructor(identifier?: any) } - class AnimationTrackEditor extends VBoxContainer { + class AnimationTrackEditor = Record> extends VBoxContainer { constructor(identifier?: any) _track_grab_focus(_unnamed_arg0: int64): void _redraw_tracks(): void @@ -2389,7 +5933,7 @@ declare module "godot" { readonly animation_len_changed: Signal1 readonly animation_step_changed: Signal1 } - class AnimationTrackKeyEditEditorPlugin extends EditorPlugin { + class AnimationTrackKeyEditEditorPlugin = Record> extends EditorPlugin { constructor(identifier?: any) } namespace AnimationTree { @@ -2401,9 +5945,9 @@ declare module "godot" { } /** A node used for advanced animation transitions in an [AnimationPlayer]. * - * @link https://docs.godotengine.org/en/4.3/classes/class_animationtree.html + * @link https://docs.godotengine.org/en/4.4/classes/class_animationtree.html */ - class AnimationTree extends AnimationMixer { + class AnimationTree = Record> extends AnimationMixer { constructor(identifier?: any) /** Sets the process notification in which to update animations. */ set_process_callback(mode: AnimationTree.AnimationProcessCallback): void @@ -2426,13 +5970,13 @@ declare module "godot" { /** Emitted when the [member anim_player] is changed. */ readonly animation_player_changed: Signal0 } - class AnimationTreeEditor extends VBoxContainer { + class AnimationTreeEditor = Record> extends VBoxContainer { constructor(identifier?: any) } - class AnimationTreeEditorPlugin extends EditorPlugin { + class AnimationTreeEditorPlugin = Record> extends EditorPlugin { constructor(identifier?: any) } - class AnimationTreeNodeEditorPlugin extends VBoxContainer { + class AnimationTreeNodeEditorPlugin = Record> extends VBoxContainer { constructor(identifier?: any) } namespace Area2D { @@ -2455,9 +5999,9 @@ declare module "godot" { } /** A region of 2D space that detects other [CollisionObject2D]s entering or exiting it. * - * @link https://docs.godotengine.org/en/4.3/classes/class_area2d.html + * @link https://docs.godotengine.org/en/4.4/classes/class_area2d.html */ - class Area2D extends CollisionObject2D { + class Area2D = Record> extends CollisionObject2D { constructor(identifier?: any) /** Returns a list of intersecting [PhysicsBody2D]s and [TileMap]s. The overlapping body's [member CollisionObject2D.collision_layer] must be part of this area's [member CollisionObject2D.collision_mask] in order to be detected. * For performance reasons (collisions are all processed at the same time) this list is modified once during the physics step, not immediately after objects are moved. Consider using signals instead. @@ -2560,7 +6104,7 @@ declare module "godot" { /** Emitted when a [Shape2D] of the received [param body] enters a shape of this area. [param body] can be a [PhysicsBody2D] or a [TileMap]. [TileMap]s are detected if their [TileSet] has collision shapes configured. Requires [member monitoring] to be set to `true`. * [param local_shape_index] and [param body_shape_index] contain indices of the interacting shapes from this area and the interacting body, respectively. [param body_rid] contains the [RID] of the body. These values can be used with the [PhysicsServer2D]. - * **Example of getting the** [CollisionShape2D] **node from the shape index:** + * **Example:** Get the [CollisionShape2D] node from the shape index: * */ readonly body_shape_entered: Signal4 @@ -2578,7 +6122,7 @@ declare module "godot" { /** Emitted when a [Shape2D] of the received [param area] enters a shape of this area. Requires [member monitoring] to be set to `true`. * [param local_shape_index] and [param area_shape_index] contain indices of the interacting shapes from this area and the other area, respectively. [param area_rid] contains the [RID] of the other area. These values can be used with the [PhysicsServer2D]. - * **Example of getting the** [CollisionShape2D] **node from the shape index:** + * **Example:** Get the [CollisionShape2D] node from the shape index: * */ readonly area_shape_entered: Signal4 @@ -2614,9 +6158,9 @@ declare module "godot" { } /** A region of 3D space that detects other [CollisionObject3D]s entering or exiting it. * - * @link https://docs.godotengine.org/en/4.3/classes/class_area3d.html + * @link https://docs.godotengine.org/en/4.4/classes/class_area3d.html */ - class Area3D extends CollisionObject3D { + class Area3D = Record> extends CollisionObject3D { constructor(identifier?: any) /** Returns a list of intersecting [PhysicsBody3D]s and [GridMap]s. The overlapping body's [member CollisionObject3D.collision_layer] must be part of this area's [member CollisionObject3D.collision_mask] in order to be detected. * For performance reasons (collisions are all processed at the same time) this list is modified once during the physics step, not immediately after objects are moved. Consider using signals instead. @@ -2756,7 +6300,7 @@ declare module "godot" { /** Emitted when a [Shape3D] of the received [param body] enters a shape of this area. [param body] can be a [PhysicsBody3D] or a [GridMap]. [GridMap]s are detected if their [MeshLibrary] has collision shapes configured. Requires [member monitoring] to be set to `true`. * [param local_shape_index] and [param body_shape_index] contain indices of the interacting shapes from this area and the interacting body, respectively. [param body_rid] contains the [RID] of the body. These values can be used with the [PhysicsServer3D]. - * **Example of getting the** [CollisionShape3D] **node from the shape index:** + * **Example:** Get the [CollisionShape3D] node from the shape index: * */ readonly body_shape_entered: Signal4 @@ -2774,7 +6318,7 @@ declare module "godot" { /** Emitted when a [Shape3D] of the received [param area] enters a shape of this area. Requires [member monitoring] to be set to `true`. * [param local_shape_index] and [param area_shape_index] contain indices of the interacting shapes from this area and the other area, respectively. [param area_rid] contains the [RID] of the other area. These values can be used with the [PhysicsServer3D]. - * **Example of getting the** [CollisionShape3D] **node from the shape index:** + * **Example:** Get the [CollisionShape3D] node from the shape index: * */ readonly area_shape_entered: Signal4 @@ -2792,7 +6336,7 @@ declare module "godot" { } /** [Mesh] type that provides utility for constructing a surface from arrays. * - * @link https://docs.godotengine.org/en/4.3/classes/class_arraymesh.html + * @link https://docs.godotengine.org/en/4.4/classes/class_arraymesh.html */ class ArrayMesh extends Mesh { constructor(identifier?: any) @@ -2816,7 +6360,7 @@ declare module "godot" { * The [param arrays] argument is an array of arrays. Each of the [constant Mesh.ARRAY_MAX] elements contains an array with some of the mesh data for this surface as described by the corresponding member of [enum Mesh.ArrayType] or `null` if it is not used by the surface. For example, `arrays[0]` is the array of vertices. That first vertex sub-array is always required; the others are optional. Adding an index array puts this surface into "index mode" where the vertex and other arrays become the sources of data and the index array defines the vertex order. All sub-arrays must have the same length as the vertex array (or be an exact multiple of the vertex array's length, when multiple elements of a sub-array correspond to a single vertex) or be empty, except for [constant Mesh.ARRAY_INDEX] if it is used. * The [param blend_shapes] argument is an array of vertex data for each blend shape. Each element is an array of the same structure as [param arrays], but [constant Mesh.ARRAY_VERTEX], [constant Mesh.ARRAY_NORMAL], and [constant Mesh.ARRAY_TANGENT] are set if and only if they are set in [param arrays] and all other entries are `null`. * The [param lods] argument is a dictionary with [float] keys and [PackedInt32Array] values. Each entry in the dictionary represents an LOD level of the surface, where the value is the [constant Mesh.ARRAY_INDEX] array to use for the LOD level and the key is roughly proportional to the distance at which the LOD stats being used. I.e., increasing the key of an LOD also increases the distance that the objects has to be from the camera before the LOD is used. - * The [param flags] argument is the bitwise or of, as required: One value of [enum Mesh.ArrayCustomFormat] left shifted by `ARRAY_FORMAT_CUSTOMn_SHIFT` for each custom channel in use, [constant Mesh.ARRAY_FLAG_USE_DYNAMIC_UPDATE], [constant Mesh.ARRAY_FLAG_USE_8_BONE_WEIGHTS], or [constant Mesh.ARRAY_FLAG_USES_EMPTY_VERTEX_ARRAY]. + * The [param flags] argument is the bitwise OR of, as required: One value of [enum Mesh.ArrayCustomFormat] left shifted by `ARRAY_FORMAT_CUSTOMn_SHIFT` for each custom channel in use, [constant Mesh.ARRAY_FLAG_USE_DYNAMIC_UPDATE], [constant Mesh.ARRAY_FLAG_USE_8_BONE_WEIGHTS], or [constant Mesh.ARRAY_FLAG_USES_EMPTY_VERTEX_ARRAY]. * * **Note:** When using indices, it is recommended to only use points, lines, or triangles. */ @@ -2824,6 +6368,9 @@ declare module "godot" { /** Removes all surfaces from this [ArrayMesh]. */ clear_surfaces(): void + + /** Removes the surface at the given index from the Mesh, shifting surfaces with higher index down by one. */ + surface_remove(surf_idx: int64): void surface_update_vertex_region(surf_idx: int64, offset: int64, data: PackedByteArray | byte[] | ArrayBuffer): void surface_update_attribute_region(surf_idx: int64, offset: int64, data: PackedByteArray | byte[] | ArrayBuffer): void surface_update_skin_region(surf_idx: int64, offset: int64, data: PackedByteArray | byte[] | ArrayBuffer): void @@ -2876,7 +6423,7 @@ declare module "godot" { } /** 3D polygon shape for use with occlusion culling in [OccluderInstance3D]. * - * @link https://docs.godotengine.org/en/4.3/classes/class_arrayoccluder3d.html + * @link https://docs.godotengine.org/en/4.4/classes/class_arrayoccluder3d.html */ class ArrayOccluder3D extends Occluder3D { constructor(identifier?: any) @@ -2926,9 +6473,9 @@ declare module "godot" { } /** A container that preserves the proportions of its child controls. * - * @link https://docs.godotengine.org/en/4.3/classes/class_aspectratiocontainer.html + * @link https://docs.godotengine.org/en/4.4/classes/class_aspectratiocontainer.html */ - class AspectRatioContainer extends Container { + class AspectRatioContainer = Record> extends Container { constructor(identifier?: any) /** The aspect ratio to enforce on child controls. This is the width divided by the height. The ratio depends on the [member stretch_mode]. */ get ratio(): float64 @@ -2946,15 +6493,15 @@ declare module "godot" { get alignment_vertical(): int64 set alignment_vertical(value: int64) } - class AssetLibraryEditorPlugin extends EditorPlugin { + class AssetLibraryEditorPlugin = Record> extends EditorPlugin { constructor(identifier?: any) } - class AtlasMergingDialog extends ConfirmationDialog { + class AtlasMergingDialog = Record> extends ConfirmationDialog { constructor(identifier?: any) } /** A texture that crops out part of another Texture2D. * - * @link https://docs.godotengine.org/en/4.3/classes/class_atlastexture.html + * @link https://docs.godotengine.org/en/4.4/classes/class_atlastexture.html */ class AtlasTexture extends Texture2D { constructor(identifier?: any) @@ -2980,17 +6527,17 @@ declare module "godot" { } /** Stores information about the audio buses. * - * @link https://docs.godotengine.org/en/4.3/classes/class_audiobuslayout.html + * @link https://docs.godotengine.org/en/4.4/classes/class_audiobuslayout.html */ class AudioBusLayout extends Resource { constructor(identifier?: any) } - class AudioBusesEditorPlugin extends EditorPlugin { + class AudioBusesEditorPlugin = Record> extends EditorPlugin { constructor(identifier?: any) } /** Base class for audio effect resources. * - * @link https://docs.godotengine.org/en/4.3/classes/class_audioeffect.html + * @link https://docs.godotengine.org/en/4.4/classes/class_audioeffect.html */ class AudioEffect extends Resource { constructor(identifier?: any) @@ -3003,31 +6550,38 @@ declare module "godot" { } /** Adds an amplifying audio effect to an audio bus. * - * @link https://docs.godotengine.org/en/4.3/classes/class_audioeffectamplify.html + * @link https://docs.godotengine.org/en/4.4/classes/class_audioeffectamplify.html */ class AudioEffectAmplify extends AudioEffect { constructor(identifier?: any) /** Amount of amplification in decibels. Positive values make the sound louder, negative values make it quieter. Value can range from -80 to 24. */ get volume_db(): float64 set volume_db(value: float64) + + /** Amount of amplification as a linear value. + * + * **Note:** This member modifies [member volume_db] for convenience. The returned value is equivalent to the result of [method @GlobalScope.db_to_linear] on [member volume_db]. Setting this member is equivalent to setting [member volume_db] to the result of [method @GlobalScope.linear_to_db] on a value. + */ + get volume_linear(): float64 + set volume_linear(value: float64) } /** Adds a band limit filter to the audio bus. * - * @link https://docs.godotengine.org/en/4.3/classes/class_audioeffectbandlimitfilter.html + * @link https://docs.godotengine.org/en/4.4/classes/class_audioeffectbandlimitfilter.html */ class AudioEffectBandLimitFilter extends AudioEffectFilter { constructor(identifier?: any) } /** Adds a band pass filter to the audio bus. * - * @link https://docs.godotengine.org/en/4.3/classes/class_audioeffectbandpassfilter.html + * @link https://docs.godotengine.org/en/4.4/classes/class_audioeffectbandpassfilter.html */ class AudioEffectBandPassFilter extends AudioEffectFilter { constructor(identifier?: any) } /** Captures audio from an audio bus in real-time. * - * @link https://docs.godotengine.org/en/4.3/classes/class_audioeffectcapture.html + * @link https://docs.godotengine.org/en/4.4/classes/class_audioeffectcapture.html */ class AudioEffectCapture extends AudioEffect { constructor(identifier?: any) @@ -3064,7 +6618,7 @@ declare module "godot" { } /** Adds a chorus audio effect. * - * @link https://docs.godotengine.org/en/4.3/classes/class_audioeffectchorus.html + * @link https://docs.godotengine.org/en/4.4/classes/class_audioeffectchorus.html */ class AudioEffectChorus extends AudioEffect { constructor(identifier?: any) @@ -3092,11 +6646,107 @@ declare module "godot" { /** The effect's processed signal. */ get wet(): float64 set wet(value: float64) + + /** The voice's signal delay. */ + get "voice/1/delay_ms"(): float64 + set "voice/1/delay_ms"(value: float64) + + /** The voice's filter rate. */ + get "voice/1/rate_hz"(): float64 + set "voice/1/rate_hz"(value: float64) + + /** The voice filter's depth. */ + get "voice/1/depth_ms"(): float64 + set "voice/1/depth_ms"(value: float64) + + /** The voice's volume. */ + get "voice/1/level_db"(): float64 + set "voice/1/level_db"(value: float64) + + /** The voice's cutoff frequency. */ + get "voice/1/cutoff_hz"(): float64 + set "voice/1/cutoff_hz"(value: float64) + + /** The voice's pan level. */ + get "voice/1/pan"(): float64 + set "voice/1/pan"(value: float64) + + /** The voice's signal delay. */ + get "voice/2/delay_ms"(): float64 + set "voice/2/delay_ms"(value: float64) + + /** The voice's filter rate. */ + get "voice/2/rate_hz"(): float64 + set "voice/2/rate_hz"(value: float64) + + /** The voice filter's depth. */ + get "voice/2/depth_ms"(): float64 + set "voice/2/depth_ms"(value: float64) + + /** The voice's volume. */ + get "voice/2/level_db"(): float64 + set "voice/2/level_db"(value: float64) + + /** The voice's cutoff frequency. */ + get "voice/2/cutoff_hz"(): float64 + set "voice/2/cutoff_hz"(value: float64) + + /** The voice's pan level. */ + get "voice/2/pan"(): float64 + set "voice/2/pan"(value: float64) + + /** The voice's signal delay. */ + get "voice/3/delay_ms"(): float64 + set "voice/3/delay_ms"(value: float64) + + /** The voice's filter rate. */ + get "voice/3/rate_hz"(): float64 + set "voice/3/rate_hz"(value: float64) + + /** The voice filter's depth. */ + get "voice/3/depth_ms"(): float64 + set "voice/3/depth_ms"(value: float64) + + /** The voice's volume. */ + get "voice/3/level_db"(): float64 + set "voice/3/level_db"(value: float64) + + /** The voice's cutoff frequency. */ + get "voice/3/cutoff_hz"(): float64 + set "voice/3/cutoff_hz"(value: float64) + + /** The voice's pan level. */ + get "voice/3/pan"(): float64 + set "voice/3/pan"(value: float64) + + /** The voice's signal delay. */ + get "voice/4/delay_ms"(): float64 + set "voice/4/delay_ms"(value: float64) + + /** The voice's filter rate. */ + get "voice/4/rate_hz"(): float64 + set "voice/4/rate_hz"(value: float64) + + /** The voice filter's depth. */ + get "voice/4/depth_ms"(): float64 + set "voice/4/depth_ms"(value: float64) + + /** The voice's volume. */ + get "voice/4/level_db"(): float64 + set "voice/4/level_db"(value: float64) + + /** The voice's cutoff frequency. */ + get "voice/4/cutoff_hz"(): float64 + set "voice/4/cutoff_hz"(value: float64) + + /** The voice's pan level. */ + get "voice/4/pan"(): float64 + set "voice/4/pan"(value: float64) } /** Adds a compressor audio effect to an audio bus. * Reduces sounds that exceed a certain threshold level, smooths out the dynamics and increases the overall volume. * - * @link https://docs.godotengine.org/en/4.3/classes/class_audioeffectcompressor.html + * @link https://docs.godotengine.org/en/4.4/classes/class_audioeffectcompressor.html */ class AudioEffectCompressor extends AudioEffect { constructor(identifier?: any) @@ -3131,7 +6781,7 @@ declare module "godot" { /** Adds a delay audio effect to an audio bus. Plays input signal back after a period of time. * Two tap delay and feedback options. * - * @link https://docs.godotengine.org/en/4.3/classes/class_audioeffectdelay.html + * @link https://docs.godotengine.org/en/4.4/classes/class_audioeffectdelay.html */ class AudioEffectDelay extends AudioEffect { constructor(identifier?: any) @@ -3206,7 +6856,7 @@ declare module "godot" { /** Adds a distortion audio effect to an Audio bus. * Modifies the sound to make it distorted. * - * @link https://docs.godotengine.org/en/4.3/classes/class_audioeffectdistortion.html + * @link https://docs.godotengine.org/en/4.4/classes/class_audioeffectdistortion.html */ class AudioEffectDistortion extends AudioEffect { constructor(identifier?: any) @@ -3233,7 +6883,7 @@ declare module "godot" { /** Base class for audio equalizers. Gives you control over frequencies. * Use it to create a custom equalizer if [AudioEffectEQ6], [AudioEffectEQ10] or [AudioEffectEQ21] don't fit your needs. * - * @link https://docs.godotengine.org/en/4.3/classes/class_audioeffecteq.html + * @link https://docs.godotengine.org/en/4.4/classes/class_audioeffecteq.html */ class AudioEffectEQ extends AudioEffect { constructor(identifier?: any) @@ -3249,7 +6899,7 @@ declare module "godot" { /** Adds a 10-band equalizer audio effect to an Audio bus. Gives you control over frequencies from 31 Hz to 16000 Hz. * Each frequency can be modulated between -60/+24 dB. * - * @link https://docs.godotengine.org/en/4.3/classes/class_audioeffecteq10.html + * @link https://docs.godotengine.org/en/4.4/classes/class_audioeffecteq10.html */ class AudioEffectEQ10 extends AudioEffectEQ { constructor(identifier?: any) @@ -3257,7 +6907,7 @@ declare module "godot" { /** Adds a 21-band equalizer audio effect to an Audio bus. Gives you control over frequencies from 22 Hz to 22000 Hz. * Each frequency can be modulated between -60/+24 dB. * - * @link https://docs.godotengine.org/en/4.3/classes/class_audioeffecteq21.html + * @link https://docs.godotengine.org/en/4.4/classes/class_audioeffecteq21.html */ class AudioEffectEQ21 extends AudioEffectEQ { constructor(identifier?: any) @@ -3265,22 +6915,29 @@ declare module "godot" { /** Adds a 6-band equalizer audio effect to an audio bus. Gives you control over frequencies from 32 Hz to 10000 Hz. * Each frequency can be modulated between -60/+24 dB. * - * @link https://docs.godotengine.org/en/4.3/classes/class_audioeffecteq6.html + * @link https://docs.godotengine.org/en/4.4/classes/class_audioeffecteq6.html */ class AudioEffectEQ6 extends AudioEffectEQ { constructor(identifier?: any) } namespace AudioEffectFilter { enum FilterDB { + /** Cutting off at 6dB per octave. */ FILTER_6DB = 0, + + /** Cutting off at 12dB per octave. */ FILTER_12DB = 1, + + /** Cutting off at 18dB per octave. */ FILTER_18DB = 2, + + /** Cutting off at 24dB per octave. */ FILTER_24DB = 3, } } /** Adds a filter to the audio bus. * - * @link https://docs.godotengine.org/en/4.3/classes/class_audioeffectfilter.html + * @link https://docs.godotengine.org/en/4.4/classes/class_audioeffectfilter.html */ class AudioEffectFilter extends AudioEffect { constructor(identifier?: any) @@ -3295,12 +6952,14 @@ declare module "godot" { /** Gain amount of the frequencies after the filter. */ get gain(): float64 set gain(value: float64) + + /** Steepness of the cutoff curve in dB per octave, also known as the order of the filter. Higher orders have a more aggressive cutoff. */ get db(): int64 set db(value: int64) } /** Adds a hard limiter audio effect to an Audio bus. * - * @link https://docs.godotengine.org/en/4.3/classes/class_audioeffecthardlimiter.html + * @link https://docs.godotengine.org/en/4.4/classes/class_audioeffecthardlimiter.html */ class AudioEffectHardLimiter extends AudioEffect { constructor(identifier?: any) @@ -3320,21 +6979,21 @@ declare module "godot" { } /** Adds a high-pass filter to the audio bus. * - * @link https://docs.godotengine.org/en/4.3/classes/class_audioeffecthighpassfilter.html + * @link https://docs.godotengine.org/en/4.4/classes/class_audioeffecthighpassfilter.html */ class AudioEffectHighPassFilter extends AudioEffectFilter { constructor(identifier?: any) } /** Adds a high-shelf filter to the audio bus. * - * @link https://docs.godotengine.org/en/4.3/classes/class_audioeffecthighshelffilter.html + * @link https://docs.godotengine.org/en/4.4/classes/class_audioeffecthighshelffilter.html */ class AudioEffectHighShelfFilter extends AudioEffectFilter { constructor(identifier?: any) } /** Manipulates the audio it receives for a given effect. * - * @link https://docs.godotengine.org/en/4.3/classes/class_audioeffectinstance.html + * @link https://docs.godotengine.org/en/4.4/classes/class_audioeffectinstance.html */ class AudioEffectInstance extends RefCounted { constructor(identifier?: any) @@ -3351,7 +7010,7 @@ declare module "godot" { } /** Adds a soft-clip limiter audio effect to an Audio bus. * - * @link https://docs.godotengine.org/en/4.3/classes/class_audioeffectlimiter.html + * @link https://docs.godotengine.org/en/4.4/classes/class_audioeffectlimiter.html */ class AudioEffectLimiter extends AudioEffect { constructor(identifier?: any) @@ -3371,28 +7030,28 @@ declare module "godot" { } /** Adds a low-pass filter to the audio bus. * - * @link https://docs.godotengine.org/en/4.3/classes/class_audioeffectlowpassfilter.html + * @link https://docs.godotengine.org/en/4.4/classes/class_audioeffectlowpassfilter.html */ class AudioEffectLowPassFilter extends AudioEffectFilter { constructor(identifier?: any) } /** Adds a low-shelf filter to the audio bus. * - * @link https://docs.godotengine.org/en/4.3/classes/class_audioeffectlowshelffilter.html + * @link https://docs.godotengine.org/en/4.4/classes/class_audioeffectlowshelffilter.html */ class AudioEffectLowShelfFilter extends AudioEffectFilter { constructor(identifier?: any) } /** Adds a notch filter to the Audio bus. * - * @link https://docs.godotengine.org/en/4.3/classes/class_audioeffectnotchfilter.html + * @link https://docs.godotengine.org/en/4.4/classes/class_audioeffectnotchfilter.html */ class AudioEffectNotchFilter extends AudioEffectFilter { constructor(identifier?: any) } /** Adds a panner audio effect to an audio bus. Pans sound left or right. * - * @link https://docs.godotengine.org/en/4.3/classes/class_audioeffectpanner.html + * @link https://docs.godotengine.org/en/4.4/classes/class_audioeffectpanner.html */ class AudioEffectPanner extends AudioEffect { constructor(identifier?: any) @@ -3403,7 +7062,7 @@ declare module "godot" { /** Adds a phaser audio effect to an audio bus. * Combines the original signal with a copy that is slightly out of phase with the original. * - * @link https://docs.godotengine.org/en/4.3/classes/class_audioeffectphaser.html + * @link https://docs.godotengine.org/en/4.4/classes/class_audioeffectphaser.html */ class AudioEffectPhaser extends AudioEffect { constructor(identifier?: any) @@ -3451,7 +7110,7 @@ declare module "godot" { /** Adds a pitch-shifting audio effect to an audio bus. * Raises or lowers the pitch of original sound. * - * @link https://docs.godotengine.org/en/4.3/classes/class_audioeffectpitchshift.html + * @link https://docs.godotengine.org/en/4.4/classes/class_audioeffectpitchshift.html */ class AudioEffectPitchShift extends AudioEffect { constructor(identifier?: any) @@ -3469,7 +7128,7 @@ declare module "godot" { } /** Audio effect used for recording the sound from an audio bus. * - * @link https://docs.godotengine.org/en/4.3/classes/class_audioeffectrecord.html + * @link https://docs.godotengine.org/en/4.4/classes/class_audioeffectrecord.html */ class AudioEffectRecord extends AudioEffect { constructor(identifier?: any) @@ -3488,7 +7147,7 @@ declare module "godot" { } /** Adds a reverberation audio effect to an Audio bus. * - * @link https://docs.godotengine.org/en/4.3/classes/class_audioeffectreverb.html + * @link https://docs.godotengine.org/en/4.4/classes/class_audioeffectreverb.html */ class AudioEffectReverb extends AudioEffect { constructor(identifier?: any) @@ -3547,7 +7206,7 @@ declare module "godot" { } /** Audio effect that can be used for real-time audio visualizations. * - * @link https://docs.godotengine.org/en/4.3/classes/class_audioeffectspectrumanalyzer.html + * @link https://docs.godotengine.org/en/4.4/classes/class_audioeffectspectrumanalyzer.html */ class AudioEffectSpectrumAnalyzer extends AudioEffect { constructor(identifier?: any) @@ -3572,7 +7231,7 @@ declare module "godot" { } /** Queryable instance of an [AudioEffectSpectrumAnalyzer]. * - * @link https://docs.godotengine.org/en/4.3/classes/class_audioeffectspectrumanalyzerinstance.html + * @link https://docs.godotengine.org/en/4.4/classes/class_audioeffectspectrumanalyzerinstance.html */ class AudioEffectSpectrumAnalyzerInstance extends AudioEffectInstance { constructor(identifier?: any) @@ -3583,23 +7242,27 @@ declare module "godot" { } /** An audio effect that can be used to adjust the intensity of stereo panning. * - * @link https://docs.godotengine.org/en/4.3/classes/class_audioeffectstereoenhance.html + * @link https://docs.godotengine.org/en/4.4/classes/class_audioeffectstereoenhance.html */ class AudioEffectStereoEnhance extends AudioEffect { constructor(identifier?: any) - /** Values greater than 1.0 increase intensity of any panning on audio passing through this effect, whereas values less than 1.0 will decrease the panning intensity. A value of 0.0 will downmix audio to mono. */ + /** Amplifies the difference between stereo channels, increasing or decreasing existing panning. A value of 0.0 will downmix stereo to mono. Does not affect a mono signal. */ get pan_pullout(): float64 set pan_pullout(value: float64) + + /** Widens sound stage through phase shifting in conjunction with [member surround]. Just delays the right channel if [member surround] is 0. */ get time_pullout_ms(): float64 set time_pullout_ms(value: float64) + + /** Widens sound stage through phase shifting in conjunction with [member time_pullout_ms]. Just pans sound to the left channel if [member time_pullout_ms] is 0. */ get surround(): float64 set surround(value: float64) } /** Overrides the location sounds are heard from. * - * @link https://docs.godotengine.org/en/4.3/classes/class_audiolistener2d.html + * @link https://docs.godotengine.org/en/4.4/classes/class_audiolistener2d.html */ - class AudioListener2D extends Node2D { + class AudioListener2D = Record> extends Node2D { constructor(identifier?: any) /** Makes the [AudioListener2D] active, setting it as the hearing point for the sounds. If there is already another active [AudioListener2D], it will be disabled. * This method will have no effect if the [AudioListener2D] is not added to [SceneTree]. @@ -3614,9 +7277,9 @@ declare module "godot" { } /** Overrides the location sounds are heard from. * - * @link https://docs.godotengine.org/en/4.3/classes/class_audiolistener3d.html + * @link https://docs.godotengine.org/en/4.4/classes/class_audiolistener3d.html */ - class AudioListener3D extends Node3D { + class AudioListener3D = Record> extends Node3D { constructor(identifier?: any) /** Enables the listener. This will override the current camera's listener. */ make_current(): void @@ -3638,25 +7301,25 @@ declare module "godot" { } /** Base class for audio samples. * - * @link https://docs.godotengine.org/en/4.3/classes/class_audiosample.html + * @link https://docs.godotengine.org/en/4.4/classes/class_audiosample.html */ class AudioSample extends RefCounted { constructor(identifier?: any) } /** Meta class for playing back audio samples. * - * @link https://docs.godotengine.org/en/4.3/classes/class_audiosampleplayback.html + * @link https://docs.godotengine.org/en/4.4/classes/class_audiosampleplayback.html */ class AudioSamplePlayback extends RefCounted { constructor(identifier?: any) } /** Base class for audio streams. * - * @link https://docs.godotengine.org/en/4.3/classes/class_audiostream.html + * @link https://docs.godotengine.org/en/4.4/classes/class_audiostream.html */ class AudioStream extends Resource { constructor(identifier?: any) - /** Override this method to customize the returned value of [method instantiate_playback]. Should returned a new [AudioStreamPlayback] created when the stream is played (such as by an [AudioStreamPlayer]).. */ + /** Override this method to customize the returned value of [method instantiate_playback]. Should return a new [AudioStreamPlayback] created when the stream is played (such as by an [AudioStreamPlayer]). */ /* gdvirtual */ _instantiate_playback(): AudioStreamPlayback /** Override this method to customize the name assigned to this audio stream. Unused by the engine. */ @@ -3681,6 +7344,12 @@ declare module "godot" { /** Return the controllable parameters of this stream. This array contains dictionaries with a property info description format (see [method Object.get_property_list]). Additionally, the default value for this parameter must be added tho each dictionary in "default_value" field. */ /* gdvirtual */ _get_parameter_list(): GArray + /** Override this method to return `true` if this stream has a loop. */ + /* gdvirtual */ _has_loop(): boolean + + /** Override this method to return the bar beats of this stream. */ + /* gdvirtual */ _get_bar_beats(): int64 + /** Returns the length of the audio stream in seconds. */ get_length(): float64 @@ -3702,18 +7371,41 @@ declare module "godot" { /** Signal to be emitted to notify when the parameter list changed. */ readonly parameter_list_changed: Signal0 } - class AudioStreamEditorPlugin extends EditorPlugin { + class AudioStreamEditorPlugin = Record> extends EditorPlugin { constructor(identifier?: any) } + namespace AudioStreamGenerator { + enum AudioStreamGeneratorMixRate { + /** Current [AudioServer] output mixing rate. */ + MIX_RATE_OUTPUT = 0, + + /** Current [AudioServer] input mixing rate. */ + MIX_RATE_INPUT = 1, + + /** Custom mixing rate, specified by [member mix_rate]. */ + MIX_RATE_CUSTOM = 2, + + /** Maximum value for the mixing rate mode enum. */ + MIX_RATE_MAX = 3, + } + } /** An audio stream with utilities for procedural sound generation. * - * @link https://docs.godotengine.org/en/4.3/classes/class_audiostreamgenerator.html + * @link https://docs.godotengine.org/en/4.4/classes/class_audiostreamgenerator.html */ class AudioStreamGenerator extends AudioStream { constructor(identifier?: any) + /** Mixing rate mode. If set to [constant MIX_RATE_CUSTOM], [member mix_rate] is used, otherwise current [AudioServer] mixing rate is used. */ + get mix_rate_mode(): int64 + set mix_rate_mode(value: int64) + /** The sample rate to use (in Hz). Higher values are more demanding for the CPU to generate, but result in better quality. * In games, common sample rates in use are `11025`, `16000`, `22050`, `32000`, `44100`, and `48000`. * According to the [url=https://en.wikipedia.org/wiki/Nyquist%E2%80%93Shannon_sampling_theorem]Nyquist-Shannon sampling theorem[/url], there is no quality difference to human hearing when going past 40,000 Hz (since most humans can only hear up to ~20,000 Hz, often less). If you are generating lower-pitched sounds such as voices, lower sample rates such as `32000` or `22050` may be usable with no loss in quality. + * + * **Note:** [AudioStreamGenerator] is not automatically resampling input data, to produce expected result [member mix_rate_mode] should match the sampling rate of input data. + * + * **Note:** If you are using [AudioEffectCapture] as the source of your data, set [member mix_rate_mode] to [constant MIX_RATE_INPUT] or [constant MIX_RATE_OUTPUT] to automatically match current [AudioServer] mixing rate. */ get mix_rate(): float64 set mix_rate(value: float64) @@ -3724,7 +7416,7 @@ declare module "godot" { } /** Plays back audio generated using [AudioStreamGenerator]. * - * @link https://docs.godotengine.org/en/4.3/classes/class_audiostreamgeneratorplayback.html + * @link https://docs.godotengine.org/en/4.4/classes/class_audiostreamgeneratorplayback.html */ class AudioStreamGeneratorPlayback extends AudioStreamPlaybackResampled { constructor(identifier?: any) @@ -3746,7 +7438,7 @@ declare module "godot" { /** Clears the audio sample data buffer. */ clear_buffer(): void } - class AudioStreamImportSettingsDialog extends ConfirmationDialog { + class AudioStreamImportSettingsDialog = Record> extends ConfirmationDialog { constructor(identifier?: any) } namespace AudioStreamInteractive { @@ -3799,7 +7491,7 @@ declare module "godot" { } /** Audio stream that can playback music interactively, combining clips and a transition table. * - * @link https://docs.godotengine.org/en/4.3/classes/class_audiostreaminteractive.html + * @link https://docs.godotengine.org/en/4.4/classes/class_audiostreaminteractive.html */ class AudioStreamInteractive extends AudioStream { /** This constant describes that any clip is valid for a specific transition as either source or destination. */ @@ -3843,7 +7535,7 @@ declare module "godot" { */ add_transition(from_clip: int64, to_clip: int64, from_time: AudioStreamInteractive.TransitionFromTime, to_time: AudioStreamInteractive.TransitionToTime, fade_mode: AudioStreamInteractive.FadeMode, fade_beats: float64, use_filler_clip: boolean = false, filler_clip: int64 = -1, hold_previous: boolean = false): void - /** Return true if a given transition exists (was added via [method add_transition]). */ + /** Returns `true` if a given transition exists (was added via [method add_transition]). */ has_transition(from_clip: int64, to_clip: int64): boolean /** Erase a transition by providing [param from_clip] and [param to_clip] clip indices. [constant CLIP_ANY] can be used for either argument or both. */ @@ -3873,29 +7565,539 @@ declare module "godot" { /** Return whether a transition uses the *hold previous* functionality (see [method add_transition]). */ is_transition_holding_previous(from_clip: int64, to_clip: int64): boolean - /** Index of the initial clip, which will be played first when this stream is played. */ - get initial_clip(): int64 - set initial_clip(value: int64) - /** Amount of clips contained in this interactive player. */ get clip_count(): any /*Clips,clip_,page_size=999,unfoldable,numbered,swap_method=_inspector_array_swap_clip,add_button_text=Add Clip*/ set clip_count(value: any /*Clips,clip_,page_size=999,unfoldable,numbered,swap_method=_inspector_array_swap_clip,add_button_text=Add Clip*/) + get "clip_0/name"(): StringName + set "clip_0/name"(value: StringName) + get "clip_0/stream"(): AudioStream + set "clip_0/stream"(value: AudioStream) + get "clip_0/auto_advance"(): int64 + set "clip_0/auto_advance"(value: int64) + get "clip_0/next_clip"(): int64 + set "clip_0/next_clip"(value: int64) + get "clip_1/name"(): StringName + set "clip_1/name"(value: StringName) + get "clip_1/stream"(): AudioStream + set "clip_1/stream"(value: AudioStream) + get "clip_1/auto_advance"(): int64 + set "clip_1/auto_advance"(value: int64) + get "clip_1/next_clip"(): int64 + set "clip_1/next_clip"(value: int64) + get "clip_2/name"(): StringName + set "clip_2/name"(value: StringName) + get "clip_2/stream"(): AudioStream + set "clip_2/stream"(value: AudioStream) + get "clip_2/auto_advance"(): int64 + set "clip_2/auto_advance"(value: int64) + get "clip_2/next_clip"(): int64 + set "clip_2/next_clip"(value: int64) + get "clip_3/name"(): StringName + set "clip_3/name"(value: StringName) + get "clip_3/stream"(): AudioStream + set "clip_3/stream"(value: AudioStream) + get "clip_3/auto_advance"(): int64 + set "clip_3/auto_advance"(value: int64) + get "clip_3/next_clip"(): int64 + set "clip_3/next_clip"(value: int64) + get "clip_4/name"(): StringName + set "clip_4/name"(value: StringName) + get "clip_4/stream"(): AudioStream + set "clip_4/stream"(value: AudioStream) + get "clip_4/auto_advance"(): int64 + set "clip_4/auto_advance"(value: int64) + get "clip_4/next_clip"(): int64 + set "clip_4/next_clip"(value: int64) + get "clip_5/name"(): StringName + set "clip_5/name"(value: StringName) + get "clip_5/stream"(): AudioStream + set "clip_5/stream"(value: AudioStream) + get "clip_5/auto_advance"(): int64 + set "clip_5/auto_advance"(value: int64) + get "clip_5/next_clip"(): int64 + set "clip_5/next_clip"(value: int64) + get "clip_6/name"(): StringName + set "clip_6/name"(value: StringName) + get "clip_6/stream"(): AudioStream + set "clip_6/stream"(value: AudioStream) + get "clip_6/auto_advance"(): int64 + set "clip_6/auto_advance"(value: int64) + get "clip_6/next_clip"(): int64 + set "clip_6/next_clip"(value: int64) + get "clip_7/name"(): StringName + set "clip_7/name"(value: StringName) + get "clip_7/stream"(): AudioStream + set "clip_7/stream"(value: AudioStream) + get "clip_7/auto_advance"(): int64 + set "clip_7/auto_advance"(value: int64) + get "clip_7/next_clip"(): int64 + set "clip_7/next_clip"(value: int64) + get "clip_8/name"(): StringName + set "clip_8/name"(value: StringName) + get "clip_8/stream"(): AudioStream + set "clip_8/stream"(value: AudioStream) + get "clip_8/auto_advance"(): int64 + set "clip_8/auto_advance"(value: int64) + get "clip_8/next_clip"(): int64 + set "clip_8/next_clip"(value: int64) + get "clip_9/name"(): StringName + set "clip_9/name"(value: StringName) + get "clip_9/stream"(): AudioStream + set "clip_9/stream"(value: AudioStream) + get "clip_9/auto_advance"(): int64 + set "clip_9/auto_advance"(value: int64) + get "clip_9/next_clip"(): int64 + set "clip_9/next_clip"(value: int64) + get "clip_10/name"(): StringName + set "clip_10/name"(value: StringName) + get "clip_10/stream"(): AudioStream + set "clip_10/stream"(value: AudioStream) + get "clip_10/auto_advance"(): int64 + set "clip_10/auto_advance"(value: int64) + get "clip_10/next_clip"(): int64 + set "clip_10/next_clip"(value: int64) + get "clip_11/name"(): StringName + set "clip_11/name"(value: StringName) + get "clip_11/stream"(): AudioStream + set "clip_11/stream"(value: AudioStream) + get "clip_11/auto_advance"(): int64 + set "clip_11/auto_advance"(value: int64) + get "clip_11/next_clip"(): int64 + set "clip_11/next_clip"(value: int64) + get "clip_12/name"(): StringName + set "clip_12/name"(value: StringName) + get "clip_12/stream"(): AudioStream + set "clip_12/stream"(value: AudioStream) + get "clip_12/auto_advance"(): int64 + set "clip_12/auto_advance"(value: int64) + get "clip_12/next_clip"(): int64 + set "clip_12/next_clip"(value: int64) + get "clip_13/name"(): StringName + set "clip_13/name"(value: StringName) + get "clip_13/stream"(): AudioStream + set "clip_13/stream"(value: AudioStream) + get "clip_13/auto_advance"(): int64 + set "clip_13/auto_advance"(value: int64) + get "clip_13/next_clip"(): int64 + set "clip_13/next_clip"(value: int64) + get "clip_14/name"(): StringName + set "clip_14/name"(value: StringName) + get "clip_14/stream"(): AudioStream + set "clip_14/stream"(value: AudioStream) + get "clip_14/auto_advance"(): int64 + set "clip_14/auto_advance"(value: int64) + get "clip_14/next_clip"(): int64 + set "clip_14/next_clip"(value: int64) + get "clip_15/name"(): StringName + set "clip_15/name"(value: StringName) + get "clip_15/stream"(): AudioStream + set "clip_15/stream"(value: AudioStream) + get "clip_15/auto_advance"(): int64 + set "clip_15/auto_advance"(value: int64) + get "clip_15/next_clip"(): int64 + set "clip_15/next_clip"(value: int64) + get "clip_16/name"(): StringName + set "clip_16/name"(value: StringName) + get "clip_16/stream"(): AudioStream + set "clip_16/stream"(value: AudioStream) + get "clip_16/auto_advance"(): int64 + set "clip_16/auto_advance"(value: int64) + get "clip_16/next_clip"(): int64 + set "clip_16/next_clip"(value: int64) + get "clip_17/name"(): StringName + set "clip_17/name"(value: StringName) + get "clip_17/stream"(): AudioStream + set "clip_17/stream"(value: AudioStream) + get "clip_17/auto_advance"(): int64 + set "clip_17/auto_advance"(value: int64) + get "clip_17/next_clip"(): int64 + set "clip_17/next_clip"(value: int64) + get "clip_18/name"(): StringName + set "clip_18/name"(value: StringName) + get "clip_18/stream"(): AudioStream + set "clip_18/stream"(value: AudioStream) + get "clip_18/auto_advance"(): int64 + set "clip_18/auto_advance"(value: int64) + get "clip_18/next_clip"(): int64 + set "clip_18/next_clip"(value: int64) + get "clip_19/name"(): StringName + set "clip_19/name"(value: StringName) + get "clip_19/stream"(): AudioStream + set "clip_19/stream"(value: AudioStream) + get "clip_19/auto_advance"(): int64 + set "clip_19/auto_advance"(value: int64) + get "clip_19/next_clip"(): int64 + set "clip_19/next_clip"(value: int64) + get "clip_20/name"(): StringName + set "clip_20/name"(value: StringName) + get "clip_20/stream"(): AudioStream + set "clip_20/stream"(value: AudioStream) + get "clip_20/auto_advance"(): int64 + set "clip_20/auto_advance"(value: int64) + get "clip_20/next_clip"(): int64 + set "clip_20/next_clip"(value: int64) + get "clip_21/name"(): StringName + set "clip_21/name"(value: StringName) + get "clip_21/stream"(): AudioStream + set "clip_21/stream"(value: AudioStream) + get "clip_21/auto_advance"(): int64 + set "clip_21/auto_advance"(value: int64) + get "clip_21/next_clip"(): int64 + set "clip_21/next_clip"(value: int64) + get "clip_22/name"(): StringName + set "clip_22/name"(value: StringName) + get "clip_22/stream"(): AudioStream + set "clip_22/stream"(value: AudioStream) + get "clip_22/auto_advance"(): int64 + set "clip_22/auto_advance"(value: int64) + get "clip_22/next_clip"(): int64 + set "clip_22/next_clip"(value: int64) + get "clip_23/name"(): StringName + set "clip_23/name"(value: StringName) + get "clip_23/stream"(): AudioStream + set "clip_23/stream"(value: AudioStream) + get "clip_23/auto_advance"(): int64 + set "clip_23/auto_advance"(value: int64) + get "clip_23/next_clip"(): int64 + set "clip_23/next_clip"(value: int64) + get "clip_24/name"(): StringName + set "clip_24/name"(value: StringName) + get "clip_24/stream"(): AudioStream + set "clip_24/stream"(value: AudioStream) + get "clip_24/auto_advance"(): int64 + set "clip_24/auto_advance"(value: int64) + get "clip_24/next_clip"(): int64 + set "clip_24/next_clip"(value: int64) + get "clip_25/name"(): StringName + set "clip_25/name"(value: StringName) + get "clip_25/stream"(): AudioStream + set "clip_25/stream"(value: AudioStream) + get "clip_25/auto_advance"(): int64 + set "clip_25/auto_advance"(value: int64) + get "clip_25/next_clip"(): int64 + set "clip_25/next_clip"(value: int64) + get "clip_26/name"(): StringName + set "clip_26/name"(value: StringName) + get "clip_26/stream"(): AudioStream + set "clip_26/stream"(value: AudioStream) + get "clip_26/auto_advance"(): int64 + set "clip_26/auto_advance"(value: int64) + get "clip_26/next_clip"(): int64 + set "clip_26/next_clip"(value: int64) + get "clip_27/name"(): StringName + set "clip_27/name"(value: StringName) + get "clip_27/stream"(): AudioStream + set "clip_27/stream"(value: AudioStream) + get "clip_27/auto_advance"(): int64 + set "clip_27/auto_advance"(value: int64) + get "clip_27/next_clip"(): int64 + set "clip_27/next_clip"(value: int64) + get "clip_28/name"(): StringName + set "clip_28/name"(value: StringName) + get "clip_28/stream"(): AudioStream + set "clip_28/stream"(value: AudioStream) + get "clip_28/auto_advance"(): int64 + set "clip_28/auto_advance"(value: int64) + get "clip_28/next_clip"(): int64 + set "clip_28/next_clip"(value: int64) + get "clip_29/name"(): StringName + set "clip_29/name"(value: StringName) + get "clip_29/stream"(): AudioStream + set "clip_29/stream"(value: AudioStream) + get "clip_29/auto_advance"(): int64 + set "clip_29/auto_advance"(value: int64) + get "clip_29/next_clip"(): int64 + set "clip_29/next_clip"(value: int64) + get "clip_30/name"(): StringName + set "clip_30/name"(value: StringName) + get "clip_30/stream"(): AudioStream + set "clip_30/stream"(value: AudioStream) + get "clip_30/auto_advance"(): int64 + set "clip_30/auto_advance"(value: int64) + get "clip_30/next_clip"(): int64 + set "clip_30/next_clip"(value: int64) + get "clip_31/name"(): StringName + set "clip_31/name"(value: StringName) + get "clip_31/stream"(): AudioStream + set "clip_31/stream"(value: AudioStream) + get "clip_31/auto_advance"(): int64 + set "clip_31/auto_advance"(value: int64) + get "clip_31/next_clip"(): int64 + set "clip_31/next_clip"(value: int64) + get "clip_32/name"(): StringName + set "clip_32/name"(value: StringName) + get "clip_32/stream"(): AudioStream + set "clip_32/stream"(value: AudioStream) + get "clip_32/auto_advance"(): int64 + set "clip_32/auto_advance"(value: int64) + get "clip_32/next_clip"(): int64 + set "clip_32/next_clip"(value: int64) + get "clip_33/name"(): StringName + set "clip_33/name"(value: StringName) + get "clip_33/stream"(): AudioStream + set "clip_33/stream"(value: AudioStream) + get "clip_33/auto_advance"(): int64 + set "clip_33/auto_advance"(value: int64) + get "clip_33/next_clip"(): int64 + set "clip_33/next_clip"(value: int64) + get "clip_34/name"(): StringName + set "clip_34/name"(value: StringName) + get "clip_34/stream"(): AudioStream + set "clip_34/stream"(value: AudioStream) + get "clip_34/auto_advance"(): int64 + set "clip_34/auto_advance"(value: int64) + get "clip_34/next_clip"(): int64 + set "clip_34/next_clip"(value: int64) + get "clip_35/name"(): StringName + set "clip_35/name"(value: StringName) + get "clip_35/stream"(): AudioStream + set "clip_35/stream"(value: AudioStream) + get "clip_35/auto_advance"(): int64 + set "clip_35/auto_advance"(value: int64) + get "clip_35/next_clip"(): int64 + set "clip_35/next_clip"(value: int64) + get "clip_36/name"(): StringName + set "clip_36/name"(value: StringName) + get "clip_36/stream"(): AudioStream + set "clip_36/stream"(value: AudioStream) + get "clip_36/auto_advance"(): int64 + set "clip_36/auto_advance"(value: int64) + get "clip_36/next_clip"(): int64 + set "clip_36/next_clip"(value: int64) + get "clip_37/name"(): StringName + set "clip_37/name"(value: StringName) + get "clip_37/stream"(): AudioStream + set "clip_37/stream"(value: AudioStream) + get "clip_37/auto_advance"(): int64 + set "clip_37/auto_advance"(value: int64) + get "clip_37/next_clip"(): int64 + set "clip_37/next_clip"(value: int64) + get "clip_38/name"(): StringName + set "clip_38/name"(value: StringName) + get "clip_38/stream"(): AudioStream + set "clip_38/stream"(value: AudioStream) + get "clip_38/auto_advance"(): int64 + set "clip_38/auto_advance"(value: int64) + get "clip_38/next_clip"(): int64 + set "clip_38/next_clip"(value: int64) + get "clip_39/name"(): StringName + set "clip_39/name"(value: StringName) + get "clip_39/stream"(): AudioStream + set "clip_39/stream"(value: AudioStream) + get "clip_39/auto_advance"(): int64 + set "clip_39/auto_advance"(value: int64) + get "clip_39/next_clip"(): int64 + set "clip_39/next_clip"(value: int64) + get "clip_40/name"(): StringName + set "clip_40/name"(value: StringName) + get "clip_40/stream"(): AudioStream + set "clip_40/stream"(value: AudioStream) + get "clip_40/auto_advance"(): int64 + set "clip_40/auto_advance"(value: int64) + get "clip_40/next_clip"(): int64 + set "clip_40/next_clip"(value: int64) + get "clip_41/name"(): StringName + set "clip_41/name"(value: StringName) + get "clip_41/stream"(): AudioStream + set "clip_41/stream"(value: AudioStream) + get "clip_41/auto_advance"(): int64 + set "clip_41/auto_advance"(value: int64) + get "clip_41/next_clip"(): int64 + set "clip_41/next_clip"(value: int64) + get "clip_42/name"(): StringName + set "clip_42/name"(value: StringName) + get "clip_42/stream"(): AudioStream + set "clip_42/stream"(value: AudioStream) + get "clip_42/auto_advance"(): int64 + set "clip_42/auto_advance"(value: int64) + get "clip_42/next_clip"(): int64 + set "clip_42/next_clip"(value: int64) + get "clip_43/name"(): StringName + set "clip_43/name"(value: StringName) + get "clip_43/stream"(): AudioStream + set "clip_43/stream"(value: AudioStream) + get "clip_43/auto_advance"(): int64 + set "clip_43/auto_advance"(value: int64) + get "clip_43/next_clip"(): int64 + set "clip_43/next_clip"(value: int64) + get "clip_44/name"(): StringName + set "clip_44/name"(value: StringName) + get "clip_44/stream"(): AudioStream + set "clip_44/stream"(value: AudioStream) + get "clip_44/auto_advance"(): int64 + set "clip_44/auto_advance"(value: int64) + get "clip_44/next_clip"(): int64 + set "clip_44/next_clip"(value: int64) + get "clip_45/name"(): StringName + set "clip_45/name"(value: StringName) + get "clip_45/stream"(): AudioStream + set "clip_45/stream"(value: AudioStream) + get "clip_45/auto_advance"(): int64 + set "clip_45/auto_advance"(value: int64) + get "clip_45/next_clip"(): int64 + set "clip_45/next_clip"(value: int64) + get "clip_46/name"(): StringName + set "clip_46/name"(value: StringName) + get "clip_46/stream"(): AudioStream + set "clip_46/stream"(value: AudioStream) + get "clip_46/auto_advance"(): int64 + set "clip_46/auto_advance"(value: int64) + get "clip_46/next_clip"(): int64 + set "clip_46/next_clip"(value: int64) + get "clip_47/name"(): StringName + set "clip_47/name"(value: StringName) + get "clip_47/stream"(): AudioStream + set "clip_47/stream"(value: AudioStream) + get "clip_47/auto_advance"(): int64 + set "clip_47/auto_advance"(value: int64) + get "clip_47/next_clip"(): int64 + set "clip_47/next_clip"(value: int64) + get "clip_48/name"(): StringName + set "clip_48/name"(value: StringName) + get "clip_48/stream"(): AudioStream + set "clip_48/stream"(value: AudioStream) + get "clip_48/auto_advance"(): int64 + set "clip_48/auto_advance"(value: int64) + get "clip_48/next_clip"(): int64 + set "clip_48/next_clip"(value: int64) + get "clip_49/name"(): StringName + set "clip_49/name"(value: StringName) + get "clip_49/stream"(): AudioStream + set "clip_49/stream"(value: AudioStream) + get "clip_49/auto_advance"(): int64 + set "clip_49/auto_advance"(value: int64) + get "clip_49/next_clip"(): int64 + set "clip_49/next_clip"(value: int64) + get "clip_50/name"(): StringName + set "clip_50/name"(value: StringName) + get "clip_50/stream"(): AudioStream + set "clip_50/stream"(value: AudioStream) + get "clip_50/auto_advance"(): int64 + set "clip_50/auto_advance"(value: int64) + get "clip_50/next_clip"(): int64 + set "clip_50/next_clip"(value: int64) + get "clip_51/name"(): StringName + set "clip_51/name"(value: StringName) + get "clip_51/stream"(): AudioStream + set "clip_51/stream"(value: AudioStream) + get "clip_51/auto_advance"(): int64 + set "clip_51/auto_advance"(value: int64) + get "clip_51/next_clip"(): int64 + set "clip_51/next_clip"(value: int64) + get "clip_52/name"(): StringName + set "clip_52/name"(value: StringName) + get "clip_52/stream"(): AudioStream + set "clip_52/stream"(value: AudioStream) + get "clip_52/auto_advance"(): int64 + set "clip_52/auto_advance"(value: int64) + get "clip_52/next_clip"(): int64 + set "clip_52/next_clip"(value: int64) + get "clip_53/name"(): StringName + set "clip_53/name"(value: StringName) + get "clip_53/stream"(): AudioStream + set "clip_53/stream"(value: AudioStream) + get "clip_53/auto_advance"(): int64 + set "clip_53/auto_advance"(value: int64) + get "clip_53/next_clip"(): int64 + set "clip_53/next_clip"(value: int64) + get "clip_54/name"(): StringName + set "clip_54/name"(value: StringName) + get "clip_54/stream"(): AudioStream + set "clip_54/stream"(value: AudioStream) + get "clip_54/auto_advance"(): int64 + set "clip_54/auto_advance"(value: int64) + get "clip_54/next_clip"(): int64 + set "clip_54/next_clip"(value: int64) + get "clip_55/name"(): StringName + set "clip_55/name"(value: StringName) + get "clip_55/stream"(): AudioStream + set "clip_55/stream"(value: AudioStream) + get "clip_55/auto_advance"(): int64 + set "clip_55/auto_advance"(value: int64) + get "clip_55/next_clip"(): int64 + set "clip_55/next_clip"(value: int64) + get "clip_56/name"(): StringName + set "clip_56/name"(value: StringName) + get "clip_56/stream"(): AudioStream + set "clip_56/stream"(value: AudioStream) + get "clip_56/auto_advance"(): int64 + set "clip_56/auto_advance"(value: int64) + get "clip_56/next_clip"(): int64 + set "clip_56/next_clip"(value: int64) + get "clip_57/name"(): StringName + set "clip_57/name"(value: StringName) + get "clip_57/stream"(): AudioStream + set "clip_57/stream"(value: AudioStream) + get "clip_57/auto_advance"(): int64 + set "clip_57/auto_advance"(value: int64) + get "clip_57/next_clip"(): int64 + set "clip_57/next_clip"(value: int64) + get "clip_58/name"(): StringName + set "clip_58/name"(value: StringName) + get "clip_58/stream"(): AudioStream + set "clip_58/stream"(value: AudioStream) + get "clip_58/auto_advance"(): int64 + set "clip_58/auto_advance"(value: int64) + get "clip_58/next_clip"(): int64 + set "clip_58/next_clip"(value: int64) + get "clip_59/name"(): StringName + set "clip_59/name"(value: StringName) + get "clip_59/stream"(): AudioStream + set "clip_59/stream"(value: AudioStream) + get "clip_59/auto_advance"(): int64 + set "clip_59/auto_advance"(value: int64) + get "clip_59/next_clip"(): int64 + set "clip_59/next_clip"(value: int64) + get "clip_60/name"(): StringName + set "clip_60/name"(value: StringName) + get "clip_60/stream"(): AudioStream + set "clip_60/stream"(value: AudioStream) + get "clip_60/auto_advance"(): int64 + set "clip_60/auto_advance"(value: int64) + get "clip_60/next_clip"(): int64 + set "clip_60/next_clip"(value: int64) + get "clip_61/name"(): StringName + set "clip_61/name"(value: StringName) + get "clip_61/stream"(): AudioStream + set "clip_61/stream"(value: AudioStream) + get "clip_61/auto_advance"(): int64 + set "clip_61/auto_advance"(value: int64) + get "clip_61/next_clip"(): int64 + set "clip_61/next_clip"(value: int64) + get "clip_62/name"(): StringName + set "clip_62/name"(value: StringName) + get "clip_62/stream"(): AudioStream + set "clip_62/stream"(value: AudioStream) + get "clip_62/auto_advance"(): int64 + set "clip_62/auto_advance"(value: int64) + get "clip_62/next_clip"(): int64 + set "clip_62/next_clip"(value: int64) + + /** Index of the initial clip, which will be played first when this stream is played. */ + get initial_clip(): int64 + set initial_clip(value: int64) get _transitions(): GDictionary set _transitions(value: GDictionary) } - class AudioStreamInteractiveEditorPlugin extends EditorPlugin { + class AudioStreamInteractiveEditorPlugin = Record> extends EditorPlugin { constructor(identifier?: any) } - class AudioStreamInteractiveTransitionEditor extends AcceptDialog { + class AudioStreamInteractiveTransitionEditor = Record> extends AcceptDialog { constructor(identifier?: any) _update_transitions(): void } /** MP3 audio stream driver. * - * @link https://docs.godotengine.org/en/4.3/classes/class_audiostreammp3.html + * @link https://docs.godotengine.org/en/4.4/classes/class_audiostreammp3.html */ class AudioStreamMP3 extends AudioStream { constructor(identifier?: any) + /** Creates a new [AudioStreamMP3] instance from the given buffer. The buffer must contain MP3 data. */ + static load_from_buffer(stream_data: PackedByteArray | byte[] | ArrayBuffer): AudioStreamMP3 + + /** Creates a new [AudioStreamMP3] instance from the given file path. The file must be in MP3 format. */ + static load_from_file(path: string): AudioStreamMP3 + /** Contains the audio data in bytes. * You can load a file without having to import it beforehand using the code snippet below. Keep in mind that this snippet loads the whole file into memory and may not be ideal for huge files (hundreds of megabytes or more). * @@ -3919,21 +8121,21 @@ declare module "godot" { } /** Plays real-time audio input data. * - * @link https://docs.godotengine.org/en/4.3/classes/class_audiostreammicrophone.html + * @link https://docs.godotengine.org/en/4.4/classes/class_audiostreammicrophone.html */ class AudioStreamMicrophone extends AudioStream { constructor(identifier?: any) } /** A class representing an Ogg Vorbis audio stream. * - * @link https://docs.godotengine.org/en/4.3/classes/class_audiostreamoggvorbis.html + * @link https://docs.godotengine.org/en/4.4/classes/class_audiostreamoggvorbis.html */ class AudioStreamOggVorbis extends AudioStream { constructor(identifier?: any) - /** Creates a new AudioStreamOggVorbis instance from the given buffer. The buffer must contain Ogg Vorbis data. */ - static load_from_buffer(buffer: PackedByteArray | byte[] | ArrayBuffer): AudioStreamOggVorbis + /** Creates a new [AudioStreamOggVorbis] instance from the given buffer. The buffer must contain Ogg Vorbis data. */ + static load_from_buffer(stream_data: PackedByteArray | byte[] | ArrayBuffer): AudioStreamOggVorbis - /** Creates a new AudioStreamOggVorbis instance from the given file path. The file must be in Ogg Vorbis format. */ + /** Creates a new [AudioStreamOggVorbis] instance from the given file path. The file must be in Ogg Vorbis format. */ static load_from_file(path: string): AudioStreamOggVorbis /** Contains the raw Ogg data for this stream. */ @@ -3956,7 +8158,7 @@ declare module "godot" { } /** Meta class for playing back audio. * - * @link https://docs.godotengine.org/en/4.3/classes/class_audiostreamplayback.html + * @link https://docs.godotengine.org/en/4.4/classes/class_audiostreamplayback.html */ class AudioStreamPlayback extends RefCounted { constructor(identifier?: any) @@ -3998,10 +8200,35 @@ declare module "godot" { /** Returns the [AudioSamplePlayback] associated with this [AudioStreamPlayback] for playing back the audio sample of this stream. */ get_sample_playback(): AudioSamplePlayback + + /** Mixes up to [param frames] of audio from the stream from the current position, at a rate of [param rate_scale], advancing the stream. + * Returns a [PackedVector2Array] where each element holds the left and right channel volume levels of each frame. + * + * **Note:** Can return fewer frames than requested, make sure to use the size of the return value. + */ + mix_audio(rate_scale: float64, frames: int64): PackedVector2Array + + /** Starts the stream from the given [param from_pos], in seconds. */ + start(from_pos: float64 = 0): void + + /** Seeks the stream at the given [param time], in seconds. */ + seek(time: float64 = 0): void + + /** Stops the stream. */ + stop(): void + + /** Returns the number of times the stream has looped. */ + get_loop_count(): int64 + + /** Returns the current position in the stream, in seconds. */ + get_playback_position(): float64 + + /** Returns `true` if the stream is playing. */ + is_playing(): boolean } /** Playback component of [AudioStreamInteractive]. * - * @link https://docs.godotengine.org/en/4.3/classes/class_audiostreamplaybackinteractive.html + * @link https://docs.godotengine.org/en/4.4/classes/class_audiostreamplaybackinteractive.html */ class AudioStreamPlaybackInteractive extends AudioStreamPlayback { constructor(identifier?: any) @@ -4010,21 +8237,27 @@ declare module "godot" { /** Switch to a clip (by index). */ switch_to_clip(clip_index: int64): void + + /** Return the index of the currently playing clip. You can use this to get the name of the currently playing clip with [method AudioStreamInteractive.get_clip_name]. + * **Example:** Get the currently playing clip name from inside an [AudioStreamPlayer] node. + * + */ + get_current_clip_index(): int64 } - /** @link https://docs.godotengine.org/en/4.3/classes/class_audiostreamplaybackoggvorbis.html */ + /** @link https://docs.godotengine.org/en/4.4/classes/class_audiostreamplaybackoggvorbis.html */ class AudioStreamPlaybackOggVorbis extends AudioStreamPlaybackResampled { constructor(identifier?: any) } /** Playback class used for [AudioStreamPlaylist]. * - * @link https://docs.godotengine.org/en/4.3/classes/class_audiostreamplaybackplaylist.html + * @link https://docs.godotengine.org/en/4.4/classes/class_audiostreamplaybackplaylist.html */ class AudioStreamPlaybackPlaylist extends AudioStreamPlayback { constructor(identifier?: any) } /** Playback instance for [AudioStreamPolyphonic]. * - * @link https://docs.godotengine.org/en/4.3/classes/class_audiostreamplaybackpolyphonic.html + * @link https://docs.godotengine.org/en/4.4/classes/class_audiostreamplaybackpolyphonic.html */ class AudioStreamPlaybackPolyphonic extends AudioStreamPlayback { /** Returned by [method play_stream] in case it could not allocate a stream for playback. */ @@ -4044,20 +8277,20 @@ declare module "godot" { /** Change the stream pitch scale. The [param stream] argument is an integer ID returned by [method play_stream]. */ set_stream_pitch_scale(stream: int64, pitch_scale: float64): void - /** Return true whether the stream associated with an integer ID is still playing. Check [method play_stream] for information on when this ID becomes invalid. */ + /** Returns `true` if the stream associated with the given integer ID is still playing. Check [method play_stream] for information on when this ID becomes invalid. */ is_stream_playing(stream: int64): boolean /** Stop a stream. The [param stream] argument is an integer ID returned by [method play_stream], which becomes invalid after calling this function. */ stop_stream(stream: int64): void } - /** @link https://docs.godotengine.org/en/4.3/classes/class_audiostreamplaybackresampled.html */ + /** @link https://docs.godotengine.org/en/4.4/classes/class_audiostreamplaybackresampled.html */ class AudioStreamPlaybackResampled extends AudioStreamPlayback { constructor(identifier?: any) /* gdvirtual */ _mix_resampled(dst_buffer: int64, frame_count: int64): int64 /* gdvirtual */ _get_stream_sampling_rate(): float64 begin_resample(): void } - /** @link https://docs.godotengine.org/en/4.3/classes/class_audiostreamplaybacksynchronized.html */ + /** @link https://docs.godotengine.org/en/4.4/classes/class_audiostreamplaybacksynchronized.html */ class AudioStreamPlaybackSynchronized extends AudioStreamPlayback { constructor(identifier?: any) } @@ -4075,9 +8308,9 @@ declare module "godot" { } /** A node for audio playback. * - * @link https://docs.godotengine.org/en/4.3/classes/class_audiostreamplayer.html + * @link https://docs.godotengine.org/en/4.4/classes/class_audiostreamplayer.html */ - class AudioStreamPlayer extends Node { + class AudioStreamPlayer = Record> extends Node { constructor(identifier?: any) /** Plays a sound from the beginning, or the given [param from_position] in seconds. */ play(from_position: float64 = 0): void @@ -4091,9 +8324,10 @@ declare module "godot" { /** Returns the position in the [AudioStream] of the latest sound, in seconds. Returns `0.0` if no sounds are playing. * * **Note:** The position is not always accurate, as the [AudioServer] does not mix audio every processed frame. To get more accurate results, add [method AudioServer.get_time_since_last_mix] to the returned position. + * + * **Note:** This method always returns `0.0` if the [member stream] is an [AudioStreamInteractive], since it can have multiple clips playing at once. */ get_playback_position(): float64 - _is_active(): boolean /** Returns `true` if any sound is active, even if [member stream_paused] is set to `true`. See also [member playing] and [method get_stream_playback]. */ has_stream_playback(): boolean @@ -4105,13 +8339,20 @@ declare module "godot" { get stream(): AudioStream set stream(value: AudioStream) - /** Volume of sound, in decibel. This is an offset of the [member stream]'s volume. + /** Volume of sound, in decibels. This is an offset of the [member stream]'s volume. * - * **Note:** To convert between decibel and linear energy (like most volume sliders do), use [method @GlobalScope.db_to_linear] and [method @GlobalScope.linear_to_db]. + * **Note:** To convert between decibel and linear energy (like most volume sliders do), use [member volume_linear], or [method @GlobalScope.db_to_linear] and [method @GlobalScope.linear_to_db]. */ get volume_db(): float64 set volume_db(value: float64) + /** Volume of sound, as a linear value. + * + * **Note:** This member modifies [member volume_db] for convenience. The returned value is equivalent to the result of [method @GlobalScope.db_to_linear] on [member volume_db]. Setting this member is equivalent to setting [member volume_db] to the result of [method @GlobalScope.linear_to_db] on a value. + */ + get volume_linear(): float64 + set volume_linear(value: float64) + /** The audio's pitch and tempo, as a multiplier of the [member stream]'s sample rate. A value of `2.0` doubles the audio's pitch, while a value of `0.5` halves the pitch. */ get pitch_scale(): float64 set pitch_scale(value: float64) @@ -4155,9 +8396,9 @@ declare module "godot" { } /** Plays positional sound in 2D space. * - * @link https://docs.godotengine.org/en/4.3/classes/class_audiostreamplayer2d.html + * @link https://docs.godotengine.org/en/4.4/classes/class_audiostreamplayer2d.html */ - class AudioStreamPlayer2D extends Node2D { + class AudioStreamPlayer2D = Record> extends Node2D { constructor(identifier?: any) /** Queues the audio to play on the next physics frame, from the given position [param from_position], in seconds. */ play(from_position: float64 = 0): void @@ -4170,7 +8411,6 @@ declare module "godot" { /** Returns the position in the [AudioStream]. */ get_playback_position(): float64 - _is_active(): boolean /** Returns whether the [AudioStreamPlayer] can return the [AudioStreamPlayback] object or not. */ has_stream_playback(): boolean @@ -4182,10 +8422,17 @@ declare module "godot" { get stream(): AudioStream set stream(value: AudioStream) - /** Base volume before attenuation. */ + /** Base volume before attenuation, in decibels. */ get volume_db(): float64 set volume_db(value: float64) + /** Base volume before attenuation, as a linear value. + * + * **Note:** This member modifies [member volume_db] for convenience. The returned value is equivalent to the result of [method @GlobalScope.db_to_linear] on [member volume_db]. Setting this member is equivalent to setting [member volume_db] to the result of [method @GlobalScope.linear_to_db] on a value. + */ + get volume_linear(): float64 + set volume_linear(value: float64) + /** The pitch and the tempo of the audio, as a multiplier of the audio sample's sample rate. */ get pitch_scale(): float64 set pitch_scale(value: float64) @@ -4263,9 +8510,9 @@ declare module "godot" { } /** Plays positional sound in 3D space. * - * @link https://docs.godotengine.org/en/4.3/classes/class_audiostreamplayer3d.html + * @link https://docs.godotengine.org/en/4.4/classes/class_audiostreamplayer3d.html */ - class AudioStreamPlayer3D extends Node3D { + class AudioStreamPlayer3D = Record> extends Node3D { constructor(identifier?: any) /** Queues the audio to play on the next physics frame, from the given position [param from_position], in seconds. */ play(from_position: float64 = 0): void @@ -4278,7 +8525,6 @@ declare module "godot" { /** Returns the position in the [AudioStream]. */ get_playback_position(): float64 - _is_active(): boolean /** Returns whether the [AudioStreamPlayer] can return the [AudioStreamPlayback] object or not. */ has_stream_playback(): boolean @@ -4298,6 +8544,13 @@ declare module "godot" { get volume_db(): float64 set volume_db(value: float64) + /** The base sound level before attenuation, as a linear value. + * + * **Note:** This member modifies [member volume_db] for convenience. The returned value is equivalent to the result of [method @GlobalScope.db_to_linear] on [member volume_db]. Setting this member is equivalent to setting [member volume_db] to the result of [method @GlobalScope.linear_to_db] on a value. + */ + get volume_linear(): float64 + set volume_linear(value: float64) + /** The factor for the attenuation effect. Higher values make the sound audible over a larger distance. */ get unit_size(): float64 set unit_size(value: float64) @@ -4384,7 +8637,7 @@ declare module "godot" { } /** [AudioStream] that includes sub-streams and plays them back like a playlist. * - * @link https://docs.godotengine.org/en/4.3/classes/class_audiostreamplaylist.html + * @link https://docs.godotengine.org/en/4.4/classes/class_audiostreamplaylist.html */ class AudioStreamPlaylist extends AudioStream { /** Maximum amount of streams supported in the playlist. */ @@ -4546,7 +8799,7 @@ declare module "godot" { } /** AudioStream that lets the user play custom streams at any time from code, simultaneously using a single player. * - * @link https://docs.godotengine.org/en/4.3/classes/class_audiostreampolyphonic.html + * @link https://docs.godotengine.org/en/4.4/classes/class_audiostreampolyphonic.html */ class AudioStreamPolyphonic extends AudioStream { constructor(identifier?: any) @@ -4554,7 +8807,7 @@ declare module "godot" { get polyphony(): int64 set polyphony(value: int64) } - class AudioStreamPreviewGenerator extends Node { + class AudioStreamPreviewGenerator = Record> extends Node { constructor(identifier?: any) generate_preview(stream: AudioStream): any /*AudioStreamPreview*/ readonly preview_updated: Signal1 @@ -4573,7 +8826,7 @@ declare module "godot" { } /** Wraps a pool of audio streams with pitch and volume shifting. * - * @link https://docs.godotengine.org/en/4.3/classes/class_audiostreamrandomizer.html + * @link https://docs.godotengine.org/en/4.4/classes/class_audiostreamrandomizer.html */ class AudioStreamRandomizer extends AudioStream { constructor(identifier?: any) @@ -4614,12 +8867,12 @@ declare module "godot" { get streams_count(): int64 set streams_count(value: int64) } - class AudioStreamRandomizerEditorPlugin extends EditorPlugin { + class AudioStreamRandomizerEditorPlugin = Record> extends EditorPlugin { constructor(identifier?: any) } /** Stream that can be fitted with sub-streams, which will be played in-sync. * - * @link https://docs.godotengine.org/en/4.3/classes/class_audiostreamsynchronized.html + * @link https://docs.godotengine.org/en/4.4/classes/class_audiostreamsynchronized.html */ class AudioStreamSynchronized extends AudioStream { /** Maximum amount of streams that can be synchronized. */ @@ -4641,19 +8894,147 @@ declare module "godot" { /** Set the total amount of streams that will be played back synchronized. */ get stream_count(): any /*Streams,stream_,unfoldable,page_size=999,add_button_text=Add Stream*/ set stream_count(value: any /*Streams,stream_,unfoldable,page_size=999,add_button_text=Add Stream*/) + get "stream_0/stream"(): AudioStream + set "stream_0/stream"(value: AudioStream) + get "stream_0/volume"(): float64 + set "stream_0/volume"(value: float64) + get "stream_1/stream"(): AudioStream + set "stream_1/stream"(value: AudioStream) + get "stream_1/volume"(): float64 + set "stream_1/volume"(value: float64) + get "stream_2/stream"(): AudioStream + set "stream_2/stream"(value: AudioStream) + get "stream_2/volume"(): float64 + set "stream_2/volume"(value: float64) + get "stream_3/stream"(): AudioStream + set "stream_3/stream"(value: AudioStream) + get "stream_3/volume"(): float64 + set "stream_3/volume"(value: float64) + get "stream_4/stream"(): AudioStream + set "stream_4/stream"(value: AudioStream) + get "stream_4/volume"(): float64 + set "stream_4/volume"(value: float64) + get "stream_5/stream"(): AudioStream + set "stream_5/stream"(value: AudioStream) + get "stream_5/volume"(): float64 + set "stream_5/volume"(value: float64) + get "stream_6/stream"(): AudioStream + set "stream_6/stream"(value: AudioStream) + get "stream_6/volume"(): float64 + set "stream_6/volume"(value: float64) + get "stream_7/stream"(): AudioStream + set "stream_7/stream"(value: AudioStream) + get "stream_7/volume"(): float64 + set "stream_7/volume"(value: float64) + get "stream_8/stream"(): AudioStream + set "stream_8/stream"(value: AudioStream) + get "stream_8/volume"(): float64 + set "stream_8/volume"(value: float64) + get "stream_9/stream"(): AudioStream + set "stream_9/stream"(value: AudioStream) + get "stream_9/volume"(): float64 + set "stream_9/volume"(value: float64) + get "stream_10/stream"(): AudioStream + set "stream_10/stream"(value: AudioStream) + get "stream_10/volume"(): float64 + set "stream_10/volume"(value: float64) + get "stream_11/stream"(): AudioStream + set "stream_11/stream"(value: AudioStream) + get "stream_11/volume"(): float64 + set "stream_11/volume"(value: float64) + get "stream_12/stream"(): AudioStream + set "stream_12/stream"(value: AudioStream) + get "stream_12/volume"(): float64 + set "stream_12/volume"(value: float64) + get "stream_13/stream"(): AudioStream + set "stream_13/stream"(value: AudioStream) + get "stream_13/volume"(): float64 + set "stream_13/volume"(value: float64) + get "stream_14/stream"(): AudioStream + set "stream_14/stream"(value: AudioStream) + get "stream_14/volume"(): float64 + set "stream_14/volume"(value: float64) + get "stream_15/stream"(): AudioStream + set "stream_15/stream"(value: AudioStream) + get "stream_15/volume"(): float64 + set "stream_15/volume"(value: float64) + get "stream_16/stream"(): AudioStream + set "stream_16/stream"(value: AudioStream) + get "stream_16/volume"(): float64 + set "stream_16/volume"(value: float64) + get "stream_17/stream"(): AudioStream + set "stream_17/stream"(value: AudioStream) + get "stream_17/volume"(): float64 + set "stream_17/volume"(value: float64) + get "stream_18/stream"(): AudioStream + set "stream_18/stream"(value: AudioStream) + get "stream_18/volume"(): float64 + set "stream_18/volume"(value: float64) + get "stream_19/stream"(): AudioStream + set "stream_19/stream"(value: AudioStream) + get "stream_19/volume"(): float64 + set "stream_19/volume"(value: float64) + get "stream_20/stream"(): AudioStream + set "stream_20/stream"(value: AudioStream) + get "stream_20/volume"(): float64 + set "stream_20/volume"(value: float64) + get "stream_21/stream"(): AudioStream + set "stream_21/stream"(value: AudioStream) + get "stream_21/volume"(): float64 + set "stream_21/volume"(value: float64) + get "stream_22/stream"(): AudioStream + set "stream_22/stream"(value: AudioStream) + get "stream_22/volume"(): float64 + set "stream_22/volume"(value: float64) + get "stream_23/stream"(): AudioStream + set "stream_23/stream"(value: AudioStream) + get "stream_23/volume"(): float64 + set "stream_23/volume"(value: float64) + get "stream_24/stream"(): AudioStream + set "stream_24/stream"(value: AudioStream) + get "stream_24/volume"(): float64 + set "stream_24/volume"(value: float64) + get "stream_25/stream"(): AudioStream + set "stream_25/stream"(value: AudioStream) + get "stream_25/volume"(): float64 + set "stream_25/volume"(value: float64) + get "stream_26/stream"(): AudioStream + set "stream_26/stream"(value: AudioStream) + get "stream_26/volume"(): float64 + set "stream_26/volume"(value: float64) + get "stream_27/stream"(): AudioStream + set "stream_27/stream"(value: AudioStream) + get "stream_27/volume"(): float64 + set "stream_27/volume"(value: float64) + get "stream_28/stream"(): AudioStream + set "stream_28/stream"(value: AudioStream) + get "stream_28/volume"(): float64 + set "stream_28/volume"(value: float64) + get "stream_29/stream"(): AudioStream + set "stream_29/stream"(value: AudioStream) + get "stream_29/volume"(): float64 + set "stream_29/volume"(value: float64) + get "stream_30/stream"(): AudioStream + set "stream_30/stream"(value: AudioStream) + get "stream_30/volume"(): float64 + set "stream_30/volume"(value: float64) + get "stream_31/stream"(): AudioStream + set "stream_31/stream"(value: AudioStream) + get "stream_31/volume"(): float64 + set "stream_31/volume"(value: float64) } namespace AudioStreamWAV { enum Format { - /** 8-bit audio codec. */ + /** 8-bit PCM audio codec. */ FORMAT_8_BITS = 0, - /** 16-bit audio codec. */ + /** 16-bit PCM audio codec. */ FORMAT_16_BITS = 1, - /** Audio is compressed using IMA ADPCM. */ + /** Audio is lossily compressed as IMA ADPCM. */ FORMAT_IMA_ADPCM = 2, - /** Audio is compressed as QOA ([url=https://qoaformat.org/]Quite OK Audio[/url]). */ + /** Audio is lossily compressed as [url=https://qoaformat.org/]Quite OK Audio[/url]. */ FORMAT_QOA = 3, } enum LoopMode { @@ -4672,11 +9053,23 @@ declare module "godot" { } /** Stores audio data loaded from WAV files. * - * @link https://docs.godotengine.org/en/4.3/classes/class_audiostreamwav.html + * @link https://docs.godotengine.org/en/4.4/classes/class_audiostreamwav.html */ class AudioStreamWAV extends AudioStream { constructor(identifier?: any) - /** Saves the AudioStreamWAV as a WAV file to [param path]. Samples with IMA ADPCM or QOA formats can't be saved. + /** Creates a new [AudioStreamWAV] instance from the given buffer. The buffer must contain WAV data. + * The keys and values of [param options] match the properties of [ResourceImporterWAV]. The usage of [param options] is identical to [method AudioStreamWAV.load_from_file]. + */ + static load_from_buffer(stream_data: PackedByteArray | byte[] | ArrayBuffer, options: GDictionary = new GDictionary()): AudioStreamWAV + + /** Creates a new [AudioStreamWAV] instance from the given file path. The file must be in WAV format. + * The keys and values of [param options] match the properties of [ResourceImporterWAV]. + * **Example:** Load the first file dropped as a WAV and play it: + * + */ + static load_from_file(path: string, options: GDictionary = new GDictionary()): AudioStreamWAV + + /** Saves the AudioStreamWAV as a WAV file to [param path]. Samples with IMA ADPCM or Quite OK Audio formats can't be saved. * * **Note:** A `.wav` extension is automatically appended to [param path] if it is missing. */ @@ -4684,7 +9077,9 @@ declare module "godot" { /** Contains the audio data in bytes. * - * **Note:** This property expects signed PCM8 data. To convert unsigned PCM8 to signed PCM8, subtract 128 from each byte. + * **Note:** If [member format] is set to [constant FORMAT_8_BITS], this property expects signed 8-bit PCM data. To convert from unsigned 8-bit PCM, subtract 128 from each byte. + * + * **Note:** If [member format] is set to [constant FORMAT_QOA], this property expects data from a full QOA file. */ get data(): PackedByteArray set data(value: PackedByteArray | byte[] | ArrayBuffer) @@ -4693,15 +9088,15 @@ declare module "godot" { get format(): int64 set format(value: int64) - /** The loop mode. This information will be imported automatically from the WAV file if present. See [enum LoopMode] constants for values. */ + /** The loop mode. See [enum LoopMode] constants for values. */ get loop_mode(): int64 set loop_mode(value: int64) - /** The loop start point (in number of samples, relative to the beginning of the stream). This information will be imported automatically from the WAV file if present. */ + /** The loop start point (in number of samples, relative to the beginning of the stream). */ get loop_begin(): int64 set loop_begin(value: int64) - /** The loop end point (in number of samples, relative to the beginning of the stream). This information will be imported automatically from the WAV file if present. */ + /** The loop end point (in number of samples, relative to the beginning of the stream). */ get loop_end(): int64 set loop_end(value: int64) @@ -4730,9 +9125,9 @@ declare module "godot" { } /** A node that copies a region of the screen to a buffer for access in shader code. * - * @link https://docs.godotengine.org/en/4.3/classes/class_backbuffercopy.html + * @link https://docs.godotengine.org/en/4.4/classes/class_backbuffercopy.html */ - class BackBufferCopy extends Node2D { + class BackBufferCopy = Record> extends Node2D { constructor(identifier?: any) /** Buffer mode. See [enum CopyMode] constants. */ get copy_mode(): int64 @@ -4742,7 +9137,7 @@ declare module "godot" { get rect(): Rect2 set rect(value: Rect2) } - class BackgroundProgress extends HBoxContainer { + class BackgroundProgress = Record> extends HBoxContainer { constructor(identifier?: any) } namespace BaseButton { @@ -4772,9 +9167,9 @@ declare module "godot" { } /** Abstract base class for GUI buttons. * - * @link https://docs.godotengine.org/en/4.3/classes/class_basebutton.html + * @link https://docs.godotengine.org/en/4.4/classes/class_basebutton.html */ - class BaseButton extends Control { + class BaseButton = Record> extends Control { constructor(identifier?: any) /** Called when the button is pressed. If you need to know the button's pressed state (and [member toggle_mode] is active), use [method _toggled] instead. */ /* gdvirtual */ _pressed(): void @@ -4804,7 +9199,7 @@ declare module "godot" { /** If `true`, the button's state is pressed. Means the button is pressed down or toggled (if [member toggle_mode] is active). Only works if [member toggle_mode] is `true`. * - * **Note:** Setting [member button_pressed] will result in [signal toggled] to be emitted. If you want to change the pressed state without emitting that signal, use [method set_pressed_no_signal]. + * **Note:** Changing the value of [member button_pressed] will result in [signal toggled] to be emitted. If you want to change the pressed state without emitting that signal, use [method set_pressed_no_signal]. */ get button_pressed(): boolean set button_pressed(value: boolean) @@ -4841,7 +9236,10 @@ declare module "godot" { get shortcut_feedback(): boolean set shortcut_feedback(value: boolean) - /** If `true`, the button will add information about its shortcut in the tooltip. */ + /** If `true`, the button will add information about its shortcut in the tooltip. + * + * **Note:** This property does nothing when the tooltip control is customized using [method Control._make_custom_tooltip]. + */ get shortcut_in_tooltip(): boolean set shortcut_in_tooltip(value: boolean) @@ -4859,4509 +9257,4 @@ declare module "godot" { /** Emitted when the button was just toggled between pressed and normal states (only if [member toggle_mode] is active). The new state is contained in the [param toggled_on] argument. */ readonly toggled: Signal1 } - namespace BaseMaterial3D { - enum TextureParam { - /** Texture specifying per-pixel color. */ - TEXTURE_ALBEDO = 0, - - /** Texture specifying per-pixel metallic value. */ - TEXTURE_METALLIC = 1, - - /** Texture specifying per-pixel roughness value. */ - TEXTURE_ROUGHNESS = 2, - - /** Texture specifying per-pixel emission color. */ - TEXTURE_EMISSION = 3, - - /** Texture specifying per-pixel normal vector. */ - TEXTURE_NORMAL = 4, - - /** Texture specifying per-pixel rim value. */ - TEXTURE_RIM = 5, - - /** Texture specifying per-pixel clearcoat value. */ - TEXTURE_CLEARCOAT = 6, - - /** Texture specifying per-pixel flowmap direction for use with [member anisotropy]. */ - TEXTURE_FLOWMAP = 7, - - /** Texture specifying per-pixel ambient occlusion value. */ - TEXTURE_AMBIENT_OCCLUSION = 8, - - /** Texture specifying per-pixel height. */ - TEXTURE_HEIGHTMAP = 9, - - /** Texture specifying per-pixel subsurface scattering. */ - TEXTURE_SUBSURFACE_SCATTERING = 10, - - /** Texture specifying per-pixel transmittance for subsurface scattering. */ - TEXTURE_SUBSURFACE_TRANSMITTANCE = 11, - - /** Texture specifying per-pixel backlight color. */ - TEXTURE_BACKLIGHT = 12, - - /** Texture specifying per-pixel refraction strength. */ - TEXTURE_REFRACTION = 13, - - /** Texture specifying per-pixel detail mask blending value. */ - TEXTURE_DETAIL_MASK = 14, - - /** Texture specifying per-pixel detail color. */ - TEXTURE_DETAIL_ALBEDO = 15, - - /** Texture specifying per-pixel detail normal. */ - TEXTURE_DETAIL_NORMAL = 16, - - /** Texture holding ambient occlusion, roughness, and metallic. */ - TEXTURE_ORM = 17, - - /** Represents the size of the [enum TextureParam] enum. */ - TEXTURE_MAX = 18, - } - enum TextureFilter { - /** The texture filter reads from the nearest pixel only. This makes the texture look pixelated from up close, and grainy from a distance (due to mipmaps not being sampled). */ - TEXTURE_FILTER_NEAREST = 0, - - /** The texture filter blends between the nearest 4 pixels. This makes the texture look smooth from up close, and grainy from a distance (due to mipmaps not being sampled). */ - TEXTURE_FILTER_LINEAR = 1, - - /** The texture filter reads from the nearest pixel and blends between the nearest 2 mipmaps (or uses the nearest mipmap if [member ProjectSettings.rendering/textures/default_filters/use_nearest_mipmap_filter] is `true`). This makes the texture look pixelated from up close, and smooth from a distance. */ - TEXTURE_FILTER_NEAREST_WITH_MIPMAPS = 2, - - /** The texture filter blends between the nearest 4 pixels and between the nearest 2 mipmaps (or uses the nearest mipmap if [member ProjectSettings.rendering/textures/default_filters/use_nearest_mipmap_filter] is `true`). This makes the texture look smooth from up close, and smooth from a distance. */ - TEXTURE_FILTER_LINEAR_WITH_MIPMAPS = 3, - - /** The texture filter reads from the nearest pixel and blends between 2 mipmaps (or uses the nearest mipmap if [member ProjectSettings.rendering/textures/default_filters/use_nearest_mipmap_filter] is `true`) based on the angle between the surface and the camera view. This makes the texture look pixelated from up close, and smooth from a distance. Anisotropic filtering improves texture quality on surfaces that are almost in line with the camera, but is slightly slower. The anisotropic filtering level can be changed by adjusting [member ProjectSettings.rendering/textures/default_filters/anisotropic_filtering_level]. */ - TEXTURE_FILTER_NEAREST_WITH_MIPMAPS_ANISOTROPIC = 4, - - /** The texture filter blends between the nearest 4 pixels and blends between 2 mipmaps (or uses the nearest mipmap if [member ProjectSettings.rendering/textures/default_filters/use_nearest_mipmap_filter] is `true`) based on the angle between the surface and the camera view. This makes the texture look smooth from up close, and smooth from a distance. Anisotropic filtering improves texture quality on surfaces that are almost in line with the camera, but is slightly slower. The anisotropic filtering level can be changed by adjusting [member ProjectSettings.rendering/textures/default_filters/anisotropic_filtering_level]. */ - TEXTURE_FILTER_LINEAR_WITH_MIPMAPS_ANISOTROPIC = 5, - - /** Represents the size of the [enum TextureFilter] enum. */ - TEXTURE_FILTER_MAX = 6, - } - enum DetailUV { - /** Use `UV` with the detail texture. */ - DETAIL_UV_1 = 0, - - /** Use `UV2` with the detail texture. */ - DETAIL_UV_2 = 1, - } - enum Transparency { - /** The material will not use transparency. This is the fastest to render. */ - TRANSPARENCY_DISABLED = 0, - - /** The material will use the texture's alpha values for transparency. This is the slowest to render, and disables shadow casting. */ - TRANSPARENCY_ALPHA = 1, - - /** The material will cut off all values below a threshold, the rest will remain opaque. The opaque portions will be rendered in the depth prepass. This is faster to render than alpha blending, but slower than opaque rendering. This also supports casting shadows. */ - TRANSPARENCY_ALPHA_SCISSOR = 2, - - /** The material will cut off all values below a spatially-deterministic threshold, the rest will remain opaque. This is faster to render than alpha blending, but slower than opaque rendering. This also supports casting shadows. Alpha hashing is suited for hair rendering. */ - TRANSPARENCY_ALPHA_HASH = 3, - - /** The material will use the texture's alpha value for transparency, but will discard fragments with an alpha of less than 0.99 during the depth prepass and fragments with an alpha less than 0.1 during the shadow pass. This also supports casting shadows. */ - TRANSPARENCY_ALPHA_DEPTH_PRE_PASS = 4, - - /** Represents the size of the [enum Transparency] enum. */ - TRANSPARENCY_MAX = 5, - } - enum ShadingMode { - /** The object will not receive shadows. This is the fastest to render, but it disables all interactions with lights. */ - SHADING_MODE_UNSHADED = 0, - - /** The object will be shaded per pixel. Useful for realistic shading effects. */ - SHADING_MODE_PER_PIXEL = 1, - - /** The object will be shaded per vertex. Useful when you want cheaper shaders and do not care about visual quality. Not implemented yet (this mode will act like [constant SHADING_MODE_PER_PIXEL]). */ - SHADING_MODE_PER_VERTEX = 2, - - /** Represents the size of the [enum ShadingMode] enum. */ - SHADING_MODE_MAX = 3, - } - enum Feature { - /** Constant for setting [member emission_enabled]. */ - FEATURE_EMISSION = 0, - - /** Constant for setting [member normal_enabled]. */ - FEATURE_NORMAL_MAPPING = 1, - - /** Constant for setting [member rim_enabled]. */ - FEATURE_RIM = 2, - - /** Constant for setting [member clearcoat_enabled]. */ - FEATURE_CLEARCOAT = 3, - - /** Constant for setting [member anisotropy_enabled]. */ - FEATURE_ANISOTROPY = 4, - - /** Constant for setting [member ao_enabled]. */ - FEATURE_AMBIENT_OCCLUSION = 5, - - /** Constant for setting [member heightmap_enabled]. */ - FEATURE_HEIGHT_MAPPING = 6, - - /** Constant for setting [member subsurf_scatter_enabled]. */ - FEATURE_SUBSURFACE_SCATTERING = 7, - - /** Constant for setting [member subsurf_scatter_transmittance_enabled]. */ - FEATURE_SUBSURFACE_TRANSMITTANCE = 8, - - /** Constant for setting [member backlight_enabled]. */ - FEATURE_BACKLIGHT = 9, - - /** Constant for setting [member refraction_enabled]. */ - FEATURE_REFRACTION = 10, - - /** Constant for setting [member detail_enabled]. */ - FEATURE_DETAIL = 11, - - /** Represents the size of the [enum Feature] enum. */ - FEATURE_MAX = 12, - } - enum BlendMode { - /** Default blend mode. The color of the object is blended over the background based on the object's alpha value. */ - BLEND_MODE_MIX = 0, - - /** The color of the object is added to the background. */ - BLEND_MODE_ADD = 1, - - /** The color of the object is subtracted from the background. */ - BLEND_MODE_SUB = 2, - - /** The color of the object is multiplied by the background. */ - BLEND_MODE_MUL = 3, - - /** The color of the object is added to the background and the alpha channel is used to mask out the background. This is effectively a hybrid of the blend mix and add modes, useful for effects like fire where you want the flame to add but the smoke to mix. By default, this works with unshaded materials using premultiplied textures. For shaded materials, use the `PREMUL_ALPHA_FACTOR` built-in so that lighting can be modulated as well. */ - BLEND_MODE_PREMULT_ALPHA = 4, - } - enum AlphaAntiAliasing { - /** Disables Alpha AntiAliasing for the material. */ - ALPHA_ANTIALIASING_OFF = 0, - - /** Enables AlphaToCoverage. Alpha values in the material are passed to the AntiAliasing sample mask. */ - ALPHA_ANTIALIASING_ALPHA_TO_COVERAGE = 1, - - /** Enables AlphaToCoverage and forces all non-zero alpha values to `1`. Alpha values in the material are passed to the AntiAliasing sample mask. */ - ALPHA_ANTIALIASING_ALPHA_TO_COVERAGE_AND_TO_ONE = 2, - } - enum DepthDrawMode { - /** Default depth draw mode. Depth is drawn only for opaque objects during the opaque prepass (if any) and during the opaque pass. */ - DEPTH_DRAW_OPAQUE_ONLY = 0, - - /** Objects will write to depth during the opaque and the transparent passes. Transparent objects that are close to the camera may obscure other transparent objects behind them. - * - * **Note:** This does not influence whether transparent objects are included in the depth prepass or not. For that, see [enum Transparency]. - */ - DEPTH_DRAW_ALWAYS = 1, - - /** Objects will not write their depth to the depth buffer, even during the depth prepass (if enabled). */ - DEPTH_DRAW_DISABLED = 2, - } - enum CullMode { - /** Default cull mode. The back of the object is culled when not visible. Back face triangles will be culled when facing the camera. This results in only the front side of triangles being drawn. For closed-surface meshes, this means that only the exterior of the mesh will be visible. */ - CULL_BACK = 0, - - /** Front face triangles will be culled when facing the camera. This results in only the back side of triangles being drawn. For closed-surface meshes, this means that the interior of the mesh will be drawn instead of the exterior. */ - CULL_FRONT = 1, - - /** No face culling is performed; both the front face and back face will be visible. */ - CULL_DISABLED = 2, - } - enum Flags { - /** Disables the depth test, so this object is drawn on top of all others drawn before it. This puts the object in the transparent draw pass where it is sorted based on distance to camera. Objects drawn after it in the draw order may cover it. This also disables writing to depth. */ - FLAG_DISABLE_DEPTH_TEST = 0, - - /** Set `ALBEDO` to the per-vertex color specified in the mesh. */ - FLAG_ALBEDO_FROM_VERTEX_COLOR = 1, - - /** Vertex colors are considered to be stored in sRGB color space and are converted to linear color space during rendering. See also [member vertex_color_is_srgb]. - * - * **Note:** Only effective when using the Forward+ and Mobile rendering methods. - */ - FLAG_SRGB_VERTEX_COLOR = 2, - - /** Uses point size to alter the size of primitive points. Also changes the albedo texture lookup to use `POINT_COORD` instead of `UV`. */ - FLAG_USE_POINT_SIZE = 3, - - /** Object is scaled by depth so that it always appears the same size on screen. */ - FLAG_FIXED_SIZE = 4, - - /** Shader will keep the scale set for the mesh. Otherwise the scale is lost when billboarding. Only applies when [member billboard_mode] is [constant BILLBOARD_ENABLED]. */ - FLAG_BILLBOARD_KEEP_SCALE = 5, - - /** Use triplanar texture lookup for all texture lookups that would normally use `UV`. */ - FLAG_UV1_USE_TRIPLANAR = 6, - - /** Use triplanar texture lookup for all texture lookups that would normally use `UV2`. */ - FLAG_UV2_USE_TRIPLANAR = 7, - - /** Use triplanar texture lookup for all texture lookups that would normally use `UV`. */ - FLAG_UV1_USE_WORLD_TRIPLANAR = 8, - - /** Use triplanar texture lookup for all texture lookups that would normally use `UV2`. */ - FLAG_UV2_USE_WORLD_TRIPLANAR = 9, - - /** Use `UV2` coordinates to look up from the [member ao_texture]. */ - FLAG_AO_ON_UV2 = 10, - - /** Use `UV2` coordinates to look up from the [member emission_texture]. */ - FLAG_EMISSION_ON_UV2 = 11, - - /** Forces the shader to convert albedo from sRGB space to linear space. See also [member albedo_texture_force_srgb]. */ - FLAG_ALBEDO_TEXTURE_FORCE_SRGB = 12, - - /** Disables receiving shadows from other objects. */ - FLAG_DONT_RECEIVE_SHADOWS = 13, - - /** Disables receiving ambient light. */ - FLAG_DISABLE_AMBIENT_LIGHT = 14, - - /** Enables the shadow to opacity feature. */ - FLAG_USE_SHADOW_TO_OPACITY = 15, - - /** Enables the texture to repeat when UV coordinates are outside the 0-1 range. If using one of the linear filtering modes, this can result in artifacts at the edges of a texture when the sampler filters across the edges of the texture. */ - FLAG_USE_TEXTURE_REPEAT = 16, - - /** Invert values read from a depth texture to convert them to height values (heightmap). */ - FLAG_INVERT_HEIGHTMAP = 17, - - /** Enables the skin mode for subsurface scattering which is used to improve the look of subsurface scattering when used for human skin. */ - FLAG_SUBSURFACE_MODE_SKIN = 18, - - /** Enables parts of the shader required for [GPUParticles3D] trails to function. This also requires using a mesh with appropriate skinning, such as [RibbonTrailMesh] or [TubeTrailMesh]. Enabling this feature outside of materials used in [GPUParticles3D] meshes will break material rendering. */ - FLAG_PARTICLE_TRAILS_MODE = 19, - - /** Enables multichannel signed distance field rendering shader. */ - FLAG_ALBEDO_TEXTURE_MSDF = 20, - - /** Disables receiving depth-based or volumetric fog. */ - FLAG_DISABLE_FOG = 21, - - /** Represents the size of the [enum Flags] enum. */ - FLAG_MAX = 22, - } - enum DiffuseMode { - /** Default diffuse scattering algorithm. */ - DIFFUSE_BURLEY = 0, - - /** Diffuse scattering ignores roughness. */ - DIFFUSE_LAMBERT = 1, - - /** Extends Lambert to cover more than 90 degrees when roughness increases. */ - DIFFUSE_LAMBERT_WRAP = 2, - - /** Uses a hard cut for lighting, with smoothing affected by roughness. */ - DIFFUSE_TOON = 3, - } - enum SpecularMode { - /** Default specular blob. */ - SPECULAR_SCHLICK_GGX = 0, - - /** Toon blob which changes size based on roughness. */ - SPECULAR_TOON = 1, - - /** No specular blob. This is slightly faster to render than other specular modes. */ - SPECULAR_DISABLED = 2, - } - enum BillboardMode { - /** Billboard mode is disabled. */ - BILLBOARD_DISABLED = 0, - - /** The object's Z axis will always face the camera. */ - BILLBOARD_ENABLED = 1, - - /** The object's X axis will always face the camera. */ - BILLBOARD_FIXED_Y = 2, - - /** Used for particle systems when assigned to [GPUParticles3D] and [CPUParticles3D] nodes (flipbook animation). Enables `particles_anim_*` properties. - * The [member ParticleProcessMaterial.anim_speed_min] or [member CPUParticles3D.anim_speed_min] should also be set to a value bigger than zero for the animation to play. - */ - BILLBOARD_PARTICLES = 3, - } - enum TextureChannel { - /** Used to read from the red channel of a texture. */ - TEXTURE_CHANNEL_RED = 0, - - /** Used to read from the green channel of a texture. */ - TEXTURE_CHANNEL_GREEN = 1, - - /** Used to read from the blue channel of a texture. */ - TEXTURE_CHANNEL_BLUE = 2, - - /** Used to read from the alpha channel of a texture. */ - TEXTURE_CHANNEL_ALPHA = 3, - - /** Used to read from the linear (non-perceptual) average of the red, green and blue channels of a texture. */ - TEXTURE_CHANNEL_GRAYSCALE = 4, - } - enum EmissionOperator { - /** Adds the emission color to the color from the emission texture. */ - EMISSION_OP_ADD = 0, - - /** Multiplies the emission color by the color from the emission texture. */ - EMISSION_OP_MULTIPLY = 1, - } - enum DistanceFadeMode { - /** Do not use distance fade. */ - DISTANCE_FADE_DISABLED = 0, - - /** Smoothly fades the object out based on each pixel's distance from the camera using the alpha channel. */ - DISTANCE_FADE_PIXEL_ALPHA = 1, - - /** Smoothly fades the object out based on each pixel's distance from the camera using a dithering approach. Dithering discards pixels based on a set pattern to smoothly fade without enabling transparency. On certain hardware, this can be faster than [constant DISTANCE_FADE_PIXEL_ALPHA]. */ - DISTANCE_FADE_PIXEL_DITHER = 2, - - /** Smoothly fades the object out based on the object's distance from the camera using a dithering approach. Dithering discards pixels based on a set pattern to smoothly fade without enabling transparency. On certain hardware, this can be faster than [constant DISTANCE_FADE_PIXEL_ALPHA] and [constant DISTANCE_FADE_PIXEL_DITHER]. */ - DISTANCE_FADE_OBJECT_DITHER = 3, - } - } - /** Abstract base class for defining the 3D rendering properties of meshes. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_basematerial3d.html - */ - class BaseMaterial3D extends Material { - constructor(identifier?: any) - /** If `true`, enables the specified flag. Flags are optional behavior that can be turned on and off. Only one flag can be enabled at a time with this function, the flag enumerators cannot be bit-masked together to enable or disable multiple flags at once. Flags can also be enabled by setting the corresponding member to `true`. See [enum Flags] enumerator for options. */ - set_flag(flag: BaseMaterial3D.Flags, enable: boolean): void - - /** Returns `true`, if the specified flag is enabled. See [enum Flags] enumerator for options. */ - get_flag(flag: BaseMaterial3D.Flags): boolean - - /** If `true`, enables the specified [enum Feature]. Many features that are available in [BaseMaterial3D]s need to be enabled before use. This way the cost for using the feature is only incurred when specified. Features can also be enabled by setting the corresponding member to `true`. */ - set_feature(feature: BaseMaterial3D.Feature, enable: boolean): void - - /** Returns `true`, if the specified [enum Feature] is enabled. */ - get_feature(feature: BaseMaterial3D.Feature): boolean - - /** Sets the texture for the slot specified by [param param]. See [enum TextureParam] for available slots. */ - set_texture(param: BaseMaterial3D.TextureParam, texture: Texture2D): void - - /** Returns the [Texture2D] associated with the specified [enum TextureParam]. */ - get_texture(param: BaseMaterial3D.TextureParam): Texture2D - - /** The material's transparency mode. Some transparency modes will disable shadow casting. Any transparency mode other than [constant TRANSPARENCY_DISABLED] has a greater performance impact compared to opaque rendering. See also [member blend_mode]. */ - get transparency(): int64 - set transparency(value: int64) - - /** Threshold at which the alpha scissor will discard values. Higher values will result in more pixels being discarded. If the material becomes too opaque at a distance, try increasing [member alpha_scissor_threshold]. If the material disappears at a distance, try decreasing [member alpha_scissor_threshold]. */ - get alpha_scissor_threshold(): float64 - set alpha_scissor_threshold(value: float64) - - /** The hashing scale for Alpha Hash. Recommended values between `0` and `2`. */ - get alpha_hash_scale(): float64 - set alpha_hash_scale(value: float64) - - /** The type of alpha antialiasing to apply. See [enum AlphaAntiAliasing]. */ - get alpha_antialiasing_mode(): int64 - set alpha_antialiasing_mode(value: int64) - - /** Threshold at which antialiasing will be applied on the alpha channel. */ - get alpha_antialiasing_edge(): float64 - set alpha_antialiasing_edge(value: float64) - - /** The material's blend mode. - * - * **Note:** Values other than `Mix` force the object into the transparent pipeline. See [enum BlendMode]. - */ - get blend_mode(): int64 - set blend_mode(value: int64) - - /** Determines which side of the triangle to cull depending on whether the triangle faces towards or away from the camera. See [enum CullMode]. */ - get cull_mode(): int64 - set cull_mode(value: int64) - - /** Determines when depth rendering takes place. See [enum DepthDrawMode]. See also [member transparency]. */ - get depth_draw_mode(): int64 - set depth_draw_mode(value: int64) - - /** If `true`, depth testing is disabled and the object will be drawn in render order. */ - get no_depth_test(): boolean - set no_depth_test(value: boolean) - - /** Sets whether the shading takes place, per-pixel, per-vertex or unshaded. Per-vertex lighting is faster, making it the best choice for mobile applications, however it looks considerably worse than per-pixel. Unshaded rendering is the fastest, but disables all interactions with lights. - * - * **Note:** Setting the shading mode vertex shading currently has no effect, as vertex shading is not implemented yet. - */ - get shading_mode(): int64 - set shading_mode(value: int64) - - /** The algorithm used for diffuse light scattering. See [enum DiffuseMode]. */ - get diffuse_mode(): int64 - set diffuse_mode(value: int64) - - /** The method for rendering the specular blob. See [enum SpecularMode]. - * - * **Note:** [member specular_mode] only applies to the specular blob. It does not affect specular reflections from the sky, screen-space reflections, [VoxelGI], SDFGI or [ReflectionProbe]s. To disable reflections from these sources as well, set [member metallic_specular] to `0.0` instead. - */ - get specular_mode(): int64 - set specular_mode(value: int64) - - /** If `true`, the object receives no ambient light. */ - get disable_ambient_light(): boolean - set disable_ambient_light(value: boolean) - - /** If `true`, the object will not be affected by fog (neither volumetric nor depth fog). This is useful for unshaded or transparent materials (e.g. particles), which without this setting will be affected even if fully transparent. */ - get disable_fog(): boolean - set disable_fog(value: boolean) - - /** If `true`, the vertex color is used as albedo color. */ - get vertex_color_use_as_albedo(): boolean - set vertex_color_use_as_albedo(value: boolean) - - /** If `true`, vertex colors are considered to be stored in sRGB color space and are converted to linear color space during rendering. If `false`, vertex colors are considered to be stored in linear color space and are rendered as-is. See also [member albedo_texture_force_srgb]. - * - * **Note:** Only effective when using the Forward+ and Mobile rendering methods, not Compatibility. - */ - get vertex_color_is_srgb(): boolean - set vertex_color_is_srgb(value: boolean) - - /** The material's base color. - * - * **Note:** If [member detail_enabled] is `true` and a [member detail_albedo] texture is specified, [member albedo_color] will *not* modulate the detail texture. This can be used to color partial areas of a material by not specifying an albedo texture and using a transparent [member detail_albedo] texture instead. - */ - get albedo_color(): Color - set albedo_color(value: Color) - - /** Texture to multiply by [member albedo_color]. Used for basic texturing of objects. - * If the texture appears unexpectedly too dark or too bright, check [member albedo_texture_force_srgb]. - */ - get albedo_texture(): Texture2D - set albedo_texture(value: Texture2D) - - /** If `true`, forces a conversion of the [member albedo_texture] from sRGB color space to linear color space. See also [member vertex_color_is_srgb]. - * This should only be enabled when needed (typically when using a [ViewportTexture] as [member albedo_texture]). If [member albedo_texture_force_srgb] is `true` when it shouldn't be, the texture will appear to be too dark. If [member albedo_texture_force_srgb] is `false` when it shouldn't be, the texture will appear to be too bright. - */ - get albedo_texture_force_srgb(): boolean - set albedo_texture_force_srgb(value: boolean) - - /** Enables multichannel signed distance field rendering shader. Use [member msdf_pixel_range] and [member msdf_outline_size] to configure MSDF parameters. */ - get albedo_texture_msdf(): boolean - set albedo_texture_msdf(value: boolean) - - /** The Occlusion/Roughness/Metallic texture to use. This is a more efficient replacement of [member ao_texture], [member roughness_texture] and [member metallic_texture] in [ORMMaterial3D]. Ambient occlusion is stored in the red channel. Roughness map is stored in the green channel. Metallic map is stored in the blue channel. The alpha channel is ignored. */ - get orm_texture(): Texture2D - set orm_texture(value: Texture2D) - - /** A high value makes the material appear more like a metal. Non-metals use their albedo as the diffuse color and add diffuse to the specular reflection. With non-metals, the reflection appears on top of the albedo color. Metals use their albedo as a multiplier to the specular reflection and set the diffuse color to black resulting in a tinted reflection. Materials work better when fully metal or fully non-metal, values between `0` and `1` should only be used for blending between metal and non-metal sections. To alter the amount of reflection use [member roughness]. */ - get metallic(): float64 - set metallic(value: float64) - - /** Adjusts the strength of specular reflections. Specular reflections are composed of scene reflections and the specular lobe which is the bright spot that is reflected from light sources. When set to `0.0`, no specular reflections will be visible. This differs from the [constant SPECULAR_DISABLED] [enum SpecularMode] as [constant SPECULAR_DISABLED] only applies to the specular lobe from the light source. - * - * **Note:** Unlike [member metallic], this is not energy-conserving, so it should be left at `0.5` in most cases. See also [member roughness]. - */ - get metallic_specular(): float64 - set metallic_specular(value: float64) - - /** Texture used to specify metallic for an object. This is multiplied by [member metallic]. */ - get metallic_texture(): Texture2D - set metallic_texture(value: Texture2D) - - /** Specifies the channel of the [member metallic_texture] in which the metallic information is stored. This is useful when you store the information for multiple effects in a single texture. For example if you stored metallic in the red channel, roughness in the blue, and ambient occlusion in the green you could reduce the number of textures you use. */ - get metallic_texture_channel(): int64 - set metallic_texture_channel(value: int64) - - /** Surface reflection. A value of `0` represents a perfect mirror while a value of `1` completely blurs the reflection. See also [member metallic]. */ - get roughness(): float64 - set roughness(value: float64) - - /** Texture used to control the roughness per-pixel. Multiplied by [member roughness]. */ - get roughness_texture(): Texture2D - set roughness_texture(value: Texture2D) - - /** Specifies the channel of the [member roughness_texture] in which the roughness information is stored. This is useful when you store the information for multiple effects in a single texture. For example if you stored metallic in the red channel, roughness in the blue, and ambient occlusion in the green you could reduce the number of textures you use. */ - get roughness_texture_channel(): int64 - set roughness_texture_channel(value: int64) - - /** If `true`, the body emits light. Emitting light makes the object appear brighter. The object can also cast light on other objects if a [VoxelGI], SDFGI, or [LightmapGI] is used and this object is used in baked lighting. */ - get emission_enabled(): boolean - set emission_enabled(value: boolean) - - /** The emitted light's color. See [member emission_enabled]. */ - get emission(): Color - set emission(value: Color) - - /** Multiplier for emitted light. See [member emission_enabled]. */ - get emission_energy_multiplier(): float64 - set emission_energy_multiplier(value: float64) - - /** Luminance of emitted light, measured in nits (candela per square meter). Only available when [member ProjectSettings.rendering/lights_and_shadows/use_physical_light_units] is enabled. The default is roughly equivalent to an indoor lightbulb. */ - get emission_intensity(): float64 - set emission_intensity(value: float64) - - /** Sets how [member emission] interacts with [member emission_texture]. Can either add or multiply. See [enum EmissionOperator] for options. */ - get emission_operator(): int64 - set emission_operator(value: int64) - - /** Use `UV2` to read from the [member emission_texture]. */ - get emission_on_uv2(): boolean - set emission_on_uv2(value: boolean) - - /** Texture that specifies how much surface emits light at a given point. */ - get emission_texture(): Texture2D - set emission_texture(value: Texture2D) - - /** If `true`, normal mapping is enabled. This has a slight performance cost, especially on mobile GPUs. */ - get normal_enabled(): boolean - set normal_enabled(value: boolean) - - /** The strength of the normal map's effect. */ - get normal_scale(): float64 - set normal_scale(value: float64) - - /** Texture used to specify the normal at a given pixel. The [member normal_texture] only uses the red and green channels; the blue and alpha channels are ignored. The normal read from [member normal_texture] is oriented around the surface normal provided by the [Mesh]. - * - * **Note:** The mesh must have both normals and tangents defined in its vertex data. Otherwise, the normal map won't render correctly and will only appear to darken the whole surface. If creating geometry with [SurfaceTool], you can use [method SurfaceTool.generate_normals] and [method SurfaceTool.generate_tangents] to automatically generate normals and tangents respectively. - * - * **Note:** Godot expects the normal map to use X+, Y+, and Z+ coordinates. See [url=http://wiki.polycount.com/wiki/Normal_Map_Technical_Details#Common_Swizzle_Coordinates]this page[/url] for a comparison of normal map coordinates expected by popular engines. - * - * **Note:** If [member detail_enabled] is `true`, the [member detail_albedo] texture is drawn *below* the [member normal_texture]. To display a normal map *above* the [member detail_albedo] texture, use [member detail_normal] instead. - */ - get normal_texture(): Texture2D - set normal_texture(value: Texture2D) - - /** If `true`, rim effect is enabled. Rim lighting increases the brightness at glancing angles on an object. - * - * **Note:** Rim lighting is not visible if the material's [member shading_mode] is [constant SHADING_MODE_UNSHADED]. - */ - get rim_enabled(): boolean - set rim_enabled(value: boolean) - - /** Sets the strength of the rim lighting effect. */ - get rim(): float64 - set rim(value: float64) - - /** The amount of to blend light and albedo color when rendering rim effect. If `0` the light color is used, while `1` means albedo color is used. An intermediate value generally works best. */ - get rim_tint(): float64 - set rim_tint(value: float64) - - /** Texture used to set the strength of the rim lighting effect per-pixel. Multiplied by [member rim]. */ - get rim_texture(): Texture2D - set rim_texture(value: Texture2D) - - /** If `true`, clearcoat rendering is enabled. Adds a secondary transparent pass to the lighting calculation resulting in an added specular blob. This makes materials appear as if they have a clear layer on them that can be either glossy or rough. - * - * **Note:** Clearcoat rendering is not visible if the material's [member shading_mode] is [constant SHADING_MODE_UNSHADED]. - */ - get clearcoat_enabled(): boolean - set clearcoat_enabled(value: boolean) - - /** Sets the strength of the clearcoat effect. Setting to `0` looks the same as disabling the clearcoat effect. */ - get clearcoat(): float64 - set clearcoat(value: float64) - - /** Sets the roughness of the clearcoat pass. A higher value results in a rougher clearcoat while a lower value results in a smoother clearcoat. */ - get clearcoat_roughness(): float64 - set clearcoat_roughness(value: float64) - - /** Texture that defines the strength of the clearcoat effect and the glossiness of the clearcoat. Strength is specified in the red channel while glossiness is specified in the green channel. */ - get clearcoat_texture(): Texture2D - set clearcoat_texture(value: Texture2D) - - /** If `true`, anisotropy is enabled. Anisotropy changes the shape of the specular blob and aligns it to tangent space. This is useful for brushed aluminium and hair reflections. - * - * **Note:** Mesh tangents are needed for anisotropy to work. If the mesh does not contain tangents, the anisotropy effect will appear broken. - * - * **Note:** Material anisotropy should not to be confused with anisotropic texture filtering, which can be enabled by setting [member texture_filter] to [constant TEXTURE_FILTER_LINEAR_WITH_MIPMAPS_ANISOTROPIC]. - */ - get anisotropy_enabled(): boolean - set anisotropy_enabled(value: boolean) - - /** The strength of the anisotropy effect. This is multiplied by [member anisotropy_flowmap]'s alpha channel if a texture is defined there and the texture contains an alpha channel. */ - get anisotropy(): float64 - set anisotropy(value: float64) - - /** Texture that offsets the tangent map for anisotropy calculations and optionally controls the anisotropy effect (if an alpha channel is present). The flowmap texture is expected to be a derivative map, with the red channel representing distortion on the X axis and green channel representing distortion on the Y axis. Values below 0.5 will result in negative distortion, whereas values above 0.5 will result in positive distortion. - * If present, the texture's alpha channel will be used to multiply the strength of the [member anisotropy] effect. Fully opaque pixels will keep the anisotropy effect's original strength while fully transparent pixels will disable the anisotropy effect entirely. The flowmap texture's blue channel is ignored. - */ - get anisotropy_flowmap(): Texture2D - set anisotropy_flowmap(value: Texture2D) - - /** If `true`, ambient occlusion is enabled. Ambient occlusion darkens areas based on the [member ao_texture]. */ - get ao_enabled(): boolean - set ao_enabled(value: boolean) - - /** Amount that ambient occlusion affects lighting from lights. If `0`, ambient occlusion only affects ambient light. If `1`, ambient occlusion affects lights just as much as it affects ambient light. This can be used to impact the strength of the ambient occlusion effect, but typically looks unrealistic. */ - get ao_light_affect(): float64 - set ao_light_affect(value: float64) - - /** Texture that defines the amount of ambient occlusion for a given point on the object. */ - get ao_texture(): Texture2D - set ao_texture(value: Texture2D) - - /** If `true`, use `UV2` coordinates to look up from the [member ao_texture]. */ - get ao_on_uv2(): boolean - set ao_on_uv2(value: boolean) - - /** Specifies the channel of the [member ao_texture] in which the ambient occlusion information is stored. This is useful when you store the information for multiple effects in a single texture. For example if you stored metallic in the red channel, roughness in the blue, and ambient occlusion in the green you could reduce the number of textures you use. */ - get ao_texture_channel(): int64 - set ao_texture_channel(value: int64) - - /** If `true`, height mapping is enabled (also called "parallax mapping" or "depth mapping"). See also [member normal_enabled]. Height mapping is a demanding feature on the GPU, so it should only be used on materials where it makes a significant visual difference. - * - * **Note:** Height mapping is not supported if triplanar mapping is used on the same material. The value of [member heightmap_enabled] will be ignored if [member uv1_triplanar] is enabled. - */ - get heightmap_enabled(): boolean - set heightmap_enabled(value: boolean) - - /** The heightmap scale to use for the parallax effect (see [member heightmap_enabled]). The default value is tuned so that the highest point (value = 255) appears to be 5 cm higher than the lowest point (value = 0). Higher values result in a deeper appearance, but may result in artifacts appearing when looking at the material from oblique angles, especially when the camera moves. Negative values can be used to invert the parallax effect, but this is different from inverting the texture using [member heightmap_flip_texture] as the material will also appear to be "closer" to the camera. In most cases, [member heightmap_scale] should be kept to a positive value. - * - * **Note:** If the height map effect looks strange regardless of this value, try adjusting [member heightmap_flip_binormal] and [member heightmap_flip_tangent]. See also [member heightmap_texture] for recommendations on authoring heightmap textures, as the way the heightmap texture is authored affects how [member heightmap_scale] behaves. - */ - get heightmap_scale(): float64 - set heightmap_scale(value: float64) - - /** If `true`, uses parallax occlusion mapping to represent depth in the material instead of simple offset mapping (see [member heightmap_enabled]). This results in a more convincing depth effect, but is much more expensive on the GPU. Only enable this on materials where it makes a significant visual difference. */ - get heightmap_deep_parallax(): boolean - set heightmap_deep_parallax(value: boolean) - - /** The number of layers to use for parallax occlusion mapping when the camera is far away from the material. Higher values result in a more convincing depth effect, especially in materials that have steep height changes. Higher values have a significant cost on the GPU, so it should only be increased on materials where it makes a significant visual difference. - * - * **Note:** Only effective if [member heightmap_deep_parallax] is `true`. - */ - get heightmap_min_layers(): int64 - set heightmap_min_layers(value: int64) - - /** The number of layers to use for parallax occlusion mapping when the camera is up close to the material. Higher values result in a more convincing depth effect, especially in materials that have steep height changes. Higher values have a significant cost on the GPU, so it should only be increased on materials where it makes a significant visual difference. - * - * **Note:** Only effective if [member heightmap_deep_parallax] is `true`. - */ - get heightmap_max_layers(): int64 - set heightmap_max_layers(value: int64) - - /** If `true`, flips the mesh's tangent vectors when interpreting the height map. If the heightmap effect looks strange when the camera moves (even with a reasonable [member heightmap_scale]), try setting this to `true`. */ - get heightmap_flip_tangent(): boolean - set heightmap_flip_tangent(value: boolean) - - /** If `true`, flips the mesh's binormal vectors when interpreting the height map. If the heightmap effect looks strange when the camera moves (even with a reasonable [member heightmap_scale]), try setting this to `true`. */ - get heightmap_flip_binormal(): boolean - set heightmap_flip_binormal(value: boolean) - - /** The texture to use as a height map. See also [member heightmap_enabled]. - * For best results, the texture should be normalized (with [member heightmap_scale] reduced to compensate). In [url=https://gimp.org]GIMP[/url], this can be done using **Colors > Auto > Equalize**. If the texture only uses a small part of its available range, the parallax effect may look strange, especially when the camera moves. - * - * **Note:** To reduce memory usage and improve loading times, you may be able to use a lower-resolution heightmap texture as most heightmaps are only comprised of low-frequency data. - */ - get heightmap_texture(): Texture2D - set heightmap_texture(value: Texture2D) - - /** If `true`, interprets the height map texture as a depth map, with brighter values appearing to be "lower" in altitude compared to darker values. - * This can be enabled for compatibility with some materials authored for Godot 3.x. This is not necessary if the Invert import option was used to invert the depth map in Godot 3.x, in which case [member heightmap_flip_texture] should remain `false`. - */ - get heightmap_flip_texture(): boolean - set heightmap_flip_texture(value: boolean) - - /** If `true`, subsurface scattering is enabled. Emulates light that penetrates an object's surface, is scattered, and then emerges. Subsurface scattering quality is controlled by [member ProjectSettings.rendering/environment/subsurface_scattering/subsurface_scattering_quality]. */ - get subsurf_scatter_enabled(): boolean - set subsurf_scatter_enabled(value: boolean) - - /** The strength of the subsurface scattering effect. The depth of the effect is also controlled by [member ProjectSettings.rendering/environment/subsurface_scattering/subsurface_scattering_scale], which is set globally. */ - get subsurf_scatter_strength(): float64 - set subsurf_scatter_strength(value: float64) - - /** If `true`, subsurface scattering will use a special mode optimized for the color and density of human skin, such as boosting the intensity of the red channel in subsurface scattering. */ - get subsurf_scatter_skin_mode(): boolean - set subsurf_scatter_skin_mode(value: boolean) - - /** Texture used to control the subsurface scattering strength. Stored in the red texture channel. Multiplied by [member subsurf_scatter_strength]. */ - get subsurf_scatter_texture(): Texture2D - set subsurf_scatter_texture(value: Texture2D) - - /** If `true`, enables subsurface scattering transmittance. Only effective if [member subsurf_scatter_enabled] is `true`. See also [member backlight_enabled]. */ - get subsurf_scatter_transmittance_enabled(): boolean - set subsurf_scatter_transmittance_enabled(value: boolean) - - /** The color to multiply the subsurface scattering transmittance effect with. Ignored if [member subsurf_scatter_skin_mode] is `true`. */ - get subsurf_scatter_transmittance_color(): Color - set subsurf_scatter_transmittance_color(value: Color) - - /** The texture to use for multiplying the intensity of the subsurface scattering transmittance intensity. See also [member subsurf_scatter_texture]. Ignored if [member subsurf_scatter_skin_mode] is `true`. */ - get subsurf_scatter_transmittance_texture(): Texture2D - set subsurf_scatter_transmittance_texture(value: Texture2D) - - /** The depth of the subsurface scattering transmittance effect. */ - get subsurf_scatter_transmittance_depth(): float64 - set subsurf_scatter_transmittance_depth(value: float64) - - /** The intensity of the subsurface scattering transmittance effect. */ - get subsurf_scatter_transmittance_boost(): float64 - set subsurf_scatter_transmittance_boost(value: float64) - - /** If `true`, the backlight effect is enabled. See also [member subsurf_scatter_transmittance_enabled]. */ - get backlight_enabled(): boolean - set backlight_enabled(value: boolean) - - /** The color used by the backlight effect. Represents the light passing through an object. */ - get backlight(): Color - set backlight(value: Color) - - /** Texture used to control the backlight effect per-pixel. Added to [member backlight]. */ - get backlight_texture(): Texture2D - set backlight_texture(value: Texture2D) - - /** If `true`, the refraction effect is enabled. Distorts transparency based on light from behind the object. */ - get refraction_enabled(): boolean - set refraction_enabled(value: boolean) - - /** The strength of the refraction effect. */ - get refraction_scale(): float64 - set refraction_scale(value: float64) - - /** Texture that controls the strength of the refraction per-pixel. Multiplied by [member refraction_scale]. */ - get refraction_texture(): Texture2D - set refraction_texture(value: Texture2D) - - /** Specifies the channel of the [member refraction_texture] in which the refraction information is stored. This is useful when you store the information for multiple effects in a single texture. For example if you stored refraction in the red channel, roughness in the blue, and ambient occlusion in the green you could reduce the number of textures you use. */ - get refraction_texture_channel(): int64 - set refraction_texture_channel(value: int64) - - /** If `true`, enables the detail overlay. Detail is a second texture that gets mixed over the surface of the object based on [member detail_mask] and [member detail_albedo]'s alpha channel. This can be used to add variation to objects, or to blend between two different albedo/normal textures. */ - get detail_enabled(): boolean - set detail_enabled(value: boolean) - - /** Texture used to specify how the detail textures get blended with the base textures. [member detail_mask] can be used together with [member detail_albedo]'s alpha channel (if any). */ - get detail_mask(): Texture2D - set detail_mask(value: Texture2D) - - /** Specifies how the [member detail_albedo] should blend with the current `ALBEDO`. See [enum BlendMode] for options. */ - get detail_blend_mode(): int64 - set detail_blend_mode(value: int64) - - /** Specifies whether to use `UV` or `UV2` for the detail layer. See [enum DetailUV] for options. */ - get detail_uv_layer(): int64 - set detail_uv_layer(value: int64) - - /** Texture that specifies the color of the detail overlay. [member detail_albedo]'s alpha channel is used as a mask, even when the material is opaque. To use a dedicated texture as a mask, see [member detail_mask]. - * - * **Note:** [member detail_albedo] is *not* modulated by [member albedo_color]. - */ - get detail_albedo(): Texture2D - set detail_albedo(value: Texture2D) - - /** Texture that specifies the per-pixel normal of the detail overlay. The [member detail_normal] texture only uses the red and green channels; the blue and alpha channels are ignored. The normal read from [member detail_normal] is oriented around the surface normal provided by the [Mesh]. - * - * **Note:** Godot expects the normal map to use X+, Y+, and Z+ coordinates. See [url=http://wiki.polycount.com/wiki/Normal_Map_Technical_Details#Common_Swizzle_Coordinates]this page[/url] for a comparison of normal map coordinates expected by popular engines. - */ - get detail_normal(): Texture2D - set detail_normal(value: Texture2D) - - /** How much to scale the `UV` coordinates. This is multiplied by `UV` in the vertex function. The Z component is used when [member uv1_triplanar] is enabled, but it is not used anywhere else. */ - get uv1_scale(): Vector3 - set uv1_scale(value: Vector3) - - /** How much to offset the `UV` coordinates. This amount will be added to `UV` in the vertex function. This can be used to offset a texture. The Z component is used when [member uv1_triplanar] is enabled, but it is not used anywhere else. */ - get uv1_offset(): Vector3 - set uv1_offset(value: Vector3) - - /** If `true`, instead of using `UV` textures will use a triplanar texture lookup to determine how to apply textures. Triplanar uses the orientation of the object's surface to blend between texture coordinates. It reads from the source texture 3 times, once for each axis and then blends between the results based on how closely the pixel aligns with each axis. This is often used for natural features to get a realistic blend of materials. Because triplanar texturing requires many more texture reads per-pixel it is much slower than normal UV texturing. Additionally, because it is blending the texture between the three axes, it is unsuitable when you are trying to achieve crisp texturing. */ - get uv1_triplanar(): boolean - set uv1_triplanar(value: boolean) - - /** A lower number blends the texture more softly while a higher number blends the texture more sharply. - * - * **Note:** [member uv1_triplanar_sharpness] is clamped between `0.0` and `150.0` (inclusive) as values outside that range can look broken depending on the mesh. - */ - get uv1_triplanar_sharpness(): float64 - set uv1_triplanar_sharpness(value: float64) - - /** If `true`, triplanar mapping for `UV` is calculated in world space rather than object local space. See also [member uv1_triplanar]. */ - get uv1_world_triplanar(): boolean - set uv1_world_triplanar(value: boolean) - - /** How much to scale the `UV2` coordinates. This is multiplied by `UV2` in the vertex function. The Z component is used when [member uv2_triplanar] is enabled, but it is not used anywhere else. */ - get uv2_scale(): Vector3 - set uv2_scale(value: Vector3) - - /** How much to offset the `UV2` coordinates. This amount will be added to `UV2` in the vertex function. This can be used to offset a texture. The Z component is used when [member uv2_triplanar] is enabled, but it is not used anywhere else. */ - get uv2_offset(): Vector3 - set uv2_offset(value: Vector3) - - /** If `true`, instead of using `UV2` textures will use a triplanar texture lookup to determine how to apply textures. Triplanar uses the orientation of the object's surface to blend between texture coordinates. It reads from the source texture 3 times, once for each axis and then blends between the results based on how closely the pixel aligns with each axis. This is often used for natural features to get a realistic blend of materials. Because triplanar texturing requires many more texture reads per-pixel it is much slower than normal UV texturing. Additionally, because it is blending the texture between the three axes, it is unsuitable when you are trying to achieve crisp texturing. */ - get uv2_triplanar(): boolean - set uv2_triplanar(value: boolean) - - /** A lower number blends the texture more softly while a higher number blends the texture more sharply. - * - * **Note:** [member uv2_triplanar_sharpness] is clamped between `0.0` and `150.0` (inclusive) as values outside that range can look broken depending on the mesh. - */ - get uv2_triplanar_sharpness(): float64 - set uv2_triplanar_sharpness(value: float64) - - /** If `true`, triplanar mapping for `UV2` is calculated in world space rather than object local space. See also [member uv2_triplanar]. */ - get uv2_world_triplanar(): boolean - set uv2_world_triplanar(value: boolean) - - /** Filter flags for the texture. See [enum TextureFilter] for options. - * - * **Note:** [member heightmap_texture] is always sampled with linear filtering, even if nearest-neighbor filtering is selected here. This is to ensure the heightmap effect looks as intended. If you need sharper height transitions between pixels, resize the heightmap texture in an image editor with nearest-neighbor filtering. - */ - get texture_filter(): int64 - set texture_filter(value: int64) - - /** Repeat flags for the texture. See [enum TextureFilter] for options. */ - get texture_repeat(): boolean - set texture_repeat(value: boolean) - - /** If `true`, the object receives no shadow that would otherwise be cast onto it. */ - get disable_receive_shadows(): boolean - set disable_receive_shadows(value: boolean) - - /** If `true`, enables the "shadow to opacity" render mode where lighting modifies the alpha so shadowed areas are opaque and non-shadowed areas are transparent. Useful for overlaying shadows onto a camera feed in AR. */ - get shadow_to_opacity(): boolean - set shadow_to_opacity(value: boolean) - - /** Controls how the object faces the camera. See [enum BillboardMode]. - * - * **Note:** When billboarding is enabled and the material also casts shadows, billboards will face **the** camera in the scene when rendering shadows. In scenes with multiple cameras, the intended shadow cannot be determined and this will result in undefined behavior. See [url=https://github.com/godotengine/godot/pull/72638]GitHub Pull Request #72638[/url] for details. - * - * **Note:** Billboard mode is not suitable for VR because the left-right vector of the camera is not horizontal when the screen is attached to your head instead of on the table. See [url=https://github.com/godotengine/godot/issues/41567]GitHub issue #41567[/url] for details. - */ - get billboard_mode(): int64 - set billboard_mode(value: int64) - - /** If `true`, the shader will keep the scale set for the mesh. Otherwise, the scale is lost when billboarding. Only applies when [member billboard_mode] is not [constant BILLBOARD_DISABLED]. */ - get billboard_keep_scale(): boolean - set billboard_keep_scale(value: boolean) - - /** The number of horizontal frames in the particle sprite sheet. Only enabled when using [constant BILLBOARD_PARTICLES]. See [member billboard_mode]. */ - get particles_anim_h_frames(): int64 - set particles_anim_h_frames(value: int64) - - /** The number of vertical frames in the particle sprite sheet. Only enabled when using [constant BILLBOARD_PARTICLES]. See [member billboard_mode]. */ - get particles_anim_v_frames(): int64 - set particles_anim_v_frames(value: int64) - - /** If `true`, particle animations are looped. Only enabled when using [constant BILLBOARD_PARTICLES]. See [member billboard_mode]. */ - get particles_anim_loop(): boolean - set particles_anim_loop(value: boolean) - - /** If `true`, enables the vertex grow setting. This can be used to create mesh-based outlines using a second material pass and its [member cull_mode] set to [constant CULL_FRONT]. See also [member grow_amount]. - * - * **Note:** Vertex growth cannot create new vertices, which means that visible gaps may occur in sharp corners. This can be alleviated by designing the mesh to use smooth normals exclusively using [url=https://wiki.polycount.com/wiki/Face_weighted_normals]face weighted normals[/url] in the 3D authoring software. In this case, grow will be able to join every outline together, just like in the original mesh. - */ - get grow(): boolean - set grow(value: boolean) - - /** Grows object vertices in the direction of their normals. Only effective if [member grow] is `true`. */ - get grow_amount(): float64 - set grow_amount(value: float64) - - /** If `true`, the object is rendered at the same size regardless of distance. */ - get fixed_size(): boolean - set fixed_size(value: boolean) - - /** If `true`, render point size can be changed. - * - * **Note:** This is only effective for objects whose geometry is point-based rather than triangle-based. See also [member point_size]. - */ - get use_point_size(): boolean - set use_point_size(value: boolean) - - /** The point size in pixels. See [member use_point_size]. */ - get point_size(): float64 - set point_size(value: float64) - - /** If `true`, enables parts of the shader required for [GPUParticles3D] trails to function. This also requires using a mesh with appropriate skinning, such as [RibbonTrailMesh] or [TubeTrailMesh]. Enabling this feature outside of materials used in [GPUParticles3D] meshes will break material rendering. */ - get use_particle_trails(): boolean - set use_particle_trails(value: boolean) - - /** If `true`, the proximity fade effect is enabled. The proximity fade effect fades out each pixel based on its distance to another object. */ - get proximity_fade_enabled(): boolean - set proximity_fade_enabled(value: boolean) - - /** Distance over which the fade effect takes place. The larger the distance the longer it takes for an object to fade. */ - get proximity_fade_distance(): float64 - set proximity_fade_distance(value: float64) - - /** The width of the range around the shape between the minimum and maximum representable signed distance. */ - get msdf_pixel_range(): float64 - set msdf_pixel_range(value: float64) - - /** The width of the shape outline. */ - get msdf_outline_size(): float64 - set msdf_outline_size(value: float64) - - /** Specifies which type of fade to use. Can be any of the [enum DistanceFadeMode]s. */ - get distance_fade_mode(): int64 - set distance_fade_mode(value: int64) - - /** Distance at which the object starts to become visible. If the object is less than this distance away, it will be invisible. - * - * **Note:** If [member distance_fade_min_distance] is greater than [member distance_fade_max_distance], the behavior will be reversed. The object will start to fade away at [member distance_fade_max_distance] and will fully disappear once it reaches [member distance_fade_min_distance]. - */ - get distance_fade_min_distance(): float64 - set distance_fade_min_distance(value: float64) - - /** Distance at which the object appears fully opaque. - * - * **Note:** If [member distance_fade_max_distance] is less than [member distance_fade_min_distance], the behavior will be reversed. The object will start to fade away at [member distance_fade_max_distance] and will fully disappear once it reaches [member distance_fade_min_distance]. - */ - get distance_fade_max_distance(): float64 - set distance_fade_max_distance(value: float64) - } - /** Boolean matrix. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_bitmap.html - */ - class BitMap extends Resource { - constructor(identifier?: any) - /** Creates a bitmap with the specified size, filled with `false`. */ - create(size: Vector2i): void - - /** Creates a bitmap that matches the given image dimensions, every element of the bitmap is set to `false` if the alpha value of the image at that position is equal to [param threshold] or less, and `true` in other case. */ - create_from_image_alpha(image: Image, threshold: float64 = 0.1): void - - /** Sets the bitmap's element at the specified position, to the specified value. */ - set_bitv(position: Vector2i, bit: boolean): void - - /** Sets the bitmap's element at the specified position, to the specified value. */ - set_bit(x: int64, y: int64, bit: boolean): void - - /** Returns bitmap's value at the specified position. */ - get_bitv(position: Vector2i): boolean - - /** Returns bitmap's value at the specified position. */ - get_bit(x: int64, y: int64): boolean - - /** Sets a rectangular portion of the bitmap to the specified value. */ - set_bit_rect(rect: Rect2i, bit: boolean): void - - /** Returns the number of bitmap elements that are set to `true`. */ - get_true_bit_count(): int64 - - /** Returns bitmap's dimensions. */ - get_size(): Vector2i - - /** Resizes the image to [param new_size]. */ - resize(new_size: Vector2i): void - - /** Applies morphological dilation or erosion to the bitmap. If [param pixels] is positive, dilation is applied to the bitmap. If [param pixels] is negative, erosion is applied to the bitmap. [param rect] defines the area where the morphological operation is applied. Pixels located outside the [param rect] are unaffected by [method grow_mask]. */ - grow_mask(pixels: int64, rect: Rect2i): void - - /** Returns an image of the same size as the bitmap and with a [enum Image.Format] of type [constant Image.FORMAT_L8]. `true` bits of the bitmap are being converted into white pixels, and `false` bits into black. */ - convert_to_image(): Image - - /** Creates an [Array] of polygons covering a rectangular portion of the bitmap. It uses a marching squares algorithm, followed by Ramer-Douglas-Peucker (RDP) reduction of the number of vertices. Each polygon is described as a [PackedVector2Array] of its vertices. - * To get polygons covering the whole bitmap, pass: - * - * [param epsilon] is passed to RDP to control how accurately the polygons cover the bitmap: a lower [param epsilon] corresponds to more points in the polygons. - */ - opaque_to_polygons(rect: Rect2i, epsilon: float64 = 2): GArray - get data(): GDictionary - set data(value: GDictionary) - } - class BitMapEditorPlugin extends EditorPlugin { - constructor(identifier?: any) - } - /** A joint used with [Skeleton2D] to control and animate other nodes. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_bone2d.html - */ - class Bone2D extends Node2D { - constructor(identifier?: any) - /** Resets the bone to the rest pose. This is equivalent to setting [member Node2D.transform] to [member rest]. */ - apply_rest(): void - - /** Returns the node's [member rest] [Transform2D] if it doesn't have a parent, or its rest pose relative to its parent. */ - get_skeleton_rest(): Transform2D - - /** Returns the node's index as part of the entire skeleton. See [Skeleton2D]. */ - get_index_in_skeleton(): int64 - - /** When set to `true`, the [Bone2D] node will attempt to automatically calculate the bone angle and length using the first child [Bone2D] node, if one exists. If none exist, the [Bone2D] cannot automatically calculate these values and will print a warning. */ - set_autocalculate_length_and_angle(auto_calculate: boolean): void - - /** Returns whether this [Bone2D] is going to autocalculate its length and bone angle using its first [Bone2D] child node, if one exists. If there are no [Bone2D] children, then it cannot autocalculate these values and will print a warning. */ - get_autocalculate_length_and_angle(): boolean - - /** Sets the length of the bone in the [Bone2D]. */ - set_length(length: float64): void - - /** Returns the length of the bone in the [Bone2D] node. */ - get_length(): float64 - - /** Sets the bone angle for the [Bone2D]. This is typically set to the rotation from the [Bone2D] to a child [Bone2D] node. - * - * **Note:** This is different from the [Bone2D]'s rotation. The bone's angle is the rotation of the bone shown by the gizmo, which is unaffected by the [Bone2D]'s [member Node2D.transform]. - */ - set_bone_angle(angle: float64): void - - /** Returns the angle of the bone in the [Bone2D]. - * - * **Note:** This is different from the [Bone2D]'s rotation. The bone's angle is the rotation of the bone shown by the gizmo, which is unaffected by the [Bone2D]'s [member Node2D.transform]. - */ - get_bone_angle(): float64 - - /** Rest transform of the bone. You can reset the node's transforms to this value using [method apply_rest]. */ - get rest(): Transform2D - set rest(value: Transform2D) - } - /** А node that dynamically copies or overrides the 3D transform of a bone in its parent [Skeleton3D]. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_boneattachment3d.html - */ - class BoneAttachment3D extends Node3D { - constructor(identifier?: any) - /** A function that is called automatically when the [Skeleton3D] is updated. This function is where the [BoneAttachment3D] node updates its position so it is correctly bound when it is *not* set to override the bone pose. */ - on_skeleton_update(): void - - /** Sets whether the BoneAttachment3D node will use an external [Skeleton3D] node rather than attempting to use its parent node as the [Skeleton3D]. When set to `true`, the BoneAttachment3D node will use the external [Skeleton3D] node set in [method set_external_skeleton]. */ - set_use_external_skeleton(use_external_skeleton: boolean): void - - /** Returns whether the BoneAttachment3D node is using an external [Skeleton3D] rather than attempting to use its parent node as the [Skeleton3D]. */ - get_use_external_skeleton(): boolean - - /** Sets the [NodePath] to the external skeleton that the BoneAttachment3D node should use. See [method set_use_external_skeleton] to enable the external [Skeleton3D] node. */ - set_external_skeleton(external_skeleton: NodePath | string): void - - /** Returns the [NodePath] to the external [Skeleton3D] node, if one has been set. */ - get_external_skeleton(): NodePath - - /** The name of the attached bone. */ - get bone_name(): StringName - set bone_name(value: StringName) - - /** The index of the attached bone. */ - get bone_idx(): int64 - set bone_idx(value: int64) - - /** Whether the BoneAttachment3D node will override the bone pose of the bone it is attached to. When set to `true`, the BoneAttachment3D node can change the pose of the bone. When set to `false`, the BoneAttachment3D will always be set to the bone's transform. - * - * **Note:** This override performs interruptively in the skeleton update process using signals due to the old design. It may cause unintended behavior when used at the same time with [SkeletonModifier3D]. - */ - get override_pose(): boolean - set override_pose(value: boolean) - } - /** Describes a mapping of bone names for retargeting [Skeleton3D] into common names defined by a [SkeletonProfile]. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_bonemap.html - */ - class BoneMap extends Resource { - constructor(identifier?: any) - /** Returns a skeleton bone name is mapped to [param profile_bone_name]. - * In the retargeting process, the returned bone name is the bone name of the source skeleton. - */ - get_skeleton_bone_name(profile_bone_name: StringName): StringName - - /** Maps a skeleton bone name to [param profile_bone_name]. - * In the retargeting process, the setting bone name is the bone name of the source skeleton. - */ - set_skeleton_bone_name(profile_bone_name: StringName, skeleton_bone_name: StringName): void - - /** Returns a profile bone name having [param skeleton_bone_name]. If not found, an empty [StringName] will be returned. - * In the retargeting process, the returned bone name is the bone name of the target skeleton. - */ - find_profile_bone_name(skeleton_bone_name: StringName): StringName - - /** A [SkeletonProfile] of the mapping target. Key names in the [BoneMap] are synchronized with it. */ - get profile(): SkeletonProfile - set profile(value: SkeletonProfile) - - /** This signal is emitted when change the key value in the [BoneMap]. This is used to validate mapping and to update [BoneMap] editor. */ - readonly bone_map_updated: Signal0 - - /** This signal is emitted when change the value in profile or change the reference of profile. This is used to update key names in the [BoneMap] and to redraw the [BoneMap] editor. */ - readonly profile_updated: Signal0 - } - class BoneMapEditorPlugin extends EditorPlugin { - constructor(identifier?: any) - } - namespace BoxContainer { - enum AlignmentMode { - /** The child controls will be arranged at the beginning of the container, i.e. top if orientation is vertical, left if orientation is horizontal (right for RTL layout). */ - ALIGNMENT_BEGIN = 0, - - /** The child controls will be centered in the container. */ - ALIGNMENT_CENTER = 1, - - /** The child controls will be arranged at the end of the container, i.e. bottom if orientation is vertical, right if orientation is horizontal (left for RTL layout). */ - ALIGNMENT_END = 2, - } - } - /** A container that arranges its child controls horizontally or vertically. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_boxcontainer.html - */ - class BoxContainer extends Container { - constructor(identifier?: any) - /** Adds a [Control] node to the box as a spacer. If [param begin] is `true`, it will insert the [Control] node in front of all other children. */ - add_spacer(begin: boolean): Control - - /** The alignment of the container's children (must be one of [constant ALIGNMENT_BEGIN], [constant ALIGNMENT_CENTER], or [constant ALIGNMENT_END]). */ - get alignment(): int64 - set alignment(value: int64) - - /** If `true`, the [BoxContainer] will arrange its children vertically, rather than horizontally. - * Can't be changed when using [HBoxContainer] and [VBoxContainer]. - */ - get vertical(): boolean - set vertical(value: boolean) - } - /** Generate an axis-aligned box [PrimitiveMesh]. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_boxmesh.html - */ - class BoxMesh extends PrimitiveMesh { - constructor(identifier?: any) - /** The box's width, height and depth. */ - get size(): Vector3 - set size(value: Vector3) - - /** Number of extra edge loops inserted along the X axis. */ - get subdivide_width(): int64 - set subdivide_width(value: int64) - - /** Number of extra edge loops inserted along the Y axis. */ - get subdivide_height(): int64 - set subdivide_height(value: int64) - - /** Number of extra edge loops inserted along the Z axis. */ - get subdivide_depth(): int64 - set subdivide_depth(value: int64) - } - /** Cuboid shape for use with occlusion culling in [OccluderInstance3D]. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_boxoccluder3d.html - */ - class BoxOccluder3D extends Occluder3D { - constructor(identifier?: any) - /** The box's size in 3D units. */ - get size(): Vector3 - set size(value: Vector3) - } - /** A 3D box shape used for physics collision. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_boxshape3d.html - */ - class BoxShape3D extends Shape3D { - constructor(identifier?: any) - /** The box's width, height and depth. */ - get size(): Vector3 - set size(value: Vector3) - } - /** A themed button that can contain text and an icon. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_button.html - */ - class Button extends BaseButton { - constructor(identifier?: any) - /** The button's text that will be displayed inside the button's area. */ - get text(): string - set text(value: string) - - /** Button's icon, if text is present the icon will be placed before the text. - * To edit margin and spacing of the icon, use [theme_item h_separation] theme property and `content_margin_*` properties of the used [StyleBox]es. - */ - get icon(): Texture2D - set icon(value: Texture2D) - - /** Flat buttons don't display decoration. */ - get flat(): boolean - set flat(value: boolean) - - /** Text alignment policy for the button's text, use one of the [enum HorizontalAlignment] constants. */ - get alignment(): int64 - set alignment(value: int64) - - /** Sets the clipping behavior when the text exceeds the node's bounding rectangle. See [enum TextServer.OverrunBehavior] for a description of all modes. */ - get text_overrun_behavior(): int64 - set text_overrun_behavior(value: int64) - - /** If set to something other than [constant TextServer.AUTOWRAP_OFF], the text gets wrapped inside the node's bounding rectangle. */ - get autowrap_mode(): int64 - set autowrap_mode(value: int64) - - /** When this property is enabled, text that is too large to fit the button is clipped, when disabled the Button will always be wide enough to hold the text. */ - get clip_text(): boolean - set clip_text(value: boolean) - - /** Specifies if the icon should be aligned horizontally to the left, right, or center of a button. Uses the same [enum HorizontalAlignment] constants as the text alignment. If centered horizontally and vertically, text will draw on top of the icon. */ - get icon_alignment(): int64 - set icon_alignment(value: int64) - - /** Specifies if the icon should be aligned vertically to the top, bottom, or center of a button. Uses the same [enum VerticalAlignment] constants as the text alignment. If centered horizontally and vertically, text will draw on top of the icon. */ - get vertical_icon_alignment(): int64 - set vertical_icon_alignment(value: int64) - - /** When enabled, the button's icon will expand/shrink to fit the button's size while keeping its aspect. See also [theme_item icon_max_width]. */ - get expand_icon(): boolean - set expand_icon(value: boolean) - - /** Base text writing direction. */ - get text_direction(): int64 - set text_direction(value: int64) - - /** Language code used for line-breaking and text shaping algorithms, if left empty current locale is used instead. */ - get language(): string - set language(value: string) - } - /** A group of buttons that doesn't allow more than one button to be pressed at a time. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_buttongroup.html - */ - class ButtonGroup extends Resource { - constructor(identifier?: any) - /** Returns the current pressed button. */ - get_pressed_button(): BaseButton - - /** Returns an [Array] of [Button]s who have this as their [ButtonGroup] (see [member BaseButton.button_group]). */ - get_buttons(): GArray - - /** If `true`, it is possible to unpress all buttons in this [ButtonGroup]. */ - get allow_unpress(): boolean - set allow_unpress(value: boolean) - - /** Emitted when one of the buttons of the group is pressed. */ - readonly pressed: Signal1 - } - namespace CPUParticles2D { - enum DrawOrder { - /** Particles are drawn in the order emitted. */ - DRAW_ORDER_INDEX = 0, - - /** Particles are drawn in order of remaining lifetime. In other words, the particle with the highest lifetime is drawn at the front. */ - DRAW_ORDER_LIFETIME = 1, - } - enum Parameter { - /** Use with [method set_param_min], [method set_param_max], and [method set_param_curve] to set initial velocity properties. */ - PARAM_INITIAL_LINEAR_VELOCITY = 0, - - /** Use with [method set_param_min], [method set_param_max], and [method set_param_curve] to set angular velocity properties. */ - PARAM_ANGULAR_VELOCITY = 1, - - /** Use with [method set_param_min], [method set_param_max], and [method set_param_curve] to set orbital velocity properties. */ - PARAM_ORBIT_VELOCITY = 2, - - /** Use with [method set_param_min], [method set_param_max], and [method set_param_curve] to set linear acceleration properties. */ - PARAM_LINEAR_ACCEL = 3, - - /** Use with [method set_param_min], [method set_param_max], and [method set_param_curve] to set radial acceleration properties. */ - PARAM_RADIAL_ACCEL = 4, - - /** Use with [method set_param_min], [method set_param_max], and [method set_param_curve] to set tangential acceleration properties. */ - PARAM_TANGENTIAL_ACCEL = 5, - - /** Use with [method set_param_min], [method set_param_max], and [method set_param_curve] to set damping properties. */ - PARAM_DAMPING = 6, - - /** Use with [method set_param_min], [method set_param_max], and [method set_param_curve] to set angle properties. */ - PARAM_ANGLE = 7, - - /** Use with [method set_param_min], [method set_param_max], and [method set_param_curve] to set scale properties. */ - PARAM_SCALE = 8, - - /** Use with [method set_param_min], [method set_param_max], and [method set_param_curve] to set hue variation properties. */ - PARAM_HUE_VARIATION = 9, - - /** Use with [method set_param_min], [method set_param_max], and [method set_param_curve] to set animation speed properties. */ - PARAM_ANIM_SPEED = 10, - - /** Use with [method set_param_min], [method set_param_max], and [method set_param_curve] to set animation offset properties. */ - PARAM_ANIM_OFFSET = 11, - - /** Represents the size of the [enum Parameter] enum. */ - PARAM_MAX = 12, - } - enum ParticleFlags { - /** Use with [method set_particle_flag] to set [member particle_flag_align_y]. */ - PARTICLE_FLAG_ALIGN_Y_TO_VELOCITY = 0, - - /** Present for consistency with 3D particle nodes, not used in 2D. */ - PARTICLE_FLAG_ROTATE_Y = 1, - - /** Present for consistency with 3D particle nodes, not used in 2D. */ - PARTICLE_FLAG_DISABLE_Z = 2, - - /** Represents the size of the [enum ParticleFlags] enum. */ - PARTICLE_FLAG_MAX = 3, - } - enum EmissionShape { - /** All particles will be emitted from a single point. */ - EMISSION_SHAPE_POINT = 0, - - /** Particles will be emitted in the volume of a sphere flattened to two dimensions. */ - EMISSION_SHAPE_SPHERE = 1, - - /** Particles will be emitted on the surface of a sphere flattened to two dimensions. */ - EMISSION_SHAPE_SPHERE_SURFACE = 2, - - /** Particles will be emitted in the area of a rectangle. */ - EMISSION_SHAPE_RECTANGLE = 3, - - /** Particles will be emitted at a position chosen randomly among [member emission_points]. Particle color will be modulated by [member emission_colors]. */ - EMISSION_SHAPE_POINTS = 4, - - /** Particles will be emitted at a position chosen randomly among [member emission_points]. Particle velocity and rotation will be set based on [member emission_normals]. Particle color will be modulated by [member emission_colors]. */ - EMISSION_SHAPE_DIRECTED_POINTS = 5, - - /** Represents the size of the [enum EmissionShape] enum. */ - EMISSION_SHAPE_MAX = 6, - } - } - /** A CPU-based 2D particle emitter. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_cpuparticles2d.html - */ - class CPUParticles2D extends Node2D { - constructor(identifier?: any) - /** Restarts the particle emitter. */ - restart(): void - - /** Sets the minimum value for the given parameter. */ - set_param_min(param: CPUParticles2D.Parameter, value: float64): void - - /** Returns the minimum value range for the given parameter. */ - get_param_min(param: CPUParticles2D.Parameter): float64 - - /** Sets the maximum value for the given parameter. */ - set_param_max(param: CPUParticles2D.Parameter, value: float64): void - - /** Returns the maximum value range for the given parameter. */ - get_param_max(param: CPUParticles2D.Parameter): float64 - - /** Sets the [Curve] of the parameter specified by [enum Parameter]. */ - set_param_curve(param: CPUParticles2D.Parameter, curve: Curve): void - - /** Returns the [Curve] of the parameter specified by [enum Parameter]. */ - get_param_curve(param: CPUParticles2D.Parameter): Curve - - /** Enables or disables the given flag (see [enum ParticleFlags] for options). */ - set_particle_flag(particle_flag: CPUParticles2D.ParticleFlags, enable: boolean): void - - /** Returns the enabled state of the given flag (see [enum ParticleFlags] for options). */ - get_particle_flag(particle_flag: CPUParticles2D.ParticleFlags): boolean - - /** Sets this node's properties to match a given [GPUParticles2D] node with an assigned [ParticleProcessMaterial]. */ - convert_from_particles(particles: Node): void - - /** If `true`, particles are being emitted. [member emitting] can be used to start and stop particles from emitting. However, if [member one_shot] is `true` setting [member emitting] to `true` will not restart the emission cycle until after all active particles finish processing. You can use the [signal finished] signal to be notified once all active particles finish processing. */ - get emitting(): boolean - set emitting(value: boolean) - - /** Number of particles emitted in one emission cycle. */ - get amount(): int64 - set amount(value: int64) - - /** Amount of time each particle will exist. */ - get lifetime(): float64 - set lifetime(value: float64) - - /** If `true`, only one emission cycle occurs. If set `true` during a cycle, emission will stop at the cycle's end. */ - get one_shot(): boolean - set one_shot(value: boolean) - - /** Particle system starts as if it had already run for this many seconds. */ - get preprocess(): float64 - set preprocess(value: float64) - - /** Particle system's running speed scaling ratio. A value of `0` can be used to pause the particles. */ - get speed_scale(): float64 - set speed_scale(value: float64) - - /** How rapidly particles in an emission cycle are emitted. If greater than `0`, there will be a gap in emissions before the next cycle begins. */ - get explosiveness(): float64 - set explosiveness(value: float64) - - /** Emission lifetime randomness ratio. */ - get randomness(): float64 - set randomness(value: float64) - - /** Particle lifetime randomness ratio. */ - get lifetime_randomness(): float64 - set lifetime_randomness(value: float64) - - /** The particle system's frame rate is fixed to a value. For example, changing the value to 2 will make the particles render at 2 frames per second. Note this does not slow down the simulation of the particle system itself. */ - get fixed_fps(): int64 - set fixed_fps(value: int64) - - /** If `true`, results in fractional delta calculation which has a smoother particles display effect. */ - get fract_delta(): boolean - set fract_delta(value: boolean) - - /** If `true`, particles use the parent node's coordinate space (known as local coordinates). This will cause particles to move and rotate along the [CPUParticles2D] node (and its parents) when it is moved or rotated. If `false`, particles use global coordinates; they will not move or rotate along the [CPUParticles2D] node (and its parents) when it is moved or rotated. */ - get local_coords(): boolean - set local_coords(value: boolean) - - /** Particle draw order. Uses [enum DrawOrder] values. */ - get draw_order(): int64 - set draw_order(value: int64) - - /** Particle texture. If `null`, particles will be squares. */ - get texture(): Texture2D - set texture(value: Texture2D) - - /** Particles will be emitted inside this region. See [enum EmissionShape] for possible values. */ - get emission_shape(): int64 - set emission_shape(value: int64) - - /** The sphere's radius if [member emission_shape] is set to [constant EMISSION_SHAPE_SPHERE]. */ - get emission_sphere_radius(): float64 - set emission_sphere_radius(value: float64) - - /** The rectangle's extents if [member emission_shape] is set to [constant EMISSION_SHAPE_RECTANGLE]. */ - get emission_rect_extents(): Vector2 - set emission_rect_extents(value: Vector2) - - /** Sets the initial positions to spawn particles when using [constant EMISSION_SHAPE_POINTS] or [constant EMISSION_SHAPE_DIRECTED_POINTS]. */ - get emission_points(): PackedVector2Array - set emission_points(value: PackedVector2Array | Vector2[]) - - /** Sets the direction the particles will be emitted in when using [constant EMISSION_SHAPE_DIRECTED_POINTS]. */ - get emission_normals(): PackedVector2Array - set emission_normals(value: PackedVector2Array | Vector2[]) - - /** Sets the [Color]s to modulate particles by when using [constant EMISSION_SHAPE_POINTS] or [constant EMISSION_SHAPE_DIRECTED_POINTS]. */ - get emission_colors(): PackedColorArray - set emission_colors(value: PackedColorArray | Color[]) - - /** Align Y axis of particle with the direction of its velocity. */ - get particle_flag_align_y(): boolean - set particle_flag_align_y(value: boolean) - - /** Unit vector specifying the particles' emission direction. */ - get direction(): Vector2 - set direction(value: Vector2) - - /** Each particle's initial direction range from `+spread` to `-spread` degrees. */ - get spread(): float64 - set spread(value: float64) - - /** Gravity applied to every particle. */ - get gravity(): Vector2 - set gravity(value: Vector2) - - /** Minimum equivalent of [member initial_velocity_max]. */ - get initial_velocity_min(): float64 - set initial_velocity_min(value: float64) - - /** Maximum initial velocity magnitude for each particle. Direction comes from [member direction] and [member spread]. */ - get initial_velocity_max(): float64 - set initial_velocity_max(value: float64) - - /** Minimum equivalent of [member angular_velocity_max]. */ - get angular_velocity_min(): float64 - set angular_velocity_min(value: float64) - - /** Maximum initial angular velocity (rotation speed) applied to each particle in *degrees* per second. */ - get angular_velocity_max(): float64 - set angular_velocity_max(value: float64) - - /** Each particle's angular velocity will vary along this [Curve]. */ - get angular_velocity_curve(): Curve - set angular_velocity_curve(value: Curve) - - /** Minimum equivalent of [member orbit_velocity_max]. */ - get orbit_velocity_min(): float64 - set orbit_velocity_min(value: float64) - - /** Maximum orbital velocity applied to each particle. Makes the particles circle around origin. Specified in number of full rotations around origin per second. */ - get orbit_velocity_max(): float64 - set orbit_velocity_max(value: float64) - - /** Each particle's orbital velocity will vary along this [Curve]. */ - get orbit_velocity_curve(): Curve - set orbit_velocity_curve(value: Curve) - - /** Minimum equivalent of [member linear_accel_max]. */ - get linear_accel_min(): float64 - set linear_accel_min(value: float64) - - /** Maximum linear acceleration applied to each particle in the direction of motion. */ - get linear_accel_max(): float64 - set linear_accel_max(value: float64) - - /** Each particle's linear acceleration will vary along this [Curve]. */ - get linear_accel_curve(): Curve - set linear_accel_curve(value: Curve) - - /** Minimum equivalent of [member radial_accel_max]. */ - get radial_accel_min(): float64 - set radial_accel_min(value: float64) - - /** Maximum radial acceleration applied to each particle. Makes particle accelerate away from the origin or towards it if negative. */ - get radial_accel_max(): float64 - set radial_accel_max(value: float64) - - /** Each particle's radial acceleration will vary along this [Curve]. */ - get radial_accel_curve(): Curve - set radial_accel_curve(value: Curve) - - /** Minimum equivalent of [member tangential_accel_max]. */ - get tangential_accel_min(): float64 - set tangential_accel_min(value: float64) - - /** Maximum tangential acceleration applied to each particle. Tangential acceleration is perpendicular to the particle's velocity giving the particles a swirling motion. */ - get tangential_accel_max(): float64 - set tangential_accel_max(value: float64) - - /** Each particle's tangential acceleration will vary along this [Curve]. */ - get tangential_accel_curve(): Curve - set tangential_accel_curve(value: Curve) - - /** Minimum equivalent of [member damping_max]. */ - get damping_min(): float64 - set damping_min(value: float64) - - /** The maximum rate at which particles lose velocity. For example value of `100` means that the particle will go from `100` velocity to `0` in `1` second. */ - get damping_max(): float64 - set damping_max(value: float64) - - /** Damping will vary along this [Curve]. */ - get damping_curve(): Curve - set damping_curve(value: Curve) - - /** Minimum equivalent of [member angle_max]. */ - get angle_min(): float64 - set angle_min(value: float64) - - /** Maximum initial rotation applied to each particle, in degrees. */ - get angle_max(): float64 - set angle_max(value: float64) - - /** Each particle's rotation will be animated along this [Curve]. */ - get angle_curve(): Curve - set angle_curve(value: Curve) - - /** Minimum equivalent of [member scale_amount_max]. */ - get scale_amount_min(): float64 - set scale_amount_min(value: float64) - - /** Maximum initial scale applied to each particle. */ - get scale_amount_max(): float64 - set scale_amount_max(value: float64) - - /** Each particle's scale will vary along this [Curve]. */ - get scale_amount_curve(): Curve - set scale_amount_curve(value: Curve) - - /** If `true`, the scale curve will be split into x and y components. See [member scale_curve_x] and [member scale_curve_y]. */ - get split_scale(): boolean - set split_scale(value: boolean) - - /** Each particle's horizontal scale will vary along this [Curve]. - * [member split_scale] must be enabled. - */ - get scale_curve_x(): Curve - set scale_curve_x(value: Curve) - - /** Each particle's vertical scale will vary along this [Curve]. - * [member split_scale] must be enabled. - */ - get scale_curve_y(): Curve - set scale_curve_y(value: Curve) - - /** Each particle's initial color. If [member texture] is defined, it will be multiplied by this color. */ - get color(): Color - set color(value: Color) - - /** Each particle's color will vary along this [Gradient] (multiplied with [member color]). */ - get color_ramp(): Gradient - set color_ramp(value: Gradient) - - /** Each particle's initial color will vary along this [GradientTexture1D] (multiplied with [member color]). */ - get color_initial_ramp(): Gradient - set color_initial_ramp(value: Gradient) - - /** Minimum equivalent of [member hue_variation_max]. */ - get hue_variation_min(): float64 - set hue_variation_min(value: float64) - - /** Maximum initial hue variation applied to each particle. It will shift the particle color's hue. */ - get hue_variation_max(): float64 - set hue_variation_max(value: float64) - - /** Each particle's hue will vary along this [Curve]. */ - get hue_variation_curve(): Curve - set hue_variation_curve(value: Curve) - - /** Minimum equivalent of [member anim_speed_max]. */ - get anim_speed_min(): float64 - set anim_speed_min(value: float64) - - /** Maximum particle animation speed. Animation speed of `1` means that the particles will make full `0` to `1` offset cycle during lifetime, `2` means `2` cycles etc. - * With animation speed greater than `1`, remember to enable [member CanvasItemMaterial.particles_anim_loop] property if you want the animation to repeat. - */ - get anim_speed_max(): float64 - set anim_speed_max(value: float64) - - /** Each particle's animation speed will vary along this [Curve]. */ - get anim_speed_curve(): Curve - set anim_speed_curve(value: Curve) - - /** Minimum equivalent of [member anim_offset_max]. */ - get anim_offset_min(): float64 - set anim_offset_min(value: float64) - - /** Maximum animation offset that corresponds to frame index in the texture. `0` is the first frame, `1` is the last one. See [member CanvasItemMaterial.particles_animation]. */ - get anim_offset_max(): float64 - set anim_offset_max(value: float64) - - /** Each particle's animation offset will vary along this [Curve]. */ - get anim_offset_curve(): Curve - set anim_offset_curve(value: Curve) - - /** Emitted when all active particles have finished processing. When [member one_shot] is disabled, particles will process continuously, so this is never emitted. */ - readonly finished: Signal0 - } - class CPUParticles2DEditorPlugin extends EditorPlugin { - constructor(identifier?: any) - } - namespace CPUParticles3D { - enum DrawOrder { - /** Particles are drawn in the order emitted. */ - DRAW_ORDER_INDEX = 0, - - /** Particles are drawn in order of remaining lifetime. In other words, the particle with the highest lifetime is drawn at the front. */ - DRAW_ORDER_LIFETIME = 1, - - /** Particles are drawn in order of depth. */ - DRAW_ORDER_VIEW_DEPTH = 2, - } - enum Parameter { - /** Use with [method set_param_min], [method set_param_max], and [method set_param_curve] to set initial velocity properties. */ - PARAM_INITIAL_LINEAR_VELOCITY = 0, - - /** Use with [method set_param_min], [method set_param_max], and [method set_param_curve] to set angular velocity properties. */ - PARAM_ANGULAR_VELOCITY = 1, - - /** Use with [method set_param_min], [method set_param_max], and [method set_param_curve] to set orbital velocity properties. */ - PARAM_ORBIT_VELOCITY = 2, - - /** Use with [method set_param_min], [method set_param_max], and [method set_param_curve] to set linear acceleration properties. */ - PARAM_LINEAR_ACCEL = 3, - - /** Use with [method set_param_min], [method set_param_max], and [method set_param_curve] to set radial acceleration properties. */ - PARAM_RADIAL_ACCEL = 4, - - /** Use with [method set_param_min], [method set_param_max], and [method set_param_curve] to set tangential acceleration properties. */ - PARAM_TANGENTIAL_ACCEL = 5, - - /** Use with [method set_param_min], [method set_param_max], and [method set_param_curve] to set damping properties. */ - PARAM_DAMPING = 6, - - /** Use with [method set_param_min], [method set_param_max], and [method set_param_curve] to set angle properties. */ - PARAM_ANGLE = 7, - - /** Use with [method set_param_min], [method set_param_max], and [method set_param_curve] to set scale properties. */ - PARAM_SCALE = 8, - - /** Use with [method set_param_min], [method set_param_max], and [method set_param_curve] to set hue variation properties. */ - PARAM_HUE_VARIATION = 9, - - /** Use with [method set_param_min], [method set_param_max], and [method set_param_curve] to set animation speed properties. */ - PARAM_ANIM_SPEED = 10, - - /** Use with [method set_param_min], [method set_param_max], and [method set_param_curve] to set animation offset properties. */ - PARAM_ANIM_OFFSET = 11, - - /** Represents the size of the [enum Parameter] enum. */ - PARAM_MAX = 12, - } - enum ParticleFlags { - /** Use with [method set_particle_flag] to set [member particle_flag_align_y]. */ - PARTICLE_FLAG_ALIGN_Y_TO_VELOCITY = 0, - - /** Use with [method set_particle_flag] to set [member particle_flag_rotate_y]. */ - PARTICLE_FLAG_ROTATE_Y = 1, - - /** Use with [method set_particle_flag] to set [member particle_flag_disable_z]. */ - PARTICLE_FLAG_DISABLE_Z = 2, - - /** Represents the size of the [enum ParticleFlags] enum. */ - PARTICLE_FLAG_MAX = 3, - } - enum EmissionShape { - /** All particles will be emitted from a single point. */ - EMISSION_SHAPE_POINT = 0, - - /** Particles will be emitted in the volume of a sphere. */ - EMISSION_SHAPE_SPHERE = 1, - - /** Particles will be emitted on the surface of a sphere. */ - EMISSION_SHAPE_SPHERE_SURFACE = 2, - - /** Particles will be emitted in the volume of a box. */ - EMISSION_SHAPE_BOX = 3, - - /** Particles will be emitted at a position chosen randomly among [member emission_points]. Particle color will be modulated by [member emission_colors]. */ - EMISSION_SHAPE_POINTS = 4, - - /** Particles will be emitted at a position chosen randomly among [member emission_points]. Particle velocity and rotation will be set based on [member emission_normals]. Particle color will be modulated by [member emission_colors]. */ - EMISSION_SHAPE_DIRECTED_POINTS = 5, - - /** Particles will be emitted in a ring or cylinder. */ - EMISSION_SHAPE_RING = 6, - - /** Represents the size of the [enum EmissionShape] enum. */ - EMISSION_SHAPE_MAX = 7, - } - } - /** A CPU-based 3D particle emitter. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_cpuparticles3d.html - */ - class CPUParticles3D extends GeometryInstance3D { - constructor(identifier?: any) - /** Restarts the particle emitter. */ - restart(): void - - /** Sets the minimum value for the given parameter. */ - set_param_min(param: CPUParticles3D.Parameter, value: float64): void - - /** Returns the minimum value range for the given parameter. */ - get_param_min(param: CPUParticles3D.Parameter): float64 - - /** Sets the maximum value for the given parameter. */ - set_param_max(param: CPUParticles3D.Parameter, value: float64): void - - /** Returns the maximum value range for the given parameter. */ - get_param_max(param: CPUParticles3D.Parameter): float64 - - /** Sets the [Curve] of the parameter specified by [enum Parameter]. */ - set_param_curve(param: CPUParticles3D.Parameter, curve: Curve): void - - /** Returns the [Curve] of the parameter specified by [enum Parameter]. */ - get_param_curve(param: CPUParticles3D.Parameter): Curve - - /** Enables or disables the given particle flag (see [enum ParticleFlags] for options). */ - set_particle_flag(particle_flag: CPUParticles3D.ParticleFlags, enable: boolean): void - - /** Returns the enabled state of the given particle flag (see [enum ParticleFlags] for options). */ - get_particle_flag(particle_flag: CPUParticles3D.ParticleFlags): boolean - - /** Sets this node's properties to match a given [GPUParticles3D] node with an assigned [ParticleProcessMaterial]. */ - convert_from_particles(particles: Node): void - - /** If `true`, particles are being emitted. [member emitting] can be used to start and stop particles from emitting. However, if [member one_shot] is `true` setting [member emitting] to `true` will not restart the emission cycle until after all active particles finish processing. You can use the [signal finished] signal to be notified once all active particles finish processing. */ - get emitting(): boolean - set emitting(value: boolean) - - /** Number of particles emitted in one emission cycle. */ - get amount(): int64 - set amount(value: int64) - - /** Amount of time each particle will exist. */ - get lifetime(): float64 - set lifetime(value: float64) - - /** If `true`, only one emission cycle occurs. If set `true` during a cycle, emission will stop at the cycle's end. */ - get one_shot(): boolean - set one_shot(value: boolean) - - /** Particle system starts as if it had already run for this many seconds. */ - get preprocess(): float64 - set preprocess(value: float64) - - /** Particle system's running speed scaling ratio. A value of `0` can be used to pause the particles. */ - get speed_scale(): float64 - set speed_scale(value: float64) - - /** How rapidly particles in an emission cycle are emitted. If greater than `0`, there will be a gap in emissions before the next cycle begins. */ - get explosiveness(): float64 - set explosiveness(value: float64) - - /** Emission lifetime randomness ratio. */ - get randomness(): float64 - set randomness(value: float64) - - /** Particle lifetime randomness ratio. */ - get lifetime_randomness(): float64 - set lifetime_randomness(value: float64) - - /** The particle system's frame rate is fixed to a value. For example, changing the value to 2 will make the particles render at 2 frames per second. Note this does not slow down the particle system itself. */ - get fixed_fps(): int64 - set fixed_fps(value: int64) - - /** If `true`, results in fractional delta calculation which has a smoother particles display effect. */ - get fract_delta(): boolean - set fract_delta(value: boolean) - - /** The [AABB] that determines the node's region which needs to be visible on screen for the particle system to be active. - * Grow the box if particles suddenly appear/disappear when the node enters/exits the screen. The [AABB] can be grown via code or with the **Particles → Generate AABB** editor tool. - */ - get visibility_aabb(): AABB - set visibility_aabb(value: AABB) - - /** If `true`, particles use the parent node's coordinate space (known as local coordinates). This will cause particles to move and rotate along the [CPUParticles3D] node (and its parents) when it is moved or rotated. If `false`, particles use global coordinates; they will not move or rotate along the [CPUParticles3D] node (and its parents) when it is moved or rotated. */ - get local_coords(): boolean - set local_coords(value: boolean) - - /** Particle draw order. Uses [enum DrawOrder] values. */ - get draw_order(): int64 - set draw_order(value: int64) - - /** The [Mesh] used for each particle. If `null`, particles will be spheres. */ - get mesh(): Mesh - set mesh(value: Mesh) - - /** Particles will be emitted inside this region. See [enum EmissionShape] for possible values. */ - get emission_shape(): int64 - set emission_shape(value: int64) - - /** The sphere's radius if [enum EmissionShape] is set to [constant EMISSION_SHAPE_SPHERE]. */ - get emission_sphere_radius(): float64 - set emission_sphere_radius(value: float64) - - /** The rectangle's extents if [member emission_shape] is set to [constant EMISSION_SHAPE_BOX]. */ - get emission_box_extents(): Vector3 - set emission_box_extents(value: Vector3) - - /** Sets the initial positions to spawn particles when using [constant EMISSION_SHAPE_POINTS] or [constant EMISSION_SHAPE_DIRECTED_POINTS]. */ - get emission_points(): PackedVector3Array - set emission_points(value: PackedVector3Array | Vector3[]) - - /** Sets the direction the particles will be emitted in when using [constant EMISSION_SHAPE_DIRECTED_POINTS]. */ - get emission_normals(): PackedVector3Array - set emission_normals(value: PackedVector3Array | Vector3[]) - - /** Sets the [Color]s to modulate particles by when using [constant EMISSION_SHAPE_POINTS] or [constant EMISSION_SHAPE_DIRECTED_POINTS]. - * - * **Note:** [member emission_colors] multiplies the particle mesh's vertex colors. To have a visible effect on a [BaseMaterial3D], [member BaseMaterial3D.vertex_color_use_as_albedo] *must* be `true`. For a [ShaderMaterial], `ALBEDO *= COLOR.rgb;` must be inserted in the shader's `fragment()` function. Otherwise, [member emission_colors] will have no visible effect. - */ - get emission_colors(): PackedColorArray - set emission_colors(value: PackedColorArray | Color[]) - - /** The axis of the ring when using the emitter [constant EMISSION_SHAPE_RING]. */ - get emission_ring_axis(): Vector3 - set emission_ring_axis(value: Vector3) - - /** The height of the ring when using the emitter [constant EMISSION_SHAPE_RING]. */ - get emission_ring_height(): float64 - set emission_ring_height(value: float64) - - /** The radius of the ring when using the emitter [constant EMISSION_SHAPE_RING]. */ - get emission_ring_radius(): float64 - set emission_ring_radius(value: float64) - - /** The inner radius of the ring when using the emitter [constant EMISSION_SHAPE_RING]. */ - get emission_ring_inner_radius(): float64 - set emission_ring_inner_radius(value: float64) - - /** Align Y axis of particle with the direction of its velocity. */ - get particle_flag_align_y(): boolean - set particle_flag_align_y(value: boolean) - - /** If `true`, particles rotate around Y axis by [member angle_min]. */ - get particle_flag_rotate_y(): boolean - set particle_flag_rotate_y(value: boolean) - - /** If `true`, particles will not move on the Z axis. */ - get particle_flag_disable_z(): boolean - set particle_flag_disable_z(value: boolean) - - /** Unit vector specifying the particles' emission direction. */ - get direction(): Vector3 - set direction(value: Vector3) - - /** Each particle's initial direction range from `+spread` to `-spread` degrees. Applied to X/Z plane and Y/Z planes. */ - get spread(): float64 - set spread(value: float64) - - /** Amount of [member spread] in Y/Z plane. A value of `1` restricts particles to X/Z plane. */ - get flatness(): float64 - set flatness(value: float64) - - /** Gravity applied to every particle. */ - get gravity(): Vector3 - set gravity(value: Vector3) - - /** Minimum value of the initial velocity. */ - get initial_velocity_min(): float64 - set initial_velocity_min(value: float64) - - /** Maximum value of the initial velocity. */ - get initial_velocity_max(): float64 - set initial_velocity_max(value: float64) - - /** Minimum initial angular velocity (rotation speed) applied to each particle in *degrees* per second. */ - get angular_velocity_min(): float64 - set angular_velocity_min(value: float64) - - /** Maximum initial angular velocity (rotation speed) applied to each particle in *degrees* per second. */ - get angular_velocity_max(): float64 - set angular_velocity_max(value: float64) - - /** Each particle's angular velocity (rotation speed) will vary along this [Curve] over its lifetime. */ - get angular_velocity_curve(): Curve - set angular_velocity_curve(value: Curve) - - /** Minimum orbit velocity. */ - get orbit_velocity_min(): float64 - set orbit_velocity_min(value: float64) - - /** Maximum orbit velocity. */ - get orbit_velocity_max(): float64 - set orbit_velocity_max(value: float64) - - /** Each particle's orbital velocity will vary along this [Curve]. */ - get orbit_velocity_curve(): Curve - set orbit_velocity_curve(value: Curve) - - /** Minimum linear acceleration. */ - get linear_accel_min(): float64 - set linear_accel_min(value: float64) - - /** Maximum linear acceleration. */ - get linear_accel_max(): float64 - set linear_accel_max(value: float64) - - /** Each particle's linear acceleration will vary along this [Curve]. */ - get linear_accel_curve(): Curve - set linear_accel_curve(value: Curve) - - /** Minimum radial acceleration. */ - get radial_accel_min(): float64 - set radial_accel_min(value: float64) - - /** Maximum radial acceleration. */ - get radial_accel_max(): float64 - set radial_accel_max(value: float64) - - /** Each particle's radial acceleration will vary along this [Curve]. */ - get radial_accel_curve(): Curve - set radial_accel_curve(value: Curve) - - /** Minimum tangent acceleration. */ - get tangential_accel_min(): float64 - set tangential_accel_min(value: float64) - - /** Maximum tangent acceleration. */ - get tangential_accel_max(): float64 - set tangential_accel_max(value: float64) - - /** Each particle's tangential acceleration will vary along this [Curve]. */ - get tangential_accel_curve(): Curve - set tangential_accel_curve(value: Curve) - - /** Minimum damping. */ - get damping_min(): float64 - set damping_min(value: float64) - - /** Maximum damping. */ - get damping_max(): float64 - set damping_max(value: float64) - - /** Damping will vary along this [Curve]. */ - get damping_curve(): Curve - set damping_curve(value: Curve) - - /** Minimum angle. */ - get angle_min(): float64 - set angle_min(value: float64) - - /** Maximum angle. */ - get angle_max(): float64 - set angle_max(value: float64) - - /** Each particle's rotation will be animated along this [Curve]. */ - get angle_curve(): Curve - set angle_curve(value: Curve) - - /** Minimum scale. */ - get scale_amount_min(): float64 - set scale_amount_min(value: float64) - - /** Maximum scale. */ - get scale_amount_max(): float64 - set scale_amount_max(value: float64) - - /** Each particle's scale will vary along this [Curve]. */ - get scale_amount_curve(): Curve - set scale_amount_curve(value: Curve) - - /** If set to `true`, three different scale curves can be specified, one per scale axis. */ - get split_scale(): boolean - set split_scale(value: boolean) - - /** Curve for the scale over life, along the x axis. */ - get scale_curve_x(): Curve - set scale_curve_x(value: Curve) - - /** Curve for the scale over life, along the y axis. */ - get scale_curve_y(): Curve - set scale_curve_y(value: Curve) - - /** Curve for the scale over life, along the z axis. */ - get scale_curve_z(): Curve - set scale_curve_z(value: Curve) - - /** Each particle's initial color. - * - * **Note:** [member color] multiplies the particle mesh's vertex colors. To have a visible effect on a [BaseMaterial3D], [member BaseMaterial3D.vertex_color_use_as_albedo] *must* be `true`. For a [ShaderMaterial], `ALBEDO *= COLOR.rgb;` must be inserted in the shader's `fragment()` function. Otherwise, [member color] will have no visible effect. - */ - get color(): Color - set color(value: Color) - - /** Each particle's color will vary along this [GradientTexture1D] over its lifetime (multiplied with [member color]). - * - * **Note:** [member color_ramp] multiplies the particle mesh's vertex colors. To have a visible effect on a [BaseMaterial3D], [member BaseMaterial3D.vertex_color_use_as_albedo] *must* be `true`. For a [ShaderMaterial], `ALBEDO *= COLOR.rgb;` must be inserted in the shader's `fragment()` function. Otherwise, [member color_ramp] will have no visible effect. - */ - get color_ramp(): Gradient - set color_ramp(value: Gradient) - - /** Each particle's initial color will vary along this [GradientTexture1D] (multiplied with [member color]). - * - * **Note:** [member color_initial_ramp] multiplies the particle mesh's vertex colors. To have a visible effect on a [BaseMaterial3D], [member BaseMaterial3D.vertex_color_use_as_albedo] *must* be `true`. For a [ShaderMaterial], `ALBEDO *= COLOR.rgb;` must be inserted in the shader's `fragment()` function. Otherwise, [member color_initial_ramp] will have no visible effect. - */ - get color_initial_ramp(): Gradient - set color_initial_ramp(value: Gradient) - - /** Minimum hue variation. */ - get hue_variation_min(): float64 - set hue_variation_min(value: float64) - - /** Maximum hue variation. */ - get hue_variation_max(): float64 - set hue_variation_max(value: float64) - - /** Each particle's hue will vary along this [Curve]. */ - get hue_variation_curve(): Curve - set hue_variation_curve(value: Curve) - - /** Minimum particle animation speed. */ - get anim_speed_min(): float64 - set anim_speed_min(value: float64) - - /** Maximum particle animation speed. */ - get anim_speed_max(): float64 - set anim_speed_max(value: float64) - - /** Each particle's animation speed will vary along this [Curve]. */ - get anim_speed_curve(): Curve - set anim_speed_curve(value: Curve) - - /** Minimum animation offset. */ - get anim_offset_min(): float64 - set anim_offset_min(value: float64) - - /** Maximum animation offset. */ - get anim_offset_max(): float64 - set anim_offset_max(value: float64) - - /** Each particle's animation offset will vary along this [Curve]. */ - get anim_offset_curve(): Curve - set anim_offset_curve(value: Curve) - - /** Emitted when all active particles have finished processing. When [member one_shot] is disabled, particles will process continuously, so this is never emitted. */ - readonly finished: Signal0 - } - class CPUParticles3DEditor extends GPUParticles3DEditorBase { - constructor(identifier?: any) - } - class CPUParticles3DEditorPlugin extends EditorPlugin { - constructor(identifier?: any) - } - class CPUParticles3DGizmoPlugin extends EditorNode3DGizmoPlugin { - constructor(identifier?: any) - } - /** A CSG Box shape. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_csgbox3d.html - */ - class CSGBox3D extends CSGPrimitive3D { - constructor(identifier?: any) - /** The box's width, height and depth. */ - get size(): Vector3 - set size(value: Vector3) - - /** The material used to render the box. */ - get material(): BaseMaterial3D | ShaderMaterial - set material(value: BaseMaterial3D | ShaderMaterial) - } - /** A CSG node that allows you to combine other CSG modifiers. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_csgcombiner3d.html - */ - class CSGCombiner3D extends CSGShape3D { - constructor(identifier?: any) - } - /** A CSG Cylinder shape. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_csgcylinder3d.html - */ - class CSGCylinder3D extends CSGPrimitive3D { - constructor(identifier?: any) - /** The radius of the cylinder. */ - get radius(): float64 - set radius(value: float64) - - /** The height of the cylinder. */ - get height(): float64 - set height(value: float64) - - /** The number of sides of the cylinder, the higher this number the more detail there will be in the cylinder. */ - get sides(): int64 - set sides(value: int64) - - /** If `true` a cone is created, the [member radius] will only apply to one side. */ - get cone(): boolean - set cone(value: boolean) - - /** If `true` the normals of the cylinder are set to give a smooth effect making the cylinder seem rounded. If `false` the cylinder will have a flat shaded look. */ - get smooth_faces(): boolean - set smooth_faces(value: boolean) - - /** The material used to render the cylinder. */ - get material(): BaseMaterial3D | ShaderMaterial - set material(value: BaseMaterial3D | ShaderMaterial) - } - /** A CSG Mesh shape that uses a mesh resource. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_csgmesh3d.html - */ - class CSGMesh3D extends CSGPrimitive3D { - constructor(identifier?: any) - /** The [Mesh] resource to use as a CSG shape. - * - * **Note:** When using an [ArrayMesh], all vertex attributes except [constant Mesh.ARRAY_VERTEX], [constant Mesh.ARRAY_NORMAL] and [constant Mesh.ARRAY_TEX_UV] are left unused. Only [constant Mesh.ARRAY_VERTEX] and [constant Mesh.ARRAY_TEX_UV] will be passed to the GPU. - * [constant Mesh.ARRAY_NORMAL] is only used to determine which faces require the use of flat shading. By default, CSGMesh will ignore the mesh's vertex normals, recalculate them for each vertex and use a smooth shader. If a flat shader is required for a face, ensure that all vertex normals of the face are approximately equal. - */ - get mesh(): Mesh - set mesh(value: Mesh) - - /** The [Material] used in drawing the CSG shape. */ - get material(): BaseMaterial3D | ShaderMaterial - set material(value: BaseMaterial3D | ShaderMaterial) - } - namespace CSGPolygon3D { - enum Mode { - /** The [member polygon] shape is extruded along the negative Z axis. */ - MODE_DEPTH = 0, - - /** The [member polygon] shape is extruded by rotating it around the Y axis. */ - MODE_SPIN = 1, - - /** The [member polygon] shape is extruded along the [Path3D] specified in [member path_node]. */ - MODE_PATH = 2, - } - enum PathRotation { - /** The [member polygon] shape is not rotated. - * - * **Note:** Requires the path Z coordinates to continually decrease to ensure viable shapes. - */ - PATH_ROTATION_POLYGON = 0, - - /** The [member polygon] shape is rotated along the path, but it is not rotated around the path axis. - * - * **Note:** Requires the path Z coordinates to continually decrease to ensure viable shapes. - */ - PATH_ROTATION_PATH = 1, - - /** The [member polygon] shape follows the path and its rotations around the path axis. */ - PATH_ROTATION_PATH_FOLLOW = 2, - } - enum PathIntervalType { - /** When [member mode] is set to [constant MODE_PATH], [member path_interval] will determine the distance, in meters, each interval of the path will extrude. */ - PATH_INTERVAL_DISTANCE = 0, - - /** When [member mode] is set to [constant MODE_PATH], [member path_interval] will subdivide the polygons along the path. */ - PATH_INTERVAL_SUBDIVIDE = 1, - } - } - /** Extrudes a 2D polygon shape to create a 3D mesh. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_csgpolygon3d.html - */ - class CSGPolygon3D extends CSGPrimitive3D { - constructor(identifier?: any) - _is_editable_3d_polygon(): boolean - _has_editable_3d_polygon_no_depth(): boolean - - /** The point array that defines the 2D polygon that is extruded. This can be a convex or concave polygon with 3 or more points. The polygon must *not* have any intersecting edges. Otherwise, triangulation will fail and no mesh will be generated. - * - * **Note:** If only 1 or 2 points are defined in [member polygon], no mesh will be generated. - */ - get polygon(): PackedVector2Array - set polygon(value: PackedVector2Array | Vector2[]) - - /** The [member mode] used to extrude the [member polygon]. */ - get mode(): int64 - set mode(value: int64) - - /** When [member mode] is [constant MODE_DEPTH], the depth of the extrusion. */ - get depth(): float64 - set depth(value: float64) - - /** When [member mode] is [constant MODE_SPIN], the total number of degrees the [member polygon] is rotated when extruding. */ - get spin_degrees(): float64 - set spin_degrees(value: float64) - - /** When [member mode] is [constant MODE_SPIN], the number of extrusions made. */ - get spin_sides(): int64 - set spin_sides(value: int64) - - /** When [member mode] is [constant MODE_PATH], the location of the [Path3D] object used to extrude the [member polygon]. */ - get path_node(): NodePath - set path_node(value: NodePath | string) - - /** When [member mode] is [constant MODE_PATH], this will determine if the interval should be by distance ([constant PATH_INTERVAL_DISTANCE]) or subdivision fractions ([constant PATH_INTERVAL_SUBDIVIDE]). */ - get path_interval_type(): int64 - set path_interval_type(value: int64) - - /** When [member mode] is [constant MODE_PATH], the path interval or ratio of path points to extrusions. */ - get path_interval(): float64 - set path_interval(value: float64) - - /** When [member mode] is [constant MODE_PATH], extrusions that are less than this angle, will be merged together to reduce polygon count. */ - get path_simplify_angle(): float64 - set path_simplify_angle(value: float64) - - /** When [member mode] is [constant MODE_PATH], the path rotation method used to rotate the [member polygon] as it is extruded. */ - get path_rotation(): int64 - set path_rotation(value: int64) - - /** When [member mode] is [constant MODE_PATH], if `true` the [Transform3D] of the [CSGPolygon3D] is used as the starting point for the extrusions, not the [Transform3D] of the [member path_node]. */ - get path_local(): boolean - set path_local(value: boolean) - - /** When [member mode] is [constant MODE_PATH], by default, the top half of the [member material] is stretched along the entire length of the extruded shape. If `false` the top half of the material is repeated every step of the extrusion. */ - get path_continuous_u(): boolean - set path_continuous_u(value: boolean) - - /** When [member mode] is [constant MODE_PATH], this is the distance along the path, in meters, the texture coordinates will tile. When set to 0, texture coordinates will match geometry exactly with no tiling. */ - get path_u_distance(): float64 - set path_u_distance(value: float64) - - /** When [member mode] is [constant MODE_PATH], if `true` the ends of the path are joined, by adding an extrusion between the last and first points of the path. */ - get path_joined(): boolean - set path_joined(value: boolean) - - /** If `true`, applies smooth shading to the extrusions. */ - get smooth_faces(): boolean - set smooth_faces(value: boolean) - - /** Material to use for the resulting mesh. The UV maps the top half of the material to the extruded shape (U along the length of the extrusions and V around the outline of the [member polygon]), the bottom-left quarter to the front end face, and the bottom-right quarter to the back end face. */ - get material(): BaseMaterial3D | ShaderMaterial - set material(value: BaseMaterial3D | ShaderMaterial) - } - /** Base class for CSG primitives. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_csgprimitive3d.html - */ - class CSGPrimitive3D extends CSGShape3D { - constructor(identifier?: any) - /** If set, the order of the vertices in each triangle are reversed resulting in the backside of the mesh being drawn. */ - get flip_faces(): boolean - set flip_faces(value: boolean) - } - namespace CSGShape3D { - enum Operation { - /** Geometry of both primitives is merged, intersecting geometry is removed. */ - OPERATION_UNION = 0, - - /** Only intersecting geometry remains, the rest is removed. */ - OPERATION_INTERSECTION = 1, - - /** The second shape is subtracted from the first, leaving a dent with its shape. */ - OPERATION_SUBTRACTION = 2, - } - } - /** The CSG base class. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_csgshape3d.html - */ - class CSGShape3D extends GeometryInstance3D { - constructor(identifier?: any) - _update_shape(): void - - /** Returns `true` if this is a root shape and is thus the object that is rendered. */ - is_root_shape(): boolean - - /** Based on [param value], enables or disables the specified layer in the [member collision_mask], given a [param layer_number] between 1 and 32. */ - set_collision_mask_value(layer_number: int64, value: boolean): void - - /** Returns whether or not the specified layer of the [member collision_mask] is enabled, given a [param layer_number] between 1 and 32. */ - get_collision_mask_value(layer_number: int64): boolean - - /** Based on [param value], enables or disables the specified layer in the [member collision_layer], given a [param layer_number] between 1 and 32. */ - set_collision_layer_value(layer_number: int64, value: boolean): void - - /** Returns whether or not the specified layer of the [member collision_layer] is enabled, given a [param layer_number] between 1 and 32. */ - get_collision_layer_value(layer_number: int64): boolean - - /** Returns an [Array] with two elements, the first is the [Transform3D] of this node and the second is the root [Mesh] of this node. Only works when this node is the root shape. */ - get_meshes(): GArray - - /** The operation that is performed on this shape. This is ignored for the first CSG child node as the operation is between this node and the previous child of this nodes parent. */ - get operation(): int64 - set operation(value: int64) - - /** Snap makes the mesh vertices snap to a given distance so that the faces of two meshes can be perfectly aligned. A lower value results in greater precision but may be harder to adjust. The top-level CSG shape's snap value is used for the entire CSG tree. */ - get snap(): float64 - set snap(value: float64) - - /** Calculate tangents for the CSG shape which allows the use of normal maps. This is only applied on the root shape, this setting is ignored on any child. */ - get calculate_tangents(): boolean - set calculate_tangents(value: boolean) - - /** Adds a collision shape to the physics engine for our CSG shape. This will always act like a static body. Note that the collision shape is still active even if the CSG shape itself is hidden. See also [member collision_mask] and [member collision_priority]. */ - get use_collision(): boolean - set use_collision(value: boolean) - - /** The physics layers this area is in. - * Collidable objects can exist in any of 32 different layers. These layers work like a tagging system, and are not visual. A collidable can use these layers to select with which objects it can collide, using the collision_mask property. - * A contact is detected if object A is in any of the layers that object B scans, or object B is in any layer scanned by object A. See [url=https://docs.godotengine.org/en/4.3/tutorials/physics/physics_introduction.html#collision-layers-and-masks]Collision layers and masks[/url] in the documentation for more information. - */ - get collision_layer(): int64 - set collision_layer(value: int64) - - /** The physics layers this CSG shape scans for collisions. Only effective if [member use_collision] is `true`. See [url=https://docs.godotengine.org/en/4.3/tutorials/physics/physics_introduction.html#collision-layers-and-masks]Collision layers and masks[/url] in the documentation for more information. */ - get collision_mask(): int64 - set collision_mask(value: int64) - - /** The priority used to solve colliding when occurring penetration. Only effective if [member use_collision] is `true`. The higher the priority is, the lower the penetration into the object will be. This can for example be used to prevent the player from breaking through the boundaries of a level. */ - get collision_priority(): float64 - set collision_priority(value: float64) - } - class CSGShape3DGizmoPlugin extends EditorNode3DGizmoPlugin { - constructor(identifier?: any) - } - /** A CSG Sphere shape. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_csgsphere3d.html - */ - class CSGSphere3D extends CSGPrimitive3D { - constructor(identifier?: any) - /** Radius of the sphere. */ - get radius(): float64 - set radius(value: float64) - - /** Number of vertical slices for the sphere. */ - get radial_segments(): int64 - set radial_segments(value: int64) - - /** Number of horizontal slices for the sphere. */ - get rings(): int64 - set rings(value: int64) - - /** If `true` the normals of the sphere are set to give a smooth effect making the sphere seem rounded. If `false` the sphere will have a flat shaded look. */ - get smooth_faces(): boolean - set smooth_faces(value: boolean) - - /** The material used to render the sphere. */ - get material(): BaseMaterial3D | ShaderMaterial - set material(value: BaseMaterial3D | ShaderMaterial) - } - /** A CSG Torus shape. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_csgtorus3d.html - */ - class CSGTorus3D extends CSGPrimitive3D { - constructor(identifier?: any) - /** The inner radius of the torus. */ - get inner_radius(): float64 - set inner_radius(value: float64) - - /** The outer radius of the torus. */ - get outer_radius(): float64 - set outer_radius(value: float64) - - /** The number of slices the torus is constructed of. */ - get sides(): int64 - set sides(value: int64) - - /** The number of edges each ring of the torus is constructed of. */ - get ring_sides(): int64 - set ring_sides(value: int64) - - /** If `true` the normals of the torus are set to give a smooth effect making the torus seem rounded. If `false` the torus will have a flat shaded look. */ - get smooth_faces(): boolean - set smooth_faces(value: boolean) - - /** The material used to render the torus. */ - get material(): BaseMaterial3D | ShaderMaterial - set material(value: BaseMaterial3D | ShaderMaterial) - } - /** Calls the specified method after optional delay. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_callbacktweener.html - */ - class CallbackTweener extends Tweener { - constructor(identifier?: any) - /** Makes the callback call delayed by given time in seconds. - * **Example:** - * - */ - set_delay(delay: float64): CallbackTweener - } - namespace Camera2D { - enum AnchorMode { - /** The camera's position is fixed so that the top-left corner is always at the origin. */ - ANCHOR_MODE_FIXED_TOP_LEFT = 0, - - /** The camera's position takes into account vertical/horizontal offsets and the screen size. */ - ANCHOR_MODE_DRAG_CENTER = 1, - } - enum Camera2DProcessCallback { - /** The camera updates during physics frames (see [constant Node.NOTIFICATION_INTERNAL_PHYSICS_PROCESS]). */ - CAMERA2D_PROCESS_PHYSICS = 0, - - /** The camera updates during process frames (see [constant Node.NOTIFICATION_INTERNAL_PROCESS]). */ - CAMERA2D_PROCESS_IDLE = 1, - } - } - /** Camera node for 2D scenes. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_camera2d.html - */ - class Camera2D extends Node2D { - constructor(identifier?: any) - _update_scroll(): void - - /** Forces this [Camera2D] to become the current active one. [member enabled] must be `true`. */ - make_current(): void - - /** Returns `true` if this [Camera2D] is the active camera (see [method Viewport.get_camera_2d]). */ - is_current(): boolean - _make_current(_unnamed_arg0: Object): void - - /** Sets the camera limit for the specified [enum Side]. See also [member limit_bottom], [member limit_top], [member limit_left], and [member limit_right]. */ - set_limit(margin: Side, limit: int64): void - - /** Returns the camera limit for the specified [enum Side]. See also [member limit_bottom], [member limit_top], [member limit_left], and [member limit_right]. */ - get_limit(margin: Side): int64 - - /** Sets the specified [enum Side]'s margin. See also [member drag_bottom_margin], [member drag_top_margin], [member drag_left_margin], and [member drag_right_margin]. */ - set_drag_margin(margin: Side, drag_margin: float64): void - - /** Returns the specified [enum Side]'s margin. See also [member drag_bottom_margin], [member drag_top_margin], [member drag_left_margin], and [member drag_right_margin]. */ - get_drag_margin(margin: Side): float64 - - /** Returns this camera's target position, in global coordinates. - * - * **Note:** The returned value is not the same as [member Node2D.global_position], as it is affected by the drag properties. It is also not the same as the current position if [member position_smoothing_enabled] is `true` (see [method get_screen_center_position]). - */ - get_target_position(): Vector2 - - /** Returns the center of the screen from this camera's point of view, in global coordinates. - * - * **Note:** The exact targeted position of the camera may be different. See [method get_target_position]. - */ - get_screen_center_position(): Vector2 - - /** Forces the camera to update scroll immediately. */ - force_update_scroll(): void - - /** Sets the camera's position immediately to its current smoothing destination. - * This method has no effect if [member position_smoothing_enabled] is `false`. - */ - reset_smoothing(): void - - /** Aligns the camera to the tracked node. */ - align(): void - _set_old_smoothing(follow_smoothing: float64): void - - /** The camera's relative offset. Useful for looking around or camera shake animations. The offsetted camera can go past the limits defined in [member limit_top], [member limit_bottom], [member limit_left] and [member limit_right]. */ - get offset(): Vector2 - set offset(value: Vector2) - - /** The Camera2D's anchor point. See [enum AnchorMode] constants. */ - get anchor_mode(): int64 - set anchor_mode(value: int64) - - /** If `true`, the camera's rendered view is not affected by its [member Node2D.rotation] and [member Node2D.global_rotation]. */ - get ignore_rotation(): boolean - set ignore_rotation(value: boolean) - - /** Controls whether the camera can be active or not. If `true`, the [Camera2D] will become the main camera when it enters the scene tree and there is no active camera currently (see [method Viewport.get_camera_2d]). - * When the camera is currently active and [member enabled] is set to `false`, the next enabled [Camera2D] in the scene tree will become active. - */ - get enabled(): boolean - set enabled(value: boolean) - - /** The camera's zoom. A zoom of `Vector(2, 2)` doubles the size seen in the viewport. A zoom of `Vector(0.5, 0.5)` halves the size seen in the viewport. - * - * **Note:** [member FontFile.oversampling] does *not* take [Camera2D] zoom into account. This means that zooming in/out will cause bitmap fonts and rasterized (non-MSDF) dynamic fonts to appear blurry or pixelated unless the font is part of a [CanvasLayer] that makes it ignore camera zoom. To ensure text remains crisp regardless of zoom, you can enable MSDF font rendering by enabling [member ProjectSettings.gui/theme/default_font_multichannel_signed_distance_field] (applies to the default project font only), or enabling **Multichannel Signed Distance Field** in the import options of a DynamicFont for custom fonts. On system fonts, [member SystemFont.multichannel_signed_distance_field] can be enabled in the inspector. - */ - get zoom(): Vector2 - set zoom(value: Vector2) - - /** The custom [Viewport] node attached to the [Camera2D]. If `null` or not a [Viewport], uses the default viewport instead. */ - get custom_viewport(): Viewport - set custom_viewport(value: Viewport) - - /** The camera's process callback. See [enum Camera2DProcessCallback]. */ - get process_callback(): int64 - set process_callback(value: int64) - - /** Left scroll limit in pixels. The camera stops moving when reaching this value, but [member offset] can push the view past the limit. */ - get limit_left(): int64 - set limit_left(value: int64) - - /** Top scroll limit in pixels. The camera stops moving when reaching this value, but [member offset] can push the view past the limit. */ - get limit_top(): int64 - set limit_top(value: int64) - - /** Right scroll limit in pixels. The camera stops moving when reaching this value, but [member offset] can push the view past the limit. */ - get limit_right(): int64 - set limit_right(value: int64) - - /** Bottom scroll limit in pixels. The camera stops moving when reaching this value, but [member offset] can push the view past the limit. */ - get limit_bottom(): int64 - set limit_bottom(value: int64) - - /** If `true`, the camera smoothly stops when reaches its limits. - * This property has no effect if [member position_smoothing_enabled] is `false`. - * - * **Note:** To immediately update the camera's position to be within limits without smoothing, even with this setting enabled, invoke [method reset_smoothing]. - */ - get limit_smoothed(): boolean - set limit_smoothed(value: boolean) - - /** If `true`, the camera's view smoothly moves towards its target position at [member position_smoothing_speed]. */ - get position_smoothing_enabled(): boolean - set position_smoothing_enabled(value: boolean) - - /** Speed in pixels per second of the camera's smoothing effect when [member position_smoothing_enabled] is `true`. */ - get position_smoothing_speed(): float64 - set position_smoothing_speed(value: float64) - - /** If `true`, the camera's view smoothly rotates, via asymptotic smoothing, to align with its target rotation at [member rotation_smoothing_speed]. - * - * **Note:** This property has no effect if [member ignore_rotation] is `true`. - */ - get rotation_smoothing_enabled(): boolean - set rotation_smoothing_enabled(value: boolean) - - /** The angular, asymptotic speed of the camera's rotation smoothing effect when [member rotation_smoothing_enabled] is `true`. */ - get rotation_smoothing_speed(): float64 - set rotation_smoothing_speed(value: float64) - - /** If `true`, the camera only moves when reaching the horizontal (left and right) drag margins. If `false`, the camera moves horizontally regardless of margins. */ - get drag_horizontal_enabled(): boolean - set drag_horizontal_enabled(value: boolean) - - /** If `true`, the camera only moves when reaching the vertical (top and bottom) drag margins. If `false`, the camera moves vertically regardless of the drag margins. */ - get drag_vertical_enabled(): boolean - set drag_vertical_enabled(value: boolean) - - /** The relative horizontal drag offset of the camera between the right (`-1`) and left (`1`) drag margins. - * - * **Note:** Used to set the initial horizontal drag offset; determine the current offset; or force the current offset. It's not automatically updated when [member drag_horizontal_enabled] is `true` or the drag margins are changed. - */ - get drag_horizontal_offset(): float64 - set drag_horizontal_offset(value: float64) - - /** The relative vertical drag offset of the camera between the bottom (`-1`) and top (`1`) drag margins. - * - * **Note:** Used to set the initial vertical drag offset; determine the current offset; or force the current offset. It's not automatically updated when [member drag_vertical_enabled] is `true` or the drag margins are changed. - */ - get drag_vertical_offset(): float64 - set drag_vertical_offset(value: float64) - - /** Left margin needed to drag the camera. A value of `1` makes the camera move only when reaching the left edge of the screen. */ - get drag_left_margin(): float64 - set drag_left_margin(value: float64) - - /** Top margin needed to drag the camera. A value of `1` makes the camera move only when reaching the top edge of the screen. */ - get drag_top_margin(): float64 - set drag_top_margin(value: float64) - - /** Right margin needed to drag the camera. A value of `1` makes the camera move only when reaching the right edge of the screen. */ - get drag_right_margin(): float64 - set drag_right_margin(value: float64) - - /** Bottom margin needed to drag the camera. A value of `1` makes the camera move only when reaching the bottom edge of the screen. */ - get drag_bottom_margin(): float64 - set drag_bottom_margin(value: float64) - - /** If `true`, draws the camera's screen rectangle in the editor. */ - get editor_draw_screen(): boolean - set editor_draw_screen(value: boolean) - - /** If `true`, draws the camera's limits rectangle in the editor. */ - get editor_draw_limits(): boolean - set editor_draw_limits(value: boolean) - - /** If `true`, draws the camera's drag margin rectangle in the editor. */ - get editor_draw_drag_margin(): boolean - set editor_draw_drag_margin(value: boolean) - } - namespace Camera3D { - enum ProjectionType { - /** Perspective projection. Objects on the screen becomes smaller when they are far away. */ - PROJECTION_PERSPECTIVE = 0, - - /** Orthogonal projection, also known as orthographic projection. Objects remain the same size on the screen no matter how far away they are. */ - PROJECTION_ORTHOGONAL = 1, - - /** Frustum projection. This mode allows adjusting [member frustum_offset] to create "tilted frustum" effects. */ - PROJECTION_FRUSTUM = 2, - } - enum KeepAspect { - /** Preserves the horizontal aspect ratio; also known as Vert- scaling. This is usually the best option for projects running in portrait mode, as taller aspect ratios will benefit from a wider vertical FOV. */ - KEEP_WIDTH = 0, - - /** Preserves the vertical aspect ratio; also known as Hor+ scaling. This is usually the best option for projects running in landscape mode, as wider aspect ratios will automatically benefit from a wider horizontal FOV. */ - KEEP_HEIGHT = 1, - } - enum DopplerTracking { - /** Disables [url=https://en.wikipedia.org/wiki/Doppler_effect]Doppler effect[/url] simulation (default). */ - DOPPLER_TRACKING_DISABLED = 0, - - /** Simulate [url=https://en.wikipedia.org/wiki/Doppler_effect]Doppler effect[/url] by tracking positions of objects that are changed in `_process`. Changes in the relative velocity of this camera compared to those objects affect how audio is perceived (changing the audio's [member AudioStreamPlayer3D.pitch_scale]). */ - DOPPLER_TRACKING_IDLE_STEP = 1, - - /** Simulate [url=https://en.wikipedia.org/wiki/Doppler_effect]Doppler effect[/url] by tracking positions of objects that are changed in `_physics_process`. Changes in the relative velocity of this camera compared to those objects affect how audio is perceived (changing the audio's [member AudioStreamPlayer3D.pitch_scale]). */ - DOPPLER_TRACKING_PHYSICS_STEP = 2, - } - } - /** Camera node, displays from a point of view. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_camera3d.html - */ - class Camera3D extends Node3D { - constructor(identifier?: any) - /** Returns a normal vector in world space, that is the result of projecting a point on the [Viewport] rectangle by the inverse camera projection. This is useful for casting rays in the form of (origin, normal) for object intersection or picking. */ - project_ray_normal(screen_point: Vector2): Vector3 - - /** Returns a normal vector from the screen point location directed along the camera. Orthogonal cameras are normalized. Perspective cameras account for perspective, screen width/height, etc. */ - project_local_ray_normal(screen_point: Vector2): Vector3 - - /** Returns a 3D position in world space, that is the result of projecting a point on the [Viewport] rectangle by the inverse camera projection. This is useful for casting rays in the form of (origin, normal) for object intersection or picking. */ - project_ray_origin(screen_point: Vector2): Vector3 - - /** Returns the 2D coordinate in the [Viewport] rectangle that maps to the given 3D point in world space. - * - * **Note:** When using this to position GUI elements over a 3D viewport, use [method is_position_behind] to prevent them from appearing if the 3D point is behind the camera: - * - */ - unproject_position(world_point: Vector3): Vector2 - - /** Returns `true` if the given position is behind the camera (the blue part of the linked diagram). [url=https://raw.githubusercontent.com/godotengine/godot-docs/master/img/camera3d_position_frustum.png]See this diagram[/url] for an overview of position query methods. - * - * **Note:** A position which returns `false` may still be outside the camera's field of view. - */ - is_position_behind(world_point: Vector3): boolean - - /** Returns the 3D point in world space that maps to the given 2D coordinate in the [Viewport] rectangle on a plane that is the given [param z_depth] distance into the scene away from the camera. */ - project_position(screen_point: Vector2, z_depth: float64): Vector3 - - /** Sets the camera projection to perspective mode (see [constant PROJECTION_PERSPECTIVE]), by specifying a [param fov] (field of view) angle in degrees, and the [param z_near] and [param z_far] clip planes in world space units. */ - set_perspective(fov: float64, z_near: float64, z_far: float64): void - - /** Sets the camera projection to orthogonal mode (see [constant PROJECTION_ORTHOGONAL]), by specifying a [param size], and the [param z_near] and [param z_far] clip planes in world space units. (As a hint, 2D games often use this projection, with values specified in pixels.) */ - set_orthogonal(size: float64, z_near: float64, z_far: float64): void - - /** Sets the camera projection to frustum mode (see [constant PROJECTION_FRUSTUM]), by specifying a [param size], an [param offset], and the [param z_near] and [param z_far] clip planes in world space units. See also [member frustum_offset]. */ - set_frustum(size: float64, offset: Vector2, z_near: float64, z_far: float64): void - - /** Makes this camera the current camera for the [Viewport] (see class description). If the camera node is outside the scene tree, it will attempt to become current once it's added. */ - make_current(): void - - /** If this is the current camera, remove it from being current. If [param enable_next] is `true`, request to make the next camera current, if any. */ - clear_current(enable_next: boolean = true): void - - /** Returns the transform of the camera plus the vertical ([member v_offset]) and horizontal ([member h_offset]) offsets; and any other adjustments made to the position and orientation of the camera by subclassed cameras such as [XRCamera3D]. */ - get_camera_transform(): Transform3D - - /** Returns the projection matrix that this camera uses to render to its associated viewport. The camera must be part of the scene tree to function. */ - get_camera_projection(): Projection - - /** Returns the camera's frustum planes in world space units as an array of [Plane]s in the following order: near, far, left, top, right, bottom. Not to be confused with [member frustum_offset]. */ - get_frustum(): GArray - - /** Returns `true` if the given position is inside the camera's frustum (the green part of the linked diagram). [url=https://raw.githubusercontent.com/godotengine/godot-docs/master/img/camera3d_position_frustum.png]See this diagram[/url] for an overview of position query methods. */ - is_position_in_frustum(world_point: Vector3): boolean - - /** Returns the camera's RID from the [RenderingServer]. */ - get_camera_rid(): RID - - /** Returns the RID of a pyramid shape encompassing the camera's view frustum, ignoring the camera's near plane. The tip of the pyramid represents the position of the camera. */ - get_pyramid_shape_rid(): RID - - /** Based on [param value], enables or disables the specified layer in the [member cull_mask], given a [param layer_number] between 1 and 20. */ - set_cull_mask_value(layer_number: int64, value: boolean): void - - /** Returns whether or not the specified layer of the [member cull_mask] is enabled, given a [param layer_number] between 1 and 20. */ - get_cull_mask_value(layer_number: int64): boolean - - /** The axis to lock during [member fov]/[member size] adjustments. Can be either [constant KEEP_WIDTH] or [constant KEEP_HEIGHT]. */ - get keep_aspect(): int64 - set keep_aspect(value: int64) - - /** The culling mask that describes which [member VisualInstance3D.layers] are rendered by this camera. By default, all 20 user-visible layers are rendered. - * - * **Note:** Since the [member cull_mask] allows for 32 layers to be stored in total, there are an additional 12 layers that are only used internally by the engine and aren't exposed in the editor. Setting [member cull_mask] using a script allows you to toggle those reserved layers, which can be useful for editor plugins. - * To adjust [member cull_mask] more easily using a script, use [method get_cull_mask_value] and [method set_cull_mask_value]. - * - * **Note:** [VoxelGI], SDFGI and [LightmapGI] will always take all layers into account to determine what contributes to global illumination. If this is an issue, set [member GeometryInstance3D.gi_mode] to [constant GeometryInstance3D.GI_MODE_DISABLED] for meshes and [member Light3D.light_bake_mode] to [constant Light3D.BAKE_DISABLED] for lights to exclude them from global illumination. - */ - get cull_mask(): int64 - set cull_mask(value: int64) - - /** The [Environment] to use for this camera. */ - get environment(): Environment - set environment(value: Environment) - - /** The [CameraAttributes] to use for this camera. */ - get attributes(): CameraAttributesPractical | CameraAttributesPhysical - set attributes(value: CameraAttributesPractical | CameraAttributesPhysical) - - /** The [Compositor] to use for this camera. */ - get compositor(): Compositor - set compositor(value: Compositor) - - /** The horizontal (X) offset of the camera viewport. */ - get h_offset(): float64 - set h_offset(value: float64) - - /** The vertical (Y) offset of the camera viewport. */ - get v_offset(): float64 - set v_offset(value: float64) - - /** If not [constant DOPPLER_TRACKING_DISABLED], this camera will simulate the [url=https://en.wikipedia.org/wiki/Doppler_effect]Doppler effect[/url] for objects changed in particular `_process` methods. See [enum DopplerTracking] for possible values. */ - get doppler_tracking(): int64 - set doppler_tracking(value: int64) - - /** The camera's projection mode. In [constant PROJECTION_PERSPECTIVE] mode, objects' Z distance from the camera's local space scales their perceived size. */ - get projection(): int64 - set projection(value: int64) - - /** If `true`, the ancestor [Viewport] is currently using this camera. - * If multiple cameras are in the scene, one will always be made current. For example, if two [Camera3D] nodes are present in the scene and only one is current, setting one camera's [member current] to `false` will cause the other camera to be made current. - */ - get current(): boolean - set current(value: boolean) - - /** The camera's field of view angle (in degrees). Only applicable in perspective mode. Since [member keep_aspect] locks one axis, [member fov] sets the other axis' field of view angle. - * For reference, the default vertical field of view value (`75.0`) is equivalent to a horizontal FOV of: - * - ~91.31 degrees in a 4:3 viewport - * - ~101.67 degrees in a 16:10 viewport - * - ~107.51 degrees in a 16:9 viewport - * - ~121.63 degrees in a 21:9 viewport - */ - get fov(): float64 - set fov(value: float64) - - /** The camera's size in meters measured as the diameter of the width or height, depending on [member keep_aspect]. Only applicable in orthogonal and frustum modes. */ - get size(): float64 - set size(value: float64) - - /** The camera's frustum offset. This can be changed from the default to create "tilted frustum" effects such as [url=https://zdoom.org/wiki/Y-shearing]Y-shearing[/url]. - * - * **Note:** Only effective if [member projection] is [constant PROJECTION_FRUSTUM]. - */ - get frustum_offset(): Vector2 - set frustum_offset(value: Vector2) - - /** The distance to the near culling boundary for this camera relative to its local Z axis. Lower values allow the camera to see objects more up close to its origin, at the cost of lower precision across the *entire* range. Values lower than the default can lead to increased Z-fighting. */ - get near(): float64 - set near(value: float64) - - /** The distance to the far culling boundary for this camera relative to its local Z axis. Higher values allow the camera to see further away, while decreasing [member far] can improve performance if it results in objects being partially or fully culled. */ - get far(): float64 - set far(value: float64) - } - class Camera3DEditorPlugin extends EditorPlugin { - constructor(identifier?: any) - } - class Camera3DGizmoPlugin extends EditorNode3DGizmoPlugin { - constructor(identifier?: any) - } - /** Parent class for camera settings. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_cameraattributes.html - */ - class CameraAttributes extends Resource { - constructor(identifier?: any) - /** Sensitivity of camera sensors, measured in ISO. A higher sensitivity results in a brighter image. Only available when [member ProjectSettings.rendering/lights_and_shadows/use_physical_light_units] is enabled. When [member auto_exposure_enabled] this can be used as a method of exposure compensation, doubling the value will increase the exposure value (measured in EV100) by 1 stop. */ - get exposure_sensitivity(): float64 - set exposure_sensitivity(value: float64) - - /** Multiplier for the exposure amount. A higher value results in a brighter image. */ - get exposure_multiplier(): float64 - set exposure_multiplier(value: float64) - - /** If `true`, enables the tonemapping auto exposure mode of the scene renderer. If `true`, the renderer will automatically determine the exposure setting to adapt to the scene's illumination and the observed light. */ - get auto_exposure_enabled(): boolean - set auto_exposure_enabled(value: boolean) - - /** The scale of the auto exposure effect. Affects the intensity of auto exposure. */ - get auto_exposure_scale(): float64 - set auto_exposure_scale(value: float64) - - /** The speed of the auto exposure effect. Affects the time needed for the camera to perform auto exposure. */ - get auto_exposure_speed(): float64 - set auto_exposure_speed(value: float64) - } - /** Physically-based camera settings. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_cameraattributesphysical.html - */ - class CameraAttributesPhysical extends CameraAttributes { - constructor(identifier?: any) - /** Returns the vertical field of view that corresponds to the [member frustum_focal_length]. This value is calculated internally whenever [member frustum_focal_length] is changed. */ - get_fov(): float64 - - /** Distance from camera of object that will be in focus, measured in meters. Internally this will be clamped to be at least 1 millimeter larger than [member frustum_focal_length]. */ - get frustum_focus_distance(): float64 - set frustum_focus_distance(value: float64) - - /** Distance between camera lens and camera aperture, measured in millimeters. Controls field of view and depth of field. A larger focal length will result in a smaller field of view and a narrower depth of field meaning fewer objects will be in focus. A smaller focal length will result in a wider field of view and a larger depth of field meaning more objects will be in focus. When attached to a [Camera3D] as its [member Camera3D.attributes], it will override the [member Camera3D.fov] property and the [member Camera3D.keep_aspect] property. */ - get frustum_focal_length(): float64 - set frustum_focal_length(value: float64) - - /** Override value for [member Camera3D.near]. Used internally when calculating depth of field. When attached to a [Camera3D] as its [member Camera3D.attributes], it will override the [member Camera3D.near] property. */ - get frustum_near(): float64 - set frustum_near(value: float64) - - /** Override value for [member Camera3D.far]. Used internally when calculating depth of field. When attached to a [Camera3D] as its [member Camera3D.attributes], it will override the [member Camera3D.far] property. */ - get frustum_far(): float64 - set frustum_far(value: float64) - - /** Size of the aperture of the camera, measured in f-stops. An f-stop is a unitless ratio between the focal length of the camera and the diameter of the aperture. A high aperture setting will result in a smaller aperture which leads to a dimmer image and sharper focus. A low aperture results in a wide aperture which lets in more light resulting in a brighter, less-focused image. Default is appropriate for outdoors at daytime (i.e. for use with a default [DirectionalLight3D]), for indoor lighting, a value between 2 and 4 is more appropriate. - * Only available when [member ProjectSettings.rendering/lights_and_shadows/use_physical_light_units] is enabled. - */ - get exposure_aperture(): float64 - set exposure_aperture(value: float64) - - /** Time for shutter to open and close, evaluated as `1 / shutter_speed` seconds. A higher value will allow less light (leading to a darker image), while a lower value will allow more light (leading to a brighter image). - * Only available when [member ProjectSettings.rendering/lights_and_shadows/use_physical_light_units] is enabled. - */ - get exposure_shutter_speed(): float64 - set exposure_shutter_speed(value: float64) - - /** The minimum luminance luminance (in EV100) used when calculating auto exposure. When calculating scene average luminance, color values will be clamped to at least this value. This limits the auto-exposure from exposing above a certain brightness, resulting in a cut off point where the scene will remain dark. */ - get auto_exposure_min_exposure_value(): float64 - set auto_exposure_min_exposure_value(value: float64) - - /** The maximum luminance (in EV100) used when calculating auto exposure. When calculating scene average luminance, color values will be clamped to at least this value. This limits the auto-exposure from exposing below a certain brightness, resulting in a cut off point where the scene will remain bright. */ - get auto_exposure_max_exposure_value(): float64 - set auto_exposure_max_exposure_value(value: float64) - } - /** Camera settings in an easy to use format. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_cameraattributespractical.html - */ - class CameraAttributesPractical extends CameraAttributes { - constructor(identifier?: any) - /** Enables depth of field blur for objects further than [member dof_blur_far_distance]. Strength of blur is controlled by [member dof_blur_amount] and modulated by [member dof_blur_far_transition]. - * - * **Note:** Depth of field blur is only supported in the Forward+ and Mobile rendering methods, not Compatibility. - */ - get dof_blur_far_enabled(): boolean - set dof_blur_far_enabled(value: boolean) - - /** Objects further from the [Camera3D] by this amount will be blurred by the depth of field effect. Measured in meters. */ - get dof_blur_far_distance(): float64 - set dof_blur_far_distance(value: float64) - - /** When positive, distance over which (starting from [member dof_blur_far_distance]) blur effect will scale from 0 to [member dof_blur_amount]. When negative, uses physically-based scaling so depth of field effect will scale from 0 at [member dof_blur_far_distance] and will increase in a physically accurate way as objects get further from the [Camera3D]. */ - get dof_blur_far_transition(): float64 - set dof_blur_far_transition(value: float64) - - /** Enables depth of field blur for objects closer than [member dof_blur_near_distance]. Strength of blur is controlled by [member dof_blur_amount] and modulated by [member dof_blur_near_transition]. - * - * **Note:** Depth of field blur is only supported in the Forward+ and Mobile rendering methods, not Compatibility. - */ - get dof_blur_near_enabled(): boolean - set dof_blur_near_enabled(value: boolean) - - /** Objects closer from the [Camera3D] by this amount will be blurred by the depth of field effect. Measured in meters. */ - get dof_blur_near_distance(): float64 - set dof_blur_near_distance(value: float64) - - /** When positive, distance over which blur effect will scale from 0 to [member dof_blur_amount], ending at [member dof_blur_near_distance]. When negative, uses physically-based scaling so depth of field effect will scale from 0 at [member dof_blur_near_distance] and will increase in a physically accurate way as objects get closer to the [Camera3D]. */ - get dof_blur_near_transition(): float64 - set dof_blur_near_transition(value: float64) - - /** Sets the maximum amount of blur. When using physically-based blur amounts, will instead act as a multiplier. High values lead to an increased amount of blurriness, but can be much more expensive to calculate. It is best to keep this as low as possible for a given art style. */ - get dof_blur_amount(): float64 - set dof_blur_amount(value: float64) - - /** The minimum sensitivity (in ISO) used when calculating auto exposure. When calculating scene average luminance, color values will be clamped to at least this value. This limits the auto-exposure from exposing above a certain brightness, resulting in a cut off point where the scene will remain dark. */ - get auto_exposure_min_sensitivity(): float64 - set auto_exposure_min_sensitivity(value: float64) - - /** The maximum sensitivity (in ISO) used when calculating auto exposure. When calculating scene average luminance, color values will be clamped to at least this value. This limits the auto-exposure from exposing below a certain brightness, resulting in a cut off point where the scene will remain bright. */ - get auto_exposure_max_sensitivity(): float64 - set auto_exposure_max_sensitivity(value: float64) - } - namespace CameraFeed { - enum FeedDataType { - /** No image set for the feed. */ - FEED_NOIMAGE = 0, - - /** Feed supplies RGB images. */ - FEED_RGB = 1, - - /** Feed supplies YCbCr images that need to be converted to RGB. */ - FEED_YCBCR = 2, - - /** Feed supplies separate Y and CbCr images that need to be combined and converted to RGB. */ - FEED_YCBCR_SEP = 3, - } - enum FeedPosition { - /** Unspecified position. */ - FEED_UNSPECIFIED = 0, - - /** Camera is mounted at the front of the device. */ - FEED_FRONT = 1, - - /** Camera is mounted at the back of the device. */ - FEED_BACK = 2, - } - } - /** A camera feed gives you access to a single physical camera attached to your device. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_camerafeed.html - */ - class CameraFeed extends RefCounted { - constructor(identifier?: any) - /** Returns the unique ID for this feed. */ - get_id(): int64 - - /** Returns the camera's name. */ - get_name(): string - _set_name(name: string): void - - /** Returns the position of camera on the device. */ - get_position(): CameraFeed.FeedPosition - _set_position(position: CameraFeed.FeedPosition): void - _set_RGB_img(rgb_img: Image): void - _set_YCbCr_img(ycbcr_img: Image): void - - /** Returns feed image data type. */ - get_datatype(): CameraFeed.FeedDataType - - /** If `true`, the feed is active. */ - get feed_is_active(): boolean - set feed_is_active(value: boolean) - - /** The transform applied to the camera's image. */ - get feed_transform(): Transform2D - set feed_transform(value: Transform2D) - } - /** Texture provided by a [CameraFeed]. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_cameratexture.html - */ - class CameraTexture extends Texture2D { - constructor(identifier?: any) - /** The ID of the [CameraFeed] for which we want to display the image. */ - get camera_feed_id(): int64 - set camera_feed_id(value: int64) - - /** Which image within the [CameraFeed] we want access to, important if the camera image is split in a Y and CbCr component. */ - get which_feed(): int64 - set which_feed(value: int64) - - /** Convenience property that gives access to the active property of the [CameraFeed]. */ - get camera_is_active(): boolean - set camera_is_active(value: boolean) - } - /** Merges several 2D nodes into a single draw operation. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_canvasgroup.html - */ - class CanvasGroup extends Node2D { - constructor(identifier?: any) - /** Sets the size of a margin used to expand the drawable rect of this [CanvasGroup]. The size of the [CanvasGroup] is determined by fitting a rect around its children then expanding that rect by [member fit_margin]. This increases both the backbuffer area used and the area covered by the [CanvasGroup] both of which can reduce performance. This should be kept as small as possible and should only be expanded when an increased size is needed (e.g. for custom shader effects). */ - get fit_margin(): float64 - set fit_margin(value: float64) - - /** Sets the size of the margin used to expand the clearing rect of this [CanvasGroup]. This expands the area of the backbuffer that will be used by the [CanvasGroup]. A smaller margin will reduce the area of the backbuffer used which can increase performance, however if [member use_mipmaps] is enabled, a small margin may result in mipmap errors at the edge of the [CanvasGroup]. Accordingly, this should be left as small as possible, but should be increased if artifacts appear along the edges of the canvas group. */ - get clear_margin(): float64 - set clear_margin(value: float64) - - /** If `true`, calculates mipmaps for the backbuffer before drawing the [CanvasGroup] so that mipmaps can be used in a custom [ShaderMaterial] attached to the [CanvasGroup]. Generating mipmaps has a performance cost so this should not be enabled unless required. */ - get use_mipmaps(): boolean - set use_mipmaps(value: boolean) - } - namespace CanvasItem { - enum TextureFilter { - /** The [CanvasItem] will inherit the filter from its parent. */ - TEXTURE_FILTER_PARENT_NODE = 0, - - /** The texture filter reads from the nearest pixel only. This makes the texture look pixelated from up close, and grainy from a distance (due to mipmaps not being sampled). */ - TEXTURE_FILTER_NEAREST = 1, - - /** The texture filter blends between the nearest 4 pixels. This makes the texture look smooth from up close, and grainy from a distance (due to mipmaps not being sampled). */ - TEXTURE_FILTER_LINEAR = 2, - - /** The texture filter reads from the nearest pixel and blends between the nearest 2 mipmaps (or uses the nearest mipmap if [member ProjectSettings.rendering/textures/default_filters/use_nearest_mipmap_filter] is `true`). This makes the texture look pixelated from up close, and smooth from a distance. - * Use this for non-pixel art textures that may be viewed at a low scale (e.g. due to [Camera2D] zoom or sprite scaling), as mipmaps are important to smooth out pixels that are smaller than on-screen pixels. - */ - TEXTURE_FILTER_NEAREST_WITH_MIPMAPS = 3, - - /** The texture filter blends between the nearest 4 pixels and between the nearest 2 mipmaps (or uses the nearest mipmap if [member ProjectSettings.rendering/textures/default_filters/use_nearest_mipmap_filter] is `true`). This makes the texture look smooth from up close, and smooth from a distance. - * Use this for non-pixel art textures that may be viewed at a low scale (e.g. due to [Camera2D] zoom or sprite scaling), as mipmaps are important to smooth out pixels that are smaller than on-screen pixels. - */ - TEXTURE_FILTER_LINEAR_WITH_MIPMAPS = 4, - - /** The texture filter reads from the nearest pixel and blends between 2 mipmaps (or uses the nearest mipmap if [member ProjectSettings.rendering/textures/default_filters/use_nearest_mipmap_filter] is `true`) based on the angle between the surface and the camera view. This makes the texture look pixelated from up close, and smooth from a distance. Anisotropic filtering improves texture quality on surfaces that are almost in line with the camera, but is slightly slower. The anisotropic filtering level can be changed by adjusting [member ProjectSettings.rendering/textures/default_filters/anisotropic_filtering_level]. - * - * **Note:** This texture filter is rarely useful in 2D projects. [constant TEXTURE_FILTER_NEAREST_WITH_MIPMAPS] is usually more appropriate in this case. - */ - TEXTURE_FILTER_NEAREST_WITH_MIPMAPS_ANISOTROPIC = 5, - - /** The texture filter blends between the nearest 4 pixels and blends between 2 mipmaps (or uses the nearest mipmap if [member ProjectSettings.rendering/textures/default_filters/use_nearest_mipmap_filter] is `true`) based on the angle between the surface and the camera view. This makes the texture look smooth from up close, and smooth from a distance. Anisotropic filtering improves texture quality on surfaces that are almost in line with the camera, but is slightly slower. The anisotropic filtering level can be changed by adjusting [member ProjectSettings.rendering/textures/default_filters/anisotropic_filtering_level]. - * - * **Note:** This texture filter is rarely useful in 2D projects. [constant TEXTURE_FILTER_LINEAR_WITH_MIPMAPS] is usually more appropriate in this case. - */ - TEXTURE_FILTER_LINEAR_WITH_MIPMAPS_ANISOTROPIC = 6, - - /** Represents the size of the [enum TextureFilter] enum. */ - TEXTURE_FILTER_MAX = 7, - } - enum TextureRepeat { - /** The [CanvasItem] will inherit the filter from its parent. */ - TEXTURE_REPEAT_PARENT_NODE = 0, - - /** Texture will not repeat. */ - TEXTURE_REPEAT_DISABLED = 1, - - /** Texture will repeat normally. */ - TEXTURE_REPEAT_ENABLED = 2, - - /** Texture will repeat in a 2×2 tiled mode, where elements at even positions are mirrored. */ - TEXTURE_REPEAT_MIRROR = 3, - - /** Represents the size of the [enum TextureRepeat] enum. */ - TEXTURE_REPEAT_MAX = 4, - } - enum ClipChildrenMode { - /** Child draws over parent and is not clipped. */ - CLIP_CHILDREN_DISABLED = 0, - - /** Parent is used for the purposes of clipping only. Child is clipped to the parent's visible area, parent is not drawn. */ - CLIP_CHILDREN_ONLY = 1, - - /** Parent is used for clipping child, but parent is also drawn underneath child as normal before clipping child to its visible area. */ - CLIP_CHILDREN_AND_DRAW = 2, - - /** Represents the size of the [enum ClipChildrenMode] enum. */ - CLIP_CHILDREN_MAX = 3, - } - } - /** Abstract base class for everything in 2D space. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_canvasitem.html - */ - class CanvasItem extends Node { - /** The [CanvasItem]'s global transform has changed. This notification is only received if enabled by [method set_notify_transform]. */ - static readonly NOTIFICATION_TRANSFORM_CHANGED = 2000 - - /** The [CanvasItem]'s local transform has changed. This notification is only received if enabled by [method set_notify_local_transform]. */ - static readonly NOTIFICATION_LOCAL_TRANSFORM_CHANGED = 35 - - /** The [CanvasItem] is requested to draw (see [method _draw]). */ - static readonly NOTIFICATION_DRAW = 30 - - /** The [CanvasItem]'s visibility has changed. */ - static readonly NOTIFICATION_VISIBILITY_CHANGED = 31 - - /** The [CanvasItem] has entered the canvas. */ - static readonly NOTIFICATION_ENTER_CANVAS = 32 - - /** The [CanvasItem] has exited the canvas. */ - static readonly NOTIFICATION_EXIT_CANVAS = 33 - - /** The [CanvasItem]'s active [World2D] changed. */ - static readonly NOTIFICATION_WORLD_2D_CHANGED = 36 - constructor(identifier?: any) - - /** Called when [CanvasItem] has been requested to redraw (after [method queue_redraw] is called, either manually or by the engine). - * Corresponds to the [constant NOTIFICATION_DRAW] notification in [method Object._notification]. - */ - /* gdvirtual */ _draw(): void - _top_level_raise_self(): void - _edit_set_state(state: GDictionary): void - _edit_get_state(): GDictionary - _edit_set_position(position: Vector2): void - _edit_get_position(): Vector2 - _edit_set_scale(scale: Vector2): void - _edit_get_scale(): Vector2 - _edit_set_rect(rect: Rect2): void - _edit_get_rect(): Rect2 - _edit_use_rect(): boolean - _edit_set_rotation(degrees: float64): void - _edit_get_rotation(): float64 - _edit_use_rotation(): boolean - _edit_set_pivot(pivot: Vector2): void - _edit_get_pivot(): Vector2 - _edit_use_pivot(): boolean - _edit_get_transform(): Transform2D - - /** Returns the canvas item RID used by [RenderingServer] for this item. */ - get_canvas_item(): RID - - /** Returns `true` if the node is present in the [SceneTree], its [member visible] property is `true` and all its ancestors are also visible. If any ancestor is hidden, this node will not be visible in the scene tree, and is therefore not drawn (see [method _draw]). - * Visibility is checked only in parent nodes that inherit from [CanvasItem], [CanvasLayer], and [Window]. If the parent is of any other type (such as [Node], [AnimationPlayer], or [Node3D]), it is assumed to be visible. - */ - is_visible_in_tree(): boolean - - /** Show the [CanvasItem] if it's currently hidden. This is equivalent to setting [member visible] to `true`. For controls that inherit [Popup], the correct way to make them visible is to call one of the multiple `popup*()` functions instead. */ - show(): void - - /** Hide the [CanvasItem] if it's currently visible. This is equivalent to setting [member visible] to `false`. */ - hide(): void - - /** Queues the [CanvasItem] to redraw. During idle time, if [CanvasItem] is visible, [constant NOTIFICATION_DRAW] is sent and [method _draw] is called. This only occurs **once** per frame, even if this method has been called multiple times. */ - queue_redraw(): void - - /** Moves this node to display on top of its siblings. - * Internally, the node is moved to the bottom of parent's child list. The method has no effect on nodes without a parent. - */ - move_to_front(): void - - /** Draws a line from a 2D point to another, with a given color and width. It can be optionally antialiased. See also [method draw_multiline] and [method draw_polyline]. - * If [param width] is negative, then a two-point primitive will be drawn instead of a four-point one. This means that when the CanvasItem is scaled, the line will remain thin. If this behavior is not desired, then pass a positive [param width] like `1.0`. - */ - draw_line(from: Vector2, to: Vector2, color: Color, width: float64 = -1, antialiased: boolean = false): void - - /** Draws a dashed line from a 2D point to another, with a given color and width. See also [method draw_multiline] and [method draw_polyline]. - * If [param width] is negative, then a two-point primitives will be drawn instead of a four-point ones. This means that when the CanvasItem is scaled, the line parts will remain thin. If this behavior is not desired, then pass a positive [param width] like `1.0`. - * If [param antialiased] is `true`, half transparent "feathers" will be attached to the boundary, making outlines smooth. - * - * **Note:** [param antialiased] is only effective if [param width] is greater than `0.0`. - */ - draw_dashed_line(from: Vector2, to: Vector2, color: Color, width: float64 = -1, dash: float64 = 2, aligned: boolean = true, antialiased: boolean = false): void - - /** Draws interconnected line segments with a uniform [param color] and [param width] and optional antialiasing (supported only for positive [param width]). When drawing large amounts of lines, this is faster than using individual [method draw_line] calls. To draw disconnected lines, use [method draw_multiline] instead. See also [method draw_polygon]. - * If [param width] is negative, it will be ignored and the polyline will be drawn using [constant RenderingServer.PRIMITIVE_LINE_STRIP]. This means that when the CanvasItem is scaled, the polyline will remain thin. If this behavior is not desired, then pass a positive [param width] like `1.0`. - */ - draw_polyline(points: PackedVector2Array | Vector2[], color: Color, width: float64 = -1, antialiased: boolean = false): void - - /** Draws interconnected line segments with a uniform [param width], point-by-point coloring, and optional antialiasing (supported only for positive [param width]). Colors assigned to line points match by index between [param points] and [param colors], i.e. each line segment is filled with a gradient between the colors of the endpoints. When drawing large amounts of lines, this is faster than using individual [method draw_line] calls. To draw disconnected lines, use [method draw_multiline_colors] instead. See also [method draw_polygon]. - * If [param width] is negative, it will be ignored and the polyline will be drawn using [constant RenderingServer.PRIMITIVE_LINE_STRIP]. This means that when the CanvasItem is scaled, the polyline will remain thin. If this behavior is not desired, then pass a positive [param width] like `1.0`. - */ - draw_polyline_colors(points: PackedVector2Array | Vector2[], colors: PackedColorArray | Color[], width: float64 = -1, antialiased: boolean = false): void - - /** Draws an unfilled arc between the given angles with a uniform [param color] and [param width] and optional antialiasing (supported only for positive [param width]). The larger the value of [param point_count], the smoother the curve. See also [method draw_circle]. - * If [param width] is negative, it will be ignored and the arc will be drawn using [constant RenderingServer.PRIMITIVE_LINE_STRIP]. This means that when the CanvasItem is scaled, the arc will remain thin. If this behavior is not desired, then pass a positive [param width] like `1.0`. - * The arc is drawn from [param start_angle] towards the value of [param end_angle] so in clockwise direction if `start_angle < end_angle` and counter-clockwise otherwise. Passing the same angles but in reversed order will produce the same arc. If absolute difference of [param start_angle] and [param end_angle] is greater than [constant @GDScript.TAU] radians, then a full circle arc is drawn (i.e. arc will not overlap itself). - */ - draw_arc(center: Vector2, radius: float64, start_angle: float64, end_angle: float64, point_count: int64, color: Color, width: float64 = -1, antialiased: boolean = false): void - - /** Draws multiple disconnected lines with a uniform [param width] and [param color]. Each line is defined by two consecutive points from [param points] array, i.e. i-th segment consists of `points[2 * i]`, `points[2 * i + 1]` endpoints. When drawing large amounts of lines, this is faster than using individual [method draw_line] calls. To draw interconnected lines, use [method draw_polyline] instead. - * If [param width] is negative, then two-point primitives will be drawn instead of a four-point ones. This means that when the CanvasItem is scaled, the lines will remain thin. If this behavior is not desired, then pass a positive [param width] like `1.0`. - * - * **Note:** [param antialiased] is only effective if [param width] is greater than `0.0`. - */ - draw_multiline(points: PackedVector2Array | Vector2[], color: Color, width: float64 = -1, antialiased: boolean = false): void - - /** Draws multiple disconnected lines with a uniform [param width] and segment-by-segment coloring. Each segment is defined by two consecutive points from [param points] array and a corresponding color from [param colors] array, i.e. i-th segment consists of `points[2 * i]`, `points[2 * i + 1]` endpoints and has `colors *` color. When drawing large amounts of lines, this is faster than using individual [method draw_line] calls. To draw interconnected lines, use [method draw_polyline_colors] instead. - * If [param width] is negative, then two-point primitives will be drawn instead of a four-point ones. This means that when the CanvasItem is scaled, the lines will remain thin. If this behavior is not desired, then pass a positive [param width] like `1.0`. - * - * **Note:** [param antialiased] is only effective if [param width] is greater than `0.0`. - */ - draw_multiline_colors(points: PackedVector2Array | Vector2[], colors: PackedColorArray | Color[], width: float64 = -1, antialiased: boolean = false): void - - /** Draws a rectangle. If [param filled] is `true`, the rectangle will be filled with the [param color] specified. If [param filled] is `false`, the rectangle will be drawn as a stroke with the [param color] and [param width] specified. See also [method draw_texture_rect]. - * If [param width] is negative, then two-point primitives will be drawn instead of a four-point ones. This means that when the CanvasItem is scaled, the lines will remain thin. If this behavior is not desired, then pass a positive [param width] like `1.0`. - * If [param antialiased] is `true`, half transparent "feathers" will be attached to the boundary, making outlines smooth. - * - * **Note:** [param width] is only effective if [param filled] is `false`. - * - * **Note:** Unfilled rectangles drawn with a negative [param width] may not display perfectly. For example, corners may be missing or brighter due to overlapping lines (for a translucent [param color]). - */ - draw_rect(rect: Rect2, color: Color, filled: boolean = true, width: float64 = -1, antialiased: boolean = false): void - - /** Draws a circle. See also [method draw_arc], [method draw_polyline], and [method draw_polygon]. - * If [param filled] is `true`, the circle will be filled with the [param color] specified. If [param filled] is `false`, the circle will be drawn as a stroke with the [param color] and [param width] specified. - * If [param width] is negative, then two-point primitives will be drawn instead of a four-point ones. This means that when the CanvasItem is scaled, the lines will remain thin. If this behavior is not desired, then pass a positive [param width] like `1.0`. - * If [param antialiased] is `true`, half transparent "feathers" will be attached to the boundary, making outlines smooth. - * - * **Note:** [param width] is only effective if [param filled] is `false`. - */ - draw_circle(position: Vector2, radius: float64, color: Color, filled: boolean = true, width: float64 = -1, antialiased: boolean = false): void - - /** Draws a texture at a given position. */ - draw_texture(texture: Texture2D, position: Vector2, modulate: Color = new Color(1, 1, 1, 1)): void - - /** Draws a textured rectangle at a given position, optionally modulated by a color. If [param transpose] is `true`, the texture will have its X and Y coordinates swapped. See also [method draw_rect] and [method draw_texture_rect_region]. */ - draw_texture_rect(texture: Texture2D, rect: Rect2, tile: boolean, modulate: Color = new Color(1, 1, 1, 1), transpose: boolean = false): void - - /** Draws a textured rectangle from a texture's region (specified by [param src_rect]) at a given position, optionally modulated by a color. If [param transpose] is `true`, the texture will have its X and Y coordinates swapped. See also [method draw_texture_rect]. */ - draw_texture_rect_region(texture: Texture2D, rect: Rect2, src_rect: Rect2, modulate: Color = new Color(1, 1, 1, 1), transpose: boolean = false, clip_uv: boolean = true): void - - /** Draws a textured rectangle region of the multi-channel signed distance field texture at a given position, optionally modulated by a color. See [member FontFile.multichannel_signed_distance_field] for more information and caveats about MSDF font rendering. - * If [param outline] is positive, each alpha channel value of pixel in region is set to maximum value of true distance in the [param outline] radius. - * Value of the [param pixel_range] should the same that was used during distance field texture generation. - */ - draw_msdf_texture_rect_region(texture: Texture2D, rect: Rect2, src_rect: Rect2, modulate: Color = new Color(1, 1, 1, 1), outline: float64 = 0, pixel_range: float64 = 4, scale: float64 = 1): void - - /** Draws a textured rectangle region of the font texture with LCD subpixel anti-aliasing at a given position, optionally modulated by a color. - * Texture is drawn using the following blend operation, blend mode of the [CanvasItemMaterial] is ignored: - * - */ - draw_lcd_texture_rect_region(texture: Texture2D, rect: Rect2, src_rect: Rect2, modulate: Color = new Color(1, 1, 1, 1)): void - - /** Draws a styled rectangle. */ - draw_style_box(style_box: StyleBox, rect: Rect2): void - - /** Draws a custom primitive. 1 point for a point, 2 points for a line, 3 points for a triangle, and 4 points for a quad. If 0 points or more than 4 points are specified, nothing will be drawn and an error message will be printed. See also [method draw_line], [method draw_polyline], [method draw_polygon], and [method draw_rect]. */ - draw_primitive(points: PackedVector2Array | Vector2[], colors: PackedColorArray | Color[], uvs: PackedVector2Array | Vector2[], texture: Texture2D = undefined): void - - /** Draws a solid polygon of any number of points, convex or concave. Unlike [method draw_colored_polygon], each point's color can be changed individually. See also [method draw_polyline] and [method draw_polyline_colors]. If you need more flexibility (such as being able to use bones), use [method RenderingServer.canvas_item_add_triangle_array] instead. */ - draw_polygon(points: PackedVector2Array | Vector2[], colors: PackedColorArray | Color[], uvs: PackedVector2Array | Vector2[] = [], texture: Texture2D = undefined): void - - /** Draws a colored polygon of any number of points, convex or concave. Unlike [method draw_polygon], a single color must be specified for the whole polygon. */ - draw_colored_polygon(points: PackedVector2Array | Vector2[], color: Color, uvs: PackedVector2Array | Vector2[] = [], texture: Texture2D = undefined): void - - /** Draws [param text] using the specified [param font] at the [param pos] (bottom-left corner using the baseline of the font). The text will have its color multiplied by [param modulate]. If [param width] is greater than or equal to 0, the text will be clipped if it exceeds the specified width. - * **Example using the default project font:** - * - * See also [method Font.draw_string]. - */ - draw_string(font: Font, pos: Vector2, text: string, alignment: HorizontalAlignment = 0, width: float64 = -1, font_size: int64 = 16, modulate: Color = new Color(1, 1, 1, 1), justification_flags: TextServer.JustificationFlag = 3, direction: TextServer.Direction = 0, orientation: TextServer.Orientation = 0): void - - /** Breaks [param text] into lines and draws it using the specified [param font] at the [param pos] (top-left corner). The text will have its color multiplied by [param modulate]. If [param width] is greater than or equal to 0, the text will be clipped if it exceeds the specified width. */ - draw_multiline_string(font: Font, pos: Vector2, text: string, alignment: HorizontalAlignment = 0, width: float64 = -1, font_size: int64 = 16, max_lines: int64 = -1, modulate: Color = new Color(1, 1, 1, 1), brk_flags: TextServer.LineBreakFlag = 3, justification_flags: TextServer.JustificationFlag = 3, direction: TextServer.Direction = 0, orientation: TextServer.Orientation = 0): void - - /** Draws [param text] outline using the specified [param font] at the [param pos] (bottom-left corner using the baseline of the font). The text will have its color multiplied by [param modulate]. If [param width] is greater than or equal to 0, the text will be clipped if it exceeds the specified width. */ - draw_string_outline(font: Font, pos: Vector2, text: string, alignment: HorizontalAlignment = 0, width: float64 = -1, font_size: int64 = 16, size: int64 = 1, modulate: Color = new Color(1, 1, 1, 1), justification_flags: TextServer.JustificationFlag = 3, direction: TextServer.Direction = 0, orientation: TextServer.Orientation = 0): void - - /** Breaks [param text] to the lines and draws text outline using the specified [param font] at the [param pos] (top-left corner). The text will have its color multiplied by [param modulate]. If [param width] is greater than or equal to 0, the text will be clipped if it exceeds the specified width. */ - draw_multiline_string_outline(font: Font, pos: Vector2, text: string, alignment: HorizontalAlignment = 0, width: float64 = -1, font_size: int64 = 16, max_lines: int64 = -1, size: int64 = 1, modulate: Color = new Color(1, 1, 1, 1), brk_flags: TextServer.LineBreakFlag = 3, justification_flags: TextServer.JustificationFlag = 3, direction: TextServer.Direction = 0, orientation: TextServer.Orientation = 0): void - - /** Draws a string first character using a custom font. */ - draw_char(font: Font, pos: Vector2, char: string, font_size: int64 = 16, modulate: Color = new Color(1, 1, 1, 1)): void - - /** Draws a string first character outline using a custom font. */ - draw_char_outline(font: Font, pos: Vector2, char: string, font_size: int64 = 16, size: int64 = -1, modulate: Color = new Color(1, 1, 1, 1)): void - - /** Draws a [Mesh] in 2D, using the provided texture. See [MeshInstance2D] for related documentation. */ - draw_mesh(mesh: Mesh, texture: Texture2D, transform: Transform2D = new Transform2D(), modulate: Color = new Color(1, 1, 1, 1)): void - - /** Draws a [MultiMesh] in 2D with the provided texture. See [MultiMeshInstance2D] for related documentation. */ - draw_multimesh(multimesh: MultiMesh, texture: Texture2D): void - - /** Sets a custom transform for drawing via components. Anything drawn afterwards will be transformed by this. - * - * **Note:** [member FontFile.oversampling] does *not* take [param scale] into account. This means that scaling up/down will cause bitmap fonts and rasterized (non-MSDF) dynamic fonts to appear blurry or pixelated. To ensure text remains crisp regardless of scale, you can enable MSDF font rendering by enabling [member ProjectSettings.gui/theme/default_font_multichannel_signed_distance_field] (applies to the default project font only), or enabling **Multichannel Signed Distance Field** in the import options of a DynamicFont for custom fonts. On system fonts, [member SystemFont.multichannel_signed_distance_field] can be enabled in the inspector. - */ - draw_set_transform(position: Vector2, rotation: float64 = 0, scale: Vector2 = Vector2.ONE): void - - /** Sets a custom transform for drawing via matrix. Anything drawn afterwards will be transformed by this. */ - draw_set_transform_matrix(xform: Transform2D): void - - /** Subsequent drawing commands will be ignored unless they fall within the specified animation slice. This is a faster way to implement animations that loop on background rather than redrawing constantly. */ - draw_animation_slice(animation_length: float64, slice_begin: float64, slice_end: float64, offset: float64 = 0): void - - /** After submitting all animations slices via [method draw_animation_slice], this function can be used to revert drawing to its default state (all subsequent drawing commands will be visible). If you don't care about this particular use case, usage of this function after submitting the slices is not required. */ - draw_end_animation(): void - - /** Returns the transform matrix of this item. */ - get_transform(): Transform2D - - /** Returns the global transform matrix of this item, i.e. the combined transform up to the topmost [CanvasItem] node. The topmost item is a [CanvasItem] that either has no parent, has non-[CanvasItem] parent or it has [member top_level] enabled. */ - get_global_transform(): Transform2D - - /** Returns the transform from the local coordinate system of this [CanvasItem] to the [Viewport]s coordinate system. */ - get_global_transform_with_canvas(): Transform2D - - /** Returns the transform from the coordinate system of the canvas, this item is in, to the [Viewport]s embedders coordinate system. */ - get_viewport_transform(): Transform2D - - /** Returns the viewport's boundaries as a [Rect2]. */ - get_viewport_rect(): Rect2 - - /** Returns the transform from the coordinate system of the canvas, this item is in, to the [Viewport]s coordinate system. */ - get_canvas_transform(): Transform2D - - /** Returns the transform of this [CanvasItem] in global screen coordinates (i.e. taking window position into account). Mostly useful for editor plugins. - * Equals to [method get_global_transform] if the window is embedded (see [member Viewport.gui_embed_subwindows]). - */ - get_screen_transform(): Transform2D - - /** Returns the mouse's position in this [CanvasItem] using the local coordinate system of this [CanvasItem]. */ - get_local_mouse_position(): Vector2 - - /** Returns the mouse's position in the [CanvasLayer] that this [CanvasItem] is in using the coordinate system of the [CanvasLayer]. - * - * **Note:** For screen-space coordinates (e.g. when using a non-embedded [Popup]), you can use [method DisplayServer.mouse_get_position]. - */ - get_global_mouse_position(): Vector2 - - /** Returns the [RID] of the [World2D] canvas where this item is in. */ - get_canvas(): RID - - /** Returns the [CanvasLayer] that contains this node, or `null` if the node is not in any [CanvasLayer]. */ - get_canvas_layer_node(): CanvasLayer - - /** Returns the [World2D] where this item is in. */ - get_world_2d(): World2D - - /** If [param enable] is `true`, this node will receive [constant NOTIFICATION_LOCAL_TRANSFORM_CHANGED] when its local transform changes. */ - set_notify_local_transform(enable: boolean): void - - /** Returns `true` if local transform notifications are communicated to children. */ - is_local_transform_notification_enabled(): boolean - - /** If [param enable] is `true`, this node will receive [constant NOTIFICATION_TRANSFORM_CHANGED] when its global transform changes. */ - set_notify_transform(enable: boolean): void - - /** Returns `true` if global transform notifications are communicated to children. */ - is_transform_notification_enabled(): boolean - - /** Forces the transform to update. Transform changes in physics are not instant for performance reasons. Transforms are accumulated and then set. Use this if you need an up-to-date transform when doing physics operations. */ - force_update_transform(): void - - /** Assigns [param screen_point] as this node's new local transform. */ - make_canvas_position_local(screen_point: Vector2): Vector2 - - /** Transformations issued by [param event]'s inputs are applied in local space instead of global space. */ - make_input_local(event: InputEvent): InputEvent - - /** Set/clear individual bits on the rendering visibility layer. This simplifies editing this [CanvasItem]'s visibility layer. */ - set_visibility_layer_bit(layer: int64, enabled: boolean): void - - /** Returns an individual bit on the rendering visibility layer. */ - get_visibility_layer_bit(layer: int64): boolean - - /** If `true`, this [CanvasItem] is drawn. The node is only visible if all of its ancestors are visible as well (in other words, [method is_visible_in_tree] must return `true`). - * - * **Note:** For controls that inherit [Popup], the correct way to make them visible is to call one of the multiple `popup*()` functions instead. - */ - get visible(): boolean - set visible(value: boolean) - - /** The color applied to this [CanvasItem]. This property does affect child [CanvasItem]s, unlike [member self_modulate] which only affects the node itself. */ - get modulate(): Color - set modulate(value: Color) - - /** The color applied to this [CanvasItem]. This property does **not** affect child [CanvasItem]s, unlike [member modulate] which affects both the node itself and its children. - * - * **Note:** Internal children (e.g. sliders in [ColorPicker] or tab bar in [TabContainer]) are also not affected by this property (see `include_internal` parameter of [method Node.get_child] and other similar methods). - */ - get self_modulate(): Color - set self_modulate(value: Color) - - /** If `true`, the object draws behind its parent. */ - get show_behind_parent(): boolean - set show_behind_parent(value: boolean) - - /** If `true`, this [CanvasItem] will *not* inherit its transform from parent [CanvasItem]s. Its draw order will also be changed to make it draw on top of other [CanvasItem]s that do not have [member top_level] set to `true`. The [CanvasItem] will effectively act as if it was placed as a child of a bare [Node]. */ - get top_level(): boolean - set top_level(value: boolean) - - /** Allows the current node to clip child nodes, essentially acting as a mask. */ - get clip_children(): int64 - set clip_children(value: int64) - - /** The rendering layers in which this [CanvasItem] responds to [Light2D] nodes. */ - get light_mask(): int64 - set light_mask(value: int64) - - /** The rendering layer in which this [CanvasItem] is rendered by [Viewport] nodes. A [Viewport] will render a [CanvasItem] if it and all its parents share a layer with the [Viewport]'s canvas cull mask. */ - get visibility_layer(): int64 - set visibility_layer(value: int64) - - /** Controls the order in which the nodes render. A node with a higher Z index will display in front of others. Must be between [constant RenderingServer.CANVAS_ITEM_Z_MIN] and [constant RenderingServer.CANVAS_ITEM_Z_MAX] (inclusive). - * - * **Note:** Changing the Z index of a [Control] only affects the drawing order, not the order in which input events are handled. This can be useful to implement certain UI animations, e.g. a menu where hovered items are scaled and should overlap others. - */ - get z_index(): int64 - set z_index(value: int64) - - /** If `true`, the node's Z index is relative to its parent's Z index. If this node's Z index is 2 and its parent's effective Z index is 3, then this node's effective Z index will be 2 + 3 = 5. */ - get z_as_relative(): boolean - set z_as_relative(value: boolean) - - /** If `true`, this and child [CanvasItem] nodes with a higher Y position are rendered in front of nodes with a lower Y position. If `false`, this and child [CanvasItem] nodes are rendered normally in scene tree order. - * With Y-sorting enabled on a parent node ('A') but disabled on a child node ('B'), the child node ('B') is sorted but its children ('C1', 'C2', etc) render together on the same Y position as the child node ('B'). This allows you to organize the render order of a scene without changing the scene tree. - * Nodes sort relative to each other only if they are on the same [member z_index]. - */ - get y_sort_enabled(): boolean - set y_sort_enabled(value: boolean) - - /** The texture filtering mode to use on this [CanvasItem]. */ - get texture_filter(): int64 - set texture_filter(value: int64) - - /** The texture repeating mode to use on this [CanvasItem]. */ - get texture_repeat(): int64 - set texture_repeat(value: int64) - - /** The material applied to this [CanvasItem]. */ - get material(): CanvasItemMaterial | ShaderMaterial - set material(value: CanvasItemMaterial | ShaderMaterial) - - /** If `true`, the parent [CanvasItem]'s [member material] property is used as this one's material. */ - get use_parent_material(): boolean - set use_parent_material(value: boolean) - - /** Emitted when the [CanvasItem] must redraw, *after* the related [constant NOTIFICATION_DRAW] notification, and *before* [method _draw] is called. - * - * **Note:** Deferred connections do not allow drawing through the `draw_*` methods. - */ - readonly draw: Signal0 - - /** Emitted when the visibility (hidden/visible) changes. */ - readonly visibility_changed: Signal0 - - /** Emitted when becoming hidden. */ - readonly hidden: Signal0 - - /** Emitted when the item's [Rect2] boundaries (position or size) have changed, or when an action is taking place that may have impacted these boundaries (e.g. changing [member Sprite2D.texture]). */ - readonly item_rect_changed: Signal0 - } - class CanvasItemEditor extends VBoxContainer { - constructor(identifier?: any) - _get_editor_data(_unnamed_arg0: Object): Object - update_viewport(): void - center_at(position: Vector2): void - _set_owner_for_node_and_children(_unnamed_arg0: Node, _unnamed_arg1: Node): void - readonly item_lock_status_changed: Signal0 - readonly item_group_status_changed: Signal0 - } - class CanvasItemEditorPlugin extends EditorPlugin { - constructor(identifier?: any) - } - class CanvasItemEditorSelectedItem extends Object { - constructor(identifier?: any) - } - class CanvasItemEditorViewport extends Control { - constructor(identifier?: any) - } - namespace CanvasItemMaterial { - enum BlendMode { - /** Mix blending mode. Colors are assumed to be independent of the alpha (opacity) value. */ - BLEND_MODE_MIX = 0, - - /** Additive blending mode. */ - BLEND_MODE_ADD = 1, - - /** Subtractive blending mode. */ - BLEND_MODE_SUB = 2, - - /** Multiplicative blending mode. */ - BLEND_MODE_MUL = 3, - - /** Mix blending mode. Colors are assumed to be premultiplied by the alpha (opacity) value. */ - BLEND_MODE_PREMULT_ALPHA = 4, - } - enum LightMode { - /** Render the material using both light and non-light sensitive material properties. */ - LIGHT_MODE_NORMAL = 0, - - /** Render the material as if there were no light. */ - LIGHT_MODE_UNSHADED = 1, - - /** Render the material as if there were only light. */ - LIGHT_MODE_LIGHT_ONLY = 2, - } - } - /** A material for [CanvasItem]s. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_canvasitemmaterial.html - */ - class CanvasItemMaterial extends Material { - constructor(identifier?: any) - /** The manner in which a material's rendering is applied to underlying textures. */ - get blend_mode(): int64 - set blend_mode(value: int64) - - /** The manner in which material reacts to lighting. */ - get light_mode(): int64 - set light_mode(value: int64) - - /** If `true`, enable spritesheet-based animation features when assigned to [GPUParticles2D] and [CPUParticles2D] nodes. The [member ParticleProcessMaterial.anim_speed_max] or [member CPUParticles2D.anim_speed_max] should also be set to a positive value for the animation to play. - * This property (and other `particles_anim_*` properties that depend on it) has no effect on other types of nodes. - */ - get particles_animation(): boolean - set particles_animation(value: boolean) - - /** The number of columns in the spritesheet assigned as [Texture2D] for a [GPUParticles2D] or [CPUParticles2D]. - * - * **Note:** This property is only used and visible in the editor if [member particles_animation] is `true`. - */ - get particles_anim_h_frames(): int64 - set particles_anim_h_frames(value: int64) - - /** The number of rows in the spritesheet assigned as [Texture2D] for a [GPUParticles2D] or [CPUParticles2D]. - * - * **Note:** This property is only used and visible in the editor if [member particles_animation] is `true`. - */ - get particles_anim_v_frames(): int64 - set particles_anim_v_frames(value: int64) - - /** If `true`, the particles animation will loop. - * - * **Note:** This property is only used and visible in the editor if [member particles_animation] is `true`. - */ - get particles_anim_loop(): boolean - set particles_anim_loop(value: boolean) - } - class CanvasItemMaterialConversionPlugin extends EditorResourceConversionPlugin { - constructor(identifier?: any) - } - /** A node used for independent rendering of objects within a 2D scene. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_canvaslayer.html - */ - class CanvasLayer extends Node { - constructor(identifier?: any) - /** Shows any [CanvasItem] under this [CanvasLayer]. This is equivalent to setting [member visible] to `true`. */ - show(): void - - /** Hides any [CanvasItem] under this [CanvasLayer]. This is equivalent to setting [member visible] to `false`. */ - hide(): void - - /** Returns the transform from the [CanvasLayer]s coordinate system to the [Viewport]s coordinate system. */ - get_final_transform(): Transform2D - - /** Returns the RID of the canvas used by this layer. */ - get_canvas(): RID - - /** Layer index for draw order. Lower values are drawn behind higher values. - * - * **Note:** If multiple CanvasLayers have the same layer index, [CanvasItem] children of one CanvasLayer are drawn behind the [CanvasItem] children of the other CanvasLayer. Which CanvasLayer is drawn in front is non-deterministic. - */ - get layer(): int64 - set layer(value: int64) - - /** If `false`, any [CanvasItem] under this [CanvasLayer] will be hidden. - * Unlike [member CanvasItem.visible], visibility of a [CanvasLayer] isn't propagated to underlying layers. - */ - get visible(): boolean - set visible(value: boolean) - - /** The layer's base offset. */ - get offset(): Vector2 - set offset(value: Vector2) - - /** The layer's rotation in radians. */ - get rotation(): float64 - set rotation(value: float64) - - /** The layer's scale. */ - get scale(): Vector2 - set scale(value: Vector2) - - /** The layer's transform. */ - get transform(): Transform2D - set transform(value: Transform2D) - - /** The custom [Viewport] node assigned to the [CanvasLayer]. If `null`, uses the default viewport instead. */ - get custom_viewport(): Viewport - set custom_viewport(value: Viewport) - - /** If enabled, the [CanvasLayer] will use the viewport's transform, so it will move when camera moves instead of being anchored in a fixed position on the screen. - * Together with [member follow_viewport_scale] it can be used for a pseudo 3D effect. - */ - get follow_viewport_enabled(): boolean - set follow_viewport_enabled(value: boolean) - - /** Scales the layer when using [member follow_viewport_enabled]. Layers moving into the foreground should have increasing scales, while layers moving into the background should have decreasing scales. */ - get follow_viewport_scale(): float64 - set follow_viewport_scale(value: float64) - - /** Emitted when visibility of the layer is changed. See [member visible]. */ - readonly visibility_changed: Signal0 - } - /** A node that applies a color tint to a canvas. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_canvasmodulate.html - */ - class CanvasModulate extends Node2D { - constructor(identifier?: any) - /** The tint color to apply. */ - get color(): Color - set color(value: Color) - } - /** Texture with optional normal and specular maps for use in 2D rendering. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_canvastexture.html - */ - class CanvasTexture extends Texture2D { - constructor(identifier?: any) - /** The diffuse (color) texture to use. This is the main texture you want to set in most cases. */ - get diffuse_texture(): Texture2D - set diffuse_texture(value: Texture2D) - - /** The normal map texture to use. Only has a visible effect if [Light2D]s are affecting this [CanvasTexture]. - * - * **Note:** Godot expects the normal map to use X+, Y+, and Z+ coordinates. See [url=http://wiki.polycount.com/wiki/Normal_Map_Technical_Details#Common_Swizzle_Coordinates]this page[/url] for a comparison of normal map coordinates expected by popular engines. - */ - get normal_texture(): Texture2D - set normal_texture(value: Texture2D) - - /** The specular map to use for [Light2D] specular reflections. This should be a grayscale or colored texture, with brighter areas resulting in a higher [member specular_shininess] value. Using a colored [member specular_texture] allows controlling specular shininess on a per-channel basis. Only has a visible effect if [Light2D]s are affecting this [CanvasTexture]. */ - get specular_texture(): Texture2D - set specular_texture(value: Texture2D) - - /** The multiplier for specular reflection colors. The [Light2D]'s color is also taken into account when determining the reflection color. Only has a visible effect if [Light2D]s are affecting this [CanvasTexture]. */ - get specular_color(): Color - set specular_color(value: Color) - - /** The specular exponent for [Light2D] specular reflections. Higher values result in a more glossy/"wet" look, with reflections becoming more localized and less visible overall. The default value of `1.0` disables specular reflections entirely. Only has a visible effect if [Light2D]s are affecting this [CanvasTexture]. */ - get specular_shininess(): float64 - set specular_shininess(value: float64) - - /** The texture filtering mode to use when drawing this [CanvasTexture]. */ - get texture_filter(): int64 - set texture_filter(value: int64) - - /** The texture repeat mode to use when drawing this [CanvasTexture]. */ - get texture_repeat(): int64 - set texture_repeat(value: int64) - } - /** Class representing a capsule-shaped [PrimitiveMesh]. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_capsulemesh.html - */ - class CapsuleMesh extends PrimitiveMesh { - constructor(identifier?: any) - /** Radius of the capsule mesh. */ - get radius(): float64 - set radius(value: float64) - - /** Total height of the capsule mesh (including the hemispherical ends). */ - get height(): float64 - set height(value: float64) - - /** Number of radial segments on the capsule mesh. */ - get radial_segments(): int64 - set radial_segments(value: int64) - - /** Number of rings along the height of the capsule. */ - get rings(): int64 - set rings(value: int64) - } - /** A 2D capsule shape used for physics collision. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_capsuleshape2d.html - */ - class CapsuleShape2D extends Shape2D { - constructor(identifier?: any) - /** The capsule's radius. */ - get radius(): float64 - set radius(value: float64) - - /** The capsule's height. */ - get height(): float64 - set height(value: float64) - } - /** A 3D capsule shape used for physics collision. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_capsuleshape3d.html - */ - class CapsuleShape3D extends Shape3D { - constructor(identifier?: any) - /** The capsule's radius. */ - get radius(): float64 - set radius(value: float64) - - /** The capsule's height. */ - get height(): float64 - set height(value: float64) - } - class Cast2DEditor extends Control { - constructor(identifier?: any) - } - class Cast2DEditorPlugin extends EditorPlugin { - constructor(identifier?: any) - } - /** A container that keeps child controls in its center. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_centercontainer.html - */ - class CenterContainer extends Container { - constructor(identifier?: any) - /** If `true`, centers children relative to the [CenterContainer]'s top left corner. */ - get use_top_left(): boolean - set use_top_left(value: boolean) - } - /** Controls how an individual character will be displayed in a [RichTextEffect]. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_charfxtransform.html - */ - class CharFXTransform extends RefCounted { - constructor(identifier?: any) - /** The current transform of the current glyph. It can be overridden (for example, by driving the position and rotation from a curve). You can also alter the existing value to apply transforms on top of other effects. */ - get transform(): Transform2D - set transform(value: Transform2D) - - /** Absolute character range in the string, corresponding to the glyph. Setting this property won't affect drawing. */ - get range(): Vector2i - set range(value: Vector2i) - - /** The time elapsed since the [RichTextLabel] was added to the scene tree (in seconds). Time stops when the [RichTextLabel] is paused (see [member Node.process_mode]). Resets when the text in the [RichTextLabel] is changed. - * - * **Note:** Time still passes while the [RichTextLabel] is hidden. - */ - get elapsed_time(): float64 - set elapsed_time(value: float64) - - /** If `true`, the character will be drawn. If `false`, the character will be hidden. Characters around hidden characters will reflow to take the space of hidden characters. If this is not desired, set their [member color] to `Color(1, 1, 1, 0)` instead. */ - get visible(): boolean - set visible(value: boolean) - - /** If `true`, FX transform is called for outline drawing. Setting this property won't affect drawing. */ - get outline(): boolean - set outline(value: boolean) - - /** The position offset the character will be drawn with (in pixels). */ - get offset(): Vector2 - set offset(value: Vector2) - - /** The color the character will be drawn with. */ - get color(): Color - set color(value: Color) - - /** Contains the arguments passed in the opening BBCode tag. By default, arguments are strings; if their contents match a type such as [bool], [int] or [float], they will be converted automatically. Color codes in the form `#rrggbb` or `#rgb` will be converted to an opaque [Color]. String arguments may not contain spaces, even if they're quoted. If present, quotes will also be present in the final string. - * For example, the opening BBCode tag `[example foo=hello bar=true baz=42 color=#ffffff]` will map to the following [Dictionary]: - * - */ - get env(): GDictionary - set env(value: GDictionary) - - /** Font specific glyph index. */ - get glyph_index(): int64 - set glyph_index(value: int64) - - /** Number of glyphs in the grapheme cluster. This value is set in the first glyph of a cluster. Setting this property won't affect drawing. */ - get glyph_count(): int64 - set glyph_count(value: int64) - - /** Glyph flags. See [enum TextServer.GraphemeFlag] for more info. Setting this property won't affect drawing. */ - get glyph_flags(): int64 - set glyph_flags(value: int64) - - /** The character offset of the glyph, relative to the current [RichTextEffect] custom block. Setting this property won't affect drawing. */ - get relative_index(): int64 - set relative_index(value: int64) - - /** Font resource used to render glyph. */ - get font(): RID - set font(value: RID) - } - namespace CharacterBody2D { - enum MotionMode { - /** Apply when notions of walls, ceiling and floor are relevant. In this mode the body motion will react to slopes (acceleration/slowdown). This mode is suitable for sided games like platformers. */ - MOTION_MODE_GROUNDED = 0, - - /** Apply when there is no notion of floor or ceiling. All collisions will be reported as `on_wall`. In this mode, when you slide, the speed will always be constant. This mode is suitable for top-down games. */ - MOTION_MODE_FLOATING = 1, - } - enum PlatformOnLeave { - /** Add the last platform velocity to the [member velocity] when you leave a moving platform. */ - PLATFORM_ON_LEAVE_ADD_VELOCITY = 0, - - /** Add the last platform velocity to the [member velocity] when you leave a moving platform, but any downward motion is ignored. It's useful to keep full jump height even when the platform is moving down. */ - PLATFORM_ON_LEAVE_ADD_UPWARD_VELOCITY = 1, - - /** Do nothing when leaving a platform. */ - PLATFORM_ON_LEAVE_DO_NOTHING = 2, - } - } - /** A 2D physics body specialized for characters moved by script. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_characterbody2d.html - */ - class CharacterBody2D extends PhysicsBody2D { - constructor(identifier?: any) - /** Moves the body based on [member velocity]. If the body collides with another, it will slide along the other body (by default only on floor) rather than stop immediately. If the other body is a [CharacterBody2D] or [RigidBody2D], it will also be affected by the motion of the other body. You can use this to make moving and rotating platforms, or to make nodes push other nodes. - * Modifies [member velocity] if a slide collision occurred. To get the latest collision call [method get_last_slide_collision], for detailed information about collisions that occurred, use [method get_slide_collision]. - * When the body touches a moving platform, the platform's velocity is automatically added to the body motion. If a collision occurs due to the platform's motion, it will always be first in the slide collisions. - * The general behavior and available properties change according to the [member motion_mode]. - * Returns `true` if the body collided, otherwise, returns `false`. - */ - move_and_slide(): boolean - - /** Allows to manually apply a snap to the floor regardless of the body's velocity. This function does nothing when [method is_on_floor] returns `true`. */ - apply_floor_snap(): void - - /** Returns `true` if the body collided with the floor on the last call of [method move_and_slide]. Otherwise, returns `false`. The [member up_direction] and [member floor_max_angle] are used to determine whether a surface is "floor" or not. */ - is_on_floor(): boolean - - /** Returns `true` if the body collided only with the floor on the last call of [method move_and_slide]. Otherwise, returns `false`. The [member up_direction] and [member floor_max_angle] are used to determine whether a surface is "floor" or not. */ - is_on_floor_only(): boolean - - /** Returns `true` if the body collided with the ceiling on the last call of [method move_and_slide]. Otherwise, returns `false`. The [member up_direction] and [member floor_max_angle] are used to determine whether a surface is "ceiling" or not. */ - is_on_ceiling(): boolean - - /** Returns `true` if the body collided only with the ceiling on the last call of [method move_and_slide]. Otherwise, returns `false`. The [member up_direction] and [member floor_max_angle] are used to determine whether a surface is "ceiling" or not. */ - is_on_ceiling_only(): boolean - - /** Returns `true` if the body collided with a wall on the last call of [method move_and_slide]. Otherwise, returns `false`. The [member up_direction] and [member floor_max_angle] are used to determine whether a surface is "wall" or not. */ - is_on_wall(): boolean - - /** Returns `true` if the body collided only with a wall on the last call of [method move_and_slide]. Otherwise, returns `false`. The [member up_direction] and [member floor_max_angle] are used to determine whether a surface is "wall" or not. */ - is_on_wall_only(): boolean - - /** Returns the collision normal of the floor at the last collision point. Only valid after calling [method move_and_slide] and when [method is_on_floor] returns `true`. - * **Warning:** The collision normal is not always the same as the surface normal. - */ - get_floor_normal(): Vector2 - - /** Returns the collision normal of the wall at the last collision point. Only valid after calling [method move_and_slide] and when [method is_on_wall] returns `true`. - * **Warning:** The collision normal is not always the same as the surface normal. - */ - get_wall_normal(): Vector2 - - /** Returns the last motion applied to the [CharacterBody2D] during the last call to [method move_and_slide]. The movement can be split into multiple motions when sliding occurs, and this method return the last one, which is useful to retrieve the current direction of the movement. */ - get_last_motion(): Vector2 - - /** Returns the travel (position delta) that occurred during the last call to [method move_and_slide]. */ - get_position_delta(): Vector2 - - /** Returns the current real velocity since the last call to [method move_and_slide]. For example, when you climb a slope, you will move diagonally even though the velocity is horizontal. This method returns the diagonal movement, as opposed to [member velocity] which returns the requested velocity. */ - get_real_velocity(): Vector2 - - /** Returns the floor's collision angle at the last collision point according to [param up_direction], which is [constant Vector2.UP] by default. This value is always positive and only valid after calling [method move_and_slide] and when [method is_on_floor] returns `true`. */ - get_floor_angle(up_direction: Vector2 = new Vector2(0, -1)): float64 - - /** Returns the linear velocity of the platform at the last collision point. Only valid after calling [method move_and_slide]. */ - get_platform_velocity(): Vector2 - - /** Returns the number of times the body collided and changed direction during the last call to [method move_and_slide]. */ - get_slide_collision_count(): int64 - - /** Returns a [KinematicCollision2D], which contains information about a collision that occurred during the last call to [method move_and_slide]. Since the body can collide several times in a single call to [method move_and_slide], you must specify the index of the collision in the range 0 to ([method get_slide_collision_count] - 1). - * **Example usage:** - * - */ - get_slide_collision(slide_idx: int64): KinematicCollision2D - - /** Returns a [KinematicCollision2D], which contains information about the latest collision that occurred during the last call to [method move_and_slide]. */ - get_last_slide_collision(): KinematicCollision2D - - /** Sets the motion mode which defines the behavior of [method move_and_slide]. See [enum MotionMode] constants for available modes. */ - get motion_mode(): int64 - set motion_mode(value: int64) - - /** Vector pointing upwards, used to determine what is a wall and what is a floor (or a ceiling) when calling [method move_and_slide]. Defaults to [constant Vector2.UP]. As the vector will be normalized it can't be equal to [constant Vector2.ZERO], if you want all collisions to be reported as walls, consider using [constant MOTION_MODE_FLOATING] as [member motion_mode]. */ - get up_direction(): Vector2 - set up_direction(value: Vector2) - - /** Current velocity vector in pixels per second, used and modified during calls to [method move_and_slide]. */ - get velocity(): Vector2 - set velocity(value: Vector2) - - /** If `true`, during a jump against the ceiling, the body will slide, if `false` it will be stopped and will fall vertically. */ - get slide_on_ceiling(): boolean - set slide_on_ceiling(value: boolean) - - /** Maximum number of times the body can change direction before it stops when calling [method move_and_slide]. */ - get max_slides(): int64 - set max_slides(value: int64) - - /** Minimum angle (in radians) where the body is allowed to slide when it encounters a slope. The default value equals 15 degrees. This property only affects movement when [member motion_mode] is [constant MOTION_MODE_FLOATING]. */ - get wall_min_slide_angle(): float64 - set wall_min_slide_angle(value: float64) - - /** If `true`, the body will not slide on slopes when calling [method move_and_slide] when the body is standing still. - * If `false`, the body will slide on floor's slopes when [member velocity] applies a downward force. - */ - get floor_stop_on_slope(): boolean - set floor_stop_on_slope(value: boolean) - - /** If `false` (by default), the body will move faster on downward slopes and slower on upward slopes. - * If `true`, the body will always move at the same speed on the ground no matter the slope. Note that you need to use [member floor_snap_length] to stick along a downward slope at constant speed. - */ - get floor_constant_speed(): boolean - set floor_constant_speed(value: boolean) - - /** If `true`, the body will be able to move on the floor only. This option avoids to be able to walk on walls, it will however allow to slide down along them. */ - get floor_block_on_wall(): boolean - set floor_block_on_wall(value: boolean) - - /** Maximum angle (in radians) where a slope is still considered a floor (or a ceiling), rather than a wall, when calling [method move_and_slide]. The default value equals 45 degrees. */ - get floor_max_angle(): float64 - set floor_max_angle(value: float64) - - /** Sets a snapping distance. When set to a value different from `0.0`, the body is kept attached to slopes when calling [method move_and_slide]. The snapping vector is determined by the given distance along the opposite direction of the [member up_direction]. - * As long as the snapping vector is in contact with the ground and the body moves against [member up_direction], the body will remain attached to the surface. Snapping is not applied if the body moves along [member up_direction], meaning it contains vertical rising velocity, so it will be able to detach from the ground when jumping or when the body is pushed up by something. If you want to apply a snap without taking into account the velocity, use [method apply_floor_snap]. - */ - get floor_snap_length(): float64 - set floor_snap_length(value: float64) - - /** Sets the behavior to apply when you leave a moving platform. By default, to be physically accurate, when you leave the last platform velocity is applied. See [enum PlatformOnLeave] constants for available behavior. */ - get platform_on_leave(): int64 - set platform_on_leave(value: int64) - - /** Collision layers that will be included for detecting floor bodies that will act as moving platforms to be followed by the [CharacterBody2D]. By default, all floor bodies are detected and propagate their velocity. */ - get platform_floor_layers(): int64 - set platform_floor_layers(value: int64) - - /** Collision layers that will be included for detecting wall bodies that will act as moving platforms to be followed by the [CharacterBody2D]. By default, all wall bodies are ignored. */ - get platform_wall_layers(): int64 - set platform_wall_layers(value: int64) - - /** Extra margin used for collision recovery when calling [method move_and_slide]. - * If the body is at least this close to another body, it will consider them to be colliding and will be pushed away before performing the actual motion. - * A higher value means it's more flexible for detecting collision, which helps with consistently detecting walls and floors. - * A lower value forces the collision algorithm to use more exact detection, so it can be used in cases that specifically require precision, e.g at very low scale to avoid visible jittering, or for stability with a stack of character bodies. - */ - get safe_margin(): float64 - set safe_margin(value: float64) - } - namespace CharacterBody3D { - enum MotionMode { - /** Apply when notions of walls, ceiling and floor are relevant. In this mode the body motion will react to slopes (acceleration/slowdown). This mode is suitable for grounded games like platformers. */ - MOTION_MODE_GROUNDED = 0, - - /** Apply when there is no notion of floor or ceiling. All collisions will be reported as `on_wall`. In this mode, when you slide, the speed will always be constant. This mode is suitable for games without ground like space games. */ - MOTION_MODE_FLOATING = 1, - } - enum PlatformOnLeave { - /** Add the last platform velocity to the [member velocity] when you leave a moving platform. */ - PLATFORM_ON_LEAVE_ADD_VELOCITY = 0, - - /** Add the last platform velocity to the [member velocity] when you leave a moving platform, but any downward motion is ignored. It's useful to keep full jump height even when the platform is moving down. */ - PLATFORM_ON_LEAVE_ADD_UPWARD_VELOCITY = 1, - - /** Do nothing when leaving a platform. */ - PLATFORM_ON_LEAVE_DO_NOTHING = 2, - } - } - /** A 3D physics body specialized for characters moved by script. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_characterbody3d.html - */ - class CharacterBody3D extends PhysicsBody3D { - constructor(identifier?: any) - /** Moves the body based on [member velocity]. If the body collides with another, it will slide along the other body rather than stop immediately. If the other body is a [CharacterBody3D] or [RigidBody3D], it will also be affected by the motion of the other body. You can use this to make moving and rotating platforms, or to make nodes push other nodes. - * Modifies [member velocity] if a slide collision occurred. To get the latest collision call [method get_last_slide_collision], for more detailed information about collisions that occurred, use [method get_slide_collision]. - * When the body touches a moving platform, the platform's velocity is automatically added to the body motion. If a collision occurs due to the platform's motion, it will always be first in the slide collisions. - * Returns `true` if the body collided, otherwise, returns `false`. - */ - move_and_slide(): boolean - - /** Allows to manually apply a snap to the floor regardless of the body's velocity. This function does nothing when [method is_on_floor] returns `true`. */ - apply_floor_snap(): void - - /** Returns `true` if the body collided with the floor on the last call of [method move_and_slide]. Otherwise, returns `false`. The [member up_direction] and [member floor_max_angle] are used to determine whether a surface is "floor" or not. */ - is_on_floor(): boolean - - /** Returns `true` if the body collided only with the floor on the last call of [method move_and_slide]. Otherwise, returns `false`. The [member up_direction] and [member floor_max_angle] are used to determine whether a surface is "floor" or not. */ - is_on_floor_only(): boolean - - /** Returns `true` if the body collided with the ceiling on the last call of [method move_and_slide]. Otherwise, returns `false`. The [member up_direction] and [member floor_max_angle] are used to determine whether a surface is "ceiling" or not. */ - is_on_ceiling(): boolean - - /** Returns `true` if the body collided only with the ceiling on the last call of [method move_and_slide]. Otherwise, returns `false`. The [member up_direction] and [member floor_max_angle] are used to determine whether a surface is "ceiling" or not. */ - is_on_ceiling_only(): boolean - - /** Returns `true` if the body collided with a wall on the last call of [method move_and_slide]. Otherwise, returns `false`. The [member up_direction] and [member floor_max_angle] are used to determine whether a surface is "wall" or not. */ - is_on_wall(): boolean - - /** Returns `true` if the body collided only with a wall on the last call of [method move_and_slide]. Otherwise, returns `false`. The [member up_direction] and [member floor_max_angle] are used to determine whether a surface is "wall" or not. */ - is_on_wall_only(): boolean - - /** Returns the collision normal of the floor at the last collision point. Only valid after calling [method move_and_slide] and when [method is_on_floor] returns `true`. - * **Warning:** The collision normal is not always the same as the surface normal. - */ - get_floor_normal(): Vector3 - - /** Returns the collision normal of the wall at the last collision point. Only valid after calling [method move_and_slide] and when [method is_on_wall] returns `true`. - * **Warning:** The collision normal is not always the same as the surface normal. - */ - get_wall_normal(): Vector3 - - /** Returns the last motion applied to the [CharacterBody3D] during the last call to [method move_and_slide]. The movement can be split into multiple motions when sliding occurs, and this method return the last one, which is useful to retrieve the current direction of the movement. */ - get_last_motion(): Vector3 - - /** Returns the travel (position delta) that occurred during the last call to [method move_and_slide]. */ - get_position_delta(): Vector3 - - /** Returns the current real velocity since the last call to [method move_and_slide]. For example, when you climb a slope, you will move diagonally even though the velocity is horizontal. This method returns the diagonal movement, as opposed to [member velocity] which returns the requested velocity. */ - get_real_velocity(): Vector3 - - /** Returns the floor's collision angle at the last collision point according to [param up_direction], which is [constant Vector3.UP] by default. This value is always positive and only valid after calling [method move_and_slide] and when [method is_on_floor] returns `true`. */ - get_floor_angle(up_direction: Vector3 = Vector3.ZERO): float64 - - /** Returns the linear velocity of the platform at the last collision point. Only valid after calling [method move_and_slide]. */ - get_platform_velocity(): Vector3 - - /** Returns the angular velocity of the platform at the last collision point. Only valid after calling [method move_and_slide]. */ - get_platform_angular_velocity(): Vector3 - - /** Returns the number of times the body collided and changed direction during the last call to [method move_and_slide]. */ - get_slide_collision_count(): int64 - - /** Returns a [KinematicCollision3D], which contains information about a collision that occurred during the last call to [method move_and_slide]. Since the body can collide several times in a single call to [method move_and_slide], you must specify the index of the collision in the range 0 to ([method get_slide_collision_count] - 1). */ - get_slide_collision(slide_idx: int64): KinematicCollision3D - - /** Returns a [KinematicCollision3D], which contains information about the latest collision that occurred during the last call to [method move_and_slide]. */ - get_last_slide_collision(): KinematicCollision3D - - /** Sets the motion mode which defines the behavior of [method move_and_slide]. See [enum MotionMode] constants for available modes. */ - get motion_mode(): int64 - set motion_mode(value: int64) - - /** Vector pointing upwards, used to determine what is a wall and what is a floor (or a ceiling) when calling [method move_and_slide]. Defaults to [constant Vector3.UP]. As the vector will be normalized it can't be equal to [constant Vector3.ZERO], if you want all collisions to be reported as walls, consider using [constant MOTION_MODE_FLOATING] as [member motion_mode]. */ - get up_direction(): Vector3 - set up_direction(value: Vector3) - - /** If `true`, during a jump against the ceiling, the body will slide, if `false` it will be stopped and will fall vertically. */ - get slide_on_ceiling(): boolean - set slide_on_ceiling(value: boolean) - - /** Current velocity vector (typically meters per second), used and modified during calls to [method move_and_slide]. */ - get velocity(): Vector3 - set velocity(value: Vector3) - - /** Maximum number of times the body can change direction before it stops when calling [method move_and_slide]. */ - get max_slides(): int64 - set max_slides(value: int64) - - /** Minimum angle (in radians) where the body is allowed to slide when it encounters a slope. The default value equals 15 degrees. When [member motion_mode] is [constant MOTION_MODE_GROUNDED], it only affects movement if [member floor_block_on_wall] is `true`. */ - get wall_min_slide_angle(): float64 - set wall_min_slide_angle(value: float64) - - /** If `true`, the body will not slide on slopes when calling [method move_and_slide] when the body is standing still. - * If `false`, the body will slide on floor's slopes when [member velocity] applies a downward force. - */ - get floor_stop_on_slope(): boolean - set floor_stop_on_slope(value: boolean) - - /** If `false` (by default), the body will move faster on downward slopes and slower on upward slopes. - * If `true`, the body will always move at the same speed on the ground no matter the slope. Note that you need to use [member floor_snap_length] to stick along a downward slope at constant speed. - */ - get floor_constant_speed(): boolean - set floor_constant_speed(value: boolean) - - /** If `true`, the body will be able to move on the floor only. This option avoids to be able to walk on walls, it will however allow to slide down along them. */ - get floor_block_on_wall(): boolean - set floor_block_on_wall(value: boolean) - - /** Maximum angle (in radians) where a slope is still considered a floor (or a ceiling), rather than a wall, when calling [method move_and_slide]. The default value equals 45 degrees. */ - get floor_max_angle(): float64 - set floor_max_angle(value: float64) - - /** Sets a snapping distance. When set to a value different from `0.0`, the body is kept attached to slopes when calling [method move_and_slide]. The snapping vector is determined by the given distance along the opposite direction of the [member up_direction]. - * As long as the snapping vector is in contact with the ground and the body moves against [member up_direction], the body will remain attached to the surface. Snapping is not applied if the body moves along [member up_direction], meaning it contains vertical rising velocity, so it will be able to detach from the ground when jumping or when the body is pushed up by something. If you want to apply a snap without taking into account the velocity, use [method apply_floor_snap]. - */ - get floor_snap_length(): float64 - set floor_snap_length(value: float64) - - /** Sets the behavior to apply when you leave a moving platform. By default, to be physically accurate, when you leave the last platform velocity is applied. See [enum PlatformOnLeave] constants for available behavior. */ - get platform_on_leave(): int64 - set platform_on_leave(value: int64) - - /** Collision layers that will be included for detecting floor bodies that will act as moving platforms to be followed by the [CharacterBody3D]. By default, all floor bodies are detected and propagate their velocity. */ - get platform_floor_layers(): int64 - set platform_floor_layers(value: int64) - - /** Collision layers that will be included for detecting wall bodies that will act as moving platforms to be followed by the [CharacterBody3D]. By default, all wall bodies are ignored. */ - get platform_wall_layers(): int64 - set platform_wall_layers(value: int64) - - /** Extra margin used for collision recovery when calling [method move_and_slide]. - * If the body is at least this close to another body, it will consider them to be colliding and will be pushed away before performing the actual motion. - * A higher value means it's more flexible for detecting collision, which helps with consistently detecting walls and floors. - * A lower value forces the collision algorithm to use more exact detection, so it can be used in cases that specifically require precision, e.g at very low scale to avoid visible jittering, or for stability with a stack of character bodies. - */ - get safe_margin(): float64 - set safe_margin(value: float64) - } - /** A button that represents a binary choice. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_checkbox.html - */ - class CheckBox extends Button { - constructor(identifier?: any) - } - /** A button that represents a binary choice. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_checkbutton.html - */ - class CheckButton extends Button { - constructor(identifier?: any) - } - /** A 2D circle shape used for physics collision. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_circleshape2d.html - */ - class CircleShape2D extends Shape2D { - constructor(identifier?: any) - /** The circle's radius. */ - get radius(): float64 - set radius(value: float64) - } - namespace CodeEdit { - enum CodeCompletionKind { - /** Marks the option as a class. */ - KIND_CLASS = 0, - - /** Marks the option as a function. */ - KIND_FUNCTION = 1, - - /** Marks the option as a Godot signal. */ - KIND_SIGNAL = 2, - - /** Marks the option as a variable. */ - KIND_VARIABLE = 3, - - /** Marks the option as a member. */ - KIND_MEMBER = 4, - - /** Marks the option as an enum entry. */ - KIND_ENUM = 5, - - /** Marks the option as a constant. */ - KIND_CONSTANT = 6, - - /** Marks the option as a Godot node path. */ - KIND_NODE_PATH = 7, - - /** Marks the option as a file path. */ - KIND_FILE_PATH = 8, - - /** Marks the option as unclassified or plain text. */ - KIND_PLAIN_TEXT = 9, - } - enum CodeCompletionLocation { - /** The option is local to the location of the code completion query - e.g. a local variable. Subsequent value of location represent options from the outer class, the exact value represent how far they are (in terms of inner classes). */ - LOCATION_LOCAL = 0, - - /** The option is from the containing class or a parent class, relative to the location of the code completion query. Perform a bitwise OR with the class depth (e.g. `0` for the local class, `1` for the parent, `2` for the grandparent, etc.) to store the depth of an option in the class or a parent class. */ - LOCATION_PARENT_MASK = 256, - - /** The option is from user code which is not local and not in a derived class (e.g. Autoload Singletons). */ - LOCATION_OTHER_USER_CODE = 512, - - /** The option is from other engine code, not covered by the other enum constants - e.g. built-in classes. */ - LOCATION_OTHER = 1024, - } - } - /** A multiline text editor designed for editing code. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_codeedit.html - */ - class CodeEdit extends TextEdit { - constructor(identifier?: any) - /** Override this method to define how the selected entry should be inserted. If [param replace] is `true`, any existing text should be replaced. */ - /* gdvirtual */ _confirm_code_completion(replace: boolean): void - - /** Override this method to define what happens when the user requests code completion. If [param force] is `true`, any checks should be bypassed. */ - /* gdvirtual */ _request_code_completion(force: boolean): void - - /** Override this method to define what items in [param candidates] should be displayed. - * Both [param candidates] and the return is a [Array] of [Dictionary], see [method get_code_completion_option] for [Dictionary] content. - */ - /* gdvirtual */ _filter_code_completion_candidates(candidates: GArray): GArray - - /** Perform an indent as if the user activated the "ui_text_indent" action. */ - do_indent(): void - - /** Indents selected lines, or in the case of no selection the caret line by one. */ - indent_lines(): void - - /** Unindents selected lines, or in the case of no selection the caret line by one. Same as performing "ui_text_unindent" action. */ - unindent_lines(): void - - /** Converts the indents of lines between [param from_line] and [param to_line] to tabs or spaces as set by [member indent_use_spaces]. - * Values of `-1` convert the entire text. - */ - convert_indent(from_line: int64 = -1, to_line: int64 = -1): void - - /** Adds a brace pair. - * Both the start and end keys must be symbols. Only the start key has to be unique. - */ - add_auto_brace_completion_pair(start_key: string, end_key: string): void - - /** Returns `true` if open key [param open_key] exists. */ - has_auto_brace_completion_open_key(open_key: string): boolean - - /** Returns `true` if close key [param close_key] exists. */ - has_auto_brace_completion_close_key(close_key: string): boolean - - /** Gets the matching auto brace close key for [param open_key]. */ - get_auto_brace_completion_close_key(open_key: string): string - - /** Sets the line as breakpointed. */ - set_line_as_breakpoint(line: int64, breakpointed: boolean): void - - /** Returns whether the line at the specified index is breakpointed or not. */ - is_line_breakpointed(line: int64): boolean - - /** Clears all breakpointed lines. */ - clear_breakpointed_lines(): void - - /** Gets all breakpointed lines. */ - get_breakpointed_lines(): PackedInt32Array - - /** Sets the line as bookmarked. */ - set_line_as_bookmarked(line: int64, bookmarked: boolean): void - - /** Returns whether the line at the specified index is bookmarked or not. */ - is_line_bookmarked(line: int64): boolean - - /** Clears all bookmarked lines. */ - clear_bookmarked_lines(): void - - /** Gets all bookmarked lines. */ - get_bookmarked_lines(): PackedInt32Array - - /** Sets the line as executing. */ - set_line_as_executing(line: int64, executing: boolean): void - - /** Returns whether the line at the specified index is marked as executing or not. */ - is_line_executing(line: int64): boolean - - /** Clears all executed lines. */ - clear_executing_lines(): void - - /** Gets all executing lines. */ - get_executing_lines(): PackedInt32Array - - /** Returns if the given line is foldable, that is, it has indented lines right below it or a comment / string block. */ - can_fold_line(line: int64): boolean - - /** Folds the given line, if possible (see [method can_fold_line]). */ - fold_line(line: int64): void - - /** Unfolds all lines that were previously folded. */ - unfold_line(line: int64): void - - /** Folds all lines that are possible to be folded (see [method can_fold_line]). */ - fold_all_lines(): void - - /** Unfolds all lines, folded or not. */ - unfold_all_lines(): void - - /** Toggle the folding of the code block at the given line. */ - toggle_foldable_line(line: int64): void - - /** Toggle the folding of the code block on all lines with a caret on them. */ - toggle_foldable_lines_at_carets(): void - - /** Returns whether the line at the specified index is folded or not. */ - is_line_folded(line: int64): boolean - - /** Returns all lines that are current folded. */ - get_folded_lines(): GArray - - /** Creates a new code region with the selection. At least one single line comment delimiter have to be defined (see [method add_comment_delimiter]). - * A code region is a part of code that is highlighted when folded and can help organize your script. - * Code region start and end tags can be customized (see [method set_code_region_tags]). - * Code regions are delimited using start and end tags (respectively `region` and `endregion` by default) preceded by one line comment delimiter. (eg. `#region` and `#endregion`) - */ - create_code_region(): void - - /** Returns the code region start tag (without comment delimiter). */ - get_code_region_start_tag(): string - - /** Returns the code region end tag (without comment delimiter). */ - get_code_region_end_tag(): string - - /** Sets the code region start and end tags (without comment delimiter). */ - set_code_region_tags(start: string = 'region', end: string = 'endregion'): void - - /** Returns whether the line at the specified index is a code region start. */ - is_line_code_region_start(line: int64): boolean - - /** Returns whether the line at the specified index is a code region end. */ - is_line_code_region_end(line: int64): boolean - - /** Defines a string delimiter from [param start_key] to [param end_key]. Both keys should be symbols, and [param start_key] must not be shared with other delimiters. - * If [param line_only] is `true` or [param end_key] is an empty [String], the region does not carry over to the next line. - */ - add_string_delimiter(start_key: string, end_key: string, line_only: boolean = false): void - - /** Removes the string delimiter with [param start_key]. */ - remove_string_delimiter(start_key: string): void - - /** Returns `true` if string [param start_key] exists. */ - has_string_delimiter(start_key: string): boolean - - /** Removes all string delimiters. */ - clear_string_delimiters(): void - - /** Returns the delimiter index if [param line] [param column] is in a string. If [param column] is not provided, will return the delimiter index if the entire [param line] is a string. Otherwise `-1`. */ - is_in_string(line: int64, column: int64 = -1): int64 - - /** Adds a comment delimiter from [param start_key] to [param end_key]. Both keys should be symbols, and [param start_key] must not be shared with other delimiters. - * If [param line_only] is `true` or [param end_key] is an empty [String], the region does not carry over to the next line. - */ - add_comment_delimiter(start_key: string, end_key: string, line_only: boolean = false): void - - /** Removes the comment delimiter with [param start_key]. */ - remove_comment_delimiter(start_key: string): void - - /** Returns `true` if comment [param start_key] exists. */ - has_comment_delimiter(start_key: string): boolean - - /** Removes all comment delimiters. */ - clear_comment_delimiters(): void - - /** Returns delimiter index if [param line] [param column] is in a comment. If [param column] is not provided, will return delimiter index if the entire [param line] is a comment. Otherwise `-1`. */ - is_in_comment(line: int64, column: int64 = -1): int64 - - /** Gets the start key for a string or comment region index. */ - get_delimiter_start_key(delimiter_index: int64): string - - /** Gets the end key for a string or comment region index. */ - get_delimiter_end_key(delimiter_index: int64): string - - /** If [param line] [param column] is in a string or comment, returns the start position of the region. If not or no start could be found, both [Vector2] values will be `-1`. */ - get_delimiter_start_position(line: int64, column: int64): Vector2 - - /** If [param line] [param column] is in a string or comment, returns the end position of the region. If not or no end could be found, both [Vector2] values will be `-1`. */ - get_delimiter_end_position(line: int64, column: int64): Vector2 - - /** Sets the code hint text. Pass an empty string to clear. */ - set_code_hint(code_hint: string): void - - /** Sets if the code hint should draw below the text. */ - set_code_hint_draw_below(draw_below: boolean): void - - /** Returns the full text with char `0xFFFF` at the caret location. */ - get_text_for_code_completion(): string - - /** Emits [signal code_completion_requested], if [param force] is `true` will bypass all checks. Otherwise will check that the caret is in a word or in front of a prefix. Will ignore the request if all current options are of type file path, node path, or signal. */ - request_code_completion(force: boolean = false): void - - /** Submits an item to the queue of potential candidates for the autocomplete menu. Call [method update_code_completion_options] to update the list. - * [param location] indicates location of the option relative to the location of the code completion query. See [enum CodeEdit.CodeCompletionLocation] for how to set this value. - * - * **Note:** This list will replace all current candidates. - */ - add_code_completion_option(type: CodeEdit.CodeCompletionKind, display_text: string, insert_text: string, text_color: Color = new Color(1, 1, 1, 1), icon: Resource = undefined, value: any = {}, location: int64 = 1024): void - - /** Submits all completion options added with [method add_code_completion_option]. Will try to force the autocomplete menu to popup, if [param force] is `true`. - * - * **Note:** This will replace all current candidates. - */ - update_code_completion_options(force: boolean): void - - /** Gets all completion options, see [method get_code_completion_option] for return content. */ - get_code_completion_options(): GArray - - /** Gets the completion option at [param index]. The return [Dictionary] has the following key-values: - * `kind`: [enum CodeCompletionKind] - * `display_text`: Text that is shown on the autocomplete menu. - * `insert_text`: Text that is to be inserted when this item is selected. - * `font_color`: Color of the text on the autocomplete menu. - * `icon`: Icon to draw on the autocomplete menu. - * `default_value`: Value of the symbol. - */ - get_code_completion_option(index: int64): GDictionary - - /** Gets the index of the current selected completion option. */ - get_code_completion_selected_index(): int64 - - /** Sets the current selected completion option. */ - set_code_completion_selected_index(index: int64): void - - /** Inserts the selected entry into the text. If [param replace] is `true`, any existing text is replaced rather than merged. */ - confirm_code_completion(replace: boolean = false): void - - /** Cancels the autocomplete menu. */ - cancel_code_completion(): void - - /** Returns the full text with char `0xFFFF` at the cursor location. */ - get_text_for_symbol_lookup(): string - - /** Returns the full text with char `0xFFFF` at the specified location. */ - get_text_with_cursor_char(line: int64, column: int64): string - - /** Sets the symbol emitted by [signal symbol_validate] as a valid lookup. */ - set_symbol_lookup_word_as_valid(valid: boolean): void - - /** Moves all lines up that are selected or have a caret on them. */ - move_lines_up(): void - - /** Moves all lines down that are selected or have a caret on them. */ - move_lines_down(): void - - /** Deletes all lines that are selected or have a caret on them. */ - delete_lines(): void - - /** Duplicates all selected text and duplicates all lines with a caret on them. */ - duplicate_selection(): void - - /** Duplicates all lines currently selected with any caret. Duplicates the entire line beneath the current one no matter where the caret is within the line. */ - duplicate_lines(): void - - /** Set when a validated word from [signal symbol_validate] is clicked, the [signal symbol_lookup] should be emitted. */ - get symbol_lookup_on_click(): boolean - set symbol_lookup_on_click(value: boolean) - - /** Sets whether line folding is allowed. */ - get line_folding(): boolean - set line_folding(value: boolean) - - /** Draws vertical lines at the provided columns. The first entry is considered a main hard guideline and is draw more prominently. */ - get line_length_guidelines(): PackedInt32Array - set line_length_guidelines(value: PackedInt32Array | int32[]) - - /** Sets if breakpoints should be drawn in the gutter. This gutter is shared with bookmarks and executing lines. */ - get gutters_draw_breakpoints_gutter(): boolean - set gutters_draw_breakpoints_gutter(value: boolean) - - /** Sets if bookmarked should be drawn in the gutter. This gutter is shared with breakpoints and executing lines. */ - get gutters_draw_bookmarks(): boolean - set gutters_draw_bookmarks(value: boolean) - - /** Sets if executing lines should be marked in the gutter. This gutter is shared with breakpoints and bookmarks lines. */ - get gutters_draw_executing_lines(): boolean - set gutters_draw_executing_lines(value: boolean) - - /** Sets if line numbers should be drawn in the gutter. */ - get gutters_draw_line_numbers(): boolean - set gutters_draw_line_numbers(value: boolean) - - /** Sets if line numbers drawn in the gutter are zero padded. */ - get gutters_zero_pad_line_numbers(): boolean - set gutters_zero_pad_line_numbers(value: boolean) - - /** Sets if foldable lines icons should be drawn in the gutter. */ - get gutters_draw_fold_gutter(): boolean - set gutters_draw_fold_gutter(value: boolean) - - /** Sets the string delimiters. All existing string delimiters will be removed. */ - get delimiter_strings(): PackedStringArray - set delimiter_strings(value: PackedStringArray | string[]) - - /** Sets the comment delimiters. All existing comment delimiters will be removed. */ - get delimiter_comments(): PackedStringArray - set delimiter_comments(value: PackedStringArray | string[]) - - /** Sets whether code completion is allowed. */ - get code_completion_enabled(): boolean - set code_completion_enabled(value: boolean) - - /** Sets prefixes that will trigger code completion. */ - get code_completion_prefixes(): PackedStringArray - set code_completion_prefixes(value: PackedStringArray | string[]) - - /** Size of the tabulation indent (one [kbd]Tab[/kbd] press) in characters. If [member indent_use_spaces] is enabled the number of spaces to use. */ - get indent_size(): int64 - set indent_size(value: int64) - - /** Use spaces instead of tabs for indentation. */ - get indent_use_spaces(): boolean - set indent_use_spaces(value: boolean) - - /** Sets whether automatic indent are enabled, this will add an extra indent if a prefix or brace is found. */ - get indent_automatic(): boolean - set indent_automatic(value: boolean) - - /** Prefixes to trigger an automatic indent. */ - get indent_automatic_prefixes(): PackedStringArray - set indent_automatic_prefixes(value: PackedStringArray | string[]) - - /** Sets whether brace pairs should be autocompleted. */ - get auto_brace_completion_enabled(): boolean - set auto_brace_completion_enabled(value: boolean) - - /** Highlight mismatching brace pairs. */ - get auto_brace_completion_highlight_matching(): boolean - set auto_brace_completion_highlight_matching(value: boolean) - - /** Sets the brace pairs to be autocompleted. */ - get auto_brace_completion_pairs(): GDictionary - set auto_brace_completion_pairs(value: GDictionary) - - /** Emitted when a breakpoint is added or removed from a line. If the line is moved via backspace a removed is emitted at the old line. */ - readonly breakpoint_toggled: Signal1 - - /** Emitted when the user requests code completion. */ - readonly code_completion_requested: Signal0 - - /** Emitted when the user has clicked on a valid symbol. */ - readonly symbol_lookup: Signal3 - - /** Emitted when the user hovers over a symbol. The symbol should be validated and responded to, by calling [method set_symbol_lookup_word_as_valid]. */ - readonly symbol_validate: Signal1 - } } diff --git a/typings/godot2.gen.d.ts b/typings/godot2.gen.d.ts index 21c58e5..1a10705 100644 --- a/typings/godot2.gen.d.ts +++ b/typings/godot2.gen.d.ts @@ -1,9 +1,4667 @@ // AUTO-GENERATED /// declare module "godot" { + namespace BaseMaterial3D { + enum TextureParam { + /** Texture specifying per-pixel color. */ + TEXTURE_ALBEDO = 0, + + /** Texture specifying per-pixel metallic value. */ + TEXTURE_METALLIC = 1, + + /** Texture specifying per-pixel roughness value. */ + TEXTURE_ROUGHNESS = 2, + + /** Texture specifying per-pixel emission color. */ + TEXTURE_EMISSION = 3, + + /** Texture specifying per-pixel normal vector. */ + TEXTURE_NORMAL = 4, + + /** Texture specifying per-pixel rim value. */ + TEXTURE_RIM = 5, + + /** Texture specifying per-pixel clearcoat value. */ + TEXTURE_CLEARCOAT = 6, + + /** Texture specifying per-pixel flowmap direction for use with [member anisotropy]. */ + TEXTURE_FLOWMAP = 7, + + /** Texture specifying per-pixel ambient occlusion value. */ + TEXTURE_AMBIENT_OCCLUSION = 8, + + /** Texture specifying per-pixel height. */ + TEXTURE_HEIGHTMAP = 9, + + /** Texture specifying per-pixel subsurface scattering. */ + TEXTURE_SUBSURFACE_SCATTERING = 10, + + /** Texture specifying per-pixel transmittance for subsurface scattering. */ + TEXTURE_SUBSURFACE_TRANSMITTANCE = 11, + + /** Texture specifying per-pixel backlight color. */ + TEXTURE_BACKLIGHT = 12, + + /** Texture specifying per-pixel refraction strength. */ + TEXTURE_REFRACTION = 13, + + /** Texture specifying per-pixel detail mask blending value. */ + TEXTURE_DETAIL_MASK = 14, + + /** Texture specifying per-pixel detail color. */ + TEXTURE_DETAIL_ALBEDO = 15, + + /** Texture specifying per-pixel detail normal. */ + TEXTURE_DETAIL_NORMAL = 16, + + /** Texture holding ambient occlusion, roughness, and metallic. */ + TEXTURE_ORM = 17, + + /** Represents the size of the [enum TextureParam] enum. */ + TEXTURE_MAX = 18, + } + enum TextureFilter { + /** The texture filter reads from the nearest pixel only. This makes the texture look pixelated from up close, and grainy from a distance (due to mipmaps not being sampled). */ + TEXTURE_FILTER_NEAREST = 0, + + /** The texture filter blends between the nearest 4 pixels. This makes the texture look smooth from up close, and grainy from a distance (due to mipmaps not being sampled). */ + TEXTURE_FILTER_LINEAR = 1, + + /** The texture filter reads from the nearest pixel and blends between the nearest 2 mipmaps (or uses the nearest mipmap if [member ProjectSettings.rendering/textures/default_filters/use_nearest_mipmap_filter] is `true`). This makes the texture look pixelated from up close, and smooth from a distance. */ + TEXTURE_FILTER_NEAREST_WITH_MIPMAPS = 2, + + /** The texture filter blends between the nearest 4 pixels and between the nearest 2 mipmaps (or uses the nearest mipmap if [member ProjectSettings.rendering/textures/default_filters/use_nearest_mipmap_filter] is `true`). This makes the texture look smooth from up close, and smooth from a distance. */ + TEXTURE_FILTER_LINEAR_WITH_MIPMAPS = 3, + + /** The texture filter reads from the nearest pixel and blends between 2 mipmaps (or uses the nearest mipmap if [member ProjectSettings.rendering/textures/default_filters/use_nearest_mipmap_filter] is `true`) based on the angle between the surface and the camera view. This makes the texture look pixelated from up close, and smooth from a distance. Anisotropic filtering improves texture quality on surfaces that are almost in line with the camera, but is slightly slower. The anisotropic filtering level can be changed by adjusting [member ProjectSettings.rendering/textures/default_filters/anisotropic_filtering_level]. */ + TEXTURE_FILTER_NEAREST_WITH_MIPMAPS_ANISOTROPIC = 4, + + /** The texture filter blends between the nearest 4 pixels and blends between 2 mipmaps (or uses the nearest mipmap if [member ProjectSettings.rendering/textures/default_filters/use_nearest_mipmap_filter] is `true`) based on the angle between the surface and the camera view. This makes the texture look smooth from up close, and smooth from a distance. Anisotropic filtering improves texture quality on surfaces that are almost in line with the camera, but is slightly slower. The anisotropic filtering level can be changed by adjusting [member ProjectSettings.rendering/textures/default_filters/anisotropic_filtering_level]. */ + TEXTURE_FILTER_LINEAR_WITH_MIPMAPS_ANISOTROPIC = 5, + + /** Represents the size of the [enum TextureFilter] enum. */ + TEXTURE_FILTER_MAX = 6, + } + enum DetailUV { + /** Use `UV` with the detail texture. */ + DETAIL_UV_1 = 0, + + /** Use `UV2` with the detail texture. */ + DETAIL_UV_2 = 1, + } + enum Transparency { + /** The material will not use transparency. This is the fastest to render. */ + TRANSPARENCY_DISABLED = 0, + + /** The material will use the texture's alpha values for transparency. This is the slowest to render, and disables shadow casting. */ + TRANSPARENCY_ALPHA = 1, + + /** The material will cut off all values below a threshold, the rest will remain opaque. The opaque portions will be rendered in the depth prepass. This is faster to render than alpha blending, but slower than opaque rendering. This also supports casting shadows. */ + TRANSPARENCY_ALPHA_SCISSOR = 2, + + /** The material will cut off all values below a spatially-deterministic threshold, the rest will remain opaque. This is faster to render than alpha blending, but slower than opaque rendering. This also supports casting shadows. Alpha hashing is suited for hair rendering. */ + TRANSPARENCY_ALPHA_HASH = 3, + + /** The material will use the texture's alpha value for transparency, but will discard fragments with an alpha of less than 0.99 during the depth prepass and fragments with an alpha less than 0.1 during the shadow pass. This also supports casting shadows. */ + TRANSPARENCY_ALPHA_DEPTH_PRE_PASS = 4, + + /** Represents the size of the [enum Transparency] enum. */ + TRANSPARENCY_MAX = 5, + } + enum ShadingMode { + /** The object will not receive shadows. This is the fastest to render, but it disables all interactions with lights. */ + SHADING_MODE_UNSHADED = 0, + + /** The object will be shaded per pixel. Useful for realistic shading effects. */ + SHADING_MODE_PER_PIXEL = 1, + + /** The object will be shaded per vertex. Useful when you want cheaper shaders and do not care about visual quality. */ + SHADING_MODE_PER_VERTEX = 2, + + /** Represents the size of the [enum ShadingMode] enum. */ + SHADING_MODE_MAX = 3, + } + enum Feature { + /** Constant for setting [member emission_enabled]. */ + FEATURE_EMISSION = 0, + + /** Constant for setting [member normal_enabled]. */ + FEATURE_NORMAL_MAPPING = 1, + + /** Constant for setting [member rim_enabled]. */ + FEATURE_RIM = 2, + + /** Constant for setting [member clearcoat_enabled]. */ + FEATURE_CLEARCOAT = 3, + + /** Constant for setting [member anisotropy_enabled]. */ + FEATURE_ANISOTROPY = 4, + + /** Constant for setting [member ao_enabled]. */ + FEATURE_AMBIENT_OCCLUSION = 5, + + /** Constant for setting [member heightmap_enabled]. */ + FEATURE_HEIGHT_MAPPING = 6, + + /** Constant for setting [member subsurf_scatter_enabled]. */ + FEATURE_SUBSURFACE_SCATTERING = 7, + + /** Constant for setting [member subsurf_scatter_transmittance_enabled]. */ + FEATURE_SUBSURFACE_TRANSMITTANCE = 8, + + /** Constant for setting [member backlight_enabled]. */ + FEATURE_BACKLIGHT = 9, + + /** Constant for setting [member refraction_enabled]. */ + FEATURE_REFRACTION = 10, + + /** Constant for setting [member detail_enabled]. */ + FEATURE_DETAIL = 11, + + /** Represents the size of the [enum Feature] enum. */ + FEATURE_MAX = 12, + } + enum BlendMode { + /** Default blend mode. The color of the object is blended over the background based on the object's alpha value. */ + BLEND_MODE_MIX = 0, + + /** The color of the object is added to the background. */ + BLEND_MODE_ADD = 1, + + /** The color of the object is subtracted from the background. */ + BLEND_MODE_SUB = 2, + + /** The color of the object is multiplied by the background. */ + BLEND_MODE_MUL = 3, + + /** The color of the object is added to the background and the alpha channel is used to mask out the background. This is effectively a hybrid of the blend mix and add modes, useful for effects like fire where you want the flame to add but the smoke to mix. By default, this works with unshaded materials using premultiplied textures. For shaded materials, use the `PREMUL_ALPHA_FACTOR` built-in so that lighting can be modulated as well. */ + BLEND_MODE_PREMULT_ALPHA = 4, + } + enum AlphaAntiAliasing { + /** Disables Alpha AntiAliasing for the material. */ + ALPHA_ANTIALIASING_OFF = 0, + + /** Enables AlphaToCoverage. Alpha values in the material are passed to the AntiAliasing sample mask. */ + ALPHA_ANTIALIASING_ALPHA_TO_COVERAGE = 1, + + /** Enables AlphaToCoverage and forces all non-zero alpha values to `1`. Alpha values in the material are passed to the AntiAliasing sample mask. */ + ALPHA_ANTIALIASING_ALPHA_TO_COVERAGE_AND_TO_ONE = 2, + } + enum DepthDrawMode { + /** Default depth draw mode. Depth is drawn only for opaque objects during the opaque prepass (if any) and during the opaque pass. */ + DEPTH_DRAW_OPAQUE_ONLY = 0, + + /** Objects will write to depth during the opaque and the transparent passes. Transparent objects that are close to the camera may obscure other transparent objects behind them. + * + * **Note:** This does not influence whether transparent objects are included in the depth prepass or not. For that, see [enum Transparency]. + */ + DEPTH_DRAW_ALWAYS = 1, + + /** Objects will not write their depth to the depth buffer, even during the depth prepass (if enabled). */ + DEPTH_DRAW_DISABLED = 2, + } + enum CullMode { + /** Default cull mode. The back of the object is culled when not visible. Back face triangles will be culled when facing the camera. This results in only the front side of triangles being drawn. For closed-surface meshes, this means that only the exterior of the mesh will be visible. */ + CULL_BACK = 0, + + /** Front face triangles will be culled when facing the camera. This results in only the back side of triangles being drawn. For closed-surface meshes, this means that the interior of the mesh will be drawn instead of the exterior. */ + CULL_FRONT = 1, + + /** No face culling is performed; both the front face and back face will be visible. */ + CULL_DISABLED = 2, + } + enum Flags { + /** Disables the depth test, so this object is drawn on top of all others drawn before it. This puts the object in the transparent draw pass where it is sorted based on distance to camera. Objects drawn after it in the draw order may cover it. This also disables writing to depth. */ + FLAG_DISABLE_DEPTH_TEST = 0, + + /** Set `ALBEDO` to the per-vertex color specified in the mesh. */ + FLAG_ALBEDO_FROM_VERTEX_COLOR = 1, + + /** Vertex colors are considered to be stored in sRGB color space and are converted to linear color space during rendering. See also [member vertex_color_is_srgb]. + * + * **Note:** Only effective when using the Forward+ and Mobile rendering methods. + */ + FLAG_SRGB_VERTEX_COLOR = 2, + + /** Uses point size to alter the size of primitive points. Also changes the albedo texture lookup to use `POINT_COORD` instead of `UV`. */ + FLAG_USE_POINT_SIZE = 3, + + /** Object is scaled by depth so that it always appears the same size on screen. */ + FLAG_FIXED_SIZE = 4, + + /** Shader will keep the scale set for the mesh. Otherwise the scale is lost when billboarding. Only applies when [member billboard_mode] is [constant BILLBOARD_ENABLED]. */ + FLAG_BILLBOARD_KEEP_SCALE = 5, + + /** Use triplanar texture lookup for all texture lookups that would normally use `UV`. */ + FLAG_UV1_USE_TRIPLANAR = 6, + + /** Use triplanar texture lookup for all texture lookups that would normally use `UV2`. */ + FLAG_UV2_USE_TRIPLANAR = 7, + + /** Use triplanar texture lookup for all texture lookups that would normally use `UV`. */ + FLAG_UV1_USE_WORLD_TRIPLANAR = 8, + + /** Use triplanar texture lookup for all texture lookups that would normally use `UV2`. */ + FLAG_UV2_USE_WORLD_TRIPLANAR = 9, + + /** Use `UV2` coordinates to look up from the [member ao_texture]. */ + FLAG_AO_ON_UV2 = 10, + + /** Use `UV2` coordinates to look up from the [member emission_texture]. */ + FLAG_EMISSION_ON_UV2 = 11, + + /** Forces the shader to convert albedo from sRGB space to linear space. See also [member albedo_texture_force_srgb]. */ + FLAG_ALBEDO_TEXTURE_FORCE_SRGB = 12, + + /** Disables receiving shadows from other objects. */ + FLAG_DONT_RECEIVE_SHADOWS = 13, + + /** Disables receiving ambient light. */ + FLAG_DISABLE_AMBIENT_LIGHT = 14, + + /** Enables the shadow to opacity feature. */ + FLAG_USE_SHADOW_TO_OPACITY = 15, + + /** Enables the texture to repeat when UV coordinates are outside the 0-1 range. If using one of the linear filtering modes, this can result in artifacts at the edges of a texture when the sampler filters across the edges of the texture. */ + FLAG_USE_TEXTURE_REPEAT = 16, + + /** Invert values read from a depth texture to convert them to height values (heightmap). */ + FLAG_INVERT_HEIGHTMAP = 17, + + /** Enables the skin mode for subsurface scattering which is used to improve the look of subsurface scattering when used for human skin. */ + FLAG_SUBSURFACE_MODE_SKIN = 18, + + /** Enables parts of the shader required for [GPUParticles3D] trails to function. This also requires using a mesh with appropriate skinning, such as [RibbonTrailMesh] or [TubeTrailMesh]. Enabling this feature outside of materials used in [GPUParticles3D] meshes will break material rendering. */ + FLAG_PARTICLE_TRAILS_MODE = 19, + + /** Enables multichannel signed distance field rendering shader. */ + FLAG_ALBEDO_TEXTURE_MSDF = 20, + + /** Disables receiving depth-based or volumetric fog. */ + FLAG_DISABLE_FOG = 21, + + /** Represents the size of the [enum Flags] enum. */ + FLAG_MAX = 22, + } + enum DiffuseMode { + /** Default diffuse scattering algorithm. */ + DIFFUSE_BURLEY = 0, + + /** Diffuse scattering ignores roughness. */ + DIFFUSE_LAMBERT = 1, + + /** Extends Lambert to cover more than 90 degrees when roughness increases. */ + DIFFUSE_LAMBERT_WRAP = 2, + + /** Uses a hard cut for lighting, with smoothing affected by roughness. */ + DIFFUSE_TOON = 3, + } + enum SpecularMode { + /** Default specular blob. */ + SPECULAR_SCHLICK_GGX = 0, + + /** Toon blob which changes size based on roughness. */ + SPECULAR_TOON = 1, + + /** No specular blob. This is slightly faster to render than other specular modes. */ + SPECULAR_DISABLED = 2, + } + enum BillboardMode { + /** Billboard mode is disabled. */ + BILLBOARD_DISABLED = 0, + + /** The object's Z axis will always face the camera. */ + BILLBOARD_ENABLED = 1, + + /** The object's X axis will always face the camera. */ + BILLBOARD_FIXED_Y = 2, + + /** Used for particle systems when assigned to [GPUParticles3D] and [CPUParticles3D] nodes (flipbook animation). Enables `particles_anim_*` properties. + * The [member ParticleProcessMaterial.anim_speed_min] or [member CPUParticles3D.anim_speed_min] should also be set to a value bigger than zero for the animation to play. + */ + BILLBOARD_PARTICLES = 3, + } + enum TextureChannel { + /** Used to read from the red channel of a texture. */ + TEXTURE_CHANNEL_RED = 0, + + /** Used to read from the green channel of a texture. */ + TEXTURE_CHANNEL_GREEN = 1, + + /** Used to read from the blue channel of a texture. */ + TEXTURE_CHANNEL_BLUE = 2, + + /** Used to read from the alpha channel of a texture. */ + TEXTURE_CHANNEL_ALPHA = 3, + + /** Used to read from the linear (non-perceptual) average of the red, green and blue channels of a texture. */ + TEXTURE_CHANNEL_GRAYSCALE = 4, + } + enum EmissionOperator { + /** Adds the emission color to the color from the emission texture. */ + EMISSION_OP_ADD = 0, + + /** Multiplies the emission color by the color from the emission texture. */ + EMISSION_OP_MULTIPLY = 1, + } + enum DistanceFadeMode { + /** Do not use distance fade. */ + DISTANCE_FADE_DISABLED = 0, + + /** Smoothly fades the object out based on each pixel's distance from the camera using the alpha channel. */ + DISTANCE_FADE_PIXEL_ALPHA = 1, + + /** Smoothly fades the object out based on each pixel's distance from the camera using a dithering approach. Dithering discards pixels based on a set pattern to smoothly fade without enabling transparency. On certain hardware, this can be faster than [constant DISTANCE_FADE_PIXEL_ALPHA]. */ + DISTANCE_FADE_PIXEL_DITHER = 2, + + /** Smoothly fades the object out based on the object's distance from the camera using a dithering approach. Dithering discards pixels based on a set pattern to smoothly fade without enabling transparency. On certain hardware, this can be faster than [constant DISTANCE_FADE_PIXEL_ALPHA] and [constant DISTANCE_FADE_PIXEL_DITHER]. */ + DISTANCE_FADE_OBJECT_DITHER = 3, + } + } + /** Abstract base class for defining the 3D rendering properties of meshes. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_basematerial3d.html + */ + class BaseMaterial3D extends Material { + constructor(identifier?: any) + /** If `true`, enables the specified flag. Flags are optional behavior that can be turned on and off. Only one flag can be enabled at a time with this function, the flag enumerators cannot be bit-masked together to enable or disable multiple flags at once. Flags can also be enabled by setting the corresponding member to `true`. See [enum Flags] enumerator for options. */ + set_flag(flag: BaseMaterial3D.Flags, enable: boolean): void + + /** Returns `true`, if the specified flag is enabled. See [enum Flags] enumerator for options. */ + get_flag(flag: BaseMaterial3D.Flags): boolean + + /** If `true`, enables the specified [enum Feature]. Many features that are available in [BaseMaterial3D]s need to be enabled before use. This way the cost for using the feature is only incurred when specified. Features can also be enabled by setting the corresponding member to `true`. */ + set_feature(feature: BaseMaterial3D.Feature, enable: boolean): void + + /** Returns `true`, if the specified [enum Feature] is enabled. */ + get_feature(feature: BaseMaterial3D.Feature): boolean + + /** Sets the texture for the slot specified by [param param]. See [enum TextureParam] for available slots. */ + set_texture(param: BaseMaterial3D.TextureParam, texture: Texture2D): void + + /** Returns the [Texture2D] associated with the specified [enum TextureParam]. */ + get_texture(param: BaseMaterial3D.TextureParam): Texture2D + + /** The material's transparency mode. Some transparency modes will disable shadow casting. Any transparency mode other than [constant TRANSPARENCY_DISABLED] has a greater performance impact compared to opaque rendering. See also [member blend_mode]. */ + get transparency(): int64 + set transparency(value: int64) + + /** Threshold at which the alpha scissor will discard values. Higher values will result in more pixels being discarded. If the material becomes too opaque at a distance, try increasing [member alpha_scissor_threshold]. If the material disappears at a distance, try decreasing [member alpha_scissor_threshold]. */ + get alpha_scissor_threshold(): float64 + set alpha_scissor_threshold(value: float64) + + /** The hashing scale for Alpha Hash. Recommended values between `0` and `2`. */ + get alpha_hash_scale(): float64 + set alpha_hash_scale(value: float64) + + /** The type of alpha antialiasing to apply. See [enum AlphaAntiAliasing]. */ + get alpha_antialiasing_mode(): int64 + set alpha_antialiasing_mode(value: int64) + + /** Threshold at which antialiasing will be applied on the alpha channel. */ + get alpha_antialiasing_edge(): float64 + set alpha_antialiasing_edge(value: float64) + + /** The material's blend mode. + * + * **Note:** Values other than `Mix` force the object into the transparent pipeline. See [enum BlendMode]. + */ + get blend_mode(): int64 + set blend_mode(value: int64) + + /** Determines which side of the triangle to cull depending on whether the triangle faces towards or away from the camera. See [enum CullMode]. */ + get cull_mode(): int64 + set cull_mode(value: int64) + + /** Determines when depth rendering takes place. See [enum DepthDrawMode]. See also [member transparency]. */ + get depth_draw_mode(): int64 + set depth_draw_mode(value: int64) + + /** If `true`, depth testing is disabled and the object will be drawn in render order. */ + get no_depth_test(): boolean + set no_depth_test(value: boolean) + + /** Sets whether the shading takes place, per-pixel, per-vertex or unshaded. Per-vertex lighting is faster, making it the best choice for mobile applications, however it looks considerably worse than per-pixel. Unshaded rendering is the fastest, but disables all interactions with lights. */ + get shading_mode(): int64 + set shading_mode(value: int64) + + /** The algorithm used for diffuse light scattering. See [enum DiffuseMode]. */ + get diffuse_mode(): int64 + set diffuse_mode(value: int64) + + /** The method for rendering the specular blob. See [enum SpecularMode]. + * + * **Note:** [member specular_mode] only applies to the specular blob. It does not affect specular reflections from the sky, screen-space reflections, [VoxelGI], SDFGI or [ReflectionProbe]s. To disable reflections from these sources as well, set [member metallic_specular] to `0.0` instead. + */ + get specular_mode(): int64 + set specular_mode(value: int64) + + /** If `true`, the object receives no ambient light. */ + get disable_ambient_light(): boolean + set disable_ambient_light(value: boolean) + + /** If `true`, the object will not be affected by fog (neither volumetric nor depth fog). This is useful for unshaded or transparent materials (e.g. particles), which without this setting will be affected even if fully transparent. */ + get disable_fog(): boolean + set disable_fog(value: boolean) + + /** If `true`, the vertex color is used as albedo color. */ + get vertex_color_use_as_albedo(): boolean + set vertex_color_use_as_albedo(value: boolean) + + /** If `true`, vertex colors are considered to be stored in sRGB color space and are converted to linear color space during rendering. If `false`, vertex colors are considered to be stored in linear color space and are rendered as-is. See also [member albedo_texture_force_srgb]. + * + * **Note:** Only effective when using the Forward+ and Mobile rendering methods, not Compatibility. + */ + get vertex_color_is_srgb(): boolean + set vertex_color_is_srgb(value: boolean) + + /** The material's base color. + * + * **Note:** If [member detail_enabled] is `true` and a [member detail_albedo] texture is specified, [member albedo_color] will *not* modulate the detail texture. This can be used to color partial areas of a material by not specifying an albedo texture and using a transparent [member detail_albedo] texture instead. + */ + get albedo_color(): Color + set albedo_color(value: Color) + + /** Texture to multiply by [member albedo_color]. Used for basic texturing of objects. + * If the texture appears unexpectedly too dark or too bright, check [member albedo_texture_force_srgb]. + */ + get albedo_texture(): Texture2D + set albedo_texture(value: Texture2D) + + /** If `true`, forces a conversion of the [member albedo_texture] from sRGB color space to linear color space. See also [member vertex_color_is_srgb]. + * This should only be enabled when needed (typically when using a [ViewportTexture] as [member albedo_texture]). If [member albedo_texture_force_srgb] is `true` when it shouldn't be, the texture will appear to be too dark. If [member albedo_texture_force_srgb] is `false` when it shouldn't be, the texture will appear to be too bright. + */ + get albedo_texture_force_srgb(): boolean + set albedo_texture_force_srgb(value: boolean) + + /** Enables multichannel signed distance field rendering shader. Use [member msdf_pixel_range] and [member msdf_outline_size] to configure MSDF parameters. */ + get albedo_texture_msdf(): boolean + set albedo_texture_msdf(value: boolean) + + /** The Occlusion/Roughness/Metallic texture to use. This is a more efficient replacement of [member ao_texture], [member roughness_texture] and [member metallic_texture] in [ORMMaterial3D]. Ambient occlusion is stored in the red channel. Roughness map is stored in the green channel. Metallic map is stored in the blue channel. The alpha channel is ignored. */ + get orm_texture(): Texture2D + set orm_texture(value: Texture2D) + + /** A high value makes the material appear more like a metal. Non-metals use their albedo as the diffuse color and add diffuse to the specular reflection. With non-metals, the reflection appears on top of the albedo color. Metals use their albedo as a multiplier to the specular reflection and set the diffuse color to black resulting in a tinted reflection. Materials work better when fully metal or fully non-metal, values between `0` and `1` should only be used for blending between metal and non-metal sections. To alter the amount of reflection use [member roughness]. */ + get metallic(): float64 + set metallic(value: float64) + + /** Adjusts the strength of specular reflections. Specular reflections are composed of scene reflections and the specular lobe which is the bright spot that is reflected from light sources. When set to `0.0`, no specular reflections will be visible. This differs from the [constant SPECULAR_DISABLED] [enum SpecularMode] as [constant SPECULAR_DISABLED] only applies to the specular lobe from the light source. + * + * **Note:** Unlike [member metallic], this is not energy-conserving, so it should be left at `0.5` in most cases. See also [member roughness]. + */ + get metallic_specular(): float64 + set metallic_specular(value: float64) + + /** Texture used to specify metallic for an object. This is multiplied by [member metallic]. */ + get metallic_texture(): Texture2D + set metallic_texture(value: Texture2D) + + /** Specifies the channel of the [member metallic_texture] in which the metallic information is stored. This is useful when you store the information for multiple effects in a single texture. For example if you stored metallic in the red channel, roughness in the blue, and ambient occlusion in the green you could reduce the number of textures you use. */ + get metallic_texture_channel(): int64 + set metallic_texture_channel(value: int64) + + /** Surface reflection. A value of `0` represents a perfect mirror while a value of `1` completely blurs the reflection. See also [member metallic]. */ + get roughness(): float64 + set roughness(value: float64) + + /** Texture used to control the roughness per-pixel. Multiplied by [member roughness]. */ + get roughness_texture(): Texture2D + set roughness_texture(value: Texture2D) + + /** Specifies the channel of the [member roughness_texture] in which the roughness information is stored. This is useful when you store the information for multiple effects in a single texture. For example if you stored metallic in the red channel, roughness in the blue, and ambient occlusion in the green you could reduce the number of textures you use. */ + get roughness_texture_channel(): int64 + set roughness_texture_channel(value: int64) + + /** If `true`, the body emits light. Emitting light makes the object appear brighter. The object can also cast light on other objects if a [VoxelGI], SDFGI, or [LightmapGI] is used and this object is used in baked lighting. */ + get emission_enabled(): boolean + set emission_enabled(value: boolean) + + /** The emitted light's color. See [member emission_enabled]. */ + get emission(): Color + set emission(value: Color) + + /** Multiplier for emitted light. See [member emission_enabled]. */ + get emission_energy_multiplier(): float64 + set emission_energy_multiplier(value: float64) + + /** Luminance of emitted light, measured in nits (candela per square meter). Only available when [member ProjectSettings.rendering/lights_and_shadows/use_physical_light_units] is enabled. The default is roughly equivalent to an indoor lightbulb. */ + get emission_intensity(): float64 + set emission_intensity(value: float64) + + /** Sets how [member emission] interacts with [member emission_texture]. Can either add or multiply. See [enum EmissionOperator] for options. */ + get emission_operator(): int64 + set emission_operator(value: int64) + + /** Use `UV2` to read from the [member emission_texture]. */ + get emission_on_uv2(): boolean + set emission_on_uv2(value: boolean) + + /** Texture that specifies how much surface emits light at a given point. */ + get emission_texture(): Texture2D + set emission_texture(value: Texture2D) + + /** If `true`, normal mapping is enabled. This has a slight performance cost, especially on mobile GPUs. */ + get normal_enabled(): boolean + set normal_enabled(value: boolean) + + /** The strength of the normal map's effect. */ + get normal_scale(): float64 + set normal_scale(value: float64) + + /** Texture used to specify the normal at a given pixel. The [member normal_texture] only uses the red and green channels; the blue and alpha channels are ignored. The normal read from [member normal_texture] is oriented around the surface normal provided by the [Mesh]. + * + * **Note:** The mesh must have both normals and tangents defined in its vertex data. Otherwise, the normal map won't render correctly and will only appear to darken the whole surface. If creating geometry with [SurfaceTool], you can use [method SurfaceTool.generate_normals] and [method SurfaceTool.generate_tangents] to automatically generate normals and tangents respectively. + * + * **Note:** Godot expects the normal map to use X+, Y+, and Z+ coordinates. See [url=http://wiki.polycount.com/wiki/Normal_Map_Technical_Details#Common_Swizzle_Coordinates]this page[/url] for a comparison of normal map coordinates expected by popular engines. + * + * **Note:** If [member detail_enabled] is `true`, the [member detail_albedo] texture is drawn *below* the [member normal_texture]. To display a normal map *above* the [member detail_albedo] texture, use [member detail_normal] instead. + */ + get normal_texture(): Texture2D + set normal_texture(value: Texture2D) + + /** If `true`, rim effect is enabled. Rim lighting increases the brightness at glancing angles on an object. + * + * **Note:** Rim lighting is not visible if the material's [member shading_mode] is [constant SHADING_MODE_UNSHADED]. + */ + get rim_enabled(): boolean + set rim_enabled(value: boolean) + + /** Sets the strength of the rim lighting effect. */ + get rim(): float64 + set rim(value: float64) + + /** The amount of to blend light and albedo color when rendering rim effect. If `0` the light color is used, while `1` means albedo color is used. An intermediate value generally works best. */ + get rim_tint(): float64 + set rim_tint(value: float64) + + /** Texture used to set the strength of the rim lighting effect per-pixel. Multiplied by [member rim]. */ + get rim_texture(): Texture2D + set rim_texture(value: Texture2D) + + /** If `true`, clearcoat rendering is enabled. Adds a secondary transparent pass to the lighting calculation resulting in an added specular blob. This makes materials appear as if they have a clear layer on them that can be either glossy or rough. + * + * **Note:** Clearcoat rendering is not visible if the material's [member shading_mode] is [constant SHADING_MODE_UNSHADED]. + */ + get clearcoat_enabled(): boolean + set clearcoat_enabled(value: boolean) + + /** Sets the strength of the clearcoat effect. Setting to `0` looks the same as disabling the clearcoat effect. */ + get clearcoat(): float64 + set clearcoat(value: float64) + + /** Sets the roughness of the clearcoat pass. A higher value results in a rougher clearcoat while a lower value results in a smoother clearcoat. */ + get clearcoat_roughness(): float64 + set clearcoat_roughness(value: float64) + + /** Texture that defines the strength of the clearcoat effect and the glossiness of the clearcoat. Strength is specified in the red channel while glossiness is specified in the green channel. */ + get clearcoat_texture(): Texture2D + set clearcoat_texture(value: Texture2D) + + /** If `true`, anisotropy is enabled. Anisotropy changes the shape of the specular blob and aligns it to tangent space. This is useful for brushed aluminum and hair reflections. + * + * **Note:** Mesh tangents are needed for anisotropy to work. If the mesh does not contain tangents, the anisotropy effect will appear broken. + * + * **Note:** Material anisotropy should not to be confused with anisotropic texture filtering, which can be enabled by setting [member texture_filter] to [constant TEXTURE_FILTER_LINEAR_WITH_MIPMAPS_ANISOTROPIC]. + */ + get anisotropy_enabled(): boolean + set anisotropy_enabled(value: boolean) + + /** The strength of the anisotropy effect. This is multiplied by [member anisotropy_flowmap]'s alpha channel if a texture is defined there and the texture contains an alpha channel. */ + get anisotropy(): float64 + set anisotropy(value: float64) + + /** Texture that offsets the tangent map for anisotropy calculations and optionally controls the anisotropy effect (if an alpha channel is present). The flowmap texture is expected to be a derivative map, with the red channel representing distortion on the X axis and green channel representing distortion on the Y axis. Values below 0.5 will result in negative distortion, whereas values above 0.5 will result in positive distortion. + * If present, the texture's alpha channel will be used to multiply the strength of the [member anisotropy] effect. Fully opaque pixels will keep the anisotropy effect's original strength while fully transparent pixels will disable the anisotropy effect entirely. The flowmap texture's blue channel is ignored. + */ + get anisotropy_flowmap(): Texture2D + set anisotropy_flowmap(value: Texture2D) + + /** If `true`, ambient occlusion is enabled. Ambient occlusion darkens areas based on the [member ao_texture]. */ + get ao_enabled(): boolean + set ao_enabled(value: boolean) + + /** Amount that ambient occlusion affects lighting from lights. If `0`, ambient occlusion only affects ambient light. If `1`, ambient occlusion affects lights just as much as it affects ambient light. This can be used to impact the strength of the ambient occlusion effect, but typically looks unrealistic. */ + get ao_light_affect(): float64 + set ao_light_affect(value: float64) + + /** Texture that defines the amount of ambient occlusion for a given point on the object. */ + get ao_texture(): Texture2D + set ao_texture(value: Texture2D) + + /** If `true`, use `UV2` coordinates to look up from the [member ao_texture]. */ + get ao_on_uv2(): boolean + set ao_on_uv2(value: boolean) + + /** Specifies the channel of the [member ao_texture] in which the ambient occlusion information is stored. This is useful when you store the information for multiple effects in a single texture. For example if you stored metallic in the red channel, roughness in the blue, and ambient occlusion in the green you could reduce the number of textures you use. */ + get ao_texture_channel(): int64 + set ao_texture_channel(value: int64) + + /** If `true`, height mapping is enabled (also called "parallax mapping" or "depth mapping"). See also [member normal_enabled]. Height mapping is a demanding feature on the GPU, so it should only be used on materials where it makes a significant visual difference. + * + * **Note:** Height mapping is not supported if triplanar mapping is used on the same material. The value of [member heightmap_enabled] will be ignored if [member uv1_triplanar] is enabled. + */ + get heightmap_enabled(): boolean + set heightmap_enabled(value: boolean) + + /** The heightmap scale to use for the parallax effect (see [member heightmap_enabled]). The default value is tuned so that the highest point (value = 255) appears to be 5 cm higher than the lowest point (value = 0). Higher values result in a deeper appearance, but may result in artifacts appearing when looking at the material from oblique angles, especially when the camera moves. Negative values can be used to invert the parallax effect, but this is different from inverting the texture using [member heightmap_flip_texture] as the material will also appear to be "closer" to the camera. In most cases, [member heightmap_scale] should be kept to a positive value. + * + * **Note:** If the height map effect looks strange regardless of this value, try adjusting [member heightmap_flip_binormal] and [member heightmap_flip_tangent]. See also [member heightmap_texture] for recommendations on authoring heightmap textures, as the way the heightmap texture is authored affects how [member heightmap_scale] behaves. + */ + get heightmap_scale(): float64 + set heightmap_scale(value: float64) + + /** If `true`, uses parallax occlusion mapping to represent depth in the material instead of simple offset mapping (see [member heightmap_enabled]). This results in a more convincing depth effect, but is much more expensive on the GPU. Only enable this on materials where it makes a significant visual difference. */ + get heightmap_deep_parallax(): boolean + set heightmap_deep_parallax(value: boolean) + + /** The number of layers to use for parallax occlusion mapping when the camera is far away from the material. Higher values result in a more convincing depth effect, especially in materials that have steep height changes. Higher values have a significant cost on the GPU, so it should only be increased on materials where it makes a significant visual difference. + * + * **Note:** Only effective if [member heightmap_deep_parallax] is `true`. + */ + get heightmap_min_layers(): int64 + set heightmap_min_layers(value: int64) + + /** The number of layers to use for parallax occlusion mapping when the camera is up close to the material. Higher values result in a more convincing depth effect, especially in materials that have steep height changes. Higher values have a significant cost on the GPU, so it should only be increased on materials where it makes a significant visual difference. + * + * **Note:** Only effective if [member heightmap_deep_parallax] is `true`. + */ + get heightmap_max_layers(): int64 + set heightmap_max_layers(value: int64) + + /** If `true`, flips the mesh's tangent vectors when interpreting the height map. If the heightmap effect looks strange when the camera moves (even with a reasonable [member heightmap_scale]), try setting this to `true`. */ + get heightmap_flip_tangent(): boolean + set heightmap_flip_tangent(value: boolean) + + /** If `true`, flips the mesh's binormal vectors when interpreting the height map. If the heightmap effect looks strange when the camera moves (even with a reasonable [member heightmap_scale]), try setting this to `true`. */ + get heightmap_flip_binormal(): boolean + set heightmap_flip_binormal(value: boolean) + + /** The texture to use as a height map. See also [member heightmap_enabled]. + * For best results, the texture should be normalized (with [member heightmap_scale] reduced to compensate). In [url=https://gimp.org]GIMP[/url], this can be done using **Colors > Auto > Equalize**. If the texture only uses a small part of its available range, the parallax effect may look strange, especially when the camera moves. + * + * **Note:** To reduce memory usage and improve loading times, you may be able to use a lower-resolution heightmap texture as most heightmaps are only comprised of low-frequency data. + */ + get heightmap_texture(): Texture2D + set heightmap_texture(value: Texture2D) + + /** If `true`, interprets the height map texture as a depth map, with brighter values appearing to be "lower" in altitude compared to darker values. + * This can be enabled for compatibility with some materials authored for Godot 3.x. This is not necessary if the Invert import option was used to invert the depth map in Godot 3.x, in which case [member heightmap_flip_texture] should remain `false`. + */ + get heightmap_flip_texture(): boolean + set heightmap_flip_texture(value: boolean) + + /** If `true`, subsurface scattering is enabled. Emulates light that penetrates an object's surface, is scattered, and then emerges. Subsurface scattering quality is controlled by [member ProjectSettings.rendering/environment/subsurface_scattering/subsurface_scattering_quality]. */ + get subsurf_scatter_enabled(): boolean + set subsurf_scatter_enabled(value: boolean) + + /** The strength of the subsurface scattering effect. The depth of the effect is also controlled by [member ProjectSettings.rendering/environment/subsurface_scattering/subsurface_scattering_scale], which is set globally. */ + get subsurf_scatter_strength(): float64 + set subsurf_scatter_strength(value: float64) + + /** If `true`, subsurface scattering will use a special mode optimized for the color and density of human skin, such as boosting the intensity of the red channel in subsurface scattering. */ + get subsurf_scatter_skin_mode(): boolean + set subsurf_scatter_skin_mode(value: boolean) + + /** Texture used to control the subsurface scattering strength. Stored in the red texture channel. Multiplied by [member subsurf_scatter_strength]. */ + get subsurf_scatter_texture(): Texture2D + set subsurf_scatter_texture(value: Texture2D) + + /** If `true`, enables subsurface scattering transmittance. Only effective if [member subsurf_scatter_enabled] is `true`. See also [member backlight_enabled]. */ + get subsurf_scatter_transmittance_enabled(): boolean + set subsurf_scatter_transmittance_enabled(value: boolean) + + /** The color to multiply the subsurface scattering transmittance effect with. Ignored if [member subsurf_scatter_skin_mode] is `true`. */ + get subsurf_scatter_transmittance_color(): Color + set subsurf_scatter_transmittance_color(value: Color) + + /** The texture to use for multiplying the intensity of the subsurface scattering transmittance intensity. See also [member subsurf_scatter_texture]. Ignored if [member subsurf_scatter_skin_mode] is `true`. */ + get subsurf_scatter_transmittance_texture(): Texture2D + set subsurf_scatter_transmittance_texture(value: Texture2D) + + /** The depth of the subsurface scattering transmittance effect. */ + get subsurf_scatter_transmittance_depth(): float64 + set subsurf_scatter_transmittance_depth(value: float64) + + /** The intensity of the subsurface scattering transmittance effect. */ + get subsurf_scatter_transmittance_boost(): float64 + set subsurf_scatter_transmittance_boost(value: float64) + + /** If `true`, the backlight effect is enabled. See also [member subsurf_scatter_transmittance_enabled]. */ + get backlight_enabled(): boolean + set backlight_enabled(value: boolean) + + /** The color used by the backlight effect. Represents the light passing through an object. */ + get backlight(): Color + set backlight(value: Color) + + /** Texture used to control the backlight effect per-pixel. Added to [member backlight]. */ + get backlight_texture(): Texture2D + set backlight_texture(value: Texture2D) + + /** If `true`, the refraction effect is enabled. Distorts transparency based on light from behind the object. + * + * **Note:** Refraction is implemented using the screen texture. Only opaque materials will appear in the refraction, since transparent materials do not appear in the screen texture. + */ + get refraction_enabled(): boolean + set refraction_enabled(value: boolean) + + /** The strength of the refraction effect. */ + get refraction_scale(): float64 + set refraction_scale(value: float64) + + /** Texture that controls the strength of the refraction per-pixel. Multiplied by [member refraction_scale]. */ + get refraction_texture(): Texture2D + set refraction_texture(value: Texture2D) + + /** Specifies the channel of the [member refraction_texture] in which the refraction information is stored. This is useful when you store the information for multiple effects in a single texture. For example if you stored refraction in the red channel, roughness in the blue, and ambient occlusion in the green you could reduce the number of textures you use. */ + get refraction_texture_channel(): int64 + set refraction_texture_channel(value: int64) + + /** If `true`, enables the detail overlay. Detail is a second texture that gets mixed over the surface of the object based on [member detail_mask] and [member detail_albedo]'s alpha channel. This can be used to add variation to objects, or to blend between two different albedo/normal textures. */ + get detail_enabled(): boolean + set detail_enabled(value: boolean) + + /** Texture used to specify how the detail textures get blended with the base textures. [member detail_mask] can be used together with [member detail_albedo]'s alpha channel (if any). */ + get detail_mask(): Texture2D + set detail_mask(value: Texture2D) + + /** Specifies how the [member detail_albedo] should blend with the current `ALBEDO`. See [enum BlendMode] for options. */ + get detail_blend_mode(): int64 + set detail_blend_mode(value: int64) + + /** Specifies whether to use `UV` or `UV2` for the detail layer. See [enum DetailUV] for options. */ + get detail_uv_layer(): int64 + set detail_uv_layer(value: int64) + + /** Texture that specifies the color of the detail overlay. [member detail_albedo]'s alpha channel is used as a mask, even when the material is opaque. To use a dedicated texture as a mask, see [member detail_mask]. + * + * **Note:** [member detail_albedo] is *not* modulated by [member albedo_color]. + */ + get detail_albedo(): Texture2D + set detail_albedo(value: Texture2D) + + /** Texture that specifies the per-pixel normal of the detail overlay. The [member detail_normal] texture only uses the red and green channels; the blue and alpha channels are ignored. The normal read from [member detail_normal] is oriented around the surface normal provided by the [Mesh]. + * + * **Note:** Godot expects the normal map to use X+, Y+, and Z+ coordinates. See [url=http://wiki.polycount.com/wiki/Normal_Map_Technical_Details#Common_Swizzle_Coordinates]this page[/url] for a comparison of normal map coordinates expected by popular engines. + */ + get detail_normal(): Texture2D + set detail_normal(value: Texture2D) + + /** How much to scale the `UV` coordinates. This is multiplied by `UV` in the vertex function. The Z component is used when [member uv1_triplanar] is enabled, but it is not used anywhere else. */ + get uv1_scale(): Vector3 + set uv1_scale(value: Vector3) + + /** How much to offset the `UV` coordinates. This amount will be added to `UV` in the vertex function. This can be used to offset a texture. The Z component is used when [member uv1_triplanar] is enabled, but it is not used anywhere else. */ + get uv1_offset(): Vector3 + set uv1_offset(value: Vector3) + + /** If `true`, instead of using `UV` textures will use a triplanar texture lookup to determine how to apply textures. Triplanar uses the orientation of the object's surface to blend between texture coordinates. It reads from the source texture 3 times, once for each axis and then blends between the results based on how closely the pixel aligns with each axis. This is often used for natural features to get a realistic blend of materials. Because triplanar texturing requires many more texture reads per-pixel it is much slower than normal UV texturing. Additionally, because it is blending the texture between the three axes, it is unsuitable when you are trying to achieve crisp texturing. */ + get uv1_triplanar(): boolean + set uv1_triplanar(value: boolean) + + /** A lower number blends the texture more softly while a higher number blends the texture more sharply. + * + * **Note:** [member uv1_triplanar_sharpness] is clamped between `0.0` and `150.0` (inclusive) as values outside that range can look broken depending on the mesh. + */ + get uv1_triplanar_sharpness(): float64 + set uv1_triplanar_sharpness(value: float64) + + /** If `true`, triplanar mapping for `UV` is calculated in world space rather than object local space. See also [member uv1_triplanar]. */ + get uv1_world_triplanar(): boolean + set uv1_world_triplanar(value: boolean) + + /** How much to scale the `UV2` coordinates. This is multiplied by `UV2` in the vertex function. The Z component is used when [member uv2_triplanar] is enabled, but it is not used anywhere else. */ + get uv2_scale(): Vector3 + set uv2_scale(value: Vector3) + + /** How much to offset the `UV2` coordinates. This amount will be added to `UV2` in the vertex function. This can be used to offset a texture. The Z component is used when [member uv2_triplanar] is enabled, but it is not used anywhere else. */ + get uv2_offset(): Vector3 + set uv2_offset(value: Vector3) + + /** If `true`, instead of using `UV2` textures will use a triplanar texture lookup to determine how to apply textures. Triplanar uses the orientation of the object's surface to blend between texture coordinates. It reads from the source texture 3 times, once for each axis and then blends between the results based on how closely the pixel aligns with each axis. This is often used for natural features to get a realistic blend of materials. Because triplanar texturing requires many more texture reads per-pixel it is much slower than normal UV texturing. Additionally, because it is blending the texture between the three axes, it is unsuitable when you are trying to achieve crisp texturing. */ + get uv2_triplanar(): boolean + set uv2_triplanar(value: boolean) + + /** A lower number blends the texture more softly while a higher number blends the texture more sharply. + * + * **Note:** [member uv2_triplanar_sharpness] is clamped between `0.0` and `150.0` (inclusive) as values outside that range can look broken depending on the mesh. + */ + get uv2_triplanar_sharpness(): float64 + set uv2_triplanar_sharpness(value: float64) + + /** If `true`, triplanar mapping for `UV2` is calculated in world space rather than object local space. See also [member uv2_triplanar]. */ + get uv2_world_triplanar(): boolean + set uv2_world_triplanar(value: boolean) + + /** Filter flags for the texture. See [enum TextureFilter] for options. + * + * **Note:** [member heightmap_texture] is always sampled with linear filtering, even if nearest-neighbor filtering is selected here. This is to ensure the heightmap effect looks as intended. If you need sharper height transitions between pixels, resize the heightmap texture in an image editor with nearest-neighbor filtering. + */ + get texture_filter(): int64 + set texture_filter(value: int64) + + /** Repeat flags for the texture. See [enum TextureFilter] for options. */ + get texture_repeat(): boolean + set texture_repeat(value: boolean) + + /** If `true`, the object receives no shadow that would otherwise be cast onto it. */ + get disable_receive_shadows(): boolean + set disable_receive_shadows(value: boolean) + + /** If `true`, enables the "shadow to opacity" render mode where lighting modifies the alpha so shadowed areas are opaque and non-shadowed areas are transparent. Useful for overlaying shadows onto a camera feed in AR. */ + get shadow_to_opacity(): boolean + set shadow_to_opacity(value: boolean) + + /** Controls how the object faces the camera. See [enum BillboardMode]. + * + * **Note:** Billboard mode is not suitable for VR because the left-right vector of the camera is not horizontal when the screen is attached to your head instead of on the table. See [url=https://github.com/godotengine/godot/issues/41567]GitHub issue #41567[/url] for details. + */ + get billboard_mode(): int64 + set billboard_mode(value: int64) + + /** If `true`, the shader will keep the scale set for the mesh. Otherwise, the scale is lost when billboarding. Only applies when [member billboard_mode] is not [constant BILLBOARD_DISABLED]. */ + get billboard_keep_scale(): boolean + set billboard_keep_scale(value: boolean) + + /** The number of horizontal frames in the particle sprite sheet. Only enabled when using [constant BILLBOARD_PARTICLES]. See [member billboard_mode]. */ + get particles_anim_h_frames(): int64 + set particles_anim_h_frames(value: int64) + + /** The number of vertical frames in the particle sprite sheet. Only enabled when using [constant BILLBOARD_PARTICLES]. See [member billboard_mode]. */ + get particles_anim_v_frames(): int64 + set particles_anim_v_frames(value: int64) + + /** If `true`, particle animations are looped. Only enabled when using [constant BILLBOARD_PARTICLES]. See [member billboard_mode]. */ + get particles_anim_loop(): boolean + set particles_anim_loop(value: boolean) + + /** If `true`, enables the vertex grow setting. This can be used to create mesh-based outlines using a second material pass and its [member cull_mode] set to [constant CULL_FRONT]. See also [member grow_amount]. + * + * **Note:** Vertex growth cannot create new vertices, which means that visible gaps may occur in sharp corners. This can be alleviated by designing the mesh to use smooth normals exclusively using [url=http://wiki.polycount.com/wiki/Face_weighted_normals]face weighted normals[/url] in the 3D authoring software. In this case, grow will be able to join every outline together, just like in the original mesh. + */ + get grow(): boolean + set grow(value: boolean) + + /** Grows object vertices in the direction of their normals. Only effective if [member grow] is `true`. */ + get grow_amount(): float64 + set grow_amount(value: float64) + + /** If `true`, the object is rendered at the same size regardless of distance. */ + get fixed_size(): boolean + set fixed_size(value: boolean) + + /** If `true`, render point size can be changed. + * + * **Note:** This is only effective for objects whose geometry is point-based rather than triangle-based. See also [member point_size]. + */ + get use_point_size(): boolean + set use_point_size(value: boolean) + + /** The point size in pixels. See [member use_point_size]. */ + get point_size(): float64 + set point_size(value: float64) + + /** If `true`, enables parts of the shader required for [GPUParticles3D] trails to function. This also requires using a mesh with appropriate skinning, such as [RibbonTrailMesh] or [TubeTrailMesh]. Enabling this feature outside of materials used in [GPUParticles3D] meshes will break material rendering. */ + get use_particle_trails(): boolean + set use_particle_trails(value: boolean) + + /** If `true`, the proximity fade effect is enabled. The proximity fade effect fades out each pixel based on its distance to another object. */ + get proximity_fade_enabled(): boolean + set proximity_fade_enabled(value: boolean) + + /** Distance over which the fade effect takes place. The larger the distance the longer it takes for an object to fade. */ + get proximity_fade_distance(): float64 + set proximity_fade_distance(value: float64) + + /** The width of the range around the shape between the minimum and maximum representable signed distance. */ + get msdf_pixel_range(): float64 + set msdf_pixel_range(value: float64) + + /** The width of the shape outline. */ + get msdf_outline_size(): float64 + set msdf_outline_size(value: float64) + + /** Specifies which type of fade to use. Can be any of the [enum DistanceFadeMode]s. */ + get distance_fade_mode(): int64 + set distance_fade_mode(value: int64) + + /** Distance at which the object starts to become visible. If the object is less than this distance away, it will be invisible. + * + * **Note:** If [member distance_fade_min_distance] is greater than [member distance_fade_max_distance], the behavior will be reversed. The object will start to fade away at [member distance_fade_max_distance] and will fully disappear once it reaches [member distance_fade_min_distance]. + */ + get distance_fade_min_distance(): float64 + set distance_fade_min_distance(value: float64) + + /** Distance at which the object appears fully opaque. + * + * **Note:** If [member distance_fade_max_distance] is less than [member distance_fade_min_distance], the behavior will be reversed. The object will start to fade away at [member distance_fade_max_distance] and will fully disappear once it reaches [member distance_fade_min_distance]. + */ + get distance_fade_max_distance(): float64 + set distance_fade_max_distance(value: float64) + } + /** Boolean matrix. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_bitmap.html + */ + class BitMap extends Resource { + constructor(identifier?: any) + /** Creates a bitmap with the specified size, filled with `false`. */ + create(size: Vector2i): void + + /** Creates a bitmap that matches the given image dimensions, every element of the bitmap is set to `false` if the alpha value of the image at that position is equal to [param threshold] or less, and `true` in other case. */ + create_from_image_alpha(image: Image, threshold: float64 = 0.1): void + + /** Sets the bitmap's element at the specified position, to the specified value. */ + set_bitv(position: Vector2i, bit: boolean): void + + /** Sets the bitmap's element at the specified position, to the specified value. */ + set_bit(x: int64, y: int64, bit: boolean): void + + /** Returns bitmap's value at the specified position. */ + get_bitv(position: Vector2i): boolean + + /** Returns bitmap's value at the specified position. */ + get_bit(x: int64, y: int64): boolean + + /** Sets a rectangular portion of the bitmap to the specified value. */ + set_bit_rect(rect: Rect2i, bit: boolean): void + + /** Returns the number of bitmap elements that are set to `true`. */ + get_true_bit_count(): int64 + + /** Returns bitmap's dimensions. */ + get_size(): Vector2i + + /** Resizes the image to [param new_size]. */ + resize(new_size: Vector2i): void + + /** Applies morphological dilation or erosion to the bitmap. If [param pixels] is positive, dilation is applied to the bitmap. If [param pixels] is negative, erosion is applied to the bitmap. [param rect] defines the area where the morphological operation is applied. Pixels located outside the [param rect] are unaffected by [method grow_mask]. */ + grow_mask(pixels: int64, rect: Rect2i): void + + /** Returns an image of the same size as the bitmap and with a [enum Image.Format] of type [constant Image.FORMAT_L8]. `true` bits of the bitmap are being converted into white pixels, and `false` bits into black. */ + convert_to_image(): Image + + /** Creates an [Array] of polygons covering a rectangular portion of the bitmap. It uses a marching squares algorithm, followed by Ramer-Douglas-Peucker (RDP) reduction of the number of vertices. Each polygon is described as a [PackedVector2Array] of its vertices. + * To get polygons covering the whole bitmap, pass: + * + * [param epsilon] is passed to RDP to control how accurately the polygons cover the bitmap: a lower [param epsilon] corresponds to more points in the polygons. + */ + opaque_to_polygons(rect: Rect2i, epsilon: float64 = 2): GArray + get data(): GDictionary + set data(value: GDictionary) + } + class BitMapEditorPlugin = Record> extends EditorPlugin { + constructor(identifier?: any) + } + /** A joint used with [Skeleton2D] to control and animate other nodes. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_bone2d.html + */ + class Bone2D = Record> extends Node2D { + constructor(identifier?: any) + /** Resets the bone to the rest pose. This is equivalent to setting [member Node2D.transform] to [member rest]. */ + apply_rest(): void + + /** Returns the node's [member rest] [Transform2D] if it doesn't have a parent, or its rest pose relative to its parent. */ + get_skeleton_rest(): Transform2D + + /** Returns the node's index as part of the entire skeleton. See [Skeleton2D]. */ + get_index_in_skeleton(): int64 + + /** When set to `true`, the [Bone2D] node will attempt to automatically calculate the bone angle and length using the first child [Bone2D] node, if one exists. If none exist, the [Bone2D] cannot automatically calculate these values and will print a warning. */ + set_autocalculate_length_and_angle(auto_calculate: boolean): void + + /** Returns whether this [Bone2D] is going to autocalculate its length and bone angle using its first [Bone2D] child node, if one exists. If there are no [Bone2D] children, then it cannot autocalculate these values and will print a warning. */ + get_autocalculate_length_and_angle(): boolean + + /** Sets the length of the bone in the [Bone2D]. */ + set_length(length: float64): void + + /** Returns the length of the bone in the [Bone2D] node. */ + get_length(): float64 + + /** Sets the bone angle for the [Bone2D]. This is typically set to the rotation from the [Bone2D] to a child [Bone2D] node. + * + * **Note:** This is different from the [Bone2D]'s rotation. The bone's angle is the rotation of the bone shown by the gizmo, which is unaffected by the [Bone2D]'s [member Node2D.transform]. + */ + set_bone_angle(angle: float64): void + + /** Returns the angle of the bone in the [Bone2D]. + * + * **Note:** This is different from the [Bone2D]'s rotation. The bone's angle is the rotation of the bone shown by the gizmo, which is unaffected by the [Bone2D]'s [member Node2D.transform]. + */ + get_bone_angle(): float64 + + /** Rest transform of the bone. You can reset the node's transforms to this value using [method apply_rest]. */ + get rest(): Transform2D + set rest(value: Transform2D) + } + /** А node that dynamically copies or overrides the 3D transform of a bone in its parent [Skeleton3D]. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_boneattachment3d.html + */ + class BoneAttachment3D = Record> extends Node3D { + constructor(identifier?: any) + /** Get parent or external [Skeleton3D] node if found. */ + get_skeleton(): Skeleton3D + + /** A function that is called automatically when the [Skeleton3D] is updated. This function is where the [BoneAttachment3D] node updates its position so it is correctly bound when it is *not* set to override the bone pose. */ + on_skeleton_update(): void + + /** Sets whether the BoneAttachment3D node will use an external [Skeleton3D] node rather than attempting to use its parent node as the [Skeleton3D]. When set to `true`, the BoneAttachment3D node will use the external [Skeleton3D] node set in [method set_external_skeleton]. */ + set_use_external_skeleton(use_external_skeleton: boolean): void + + /** Returns whether the BoneAttachment3D node is using an external [Skeleton3D] rather than attempting to use its parent node as the [Skeleton3D]. */ + get_use_external_skeleton(): boolean + + /** Sets the [NodePath] to the external skeleton that the BoneAttachment3D node should use. See [method set_use_external_skeleton] to enable the external [Skeleton3D] node. */ + set_external_skeleton(external_skeleton: NodePath | string): void + + /** Returns the [NodePath] to the external [Skeleton3D] node, if one has been set. */ + get_external_skeleton(): NodePath + + /** The name of the attached bone. */ + get bone_name(): StringName + set bone_name(value: StringName) + + /** The index of the attached bone. */ + get bone_idx(): int64 + set bone_idx(value: int64) + + /** Whether the BoneAttachment3D node will override the bone pose of the bone it is attached to. When set to `true`, the BoneAttachment3D node can change the pose of the bone. When set to `false`, the BoneAttachment3D will always be set to the bone's transform. + * + * **Note:** This override performs interruptively in the skeleton update process using signals due to the old design. It may cause unintended behavior when used at the same time with [SkeletonModifier3D]. + */ + get override_pose(): boolean + set override_pose(value: boolean) + } + /** Describes a mapping of bone names for retargeting [Skeleton3D] into common names defined by a [SkeletonProfile]. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_bonemap.html + */ + class BoneMap extends Resource { + constructor(identifier?: any) + /** Returns a skeleton bone name is mapped to [param profile_bone_name]. + * In the retargeting process, the returned bone name is the bone name of the source skeleton. + */ + get_skeleton_bone_name(profile_bone_name: StringName): StringName + + /** Maps a skeleton bone name to [param profile_bone_name]. + * In the retargeting process, the setting bone name is the bone name of the source skeleton. + */ + set_skeleton_bone_name(profile_bone_name: StringName, skeleton_bone_name: StringName): void + + /** Returns a profile bone name having [param skeleton_bone_name]. If not found, an empty [StringName] will be returned. + * In the retargeting process, the returned bone name is the bone name of the target skeleton. + */ + find_profile_bone_name(skeleton_bone_name: StringName): StringName + + /** A [SkeletonProfile] of the mapping target. Key names in the [BoneMap] are synchronized with it. */ + get profile(): SkeletonProfile + set profile(value: SkeletonProfile) + + /** This signal is emitted when change the key value in the [BoneMap]. This is used to validate mapping and to update [BoneMap] editor. */ + readonly bone_map_updated: Signal0 + + /** This signal is emitted when change the value in profile or change the reference of profile. This is used to update key names in the [BoneMap] and to redraw the [BoneMap] editor. */ + readonly profile_updated: Signal0 + } + class BoneMapEditorPlugin = Record> extends EditorPlugin { + constructor(identifier?: any) + } + namespace BoxContainer { + enum AlignmentMode { + /** The child controls will be arranged at the beginning of the container, i.e. top if orientation is vertical, left if orientation is horizontal (right for RTL layout). */ + ALIGNMENT_BEGIN = 0, + + /** The child controls will be centered in the container. */ + ALIGNMENT_CENTER = 1, + + /** The child controls will be arranged at the end of the container, i.e. bottom if orientation is vertical, right if orientation is horizontal (left for RTL layout). */ + ALIGNMENT_END = 2, + } + } + /** A container that arranges its child controls horizontally or vertically. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_boxcontainer.html + */ + class BoxContainer = Record> extends Container { + constructor(identifier?: any) + /** Adds a [Control] node to the box as a spacer. If [param begin] is `true`, it will insert the [Control] node in front of all other children. */ + add_spacer(begin: boolean): Control + + /** The alignment of the container's children (must be one of [constant ALIGNMENT_BEGIN], [constant ALIGNMENT_CENTER], or [constant ALIGNMENT_END]). */ + get alignment(): int64 + set alignment(value: int64) + + /** If `true`, the [BoxContainer] will arrange its children vertically, rather than horizontally. + * Can't be changed when using [HBoxContainer] and [VBoxContainer]. + */ + get vertical(): boolean + set vertical(value: boolean) + } + /** Generate an axis-aligned box [PrimitiveMesh]. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_boxmesh.html + */ + class BoxMesh extends PrimitiveMesh { + constructor(identifier?: any) + /** The box's width, height and depth. */ + get size(): Vector3 + set size(value: Vector3) + + /** Number of extra edge loops inserted along the X axis. */ + get subdivide_width(): int64 + set subdivide_width(value: int64) + + /** Number of extra edge loops inserted along the Y axis. */ + get subdivide_height(): int64 + set subdivide_height(value: int64) + + /** Number of extra edge loops inserted along the Z axis. */ + get subdivide_depth(): int64 + set subdivide_depth(value: int64) + } + /** Cuboid shape for use with occlusion culling in [OccluderInstance3D]. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_boxoccluder3d.html + */ + class BoxOccluder3D extends Occluder3D { + constructor(identifier?: any) + /** The box's size in 3D units. */ + get size(): Vector3 + set size(value: Vector3) + } + /** A 3D box shape used for physics collision. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_boxshape3d.html + */ + class BoxShape3D extends Shape3D { + constructor(identifier?: any) + /** The box's width, height and depth. */ + get size(): Vector3 + set size(value: Vector3) + } + /** A themed button that can contain text and an icon. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_button.html + */ + class Button = Record> extends BaseButton { + constructor(identifier?: any) + /** The button's text that will be displayed inside the button's area. */ + get text(): string + set text(value: string) + + /** Button's icon, if text is present the icon will be placed before the text. + * To edit margin and spacing of the icon, use [theme_item h_separation] theme property and `content_margin_*` properties of the used [StyleBox]es. + */ + get icon(): Texture2D + set icon(value: Texture2D) + + /** Flat buttons don't display decoration. */ + get flat(): boolean + set flat(value: boolean) + + /** Text alignment policy for the button's text, use one of the [enum HorizontalAlignment] constants. */ + get alignment(): int64 + set alignment(value: int64) + + /** Sets the clipping behavior when the text exceeds the node's bounding rectangle. See [enum TextServer.OverrunBehavior] for a description of all modes. */ + get text_overrun_behavior(): int64 + set text_overrun_behavior(value: int64) + + /** If set to something other than [constant TextServer.AUTOWRAP_OFF], the text gets wrapped inside the node's bounding rectangle. */ + get autowrap_mode(): int64 + set autowrap_mode(value: int64) + + /** If `true`, text that is too large to fit the button is clipped horizontally. If `false`, the button will always be wide enough to hold the text. The text is not vertically clipped, and the button's height is not affected by this property. */ + get clip_text(): boolean + set clip_text(value: boolean) + + /** Specifies if the icon should be aligned horizontally to the left, right, or center of a button. Uses the same [enum HorizontalAlignment] constants as the text alignment. If centered horizontally and vertically, text will draw on top of the icon. */ + get icon_alignment(): int64 + set icon_alignment(value: int64) + + /** Specifies if the icon should be aligned vertically to the top, bottom, or center of a button. Uses the same [enum VerticalAlignment] constants as the text alignment. If centered horizontally and vertically, text will draw on top of the icon. */ + get vertical_icon_alignment(): int64 + set vertical_icon_alignment(value: int64) + + /** When enabled, the button's icon will expand/shrink to fit the button's size while keeping its aspect. See also [theme_item icon_max_width]. */ + get expand_icon(): boolean + set expand_icon(value: boolean) + + /** Base text writing direction. */ + get text_direction(): int64 + set text_direction(value: int64) + + /** Language code used for line-breaking and text shaping algorithms, if left empty current locale is used instead. */ + get language(): string + set language(value: string) + } + /** A group of buttons that doesn't allow more than one button to be pressed at a time. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_buttongroup.html + */ + class ButtonGroup extends Resource { + constructor(identifier?: any) + /** Returns the current pressed button. */ + get_pressed_button(): BaseButton + + /** Returns an [Array] of [Button]s who have this as their [ButtonGroup] (see [member BaseButton.button_group]). */ + get_buttons(): GArray + + /** If `true`, it is possible to unpress all buttons in this [ButtonGroup]. */ + get allow_unpress(): boolean + set allow_unpress(value: boolean) + + /** Emitted when one of the buttons of the group is pressed. */ + readonly pressed: Signal1 + } + namespace CPUParticles2D { + enum DrawOrder { + /** Particles are drawn in the order emitted. */ + DRAW_ORDER_INDEX = 0, + + /** Particles are drawn in order of remaining lifetime. In other words, the particle with the highest lifetime is drawn at the front. */ + DRAW_ORDER_LIFETIME = 1, + } + enum Parameter { + /** Use with [method set_param_min], [method set_param_max], and [method set_param_curve] to set initial velocity properties. */ + PARAM_INITIAL_LINEAR_VELOCITY = 0, + + /** Use with [method set_param_min], [method set_param_max], and [method set_param_curve] to set angular velocity properties. */ + PARAM_ANGULAR_VELOCITY = 1, + + /** Use with [method set_param_min], [method set_param_max], and [method set_param_curve] to set orbital velocity properties. */ + PARAM_ORBIT_VELOCITY = 2, + + /** Use with [method set_param_min], [method set_param_max], and [method set_param_curve] to set linear acceleration properties. */ + PARAM_LINEAR_ACCEL = 3, + + /** Use with [method set_param_min], [method set_param_max], and [method set_param_curve] to set radial acceleration properties. */ + PARAM_RADIAL_ACCEL = 4, + + /** Use with [method set_param_min], [method set_param_max], and [method set_param_curve] to set tangential acceleration properties. */ + PARAM_TANGENTIAL_ACCEL = 5, + + /** Use with [method set_param_min], [method set_param_max], and [method set_param_curve] to set damping properties. */ + PARAM_DAMPING = 6, + + /** Use with [method set_param_min], [method set_param_max], and [method set_param_curve] to set angle properties. */ + PARAM_ANGLE = 7, + + /** Use with [method set_param_min], [method set_param_max], and [method set_param_curve] to set scale properties. */ + PARAM_SCALE = 8, + + /** Use with [method set_param_min], [method set_param_max], and [method set_param_curve] to set hue variation properties. */ + PARAM_HUE_VARIATION = 9, + + /** Use with [method set_param_min], [method set_param_max], and [method set_param_curve] to set animation speed properties. */ + PARAM_ANIM_SPEED = 10, + + /** Use with [method set_param_min], [method set_param_max], and [method set_param_curve] to set animation offset properties. */ + PARAM_ANIM_OFFSET = 11, + + /** Represents the size of the [enum Parameter] enum. */ + PARAM_MAX = 12, + } + enum ParticleFlags { + /** Use with [method set_particle_flag] to set [member particle_flag_align_y]. */ + PARTICLE_FLAG_ALIGN_Y_TO_VELOCITY = 0, + + /** Present for consistency with 3D particle nodes, not used in 2D. */ + PARTICLE_FLAG_ROTATE_Y = 1, + + /** Present for consistency with 3D particle nodes, not used in 2D. */ + PARTICLE_FLAG_DISABLE_Z = 2, + + /** Represents the size of the [enum ParticleFlags] enum. */ + PARTICLE_FLAG_MAX = 3, + } + enum EmissionShape { + /** All particles will be emitted from a single point. */ + EMISSION_SHAPE_POINT = 0, + + /** Particles will be emitted in the volume of a sphere flattened to two dimensions. */ + EMISSION_SHAPE_SPHERE = 1, + + /** Particles will be emitted on the surface of a sphere flattened to two dimensions. */ + EMISSION_SHAPE_SPHERE_SURFACE = 2, + + /** Particles will be emitted in the area of a rectangle. */ + EMISSION_SHAPE_RECTANGLE = 3, + + /** Particles will be emitted at a position chosen randomly among [member emission_points]. Particle color will be modulated by [member emission_colors]. */ + EMISSION_SHAPE_POINTS = 4, + + /** Particles will be emitted at a position chosen randomly among [member emission_points]. Particle velocity and rotation will be set based on [member emission_normals]. Particle color will be modulated by [member emission_colors]. */ + EMISSION_SHAPE_DIRECTED_POINTS = 5, + + /** Represents the size of the [enum EmissionShape] enum. */ + EMISSION_SHAPE_MAX = 6, + } + } + /** A CPU-based 2D particle emitter. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_cpuparticles2d.html + */ + class CPUParticles2D = Record> extends Node2D { + constructor(identifier?: any) + /** Requests the particles to process for extra process time during a single frame. + * Useful for particle playback, if used in combination with [member use_fixed_seed] or by calling [method restart] with parameter `keep_seed` set to `true`. + */ + request_particles_process(process_time: float64): void + + /** Restarts the particle emitter. + * If [param keep_seed] is `true`, the current random seed will be preserved. Useful for seeking and playback. + */ + restart(keep_seed: boolean = false): void + + /** Sets the minimum value for the given parameter. */ + set_param_min(param: CPUParticles2D.Parameter, value: float64): void + + /** Returns the minimum value range for the given parameter. */ + get_param_min(param: CPUParticles2D.Parameter): float64 + + /** Sets the maximum value for the given parameter. */ + set_param_max(param: CPUParticles2D.Parameter, value: float64): void + + /** Returns the maximum value range for the given parameter. */ + get_param_max(param: CPUParticles2D.Parameter): float64 + + /** Sets the [Curve] of the parameter specified by [enum Parameter]. Should be a unit [Curve]. */ + set_param_curve(param: CPUParticles2D.Parameter, curve: Curve): void + + /** Returns the [Curve] of the parameter specified by [enum Parameter]. */ + get_param_curve(param: CPUParticles2D.Parameter): Curve + + /** Enables or disables the given flag (see [enum ParticleFlags] for options). */ + set_particle_flag(particle_flag: CPUParticles2D.ParticleFlags, enable: boolean): void + + /** Returns the enabled state of the given particle flag (see [enum ParticleFlags] for options). */ + get_particle_flag(particle_flag: CPUParticles2D.ParticleFlags): boolean + + /** Sets this node's properties to match a given [GPUParticles2D] node with an assigned [ParticleProcessMaterial]. */ + convert_from_particles(particles: Node): void + + /** If `true`, particles are being emitted. [member emitting] can be used to start and stop particles from emitting. However, if [member one_shot] is `true` setting [member emitting] to `true` will not restart the emission cycle until after all active particles finish processing. You can use the [signal finished] signal to be notified once all active particles finish processing. */ + get emitting(): boolean + set emitting(value: boolean) + + /** Number of particles emitted in one emission cycle. */ + get amount(): int64 + set amount(value: int64) + + /** Particle texture. If `null`, particles will be squares. */ + get texture(): Texture2D + set texture(value: Texture2D) + + /** Amount of time each particle will exist. */ + get lifetime(): float64 + set lifetime(value: float64) + + /** If `true`, only one emission cycle occurs. If set `true` during a cycle, emission will stop at the cycle's end. */ + get one_shot(): boolean + set one_shot(value: boolean) + + /** Particle system starts as if it had already run for this many seconds. */ + get preprocess(): float64 + set preprocess(value: float64) + + /** Particle system's running speed scaling ratio. A value of `0` can be used to pause the particles. */ + get speed_scale(): float64 + set speed_scale(value: float64) + + /** How rapidly particles in an emission cycle are emitted. If greater than `0`, there will be a gap in emissions before the next cycle begins. */ + get explosiveness(): float64 + set explosiveness(value: float64) + + /** Emission lifetime randomness ratio. */ + get randomness(): float64 + set randomness(value: float64) + + /** If `true`, particles will use the same seed for every simulation using the seed defined in [member seed]. This is useful for situations where the visual outcome should be consistent across replays, for example when using Movie Maker mode. */ + get use_fixed_seed(): boolean + set use_fixed_seed(value: boolean) + + /** Sets the random seed used by the particle system. Only effective if [member use_fixed_seed] is `true`. */ + get seed(): int64 + set seed(value: int64) + + /** Particle lifetime randomness ratio. */ + get lifetime_randomness(): float64 + set lifetime_randomness(value: float64) + + /** The particle system's frame rate is fixed to a value. For example, changing the value to 2 will make the particles render at 2 frames per second. Note this does not slow down the simulation of the particle system itself. */ + get fixed_fps(): int64 + set fixed_fps(value: int64) + + /** If `true`, results in fractional delta calculation which has a smoother particles display effect. */ + get fract_delta(): boolean + set fract_delta(value: boolean) + + /** If `true`, particles use the parent node's coordinate space (known as local coordinates). This will cause particles to move and rotate along the [CPUParticles2D] node (and its parents) when it is moved or rotated. If `false`, particles use global coordinates; they will not move or rotate along the [CPUParticles2D] node (and its parents) when it is moved or rotated. */ + get local_coords(): boolean + set local_coords(value: boolean) + + /** Particle draw order. Uses [enum DrawOrder] values. */ + get draw_order(): int64 + set draw_order(value: int64) + + /** Particles will be emitted inside this region. See [enum EmissionShape] for possible values. */ + get emission_shape(): int64 + set emission_shape(value: int64) + + /** The sphere's radius if [member emission_shape] is set to [constant EMISSION_SHAPE_SPHERE]. */ + get emission_sphere_radius(): float64 + set emission_sphere_radius(value: float64) + + /** The rectangle's extents if [member emission_shape] is set to [constant EMISSION_SHAPE_RECTANGLE]. */ + get emission_rect_extents(): Vector2 + set emission_rect_extents(value: Vector2) + + /** Sets the initial positions to spawn particles when using [constant EMISSION_SHAPE_POINTS] or [constant EMISSION_SHAPE_DIRECTED_POINTS]. */ + get emission_points(): PackedVector2Array + set emission_points(value: PackedVector2Array | Vector2[]) + + /** Sets the direction the particles will be emitted in when using [constant EMISSION_SHAPE_DIRECTED_POINTS]. */ + get emission_normals(): PackedVector2Array + set emission_normals(value: PackedVector2Array | Vector2[]) + + /** Sets the [Color]s to modulate particles by when using [constant EMISSION_SHAPE_POINTS] or [constant EMISSION_SHAPE_DIRECTED_POINTS]. */ + get emission_colors(): PackedColorArray + set emission_colors(value: PackedColorArray | Color[]) + + /** Align Y axis of particle with the direction of its velocity. */ + get particle_flag_align_y(): boolean + set particle_flag_align_y(value: boolean) + + /** Unit vector specifying the particles' emission direction. */ + get direction(): Vector2 + set direction(value: Vector2) + + /** Each particle's initial direction range from `+spread` to `-spread` degrees. */ + get spread(): float64 + set spread(value: float64) + + /** Gravity applied to every particle. */ + get gravity(): Vector2 + set gravity(value: Vector2) + + /** Minimum equivalent of [member initial_velocity_max]. */ + get initial_velocity_min(): float64 + set initial_velocity_min(value: float64) + + /** Maximum initial velocity magnitude for each particle. Direction comes from [member direction] and [member spread]. */ + get initial_velocity_max(): float64 + set initial_velocity_max(value: float64) + + /** Minimum equivalent of [member angular_velocity_max]. */ + get angular_velocity_min(): float64 + set angular_velocity_min(value: float64) + + /** Maximum initial angular velocity (rotation speed) applied to each particle in *degrees* per second. */ + get angular_velocity_max(): float64 + set angular_velocity_max(value: float64) + + /** Each particle's angular velocity will vary along this [Curve]. Should be a unit [Curve]. */ + get angular_velocity_curve(): Curve + set angular_velocity_curve(value: Curve) + + /** Minimum equivalent of [member orbit_velocity_max]. */ + get orbit_velocity_min(): float64 + set orbit_velocity_min(value: float64) + + /** Maximum orbital velocity applied to each particle. Makes the particles circle around origin. Specified in number of full rotations around origin per second. */ + get orbit_velocity_max(): float64 + set orbit_velocity_max(value: float64) + + /** Each particle's orbital velocity will vary along this [Curve]. Should be a unit [Curve]. */ + get orbit_velocity_curve(): Curve + set orbit_velocity_curve(value: Curve) + + /** Minimum equivalent of [member linear_accel_max]. */ + get linear_accel_min(): float64 + set linear_accel_min(value: float64) + + /** Maximum linear acceleration applied to each particle in the direction of motion. */ + get linear_accel_max(): float64 + set linear_accel_max(value: float64) + + /** Each particle's linear acceleration will vary along this [Curve]. Should be a unit [Curve]. */ + get linear_accel_curve(): Curve + set linear_accel_curve(value: Curve) + + /** Minimum equivalent of [member radial_accel_max]. */ + get radial_accel_min(): float64 + set radial_accel_min(value: float64) + + /** Maximum radial acceleration applied to each particle. Makes particle accelerate away from the origin or towards it if negative. */ + get radial_accel_max(): float64 + set radial_accel_max(value: float64) + + /** Each particle's radial acceleration will vary along this [Curve]. Should be a unit [Curve]. */ + get radial_accel_curve(): Curve + set radial_accel_curve(value: Curve) + + /** Minimum equivalent of [member tangential_accel_max]. */ + get tangential_accel_min(): float64 + set tangential_accel_min(value: float64) + + /** Maximum tangential acceleration applied to each particle. Tangential acceleration is perpendicular to the particle's velocity giving the particles a swirling motion. */ + get tangential_accel_max(): float64 + set tangential_accel_max(value: float64) + + /** Each particle's tangential acceleration will vary along this [Curve]. Should be a unit [Curve]. */ + get tangential_accel_curve(): Curve + set tangential_accel_curve(value: Curve) + + /** Minimum equivalent of [member damping_max]. */ + get damping_min(): float64 + set damping_min(value: float64) + + /** The maximum rate at which particles lose velocity. For example value of `100` means that the particle will go from `100` velocity to `0` in `1` second. */ + get damping_max(): float64 + set damping_max(value: float64) + + /** Damping will vary along this [Curve]. Should be a unit [Curve]. */ + get damping_curve(): Curve + set damping_curve(value: Curve) + + /** Minimum equivalent of [member angle_max]. */ + get angle_min(): float64 + set angle_min(value: float64) + + /** Maximum initial rotation applied to each particle, in degrees. */ + get angle_max(): float64 + set angle_max(value: float64) + + /** Each particle's rotation will be animated along this [Curve]. Should be a unit [Curve]. */ + get angle_curve(): Curve + set angle_curve(value: Curve) + + /** Minimum equivalent of [member scale_amount_max]. */ + get scale_amount_min(): float64 + set scale_amount_min(value: float64) + + /** Maximum initial scale applied to each particle. */ + get scale_amount_max(): float64 + set scale_amount_max(value: float64) + + /** Each particle's scale will vary along this [Curve]. Should be a unit [Curve]. */ + get scale_amount_curve(): Curve + set scale_amount_curve(value: Curve) + + /** If `true`, the scale curve will be split into x and y components. See [member scale_curve_x] and [member scale_curve_y]. */ + get split_scale(): boolean + set split_scale(value: boolean) + + /** Each particle's horizontal scale will vary along this [Curve]. Should be a unit [Curve]. + * [member split_scale] must be enabled. + */ + get scale_curve_x(): Curve + set scale_curve_x(value: Curve) + + /** Each particle's vertical scale will vary along this [Curve]. Should be a unit [Curve]. + * [member split_scale] must be enabled. + */ + get scale_curve_y(): Curve + set scale_curve_y(value: Curve) + + /** Each particle's initial color. If [member texture] is defined, it will be multiplied by this color. */ + get color(): Color + set color(value: Color) + + /** Each particle's color will vary along this [Gradient] over its lifetime (multiplied with [member color]). */ + get color_ramp(): Gradient + set color_ramp(value: Gradient) + + /** Each particle's initial color will vary along this [Gradient] (multiplied with [member color]). */ + get color_initial_ramp(): Gradient + set color_initial_ramp(value: Gradient) + + /** Minimum equivalent of [member hue_variation_max]. */ + get hue_variation_min(): float64 + set hue_variation_min(value: float64) + + /** Maximum initial hue variation applied to each particle. It will shift the particle color's hue. */ + get hue_variation_max(): float64 + set hue_variation_max(value: float64) + + /** Each particle's hue will vary along this [Curve]. Should be a unit [Curve]. */ + get hue_variation_curve(): Curve + set hue_variation_curve(value: Curve) + + /** Minimum equivalent of [member anim_speed_max]. */ + get anim_speed_min(): float64 + set anim_speed_min(value: float64) + + /** Maximum particle animation speed. Animation speed of `1` means that the particles will make full `0` to `1` offset cycle during lifetime, `2` means `2` cycles etc. + * With animation speed greater than `1`, remember to enable [member CanvasItemMaterial.particles_anim_loop] property if you want the animation to repeat. + */ + get anim_speed_max(): float64 + set anim_speed_max(value: float64) + + /** Each particle's animation speed will vary along this [Curve]. Should be a unit [Curve]. */ + get anim_speed_curve(): Curve + set anim_speed_curve(value: Curve) + + /** Minimum equivalent of [member anim_offset_max]. */ + get anim_offset_min(): float64 + set anim_offset_min(value: float64) + + /** Maximum animation offset that corresponds to frame index in the texture. `0` is the first frame, `1` is the last one. See [member CanvasItemMaterial.particles_animation]. */ + get anim_offset_max(): float64 + set anim_offset_max(value: float64) + + /** Each particle's animation offset will vary along this [Curve]. Should be a unit [Curve]. */ + get anim_offset_curve(): Curve + set anim_offset_curve(value: Curve) + + /** Emitted when all active particles have finished processing. When [member one_shot] is disabled, particles will process continuously, so this is never emitted. */ + readonly finished: Signal0 + } + class CPUParticles2DEditorPlugin = Record> extends Particles2DEditorPlugin { + constructor(identifier?: any) + } + namespace CPUParticles3D { + enum DrawOrder { + /** Particles are drawn in the order emitted. */ + DRAW_ORDER_INDEX = 0, + + /** Particles are drawn in order of remaining lifetime. In other words, the particle with the highest lifetime is drawn at the front. */ + DRAW_ORDER_LIFETIME = 1, + + /** Particles are drawn in order of depth. */ + DRAW_ORDER_VIEW_DEPTH = 2, + } + enum Parameter { + /** Use with [method set_param_min], [method set_param_max], and [method set_param_curve] to set initial velocity properties. */ + PARAM_INITIAL_LINEAR_VELOCITY = 0, + + /** Use with [method set_param_min], [method set_param_max], and [method set_param_curve] to set angular velocity properties. */ + PARAM_ANGULAR_VELOCITY = 1, + + /** Use with [method set_param_min], [method set_param_max], and [method set_param_curve] to set orbital velocity properties. */ + PARAM_ORBIT_VELOCITY = 2, + + /** Use with [method set_param_min], [method set_param_max], and [method set_param_curve] to set linear acceleration properties. */ + PARAM_LINEAR_ACCEL = 3, + + /** Use with [method set_param_min], [method set_param_max], and [method set_param_curve] to set radial acceleration properties. */ + PARAM_RADIAL_ACCEL = 4, + + /** Use with [method set_param_min], [method set_param_max], and [method set_param_curve] to set tangential acceleration properties. */ + PARAM_TANGENTIAL_ACCEL = 5, + + /** Use with [method set_param_min], [method set_param_max], and [method set_param_curve] to set damping properties. */ + PARAM_DAMPING = 6, + + /** Use with [method set_param_min], [method set_param_max], and [method set_param_curve] to set angle properties. */ + PARAM_ANGLE = 7, + + /** Use with [method set_param_min], [method set_param_max], and [method set_param_curve] to set scale properties. */ + PARAM_SCALE = 8, + + /** Use with [method set_param_min], [method set_param_max], and [method set_param_curve] to set hue variation properties. */ + PARAM_HUE_VARIATION = 9, + + /** Use with [method set_param_min], [method set_param_max], and [method set_param_curve] to set animation speed properties. */ + PARAM_ANIM_SPEED = 10, + + /** Use with [method set_param_min], [method set_param_max], and [method set_param_curve] to set animation offset properties. */ + PARAM_ANIM_OFFSET = 11, + + /** Represents the size of the [enum Parameter] enum. */ + PARAM_MAX = 12, + } + enum ParticleFlags { + /** Use with [method set_particle_flag] to set [member particle_flag_align_y]. */ + PARTICLE_FLAG_ALIGN_Y_TO_VELOCITY = 0, + + /** Use with [method set_particle_flag] to set [member particle_flag_rotate_y]. */ + PARTICLE_FLAG_ROTATE_Y = 1, + + /** Use with [method set_particle_flag] to set [member particle_flag_disable_z]. */ + PARTICLE_FLAG_DISABLE_Z = 2, + + /** Represents the size of the [enum ParticleFlags] enum. */ + PARTICLE_FLAG_MAX = 3, + } + enum EmissionShape { + /** All particles will be emitted from a single point. */ + EMISSION_SHAPE_POINT = 0, + + /** Particles will be emitted in the volume of a sphere. */ + EMISSION_SHAPE_SPHERE = 1, + + /** Particles will be emitted on the surface of a sphere. */ + EMISSION_SHAPE_SPHERE_SURFACE = 2, + + /** Particles will be emitted in the volume of a box. */ + EMISSION_SHAPE_BOX = 3, + + /** Particles will be emitted at a position chosen randomly among [member emission_points]. Particle color will be modulated by [member emission_colors]. */ + EMISSION_SHAPE_POINTS = 4, + + /** Particles will be emitted at a position chosen randomly among [member emission_points]. Particle velocity and rotation will be set based on [member emission_normals]. Particle color will be modulated by [member emission_colors]. */ + EMISSION_SHAPE_DIRECTED_POINTS = 5, + + /** Particles will be emitted in a ring or cylinder. */ + EMISSION_SHAPE_RING = 6, + + /** Represents the size of the [enum EmissionShape] enum. */ + EMISSION_SHAPE_MAX = 7, + } + } + /** A CPU-based 3D particle emitter. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_cpuparticles3d.html + */ + class CPUParticles3D = Record> extends GeometryInstance3D { + constructor(identifier?: any) + /** Restarts the particle emitter. + * If [param keep_seed] is `true`, the current random seed will be preserved. Useful for seeking and playback. + */ + restart(keep_seed: boolean = false): void + + /** Requests the particles to process for extra process time during a single frame. + * Useful for particle playback, if used in combination with [member use_fixed_seed] or by calling [method restart] with parameter `keep_seed` set to `true`. + */ + request_particles_process(process_time: float64): void + + /** Returns the axis-aligned bounding box that contains all the particles that are active in the current frame. */ + capture_aabb(): AABB + + /** Sets the minimum value for the given parameter. */ + set_param_min(param: CPUParticles3D.Parameter, value: float64): void + + /** Returns the minimum value range for the given parameter. */ + get_param_min(param: CPUParticles3D.Parameter): float64 + + /** Sets the maximum value for the given parameter. */ + set_param_max(param: CPUParticles3D.Parameter, value: float64): void + + /** Returns the maximum value range for the given parameter. */ + get_param_max(param: CPUParticles3D.Parameter): float64 + + /** Sets the [Curve] of the parameter specified by [enum Parameter]. Should be a unit [Curve]. */ + set_param_curve(param: CPUParticles3D.Parameter, curve: Curve): void + + /** Returns the [Curve] of the parameter specified by [enum Parameter]. */ + get_param_curve(param: CPUParticles3D.Parameter): Curve + + /** Enables or disables the given particle flag (see [enum ParticleFlags] for options). */ + set_particle_flag(particle_flag: CPUParticles3D.ParticleFlags, enable: boolean): void + + /** Returns the enabled state of the given particle flag (see [enum ParticleFlags] for options). */ + get_particle_flag(particle_flag: CPUParticles3D.ParticleFlags): boolean + + /** Sets this node's properties to match a given [GPUParticles3D] node with an assigned [ParticleProcessMaterial]. */ + convert_from_particles(particles: Node): void + + /** If `true`, particles are being emitted. [member emitting] can be used to start and stop particles from emitting. However, if [member one_shot] is `true` setting [member emitting] to `true` will not restart the emission cycle until after all active particles finish processing. You can use the [signal finished] signal to be notified once all active particles finish processing. */ + get emitting(): boolean + set emitting(value: boolean) + + /** Number of particles emitted in one emission cycle. */ + get amount(): int64 + set amount(value: int64) + + /** Amount of time each particle will exist. */ + get lifetime(): float64 + set lifetime(value: float64) + + /** If `true`, only one emission cycle occurs. If set `true` during a cycle, emission will stop at the cycle's end. */ + get one_shot(): boolean + set one_shot(value: boolean) + + /** Particle system starts as if it had already run for this many seconds. */ + get preprocess(): float64 + set preprocess(value: float64) + + /** Particle system's running speed scaling ratio. A value of `0` can be used to pause the particles. */ + get speed_scale(): float64 + set speed_scale(value: float64) + + /** How rapidly particles in an emission cycle are emitted. If greater than `0`, there will be a gap in emissions before the next cycle begins. */ + get explosiveness(): float64 + set explosiveness(value: float64) + + /** Emission lifetime randomness ratio. */ + get randomness(): float64 + set randomness(value: float64) + + /** If `true`, particles will use the same seed for every simulation using the seed defined in [member seed]. This is useful for situations where the visual outcome should be consistent across replays, for example when using Movie Maker mode. */ + get use_fixed_seed(): boolean + set use_fixed_seed(value: boolean) + + /** Sets the random seed used by the particle system. Only effective if [member use_fixed_seed] is `true`. */ + get seed(): int64 + set seed(value: int64) + + /** Particle lifetime randomness ratio. */ + get lifetime_randomness(): float64 + set lifetime_randomness(value: float64) + + /** The particle system's frame rate is fixed to a value. For example, changing the value to 2 will make the particles render at 2 frames per second. Note this does not slow down the particle system itself. */ + get fixed_fps(): int64 + set fixed_fps(value: int64) + + /** If `true`, results in fractional delta calculation which has a smoother particles display effect. */ + get fract_delta(): boolean + set fract_delta(value: boolean) + + /** The [AABB] that determines the node's region which needs to be visible on screen for the particle system to be active. + * Grow the box if particles suddenly appear/disappear when the node enters/exits the screen. The [AABB] can be grown via code or with the **Particles → Generate AABB** editor tool. + */ + get visibility_aabb(): AABB + set visibility_aabb(value: AABB) + + /** If `true`, particles use the parent node's coordinate space (known as local coordinates). This will cause particles to move and rotate along the [CPUParticles3D] node (and its parents) when it is moved or rotated. If `false`, particles use global coordinates; they will not move or rotate along the [CPUParticles3D] node (and its parents) when it is moved or rotated. */ + get local_coords(): boolean + set local_coords(value: boolean) + + /** Particle draw order. Uses [enum DrawOrder] values. */ + get draw_order(): int64 + set draw_order(value: int64) + + /** The [Mesh] used for each particle. If `null`, particles will be spheres. */ + get mesh(): Mesh + set mesh(value: Mesh) + + /** Particles will be emitted inside this region. See [enum EmissionShape] for possible values. */ + get emission_shape(): int64 + set emission_shape(value: int64) + + /** The sphere's radius if [enum EmissionShape] is set to [constant EMISSION_SHAPE_SPHERE]. */ + get emission_sphere_radius(): float64 + set emission_sphere_radius(value: float64) + + /** The rectangle's extents if [member emission_shape] is set to [constant EMISSION_SHAPE_BOX]. */ + get emission_box_extents(): Vector3 + set emission_box_extents(value: Vector3) + + /** Sets the initial positions to spawn particles when using [constant EMISSION_SHAPE_POINTS] or [constant EMISSION_SHAPE_DIRECTED_POINTS]. */ + get emission_points(): PackedVector3Array + set emission_points(value: PackedVector3Array | Vector3[]) + + /** Sets the direction the particles will be emitted in when using [constant EMISSION_SHAPE_DIRECTED_POINTS]. */ + get emission_normals(): PackedVector3Array + set emission_normals(value: PackedVector3Array | Vector3[]) + + /** Sets the [Color]s to modulate particles by when using [constant EMISSION_SHAPE_POINTS] or [constant EMISSION_SHAPE_DIRECTED_POINTS]. + * + * **Note:** [member emission_colors] multiplies the particle mesh's vertex colors. To have a visible effect on a [BaseMaterial3D], [member BaseMaterial3D.vertex_color_use_as_albedo] *must* be `true`. For a [ShaderMaterial], `ALBEDO *= COLOR.rgb;` must be inserted in the shader's `fragment()` function. Otherwise, [member emission_colors] will have no visible effect. + */ + get emission_colors(): PackedColorArray + set emission_colors(value: PackedColorArray | Color[]) + + /** The axis of the ring when using the emitter [constant EMISSION_SHAPE_RING]. */ + get emission_ring_axis(): Vector3 + set emission_ring_axis(value: Vector3) + + /** The height of the ring when using the emitter [constant EMISSION_SHAPE_RING]. */ + get emission_ring_height(): float64 + set emission_ring_height(value: float64) + + /** The radius of the ring when using the emitter [constant EMISSION_SHAPE_RING]. */ + get emission_ring_radius(): float64 + set emission_ring_radius(value: float64) + + /** The inner radius of the ring when using the emitter [constant EMISSION_SHAPE_RING]. */ + get emission_ring_inner_radius(): float64 + set emission_ring_inner_radius(value: float64) + + /** The angle of the cone when using the emitter [constant EMISSION_SHAPE_RING]. The default angle of 90 degrees results in a ring, while an angle of 0 degrees results in a cone. Intermediate values will result in a ring where one end is larger than the other. + * + * **Note:** Depending on [member emission_ring_height], the angle may be clamped if the ring's end is reached to form a perfect cone. + */ + get emission_ring_cone_angle(): float64 + set emission_ring_cone_angle(value: float64) + + /** Align Y axis of particle with the direction of its velocity. */ + get particle_flag_align_y(): boolean + set particle_flag_align_y(value: boolean) + + /** If `true`, particles rotate around Y axis by [member angle_min]. */ + get particle_flag_rotate_y(): boolean + set particle_flag_rotate_y(value: boolean) + + /** If `true`, particles will not move on the Z axis. */ + get particle_flag_disable_z(): boolean + set particle_flag_disable_z(value: boolean) + + /** Unit vector specifying the particles' emission direction. */ + get direction(): Vector3 + set direction(value: Vector3) + + /** Each particle's initial direction range from `+spread` to `-spread` degrees. Applied to X/Z plane and Y/Z planes. */ + get spread(): float64 + set spread(value: float64) + + /** Amount of [member spread] in Y/Z plane. A value of `1` restricts particles to X/Z plane. */ + get flatness(): float64 + set flatness(value: float64) + + /** Gravity applied to every particle. */ + get gravity(): Vector3 + set gravity(value: Vector3) + + /** Minimum value of the initial velocity. */ + get initial_velocity_min(): float64 + set initial_velocity_min(value: float64) + + /** Maximum value of the initial velocity. */ + get initial_velocity_max(): float64 + set initial_velocity_max(value: float64) + + /** Minimum initial angular velocity (rotation speed) applied to each particle in *degrees* per second. */ + get angular_velocity_min(): float64 + set angular_velocity_min(value: float64) + + /** Maximum initial angular velocity (rotation speed) applied to each particle in *degrees* per second. */ + get angular_velocity_max(): float64 + set angular_velocity_max(value: float64) + + /** Each particle's angular velocity (rotation speed) will vary along this [Curve] over its lifetime. Should be a unit [Curve]. */ + get angular_velocity_curve(): Curve + set angular_velocity_curve(value: Curve) + + /** Minimum orbit velocity. */ + get orbit_velocity_min(): float64 + set orbit_velocity_min(value: float64) + + /** Maximum orbit velocity. */ + get orbit_velocity_max(): float64 + set orbit_velocity_max(value: float64) + + /** Each particle's orbital velocity will vary along this [Curve]. Should be a unit [Curve]. */ + get orbit_velocity_curve(): Curve + set orbit_velocity_curve(value: Curve) + + /** Minimum linear acceleration. */ + get linear_accel_min(): float64 + set linear_accel_min(value: float64) + + /** Maximum linear acceleration. */ + get linear_accel_max(): float64 + set linear_accel_max(value: float64) + + /** Each particle's linear acceleration will vary along this [Curve]. Should be a unit [Curve]. */ + get linear_accel_curve(): Curve + set linear_accel_curve(value: Curve) + + /** Minimum radial acceleration. */ + get radial_accel_min(): float64 + set radial_accel_min(value: float64) + + /** Maximum radial acceleration. */ + get radial_accel_max(): float64 + set radial_accel_max(value: float64) + + /** Each particle's radial acceleration will vary along this [Curve]. Should be a unit [Curve]. */ + get radial_accel_curve(): Curve + set radial_accel_curve(value: Curve) + + /** Minimum tangent acceleration. */ + get tangential_accel_min(): float64 + set tangential_accel_min(value: float64) + + /** Maximum tangent acceleration. */ + get tangential_accel_max(): float64 + set tangential_accel_max(value: float64) + + /** Each particle's tangential acceleration will vary along this [Curve]. Should be a unit [Curve]. */ + get tangential_accel_curve(): Curve + set tangential_accel_curve(value: Curve) + + /** Minimum damping. */ + get damping_min(): float64 + set damping_min(value: float64) + + /** Maximum damping. */ + get damping_max(): float64 + set damping_max(value: float64) + + /** Damping will vary along this [Curve]. Should be a unit [Curve]. */ + get damping_curve(): Curve + set damping_curve(value: Curve) + + /** Minimum angle. */ + get angle_min(): float64 + set angle_min(value: float64) + + /** Maximum angle. */ + get angle_max(): float64 + set angle_max(value: float64) + + /** Each particle's rotation will be animated along this [Curve]. Should be a unit [Curve]. */ + get angle_curve(): Curve + set angle_curve(value: Curve) + + /** Minimum scale. */ + get scale_amount_min(): float64 + set scale_amount_min(value: float64) + + /** Maximum scale. */ + get scale_amount_max(): float64 + set scale_amount_max(value: float64) + + /** Each particle's scale will vary along this [Curve]. Should be a unit [Curve]. */ + get scale_amount_curve(): Curve + set scale_amount_curve(value: Curve) + + /** If set to `true`, three different scale curves can be specified, one per scale axis. */ + get split_scale(): boolean + set split_scale(value: boolean) + + /** Curve for the scale over life, along the x axis. */ + get scale_curve_x(): Curve + set scale_curve_x(value: Curve) + + /** Curve for the scale over life, along the y axis. */ + get scale_curve_y(): Curve + set scale_curve_y(value: Curve) + + /** Curve for the scale over life, along the z axis. */ + get scale_curve_z(): Curve + set scale_curve_z(value: Curve) + + /** Each particle's initial color. + * + * **Note:** [member color] multiplies the particle mesh's vertex colors. To have a visible effect on a [BaseMaterial3D], [member BaseMaterial3D.vertex_color_use_as_albedo] *must* be `true`. For a [ShaderMaterial], `ALBEDO *= COLOR.rgb;` must be inserted in the shader's `fragment()` function. Otherwise, [member color] will have no visible effect. + */ + get color(): Color + set color(value: Color) + + /** Each particle's color will vary along this [Gradient] over its lifetime (multiplied with [member color]). + * + * **Note:** [member color_ramp] multiplies the particle mesh's vertex colors. To have a visible effect on a [BaseMaterial3D], [member BaseMaterial3D.vertex_color_use_as_albedo] *must* be `true`. For a [ShaderMaterial], `ALBEDO *= COLOR.rgb;` must be inserted in the shader's `fragment()` function. Otherwise, [member color_ramp] will have no visible effect. + */ + get color_ramp(): Gradient + set color_ramp(value: Gradient) + + /** Each particle's initial color will vary along this [Gradient] (multiplied with [member color]). + * + * **Note:** [member color_initial_ramp] multiplies the particle mesh's vertex colors. To have a visible effect on a [BaseMaterial3D], [member BaseMaterial3D.vertex_color_use_as_albedo] *must* be `true`. For a [ShaderMaterial], `ALBEDO *= COLOR.rgb;` must be inserted in the shader's `fragment()` function. Otherwise, [member color_initial_ramp] will have no visible effect. + */ + get color_initial_ramp(): Gradient + set color_initial_ramp(value: Gradient) + + /** Minimum hue variation. */ + get hue_variation_min(): float64 + set hue_variation_min(value: float64) + + /** Maximum hue variation. */ + get hue_variation_max(): float64 + set hue_variation_max(value: float64) + + /** Each particle's hue will vary along this [Curve]. Should be a unit [Curve]. */ + get hue_variation_curve(): Curve + set hue_variation_curve(value: Curve) + + /** Minimum particle animation speed. */ + get anim_speed_min(): float64 + set anim_speed_min(value: float64) + + /** Maximum particle animation speed. */ + get anim_speed_max(): float64 + set anim_speed_max(value: float64) + + /** Each particle's animation speed will vary along this [Curve]. Should be a unit [Curve]. */ + get anim_speed_curve(): Curve + set anim_speed_curve(value: Curve) + + /** Minimum animation offset. */ + get anim_offset_min(): float64 + set anim_offset_min(value: float64) + + /** Maximum animation offset. */ + get anim_offset_max(): float64 + set anim_offset_max(value: float64) + + /** Each particle's animation offset will vary along this [Curve]. Should be a unit [Curve]. */ + get anim_offset_curve(): Curve + set anim_offset_curve(value: Curve) + + /** Emitted when all active particles have finished processing. When [member one_shot] is disabled, particles will process continuously, so this is never emitted. */ + readonly finished: Signal0 + } + class CPUParticles3DEditorPlugin = Record> extends Particles3DEditorPlugin { + constructor(identifier?: any) + } + class CPUParticles3DGizmoPlugin extends EditorNode3DGizmoPlugin { + constructor(identifier?: any) + } + /** A CSG Box shape. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_csgbox3d.html + */ + class CSGBox3D = Record> extends CSGPrimitive3D { + constructor(identifier?: any) + /** The box's width, height and depth. */ + get size(): Vector3 + set size(value: Vector3) + + /** The material used to render the box. */ + get material(): BaseMaterial3D | ShaderMaterial + set material(value: BaseMaterial3D | ShaderMaterial) + } + /** A CSG node that allows you to combine other CSG modifiers. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_csgcombiner3d.html + */ + class CSGCombiner3D = Record> extends CSGShape3D { + constructor(identifier?: any) + } + /** A CSG Cylinder shape. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_csgcylinder3d.html + */ + class CSGCylinder3D = Record> extends CSGPrimitive3D { + constructor(identifier?: any) + /** The radius of the cylinder. */ + get radius(): float64 + set radius(value: float64) + + /** The height of the cylinder. */ + get height(): float64 + set height(value: float64) + + /** The number of sides of the cylinder, the higher this number the more detail there will be in the cylinder. */ + get sides(): int64 + set sides(value: int64) + + /** If `true` a cone is created, the [member radius] will only apply to one side. */ + get cone(): boolean + set cone(value: boolean) + + /** If `true` the normals of the cylinder are set to give a smooth effect making the cylinder seem rounded. If `false` the cylinder will have a flat shaded look. */ + get smooth_faces(): boolean + set smooth_faces(value: boolean) + + /** The material used to render the cylinder. */ + get material(): BaseMaterial3D | ShaderMaterial + set material(value: BaseMaterial3D | ShaderMaterial) + } + /** A CSG Mesh shape that uses a mesh resource. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_csgmesh3d.html + */ + class CSGMesh3D = Record> extends CSGPrimitive3D { + constructor(identifier?: any) + /** The [Mesh] resource to use as a CSG shape. + * + * **Note:** Some [Mesh] types such as [PlaneMesh], [PointMesh], [QuadMesh], and [RibbonTrailMesh] are excluded from the type hint for this property, as these primitives are non- *manifold* and thus not compatible with the CSG algorithm. + * + * **Note:** When using an [ArrayMesh], all vertex attributes except [constant Mesh.ARRAY_VERTEX], [constant Mesh.ARRAY_NORMAL] and [constant Mesh.ARRAY_TEX_UV] are left unused. Only [constant Mesh.ARRAY_VERTEX] and [constant Mesh.ARRAY_TEX_UV] will be passed to the GPU. + * [constant Mesh.ARRAY_NORMAL] is only used to determine which faces require the use of flat shading. By default, CSGMesh will ignore the mesh's vertex normals, recalculate them for each vertex and use a smooth shader. If a flat shader is required for a face, ensure that all vertex normals of the face are approximately equal. + */ + get mesh(): Mesh | any /*-PlaneMesh*/ | any /*-PointMesh*/ | any /*-QuadMesh*/ | any /*-RibbonTrailMesh*/ + set mesh(value: Mesh | any /*-PlaneMesh*/ | any /*-PointMesh*/ | any /*-QuadMesh*/ | any /*-RibbonTrailMesh*/) + + /** The [Material] used in drawing the CSG shape. */ + get material(): BaseMaterial3D | ShaderMaterial + set material(value: BaseMaterial3D | ShaderMaterial) + } + namespace CSGPolygon3D { + enum Mode { + /** The [member polygon] shape is extruded along the negative Z axis. */ + MODE_DEPTH = 0, + + /** The [member polygon] shape is extruded by rotating it around the Y axis. */ + MODE_SPIN = 1, + + /** The [member polygon] shape is extruded along the [Path3D] specified in [member path_node]. */ + MODE_PATH = 2, + } + enum PathRotation { + /** The [member polygon] shape is not rotated. + * + * **Note:** Requires the path Z coordinates to continually decrease to ensure viable shapes. + */ + PATH_ROTATION_POLYGON = 0, + + /** The [member polygon] shape is rotated along the path, but it is not rotated around the path axis. + * + * **Note:** Requires the path Z coordinates to continually decrease to ensure viable shapes. + */ + PATH_ROTATION_PATH = 1, + + /** The [member polygon] shape follows the path and its rotations around the path axis. */ + PATH_ROTATION_PATH_FOLLOW = 2, + } + enum PathIntervalType { + /** When [member mode] is set to [constant MODE_PATH], [member path_interval] will determine the distance, in meters, each interval of the path will extrude. */ + PATH_INTERVAL_DISTANCE = 0, + + /** When [member mode] is set to [constant MODE_PATH], [member path_interval] will subdivide the polygons along the path. */ + PATH_INTERVAL_SUBDIVIDE = 1, + } + } + /** Extrudes a 2D polygon shape to create a 3D mesh. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_csgpolygon3d.html + */ + class CSGPolygon3D = Record> extends CSGPrimitive3D { + constructor(identifier?: any) + _is_editable_3d_polygon(): boolean + _has_editable_3d_polygon_no_depth(): boolean + + /** The point array that defines the 2D polygon that is extruded. This can be a convex or concave polygon with 3 or more points. The polygon must *not* have any intersecting edges. Otherwise, triangulation will fail and no mesh will be generated. + * + * **Note:** If only 1 or 2 points are defined in [member polygon], no mesh will be generated. + */ + get polygon(): PackedVector2Array + set polygon(value: PackedVector2Array | Vector2[]) + + /** The [member mode] used to extrude the [member polygon]. */ + get mode(): int64 + set mode(value: int64) + + /** When [member mode] is [constant MODE_DEPTH], the depth of the extrusion. */ + get depth(): float64 + set depth(value: float64) + + /** When [member mode] is [constant MODE_SPIN], the total number of degrees the [member polygon] is rotated when extruding. */ + get spin_degrees(): float64 + set spin_degrees(value: float64) + + /** When [member mode] is [constant MODE_SPIN], the number of extrusions made. */ + get spin_sides(): int64 + set spin_sides(value: int64) + + /** When [member mode] is [constant MODE_PATH], the location of the [Path3D] object used to extrude the [member polygon]. */ + get path_node(): NodePath + set path_node(value: NodePath | string) + + /** When [member mode] is [constant MODE_PATH], this will determine if the interval should be by distance ([constant PATH_INTERVAL_DISTANCE]) or subdivision fractions ([constant PATH_INTERVAL_SUBDIVIDE]). */ + get path_interval_type(): int64 + set path_interval_type(value: int64) + + /** When [member mode] is [constant MODE_PATH], the path interval or ratio of path points to extrusions. */ + get path_interval(): float64 + set path_interval(value: float64) + + /** When [member mode] is [constant MODE_PATH], extrusions that are less than this angle, will be merged together to reduce polygon count. */ + get path_simplify_angle(): float64 + set path_simplify_angle(value: float64) + + /** When [member mode] is [constant MODE_PATH], the path rotation method used to rotate the [member polygon] as it is extruded. */ + get path_rotation(): int64 + set path_rotation(value: int64) + + /** When [member mode] is [constant MODE_PATH], if `true` the polygon will be rotated according to the proper tangent of the path at the sampled points. If `false` an approximation is used, which decreases in accuracy as the number of subdivisions decreases. */ + get path_rotation_accurate(): boolean + set path_rotation_accurate(value: boolean) + + /** When [member mode] is [constant MODE_PATH], if `true` the [Transform3D] of the [CSGPolygon3D] is used as the starting point for the extrusions, not the [Transform3D] of the [member path_node]. */ + get path_local(): boolean + set path_local(value: boolean) + + /** When [member mode] is [constant MODE_PATH], by default, the top half of the [member material] is stretched along the entire length of the extruded shape. If `false` the top half of the material is repeated every step of the extrusion. */ + get path_continuous_u(): boolean + set path_continuous_u(value: boolean) + + /** When [member mode] is [constant MODE_PATH], this is the distance along the path, in meters, the texture coordinates will tile. When set to 0, texture coordinates will match geometry exactly with no tiling. */ + get path_u_distance(): float64 + set path_u_distance(value: float64) + + /** When [member mode] is [constant MODE_PATH], if `true` the ends of the path are joined, by adding an extrusion between the last and first points of the path. */ + get path_joined(): boolean + set path_joined(value: boolean) + + /** If `true`, applies smooth shading to the extrusions. */ + get smooth_faces(): boolean + set smooth_faces(value: boolean) + + /** Material to use for the resulting mesh. The UV maps the top half of the material to the extruded shape (U along the length of the extrusions and V around the outline of the [member polygon]), the bottom-left quarter to the front end face, and the bottom-right quarter to the back end face. */ + get material(): BaseMaterial3D | ShaderMaterial + set material(value: BaseMaterial3D | ShaderMaterial) + } + /** Base class for CSG primitives. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_csgprimitive3d.html + */ + class CSGPrimitive3D = Record> extends CSGShape3D { + constructor(identifier?: any) + /** If set, the order of the vertices in each triangle are reversed resulting in the backside of the mesh being drawn. */ + get flip_faces(): boolean + set flip_faces(value: boolean) + } + namespace CSGShape3D { + enum Operation { + /** Geometry of both primitives is merged, intersecting geometry is removed. */ + OPERATION_UNION = 0, + + /** Only intersecting geometry remains, the rest is removed. */ + OPERATION_INTERSECTION = 1, + + /** The second shape is subtracted from the first, leaving a dent with its shape. */ + OPERATION_SUBTRACTION = 2, + } + } + /** The CSG base class. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_csgshape3d.html + */ + class CSGShape3D = Record> extends GeometryInstance3D { + constructor(identifier?: any) + _update_shape(): void + + /** Returns `true` if this is a root shape and is thus the object that is rendered. */ + is_root_shape(): boolean + + /** Based on [param value], enables or disables the specified layer in the [member collision_mask], given a [param layer_number] between 1 and 32. */ + set_collision_mask_value(layer_number: int64, value: boolean): void + + /** Returns whether or not the specified layer of the [member collision_mask] is enabled, given a [param layer_number] between 1 and 32. */ + get_collision_mask_value(layer_number: int64): boolean + _get_root_collision_instance(): RID + + /** Based on [param value], enables or disables the specified layer in the [member collision_layer], given a [param layer_number] between 1 and 32. */ + set_collision_layer_value(layer_number: int64, value: boolean): void + + /** Returns whether or not the specified layer of the [member collision_layer] is enabled, given a [param layer_number] between 1 and 32. */ + get_collision_layer_value(layer_number: int64): boolean + + /** Returns an [Array] with two elements, the first is the [Transform3D] of this node and the second is the root [Mesh] of this node. Only works when this node is the root shape. */ + get_meshes(): GArray + + /** Returns a baked static [ArrayMesh] of this node's CSG operation result. Materials from involved CSG nodes are added as extra mesh surfaces. Returns an empty mesh if the node is not a CSG root node or has no valid geometry. */ + bake_static_mesh(): ArrayMesh + + /** Returns a baked physics [ConcavePolygonShape3D] of this node's CSG operation result. Returns an empty shape if the node is not a CSG root node or has no valid geometry. + * **Performance:** If the CSG operation results in a very detailed geometry with many faces physics performance will be very slow. Concave shapes should in general only be used for static level geometry and not with dynamic objects that are moving. + */ + bake_collision_shape(): ConcavePolygonShape3D + + /** The operation that is performed on this shape. This is ignored for the first CSG child node as the operation is between this node and the previous child of this nodes parent. */ + get operation(): int64 + set operation(value: int64) + + /** This property does nothing. */ + get snap(): float64 + set snap(value: float64) + + /** Calculate tangents for the CSG shape which allows the use of normal maps. This is only applied on the root shape, this setting is ignored on any child. */ + get calculate_tangents(): boolean + set calculate_tangents(value: boolean) + + /** Adds a collision shape to the physics engine for our CSG shape. This will always act like a static body. Note that the collision shape is still active even if the CSG shape itself is hidden. See also [member collision_mask] and [member collision_priority]. */ + get use_collision(): boolean + set use_collision(value: boolean) + + /** The physics layers this area is in. + * Collidable objects can exist in any of 32 different layers. These layers work like a tagging system, and are not visual. A collidable can use these layers to select with which objects it can collide, using the collision_mask property. + * A contact is detected if object A is in any of the layers that object B scans, or object B is in any layer scanned by object A. See [url=https://docs.godotengine.org/en/4.4/tutorials/physics/physics_introduction.html#collision-layers-and-masks]Collision layers and masks[/url] in the documentation for more information. + */ + get collision_layer(): int64 + set collision_layer(value: int64) + + /** The physics layers this CSG shape scans for collisions. Only effective if [member use_collision] is `true`. See [url=https://docs.godotengine.org/en/4.4/tutorials/physics/physics_introduction.html#collision-layers-and-masks]Collision layers and masks[/url] in the documentation for more information. */ + get collision_mask(): int64 + set collision_mask(value: int64) + + /** The priority used to solve colliding when occurring penetration. Only effective if [member use_collision] is `true`. The higher the priority is, the lower the penetration into the object will be. This can for example be used to prevent the player from breaking through the boundaries of a level. */ + get collision_priority(): float64 + set collision_priority(value: float64) + } + class CSGShape3DGizmoPlugin extends EditorNode3DGizmoPlugin { + constructor(identifier?: any) + } + class CSGShapeEditor = Record> extends Control { + constructor(identifier?: any) + } + /** A CSG Sphere shape. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_csgsphere3d.html + */ + class CSGSphere3D = Record> extends CSGPrimitive3D { + constructor(identifier?: any) + /** Radius of the sphere. */ + get radius(): float64 + set radius(value: float64) + + /** Number of vertical slices for the sphere. */ + get radial_segments(): int64 + set radial_segments(value: int64) + + /** Number of horizontal slices for the sphere. */ + get rings(): int64 + set rings(value: int64) + + /** If `true` the normals of the sphere are set to give a smooth effect making the sphere seem rounded. If `false` the sphere will have a flat shaded look. */ + get smooth_faces(): boolean + set smooth_faces(value: boolean) + + /** The material used to render the sphere. */ + get material(): BaseMaterial3D | ShaderMaterial + set material(value: BaseMaterial3D | ShaderMaterial) + } + /** A CSG Torus shape. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_csgtorus3d.html + */ + class CSGTorus3D = Record> extends CSGPrimitive3D { + constructor(identifier?: any) + /** The inner radius of the torus. */ + get inner_radius(): float64 + set inner_radius(value: float64) + + /** The outer radius of the torus. */ + get outer_radius(): float64 + set outer_radius(value: float64) + + /** The number of slices the torus is constructed of. */ + get sides(): int64 + set sides(value: int64) + + /** The number of edges each ring of the torus is constructed of. */ + get ring_sides(): int64 + set ring_sides(value: int64) + + /** If `true` the normals of the torus are set to give a smooth effect making the torus seem rounded. If `false` the torus will have a flat shaded look. */ + get smooth_faces(): boolean + set smooth_faces(value: boolean) + + /** The material used to render the torus. */ + get material(): BaseMaterial3D | ShaderMaterial + set material(value: BaseMaterial3D | ShaderMaterial) + } + /** Calls the specified method after optional delay. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_callbacktweener.html + */ + class CallbackTweener extends Tweener { + constructor(identifier?: any) + /** Makes the callback call delayed by given time in seconds. + * **Example:** Call [method Node.queue_free] after 2 seconds: + * + */ + set_delay(delay: float64): CallbackTweener + } + namespace Camera2D { + enum AnchorMode { + /** The camera's position is fixed so that the top-left corner is always at the origin. */ + ANCHOR_MODE_FIXED_TOP_LEFT = 0, + + /** The camera's position takes into account vertical/horizontal offsets and the screen size. */ + ANCHOR_MODE_DRAG_CENTER = 1, + } + enum Camera2DProcessCallback { + /** The camera updates during physics frames (see [constant Node.NOTIFICATION_INTERNAL_PHYSICS_PROCESS]). */ + CAMERA2D_PROCESS_PHYSICS = 0, + + /** The camera updates during process frames (see [constant Node.NOTIFICATION_INTERNAL_PROCESS]). */ + CAMERA2D_PROCESS_IDLE = 1, + } + } + /** Camera node for 2D scenes. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_camera2d.html + */ + class Camera2D = Record> extends Node2D { + constructor(identifier?: any) + _update_scroll(): void + + /** Forces this [Camera2D] to become the current active one. [member enabled] must be `true`. */ + make_current(): void + + /** Returns `true` if this [Camera2D] is the active camera (see [method Viewport.get_camera_2d]). */ + is_current(): boolean + _make_current(_unnamed_arg0: Object): void + + /** Sets the camera limit for the specified [enum Side]. See also [member limit_bottom], [member limit_top], [member limit_left], and [member limit_right]. */ + set_limit(margin: Side, limit: int64): void + + /** Returns the camera limit for the specified [enum Side]. See also [member limit_bottom], [member limit_top], [member limit_left], and [member limit_right]. */ + get_limit(margin: Side): int64 + + /** Sets the specified [enum Side]'s margin. See also [member drag_bottom_margin], [member drag_top_margin], [member drag_left_margin], and [member drag_right_margin]. */ + set_drag_margin(margin: Side, drag_margin: float64): void + + /** Returns the specified [enum Side]'s margin. See also [member drag_bottom_margin], [member drag_top_margin], [member drag_left_margin], and [member drag_right_margin]. */ + get_drag_margin(margin: Side): float64 + + /** Returns this camera's target position, in global coordinates. + * + * **Note:** The returned value is not the same as [member Node2D.global_position], as it is affected by the drag properties. It is also not the same as the current position if [member position_smoothing_enabled] is `true` (see [method get_screen_center_position]). + */ + get_target_position(): Vector2 + + /** Returns the center of the screen from this camera's point of view, in global coordinates. + * + * **Note:** The exact targeted position of the camera may be different. See [method get_target_position]. + */ + get_screen_center_position(): Vector2 + + /** Forces the camera to update scroll immediately. */ + force_update_scroll(): void + + /** Sets the camera's position immediately to its current smoothing destination. + * This method has no effect if [member position_smoothing_enabled] is `false`. + */ + reset_smoothing(): void + + /** Aligns the camera to the tracked node. */ + align(): void + _set_old_smoothing(follow_smoothing: float64): void + + /** The camera's relative offset. Useful for looking around or camera shake animations. The offsetted camera can go past the limits defined in [member limit_top], [member limit_bottom], [member limit_left] and [member limit_right]. */ + get offset(): Vector2 + set offset(value: Vector2) + + /** The Camera2D's anchor point. See [enum AnchorMode] constants. */ + get anchor_mode(): int64 + set anchor_mode(value: int64) + + /** If `true`, the camera's rendered view is not affected by its [member Node2D.rotation] and [member Node2D.global_rotation]. */ + get ignore_rotation(): boolean + set ignore_rotation(value: boolean) + + /** Controls whether the camera can be active or not. If `true`, the [Camera2D] will become the main camera when it enters the scene tree and there is no active camera currently (see [method Viewport.get_camera_2d]). + * When the camera is currently active and [member enabled] is set to `false`, the next enabled [Camera2D] in the scene tree will become active. + */ + get enabled(): boolean + set enabled(value: boolean) + + /** The camera's zoom. A zoom of `Vector(2, 2)` doubles the size seen in the viewport. A zoom of `Vector(0.5, 0.5)` halves the size seen in the viewport. + * + * **Note:** [member FontFile.oversampling] does *not* take [Camera2D] zoom into account. This means that zooming in/out will cause bitmap fonts and rasterized (non-MSDF) dynamic fonts to appear blurry or pixelated unless the font is part of a [CanvasLayer] that makes it ignore camera zoom. To ensure text remains crisp regardless of zoom, you can enable MSDF font rendering by enabling [member ProjectSettings.gui/theme/default_font_multichannel_signed_distance_field] (applies to the default project font only), or enabling **Multichannel Signed Distance Field** in the import options of a DynamicFont for custom fonts. On system fonts, [member SystemFont.multichannel_signed_distance_field] can be enabled in the inspector. + */ + get zoom(): Vector2 + set zoom(value: Vector2) + + /** The custom [Viewport] node attached to the [Camera2D]. If `null` or not a [Viewport], uses the default viewport instead. */ + get custom_viewport(): Viewport + set custom_viewport(value: Viewport) + + /** The camera's process callback. See [enum Camera2DProcessCallback]. */ + get process_callback(): int64 + set process_callback(value: int64) + + /** Left scroll limit in pixels. The camera stops moving when reaching this value, but [member offset] can push the view past the limit. */ + get limit_left(): int64 + set limit_left(value: int64) + + /** Top scroll limit in pixels. The camera stops moving when reaching this value, but [member offset] can push the view past the limit. */ + get limit_top(): int64 + set limit_top(value: int64) + + /** Right scroll limit in pixels. The camera stops moving when reaching this value, but [member offset] can push the view past the limit. */ + get limit_right(): int64 + set limit_right(value: int64) + + /** Bottom scroll limit in pixels. The camera stops moving when reaching this value, but [member offset] can push the view past the limit. */ + get limit_bottom(): int64 + set limit_bottom(value: int64) + + /** If `true`, the camera smoothly stops when reaches its limits. + * This property has no effect if [member position_smoothing_enabled] is `false`. + * + * **Note:** To immediately update the camera's position to be within limits without smoothing, even with this setting enabled, invoke [method reset_smoothing]. + */ + get limit_smoothed(): boolean + set limit_smoothed(value: boolean) + + /** If `true`, the camera's view smoothly moves towards its target position at [member position_smoothing_speed]. */ + get position_smoothing_enabled(): boolean + set position_smoothing_enabled(value: boolean) + + /** Speed in pixels per second of the camera's smoothing effect when [member position_smoothing_enabled] is `true`. */ + get position_smoothing_speed(): float64 + set position_smoothing_speed(value: float64) + + /** If `true`, the camera's view smoothly rotates, via asymptotic smoothing, to align with its target rotation at [member rotation_smoothing_speed]. + * + * **Note:** This property has no effect if [member ignore_rotation] is `true`. + */ + get rotation_smoothing_enabled(): boolean + set rotation_smoothing_enabled(value: boolean) + + /** The angular, asymptotic speed of the camera's rotation smoothing effect when [member rotation_smoothing_enabled] is `true`. */ + get rotation_smoothing_speed(): float64 + set rotation_smoothing_speed(value: float64) + + /** If `true`, the camera only moves when reaching the horizontal (left and right) drag margins. If `false`, the camera moves horizontally regardless of margins. */ + get drag_horizontal_enabled(): boolean + set drag_horizontal_enabled(value: boolean) + + /** If `true`, the camera only moves when reaching the vertical (top and bottom) drag margins. If `false`, the camera moves vertically regardless of the drag margins. */ + get drag_vertical_enabled(): boolean + set drag_vertical_enabled(value: boolean) + + /** The relative horizontal drag offset of the camera between the right (`-1`) and left (`1`) drag margins. + * + * **Note:** Used to set the initial horizontal drag offset; determine the current offset; or force the current offset. It's not automatically updated when [member drag_horizontal_enabled] is `true` or the drag margins are changed. + */ + get drag_horizontal_offset(): float64 + set drag_horizontal_offset(value: float64) + + /** The relative vertical drag offset of the camera between the bottom (`-1`) and top (`1`) drag margins. + * + * **Note:** Used to set the initial vertical drag offset; determine the current offset; or force the current offset. It's not automatically updated when [member drag_vertical_enabled] is `true` or the drag margins are changed. + */ + get drag_vertical_offset(): float64 + set drag_vertical_offset(value: float64) + + /** Left margin needed to drag the camera. A value of `1` makes the camera move only when reaching the left edge of the screen. */ + get drag_left_margin(): float64 + set drag_left_margin(value: float64) + + /** Top margin needed to drag the camera. A value of `1` makes the camera move only when reaching the top edge of the screen. */ + get drag_top_margin(): float64 + set drag_top_margin(value: float64) + + /** Right margin needed to drag the camera. A value of `1` makes the camera move only when reaching the right edge of the screen. */ + get drag_right_margin(): float64 + set drag_right_margin(value: float64) + + /** Bottom margin needed to drag the camera. A value of `1` makes the camera move only when reaching the bottom edge of the screen. */ + get drag_bottom_margin(): float64 + set drag_bottom_margin(value: float64) + + /** If `true`, draws the camera's screen rectangle in the editor. */ + get editor_draw_screen(): boolean + set editor_draw_screen(value: boolean) + + /** If `true`, draws the camera's limits rectangle in the editor. */ + get editor_draw_limits(): boolean + set editor_draw_limits(value: boolean) + + /** If `true`, draws the camera's drag margin rectangle in the editor. */ + get editor_draw_drag_margin(): boolean + set editor_draw_drag_margin(value: boolean) + } + namespace Camera3D { + enum ProjectionType { + /** Perspective projection. Objects on the screen becomes smaller when they are far away. */ + PROJECTION_PERSPECTIVE = 0, + + /** Orthogonal projection, also known as orthographic projection. Objects remain the same size on the screen no matter how far away they are. */ + PROJECTION_ORTHOGONAL = 1, + + /** Frustum projection. This mode allows adjusting [member frustum_offset] to create "tilted frustum" effects. */ + PROJECTION_FRUSTUM = 2, + } + enum KeepAspect { + /** Preserves the horizontal aspect ratio; also known as Vert- scaling. This is usually the best option for projects running in portrait mode, as taller aspect ratios will benefit from a wider vertical FOV. */ + KEEP_WIDTH = 0, + + /** Preserves the vertical aspect ratio; also known as Hor+ scaling. This is usually the best option for projects running in landscape mode, as wider aspect ratios will automatically benefit from a wider horizontal FOV. */ + KEEP_HEIGHT = 1, + } + enum DopplerTracking { + /** Disables [url=https://en.wikipedia.org/wiki/Doppler_effect]Doppler effect[/url] simulation (default). */ + DOPPLER_TRACKING_DISABLED = 0, + + /** Simulate [url=https://en.wikipedia.org/wiki/Doppler_effect]Doppler effect[/url] by tracking positions of objects that are changed in `_process`. Changes in the relative velocity of this camera compared to those objects affect how audio is perceived (changing the audio's [member AudioStreamPlayer3D.pitch_scale]). */ + DOPPLER_TRACKING_IDLE_STEP = 1, + + /** Simulate [url=https://en.wikipedia.org/wiki/Doppler_effect]Doppler effect[/url] by tracking positions of objects that are changed in `_physics_process`. Changes in the relative velocity of this camera compared to those objects affect how audio is perceived (changing the audio's [member AudioStreamPlayer3D.pitch_scale]). */ + DOPPLER_TRACKING_PHYSICS_STEP = 2, + } + } + /** Camera node, displays from a point of view. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_camera3d.html + */ + class Camera3D = Record> extends Node3D { + constructor(identifier?: any) + /** Returns a normal vector in world space, that is the result of projecting a point on the [Viewport] rectangle by the inverse camera projection. This is useful for casting rays in the form of (origin, normal) for object intersection or picking. */ + project_ray_normal(screen_point: Vector2): Vector3 + + /** Returns a normal vector from the screen point location directed along the camera. Orthogonal cameras are normalized. Perspective cameras account for perspective, screen width/height, etc. */ + project_local_ray_normal(screen_point: Vector2): Vector3 + + /** Returns a 3D position in world space, that is the result of projecting a point on the [Viewport] rectangle by the inverse camera projection. This is useful for casting rays in the form of (origin, normal) for object intersection or picking. */ + project_ray_origin(screen_point: Vector2): Vector3 + + /** Returns the 2D coordinate in the [Viewport] rectangle that maps to the given 3D point in world space. + * + * **Note:** When using this to position GUI elements over a 3D viewport, use [method is_position_behind] to prevent them from appearing if the 3D point is behind the camera: + * + */ + unproject_position(world_point: Vector3): Vector2 + + /** Returns `true` if the given position is behind the camera (the blue part of the linked diagram). [url=https://raw.githubusercontent.com/godotengine/godot-docs/master/img/camera3d_position_frustum.png]See this diagram[/url] for an overview of position query methods. + * + * **Note:** A position which returns `false` may still be outside the camera's field of view. + */ + is_position_behind(world_point: Vector3): boolean + + /** Returns the 3D point in world space that maps to the given 2D coordinate in the [Viewport] rectangle on a plane that is the given [param z_depth] distance into the scene away from the camera. */ + project_position(screen_point: Vector2, z_depth: float64): Vector3 + + /** Sets the camera projection to perspective mode (see [constant PROJECTION_PERSPECTIVE]), by specifying a [param fov] (field of view) angle in degrees, and the [param z_near] and [param z_far] clip planes in world space units. */ + set_perspective(fov: float64, z_near: float64, z_far: float64): void + + /** Sets the camera projection to orthogonal mode (see [constant PROJECTION_ORTHOGONAL]), by specifying a [param size], and the [param z_near] and [param z_far] clip planes in world space units. (As a hint, 2D games often use this projection, with values specified in pixels.) */ + set_orthogonal(size: float64, z_near: float64, z_far: float64): void + + /** Sets the camera projection to frustum mode (see [constant PROJECTION_FRUSTUM]), by specifying a [param size], an [param offset], and the [param z_near] and [param z_far] clip planes in world space units. See also [member frustum_offset]. */ + set_frustum(size: float64, offset: Vector2, z_near: float64, z_far: float64): void + + /** Makes this camera the current camera for the [Viewport] (see class description). If the camera node is outside the scene tree, it will attempt to become current once it's added. */ + make_current(): void + + /** If this is the current camera, remove it from being current. If [param enable_next] is `true`, request to make the next camera current, if any. */ + clear_current(enable_next: boolean = true): void + + /** Returns the transform of the camera plus the vertical ([member v_offset]) and horizontal ([member h_offset]) offsets; and any other adjustments made to the position and orientation of the camera by subclassed cameras such as [XRCamera3D]. */ + get_camera_transform(): Transform3D + + /** Returns the projection matrix that this camera uses to render to its associated viewport. The camera must be part of the scene tree to function. */ + get_camera_projection(): Projection + + /** Returns the camera's frustum planes in world space units as an array of [Plane]s in the following order: near, far, left, top, right, bottom. Not to be confused with [member frustum_offset]. */ + get_frustum(): GArray + + /** Returns `true` if the given position is inside the camera's frustum (the green part of the linked diagram). [url=https://raw.githubusercontent.com/godotengine/godot-docs/master/img/camera3d_position_frustum.png]See this diagram[/url] for an overview of position query methods. */ + is_position_in_frustum(world_point: Vector3): boolean + + /** Returns the camera's RID from the [RenderingServer]. */ + get_camera_rid(): RID + + /** Returns the RID of a pyramid shape encompassing the camera's view frustum, ignoring the camera's near plane. The tip of the pyramid represents the position of the camera. */ + get_pyramid_shape_rid(): RID + + /** Based on [param value], enables or disables the specified layer in the [member cull_mask], given a [param layer_number] between 1 and 20. */ + set_cull_mask_value(layer_number: int64, value: boolean): void + + /** Returns whether or not the specified layer of the [member cull_mask] is enabled, given a [param layer_number] between 1 and 20. */ + get_cull_mask_value(layer_number: int64): boolean + + /** The axis to lock during [member fov]/[member size] adjustments. Can be either [constant KEEP_WIDTH] or [constant KEEP_HEIGHT]. */ + get keep_aspect(): int64 + set keep_aspect(value: int64) + + /** The culling mask that describes which [member VisualInstance3D.layers] are rendered by this camera. By default, all 20 user-visible layers are rendered. + * + * **Note:** Since the [member cull_mask] allows for 32 layers to be stored in total, there are an additional 12 layers that are only used internally by the engine and aren't exposed in the editor. Setting [member cull_mask] using a script allows you to toggle those reserved layers, which can be useful for editor plugins. + * To adjust [member cull_mask] more easily using a script, use [method get_cull_mask_value] and [method set_cull_mask_value]. + * + * **Note:** [VoxelGI], SDFGI and [LightmapGI] will always take all layers into account to determine what contributes to global illumination. If this is an issue, set [member GeometryInstance3D.gi_mode] to [constant GeometryInstance3D.GI_MODE_DISABLED] for meshes and [member Light3D.light_bake_mode] to [constant Light3D.BAKE_DISABLED] for lights to exclude them from global illumination. + */ + get cull_mask(): int64 + set cull_mask(value: int64) + + /** The [Environment] to use for this camera. */ + get environment(): Environment + set environment(value: Environment) + + /** The [CameraAttributes] to use for this camera. */ + get attributes(): CameraAttributesPractical | CameraAttributesPhysical + set attributes(value: CameraAttributesPractical | CameraAttributesPhysical) + + /** The [Compositor] to use for this camera. */ + get compositor(): Compositor + set compositor(value: Compositor) + + /** The horizontal (X) offset of the camera viewport. */ + get h_offset(): float64 + set h_offset(value: float64) + + /** The vertical (Y) offset of the camera viewport. */ + get v_offset(): float64 + set v_offset(value: float64) + + /** If not [constant DOPPLER_TRACKING_DISABLED], this camera will simulate the [url=https://en.wikipedia.org/wiki/Doppler_effect]Doppler effect[/url] for objects changed in particular `_process` methods. See [enum DopplerTracking] for possible values. */ + get doppler_tracking(): int64 + set doppler_tracking(value: int64) + + /** The camera's projection mode. In [constant PROJECTION_PERSPECTIVE] mode, objects' Z distance from the camera's local space scales their perceived size. */ + get projection(): int64 + set projection(value: int64) + + /** If `true`, the ancestor [Viewport] is currently using this camera. + * If multiple cameras are in the scene, one will always be made current. For example, if two [Camera3D] nodes are present in the scene and only one is current, setting one camera's [member current] to `false` will cause the other camera to be made current. + */ + get current(): boolean + set current(value: boolean) + + /** The camera's field of view angle (in degrees). Only applicable in perspective mode. Since [member keep_aspect] locks one axis, [member fov] sets the other axis' field of view angle. + * For reference, the default vertical field of view value (`75.0`) is equivalent to a horizontal FOV of: + * - ~91.31 degrees in a 4:3 viewport + * - ~101.67 degrees in a 16:10 viewport + * - ~107.51 degrees in a 16:9 viewport + * - ~121.63 degrees in a 21:9 viewport + */ + get fov(): float64 + set fov(value: float64) + + /** The camera's size in meters measured as the diameter of the width or height, depending on [member keep_aspect]. Only applicable in orthogonal and frustum modes. */ + get size(): float64 + set size(value: float64) + + /** The camera's frustum offset. This can be changed from the default to create "tilted frustum" effects such as [url=https://zdoom.org/wiki/Y-shearing]Y-shearing[/url]. + * + * **Note:** Only effective if [member projection] is [constant PROJECTION_FRUSTUM]. + */ + get frustum_offset(): Vector2 + set frustum_offset(value: Vector2) + + /** The distance to the near culling boundary for this camera relative to its local Z axis. Lower values allow the camera to see objects more up close to its origin, at the cost of lower precision across the *entire* range. Values lower than the default can lead to increased Z-fighting. */ + get near(): float64 + set near(value: float64) + + /** The distance to the far culling boundary for this camera relative to its local Z axis. Higher values allow the camera to see further away, while decreasing [member far] can improve performance if it results in objects being partially or fully culled. */ + get far(): float64 + set far(value: float64) + } + class Camera3DEditorPlugin = Record> extends EditorPlugin { + constructor(identifier?: any) + } + class Camera3DGizmoPlugin extends EditorNode3DGizmoPlugin { + constructor(identifier?: any) + } + /** Parent class for camera settings. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_cameraattributes.html + */ + class CameraAttributes extends Resource { + constructor(identifier?: any) + /** Sensitivity of camera sensors, measured in ISO. A higher sensitivity results in a brighter image. + * If [member auto_exposure_enabled] is `true`, this can be used as a method of exposure compensation, doubling the value will increase the exposure value (measured in EV100) by 1 stop. + * + * **Note:** Only available when [member ProjectSettings.rendering/lights_and_shadows/use_physical_light_units] is enabled. + */ + get exposure_sensitivity(): float64 + set exposure_sensitivity(value: float64) + + /** Multiplier for the exposure amount. A higher value results in a brighter image. */ + get exposure_multiplier(): float64 + set exposure_multiplier(value: float64) + + /** If `true`, enables the tonemapping auto exposure mode of the scene renderer. If `true`, the renderer will automatically determine the exposure setting to adapt to the scene's illumination and the observed light. */ + get auto_exposure_enabled(): boolean + set auto_exposure_enabled(value: boolean) + + /** The scale of the auto exposure effect. Affects the intensity of auto exposure. */ + get auto_exposure_scale(): float64 + set auto_exposure_scale(value: float64) + + /** The speed of the auto exposure effect. Affects the time needed for the camera to perform auto exposure. */ + get auto_exposure_speed(): float64 + set auto_exposure_speed(value: float64) + } + /** Physically-based camera settings. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_cameraattributesphysical.html + */ + class CameraAttributesPhysical extends CameraAttributes { + constructor(identifier?: any) + /** Returns the vertical field of view that corresponds to the [member frustum_focal_length]. This value is calculated internally whenever [member frustum_focal_length] is changed. */ + get_fov(): float64 + + /** Distance from camera of object that will be in focus, measured in meters. Internally this will be clamped to be at least 1 millimeter larger than [member frustum_focal_length]. */ + get frustum_focus_distance(): float64 + set frustum_focus_distance(value: float64) + + /** Distance between camera lens and camera aperture, measured in millimeters. Controls field of view and depth of field. A larger focal length will result in a smaller field of view and a narrower depth of field meaning fewer objects will be in focus. A smaller focal length will result in a wider field of view and a larger depth of field meaning more objects will be in focus. When attached to a [Camera3D] as its [member Camera3D.attributes], it will override the [member Camera3D.fov] property and the [member Camera3D.keep_aspect] property. */ + get frustum_focal_length(): float64 + set frustum_focal_length(value: float64) + + /** Override value for [member Camera3D.near]. Used internally when calculating depth of field. When attached to a [Camera3D] as its [member Camera3D.attributes], it will override the [member Camera3D.near] property. */ + get frustum_near(): float64 + set frustum_near(value: float64) + + /** Override value for [member Camera3D.far]. Used internally when calculating depth of field. When attached to a [Camera3D] as its [member Camera3D.attributes], it will override the [member Camera3D.far] property. */ + get frustum_far(): float64 + set frustum_far(value: float64) + + /** Size of the aperture of the camera, measured in f-stops. An f-stop is a unitless ratio between the focal length of the camera and the diameter of the aperture. A high aperture setting will result in a smaller aperture which leads to a dimmer image and sharper focus. A low aperture results in a wide aperture which lets in more light resulting in a brighter, less-focused image. Default is appropriate for outdoors at daytime (i.e. for use with a default [DirectionalLight3D]), for indoor lighting, a value between 2 and 4 is more appropriate. + * Only available when [member ProjectSettings.rendering/lights_and_shadows/use_physical_light_units] is enabled. + */ + get exposure_aperture(): float64 + set exposure_aperture(value: float64) + + /** Time for shutter to open and close, evaluated as `1 / shutter_speed` seconds. A higher value will allow less light (leading to a darker image), while a lower value will allow more light (leading to a brighter image). + * Only available when [member ProjectSettings.rendering/lights_and_shadows/use_physical_light_units] is enabled. + */ + get exposure_shutter_speed(): float64 + set exposure_shutter_speed(value: float64) + + /** The minimum luminance (in EV100) used when calculating auto exposure. When calculating scene average luminance, color values will be clamped to at least this value. This limits the auto-exposure from exposing above a certain brightness, resulting in a cut off point where the scene will remain dark. */ + get auto_exposure_min_exposure_value(): float64 + set auto_exposure_min_exposure_value(value: float64) + + /** The maximum luminance (in EV100) used when calculating auto exposure. When calculating scene average luminance, color values will be clamped to at least this value. This limits the auto-exposure from exposing below a certain brightness, resulting in a cut off point where the scene will remain bright. */ + get auto_exposure_max_exposure_value(): float64 + set auto_exposure_max_exposure_value(value: float64) + } + /** Camera settings in an easy to use format. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_cameraattributespractical.html + */ + class CameraAttributesPractical extends CameraAttributes { + constructor(identifier?: any) + /** Enables depth of field blur for objects further than [member dof_blur_far_distance]. Strength of blur is controlled by [member dof_blur_amount] and modulated by [member dof_blur_far_transition]. + * + * **Note:** Depth of field blur is only supported in the Forward+ and Mobile rendering methods, not Compatibility. + */ + get dof_blur_far_enabled(): boolean + set dof_blur_far_enabled(value: boolean) + + /** Objects further from the [Camera3D] by this amount will be blurred by the depth of field effect. Measured in meters. */ + get dof_blur_far_distance(): float64 + set dof_blur_far_distance(value: float64) + + /** When positive, distance over which (starting from [member dof_blur_far_distance]) blur effect will scale from 0 to [member dof_blur_amount]. When negative, uses physically-based scaling so depth of field effect will scale from 0 at [member dof_blur_far_distance] and will increase in a physically accurate way as objects get further from the [Camera3D]. */ + get dof_blur_far_transition(): float64 + set dof_blur_far_transition(value: float64) + + /** Enables depth of field blur for objects closer than [member dof_blur_near_distance]. Strength of blur is controlled by [member dof_blur_amount] and modulated by [member dof_blur_near_transition]. + * + * **Note:** Depth of field blur is only supported in the Forward+ and Mobile rendering methods, not Compatibility. + */ + get dof_blur_near_enabled(): boolean + set dof_blur_near_enabled(value: boolean) + + /** Objects closer from the [Camera3D] by this amount will be blurred by the depth of field effect. Measured in meters. */ + get dof_blur_near_distance(): float64 + set dof_blur_near_distance(value: float64) + + /** When positive, distance over which blur effect will scale from 0 to [member dof_blur_amount], ending at [member dof_blur_near_distance]. When negative, uses physically-based scaling so depth of field effect will scale from 0 at [member dof_blur_near_distance] and will increase in a physically accurate way as objects get closer to the [Camera3D]. */ + get dof_blur_near_transition(): float64 + set dof_blur_near_transition(value: float64) + + /** Sets the maximum amount of blur. When using physically-based blur amounts, will instead act as a multiplier. High values lead to an increased amount of blurriness, but can be much more expensive to calculate. It is best to keep this as low as possible for a given art style. */ + get dof_blur_amount(): float64 + set dof_blur_amount(value: float64) + + /** The minimum sensitivity (in ISO) used when calculating auto exposure. When calculating scene average luminance, color values will be clamped to at least this value. This limits the auto-exposure from exposing above a certain brightness, resulting in a cut off point where the scene will remain dark. */ + get auto_exposure_min_sensitivity(): float64 + set auto_exposure_min_sensitivity(value: float64) + + /** The maximum sensitivity (in ISO) used when calculating auto exposure. When calculating scene average luminance, color values will be clamped to at least this value. This limits the auto-exposure from exposing below a certain brightness, resulting in a cut off point where the scene will remain bright. */ + get auto_exposure_max_sensitivity(): float64 + set auto_exposure_max_sensitivity(value: float64) + } + namespace CameraFeed { + enum FeedDataType { + /** No image set for the feed. */ + FEED_NOIMAGE = 0, + + /** Feed supplies RGB images. */ + FEED_RGB = 1, + + /** Feed supplies YCbCr images that need to be converted to RGB. */ + FEED_YCBCR = 2, + + /** Feed supplies separate Y and CbCr images that need to be combined and converted to RGB. */ + FEED_YCBCR_SEP = 3, + + /** Feed supplies external image. */ + FEED_EXTERNAL = 4, + } + enum FeedPosition { + /** Unspecified position. */ + FEED_UNSPECIFIED = 0, + + /** Camera is mounted at the front of the device. */ + FEED_FRONT = 1, + + /** Camera is mounted at the back of the device. */ + FEED_BACK = 2, + } + } + /** A camera feed gives you access to a single physical camera attached to your device. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_camerafeed.html + */ + class CameraFeed extends RefCounted { + constructor(identifier?: any) + /** Called when the camera feed is activated. */ + /* gdvirtual */ _activate_feed(): boolean + + /** Called when the camera feed is deactivated. */ + /* gdvirtual */ _deactivate_feed(): void + + /** Returns the unique ID for this feed. */ + get_id(): int64 + + /** Returns the camera's name. */ + get_name(): string + + /** Sets the camera's name. */ + set_name(name: string): void + + /** Returns the position of camera on the device. */ + get_position(): CameraFeed.FeedPosition + + /** Sets the position of this camera. */ + set_position(position: CameraFeed.FeedPosition): void + + /** Sets RGB image for this feed. */ + set_rgb_image(rgb_image: Image): void + + /** Sets YCbCr image for this feed. */ + set_ycbcr_image(ycbcr_image: Image): void + + /** Sets the feed as external feed provided by another library. */ + set_external(width: int64, height: int64): void + + /** Returns the texture backend ID (usable by some external libraries that need a handle to a texture to write data). */ + get_texture_tex_id(feed_image_type: CameraServer.FeedImage): int64 + + /** Returns feed image data type. */ + get_datatype(): CameraFeed.FeedDataType + + /** Sets the feed format parameters for the given index in the [member formats] array. Returns `true` on success. By default YUYV encoded stream is transformed to FEED_RGB. YUYV encoded stream output format can be changed with [param parameters].output value: + * `separate` will result in FEED_YCBCR_SEP + * `grayscale` will result in desaturated FEED_RGB + * `copy` will result in FEED_YCBCR + */ + set_format(index: int64, parameters: GDictionary): boolean + + /** If `true`, the feed is active. */ + get feed_is_active(): boolean + set feed_is_active(value: boolean) + + /** The transform applied to the camera's image. */ + get feed_transform(): Transform2D + set feed_transform(value: Transform2D) + + /** Formats supported by the feed. Each entry is a [Dictionary] describing format parameters. */ + get formats(): GArray + + /** Emitted when a new frame is available. */ + readonly frame_changed: Signal0 + + /** Emitted when the format has changed. */ + readonly format_changed: Signal0 + } + /** Texture provided by a [CameraFeed]. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_cameratexture.html + */ + class CameraTexture extends Texture2D { + constructor(identifier?: any) + /** The ID of the [CameraFeed] for which we want to display the image. */ + get camera_feed_id(): int64 + set camera_feed_id(value: int64) + + /** Which image within the [CameraFeed] we want access to, important if the camera image is split in a Y and CbCr component. */ + get which_feed(): int64 + set which_feed(value: int64) + + /** Convenience property that gives access to the active property of the [CameraFeed]. */ + get camera_is_active(): boolean + set camera_is_active(value: boolean) + } + /** Merges several 2D nodes into a single draw operation. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_canvasgroup.html + */ + class CanvasGroup = Record> extends Node2D { + constructor(identifier?: any) + /** Sets the size of a margin used to expand the drawable rect of this [CanvasGroup]. The size of the [CanvasGroup] is determined by fitting a rect around its children then expanding that rect by [member fit_margin]. This increases both the backbuffer area used and the area covered by the [CanvasGroup] both of which can reduce performance. This should be kept as small as possible and should only be expanded when an increased size is needed (e.g. for custom shader effects). */ + get fit_margin(): float64 + set fit_margin(value: float64) + + /** Sets the size of the margin used to expand the clearing rect of this [CanvasGroup]. This expands the area of the backbuffer that will be used by the [CanvasGroup]. A smaller margin will reduce the area of the backbuffer used which can increase performance, however if [member use_mipmaps] is enabled, a small margin may result in mipmap errors at the edge of the [CanvasGroup]. Accordingly, this should be left as small as possible, but should be increased if artifacts appear along the edges of the canvas group. */ + get clear_margin(): float64 + set clear_margin(value: float64) + + /** If `true`, calculates mipmaps for the backbuffer before drawing the [CanvasGroup] so that mipmaps can be used in a custom [ShaderMaterial] attached to the [CanvasGroup]. Generating mipmaps has a performance cost so this should not be enabled unless required. */ + get use_mipmaps(): boolean + set use_mipmaps(value: boolean) + } + namespace CanvasItem { + enum TextureFilter { + /** The [CanvasItem] will inherit the filter from its parent. */ + TEXTURE_FILTER_PARENT_NODE = 0, + + /** The texture filter reads from the nearest pixel only. This makes the texture look pixelated from up close, and grainy from a distance (due to mipmaps not being sampled). */ + TEXTURE_FILTER_NEAREST = 1, + + /** The texture filter blends between the nearest 4 pixels. This makes the texture look smooth from up close, and grainy from a distance (due to mipmaps not being sampled). */ + TEXTURE_FILTER_LINEAR = 2, + + /** The texture filter reads from the nearest pixel and blends between the nearest 2 mipmaps (or uses the nearest mipmap if [member ProjectSettings.rendering/textures/default_filters/use_nearest_mipmap_filter] is `true`). This makes the texture look pixelated from up close, and smooth from a distance. + * Use this for non-pixel art textures that may be viewed at a low scale (e.g. due to [Camera2D] zoom or sprite scaling), as mipmaps are important to smooth out pixels that are smaller than on-screen pixels. + */ + TEXTURE_FILTER_NEAREST_WITH_MIPMAPS = 3, + + /** The texture filter blends between the nearest 4 pixels and between the nearest 2 mipmaps (or uses the nearest mipmap if [member ProjectSettings.rendering/textures/default_filters/use_nearest_mipmap_filter] is `true`). This makes the texture look smooth from up close, and smooth from a distance. + * Use this for non-pixel art textures that may be viewed at a low scale (e.g. due to [Camera2D] zoom or sprite scaling), as mipmaps are important to smooth out pixels that are smaller than on-screen pixels. + */ + TEXTURE_FILTER_LINEAR_WITH_MIPMAPS = 4, + + /** The texture filter reads from the nearest pixel and blends between 2 mipmaps (or uses the nearest mipmap if [member ProjectSettings.rendering/textures/default_filters/use_nearest_mipmap_filter] is `true`) based on the angle between the surface and the camera view. This makes the texture look pixelated from up close, and smooth from a distance. Anisotropic filtering improves texture quality on surfaces that are almost in line with the camera, but is slightly slower. The anisotropic filtering level can be changed by adjusting [member ProjectSettings.rendering/textures/default_filters/anisotropic_filtering_level]. + * + * **Note:** This texture filter is rarely useful in 2D projects. [constant TEXTURE_FILTER_NEAREST_WITH_MIPMAPS] is usually more appropriate in this case. + */ + TEXTURE_FILTER_NEAREST_WITH_MIPMAPS_ANISOTROPIC = 5, + + /** The texture filter blends between the nearest 4 pixels and blends between 2 mipmaps (or uses the nearest mipmap if [member ProjectSettings.rendering/textures/default_filters/use_nearest_mipmap_filter] is `true`) based on the angle between the surface and the camera view. This makes the texture look smooth from up close, and smooth from a distance. Anisotropic filtering improves texture quality on surfaces that are almost in line with the camera, but is slightly slower. The anisotropic filtering level can be changed by adjusting [member ProjectSettings.rendering/textures/default_filters/anisotropic_filtering_level]. + * + * **Note:** This texture filter is rarely useful in 2D projects. [constant TEXTURE_FILTER_LINEAR_WITH_MIPMAPS] is usually more appropriate in this case. + */ + TEXTURE_FILTER_LINEAR_WITH_MIPMAPS_ANISOTROPIC = 6, + + /** Represents the size of the [enum TextureFilter] enum. */ + TEXTURE_FILTER_MAX = 7, + } + enum TextureRepeat { + /** The [CanvasItem] will inherit the filter from its parent. */ + TEXTURE_REPEAT_PARENT_NODE = 0, + + /** Texture will not repeat. */ + TEXTURE_REPEAT_DISABLED = 1, + + /** Texture will repeat normally. */ + TEXTURE_REPEAT_ENABLED = 2, + + /** Texture will repeat in a 2×2 tiled mode, where elements at even positions are mirrored. */ + TEXTURE_REPEAT_MIRROR = 3, + + /** Represents the size of the [enum TextureRepeat] enum. */ + TEXTURE_REPEAT_MAX = 4, + } + enum ClipChildrenMode { + /** Child draws over parent and is not clipped. */ + CLIP_CHILDREN_DISABLED = 0, + + /** Parent is used for the purposes of clipping only. Child is clipped to the parent's visible area, parent is not drawn. */ + CLIP_CHILDREN_ONLY = 1, + + /** Parent is used for clipping child, but parent is also drawn underneath child as normal before clipping child to its visible area. */ + CLIP_CHILDREN_AND_DRAW = 2, + + /** Represents the size of the [enum ClipChildrenMode] enum. */ + CLIP_CHILDREN_MAX = 3, + } + } + /** Abstract base class for everything in 2D space. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_canvasitem.html + */ + class CanvasItem = Record> extends Node { + /** The [CanvasItem]'s global transform has changed. This notification is only received if enabled by [method set_notify_transform]. */ + static readonly NOTIFICATION_TRANSFORM_CHANGED = 2000 + + /** The [CanvasItem]'s local transform has changed. This notification is only received if enabled by [method set_notify_local_transform]. */ + static readonly NOTIFICATION_LOCAL_TRANSFORM_CHANGED = 35 + + /** The [CanvasItem] is requested to draw (see [method _draw]). */ + static readonly NOTIFICATION_DRAW = 30 + + /** The [CanvasItem]'s visibility has changed. */ + static readonly NOTIFICATION_VISIBILITY_CHANGED = 31 + + /** The [CanvasItem] has entered the canvas. */ + static readonly NOTIFICATION_ENTER_CANVAS = 32 + + /** The [CanvasItem] has exited the canvas. */ + static readonly NOTIFICATION_EXIT_CANVAS = 33 + + /** The [CanvasItem]'s active [World2D] changed. */ + static readonly NOTIFICATION_WORLD_2D_CHANGED = 36 + constructor(identifier?: any) + + /** Called when [CanvasItem] has been requested to redraw (after [method queue_redraw] is called, either manually or by the engine). + * Corresponds to the [constant NOTIFICATION_DRAW] notification in [method Object._notification]. + */ + /* gdvirtual */ _draw(): void + _top_level_raise_self(): void + _edit_set_state(state: GDictionary): void + _edit_get_state(): GDictionary + _edit_set_position(position: Vector2): void + _edit_get_position(): Vector2 + _edit_set_scale(scale: Vector2): void + _edit_get_scale(): Vector2 + _edit_set_rect(rect: Rect2): void + _edit_get_rect(): Rect2 + _edit_use_rect(): boolean + _edit_set_rotation(degrees: float64): void + _edit_get_rotation(): float64 + _edit_use_rotation(): boolean + _edit_set_pivot(pivot: Vector2): void + _edit_get_pivot(): Vector2 + _edit_use_pivot(): boolean + _edit_get_transform(): Transform2D + + /** Returns the canvas item RID used by [RenderingServer] for this item. */ + get_canvas_item(): RID + + /** Returns `true` if the node is present in the [SceneTree], its [member visible] property is `true` and all its ancestors are also visible. If any ancestor is hidden, this node will not be visible in the scene tree, and is therefore not drawn (see [method _draw]). + * Visibility is checked only in parent nodes that inherit from [CanvasItem], [CanvasLayer], and [Window]. If the parent is of any other type (such as [Node], [AnimationPlayer], or [Node3D]), it is assumed to be visible. + * + * **Note:** This method does not take [member visibility_layer] into account, so even if this method returns `true`, the node might end up not being rendered. + */ + is_visible_in_tree(): boolean + + /** Show the [CanvasItem] if it's currently hidden. This is equivalent to setting [member visible] to `true`. For controls that inherit [Popup], the correct way to make them visible is to call one of the multiple `popup*()` functions instead. */ + show(): void + + /** Hide the [CanvasItem] if it's currently visible. This is equivalent to setting [member visible] to `false`. */ + hide(): void + + /** Queues the [CanvasItem] to redraw. During idle time, if [CanvasItem] is visible, [constant NOTIFICATION_DRAW] is sent and [method _draw] is called. This only occurs **once** per frame, even if this method has been called multiple times. */ + queue_redraw(): void + + /** Moves this node to display on top of its siblings. + * Internally, the node is moved to the bottom of parent's child list. The method has no effect on nodes without a parent. + */ + move_to_front(): void + + /** Draws a line from a 2D point to another, with a given color and width. It can be optionally antialiased. See also [method draw_dashed_line], [method draw_multiline], and [method draw_polyline]. + * If [param width] is negative, then a two-point primitive will be drawn instead of a four-point one. This means that when the CanvasItem is scaled, the line will remain thin. If this behavior is not desired, then pass a positive [param width] like `1.0`. + */ + draw_line(from: Vector2, to: Vector2, color: Color, width: float64 = -1, antialiased: boolean = false): void + + /** Draws a dashed line from a 2D point to another, with a given color and width. See also [method draw_line], [method draw_multiline], and [method draw_polyline]. + * If [param width] is negative, then a two-point primitives will be drawn instead of a four-point ones. This means that when the CanvasItem is scaled, the line parts will remain thin. If this behavior is not desired, then pass a positive [param width] like `1.0`. + * [param dash] is the length of each dash in pixels, with the gap between each dash being the same length. If [param aligned] is `true`, the length of the first and last dashes may be shortened or lengthened to allow the line to begin and end at the precise points defined by [param from] and [param to]. Both ends are always symmetrical when [param aligned] is `true`. If [param aligned] is `false`, all dashes will have the same length, but the line may appear incomplete at the end due to the dash length not dividing evenly into the line length. Only full dashes are drawn when [param aligned] is `false`. + * If [param antialiased] is `true`, half transparent "feathers" will be attached to the boundary, making outlines smooth. + * + * **Note:** [param antialiased] is only effective if [param width] is greater than `0.0`. + */ + draw_dashed_line(from: Vector2, to: Vector2, color: Color, width: float64 = -1, dash: float64 = 2, aligned: boolean = true, antialiased: boolean = false): void + + /** Draws interconnected line segments with a uniform [param color] and [param width] and optional antialiasing (supported only for positive [param width]). When drawing large amounts of lines, this is faster than using individual [method draw_line] calls. To draw disconnected lines, use [method draw_multiline] instead. See also [method draw_polygon]. + * If [param width] is negative, it will be ignored and the polyline will be drawn using [constant RenderingServer.PRIMITIVE_LINE_STRIP]. This means that when the CanvasItem is scaled, the polyline will remain thin. If this behavior is not desired, then pass a positive [param width] like `1.0`. + */ + draw_polyline(points: PackedVector2Array | Vector2[], color: Color, width: float64 = -1, antialiased: boolean = false): void + + /** Draws interconnected line segments with a uniform [param width], point-by-point coloring, and optional antialiasing (supported only for positive [param width]). Colors assigned to line points match by index between [param points] and [param colors], i.e. each line segment is filled with a gradient between the colors of the endpoints. When drawing large amounts of lines, this is faster than using individual [method draw_line] calls. To draw disconnected lines, use [method draw_multiline_colors] instead. See also [method draw_polygon]. + * If [param width] is negative, it will be ignored and the polyline will be drawn using [constant RenderingServer.PRIMITIVE_LINE_STRIP]. This means that when the CanvasItem is scaled, the polyline will remain thin. If this behavior is not desired, then pass a positive [param width] like `1.0`. + */ + draw_polyline_colors(points: PackedVector2Array | Vector2[], colors: PackedColorArray | Color[], width: float64 = -1, antialiased: boolean = false): void + + /** Draws an unfilled arc between the given angles with a uniform [param color] and [param width] and optional antialiasing (supported only for positive [param width]). The larger the value of [param point_count], the smoother the curve. See also [method draw_circle]. + * If [param width] is negative, it will be ignored and the arc will be drawn using [constant RenderingServer.PRIMITIVE_LINE_STRIP]. This means that when the CanvasItem is scaled, the arc will remain thin. If this behavior is not desired, then pass a positive [param width] like `1.0`. + * The arc is drawn from [param start_angle] towards the value of [param end_angle] so in clockwise direction if `start_angle < end_angle` and counter-clockwise otherwise. Passing the same angles but in reversed order will produce the same arc. If absolute difference of [param start_angle] and [param end_angle] is greater than [constant @GDScript.TAU] radians, then a full circle arc is drawn (i.e. arc will not overlap itself). + */ + draw_arc(center: Vector2, radius: float64, start_angle: float64, end_angle: float64, point_count: int64, color: Color, width: float64 = -1, antialiased: boolean = false): void + + /** Draws multiple disconnected lines with a uniform [param width] and [param color]. Each line is defined by two consecutive points from [param points] array, i.e. i-th segment consists of `points[2 * i]`, `points[2 * i + 1]` endpoints. When drawing large amounts of lines, this is faster than using individual [method draw_line] calls. To draw interconnected lines, use [method draw_polyline] instead. + * If [param width] is negative, then two-point primitives will be drawn instead of a four-point ones. This means that when the CanvasItem is scaled, the lines will remain thin. If this behavior is not desired, then pass a positive [param width] like `1.0`. + * + * **Note:** [param antialiased] is only effective if [param width] is greater than `0.0`. + */ + draw_multiline(points: PackedVector2Array | Vector2[], color: Color, width: float64 = -1, antialiased: boolean = false): void + + /** Draws multiple disconnected lines with a uniform [param width] and segment-by-segment coloring. Each segment is defined by two consecutive points from [param points] array and a corresponding color from [param colors] array, i.e. i-th segment consists of `points[2 * i]`, `points[2 * i + 1]` endpoints and has `colors *` color. When drawing large amounts of lines, this is faster than using individual [method draw_line] calls. To draw interconnected lines, use [method draw_polyline_colors] instead. + * If [param width] is negative, then two-point primitives will be drawn instead of a four-point ones. This means that when the CanvasItem is scaled, the lines will remain thin. If this behavior is not desired, then pass a positive [param width] like `1.0`. + * + * **Note:** [param antialiased] is only effective if [param width] is greater than `0.0`. + */ + draw_multiline_colors(points: PackedVector2Array | Vector2[], colors: PackedColorArray | Color[], width: float64 = -1, antialiased: boolean = false): void + + /** Draws a rectangle. If [param filled] is `true`, the rectangle will be filled with the [param color] specified. If [param filled] is `false`, the rectangle will be drawn as a stroke with the [param color] and [param width] specified. See also [method draw_texture_rect]. + * If [param width] is negative, then two-point primitives will be drawn instead of a four-point ones. This means that when the CanvasItem is scaled, the lines will remain thin. If this behavior is not desired, then pass a positive [param width] like `1.0`. + * If [param antialiased] is `true`, half transparent "feathers" will be attached to the boundary, making outlines smooth. + * + * **Note:** [param width] is only effective if [param filled] is `false`. + * + * **Note:** Unfilled rectangles drawn with a negative [param width] may not display perfectly. For example, corners may be missing or brighter due to overlapping lines (for a translucent [param color]). + */ + draw_rect(rect: Rect2, color: Color, filled: boolean = true, width: float64 = -1, antialiased: boolean = false): void + + /** Draws a circle. See also [method draw_arc], [method draw_polyline], and [method draw_polygon]. + * If [param filled] is `true`, the circle will be filled with the [param color] specified. If [param filled] is `false`, the circle will be drawn as a stroke with the [param color] and [param width] specified. + * If [param width] is negative, then two-point primitives will be drawn instead of a four-point ones. This means that when the CanvasItem is scaled, the lines will remain thin. If this behavior is not desired, then pass a positive [param width] like `1.0`. + * If [param antialiased] is `true`, half transparent "feathers" will be attached to the boundary, making outlines smooth. + * + * **Note:** [param width] is only effective if [param filled] is `false`. + */ + draw_circle(position: Vector2, radius: float64, color: Color, filled: boolean = true, width: float64 = -1, antialiased: boolean = false): void + + /** Draws a texture at a given position. */ + draw_texture(texture: Texture2D, position: Vector2, modulate: Color = new Color(1, 1, 1, 1)): void + + /** Draws a textured rectangle at a given position, optionally modulated by a color. If [param transpose] is `true`, the texture will have its X and Y coordinates swapped. See also [method draw_rect] and [method draw_texture_rect_region]. */ + draw_texture_rect(texture: Texture2D, rect: Rect2, tile: boolean, modulate: Color = new Color(1, 1, 1, 1), transpose: boolean = false): void + + /** Draws a textured rectangle from a texture's region (specified by [param src_rect]) at a given position, optionally modulated by a color. If [param transpose] is `true`, the texture will have its X and Y coordinates swapped. See also [method draw_texture_rect]. */ + draw_texture_rect_region(texture: Texture2D, rect: Rect2, src_rect: Rect2, modulate: Color = new Color(1, 1, 1, 1), transpose: boolean = false, clip_uv: boolean = true): void + + /** Draws a textured rectangle region of the multi-channel signed distance field texture at a given position, optionally modulated by a color. See [member FontFile.multichannel_signed_distance_field] for more information and caveats about MSDF font rendering. + * If [param outline] is positive, each alpha channel value of pixel in region is set to maximum value of true distance in the [param outline] radius. + * Value of the [param pixel_range] should the same that was used during distance field texture generation. + */ + draw_msdf_texture_rect_region(texture: Texture2D, rect: Rect2, src_rect: Rect2, modulate: Color = new Color(1, 1, 1, 1), outline: float64 = 0, pixel_range: float64 = 4, scale: float64 = 1): void + + /** Draws a textured rectangle region of the font texture with LCD subpixel anti-aliasing at a given position, optionally modulated by a color. + * Texture is drawn using the following blend operation, blend mode of the [CanvasItemMaterial] is ignored: + * + */ + draw_lcd_texture_rect_region(texture: Texture2D, rect: Rect2, src_rect: Rect2, modulate: Color = new Color(1, 1, 1, 1)): void + + /** Draws a styled rectangle. */ + draw_style_box(style_box: StyleBox, rect: Rect2): void + + /** Draws a custom primitive. 1 point for a point, 2 points for a line, 3 points for a triangle, and 4 points for a quad. If 0 points or more than 4 points are specified, nothing will be drawn and an error message will be printed. See also [method draw_line], [method draw_polyline], [method draw_polygon], and [method draw_rect]. */ + draw_primitive(points: PackedVector2Array | Vector2[], colors: PackedColorArray | Color[], uvs: PackedVector2Array | Vector2[], texture: Texture2D = undefined): void + + /** Draws a solid polygon of any number of points, convex or concave. Unlike [method draw_colored_polygon], each point's color can be changed individually. See also [method draw_polyline] and [method draw_polyline_colors]. If you need more flexibility (such as being able to use bones), use [method RenderingServer.canvas_item_add_triangle_array] instead. + * + * **Note:** If you frequently redraw the same polygon with a large number of vertices, consider pre-calculating the triangulation with [method Geometry2D.triangulate_polygon] and using [method draw_mesh], [method draw_multimesh], or [method RenderingServer.canvas_item_add_triangle_array]. + */ + draw_polygon(points: PackedVector2Array | Vector2[], colors: PackedColorArray | Color[], uvs: PackedVector2Array | Vector2[] = [], texture: Texture2D = undefined): void + + /** Draws a colored polygon of any number of points, convex or concave. Unlike [method draw_polygon], a single color must be specified for the whole polygon. + * + * **Note:** If you frequently redraw the same polygon with a large number of vertices, consider pre-calculating the triangulation with [method Geometry2D.triangulate_polygon] and using [method draw_mesh], [method draw_multimesh], or [method RenderingServer.canvas_item_add_triangle_array]. + */ + draw_colored_polygon(points: PackedVector2Array | Vector2[], color: Color, uvs: PackedVector2Array | Vector2[] = [], texture: Texture2D = undefined): void + + /** Draws [param text] using the specified [param font] at the [param pos] (bottom-left corner using the baseline of the font). The text will have its color multiplied by [param modulate]. If [param width] is greater than or equal to 0, the text will be clipped if it exceeds the specified width. + * **Example:** Draw "Hello world", using the project's default font: + * + * See also [method Font.draw_string]. + */ + draw_string(font: Font, pos: Vector2, text: string, alignment: HorizontalAlignment = 0, width: float64 = -1, font_size: int64 = 16, modulate: Color = new Color(1, 1, 1, 1), justification_flags: TextServer.JustificationFlag = 3, direction: TextServer.Direction = 0, orientation: TextServer.Orientation = 0): void + + /** Breaks [param text] into lines and draws it using the specified [param font] at the [param pos] (top-left corner). The text will have its color multiplied by [param modulate]. If [param width] is greater than or equal to 0, the text will be clipped if it exceeds the specified width. */ + draw_multiline_string(font: Font, pos: Vector2, text: string, alignment: HorizontalAlignment = 0, width: float64 = -1, font_size: int64 = 16, max_lines: int64 = -1, modulate: Color = new Color(1, 1, 1, 1), brk_flags: TextServer.LineBreakFlag = 3, justification_flags: TextServer.JustificationFlag = 3, direction: TextServer.Direction = 0, orientation: TextServer.Orientation = 0): void + + /** Draws [param text] outline using the specified [param font] at the [param pos] (bottom-left corner using the baseline of the font). The text will have its color multiplied by [param modulate]. If [param width] is greater than or equal to 0, the text will be clipped if it exceeds the specified width. */ + draw_string_outline(font: Font, pos: Vector2, text: string, alignment: HorizontalAlignment = 0, width: float64 = -1, font_size: int64 = 16, size: int64 = 1, modulate: Color = new Color(1, 1, 1, 1), justification_flags: TextServer.JustificationFlag = 3, direction: TextServer.Direction = 0, orientation: TextServer.Orientation = 0): void + + /** Breaks [param text] to the lines and draws text outline using the specified [param font] at the [param pos] (top-left corner). The text will have its color multiplied by [param modulate]. If [param width] is greater than or equal to 0, the text will be clipped if it exceeds the specified width. */ + draw_multiline_string_outline(font: Font, pos: Vector2, text: string, alignment: HorizontalAlignment = 0, width: float64 = -1, font_size: int64 = 16, max_lines: int64 = -1, size: int64 = 1, modulate: Color = new Color(1, 1, 1, 1), brk_flags: TextServer.LineBreakFlag = 3, justification_flags: TextServer.JustificationFlag = 3, direction: TextServer.Direction = 0, orientation: TextServer.Orientation = 0): void + + /** Draws a string first character using a custom font. */ + draw_char(font: Font, pos: Vector2, char: string, font_size: int64 = 16, modulate: Color = new Color(1, 1, 1, 1)): void + + /** Draws a string first character outline using a custom font. */ + draw_char_outline(font: Font, pos: Vector2, char: string, font_size: int64 = 16, size: int64 = -1, modulate: Color = new Color(1, 1, 1, 1)): void + + /** Draws a [Mesh] in 2D, using the provided texture. See [MeshInstance2D] for related documentation. */ + draw_mesh(mesh: Mesh, texture: Texture2D, transform: Transform2D = new Transform2D(), modulate: Color = new Color(1, 1, 1, 1)): void + + /** Draws a [MultiMesh] in 2D with the provided texture. See [MultiMeshInstance2D] for related documentation. */ + draw_multimesh(multimesh: MultiMesh, texture: Texture2D): void + + /** Sets a custom transform for drawing via components. Anything drawn afterwards will be transformed by this. + * + * **Note:** [member FontFile.oversampling] does *not* take [param scale] into account. This means that scaling up/down will cause bitmap fonts and rasterized (non-MSDF) dynamic fonts to appear blurry or pixelated. To ensure text remains crisp regardless of scale, you can enable MSDF font rendering by enabling [member ProjectSettings.gui/theme/default_font_multichannel_signed_distance_field] (applies to the default project font only), or enabling **Multichannel Signed Distance Field** in the import options of a DynamicFont for custom fonts. On system fonts, [member SystemFont.multichannel_signed_distance_field] can be enabled in the inspector. + */ + draw_set_transform(position: Vector2, rotation: float64 = 0, scale: Vector2 = Vector2.ONE): void + + /** Sets a custom transform for drawing via matrix. Anything drawn afterwards will be transformed by this. */ + draw_set_transform_matrix(xform: Transform2D): void + + /** Subsequent drawing commands will be ignored unless they fall within the specified animation slice. This is a faster way to implement animations that loop on background rather than redrawing constantly. */ + draw_animation_slice(animation_length: float64, slice_begin: float64, slice_end: float64, offset: float64 = 0): void + + /** After submitting all animations slices via [method draw_animation_slice], this function can be used to revert drawing to its default state (all subsequent drawing commands will be visible). If you don't care about this particular use case, usage of this function after submitting the slices is not required. */ + draw_end_animation(): void + + /** Returns the transform matrix of this item. */ + get_transform(): Transform2D + + /** Returns the global transform matrix of this item, i.e. the combined transform up to the topmost [CanvasItem] node. The topmost item is a [CanvasItem] that either has no parent, has non-[CanvasItem] parent or it has [member top_level] enabled. */ + get_global_transform(): Transform2D + + /** Returns the transform from the local coordinate system of this [CanvasItem] to the [Viewport]s coordinate system. */ + get_global_transform_with_canvas(): Transform2D + + /** Returns the transform from the coordinate system of the canvas, this item is in, to the [Viewport]s embedders coordinate system. */ + get_viewport_transform(): Transform2D + + /** Returns the viewport's boundaries as a [Rect2]. */ + get_viewport_rect(): Rect2 + + /** Returns the transform from the coordinate system of the canvas, this item is in, to the [Viewport]s coordinate system. */ + get_canvas_transform(): Transform2D + + /** Returns the transform of this [CanvasItem] in global screen coordinates (i.e. taking window position into account). Mostly useful for editor plugins. + * Equals to [method get_global_transform] if the window is embedded (see [member Viewport.gui_embed_subwindows]). + */ + get_screen_transform(): Transform2D + + /** Returns the mouse's position in this [CanvasItem] using the local coordinate system of this [CanvasItem]. */ + get_local_mouse_position(): Vector2 + + /** Returns the mouse's position in the [CanvasLayer] that this [CanvasItem] is in using the coordinate system of the [CanvasLayer]. + * + * **Note:** For screen-space coordinates (e.g. when using a non-embedded [Popup]), you can use [method DisplayServer.mouse_get_position]. + */ + get_global_mouse_position(): Vector2 + + /** Returns the [RID] of the [World2D] canvas where this item is in. */ + get_canvas(): RID + + /** Returns the [CanvasLayer] that contains this node, or `null` if the node is not in any [CanvasLayer]. */ + get_canvas_layer_node(): CanvasLayer + + /** Returns the [World2D] where this item is in. */ + get_world_2d(): World2D + + /** Set the value of a shader uniform for this instance only ([url=https://docs.godotengine.org/en/4.4/tutorials/shaders/shader_reference/shading_language.html#per-instance-uniforms]per-instance uniform[/url]). See also [method ShaderMaterial.set_shader_parameter] to assign a uniform on all instances using the same [ShaderMaterial]. + * + * **Note:** For a shader uniform to be assignable on a per-instance basis, it *must* be defined with `instance uniform ...` rather than `uniform ...` in the shader code. + * + * **Note:** [param name] is case-sensitive and must match the name of the uniform in the code exactly (not the capitalized name in the inspector). + */ + set_instance_shader_parameter(name: StringName, value: any): void + + /** Get the value of a shader parameter as set on this instance. */ + get_instance_shader_parameter(name: StringName): any + + /** If [param enable] is `true`, this node will receive [constant NOTIFICATION_LOCAL_TRANSFORM_CHANGED] when its local transform changes. */ + set_notify_local_transform(enable: boolean): void + + /** Returns `true` if local transform notifications are communicated to children. */ + is_local_transform_notification_enabled(): boolean + + /** If [param enable] is `true`, this node will receive [constant NOTIFICATION_TRANSFORM_CHANGED] when its global transform changes. */ + set_notify_transform(enable: boolean): void + + /** Returns `true` if global transform notifications are communicated to children. */ + is_transform_notification_enabled(): boolean + + /** Forces the transform to update. Transform changes in physics are not instant for performance reasons. Transforms are accumulated and then set. Use this if you need an up-to-date transform when doing physics operations. */ + force_update_transform(): void + + /** Transforms [param viewport_point] from the viewport's coordinates to this node's local coordinates. + * For the opposite operation, use [method get_global_transform_with_canvas]. + * + */ + make_canvas_position_local(viewport_point: Vector2): Vector2 + + /** Transformations issued by [param event]'s inputs are applied in local space instead of global space. */ + make_input_local(event: InputEvent): InputEvent + + /** Set/clear individual bits on the rendering visibility layer. This simplifies editing this [CanvasItem]'s visibility layer. */ + set_visibility_layer_bit(layer: int64, enabled: boolean): void + + /** Returns an individual bit on the rendering visibility layer. */ + get_visibility_layer_bit(layer: int64): boolean + + /** If `true`, this [CanvasItem] may be drawn. Whether this [CanvasItem] is actually drawn depends on the visibility of all of its [CanvasItem] ancestors. In other words: this [CanvasItem] will be drawn when [method is_visible_in_tree] returns `true` and all [CanvasItem] ancestors share at least one [member visibility_layer] with this [CanvasItem]. + * + * **Note:** For controls that inherit [Popup], the correct way to make them visible is to call one of the multiple `popup*()` functions instead. + */ + get visible(): boolean + set visible(value: boolean) + + /** The color applied to this [CanvasItem]. This property does affect child [CanvasItem]s, unlike [member self_modulate] which only affects the node itself. */ + get modulate(): Color + set modulate(value: Color) + + /** The color applied to this [CanvasItem]. This property does **not** affect child [CanvasItem]s, unlike [member modulate] which affects both the node itself and its children. + * + * **Note:** Internal children (e.g. sliders in [ColorPicker] or tab bar in [TabContainer]) are also not affected by this property (see `include_internal` parameter of [method Node.get_child] and other similar methods). + */ + get self_modulate(): Color + set self_modulate(value: Color) + + /** If `true`, the object draws behind its parent. */ + get show_behind_parent(): boolean + set show_behind_parent(value: boolean) + + /** If `true`, this [CanvasItem] will *not* inherit its transform from parent [CanvasItem]s. Its draw order will also be changed to make it draw on top of other [CanvasItem]s that do not have [member top_level] set to `true`. The [CanvasItem] will effectively act as if it was placed as a child of a bare [Node]. */ + get top_level(): boolean + set top_level(value: boolean) + + /** Allows the current node to clip child nodes, essentially acting as a mask. + * + * **Note:** Clipping nodes cannot be nested or placed within [CanvasGroup]s. If an ancestor of this node clips its children or is a [CanvasGroup], then this node's clip mode should be set to [constant CLIP_CHILDREN_DISABLED] to avoid unexpected behavior. + */ + get clip_children(): int64 + set clip_children(value: int64) + + /** The rendering layers in which this [CanvasItem] responds to [Light2D] nodes. */ + get light_mask(): int64 + set light_mask(value: int64) + + /** The rendering layer in which this [CanvasItem] is rendered by [Viewport] nodes. A [Viewport] will render a [CanvasItem] if it and all its parents share a layer with the [Viewport]'s canvas cull mask. */ + get visibility_layer(): int64 + set visibility_layer(value: int64) + + /** Controls the order in which the nodes render. A node with a higher Z index will display in front of others. Must be between [constant RenderingServer.CANVAS_ITEM_Z_MIN] and [constant RenderingServer.CANVAS_ITEM_Z_MAX] (inclusive). + * + * **Note:** Changing the Z index of a [Control] only affects the drawing order, not the order in which input events are handled. This can be useful to implement certain UI animations, e.g. a menu where hovered items are scaled and should overlap others. + */ + get z_index(): int64 + set z_index(value: int64) + + /** If `true`, the node's Z index is relative to its parent's Z index. If this node's Z index is 2 and its parent's effective Z index is 3, then this node's effective Z index will be 2 + 3 = 5. */ + get z_as_relative(): boolean + set z_as_relative(value: boolean) + + /** If `true`, this and child [CanvasItem] nodes with a higher Y position are rendered in front of nodes with a lower Y position. If `false`, this and child [CanvasItem] nodes are rendered normally in scene tree order. + * With Y-sorting enabled on a parent node ('A') but disabled on a child node ('B'), the child node ('B') is sorted but its children ('C1', 'C2', etc.) render together on the same Y position as the child node ('B'). This allows you to organize the render order of a scene without changing the scene tree. + * Nodes sort relative to each other only if they are on the same [member z_index]. + */ + get y_sort_enabled(): boolean + set y_sort_enabled(value: boolean) + + /** The texture filtering mode to use on this [CanvasItem]. */ + get texture_filter(): int64 + set texture_filter(value: int64) + + /** The texture repeating mode to use on this [CanvasItem]. */ + get texture_repeat(): int64 + set texture_repeat(value: int64) + + /** The material applied to this [CanvasItem]. */ + get material(): CanvasItemMaterial | ShaderMaterial + set material(value: CanvasItemMaterial | ShaderMaterial) + + /** If `true`, the parent [CanvasItem]'s [member material] property is used as this one's material. */ + get use_parent_material(): boolean + set use_parent_material(value: boolean) + + /** Emitted when the [CanvasItem] must redraw, *after* the related [constant NOTIFICATION_DRAW] notification, and *before* [method _draw] is called. + * + * **Note:** Deferred connections do not allow drawing through the `draw_*` methods. + */ + readonly draw: Signal0 + + /** Emitted when the [CanvasItem]'s visibility changes, either because its own [member visible] property changed or because its visibility in the tree changed (see [method is_visible_in_tree]). */ + readonly visibility_changed: Signal0 + + /** Emitted when the [CanvasItem] is hidden, i.e. it's no longer visible in the tree (see [method is_visible_in_tree]). */ + readonly hidden: Signal0 + + /** Emitted when the [CanvasItem]'s boundaries (position or size) change, or when an action took place that may have affected these boundaries (e.g. changing [member Sprite2D.texture]). */ + readonly item_rect_changed: Signal0 + } + class CanvasItemEditor = Record> extends VBoxContainer { + constructor(identifier?: any) + _get_editor_data(_unnamed_arg0: Object): Object + update_viewport(): void + center_at(position: Vector2): void + _set_owner_for_node_and_children(_unnamed_arg0: Node, _unnamed_arg1: Node): void + readonly item_lock_status_changed: Signal0 + readonly item_group_status_changed: Signal0 + } + class CanvasItemEditorPlugin = Record> extends EditorPlugin { + constructor(identifier?: any) + } + class CanvasItemEditorViewport = Record> extends Control { + constructor(identifier?: any) + } + namespace CanvasItemMaterial { + enum BlendMode { + /** Mix blending mode. Colors are assumed to be independent of the alpha (opacity) value. */ + BLEND_MODE_MIX = 0, + + /** Additive blending mode. */ + BLEND_MODE_ADD = 1, + + /** Subtractive blending mode. */ + BLEND_MODE_SUB = 2, + + /** Multiplicative blending mode. */ + BLEND_MODE_MUL = 3, + + /** Mix blending mode. Colors are assumed to be premultiplied by the alpha (opacity) value. */ + BLEND_MODE_PREMULT_ALPHA = 4, + } + enum LightMode { + /** Render the material using both light and non-light sensitive material properties. */ + LIGHT_MODE_NORMAL = 0, + + /** Render the material as if there were no light. */ + LIGHT_MODE_UNSHADED = 1, + + /** Render the material as if there were only light. */ + LIGHT_MODE_LIGHT_ONLY = 2, + } + } + /** A material for [CanvasItem]s. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_canvasitemmaterial.html + */ + class CanvasItemMaterial extends Material { + constructor(identifier?: any) + /** The manner in which a material's rendering is applied to underlying textures. */ + get blend_mode(): int64 + set blend_mode(value: int64) + + /** The manner in which material reacts to lighting. */ + get light_mode(): int64 + set light_mode(value: int64) + + /** If `true`, enable spritesheet-based animation features when assigned to [GPUParticles2D] and [CPUParticles2D] nodes. The [member ParticleProcessMaterial.anim_speed_max] or [member CPUParticles2D.anim_speed_max] should also be set to a positive value for the animation to play. + * This property (and other `particles_anim_*` properties that depend on it) has no effect on other types of nodes. + */ + get particles_animation(): boolean + set particles_animation(value: boolean) + + /** The number of columns in the spritesheet assigned as [Texture2D] for a [GPUParticles2D] or [CPUParticles2D]. + * + * **Note:** This property is only used and visible in the editor if [member particles_animation] is `true`. + */ + get particles_anim_h_frames(): int64 + set particles_anim_h_frames(value: int64) + + /** The number of rows in the spritesheet assigned as [Texture2D] for a [GPUParticles2D] or [CPUParticles2D]. + * + * **Note:** This property is only used and visible in the editor if [member particles_animation] is `true`. + */ + get particles_anim_v_frames(): int64 + set particles_anim_v_frames(value: int64) + + /** If `true`, the particles animation will loop. + * + * **Note:** This property is only used and visible in the editor if [member particles_animation] is `true`. + */ + get particles_anim_loop(): boolean + set particles_anim_loop(value: boolean) + } + class CanvasItemMaterialConversionPlugin extends EditorResourceConversionPlugin { + constructor(identifier?: any) + } + /** A node used for independent rendering of objects within a 2D scene. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_canvaslayer.html + */ + class CanvasLayer = Record> extends Node { + constructor(identifier?: any) + /** Shows any [CanvasItem] under this [CanvasLayer]. This is equivalent to setting [member visible] to `true`. */ + show(): void + + /** Hides any [CanvasItem] under this [CanvasLayer]. This is equivalent to setting [member visible] to `false`. */ + hide(): void + + /** Returns the transform from the [CanvasLayer]s coordinate system to the [Viewport]s coordinate system. */ + get_final_transform(): Transform2D + + /** Returns the RID of the canvas used by this layer. */ + get_canvas(): RID + + /** Layer index for draw order. Lower values are drawn behind higher values. + * + * **Note:** If multiple CanvasLayers have the same layer index, [CanvasItem] children of one CanvasLayer are drawn behind the [CanvasItem] children of the other CanvasLayer. Which CanvasLayer is drawn in front is non-deterministic. + */ + get layer(): int64 + set layer(value: int64) + + /** If `false`, any [CanvasItem] under this [CanvasLayer] will be hidden. + * Unlike [member CanvasItem.visible], visibility of a [CanvasLayer] isn't propagated to underlying layers. + */ + get visible(): boolean + set visible(value: boolean) + + /** The layer's base offset. */ + get offset(): Vector2 + set offset(value: Vector2) + + /** The layer's rotation in radians. */ + get rotation(): float64 + set rotation(value: float64) + + /** The layer's scale. */ + get scale(): Vector2 + set scale(value: Vector2) + + /** The layer's transform. */ + get transform(): Transform2D + set transform(value: Transform2D) + + /** The custom [Viewport] node assigned to the [CanvasLayer]. If `null`, uses the default viewport instead. */ + get custom_viewport(): Viewport + set custom_viewport(value: Viewport) + + /** If enabled, the [CanvasLayer] stays in a fixed position on the screen. If disabled, the [CanvasLayer] maintains its position in world space. + * Together with [member follow_viewport_scale], this can be used for a pseudo-3D effect. + */ + get follow_viewport_enabled(): boolean + set follow_viewport_enabled(value: boolean) + + /** Scales the layer when using [member follow_viewport_enabled]. Layers moving into the foreground should have increasing scales, while layers moving into the background should have decreasing scales. */ + get follow_viewport_scale(): float64 + set follow_viewport_scale(value: float64) + + /** Emitted when visibility of the layer is changed. See [member visible]. */ + readonly visibility_changed: Signal0 + } + /** A node that applies a color tint to a canvas. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_canvasmodulate.html + */ + class CanvasModulate = Record> extends Node2D { + constructor(identifier?: any) + /** The tint color to apply. */ + get color(): Color + set color(value: Color) + } + /** Texture with optional normal and specular maps for use in 2D rendering. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_canvastexture.html + */ + class CanvasTexture extends Texture2D { + constructor(identifier?: any) + /** The diffuse (color) texture to use. This is the main texture you want to set in most cases. */ + get diffuse_texture(): Texture2D + set diffuse_texture(value: Texture2D) + + /** The normal map texture to use. Only has a visible effect if [Light2D]s are affecting this [CanvasTexture]. + * + * **Note:** Godot expects the normal map to use X+, Y+, and Z+ coordinates. See [url=http://wiki.polycount.com/wiki/Normal_Map_Technical_Details#Common_Swizzle_Coordinates]this page[/url] for a comparison of normal map coordinates expected by popular engines. + */ + get normal_texture(): Texture2D + set normal_texture(value: Texture2D) + + /** The specular map to use for [Light2D] specular reflections. This should be a grayscale or colored texture, with brighter areas resulting in a higher [member specular_shininess] value. Using a colored [member specular_texture] allows controlling specular shininess on a per-channel basis. Only has a visible effect if [Light2D]s are affecting this [CanvasTexture]. */ + get specular_texture(): Texture2D + set specular_texture(value: Texture2D) + + /** The multiplier for specular reflection colors. The [Light2D]'s color is also taken into account when determining the reflection color. Only has a visible effect if [Light2D]s are affecting this [CanvasTexture]. */ + get specular_color(): Color + set specular_color(value: Color) + + /** The specular exponent for [Light2D] specular reflections. Higher values result in a more glossy/"wet" look, with reflections becoming more localized and less visible overall. The default value of `1.0` disables specular reflections entirely. Only has a visible effect if [Light2D]s are affecting this [CanvasTexture]. */ + get specular_shininess(): float64 + set specular_shininess(value: float64) + + /** The texture filtering mode to use when drawing this [CanvasTexture]. */ + get texture_filter(): int64 + set texture_filter(value: int64) + + /** The texture repeat mode to use when drawing this [CanvasTexture]. */ + get texture_repeat(): int64 + set texture_repeat(value: int64) + } + /** Class representing a capsule-shaped [PrimitiveMesh]. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_capsulemesh.html + */ + class CapsuleMesh extends PrimitiveMesh { + constructor(identifier?: any) + /** Radius of the capsule mesh. */ + get radius(): float64 + set radius(value: float64) + + /** Total height of the capsule mesh (including the hemispherical ends). */ + get height(): float64 + set height(value: float64) + + /** Number of radial segments on the capsule mesh. */ + get radial_segments(): int64 + set radial_segments(value: int64) + + /** Number of rings along the height of the capsule. */ + get rings(): int64 + set rings(value: int64) + } + /** A 2D capsule shape used for physics collision. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_capsuleshape2d.html + */ + class CapsuleShape2D extends Shape2D { + constructor(identifier?: any) + /** The capsule's radius. */ + get radius(): float64 + set radius(value: float64) + + /** The capsule's height. */ + get height(): float64 + set height(value: float64) + } + /** A 3D capsule shape used for physics collision. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_capsuleshape3d.html + */ + class CapsuleShape3D extends Shape3D { + constructor(identifier?: any) + /** The capsule's radius. */ + get radius(): float64 + set radius(value: float64) + + /** The capsule's height. */ + get height(): float64 + set height(value: float64) + } + class Cast2DEditor = Record> extends Control { + constructor(identifier?: any) + } + class Cast2DEditorPlugin = Record> extends EditorPlugin { + constructor(identifier?: any) + } + /** A container that keeps child controls in its center. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_centercontainer.html + */ + class CenterContainer = Record> extends Container { + constructor(identifier?: any) + /** If `true`, centers children relative to the [CenterContainer]'s top left corner. */ + get use_top_left(): boolean + set use_top_left(value: boolean) + } + /** Controls how an individual character will be displayed in a [RichTextEffect]. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_charfxtransform.html + */ + class CharFXTransform extends RefCounted { + constructor(identifier?: any) + /** The current transform of the current glyph. It can be overridden (for example, by driving the position and rotation from a curve). You can also alter the existing value to apply transforms on top of other effects. */ + get transform(): Transform2D + set transform(value: Transform2D) + + /** Absolute character range in the string, corresponding to the glyph. + * + * **Note:** Read-only. Setting this property won't affect drawing. + */ + get range(): Vector2i + set range(value: Vector2i) + + /** The time elapsed since the [RichTextLabel] was added to the scene tree (in seconds). Time stops when the [RichTextLabel] is paused (see [member Node.process_mode]). Resets when the text in the [RichTextLabel] is changed. + * + * **Note:** Time still passes while the [RichTextLabel] is hidden. + */ + get elapsed_time(): float64 + set elapsed_time(value: float64) + + /** If `true`, the character will be drawn. If `false`, the character will be hidden. Characters around hidden characters will reflow to take the space of hidden characters. If this is not desired, set their [member color] to `Color(1, 1, 1, 0)` instead. */ + get visible(): boolean + set visible(value: boolean) + + /** If `true`, FX transform is called for outline drawing. + * + * **Note:** Read-only. Setting this property won't affect drawing. + */ + get outline(): boolean + set outline(value: boolean) + + /** The position offset the character will be drawn with (in pixels). */ + get offset(): Vector2 + set offset(value: Vector2) + + /** The color the character will be drawn with. */ + get color(): Color + set color(value: Color) + + /** Contains the arguments passed in the opening BBCode tag. By default, arguments are strings; if their contents match a type such as [bool], [int] or [float], they will be converted automatically. Color codes in the form `#rrggbb` or `#rgb` will be converted to an opaque [Color]. String arguments may not contain spaces, even if they're quoted. If present, quotes will also be present in the final string. + * For example, the opening BBCode tag `[example foo=hello bar=true baz=42 color=#ffffff]` will map to the following [Dictionary]: + * + */ + get env(): GDictionary + set env(value: GDictionary) + + /** Glyph index specific to the [member font]. If you want to replace this glyph, use [method TextServer.font_get_glyph_index] with [member font] to get a new glyph index for a single character. */ + get glyph_index(): int64 + set glyph_index(value: int64) + + /** Number of glyphs in the grapheme cluster. This value is set in the first glyph of a cluster. + * + * **Note:** Read-only. Setting this property won't affect drawing. + */ + get glyph_count(): int64 + set glyph_count(value: int64) + + /** Glyph flags. See [enum TextServer.GraphemeFlag] for more info. + * + * **Note:** Read-only. Setting this property won't affect drawing. + */ + get glyph_flags(): int64 + set glyph_flags(value: int64) + + /** The character offset of the glyph, relative to the current [RichTextEffect] custom block. + * + * **Note:** Read-only. Setting this property won't affect drawing. + */ + get relative_index(): int64 + set relative_index(value: int64) + + /** [TextServer] RID of the font used to render glyph, this value can be used with `TextServer.font_*` methods to retrieve font information. + * + * **Note:** Read-only. Setting this property won't affect drawing. + */ + get font(): RID + set font(value: RID) + } + namespace CharacterBody2D { + enum MotionMode { + /** Apply when notions of walls, ceiling and floor are relevant. In this mode the body motion will react to slopes (acceleration/slowdown). This mode is suitable for sided games like platformers. */ + MOTION_MODE_GROUNDED = 0, + + /** Apply when there is no notion of floor or ceiling. All collisions will be reported as `on_wall`. In this mode, when you slide, the speed will always be constant. This mode is suitable for top-down games. */ + MOTION_MODE_FLOATING = 1, + } + enum PlatformOnLeave { + /** Add the last platform velocity to the [member velocity] when you leave a moving platform. */ + PLATFORM_ON_LEAVE_ADD_VELOCITY = 0, + + /** Add the last platform velocity to the [member velocity] when you leave a moving platform, but any downward motion is ignored. It's useful to keep full jump height even when the platform is moving down. */ + PLATFORM_ON_LEAVE_ADD_UPWARD_VELOCITY = 1, + + /** Do nothing when leaving a platform. */ + PLATFORM_ON_LEAVE_DO_NOTHING = 2, + } + } + /** A 2D physics body specialized for characters moved by script. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_characterbody2d.html + */ + class CharacterBody2D = Record> extends PhysicsBody2D { + constructor(identifier?: any) + /** Moves the body based on [member velocity]. If the body collides with another, it will slide along the other body (by default only on floor) rather than stop immediately. If the other body is a [CharacterBody2D] or [RigidBody2D], it will also be affected by the motion of the other body. You can use this to make moving and rotating platforms, or to make nodes push other nodes. + * Modifies [member velocity] if a slide collision occurred. To get the latest collision call [method get_last_slide_collision], for detailed information about collisions that occurred, use [method get_slide_collision]. + * When the body touches a moving platform, the platform's velocity is automatically added to the body motion. If a collision occurs due to the platform's motion, it will always be first in the slide collisions. + * The general behavior and available properties change according to the [member motion_mode]. + * Returns `true` if the body collided, otherwise, returns `false`. + */ + move_and_slide(): boolean + + /** Allows to manually apply a snap to the floor regardless of the body's velocity. This function does nothing when [method is_on_floor] returns `true`. */ + apply_floor_snap(): void + + /** Returns `true` if the body collided with the floor on the last call of [method move_and_slide]. Otherwise, returns `false`. The [member up_direction] and [member floor_max_angle] are used to determine whether a surface is "floor" or not. */ + is_on_floor(): boolean + + /** Returns `true` if the body collided only with the floor on the last call of [method move_and_slide]. Otherwise, returns `false`. The [member up_direction] and [member floor_max_angle] are used to determine whether a surface is "floor" or not. */ + is_on_floor_only(): boolean + + /** Returns `true` if the body collided with the ceiling on the last call of [method move_and_slide]. Otherwise, returns `false`. The [member up_direction] and [member floor_max_angle] are used to determine whether a surface is "ceiling" or not. */ + is_on_ceiling(): boolean + + /** Returns `true` if the body collided only with the ceiling on the last call of [method move_and_slide]. Otherwise, returns `false`. The [member up_direction] and [member floor_max_angle] are used to determine whether a surface is "ceiling" or not. */ + is_on_ceiling_only(): boolean + + /** Returns `true` if the body collided with a wall on the last call of [method move_and_slide]. Otherwise, returns `false`. The [member up_direction] and [member floor_max_angle] are used to determine whether a surface is "wall" or not. */ + is_on_wall(): boolean + + /** Returns `true` if the body collided only with a wall on the last call of [method move_and_slide]. Otherwise, returns `false`. The [member up_direction] and [member floor_max_angle] are used to determine whether a surface is "wall" or not. */ + is_on_wall_only(): boolean + + /** Returns the collision normal of the floor at the last collision point. Only valid after calling [method move_and_slide] and when [method is_on_floor] returns `true`. + * **Warning:** The collision normal is not always the same as the surface normal. + */ + get_floor_normal(): Vector2 + + /** Returns the collision normal of the wall at the last collision point. Only valid after calling [method move_and_slide] and when [method is_on_wall] returns `true`. + * **Warning:** The collision normal is not always the same as the surface normal. + */ + get_wall_normal(): Vector2 + + /** Returns the last motion applied to the [CharacterBody2D] during the last call to [method move_and_slide]. The movement can be split into multiple motions when sliding occurs, and this method return the last one, which is useful to retrieve the current direction of the movement. */ + get_last_motion(): Vector2 + + /** Returns the travel (position delta) that occurred during the last call to [method move_and_slide]. */ + get_position_delta(): Vector2 + + /** Returns the current real velocity since the last call to [method move_and_slide]. For example, when you climb a slope, you will move diagonally even though the velocity is horizontal. This method returns the diagonal movement, as opposed to [member velocity] which returns the requested velocity. */ + get_real_velocity(): Vector2 + + /** Returns the floor's collision angle at the last collision point according to [param up_direction], which is [constant Vector2.UP] by default. This value is always positive and only valid after calling [method move_and_slide] and when [method is_on_floor] returns `true`. */ + get_floor_angle(up_direction: Vector2 = new Vector2(0, -1)): float64 + + /** Returns the linear velocity of the platform at the last collision point. Only valid after calling [method move_and_slide]. */ + get_platform_velocity(): Vector2 + + /** Returns the number of times the body collided and changed direction during the last call to [method move_and_slide]. */ + get_slide_collision_count(): int64 + + /** Returns a [KinematicCollision2D], which contains information about a collision that occurred during the last call to [method move_and_slide]. Since the body can collide several times in a single call to [method move_and_slide], you must specify the index of the collision in the range 0 to ([method get_slide_collision_count] - 1). + * **Example:** Iterate through the collisions with a `for` loop: + * + */ + get_slide_collision(slide_idx: int64): KinematicCollision2D + + /** Returns a [KinematicCollision2D], which contains information about the latest collision that occurred during the last call to [method move_and_slide]. */ + get_last_slide_collision(): KinematicCollision2D + + /** Sets the motion mode which defines the behavior of [method move_and_slide]. See [enum MotionMode] constants for available modes. */ + get motion_mode(): int64 + set motion_mode(value: int64) + + /** Vector pointing upwards, used to determine what is a wall and what is a floor (or a ceiling) when calling [method move_and_slide]. Defaults to [constant Vector2.UP]. As the vector will be normalized it can't be equal to [constant Vector2.ZERO], if you want all collisions to be reported as walls, consider using [constant MOTION_MODE_FLOATING] as [member motion_mode]. */ + get up_direction(): Vector2 + set up_direction(value: Vector2) + + /** Current velocity vector in pixels per second, used and modified during calls to [method move_and_slide]. */ + get velocity(): Vector2 + set velocity(value: Vector2) + + /** If `true`, during a jump against the ceiling, the body will slide, if `false` it will be stopped and will fall vertically. */ + get slide_on_ceiling(): boolean + set slide_on_ceiling(value: boolean) + + /** Maximum number of times the body can change direction before it stops when calling [method move_and_slide]. */ + get max_slides(): int64 + set max_slides(value: int64) + + /** Minimum angle (in radians) where the body is allowed to slide when it encounters a slope. The default value equals 15 degrees. This property only affects movement when [member motion_mode] is [constant MOTION_MODE_FLOATING]. */ + get wall_min_slide_angle(): float64 + set wall_min_slide_angle(value: float64) + + /** If `true`, the body will not slide on slopes when calling [method move_and_slide] when the body is standing still. + * If `false`, the body will slide on floor's slopes when [member velocity] applies a downward force. + */ + get floor_stop_on_slope(): boolean + set floor_stop_on_slope(value: boolean) + + /** If `false` (by default), the body will move faster on downward slopes and slower on upward slopes. + * If `true`, the body will always move at the same speed on the ground no matter the slope. Note that you need to use [member floor_snap_length] to stick along a downward slope at constant speed. + */ + get floor_constant_speed(): boolean + set floor_constant_speed(value: boolean) + + /** If `true`, the body will be able to move on the floor only. This option avoids to be able to walk on walls, it will however allow to slide down along them. */ + get floor_block_on_wall(): boolean + set floor_block_on_wall(value: boolean) + + /** Maximum angle (in radians) where a slope is still considered a floor (or a ceiling), rather than a wall, when calling [method move_and_slide]. The default value equals 45 degrees. */ + get floor_max_angle(): float64 + set floor_max_angle(value: float64) + + /** Sets a snapping distance. When set to a value different from `0.0`, the body is kept attached to slopes when calling [method move_and_slide]. The snapping vector is determined by the given distance along the opposite direction of the [member up_direction]. + * As long as the snapping vector is in contact with the ground and the body moves against [member up_direction], the body will remain attached to the surface. Snapping is not applied if the body moves along [member up_direction], meaning it contains vertical rising velocity, so it will be able to detach from the ground when jumping or when the body is pushed up by something. If you want to apply a snap without taking into account the velocity, use [method apply_floor_snap]. + */ + get floor_snap_length(): float64 + set floor_snap_length(value: float64) + + /** Sets the behavior to apply when you leave a moving platform. By default, to be physically accurate, when you leave the last platform velocity is applied. See [enum PlatformOnLeave] constants for available behavior. */ + get platform_on_leave(): int64 + set platform_on_leave(value: int64) + + /** Collision layers that will be included for detecting floor bodies that will act as moving platforms to be followed by the [CharacterBody2D]. By default, all floor bodies are detected and propagate their velocity. */ + get platform_floor_layers(): int64 + set platform_floor_layers(value: int64) + + /** Collision layers that will be included for detecting wall bodies that will act as moving platforms to be followed by the [CharacterBody2D]. By default, all wall bodies are ignored. */ + get platform_wall_layers(): int64 + set platform_wall_layers(value: int64) + + /** Extra margin used for collision recovery when calling [method move_and_slide]. + * If the body is at least this close to another body, it will consider them to be colliding and will be pushed away before performing the actual motion. + * A higher value means it's more flexible for detecting collision, which helps with consistently detecting walls and floors. + * A lower value forces the collision algorithm to use more exact detection, so it can be used in cases that specifically require precision, e.g at very low scale to avoid visible jittering, or for stability with a stack of character bodies. + */ + get safe_margin(): float64 + set safe_margin(value: float64) + } + namespace CharacterBody3D { + enum MotionMode { + /** Apply when notions of walls, ceiling and floor are relevant. In this mode the body motion will react to slopes (acceleration/slowdown). This mode is suitable for grounded games like platformers. */ + MOTION_MODE_GROUNDED = 0, + + /** Apply when there is no notion of floor or ceiling. All collisions will be reported as `on_wall`. In this mode, when you slide, the speed will always be constant. This mode is suitable for games without ground like space games. */ + MOTION_MODE_FLOATING = 1, + } + enum PlatformOnLeave { + /** Add the last platform velocity to the [member velocity] when you leave a moving platform. */ + PLATFORM_ON_LEAVE_ADD_VELOCITY = 0, + + /** Add the last platform velocity to the [member velocity] when you leave a moving platform, but any downward motion is ignored. It's useful to keep full jump height even when the platform is moving down. */ + PLATFORM_ON_LEAVE_ADD_UPWARD_VELOCITY = 1, + + /** Do nothing when leaving a platform. */ + PLATFORM_ON_LEAVE_DO_NOTHING = 2, + } + } + /** A 3D physics body specialized for characters moved by script. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_characterbody3d.html + */ + class CharacterBody3D = Record> extends PhysicsBody3D { + constructor(identifier?: any) + /** Moves the body based on [member velocity]. If the body collides with another, it will slide along the other body rather than stop immediately. If the other body is a [CharacterBody3D] or [RigidBody3D], it will also be affected by the motion of the other body. You can use this to make moving and rotating platforms, or to make nodes push other nodes. + * Modifies [member velocity] if a slide collision occurred. To get the latest collision call [method get_last_slide_collision], for more detailed information about collisions that occurred, use [method get_slide_collision]. + * When the body touches a moving platform, the platform's velocity is automatically added to the body motion. If a collision occurs due to the platform's motion, it will always be first in the slide collisions. + * Returns `true` if the body collided, otherwise, returns `false`. + */ + move_and_slide(): boolean + + /** Allows to manually apply a snap to the floor regardless of the body's velocity. This function does nothing when [method is_on_floor] returns `true`. */ + apply_floor_snap(): void + + /** Returns `true` if the body collided with the floor on the last call of [method move_and_slide]. Otherwise, returns `false`. The [member up_direction] and [member floor_max_angle] are used to determine whether a surface is "floor" or not. */ + is_on_floor(): boolean + + /** Returns `true` if the body collided only with the floor on the last call of [method move_and_slide]. Otherwise, returns `false`. The [member up_direction] and [member floor_max_angle] are used to determine whether a surface is "floor" or not. */ + is_on_floor_only(): boolean + + /** Returns `true` if the body collided with the ceiling on the last call of [method move_and_slide]. Otherwise, returns `false`. The [member up_direction] and [member floor_max_angle] are used to determine whether a surface is "ceiling" or not. */ + is_on_ceiling(): boolean + + /** Returns `true` if the body collided only with the ceiling on the last call of [method move_and_slide]. Otherwise, returns `false`. The [member up_direction] and [member floor_max_angle] are used to determine whether a surface is "ceiling" or not. */ + is_on_ceiling_only(): boolean + + /** Returns `true` if the body collided with a wall on the last call of [method move_and_slide]. Otherwise, returns `false`. The [member up_direction] and [member floor_max_angle] are used to determine whether a surface is "wall" or not. */ + is_on_wall(): boolean + + /** Returns `true` if the body collided only with a wall on the last call of [method move_and_slide]. Otherwise, returns `false`. The [member up_direction] and [member floor_max_angle] are used to determine whether a surface is "wall" or not. */ + is_on_wall_only(): boolean + + /** Returns the collision normal of the floor at the last collision point. Only valid after calling [method move_and_slide] and when [method is_on_floor] returns `true`. + * **Warning:** The collision normal is not always the same as the surface normal. + */ + get_floor_normal(): Vector3 + + /** Returns the collision normal of the wall at the last collision point. Only valid after calling [method move_and_slide] and when [method is_on_wall] returns `true`. + * **Warning:** The collision normal is not always the same as the surface normal. + */ + get_wall_normal(): Vector3 + + /** Returns the last motion applied to the [CharacterBody3D] during the last call to [method move_and_slide]. The movement can be split into multiple motions when sliding occurs, and this method return the last one, which is useful to retrieve the current direction of the movement. */ + get_last_motion(): Vector3 + + /** Returns the travel (position delta) that occurred during the last call to [method move_and_slide]. */ + get_position_delta(): Vector3 + + /** Returns the current real velocity since the last call to [method move_and_slide]. For example, when you climb a slope, you will move diagonally even though the velocity is horizontal. This method returns the diagonal movement, as opposed to [member velocity] which returns the requested velocity. */ + get_real_velocity(): Vector3 + + /** Returns the floor's collision angle at the last collision point according to [param up_direction], which is [constant Vector3.UP] by default. This value is always positive and only valid after calling [method move_and_slide] and when [method is_on_floor] returns `true`. */ + get_floor_angle(up_direction: Vector3 = Vector3.ZERO): float64 + + /** Returns the linear velocity of the platform at the last collision point. Only valid after calling [method move_and_slide]. */ + get_platform_velocity(): Vector3 + + /** Returns the angular velocity of the platform at the last collision point. Only valid after calling [method move_and_slide]. */ + get_platform_angular_velocity(): Vector3 + + /** Returns the number of times the body collided and changed direction during the last call to [method move_and_slide]. */ + get_slide_collision_count(): int64 + + /** Returns a [KinematicCollision3D], which contains information about a collision that occurred during the last call to [method move_and_slide]. Since the body can collide several times in a single call to [method move_and_slide], you must specify the index of the collision in the range 0 to ([method get_slide_collision_count] - 1). */ + get_slide_collision(slide_idx: int64): KinematicCollision3D + + /** Returns a [KinematicCollision3D], which contains information about the latest collision that occurred during the last call to [method move_and_slide]. */ + get_last_slide_collision(): KinematicCollision3D + + /** Sets the motion mode which defines the behavior of [method move_and_slide]. See [enum MotionMode] constants for available modes. */ + get motion_mode(): int64 + set motion_mode(value: int64) + + /** Vector pointing upwards, used to determine what is a wall and what is a floor (or a ceiling) when calling [method move_and_slide]. Defaults to [constant Vector3.UP]. As the vector will be normalized it can't be equal to [constant Vector3.ZERO], if you want all collisions to be reported as walls, consider using [constant MOTION_MODE_FLOATING] as [member motion_mode]. */ + get up_direction(): Vector3 + set up_direction(value: Vector3) + + /** If `true`, during a jump against the ceiling, the body will slide, if `false` it will be stopped and will fall vertically. */ + get slide_on_ceiling(): boolean + set slide_on_ceiling(value: boolean) + + /** Current velocity vector (typically meters per second), used and modified during calls to [method move_and_slide]. */ + get velocity(): Vector3 + set velocity(value: Vector3) + + /** Maximum number of times the body can change direction before it stops when calling [method move_and_slide]. */ + get max_slides(): int64 + set max_slides(value: int64) + + /** Minimum angle (in radians) where the body is allowed to slide when it encounters a slope. The default value equals 15 degrees. When [member motion_mode] is [constant MOTION_MODE_GROUNDED], it only affects movement if [member floor_block_on_wall] is `true`. */ + get wall_min_slide_angle(): float64 + set wall_min_slide_angle(value: float64) + + /** If `true`, the body will not slide on slopes when calling [method move_and_slide] when the body is standing still. + * If `false`, the body will slide on floor's slopes when [member velocity] applies a downward force. + */ + get floor_stop_on_slope(): boolean + set floor_stop_on_slope(value: boolean) + + /** If `false` (by default), the body will move faster on downward slopes and slower on upward slopes. + * If `true`, the body will always move at the same speed on the ground no matter the slope. Note that you need to use [member floor_snap_length] to stick along a downward slope at constant speed. + */ + get floor_constant_speed(): boolean + set floor_constant_speed(value: boolean) + + /** If `true`, the body will be able to move on the floor only. This option avoids to be able to walk on walls, it will however allow to slide down along them. */ + get floor_block_on_wall(): boolean + set floor_block_on_wall(value: boolean) + + /** Maximum angle (in radians) where a slope is still considered a floor (or a ceiling), rather than a wall, when calling [method move_and_slide]. The default value equals 45 degrees. */ + get floor_max_angle(): float64 + set floor_max_angle(value: float64) + + /** Sets a snapping distance. When set to a value different from `0.0`, the body is kept attached to slopes when calling [method move_and_slide]. The snapping vector is determined by the given distance along the opposite direction of the [member up_direction]. + * As long as the snapping vector is in contact with the ground and the body moves against [member up_direction], the body will remain attached to the surface. Snapping is not applied if the body moves along [member up_direction], meaning it contains vertical rising velocity, so it will be able to detach from the ground when jumping or when the body is pushed up by something. If you want to apply a snap without taking into account the velocity, use [method apply_floor_snap]. + */ + get floor_snap_length(): float64 + set floor_snap_length(value: float64) + + /** Sets the behavior to apply when you leave a moving platform. By default, to be physically accurate, when you leave the last platform velocity is applied. See [enum PlatformOnLeave] constants for available behavior. */ + get platform_on_leave(): int64 + set platform_on_leave(value: int64) + + /** Collision layers that will be included for detecting floor bodies that will act as moving platforms to be followed by the [CharacterBody3D]. By default, all floor bodies are detected and propagate their velocity. */ + get platform_floor_layers(): int64 + set platform_floor_layers(value: int64) + + /** Collision layers that will be included for detecting wall bodies that will act as moving platforms to be followed by the [CharacterBody3D]. By default, all wall bodies are ignored. */ + get platform_wall_layers(): int64 + set platform_wall_layers(value: int64) + + /** Extra margin used for collision recovery when calling [method move_and_slide]. + * If the body is at least this close to another body, it will consider them to be colliding and will be pushed away before performing the actual motion. + * A higher value means it's more flexible for detecting collision, which helps with consistently detecting walls and floors. + * A lower value forces the collision algorithm to use more exact detection, so it can be used in cases that specifically require precision, e.g at very low scale to avoid visible jittering, or for stability with a stack of character bodies. + */ + get safe_margin(): float64 + set safe_margin(value: float64) + } + /** A button that represents a binary choice. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_checkbox.html + */ + class CheckBox = Record> extends Button { + constructor(identifier?: any) + } + /** A button that represents a binary choice. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_checkbutton.html + */ + class CheckButton = Record> extends Button { + constructor(identifier?: any) + } + /** A 2D circle shape used for physics collision. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_circleshape2d.html + */ + class CircleShape2D extends Shape2D { + constructor(identifier?: any) + /** The circle's radius. */ + get radius(): float64 + set radius(value: float64) + } + namespace CodeEdit { + enum CodeCompletionKind { + /** Marks the option as a class. */ + KIND_CLASS = 0, + + /** Marks the option as a function. */ + KIND_FUNCTION = 1, + + /** Marks the option as a Godot signal. */ + KIND_SIGNAL = 2, + + /** Marks the option as a variable. */ + KIND_VARIABLE = 3, + + /** Marks the option as a member. */ + KIND_MEMBER = 4, + + /** Marks the option as an enum entry. */ + KIND_ENUM = 5, + + /** Marks the option as a constant. */ + KIND_CONSTANT = 6, + + /** Marks the option as a Godot node path. */ + KIND_NODE_PATH = 7, + + /** Marks the option as a file path. */ + KIND_FILE_PATH = 8, + + /** Marks the option as unclassified or plain text. */ + KIND_PLAIN_TEXT = 9, + } + enum CodeCompletionLocation { + /** The option is local to the location of the code completion query - e.g. a local variable. Subsequent value of location represent options from the outer class, the exact value represent how far they are (in terms of inner classes). */ + LOCATION_LOCAL = 0, + + /** The option is from the containing class or a parent class, relative to the location of the code completion query. Perform a bitwise OR with the class depth (e.g. `0` for the local class, `1` for the parent, `2` for the grandparent, etc.) to store the depth of an option in the class or a parent class. */ + LOCATION_PARENT_MASK = 256, + + /** The option is from user code which is not local and not in a derived class (e.g. Autoload Singletons). */ + LOCATION_OTHER_USER_CODE = 512, + + /** The option is from other engine code, not covered by the other enum constants - e.g. built-in classes. */ + LOCATION_OTHER = 1024, + } + } + /** A multiline text editor designed for editing code. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_codeedit.html + */ + class CodeEdit = Record> extends TextEdit { + constructor(identifier?: any) + /** Override this method to define how the selected entry should be inserted. If [param replace] is `true`, any existing text should be replaced. */ + /* gdvirtual */ _confirm_code_completion(replace: boolean): void + + /** Override this method to define what happens when the user requests code completion. If [param force] is `true`, any checks should be bypassed. */ + /* gdvirtual */ _request_code_completion(force: boolean): void + + /** Override this method to define what items in [param candidates] should be displayed. + * Both [param candidates] and the return is a [Array] of [Dictionary], see [method get_code_completion_option] for [Dictionary] content. + */ + /* gdvirtual */ _filter_code_completion_candidates(candidates: GArray): GArray + + /** If there is no selection, indentation is inserted at the caret. Otherwise, the selected lines are indented like [method indent_lines]. Equivalent to the [member ProjectSettings.input/ui_text_indent] action. The indentation characters used depend on [member indent_use_spaces] and [member indent_size]. */ + do_indent(): void + + /** Indents all lines that are selected or have a caret on them. Uses spaces or a tab depending on [member indent_use_spaces]. See [method unindent_lines]. */ + indent_lines(): void + + /** Unindents all lines that are selected or have a caret on them. Uses spaces or a tab depending on [member indent_use_spaces]. Equivalent to the [member ProjectSettings.input/ui_text_dedent] action. See [method indent_lines]. */ + unindent_lines(): void + + /** Converts the indents of lines between [param from_line] and [param to_line] to tabs or spaces as set by [member indent_use_spaces]. + * Values of `-1` convert the entire text. + */ + convert_indent(from_line: int64 = -1, to_line: int64 = -1): void + + /** Adds a brace pair. + * Both the start and end keys must be symbols. Only the start key has to be unique. + */ + add_auto_brace_completion_pair(start_key: string, end_key: string): void + + /** Returns `true` if open key [param open_key] exists. */ + has_auto_brace_completion_open_key(open_key: string): boolean + + /** Returns `true` if close key [param close_key] exists. */ + has_auto_brace_completion_close_key(close_key: string): boolean + + /** Gets the matching auto brace close key for [param open_key]. */ + get_auto_brace_completion_close_key(open_key: string): string + + /** Sets the given line as a breakpoint. If `true` and [member gutters_draw_breakpoints_gutter] is `true`, draws the [theme_item breakpoint] icon in the gutter for this line. See [method get_breakpointed_lines] and [method is_line_breakpointed]. */ + set_line_as_breakpoint(line: int64, breakpointed: boolean): void + + /** Returns `true` if the given line is breakpointed. See [method set_line_as_breakpoint]. */ + is_line_breakpointed(line: int64): boolean + + /** Clears all breakpointed lines. */ + clear_breakpointed_lines(): void + + /** Gets all breakpointed lines. */ + get_breakpointed_lines(): PackedInt32Array + + /** Sets the given line as bookmarked. If `true` and [member gutters_draw_bookmarks] is `true`, draws the [theme_item bookmark] icon in the gutter for this line. See [method get_bookmarked_lines] and [method is_line_bookmarked]. */ + set_line_as_bookmarked(line: int64, bookmarked: boolean): void + + /** Returns `true` if the given line is bookmarked. See [method set_line_as_bookmarked]. */ + is_line_bookmarked(line: int64): boolean + + /** Clears all bookmarked lines. */ + clear_bookmarked_lines(): void + + /** Gets all bookmarked lines. */ + get_bookmarked_lines(): PackedInt32Array + + /** Sets the given line as executing. If `true` and [member gutters_draw_executing_lines] is `true`, draws the [theme_item executing_line] icon in the gutter for this line. See [method get_executing_lines] and [method is_line_executing]. */ + set_line_as_executing(line: int64, executing: boolean): void + + /** Returns `true` if the given line is marked as executing. See [method set_line_as_executing]. */ + is_line_executing(line: int64): boolean + + /** Clears all executed lines. */ + clear_executing_lines(): void + + /** Gets all executing lines. */ + get_executing_lines(): PackedInt32Array + + /** Returns `true` if the given line is foldable. A line is foldable if it is the start of a valid code region (see [method get_code_region_start_tag]), if it is the start of a comment or string block, or if the next non-empty line is more indented (see [method TextEdit.get_indent_level]). */ + can_fold_line(line: int64): boolean + + /** Folds the given line, if possible (see [method can_fold_line]). */ + fold_line(line: int64): void + + /** Unfolds the given line if it is folded or if it is hidden under a folded line. */ + unfold_line(line: int64): void + + /** Folds all lines that are possible to be folded (see [method can_fold_line]). */ + fold_all_lines(): void + + /** Unfolds all lines that are folded. */ + unfold_all_lines(): void + + /** Toggle the folding of the code block at the given line. */ + toggle_foldable_line(line: int64): void + + /** Toggle the folding of the code block on all lines with a caret on them. */ + toggle_foldable_lines_at_carets(): void + + /** Returns `true` if the given line is folded. See [method fold_line]. */ + is_line_folded(line: int64): boolean + + /** Returns all lines that are currently folded. */ + get_folded_lines(): GArray + + /** Creates a new code region with the selection. At least one single line comment delimiter have to be defined (see [method add_comment_delimiter]). + * A code region is a part of code that is highlighted when folded and can help organize your script. + * Code region start and end tags can be customized (see [method set_code_region_tags]). + * Code regions are delimited using start and end tags (respectively `region` and `endregion` by default) preceded by one line comment delimiter. (eg. `#region` and `#endregion`) + */ + create_code_region(): void + + /** Returns the code region start tag (without comment delimiter). */ + get_code_region_start_tag(): string + + /** Returns the code region end tag (without comment delimiter). */ + get_code_region_end_tag(): string + + /** Sets the code region start and end tags (without comment delimiter). */ + set_code_region_tags(start: string = 'region', end: string = 'endregion'): void + + /** Returns `true` if the given line is a code region start. See [method set_code_region_tags]. */ + is_line_code_region_start(line: int64): boolean + + /** Returns `true` if the given line is a code region end. See [method set_code_region_tags]. */ + is_line_code_region_end(line: int64): boolean + + /** Defines a string delimiter from [param start_key] to [param end_key]. Both keys should be symbols, and [param start_key] must not be shared with other delimiters. + * If [param line_only] is `true` or [param end_key] is an empty [String], the region does not carry over to the next line. + */ + add_string_delimiter(start_key: string, end_key: string, line_only: boolean = false): void + + /** Removes the string delimiter with [param start_key]. */ + remove_string_delimiter(start_key: string): void + + /** Returns `true` if string [param start_key] exists. */ + has_string_delimiter(start_key: string): boolean + + /** Removes all string delimiters. */ + clear_string_delimiters(): void + + /** Returns the delimiter index if [param line] [param column] is in a string. If [param column] is not provided, will return the delimiter index if the entire [param line] is a string. Otherwise `-1`. */ + is_in_string(line: int64, column: int64 = -1): int64 + + /** Adds a comment delimiter from [param start_key] to [param end_key]. Both keys should be symbols, and [param start_key] must not be shared with other delimiters. + * If [param line_only] is `true` or [param end_key] is an empty [String], the region does not carry over to the next line. + */ + add_comment_delimiter(start_key: string, end_key: string, line_only: boolean = false): void + + /** Removes the comment delimiter with [param start_key]. */ + remove_comment_delimiter(start_key: string): void + + /** Returns `true` if comment [param start_key] exists. */ + has_comment_delimiter(start_key: string): boolean + + /** Removes all comment delimiters. */ + clear_comment_delimiters(): void + + /** Returns delimiter index if [param line] [param column] is in a comment. If [param column] is not provided, will return delimiter index if the entire [param line] is a comment. Otherwise `-1`. */ + is_in_comment(line: int64, column: int64 = -1): int64 + + /** Gets the start key for a string or comment region index. */ + get_delimiter_start_key(delimiter_index: int64): string + + /** Gets the end key for a string or comment region index. */ + get_delimiter_end_key(delimiter_index: int64): string + + /** If [param line] [param column] is in a string or comment, returns the start position of the region. If not or no start could be found, both [Vector2] values will be `-1`. */ + get_delimiter_start_position(line: int64, column: int64): Vector2 + + /** If [param line] [param column] is in a string or comment, returns the end position of the region. If not or no end could be found, both [Vector2] values will be `-1`. */ + get_delimiter_end_position(line: int64, column: int64): Vector2 + + /** Sets the code hint text. Pass an empty string to clear. */ + set_code_hint(code_hint: string): void + + /** If `true`, the code hint will draw below the main caret. If `false`, the code hint will draw above the main caret. See [method set_code_hint]. */ + set_code_hint_draw_below(draw_below: boolean): void + + /** Returns the full text with char `0xFFFF` at the caret location. */ + get_text_for_code_completion(): string + + /** Emits [signal code_completion_requested], if [param force] is `true` will bypass all checks. Otherwise will check that the caret is in a word or in front of a prefix. Will ignore the request if all current options are of type file path, node path, or signal. */ + request_code_completion(force: boolean = false): void + + /** Submits an item to the queue of potential candidates for the autocomplete menu. Call [method update_code_completion_options] to update the list. + * [param location] indicates location of the option relative to the location of the code completion query. See [enum CodeEdit.CodeCompletionLocation] for how to set this value. + * + * **Note:** This list will replace all current candidates. + */ + add_code_completion_option(type: CodeEdit.CodeCompletionKind, display_text: string, insert_text: string, text_color: Color = new Color(1, 1, 1, 1), icon: Resource = undefined, value: any = {}, location: int64 = 1024): void + + /** Submits all completion options added with [method add_code_completion_option]. Will try to force the autocomplete menu to popup, if [param force] is `true`. + * + * **Note:** This will replace all current candidates. + */ + update_code_completion_options(force: boolean): void + + /** Gets all completion options, see [method get_code_completion_option] for return content. */ + get_code_completion_options(): GArray + + /** Gets the completion option at [param index]. The return [Dictionary] has the following key-values: + * `kind`: [enum CodeCompletionKind] + * `display_text`: Text that is shown on the autocomplete menu. + * `insert_text`: Text that is to be inserted when this item is selected. + * `font_color`: Color of the text on the autocomplete menu. + * `icon`: Icon to draw on the autocomplete menu. + * `default_value`: Value of the symbol. + */ + get_code_completion_option(index: int64): GDictionary + + /** Gets the index of the current selected completion option. */ + get_code_completion_selected_index(): int64 + + /** Sets the current selected completion option. */ + set_code_completion_selected_index(index: int64): void + + /** Inserts the selected entry into the text. If [param replace] is `true`, any existing text is replaced rather than merged. */ + confirm_code_completion(replace: boolean = false): void + + /** Cancels the autocomplete menu. */ + cancel_code_completion(): void + + /** Returns the full text with char `0xFFFF` at the cursor location. */ + get_text_for_symbol_lookup(): string + + /** Returns the full text with char `0xFFFF` at the specified location. */ + get_text_with_cursor_char(line: int64, column: int64): string + + /** Sets the symbol emitted by [signal symbol_validate] as a valid lookup. */ + set_symbol_lookup_word_as_valid(valid: boolean): void + + /** Moves all lines up that are selected or have a caret on them. */ + move_lines_up(): void + + /** Moves all lines down that are selected or have a caret on them. */ + move_lines_down(): void + + /** Deletes all lines that are selected or have a caret on them. */ + delete_lines(): void + + /** Duplicates all selected text and duplicates all lines with a caret on them. */ + duplicate_selection(): void + + /** Duplicates all lines currently selected with any caret. Duplicates the entire line beneath the current one no matter where the caret is within the line. */ + duplicate_lines(): void + + /** Set when a validated word from [signal symbol_validate] is clicked, the [signal symbol_lookup] should be emitted. */ + get symbol_lookup_on_click(): boolean + set symbol_lookup_on_click(value: boolean) + + /** Set when a word is hovered, the [signal symbol_hovered] should be emitted. */ + get symbol_tooltip_on_hover(): boolean + set symbol_tooltip_on_hover(value: boolean) + + /** If `true`, lines can be folded. Otherwise, line folding methods like [method fold_line] will not work and [method can_fold_line] will always return `false`. See [member gutters_draw_fold_gutter]. */ + get line_folding(): boolean + set line_folding(value: boolean) + + /** Draws vertical lines at the provided columns. The first entry is considered a main hard guideline and is draw more prominently. */ + get line_length_guidelines(): PackedInt32Array + set line_length_guidelines(value: PackedInt32Array | int32[]) + + /** If `true`, breakpoints are drawn in the gutter. This gutter is shared with bookmarks and executing lines. Clicking the gutter will toggle the breakpoint for the line, see [method set_line_as_breakpoint]. */ + get gutters_draw_breakpoints_gutter(): boolean + set gutters_draw_breakpoints_gutter(value: boolean) + + /** If `true`, bookmarks are drawn in the gutter. This gutter is shared with breakpoints and executing lines. See [method set_line_as_bookmarked]. */ + get gutters_draw_bookmarks(): boolean + set gutters_draw_bookmarks(value: boolean) + + /** If `true`, executing lines are marked in the gutter. This gutter is shared with breakpoints and bookmarks. See [method set_line_as_executing]. */ + get gutters_draw_executing_lines(): boolean + set gutters_draw_executing_lines(value: boolean) + + /** If `true`, the line number gutter is drawn. Line numbers start at `1` and are incremented for each line of text. Clicking and dragging in the line number gutter will select entire lines of text. */ + get gutters_draw_line_numbers(): boolean + set gutters_draw_line_numbers(value: boolean) + + /** If `true`, line numbers drawn in the gutter are zero padded based on the total line count. Requires [member gutters_draw_line_numbers] to be set to `true`. */ + get gutters_zero_pad_line_numbers(): boolean + set gutters_zero_pad_line_numbers(value: boolean) + + /** If `true`, the fold gutter is drawn. In this gutter, the [theme_item can_fold_code_region] icon is drawn for each foldable line (see [method can_fold_line]) and the [theme_item folded_code_region] icon is drawn for each folded line (see [method is_line_folded]). These icons can be clicked to toggle the fold state, see [method toggle_foldable_line]. [member line_folding] must be `true` to show icons. */ + get gutters_draw_fold_gutter(): boolean + set gutters_draw_fold_gutter(value: boolean) + + /** Sets the string delimiters. All existing string delimiters will be removed. */ + get delimiter_strings(): PackedStringArray + set delimiter_strings(value: PackedStringArray | string[]) + + /** Sets the comment delimiters. All existing comment delimiters will be removed. */ + get delimiter_comments(): PackedStringArray + set delimiter_comments(value: PackedStringArray | string[]) + + /** If `true`, the [member ProjectSettings.input/ui_text_completion_query] action requests code completion. To handle it, see [method _request_code_completion] or [signal code_completion_requested]. */ + get code_completion_enabled(): boolean + set code_completion_enabled(value: boolean) + + /** Sets prefixes that will trigger code completion. */ + get code_completion_prefixes(): PackedStringArray + set code_completion_prefixes(value: PackedStringArray | string[]) + + /** Size of the tabulation indent (one [kbd]Tab[/kbd] press) in characters. If [member indent_use_spaces] is enabled the number of spaces to use. */ + get indent_size(): int64 + set indent_size(value: int64) + + /** Use spaces instead of tabs for indentation. */ + get indent_use_spaces(): boolean + set indent_use_spaces(value: boolean) + + /** If `true`, an extra indent is automatically inserted when a new line is added and a prefix in [member indent_automatic_prefixes] is found. If a brace pair opening key is found, the matching closing brace will be moved to another new line (see [member auto_brace_completion_pairs]). */ + get indent_automatic(): boolean + set indent_automatic(value: boolean) + + /** Prefixes to trigger an automatic indent. Used when [member indent_automatic] is set to `true`. */ + get indent_automatic_prefixes(): PackedStringArray + set indent_automatic_prefixes(value: PackedStringArray | string[]) + + /** If `true`, uses [member auto_brace_completion_pairs] to automatically insert the closing brace when the opening brace is inserted by typing or autocompletion. Also automatically removes the closing brace when using backspace on the opening brace. */ + get auto_brace_completion_enabled(): boolean + set auto_brace_completion_enabled(value: boolean) + + /** If `true`, highlights brace pairs when the caret is on either one, using [member auto_brace_completion_pairs]. If matching, the pairs will be underlined. If a brace is unmatched, it is colored with [theme_item brace_mismatch_color]. */ + get auto_brace_completion_highlight_matching(): boolean + set auto_brace_completion_highlight_matching(value: boolean) + + /** Sets the brace pairs to be autocompleted. For each entry in the dictionary, the key is the opening brace and the value is the closing brace that matches it. A brace is a [String] made of symbols. See [member auto_brace_completion_enabled] and [member auto_brace_completion_highlight_matching]. */ + get auto_brace_completion_pairs(): GDictionary + set auto_brace_completion_pairs(value: GDictionary) + + /** Emitted when a breakpoint is added or removed from a line. If the line is moved via backspace a removed is emitted at the old line. */ + readonly breakpoint_toggled: Signal1 + + /** Emitted when the user requests code completion. This signal will not be sent if [method _request_code_completion] is overridden or [member code_completion_enabled] is `false`. */ + readonly code_completion_requested: Signal0 + + /** Emitted when the user has clicked on a valid symbol. */ + readonly symbol_lookup: Signal3 + + /** Emitted when the user hovers over a symbol. The symbol should be validated and responded to, by calling [method set_symbol_lookup_word_as_valid]. + * + * **Note:** [member symbol_lookup_on_click] must be `true` for this signal to be emitted. + */ + readonly symbol_validate: Signal1 + + /** Emitted when the user hovers over a symbol. Unlike [signal Control.mouse_entered], this signal is not emitted immediately, but when the cursor is over the symbol for [member ProjectSettings.gui/timers/tooltip_delay_sec] seconds. + * + * **Note:** [member symbol_tooltip_on_hover] must be `true` for this signal to be emitted. + */ + readonly symbol_hovered: Signal3 + } /** A syntax highlighter intended for code. * - * @link https://docs.godotengine.org/en/4.3/classes/class_codehighlighter.html + * @link https://docs.godotengine.org/en/4.4/classes/class_codehighlighter.html */ class CodeHighlighter extends SyntaxHighlighter { constructor(identifier?: any) @@ -84,14 +4742,6 @@ declare module "godot" { get color_regions(): GDictionary set color_regions(value: GDictionary) } - class CodeTextEditor extends VBoxContainer { - constructor(identifier?: any) - readonly validate_script: Signal0 - readonly load_theme_settings: Signal0 - readonly show_errors_panel: Signal0 - readonly show_warnings_panel: Signal0 - readonly zoomed: Signal1 - } namespace CollisionObject2D { enum DisableMode { /** When [member Node.process_mode] is set to [constant Node.PROCESS_MODE_DISABLED], remove from the physics simulation to stop all physics interactions with this [CollisionObject2D]. @@ -110,9 +4760,9 @@ declare module "godot" { } /** Abstract base class for 2D physics objects. * - * @link https://docs.godotengine.org/en/4.3/classes/class_collisionobject2d.html + * @link https://docs.godotengine.org/en/4.4/classes/class_collisionobject2d.html */ - class CollisionObject2D extends Node2D { + class CollisionObject2D = Record> extends Node2D { constructor(identifier?: any) /** Accepts unhandled [InputEvent]s. [param shape_idx] is the child index of the clicked [Shape2D]. Connect to [signal input_event] to easily pick up these events. * @@ -210,14 +4860,14 @@ declare module "godot" { /** The physics layers this CollisionObject2D is in. Collision objects can exist in one or more of 32 different layers. See also [member collision_mask]. * - * **Note:** Object A can detect a contact with object B only if object B is in any of the layers that object A scans. See [url=https://docs.godotengine.org/en/4.3/tutorials/physics/physics_introduction.html#collision-layers-and-masks]Collision layers and masks[/url] in the documentation for more information. + * **Note:** Object A can detect a contact with object B only if object B is in any of the layers that object A scans. See [url=https://docs.godotengine.org/en/4.4/tutorials/physics/physics_introduction.html#collision-layers-and-masks]Collision layers and masks[/url] in the documentation for more information. */ get collision_layer(): int64 set collision_layer(value: int64) /** The physics layers this CollisionObject2D scans. Collision objects can scan one or more of 32 different layers. See also [member collision_layer]. * - * **Note:** Object A can detect a contact with object B only if object B is in any of the layers that object A scans. See [url=https://docs.godotengine.org/en/4.3/tutorials/physics/physics_introduction.html#collision-layers-and-masks]Collision layers and masks[/url] in the documentation for more information. + * **Note:** Object A can detect a contact with object B only if object B is in any of the layers that object A scans. See [url=https://docs.godotengine.org/en/4.4/tutorials/physics/physics_introduction.html#collision-layers-and-masks]Collision layers and masks[/url] in the documentation for more information. */ get collision_mask(): int64 set collision_mask(value: int64) @@ -269,9 +4919,9 @@ declare module "godot" { } /** Abstract base class for 3D physics objects. * - * @link https://docs.godotengine.org/en/4.3/classes/class_collisionobject3d.html + * @link https://docs.godotengine.org/en/4.4/classes/class_collisionobject3d.html */ - class CollisionObject3D extends Node3D { + class CollisionObject3D = Record> extends Node3D { constructor(identifier?: any) /** Receives unhandled [InputEvent]s. [param event_position] is the location in world space of the mouse pointer on the surface of the shape with index [param shape_idx] and [param normal] is the normal vector of the surface at that point. Connect to the [signal input_event] signal to easily pick up these events. * @@ -351,14 +5001,14 @@ declare module "godot" { /** The physics layers this CollisionObject3D **is in**. Collision objects can exist in one or more of 32 different layers. See also [member collision_mask]. * - * **Note:** Object A can detect a contact with object B only if object B is in any of the layers that object A scans. See [url=https://docs.godotengine.org/en/4.3/tutorials/physics/physics_introduction.html#collision-layers-and-masks]Collision layers and masks[/url] in the documentation for more information. + * **Note:** Object A can detect a contact with object B only if object B is in any of the layers that object A scans. See [url=https://docs.godotengine.org/en/4.4/tutorials/physics/physics_introduction.html#collision-layers-and-masks]Collision layers and masks[/url] in the documentation for more information. */ get collision_layer(): int64 set collision_layer(value: int64) /** The physics layers this CollisionObject3D **scans**. Collision objects can scan one or more of 32 different layers. See also [member collision_layer]. * - * **Note:** Object A can detect a contact with object B only if object B is in any of the layers that object A scans. See [url=https://docs.godotengine.org/en/4.3/tutorials/physics/physics_introduction.html#collision-layers-and-masks]Collision layers and masks[/url] in the documentation for more information. + * **Note:** Object A can detect a contact with object B only if object B is in any of the layers that object A scans. See [url=https://docs.godotengine.org/en/4.4/tutorials/physics/physics_introduction.html#collision-layers-and-masks]Collision layers and masks[/url] in the documentation for more information. */ get collision_mask(): int64 set collision_mask(value: int64) @@ -404,9 +5054,9 @@ declare module "godot" { } /** A node that provides a polygon shape to a [CollisionObject2D] parent. * - * @link https://docs.godotengine.org/en/4.3/classes/class_collisionpolygon2d.html + * @link https://docs.godotengine.org/en/4.4/classes/class_collisionpolygon2d.html */ - class CollisionPolygon2D extends Node2D { + class CollisionPolygon2D = Record> extends Node2D { constructor(identifier?: any) /** Collision build mode. Use one of the [enum BuildMode] constants. */ get build_mode(): int64 @@ -434,17 +5084,17 @@ declare module "godot" { get one_way_collision_margin(): float64 set one_way_collision_margin(value: float64) } - class CollisionPolygon2DEditor extends AbstractPolygon2DEditor { + class CollisionPolygon2DEditor = Record> extends AbstractPolygon2DEditor { constructor(identifier?: any) } - class CollisionPolygon2DEditorPlugin extends AbstractPolygon2DEditorPlugin { + class CollisionPolygon2DEditorPlugin = Record> extends AbstractPolygon2DEditorPlugin { constructor(identifier?: any) } /** A node that provides a thickened polygon shape (a prism) to a [CollisionObject3D] parent. * - * @link https://docs.godotengine.org/en/4.3/classes/class_collisionpolygon3d.html + * @link https://docs.godotengine.org/en/4.4/classes/class_collisionpolygon3d.html */ - class CollisionPolygon3D extends Node3D { + class CollisionPolygon3D = Record> extends Node3D { constructor(identifier?: any) _is_editable_3d_polygon(): boolean @@ -463,15 +5113,26 @@ declare module "godot" { /** The collision margin for the generated [Shape3D]. See [member Shape3D.margin] for more details. */ get margin(): float64 set margin(value: float64) + + /** The collision shape color that is displayed in the editor, or in the running project if **Debug > Visible Collision Shapes** is checked at the top of the editor. + * + * **Note:** The default value is [member ProjectSettings.debug/shapes/collision/shape_color]. The `Color(0, 0, 0, 0)` value documented here is a placeholder, and not the actual default debug color. + */ + get debug_color(): Color + set debug_color(value: Color) + + /** If `true`, when the shape is displayed, it will show a solid fill color in addition to its wireframe. */ + get debug_fill(): boolean + set debug_fill(value: boolean) } class CollisionPolygon3DGizmoPlugin extends EditorNode3DGizmoPlugin { constructor(identifier?: any) } /** A node that provides a [Shape2D] to a [CollisionObject2D] parent. * - * @link https://docs.godotengine.org/en/4.3/classes/class_collisionshape2d.html + * @link https://docs.godotengine.org/en/4.4/classes/class_collisionshape2d.html */ - class CollisionShape2D extends Node2D { + class CollisionShape2D = Record> extends Node2D { constructor(identifier?: any) /** The actual shape owned by this collision shape. */ get shape(): Shape2D @@ -492,24 +5153,24 @@ declare module "godot" { get one_way_collision_margin(): float64 set one_way_collision_margin(value: float64) - /** The collision shape debug color. + /** The collision shape color that is displayed in the editor, or in the running project if **Debug > Visible Collision Shapes** is checked at the top of the editor. * - * **Note:** The default value is [member ProjectSettings.debug/shapes/collision/shape_color]. The `Color(0, 0, 0, 1)` value documented here is a placeholder, and not the actual default debug color. + * **Note:** The default value is [member ProjectSettings.debug/shapes/collision/shape_color]. The `Color(0, 0, 0, 0)` value documented here is a placeholder, and not the actual default debug color. */ get debug_color(): Color set debug_color(value: Color) } - class CollisionShape2DEditor extends Control { + class CollisionShape2DEditor = Record> extends Control { constructor(identifier?: any) } - class CollisionShape2DEditorPlugin extends EditorPlugin { + class CollisionShape2DEditorPlugin = Record> extends EditorPlugin { constructor(identifier?: any) } /** A node that provides a [Shape3D] to a [CollisionObject3D] parent. * - * @link https://docs.godotengine.org/en/4.3/classes/class_collisionshape3d.html + * @link https://docs.godotengine.org/en/4.4/classes/class_collisionshape3d.html */ - class CollisionShape3D extends Node3D { + class CollisionShape3D = Record> extends Node3D { constructor(identifier?: any) /** This method does nothing. */ resource_changed(resource: Resource): void @@ -524,10 +5185,31 @@ declare module "godot" { /** A disabled collision shape has no effect in the world. */ get disabled(): boolean set disabled(value: boolean) + + /** The collision shape color that is displayed in the editor, or in the running project if **Debug > Visible Collision Shapes** is checked at the top of the editor. + * + * **Note:** The default value is [member ProjectSettings.debug/shapes/collision/shape_color]. The `Color(0, 0, 0, 0)` value documented here is a placeholder, and not the actual default debug color. + */ + get debug_color(): Color + set debug_color(value: Color) + + /** If `true`, when the shape is displayed, it will show a solid fill color in addition to its wireframe. */ + get debug_fill(): boolean + set debug_fill(value: boolean) } class CollisionShape3DGizmoPlugin extends EditorNode3DGizmoPlugin { constructor(identifier?: any) } + /** A resource class for managing a palette of colors, which can be loaded and saved using [ColorPicker]. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_colorpalette.html + */ + class ColorPalette extends Resource { + constructor(identifier?: any) + /** A [PackedColorArray] containing the colors in the palette. */ + get colors(): PackedColorArray + set colors(value: PackedColorArray | Color[]) + } namespace ColorPicker { enum ColorModeType { /** Allows editing the color with Red/Green/Blue sliders. */ @@ -564,9 +5246,9 @@ declare module "godot" { } /** A widget that provides an interface for selecting or modifying a color. * - * @link https://docs.godotengine.org/en/4.3/classes/class_colorpicker.html + * @link https://docs.godotengine.org/en/4.4/classes/class_colorpicker.html */ - class ColorPicker extends VBoxContainer { + class ColorPicker = Record> extends VBoxContainer { constructor(identifier?: any) /** Adds the given color to a list of color presets. The presets are displayed in the color picker and the user will be able to select them. * @@ -647,9 +5329,9 @@ declare module "godot" { } /** A button that brings up a [ColorPicker] when pressed. * - * @link https://docs.godotengine.org/en/4.3/classes/class_colorpickerbutton.html + * @link https://docs.godotengine.org/en/4.4/classes/class_colorpickerbutton.html */ - class ColorPickerButton extends Button { + class ColorPickerButton = Record> extends Button { constructor(identifier?: any) /** Returns the [ColorPicker] that this node toggles. * **Warning:** This is a required internal node, removing and freeing it may cause a crash. If you wish to hide it or any of its children, use their [member CanvasItem.visible] property. @@ -681,9 +5363,9 @@ declare module "godot" { } /** A control that displays a solid color rectangle. * - * @link https://docs.godotengine.org/en/4.3/classes/class_colorrect.html + * @link https://docs.godotengine.org/en/4.4/classes/class_colorrect.html */ - class ColorRect extends Control { + class ColorRect = Record> extends Control { constructor(identifier?: any) /** The fill color of the rectangle. */ get color(): Color @@ -691,7 +5373,7 @@ declare module "godot" { } /** Stores attributes used to customize how a Viewport is rendered. * - * @link https://docs.godotengine.org/en/4.3/classes/class_compositor.html + * @link https://docs.godotengine.org/en/4.4/classes/class_compositor.html */ class Compositor extends Resource { constructor(identifier?: any) @@ -713,7 +5395,7 @@ declare module "godot" { /** The callback is called before our transparent rendering pass, but after our sky is rendered and we've created our back buffers. */ EFFECT_CALLBACK_TYPE_PRE_TRANSPARENT = 3, - /** The callback is called after our transparent rendering pass, but before any build in post effects and output to our render target. */ + /** The callback is called after our transparent rendering pass, but before any built-in post-processing effects and output to our render target. */ EFFECT_CALLBACK_TYPE_POST_TRANSPARENT = 4, /** Represents the size of the [enum EffectCallbackType] enum. */ @@ -722,7 +5404,7 @@ declare module "godot" { } /** This resource allows for creating a custom rendering effect. * - * @link https://docs.godotengine.org/en/4.3/classes/class_compositoreffect.html + * @link https://docs.godotengine.org/en/4.4/classes/class_compositoreffect.html */ class CompositorEffect extends Resource { constructor(identifier?: any) @@ -765,6 +5447,8 @@ declare module "godot" { * * **Note:** In [method _render_callback], to access the roughness buffer use: * + * The raw normal and roughness buffer is stored in an optimized format, different than the one available in Spatial shaders. When sampling the buffer, a conversion function must be applied. Use this function, copied from [url=https://github.com/godotengine/godot/blob/da5f39889f155658cef7f7ec3cc1abb94e17d815/servers/rendering/renderer_rd/shaders/forward_clustered/scene_forward_clustered_inc.glsl#L334-L341]here[/url]: + * */ get needs_normal_roughness(): boolean set needs_normal_roughness(value: boolean) @@ -775,21 +5459,21 @@ declare module "godot" { } /** An optionally compressed [Cubemap]. * - * @link https://docs.godotengine.org/en/4.3/classes/class_compressedcubemap.html + * @link https://docs.godotengine.org/en/4.4/classes/class_compressedcubemap.html */ class CompressedCubemap extends CompressedTextureLayered { constructor(identifier?: any) } /** An optionally compressed [CubemapArray]. * - * @link https://docs.godotengine.org/en/4.3/classes/class_compressedcubemaparray.html + * @link https://docs.godotengine.org/en/4.4/classes/class_compressedcubemaparray.html */ class CompressedCubemapArray extends CompressedTextureLayered { constructor(identifier?: any) } /** Texture with 2 dimensions, optionally compressed. * - * @link https://docs.godotengine.org/en/4.3/classes/class_compressedtexture2d.html + * @link https://docs.godotengine.org/en/4.4/classes/class_compressedtexture2d.html */ class CompressedTexture2D extends Texture2D { constructor(identifier?: any) @@ -799,14 +5483,14 @@ declare module "godot" { } /** Array of 2-dimensional textures, optionally compressed. * - * @link https://docs.godotengine.org/en/4.3/classes/class_compressedtexture2darray.html + * @link https://docs.godotengine.org/en/4.4/classes/class_compressedtexture2darray.html */ class CompressedTexture2DArray extends CompressedTextureLayered { constructor(identifier?: any) } /** Texture with 3 dimensions, optionally compressed. * - * @link https://docs.godotengine.org/en/4.3/classes/class_compressedtexture3d.html + * @link https://docs.godotengine.org/en/4.4/classes/class_compressedtexture3d.html */ class CompressedTexture3D extends Texture3D { constructor(identifier?: any) @@ -816,7 +5500,7 @@ declare module "godot" { } /** Base class for texture arrays that can optionally be compressed. * - * @link https://docs.godotengine.org/en/4.3/classes/class_compressedtexturelayered.html + * @link https://docs.godotengine.org/en/4.4/classes/class_compressedtexturelayered.html */ class CompressedTextureLayered extends TextureLayered { constructor(identifier?: any) @@ -826,7 +5510,7 @@ declare module "godot" { } /** A 2D polyline shape used for physics collision. * - * @link https://docs.godotengine.org/en/4.3/classes/class_concavepolygonshape2d.html + * @link https://docs.godotengine.org/en/4.4/classes/class_concavepolygonshape2d.html */ class ConcavePolygonShape2D extends Shape2D { constructor(identifier?: any) @@ -836,7 +5520,7 @@ declare module "godot" { } /** A 3D trimesh shape used for physics collision. * - * @link https://docs.godotengine.org/en/4.3/classes/class_concavepolygonshape3d.html + * @link https://docs.godotengine.org/en/4.4/classes/class_concavepolygonshape3d.html */ class ConcavePolygonShape3D extends Shape3D { constructor(identifier?: any) @@ -878,9 +5562,9 @@ declare module "godot" { } /** A physics joint that connects two 3D physics bodies in a way that simulates a ball-and-socket joint. * - * @link https://docs.godotengine.org/en/4.3/classes/class_conetwistjoint3d.html + * @link https://docs.godotengine.org/en/4.4/classes/class_conetwistjoint3d.html */ - class ConeTwistJoint3D extends Joint3D { + class ConeTwistJoint3D = Record> extends Joint3D { constructor(identifier?: any) /** Sets the value of the specified parameter. */ set_param(param: ConeTwistJoint3D.Param, value: float64): void @@ -918,7 +5602,7 @@ declare module "godot" { } /** Helper class to handle INI-style files. * - * @link https://docs.godotengine.org/en/4.3/classes/class_configfile.html + * @link https://docs.godotengine.org/en/4.4/classes/class_configfile.html */ class ConfigFile extends RefCounted { constructor(identifier?: any) @@ -989,9 +5673,9 @@ declare module "godot" { } /** A dialog used for confirmation of actions. * - * @link https://docs.godotengine.org/en/4.3/classes/class_confirmationdialog.html + * @link https://docs.godotengine.org/en/4.4/classes/class_confirmationdialog.html */ - class ConfirmationDialog extends AcceptDialog { + class ConfirmationDialog = Record> extends AcceptDialog { constructor(identifier?: any) /** Returns the cancel button. * **Warning:** This is a required internal node, removing and freeing it may cause a crash. If you wish to hide it or any of its children, use their [member CanvasItem.visible] property. @@ -1002,25 +5686,22 @@ declare module "godot" { get cancel_button_text(): string set cancel_button_text(value: string) } - class ConnectDialog extends ConfirmationDialog { + class ConnectDialog = Record> extends ConfirmationDialog { constructor(identifier?: any) readonly connected: Signal0 } class ConnectDialogBinds extends Object { constructor(identifier?: any) } - class ConnectionInfoDialog extends AcceptDialog { - constructor(identifier?: any) - } - class ConnectionsDock extends VBoxContainer { + class ConnectionsDock = Record> extends VBoxContainer { constructor(identifier?: any) update_tree(): void } /** Base class for all GUI containers. * - * @link https://docs.godotengine.org/en/4.3/classes/class_container.html + * @link https://docs.godotengine.org/en/4.4/classes/class_container.html */ - class Container extends Control { + class Container = Record> extends Control { /** Notification just before children are going to be sorted, in case there's something to process beforehand. */ static readonly NOTIFICATION_PRE_SORT_CHILDREN = 50 @@ -1200,13 +5881,15 @@ declare module "godot" { SIZE_SHRINK_END = 8, } enum MouseFilter { - /** The control will receive mouse movement input events and mouse button input events if clicked on through [method _gui_input]. And the control will receive the [signal mouse_entered] and [signal mouse_exited] signals. These events are automatically marked as handled, and they will not propagate further to other controls. This also results in blocking signals in other controls. */ + /** The control will receive mouse movement input events and mouse button input events if clicked on through [method _gui_input]. The control will also receive the [signal mouse_entered] and [signal mouse_exited] signals. These events are automatically marked as handled, and they will not propagate further to other controls. This also results in blocking signals in other controls. */ MOUSE_FILTER_STOP = 0, - /** The control will receive mouse movement input events and mouse button input events if clicked on through [method _gui_input]. And the control will receive the [signal mouse_entered] and [signal mouse_exited] signals. If this control does not handle the event, the parent control (if any) will be considered, and so on until there is no more parent control to potentially handle it. This also allows signals to fire in other controls. If no control handled it, the event will be passed to [method Node._shortcut_input] for further processing. */ + /** The control will receive mouse movement input events and mouse button input events if clicked on through [method _gui_input]. The control will also receive the [signal mouse_entered] and [signal mouse_exited] signals. + * If this control does not handle the event, the event will propagate up to its parent control if it has one. The event is bubbled up the node hierarchy until it reaches a non-[CanvasItem], a control with [constant MOUSE_FILTER_STOP], or a [CanvasItem] with [member CanvasItem.top_level] enabled. This will allow signals to fire in all controls it reaches. If no control handled it, the event will be passed to [method Node._shortcut_input] for further processing. + */ MOUSE_FILTER_PASS = 1, - /** The control will not receive mouse movement input events and mouse button input events if clicked on through [method _gui_input]. The control will also not receive the [signal mouse_entered] nor [signal mouse_exited] signals. This will not block other controls from receiving these events or firing the signals. Ignored events will not be handled automatically. + /** The control will not receive any mouse movement input events nor mouse button input events through [method _gui_input]. The control will also not receive the [signal mouse_entered] nor [signal mouse_exited] signals. This will not block other controls from receiving these events or firing the signals. Ignored events will not be handled automatically. If a child has [constant MOUSE_FILTER_PASS] and an event was passed to this control, the event will further propagate up to the control's parent. * * **Note:** If the control has received [signal mouse_entered] but not [signal mouse_exited], changing the [member mouse_filter] to [constant MOUSE_FILTER_IGNORE] will cause [signal mouse_exited] to be emitted. */ @@ -1233,14 +5916,21 @@ declare module "godot" { /** Automatic layout direction, determined from the parent control layout direction. */ LAYOUT_DIRECTION_INHERITED = 0, - /** Automatic layout direction, determined from the current locale. */ - LAYOUT_DIRECTION_LOCALE = 1, + /** Automatic layout direction, determined from the current locale. Right-to-left layout direction is automatically used for languages that require it such as Arabic and Hebrew, but only if a valid translation file is loaded for the given language (unless said language is configured as a fallback in [member ProjectSettings.internationalization/locale/fallback]). For all other languages (or if no valid translation file is found by Godot), left-to-right layout direction is used. If using [TextServerFallback] ([member ProjectSettings.internationalization/rendering/text_driver]), left-to-right layout direction is always used regardless of the language. Right-to-left layout direction can also be forced using [member ProjectSettings.internationalization/rendering/force_right_to_left_layout_direction]. */ + LAYOUT_DIRECTION_APPLICATION_LOCALE = 1, /** Left-to-right layout direction. */ LAYOUT_DIRECTION_LTR = 2, /** Right-to-left layout direction. */ LAYOUT_DIRECTION_RTL = 3, + + /** Automatic layout direction, determined from the system locale. Right-to-left layout direction is automatically used for languages that require it such as Arabic and Hebrew, but only if a valid translation file is loaded for the given language.. For all other languages (or if no valid translation file is found by Godot), left-to-right layout direction is used. If using [TextServerFallback] ([member ProjectSettings.internationalization/rendering/text_driver]), left-to-right layout direction is always used regardless of the language. */ + LAYOUT_DIRECTION_SYSTEM_LOCALE = 4, + + /** Represents the size of the [enum LayoutDirection] enum. */ + LAYOUT_DIRECTION_MAX = 5, + LAYOUT_DIRECTION_LOCALE = 1, } enum TextDirection { /** Text writing direction is the same as layout direction. */ @@ -1258,9 +5948,9 @@ declare module "godot" { } /** Base class for all GUI controls. Adapts its position and size based on its parent control. * - * @link https://docs.godotengine.org/en/4.3/classes/class_control.html + * @link https://docs.godotengine.org/en/4.4/classes/class_control.html */ - class Control extends CanvasItem { + class Control = Record> extends CanvasItem { /** Sent when the node changes size. Use [member size] to get the new size. */ static readonly NOTIFICATION_RESIZED = 40 @@ -1323,7 +6013,7 @@ declare module "godot" { */ static readonly NOTIFICATION_SCROLL_END = 48 - /** Sent when control layout direction is changed. */ + /** Sent when the control layout direction is changed from LTR or RTL or vice versa. This notification is propagated to child Control nodes as result of a change to [member layout_direction]. */ static readonly NOTIFICATION_LAYOUT_DIRECTION_CHANGED = 49 constructor(identifier?: any) @@ -1348,7 +6038,7 @@ declare module "godot" { /** Virtual method to be implemented by the user. Returns the tooltip text for the position [param at_position] in control's local coordinates, which will typically appear when the cursor is resting over this control. See [method get_tooltip]. * - * **Note:** If this method returns an empty [String], no tooltip is displayed. + * **Note:** If this method returns an empty [String] and [method _make_custom_tooltip] is not overridden, no tooltip is displayed. */ /* gdvirtual */ _get_tooltip(at_position: Vector2): string @@ -1369,31 +6059,33 @@ declare module "godot" { */ /* gdvirtual */ _drop_data(at_position: Vector2, data: any): void - /** Virtual method to be implemented by the user. Returns a [Control] node that should be used as a tooltip instead of the default one. The [param for_text] includes the contents of the [member tooltip_text] property. + /** Virtual method to be implemented by the user. Returns a [Control] node that should be used as a tooltip instead of the default one. [param for_text] is the return value of [method get_tooltip]. * The returned node must be of type [Control] or Control-derived. It can have child nodes of any type. It is freed when the tooltip disappears, so make sure you always provide a new instance (if you want to use a pre-existing node from your scene tree, you can duplicate it and pass the duplicated instance). When `null` or a non-Control node is returned, the default tooltip will be used instead. * The returned node will be added as child to a [PopupPanel], so you should only provide the contents of that panel. That [PopupPanel] can be themed using [method Theme.set_stylebox] for the type `"TooltipPanel"` (see [member tooltip_text] for an example). * * **Note:** The tooltip is shrunk to minimal size. If you want to ensure it's fully visible, you might want to set its [member custom_minimum_size] to some non-zero value. * - * **Note:** The node (and any relevant children) should be [member CanvasItem.visible] when returned, otherwise, the viewport that instantiates it will not be able to calculate its minimum size reliably. - * **Example of usage with a custom-constructed node:** + * **Note:** The node (and any relevant children) should have their [member CanvasItem.visible] set to `true` when returned, otherwise, the viewport that instantiates it will not be able to calculate its minimum size reliably. + * + * **Note:** If overridden, this method is called even if [method get_tooltip] returns an empty string. When this happens with the default tooltip, it is not displayed. To copy this behavior, return `null` in this method when [param for_text] is empty. + * **Example:** Use a constructed node as a tooltip: * - * **Example of usage with a custom scene instance:** + * **Example:** Usa a scene instance as a tooltip: * */ /* gdvirtual */ _make_custom_tooltip(for_text: string): Object - /** Virtual method to be implemented by the user. Use this method to process and accept inputs on UI elements. See [method accept_event]. - * **Example usage for clicking a control:** + /** Virtual method to be implemented by the user. Override this method to handle and accept inputs on UI elements. See also [method accept_event]. + * **Example:** Click on the control to print a message: * - * The event won't trigger if: - * * clicking outside the control (see [method _has_point]); - * * control has [member mouse_filter] set to [constant MOUSE_FILTER_IGNORE]; - * * control is obstructed by another [Control] on top of it, which doesn't have [member mouse_filter] set to [constant MOUSE_FILTER_IGNORE]; - * * control's parent has [member mouse_filter] set to [constant MOUSE_FILTER_STOP] or has accepted the event; - * * it happens outside the parent's rectangle and the parent has either [member clip_contents] enabled. + * If the [param event] inherits [InputEventMouse], this method will **not** be called when: + * - the control's [member mouse_filter] is set to [constant MOUSE_FILTER_IGNORE]; + * - the control is obstructed by another control on top, that doesn't have [member mouse_filter] set to [constant MOUSE_FILTER_IGNORE]; + * - the control's parent has [member mouse_filter] set to [constant MOUSE_FILTER_STOP] or has accepted the event; + * - the control's parent has [member clip_contents] enabled and the [param event]'s position is outside the parent's rectangle; + * - the [param event]'s position is outside the control (see [method _has_point]). * - * **Note:** Event position is relative to the control origin. + * **Note:** The [param event]'s position is relative to this control's origin. */ /* gdvirtual */ _gui_input(event: InputEvent): void @@ -1477,7 +6169,7 @@ declare module "godot" { /** Returns the position of this [Control] in global screen coordinates (i.e. taking window position into account). Mostly useful for editor plugins. * Equals to [member global_position] if the window is embedded (see [member Viewport.gui_embed_subwindows]). - * **Example usage for showing a popup:** + * **Example:** Show a popup at the mouse position: * */ get_screen_position(): Vector2 @@ -1535,7 +6227,7 @@ declare module "godot" { /** Creates a local override for a theme [StyleBox] with the specified [param name]. Local overrides always take precedence when fetching theme items for the control. An override can be removed with [method remove_theme_stylebox_override]. * See also [method get_theme_stylebox]. - * **Example of modifying a property in a StyleBox by duplicating it:** + * **Example:** Modify a property in a [StyleBox] by duplicating it: * */ add_theme_stylebox_override(name: StringName, stylebox: StyleBox): void @@ -1552,7 +6244,7 @@ declare module "godot" { /** Creates a local override for a theme [Color] with the specified [param name]. Local overrides always take precedence when fetching theme items for the control. An override can be removed with [method remove_theme_color_override]. * See also [method get_theme_color]. - * **Example of overriding a label's color and resetting it later:** + * **Example:** Override a [Label]'s color and reset it later: * */ add_theme_color_override(name: StringName, color: Color): void @@ -1692,7 +6384,7 @@ declare module "godot" { /** Returns the tooltip text for the position [param at_position] in control's local coordinates, which will typically appear when the cursor is resting over this control. By default, it returns [member tooltip_text]. * This method can be overridden to customize its behavior. See [method _get_tooltip]. * - * **Note:** If this method returns an empty [String], no tooltip is displayed. + * **Note:** If this method returns an empty [String] and [method _make_custom_tooltip] is not overridden, no tooltip is displayed. */ get_tooltip(at_position: Vector2 = Vector2.ZERO): string @@ -1713,14 +6405,16 @@ declare module "godot" { */ force_drag(data: any, preview: Control): void - /** Creates an [InputEventMouseButton] that attempts to click the control. If the event is received, the control acquires focus. + /** Creates an [InputEventMouseButton] that attempts to click the control. If the event is received, the control gains focus. * */ grab_click_focus(): void - /** Forwards the handling of this control's [method _get_drag_data], [method _can_drop_data] and [method _drop_data] virtual functions to delegate callables. - * For each argument, if not empty, the delegate callable is used, otherwise the local (virtual) function is used. - * The function format for each callable should be exactly the same as the virtual functions described above. + /** Sets the given callables to be used instead of the control's own drag-and-drop virtual methods. If a callable is empty, its respective virtual method is used as normal. + * The arguments for each callable should be exactly the same as their respective virtual methods, which would be: + * - [param drag_func] corresponds to [method _get_drag_data] and requires a [Vector2]; + * - [param can_drop_func] corresponds to [method _can_drop_data] and requires both a [Vector2] and a [Variant]; + * - [param drop_func] corresponds to [method _drop_data] and requires both a [Vector2] and a [Variant]. */ set_drag_forwarding(drag_func: Callable, can_drop_func: Callable, drop_func: Callable): void @@ -1743,7 +6437,7 @@ declare module "godot" { /** Invalidates the size cache in this node and in parent nodes up to top level. Intended to be used with [method get_minimum_size] when the return value is changed. Setting [member custom_minimum_size] directly calls this method automatically. */ update_minimum_size(): void - /** Returns `true` if layout is right-to-left. */ + /** Returns `true` if layout is right-to-left. See also [member layout_direction]. */ is_layout_rtl(): boolean /** Enables whether rendering of [CanvasItem] based children should be clipped to this control's rectangle. If `true`, parts of a child which would be visibly outside of this control's rectangle will not be rendered and won't receive input. */ @@ -1754,7 +6448,7 @@ declare module "godot" { get custom_minimum_size(): Vector2 set custom_minimum_size(value: Vector2) - /** Controls layout direction and text writing direction. Right-to-left layouts are necessary for certain languages (e.g. Arabic and Hebrew). */ + /** Controls layout direction and text writing direction. Right-to-left layouts are necessary for certain languages (e.g. Arabic and Hebrew). See also [method is_layout_rtl]. */ get layout_direction(): int64 set layout_direction(value: int64) get layout_mode(): int64 @@ -1781,26 +6475,26 @@ declare module "godot" { /** Distance between the node's left edge and its parent control, based on [member anchor_left]. * Offsets are often controlled by one or multiple parent [Container] nodes, so you should not modify them manually if your node is a direct child of a [Container]. Offsets update automatically when you move or resize the node. */ - get offset_left(): int64 - set offset_left(value: int64) + get offset_left(): float64 + set offset_left(value: float64) /** Distance between the node's top edge and its parent control, based on [member anchor_top]. * Offsets are often controlled by one or multiple parent [Container] nodes, so you should not modify them manually if your node is a direct child of a [Container]. Offsets update automatically when you move or resize the node. */ - get offset_top(): int64 - set offset_top(value: int64) + get offset_top(): float64 + set offset_top(value: float64) /** Distance between the node's right edge and its parent control, based on [member anchor_right]. * Offsets are often controlled by one or multiple parent [Container] nodes, so you should not modify them manually if your node is a direct child of a [Container]. Offsets update automatically when you move or resize the node. */ - get offset_right(): int64 - set offset_right(value: int64) + get offset_right(): float64 + set offset_right(value: float64) /** Distance between the node's bottom edge and its parent control, based on [member anchor_bottom]. * Offsets are often controlled by one or multiple parent [Container] nodes, so you should not modify them manually if your node is a direct child of a [Container]. Offsets update automatically when you move or resize the node. */ - get offset_bottom(): int64 - set offset_bottom(value: int64) + get offset_bottom(): float64 + set offset_bottom(value: float64) /** Controls the direction on the horizontal axis in which the control should grow if its horizontal minimum size is changed to be greater than its current size, as the control always has to be at least the minimum size. */ get grow_horizontal(): int64 @@ -1835,7 +6529,7 @@ declare module "godot" { /** The node's scale, relative to its [member size]. Change this property to scale the node around its [member pivot_offset]. The Control's [member tooltip_text] will also scale according to this value. * - * **Note:** This property is mainly intended to be used for animation purposes. To support multiple resolutions in your project, use an appropriate viewport stretch mode as described in the [url=https://docs.godotengine.org/en/4.3/tutorials/rendering/multiple_resolutions.html]documentation[/url] instead of scaling Controls individually. + * **Note:** This property is mainly intended to be used for animation purposes. To support multiple resolutions in your project, use an appropriate viewport stretch mode as described in the [url=https://docs.godotengine.org/en/4.4/tutorials/rendering/multiple_resolutions.html]documentation[/url] instead of scaling Controls individually. * * **Note:** [member FontFile.oversampling] does *not* take [Control] [member scale] into account. This means that scaling up/down will cause bitmap fonts and rasterized (non-MSDF) dynamic fonts to appear blurry or pixelated. To ensure text remains crisp regardless of scale, you can enable MSDF font rendering by enabling [member ProjectSettings.gui/theme/default_font_multichannel_signed_distance_field] (applies to the default project font only), or enabling **Multichannel Signed Distance Field** in the import options of a DynamicFont for custom fonts. On system fonts, [member SystemFont.multichannel_signed_distance_field] can be enabled in the inspector. * @@ -1871,13 +6565,21 @@ declare module "godot" { get auto_translate(): boolean set auto_translate(value: boolean) - /** The default tooltip text. The tooltip appears when the user's mouse cursor stays idle over this control for a few moments, provided that the [member mouse_filter] property is not [constant MOUSE_FILTER_IGNORE]. The time required for the tooltip to appear can be changed with the [member ProjectSettings.gui/timers/tooltip_delay_sec] option. See also [method get_tooltip]. + /** The default tooltip text. The tooltip appears when the user's mouse cursor stays idle over this control for a few moments, provided that the [member mouse_filter] property is not [constant MOUSE_FILTER_IGNORE]. The time required for the tooltip to appear can be changed with the [member ProjectSettings.gui/timers/tooltip_delay_sec] setting. + * This string is the default return value of [method get_tooltip]. Override [method _get_tooltip] to generate tooltip text dynamically. Override [method _make_custom_tooltip] to customize the tooltip interface and behavior. * The tooltip popup will use either a default implementation, or a custom one that you can provide by overriding [method _make_custom_tooltip]. The default tooltip includes a [PopupPanel] and [Label] whose theme properties can be customized using [Theme] methods with the `"TooltipPanel"` and `"TooltipLabel"` respectively. For example: * */ get tooltip_text(): string set tooltip_text(value: string) + /** Defines if tooltip text should automatically change to its translated version depending on the current locale. Uses the same auto translate mode as this control when set to [constant Node.AUTO_TRANSLATE_MODE_INHERIT]. + * + * **Note:** Tooltips customized using [method _make_custom_tooltip] do not use this auto translate mode automatically. + */ + get tooltip_auto_translate_mode(): int64 + set tooltip_auto_translate_mode(value: int64) + /** Tells Godot which node it should give focus to if the user presses the left arrow on the keyboard or left on a gamepad by default. You can change the key by editing the [member ProjectSettings.input/ui_left] input action. The node must be a [Control]. If this property is not set, Godot will give focus to the closest [Control] to the left of this one. */ get focus_neighbor_left(): NodePath set focus_neighbor_left(value: NodePath | string) @@ -1914,8 +6616,10 @@ declare module "godot" { get mouse_filter(): int64 set mouse_filter(value: int64) - /** When enabled, scroll wheel events processed by [method _gui_input] will be passed to the parent control even if [member mouse_filter] is set to [constant MOUSE_FILTER_STOP]. As it defaults to true, this allows nested scrollable containers to work out of the box. + /** When enabled, scroll wheel events processed by [method _gui_input] will be passed to the parent control even if [member mouse_filter] is set to [constant MOUSE_FILTER_STOP]. * You should disable it on the root of your UI if you do not want scroll events to go to the [method Node._unhandled_input] processing. + * + * **Note:** Because this property defaults to `true`, this allows nested scrollable containers to work out of the box. */ get mouse_force_pass_scroll_events(): boolean set mouse_force_pass_scroll_events(value: boolean) @@ -1984,24 +6688,21 @@ declare module "godot" { /** Emitted when the [constant NOTIFICATION_THEME_CHANGED] notification is sent. */ readonly theme_changed: Signal0 } - class ControlEditorPlugin extends EditorPlugin { + class ControlEditorPlugin = Record> extends EditorPlugin { constructor(identifier?: any) } - class ControlEditorPopupButton extends Button { + class ControlEditorPopupButton = Record> extends Button { constructor(identifier?: any) } - class ControlEditorPresetPicker extends MarginContainer { + class ControlEditorPresetPicker = Record> extends MarginContainer { constructor(identifier?: any) } - class ControlEditorToolbar extends HBoxContainer { - constructor(identifier?: any) - } - class ControlPositioningWarning extends MarginContainer { + class ControlEditorToolbar = Record> extends HBoxContainer { constructor(identifier?: any) } /** A 2D convex polygon shape used for physics collision. * - * @link https://docs.godotengine.org/en/4.3/classes/class_convexpolygonshape2d.html + * @link https://docs.godotengine.org/en/4.4/classes/class_convexpolygonshape2d.html */ class ConvexPolygonShape2D extends Shape2D { constructor(identifier?: any) @@ -2016,7 +6717,7 @@ declare module "godot" { } /** A 3D convex polyhedron shape used for physics collision. * - * @link https://docs.godotengine.org/en/4.3/classes/class_convexpolygonshape3d.html + * @link https://docs.godotengine.org/en/4.4/classes/class_convexpolygonshape3d.html */ class ConvexPolygonShape3D extends Shape3D { constructor(identifier?: any) @@ -2024,14 +6725,14 @@ declare module "godot" { get points(): GArray set points(value: GArray) } - class CreateDialog extends ConfirmationDialog { + class CreateDialog = Record> extends ConfirmationDialog { constructor(identifier?: any) readonly create: Signal0 readonly favorites_updated: Signal0 } /** Provides access to advanced cryptographic functionalities. * - * @link https://docs.godotengine.org/en/4.3/classes/class_crypto.html + * @link https://docs.godotengine.org/en/4.4/classes/class_crypto.html */ class Crypto extends RefCounted { constructor(identifier?: any) @@ -2077,7 +6778,7 @@ declare module "godot" { } /** A cryptographic key (RSA or elliptic-curve). * - * @link https://docs.godotengine.org/en/4.3/classes/class_cryptokey.html + * @link https://docs.godotengine.org/en/4.4/classes/class_cryptokey.html */ class CryptoKey extends Resource { constructor(identifier?: any) @@ -2104,7 +6805,7 @@ declare module "godot" { } /** Six square textures representing the faces of a cube. Commonly used as a skybox. * - * @link https://docs.godotengine.org/en/4.3/classes/class_cubemap.html + * @link https://docs.godotengine.org/en/4.4/classes/class_cubemap.html */ class Cubemap extends ImageTextureLayered { constructor(identifier?: any) @@ -2113,7 +6814,7 @@ declare module "godot" { } /** An array of [Cubemap]s, stored together and with a single reference. * - * @link https://docs.godotengine.org/en/4.3/classes/class_cubemaparray.html + * @link https://docs.godotengine.org/en/4.4/classes/class_cubemaparray.html */ class CubemapArray extends ImageTextureLayered { constructor(identifier?: any) @@ -2134,7 +6835,7 @@ declare module "godot" { } /** A mathematical curve. * - * @link https://docs.godotengine.org/en/4.3/classes/class_curve.html + * @link https://docs.godotengine.org/en/4.4/classes/class_curve.html */ class Curve extends Resource { constructor(identifier?: any) @@ -2186,19 +6887,35 @@ declare module "godot" { /** Sets the right [enum TangentMode] for the point at [param index] to [param mode]. */ set_point_right_mode(index: int64, mode: Curve.TangentMode): void + /** Returns the difference between [member min_value] and [member max_value]. */ + get_value_range(): float64 + + /** Returns the difference between [member min_domain] and [member max_domain]. */ + get_domain_range(): float64 + /** Removes duplicate points, i.e. points that are less than 0.00001 units (engine epsilon value) away from their neighbor on the curve. */ clean_dupes(): void /** Recomputes the baked cache of points for the curve. */ bake(): void - /** The minimum value the curve can reach. */ + /** The minimum domain (x-coordinate) that points can have. */ + get min_domain(): float64 + set min_domain(value: float64) + + /** The maximum domain (x-coordinate) that points can have. */ + get max_domain(): float64 + set max_domain(value: float64) + + /** The minimum value (y-coordinate) that points can have. Tangents can cause lower values between points. */ get min_value(): float64 set min_value(value: float64) - /** The maximum value the curve can reach. */ + /** The maximum value (y-coordinate) that points can have. Tangents can cause higher values between points. */ get max_value(): float64 set max_value(value: float64) + get _limits(): any + set _limits(value: any) /** The number of points to include in the baked (i.e. cached) curve data. */ get bake_resolution(): int64 @@ -2212,10 +6929,13 @@ declare module "godot" { /** Emitted when [member max_value] or [member min_value] is changed. */ readonly range_changed: Signal0 + + /** Emitted when [member max_domain] or [member min_domain] is changed. */ + readonly domain_changed: Signal0 } /** Describes a Bézier curve in 2D space. * - * @link https://docs.godotengine.org/en/4.3/classes/class_curve2d.html + * @link https://docs.godotengine.org/en/4.4/classes/class_curve2d.html */ class Curve2D extends Resource { constructor(identifier?: any) @@ -2307,7 +7027,7 @@ declare module "godot" { } /** Describes a Bézier curve in 3D space. * - * @link https://docs.godotengine.org/en/4.3/classes/class_curve3d.html + * @link https://docs.godotengine.org/en/4.4/classes/class_curve3d.html */ class Curve3D extends Resource { constructor(identifier?: any) @@ -2405,6 +7125,10 @@ declare module "godot" { */ tessellate_even_length(max_stages: int64 = 5, tolerance_length: float64 = 0.2): PackedVector3Array + /** If `true`, and the curve has more than 2 control points, the last point and the first one will be connected in a loop. */ + get closed(): boolean + set closed(value: boolean) + /** The distance in meters between two adjacent cached points. Changing it forces the cache to be recomputed the next time the [method get_baked_points] or [method get_baked_length] function is called. The smaller the distance, the more points in the cache and the more memory it will consume, so use with care. */ get bake_interval(): float64 set bake_interval(value: float64) @@ -2419,7 +7143,7 @@ declare module "godot" { get up_vector_enabled(): boolean set up_vector_enabled(value: boolean) } - class CurveEditorPlugin extends EditorPlugin { + class CurveEditorPlugin = Record> extends EditorPlugin { constructor(identifier?: any) } class CurvePreviewGenerator extends EditorResourcePreviewGenerator { @@ -2436,7 +7160,7 @@ declare module "godot" { } /** A 1D texture where pixel brightness corresponds to points on a curve. * - * @link https://docs.godotengine.org/en/4.3/classes/class_curvetexture.html + * @link https://docs.godotengine.org/en/4.4/classes/class_curvetexture.html */ class CurveTexture extends Texture2D { constructor(identifier?: any) @@ -2448,13 +7172,13 @@ declare module "godot" { get texture_mode(): int64 set texture_mode(value: int64) - /** The [Curve] that is rendered onto the texture. */ + /** The [Curve] that is rendered onto the texture. Should be a unit [Curve]. */ get curve(): Curve set curve(value: Curve) } /** A 1D texture where the red, green, and blue color channels correspond to points on 3 curves. * - * @link https://docs.godotengine.org/en/4.3/classes/class_curvexyztexture.html + * @link https://docs.godotengine.org/en/4.4/classes/class_curvexyztexture.html */ class CurveXYZTexture extends Texture2D { constructor(identifier?: any) @@ -2462,21 +7186,21 @@ declare module "godot" { get width(): int64 set width(value: int64) - /** The [Curve] that is rendered onto the texture's red channel. */ + /** The [Curve] that is rendered onto the texture's red channel. Should be a unit [Curve]. */ get curve_x(): Curve set curve_x(value: Curve) - /** The [Curve] that is rendered onto the texture's green channel. */ + /** The [Curve] that is rendered onto the texture's green channel. Should be a unit [Curve]. */ get curve_y(): Curve set curve_y(value: Curve) - /** The [Curve] that is rendered onto the texture's blue channel. */ + /** The [Curve] that is rendered onto the texture's blue channel. Should be a unit [Curve]. */ get curve_z(): Curve set curve_z(value: Curve) } /** Class representing a cylindrical [PrimitiveMesh]. * - * @link https://docs.godotengine.org/en/4.3/classes/class_cylindermesh.html + * @link https://docs.godotengine.org/en/4.4/classes/class_cylindermesh.html */ class CylinderMesh extends PrimitiveMesh { constructor(identifier?: any) @@ -2516,7 +7240,7 @@ declare module "godot" { } /** A 3D cylinder shape used for physics collision. * - * @link https://docs.godotengine.org/en/4.3/classes/class_cylindershape3d.html + * @link https://docs.godotengine.org/en/4.4/classes/class_cylindershape3d.html */ class CylinderShape3D extends Shape3D { constructor(identifier?: any) @@ -2530,7 +7254,7 @@ declare module "godot" { } /** Helper class to implement a DTLS server. * - * @link https://docs.godotengine.org/en/4.3/classes/class_dtlsserver.html + * @link https://docs.godotengine.org/en/4.4/classes/class_dtlsserver.html */ class DTLSServer extends RefCounted { constructor(identifier?: any) @@ -2545,9 +7269,9 @@ declare module "godot" { } /** A physics joint that connects two 2D physics bodies with a spring-like force. * - * @link https://docs.godotengine.org/en/4.3/classes/class_dampedspringjoint2d.html + * @link https://docs.godotengine.org/en/4.4/classes/class_dampedspringjoint2d.html */ - class DampedSpringJoint2D extends Joint2D { + class DampedSpringJoint2D = Record> extends Joint2D { constructor(identifier?: any) /** The spring joint's maximum length. The two attached bodies cannot stretch it past this value. */ get length(): float64 @@ -2587,10 +7311,10 @@ declare module "godot" { req_evaluate(params: GDictionary): GDictionary ["req_godot/put_msg"]: (params: GDictionary) => GDictionary } - class DebugAdapterServer extends EditorPlugin { + class DebugAdapterServer = Record> extends EditorPlugin { constructor(identifier?: any) } - class DebuggerEditorPlugin extends EditorPlugin { + class DebuggerEditorPlugin = Record> extends EditorPlugin { constructor(identifier?: any) } namespace Decal { @@ -2613,9 +7337,9 @@ declare module "godot" { } /** Node that projects a texture onto a [MeshInstance3D]. * - * @link https://docs.godotengine.org/en/4.3/classes/class_decal.html + * @link https://docs.godotengine.org/en/4.4/classes/class_decal.html */ - class Decal extends VisualInstance3D { + class Decal = Record> extends VisualInstance3D { constructor(identifier?: any) /** Sets the [Texture2D] associated with the specified [enum DecalTexture]. This is a convenience method, in most cases you should access the texture directly. * For example, instead of `$Decal.set_texture(Decal.TEXTURE_ALBEDO, albedo_tex)`, use `$Decal.texture_albedo = albedo_tex`. @@ -2642,8 +7366,8 @@ declare module "godot" { * * **Note:** Unlike [BaseMaterial3D] whose filter mode can be adjusted on a per-material basis, the filter mode for [Decal] textures is set globally with [member ProjectSettings.rendering/textures/decals/filter]. */ - get texture_albedo(): Texture2D - set texture_albedo(value: Texture2D) + get texture_albedo(): Texture2D | any /*-AnimatedTexture*/ | any /*-AtlasTexture*/ | any /*-CameraTexture*/ | any /*-CanvasTexture*/ | any /*-MeshTexture*/ | any /*-Texture2DRD*/ | any /*-ViewportTexture*/ + set texture_albedo(value: Texture2D | any /*-AnimatedTexture*/ | any /*-AtlasTexture*/ | any /*-CameraTexture*/ | any /*-CanvasTexture*/ | any /*-MeshTexture*/ | any /*-Texture2DRD*/ | any /*-ViewportTexture*/) /** [Texture2D] with the per-pixel normal map for the decal. Use this to add extra detail to decals. * @@ -2651,8 +7375,8 @@ declare module "godot" { * * **Note:** Setting this texture alone will not result in a visible decal, as [member texture_albedo] must also be set. To create a normal-only decal, load an albedo texture into [member texture_albedo] and set [member albedo_mix] to `0.0`. The albedo texture's alpha channel will be used to determine where the underlying surface's normal map should be overridden (and its intensity). */ - get texture_normal(): Texture2D - set texture_normal(value: Texture2D) + get texture_normal(): Texture2D | any /*-AnimatedTexture*/ | any /*-AtlasTexture*/ | any /*-CameraTexture*/ | any /*-CanvasTexture*/ | any /*-MeshTexture*/ | any /*-Texture2DRD*/ | any /*-ViewportTexture*/ + set texture_normal(value: Texture2D | any /*-AnimatedTexture*/ | any /*-AtlasTexture*/ | any /*-CameraTexture*/ | any /*-CanvasTexture*/ | any /*-MeshTexture*/ | any /*-Texture2DRD*/ | any /*-ViewportTexture*/) /** [Texture2D] storing ambient occlusion, roughness, and metallic for the decal. Use this to add extra detail to decals. * @@ -2660,15 +7384,15 @@ declare module "godot" { * * **Note:** Setting this texture alone will not result in a visible decal, as [member texture_albedo] must also be set. To create an ORM-only decal, load an albedo texture into [member texture_albedo] and set [member albedo_mix] to `0.0`. The albedo texture's alpha channel will be used to determine where the underlying surface's ORM map should be overridden (and its intensity). */ - get texture_orm(): Texture2D - set texture_orm(value: Texture2D) + get texture_orm(): Texture2D | any /*-AnimatedTexture*/ | any /*-AtlasTexture*/ | any /*-CameraTexture*/ | any /*-CanvasTexture*/ | any /*-MeshTexture*/ | any /*-Texture2DRD*/ | any /*-ViewportTexture*/ + set texture_orm(value: Texture2D | any /*-AnimatedTexture*/ | any /*-AtlasTexture*/ | any /*-CameraTexture*/ | any /*-CanvasTexture*/ | any /*-MeshTexture*/ | any /*-Texture2DRD*/ | any /*-ViewportTexture*/) /** [Texture2D] with the emission [Color] of the Decal. Either this or the [member texture_albedo] must be set for the Decal to be visible. Use the alpha channel like a mask to smoothly blend the edges of the decal with the underlying object. * * **Note:** Unlike [BaseMaterial3D] whose filter mode can be adjusted on a per-material basis, the filter mode for [Decal] textures is set globally with [member ProjectSettings.rendering/textures/decals/filter]. */ - get texture_emission(): Texture2D - set texture_emission(value: Texture2D) + get texture_emission(): Texture2D | any /*-AnimatedTexture*/ | any /*-AtlasTexture*/ | any /*-CameraTexture*/ | any /*-CanvasTexture*/ | any /*-MeshTexture*/ | any /*-Texture2DRD*/ | any /*-ViewportTexture*/ + set texture_emission(value: Texture2D | any /*-AnimatedTexture*/ | any /*-AtlasTexture*/ | any /*-CameraTexture*/ | any /*-CanvasTexture*/ | any /*-MeshTexture*/ | any /*-Texture2DRD*/ | any /*-ViewportTexture*/) /** Energy multiplier for the emission texture. This will make the decal emit light at a higher or lower intensity, independently of the albedo color. See also [member modulate]. */ get emission_energy(): float64 @@ -2716,19 +7440,19 @@ declare module "godot" { class DecalGizmoPlugin extends EditorNode3DGizmoPlugin { constructor(identifier?: any) } - class DefaultThemeEditorPreview extends ThemeEditorPreview { + class DefaultThemeEditorPreview = Record> extends ThemeEditorPreview { constructor(identifier?: any) } - class DependencyEditor extends AcceptDialog { + class DependencyEditor = Record> extends AcceptDialog { constructor(identifier?: any) } - class DependencyEditorOwners extends AcceptDialog { + class DependencyEditorOwners = Record> extends AcceptDialog { constructor(identifier?: any) } - class DependencyErrorDialog extends ConfirmationDialog { + class DependencyErrorDialog = Record> extends ConfirmationDialog { constructor(identifier?: any) } - class DependencyRemoveDialog extends ConfirmationDialog { + class DependencyRemoveDialog = Record> extends ConfirmationDialog { constructor(identifier?: any) readonly resource_removed: Signal1 readonly file_removed: Signal1 @@ -2736,7 +7460,7 @@ declare module "godot" { } /** Provides methods for managing directories and their content. * - * @link https://docs.godotengine.org/en/4.3/classes/class_diraccess.html + * @link https://docs.godotengine.org/en/4.4/classes/class_diraccess.html */ class DirAccess extends RefCounted { constructor(identifier?: any) @@ -2748,6 +7472,13 @@ declare module "godot" { /** Returns the result of the last [method open] call in the current thread. */ static get_open_error(): GError + /** Creates a temporary directory. This directory will be freed when the returned [DirAccess] is freed. + * If [param prefix] is not empty, it will be prefixed to the directory name, separated by a `-`. + * If [param keep] is `true`, the directory is not deleted when the returned [DirAccess] is freed. + * Returns `null` if opening the directory failed. You can use [method get_open_error] to check the error that occurred. + */ + static create_temp(prefix: string = '', keep: boolean = false): DirAccess + /** Initializes the stream used to list all files and directories using the [method get_next] function, closing the currently opened stream if needed. Once the stream has been processed, it should typically be closed with [method list_dir_end]. * Affected by [member include_hidden] and [member include_navigational]. * @@ -2775,16 +7506,22 @@ declare module "godot" { /** Returns a [PackedStringArray] containing filenames of the directory contents, excluding directories, at the given [param path]. The array is sorted alphabetically. * Use [method get_files] if you want more control of what gets included. + * + * **Note:** When used on a `res://` path in an exported project, only the files included in the PCK at the given folder level are returned. In practice, this means that since imported resources are stored in a top-level `.godot/` folder, only paths to `.gd` and `.import` files are returned (plus a few other files, such as `project.godot` or `project.binary` and the project icon). In an exported project, the list of returned files will also vary depending on [member ProjectSettings.editor/export/convert_text_resources_to_binary]. */ static get_files_at(path: string): PackedStringArray /** Returns a [PackedStringArray] containing filenames of the directory contents, excluding files. The array is sorted alphabetically. * Affected by [member include_hidden] and [member include_navigational]. + * + * **Note:** The returned directories in the editor and after exporting in the `res://` directory may differ as some files are converted to engine-specific formats when exported. */ get_directories(): PackedStringArray /** Returns a [PackedStringArray] containing filenames of the directory contents, excluding files, at the given [param path]. The array is sorted alphabetically. * Use [method get_directories] if you want more control of what gets included. + * + * **Note:** The returned directories in the editor and after exporting in the `res://` directory may differ as some files are converted to engine-specific formats when exported. */ static get_directories_at(path: string): PackedStringArray @@ -2833,13 +7570,21 @@ declare module "godot" { /** Returns whether the target file exists. The argument can be relative to the current directory, or an absolute path. * For a static equivalent, use [method FileAccess.file_exists]. + * + * **Note:** Many resources types are imported (e.g. textures or sound files), and their source asset will not be included in the exported game, as only the imported version is used. See [method ResourceLoader.exists] for an alternative approach that takes resource remapping into account. */ file_exists(path: string): boolean - /** Returns whether the target directory exists. The argument can be relative to the current directory, or an absolute path. */ + /** Returns whether the target directory exists. The argument can be relative to the current directory, or an absolute path. + * + * **Note:** The returned [bool] in the editor and after exporting when used on a path in the `res://` directory may be different. Some files are converted to engine-specific formats when exported, potentially changing the directory structure. + */ dir_exists(path: string): boolean - /** Static version of [method dir_exists]. Supports only absolute paths. */ + /** Static version of [method dir_exists]. Supports only absolute paths. + * + * **Note:** The returned [bool] in the editor and after exporting when used on a path in the `res://` directory may be different. Some files are converted to engine-specific formats when exported, potentially changing the directory structure. + */ static dir_exists_absolute(path: string): boolean /** Returns the available space on the current directory's disk, in bytes. Returns `0` if the platform-specific method to query the available space fails. */ @@ -2891,6 +7636,12 @@ declare module "godot" { */ create_link(source: string, target: string): GError + /** Returns `true` if the directory is a macOS bundle. + * + * **Note:** This method is implemented on macOS. + */ + is_bundle(path: string): boolean + /** Returns `true` if the file system or directory use case sensitive file names. * * **Note:** This method is implemented on macOS, Linux (for EXT4 and F2FS filesystems only) and Windows. On other platforms, it always returns `true`. @@ -2911,9 +7662,9 @@ declare module "godot" { } /** Directional 2D light from a distance. * - * @link https://docs.godotengine.org/en/4.3/classes/class_directionallight2d.html + * @link https://docs.godotengine.org/en/4.4/classes/class_directionallight2d.html */ - class DirectionalLight2D extends Light2D { + class DirectionalLight2D = Record> extends Light2D { constructor(identifier?: any) /** The height of the light. Used with 2D normal mapping. Ranges from 0 (parallel to the plane) to 1 (perpendicular to the plane). */ get height(): float64 @@ -2947,9 +7698,9 @@ declare module "godot" { } /** Directional light from a distance, as from the Sun. * - * @link https://docs.godotengine.org/en/4.3/classes/class_directionallight3d.html + * @link https://docs.godotengine.org/en/4.4/classes/class_directionallight3d.html */ - class DirectionalLight3D extends Light3D { + class DirectionalLight3D = Record> extends Light3D { constructor(identifier?: any) /** The light's shadow rendering algorithm. See [enum ShadowMode]. */ get directional_shadow_mode(): int64 @@ -2987,20 +7738,19 @@ declare module "godot" { get sky_mode(): int64 set sky_mode(value: int64) } - class DirectoryCreateDialog extends ConfirmationDialog { - constructor(identifier?: any) - readonly dir_created: Signal1 - } - class DockContextPopup extends PopupPanel { + class DirectoryCreateDialog = Record> extends ConfirmationDialog { constructor(identifier?: any) } - class DockSplitContainer extends SplitContainer { + class DockContextPopup = Record> extends PopupPanel { + constructor(identifier?: any) + } + class DockSplitContainer = Record> extends SplitContainer { constructor(identifier?: any) } class DynamicFontImportSettingsData extends RefCounted { constructor(identifier?: any) } - class DynamicFontImportSettingsDialog extends ConfirmationDialog { + class DynamicFontImportSettingsDialog = Record> extends ConfirmationDialog { constructor(identifier?: any) } namespace ENetConnection { @@ -3052,7 +7802,7 @@ declare module "godot" { } /** A wrapper class for an [url=http://enet.bespin.org/group__host.html]ENetHost[/url]. * - * @link https://docs.godotengine.org/en/4.3/classes/class_enetconnection.html + * @link https://docs.godotengine.org/en/4.4/classes/class_enetconnection.html */ class ENetConnection extends RefCounted { constructor(identifier?: any) @@ -3140,7 +7890,7 @@ declare module "godot" { } /** A MultiplayerPeer implementation using the [url=http://enet.bespin.org/index.html]ENet[/url] library. * - * @link https://docs.godotengine.org/en/4.3/classes/class_enetmultiplayerpeer.html + * @link https://docs.godotengine.org/en/4.4/classes/class_enetmultiplayerpeer.html */ class ENetMultiplayerPeer extends MultiplayerPeer { constructor(identifier?: any) @@ -3246,7 +7996,7 @@ declare module "godot" { } /** A wrapper class for an [url=http://enet.bespin.org/group__peer.html]ENetPeer[/url]. * - * @link https://docs.godotengine.org/en/4.3/classes/class_enetpacketpeer.html + * @link https://docs.godotengine.org/en/4.4/classes/class_enetpacketpeer.html */ class ENetPacketPeer extends PacketPeer { /** The reference scale for packet loss. See [method get_statistic] and [constant PEER_PACKET_LOSS]. */ @@ -3299,6 +8049,9 @@ declare module "godot" { */ set_timeout(timeout: int64, timeout_min: int64, timeout_max: int64): void + /** Returns the ENet flags of the next packet in the received queue. See `FLAG_*` constants for available packet flags. Note that not all flags are replicated from the sending peer to the receiving peer. */ + get_packet_flags(): int64 + /** Returns the IP address of this peer. */ get_remote_address(): string @@ -3317,14 +8070,14 @@ declare module "godot" { /** Returns `true` if the peer is currently active (i.e. the associated [ENetConnection] is still valid). */ is_active(): boolean } - class EditorAbout extends AcceptDialog { + class EditorAbout = Record> extends AcceptDialog { constructor(identifier?: any) } - class EditorAssetLibrary extends PanelContainer { + class EditorAssetLibrary = Record> extends PanelContainer { constructor(identifier?: any) readonly install_asset: Signal2 } - class EditorAudioBus extends PanelContainer { + class EditorAudioBus = Record> extends PanelContainer { constructor(identifier?: any) update_bus(): void update_send(): void @@ -3334,12 +8087,12 @@ declare module "godot" { readonly drop_end_request: Signal0 readonly dropped: Signal0 } - class EditorAudioBuses extends VBoxContainer { + class EditorAudioBuses = Record> extends VBoxContainer { constructor(identifier?: any) _update_bus(_unnamed_arg0: int64): void _update_sends(): void } - class EditorAudioMeterNotches extends Control { + class EditorAudioMeterNotches = Record> extends Control { constructor(identifier?: any) add_notch(_unnamed_arg0: float64, _unnamed_arg1: float64, _unnamed_arg2: boolean): void _draw_audio_notches(): void @@ -3350,7 +8103,7 @@ declare module "godot" { class EditorAudioStreamTooltipPlugin extends EditorResourceTooltipPlugin { constructor(identifier?: any) } - class EditorAutoloadSettings extends VBoxContainer { + class EditorAutoloadSettings = Record> extends VBoxContainer { constructor(identifier?: any) update_autoload(): void autoload_add(_unnamed_arg0: string, _unnamed_arg1: string): boolean @@ -3360,7 +8113,7 @@ declare module "godot" { class EditorBitmapPreviewPlugin extends EditorResourcePreviewGenerator { constructor(identifier?: any) } - class EditorBottomPanel extends PanelContainer { + class EditorBottomPanel = Record> extends PanelContainer { constructor(identifier?: any) } namespace EditorBuildProfile { @@ -3377,7 +8130,7 @@ declare module "godot" { BUILD_OPTION_TEXT_SERVER_ADVANCED = 9, BUILD_OPTION_DYNAMIC_FONTS = 10, BUILD_OPTION_WOFF2_FONTS = 11, - BUILD_OPTION_GRPAHITE_FONTS = 12, + BUILD_OPTION_GRAPHITE_FONTS = 12, BUILD_OPTION_MSDFGEN = 13, BUILD_OPTION_MAX = 14, } @@ -3397,15 +8150,15 @@ declare module "godot" { save_to_file(path: string): GError load_from_file(path: string): GError } - class EditorBuildProfileManager extends AcceptDialog { + class EditorBuildProfileManager = Record> extends AcceptDialog { constructor(identifier?: any) _update_selected_profile(): void } /** Godot editor's command palette. * - * @link https://docs.godotengine.org/en/4.3/classes/class_editorcommandpalette.html + * @link https://docs.godotengine.org/en/4.4/classes/class_editorcommandpalette.html */ - class EditorCommandPalette extends ConfirmationDialog { + class EditorCommandPalette = Record> extends ConfirmationDialog { constructor(identifier?: any) /** Adds a custom command to EditorCommandPalette. * - [param command_name]: [String] (Name of the **Command**. This is displayed to the user.) @@ -3420,13 +8173,76 @@ declare module "godot" { */ remove_command(key_name: string): void } - class EditorDebuggerInspector extends EditorInspector { + namespace EditorContextMenuPlugin { + enum ContextMenuSlot { + /** Context menu of Scene dock. [method _popup_menu] will be called with a list of paths to currently selected nodes, while option callback will receive the list of currently selected nodes. */ + CONTEXT_SLOT_SCENE_TREE = 0, + + /** Context menu of FileSystem dock. [method _popup_menu] and option callback will be called with list of paths of the currently selected files. */ + CONTEXT_SLOT_FILESYSTEM = 1, + + /** Context menu of Script editor's script tabs. [method _popup_menu] will be called with the path to the currently edited script, while option callback will receive reference to that script. */ + CONTEXT_SLOT_SCRIPT_EDITOR = 2, + + /** The "Create..." submenu of FileSystem dock's context menu. [method _popup_menu] and option callback will be called with list of paths of the currently selected files. */ + CONTEXT_SLOT_FILESYSTEM_CREATE = 3, + + /** Context menu of Script editor's code editor. [method _popup_menu] will be called with the path to the [CodeEdit] node. You can fetch it using this code: + * + * The option callback will receive reference to that node. You can use [CodeEdit] methods to perform symbol lookups etc. + */ + CONTEXT_SLOT_SCRIPT_EDITOR_CODE = 4, + + /** Context menu of scene tabs. [method _popup_menu] will be called with the path of the clicked scene, or empty [PackedStringArray] if the menu was opened on empty space. The option callback will receive the path of the clicked scene, or empty [String] if none was clicked. */ + CONTEXT_SLOT_SCENE_TABS = 5, + + /** Context menu of 2D editor's basic right-click menu. [method _popup_menu] will be called with paths to all [CanvasItem] nodes under the cursor. You can fetch them using this code: + * + * The paths array is empty if there weren't any nodes under cursor. The option callback will receive a typed array of [CanvasItem] nodes. + */ + CONTEXT_SLOT_2D_EDITOR = 6, + } + } + /** Plugin for adding custom context menus in the editor. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_editorcontextmenuplugin.html + */ + class EditorContextMenuPlugin extends RefCounted { + constructor(identifier?: any) + /** Called when creating a context menu, custom options can be added by using the [method add_context_menu_item] or [method add_context_menu_item_from_shortcut] functions. [param paths] contains currently selected paths (depending on menu), which can be used to conditionally add options. */ + /* gdvirtual */ _popup_menu(paths: PackedStringArray | string[]): void + + /** Registers a shortcut associated with the plugin's context menu. This method should be called once (e.g. in plugin's [method Object._init]). [param callback] will be called when user presses the specified [param shortcut] while the menu's context is in effect (e.g. FileSystem dock is focused). Callback should take single [Array] argument; array contents depend on context menu slot. + * + */ + add_menu_shortcut(shortcut: Shortcut, callback: Callable): void + + /** Add custom option to the context menu of the plugin's specified slot. When the option is activated, [param callback] will be called. Callback should take single [Array] argument; array contents depend on context menu slot. + * + * If you want to assign shortcut to the menu item, use [method add_context_menu_item_from_shortcut] instead. + */ + add_context_menu_item(name: string, callback: Callable, icon: Texture2D = undefined): void + + /** Add custom option to the context menu of the plugin's specified slot. The option will have the [param shortcut] assigned and reuse its callback. The shortcut has to be registered beforehand with [method add_menu_shortcut]. + * + */ + add_context_menu_item_from_shortcut(name: string, shortcut: Shortcut, icon: Texture2D = undefined): void + + /** Add a submenu to the context menu of the plugin's specified slot. The submenu is not automatically handled, you need to connect to its signals yourself. Also the submenu is freed on every popup, so provide a new [PopupMenu] every time. + * + */ + add_context_submenu_item(name: string, menu: PopupMenu, icon: Texture2D = undefined): void + } + class EditorContextMenuPluginManager extends Object { + constructor(identifier?: any) + } + class EditorDebuggerInspector = Record> extends EditorInspector { constructor(identifier?: any) readonly object_selected: Signal1 readonly object_edited: Signal3 readonly object_property_updated: Signal2 } - class EditorDebuggerNode extends MarginContainer { + class EditorDebuggerNode = Record> extends MarginContainer { constructor(identifier?: any) live_debug_create_node(_unnamed_arg0: NodePath | string, _unnamed_arg1: string, _unnamed_arg2: string): void live_debug_instantiate_node(_unnamed_arg0: NodePath | string, _unnamed_arg1: string, _unnamed_arg2: string): void @@ -3445,17 +8261,17 @@ declare module "godot" { } /** A base class to implement debugger plugins. * - * @link https://docs.godotengine.org/en/4.3/classes/class_editordebuggerplugin.html + * @link https://docs.godotengine.org/en/4.4/classes/class_editordebuggerplugin.html */ class EditorDebuggerPlugin extends RefCounted { constructor(identifier?: any) - /** Override this method to be notified whenever a new [EditorDebuggerSession] is created (the session may be inactive during this stage). */ + /** Override this method to be notified whenever a new [EditorDebuggerSession] is created. Note that the session may be inactive during this stage. */ /* gdvirtual */ _setup_session(session_id: int64): void - /** Override this method to enable receiving messages from the debugger. If [param capture] is "my_message" then messages starting with "my_message:" will be passes to the [method _capture] method. */ + /** Override this method to enable receiving messages from the debugger. If [param capture] is "my_message" then messages starting with "my_message:" will be passed to the [method _capture] method. */ /* gdvirtual */ _has_capture(capture: string): boolean - /** Override this method to process incoming messages. The [param session_id] is the ID of the [EditorDebuggerSession] that received the message (which you can retrieve via [method get_session]). */ + /** Override this method to process incoming messages. The [param session_id] is the ID of the [EditorDebuggerSession] that received the [param message]. Use [method get_session] to retrieve the session. This method should return `true` if the message is recognized. */ /* gdvirtual */ _capture(message: string, data: GArray, session_id: int64): boolean /** Override this method to be notified when a breakpoint line has been clicked in the debugger breakpoint panel. */ @@ -3486,7 +8302,7 @@ declare module "godot" { } /** A class to interact with the editor debugger. * - * @link https://docs.godotengine.org/en/4.3/classes/class_editordebuggersession.html + * @link https://docs.godotengine.org/en/4.4/classes/class_editordebuggersession.html */ class EditorDebuggerSession extends RefCounted { constructor(identifier?: any) @@ -3505,7 +8321,7 @@ declare module "godot" { /** Returns `true` if the debug session is currently attached to a remote instance. */ is_active(): boolean - /** Adds the given [param control] to the debug session UI in the debugger bottom panel. */ + /** Adds the given [param control] to the debug session UI in the debugger bottom panel. The [param control]'s node name will be used as the tab title. */ add_session_tab(control: Control): void /** Removes the given [param control] from the debug session UI in the debugger bottom panel. */ @@ -3526,13 +8342,13 @@ declare module "godot" { /** Emitted when the attached remote instance exits a break state. */ readonly continued: Signal0 } - class EditorDebuggerTree extends Tree { + class EditorDebuggerTree = Record> extends Tree { constructor(identifier?: any) readonly object_selected: Signal2 readonly save_node: Signal3 readonly open: Signal0 } - class EditorDirDialog extends ConfirmationDialog { + class EditorDirDialog = Record> extends ConfirmationDialog { constructor(identifier?: any) readonly copy_pressed: Signal1 readonly move_pressed: Signal1 @@ -3540,7 +8356,7 @@ declare module "godot" { class EditorDockManager extends Object { constructor(identifier?: any) } - class EditorExport extends Node { + class EditorExport = Record> extends Node { constructor(identifier?: any) readonly export_presets_updated: Signal0 readonly export_presets_runnable_updated: Signal0 @@ -3548,67 +8364,378 @@ declare module "godot" { class EditorExportGDScript extends EditorExportPlugin { constructor(identifier?: any) } + namespace EditorExportPlatform { + enum ExportMessageType { + /** Invalid message type used as the default value when no type is specified. */ + EXPORT_MESSAGE_NONE = 0, + + /** Message type for informational messages that have no effect on the export. */ + EXPORT_MESSAGE_INFO = 1, + + /** Message type for warning messages that should be addressed but still allow to complete the export. */ + EXPORT_MESSAGE_WARNING = 2, + + /** Message type for error messages that must be addressed and fail the export. */ + EXPORT_MESSAGE_ERROR = 3, + } + enum DebugFlags { + /** Flag is set if remotely debugged project is expected to use remote file system. If set, [method gen_export_flags] will add `--remote-fs` and `--remote-fs-password` (if password is set in the editor settings) command line arguments to the list. */ + DEBUG_FLAG_DUMB_CLIENT = 1, + + /** Flag is set if remote debug is enabled. If set, [method gen_export_flags] will add `--remote-debug` and `--breakpoints` (if breakpoints are selected in the script editor or added by the plugin) command line arguments to the list. */ + DEBUG_FLAG_REMOTE_DEBUG = 2, + + /** Flag is set if remotely debugged project is running on the localhost. If set, [method gen_export_flags] will use `localhost` instead of [member EditorSettings.network/debug/remote_host] as remote debugger host. */ + DEBUG_FLAG_REMOTE_DEBUG_LOCALHOST = 4, + + /** Flag is set if "Visible Collision Shapes" remote debug option is enabled. If set, [method gen_export_flags] will add `--debug-collisions` command line arguments to the list. */ + DEBUG_FLAG_VIEW_COLLISIONS = 8, + + /** Flag is set if Visible Navigation" remote debug option is enabled. If set, [method gen_export_flags] will add `--debug-navigation` command line arguments to the list. */ + DEBUG_FLAG_VIEW_NAVIGATION = 16, + } + } /** Identifies a supported export platform, and internally provides the functionality of exporting to that platform. * - * @link https://docs.godotengine.org/en/4.3/classes/class_editorexportplatform.html + * @link https://docs.godotengine.org/en/4.4/classes/class_editorexportplatform.html */ class EditorExportPlatform extends RefCounted { constructor(identifier?: any) /** Returns the name of the export operating system handled by this [EditorExportPlatform] class, as a friendly string. Possible return values are `Windows`, `Linux`, `macOS`, `Android`, `iOS`, and `Web`. */ get_os_name(): string + + /** Create a new preset for this platform. */ + create_preset(): EditorExportPreset + + /** Locates export template for the platform, and returns [Dictionary] with the following keys: `path: String` and `error: String`. This method is provided for convenience and custom export platforms aren't required to use it or keep export templates stored in the same way official templates are. */ + find_export_template(template_file_name: string): GDictionary + + /** Returns array of [EditorExportPreset]s for this platform. */ + get_current_presets(): GArray + + /** Saves PCK archive and returns [Dictionary] with the following keys: `result: Error`, `so_files: Array` (array of the shared/static objects which contains dictionaries with the following keys: `path: String`, `tags: PackedStringArray`, and `target_folder: String`). + * If [param embed] is `true`, PCK content is appended to the end of [param path] file and return [Dictionary] additionally include following keys: `embedded_start: int` (embedded PCK offset) and `embedded_size: int` (embedded PCK size). + */ + save_pack(preset: EditorExportPreset, debug: boolean, path: string, embed: boolean = false): GDictionary + + /** Saves ZIP archive and returns [Dictionary] with the following keys: `result: Error`, `so_files: Array` (array of the shared/static objects which contains dictionaries with the following keys: `path: String`, `tags: PackedStringArray`, and `target_folder: String`). */ + save_zip(preset: EditorExportPreset, debug: boolean, path: string): GDictionary + + /** Saves patch PCK archive and returns [Dictionary] with the following keys: `result: Error`, `so_files: Array` (array of the shared/static objects which contains dictionaries with the following keys: `path: String`, `tags: PackedStringArray`, and `target_folder: String`). */ + save_pack_patch(preset: EditorExportPreset, debug: boolean, path: string): GDictionary + + /** Saves patch ZIP archive and returns [Dictionary] with the following keys: `result: Error`, `so_files: Array` (array of the shared/static objects which contains dictionaries with the following keys: `path: String`, `tags: PackedStringArray`, and `target_folder: String`). */ + save_zip_patch(preset: EditorExportPreset, debug: boolean, path: string): GDictionary + + /** Generates array of command line arguments for the default export templates for the debug flags and editor settings. */ + gen_export_flags(flags: EditorExportPlatform.DebugFlags): PackedStringArray + + /** Exports project files for the specified preset. This method can be used to implement custom export format, other than PCK and ZIP. One of the callbacks is called for each exported file. + * [param save_cb] is called for all exported files and have the following arguments: `file_path: String`, `file_data: PackedByteArray`, `file_index: int`, `file_count: int`, `encryption_include_filters: PackedStringArray`, `encryption_exclude_filters: PackedStringArray`, `encryption_key: PackedByteArray`. + * [param shared_cb] is called for exported native shared/static libraries and have the following arguments: `file_path: String`, `tags: PackedStringArray`, `target_folder: String`. + * + * **Note:** `file_index` and `file_count` are intended for progress tracking only and aren't necessarily unique and precise. + */ + export_project_files(preset: EditorExportPreset, debug: boolean, save_cb: Callable, shared_cb: Callable = new Callable()): GError + + /** Creates a full project at [param path] for the specified [param preset]. */ + export_project(preset: EditorExportPreset, debug: boolean, path: string, flags: EditorExportPlatform.DebugFlags = 0): GError + + /** Creates a PCK archive at [param path] for the specified [param preset]. */ + export_pack(preset: EditorExportPreset, debug: boolean, path: string, flags: EditorExportPlatform.DebugFlags = 0): GError + + /** Create a ZIP archive at [param path] for the specified [param preset]. */ + export_zip(preset: EditorExportPreset, debug: boolean, path: string, flags: EditorExportPlatform.DebugFlags = 0): GError + + /** Creates a patch PCK archive at [param path] for the specified [param preset], containing only the files that have changed since the last patch. + * + * **Note:** [param patches] is an optional override of the set of patches defined in the export preset. When empty the patches defined in the export preset will be used instead. + */ + export_pack_patch(preset: EditorExportPreset, debug: boolean, path: string, patches: PackedStringArray | string[] = [], flags: EditorExportPlatform.DebugFlags = 0): GError + + /** Create a patch ZIP archive at [param path] for the specified [param preset], containing only the files that have changed since the last patch. + * + * **Note:** [param patches] is an optional override of the set of patches defined in the export preset. When empty the patches defined in the export preset will be used instead. + */ + export_zip_patch(preset: EditorExportPreset, debug: boolean, path: string, patches: PackedStringArray | string[] = [], flags: EditorExportPlatform.DebugFlags = 0): GError + + /** Clears the export log. */ + clear_messages(): void + + /** Adds a message to the export log that will be displayed when exporting ends. */ + add_message(type: EditorExportPlatform.ExportMessageType, category: string, message: string): void + + /** Returns number of messages in the export log. */ + get_message_count(): int64 + + /** Returns message type, for the message with [param index]. */ + get_message_type(index: int64): EditorExportPlatform.ExportMessageType + + /** Returns message category, for the message with [param index]. */ + get_message_category(index: int64): string + + /** Returns message text, for the message with [param index]. */ + get_message_text(index: int64): string + + /** Returns most severe message type currently present in the export log. */ + get_worst_message_type(): EditorExportPlatform.ExportMessageType + + /** Executes specified command on the remote host via SSH protocol and returns command output in the [param output]. */ + ssh_run_on_remote(host: string, port: string, ssh_arg: PackedStringArray | string[], cmd_args: string, output: GArray = [], port_fwd: int64 = -1): GError + + /** Executes specified command on the remote host via SSH protocol and returns process ID (on the remote host) without waiting for command to finish. */ + ssh_run_on_remote_no_wait(host: string, port: string, ssh_args: PackedStringArray | string[], cmd_args: string, port_fwd: int64 = -1): int64 + + /** Uploads specified file over SCP protocol to the remote host. */ + ssh_push_to_remote(host: string, port: string, scp_args: PackedStringArray | string[], src_file: string, dst_file: string): GError + + /** Returns additional files that should always be exported regardless of preset configuration, and are not part of the project source. The returned [Dictionary] contains filename keys ([String]) and their corresponding raw data ([PackedByteArray]). */ + get_internal_export_files(preset: EditorExportPreset, debug: boolean): GDictionary + + /** Returns array of core file names that always should be exported regardless of preset config. */ + static get_forced_export_files(): PackedStringArray } /** Exporter for Android. * - * @link https://docs.godotengine.org/en/4.3/classes/class_editorexportplatformandroid.html + * @link https://docs.godotengine.org/en/4.4/classes/class_editorexportplatformandroid.html */ class EditorExportPlatformAndroid extends EditorExportPlatform { constructor(identifier?: any) } + /** Base class for custom [EditorExportPlatform] implementations (plugins). + * + * @link https://docs.godotengine.org/en/4.4/classes/class_editorexportplatformextension.html + */ + class EditorExportPlatformExtension extends EditorExportPlatform { + constructor(identifier?: any) + /** **Required.** + * Returns array of platform specific features for the specified [param preset]. + */ + /* gdvirtual */ _get_preset_features(preset: EditorExportPreset): PackedStringArray + + /** **Optional.** + * Returns `true` if specified file is a valid executable (native executable or script) for the target platform. + */ + /* gdvirtual */ _is_executable(path: string): boolean + + /** **Optional.** + * Returns a property list, as an [Array] of dictionaries. Each [Dictionary] must at least contain the `name: StringName` and `type: Variant.Type` entries. + * Additionally, the following keys are supported: + * - `hint: PropertyHint` + * - `hint_string: String` + * - `usage: PropertyUsageFlags` + * - `class_name: StringName` + * - `default_value: Variant`, default value of the property. + * - `update_visibility: bool`, if set to `true`, [method _get_export_option_visibility] is called for each property when this property is changed. + * - `required: bool`, if set to `true`, this property warnings are critical, and should be resolved to make export possible. This value is a hint for the [method _has_valid_export_configuration] implementation, and not used by the engine directly. + * See also [method Object._get_property_list]. + */ + /* gdvirtual */ _get_export_options(): GArray + + /** **Optional.** + * Returns `true` if export options list is changed and presets should be updated. + */ + /* gdvirtual */ _should_update_export_options(): boolean + + /** **Optional.** + * Validates [param option] and returns visibility for the specified [param preset]. Default implementation return `true` for all options. + */ + /* gdvirtual */ _get_export_option_visibility(preset: EditorExportPreset, option: string): boolean + + /** **Optional.** + * Validates [param option] and returns warning message for the specified [param preset]. Default implementation return empty string for all options. + */ + /* gdvirtual */ _get_export_option_warning(preset: EditorExportPreset, option: StringName): string + + /** **Required.** + * Returns target OS name. + */ + /* gdvirtual */ _get_os_name(): string + + /** **Required.** + * Returns export platform name. + */ + /* gdvirtual */ _get_name(): string + + /** **Required.** + * Returns platform logo displayed in the export dialog, logo should be 32x32 adjusted to the current editor scale, see [method EditorInterface.get_editor_scale]. + */ + /* gdvirtual */ _get_logo(): Texture2D + + /** **Optional.** + * Returns `true` if one-click deploy options are changed and editor interface should be updated. + */ + /* gdvirtual */ _poll_export(): boolean + + /** **Optional.** + * Returns number one-click deploy devices (or other one-click option displayed in the menu). + */ + /* gdvirtual */ _get_options_count(): int64 + + /** **Optional.** + * Returns tooltip of the one-click deploy menu button. + */ + /* gdvirtual */ _get_options_tooltip(): string + + /** **Optional.** + * Returns one-click deploy menu item icon for the specified [param device], icon should be 16x16 adjusted to the current editor scale, see [method EditorInterface.get_editor_scale]. + */ + /* gdvirtual */ _get_option_icon(device: int64): ImageTexture + + /** **Optional.** + * Returns one-click deploy menu item label for the specified [param device]. + */ + /* gdvirtual */ _get_option_label(device: int64): string + + /** **Optional.** + * Returns one-click deploy menu item tooltip for the specified [param device]. + */ + /* gdvirtual */ _get_option_tooltip(device: int64): string + + /** **Optional.** + * Returns device architecture for one-click deploy. + */ + /* gdvirtual */ _get_device_architecture(device: int64): string + + /** **Optional.** + * Called by the editor before platform is unregistered. + */ + /* gdvirtual */ _cleanup(): void + + /** **Optional.** + * This method is called when [param device] one-click deploy menu option is selected. + * Implementation should export project to a temporary location, upload and run it on the specific [param device], or perform another action associated with the menu item. + */ + /* gdvirtual */ _run(preset: EditorExportPreset, device: int64, debug_flags: EditorExportPlatform.DebugFlags): GError + + /** **Optional.** + * Returns icon of the one-click deploy menu button, icon should be 16x16 adjusted to the current editor scale, see [method EditorInterface.get_editor_scale]. + */ + /* gdvirtual */ _get_run_icon(): Texture2D + + /** **Optional.** + * Returns `true`, if specified [param preset] is valid and can be exported. Use [method set_config_error] and [method set_config_missing_templates] to set error details. + * Usual implementation can call [method _has_valid_export_configuration] and [method _has_valid_project_configuration] to determine if export is possible. + */ + /* gdvirtual */ _can_export(preset: EditorExportPreset, debug: boolean): boolean + + /** **Required.** + * Returns `true` if export configuration is valid. + */ + /* gdvirtual */ _has_valid_export_configuration(preset: EditorExportPreset, debug: boolean): boolean + + /** **Required.** + * Returns `true` if project configuration is valid. + */ + /* gdvirtual */ _has_valid_project_configuration(preset: EditorExportPreset): boolean + + /** **Required.** + * Returns array of supported binary extensions for the full project export. + */ + /* gdvirtual */ _get_binary_extensions(preset: EditorExportPreset): PackedStringArray + + /** **Required.** + * Creates a full project at [param path] for the specified [param preset]. + * This method is called when "Export" button is pressed in the export dialog. + * This method implementation can call [method EditorExportPlatform.save_pack] or [method EditorExportPlatform.save_zip] to use default PCK/ZIP export process, or calls [method EditorExportPlatform.export_project_files] and implement custom callback for processing each exported file. + */ + /* gdvirtual */ _export_project(preset: EditorExportPreset, debug: boolean, path: string, flags: EditorExportPlatform.DebugFlags): GError + + /** **Optional.** + * Creates a PCK archive at [param path] for the specified [param preset]. + * This method is called when "Export PCK/ZIP" button is pressed in the export dialog, with "Export as Patch" disabled, and PCK is selected as a file type. + */ + /* gdvirtual */ _export_pack(preset: EditorExportPreset, debug: boolean, path: string, flags: EditorExportPlatform.DebugFlags): GError + + /** **Optional.** + * Create a ZIP archive at [param path] for the specified [param preset]. + * This method is called when "Export PCK/ZIP" button is pressed in the export dialog, with "Export as Patch" disabled, and ZIP is selected as a file type. + */ + /* gdvirtual */ _export_zip(preset: EditorExportPreset, debug: boolean, path: string, flags: EditorExportPlatform.DebugFlags): GError + + /** **Optional.** + * Creates a patch PCK archive at [param path] for the specified [param preset], containing only the files that have changed since the last patch. + * This method is called when "Export PCK/ZIP" button is pressed in the export dialog, with "Export as Patch" enabled, and PCK is selected as a file type. + * + * **Note:** The patches provided in [param patches] have already been loaded when this method is called and are merely provided as context. When empty the patches defined in the export preset have been loaded instead. + */ + /* gdvirtual */ _export_pack_patch(preset: EditorExportPreset, debug: boolean, path: string, patches: PackedStringArray | string[], flags: EditorExportPlatform.DebugFlags): GError + + /** **Optional.** + * Create a ZIP archive at [param path] for the specified [param preset], containing only the files that have changed since the last patch. + * This method is called when "Export PCK/ZIP" button is pressed in the export dialog, with "Export as Patch" enabled, and ZIP is selected as a file type. + * + * **Note:** The patches provided in [param patches] have already been loaded when this method is called and are merely provided as context. When empty the patches defined in the export preset have been loaded instead. + */ + /* gdvirtual */ _export_zip_patch(preset: EditorExportPreset, debug: boolean, path: string, patches: PackedStringArray | string[], flags: EditorExportPlatform.DebugFlags): GError + + /** **Required.** + * Returns array of platform specific features. + */ + /* gdvirtual */ _get_platform_features(): PackedStringArray + + /** **Optional.** + * Returns protocol used for remote debugging. Default implementation return `tcp://`. + */ + /* gdvirtual */ _get_debug_protocol(): string + + /** Sets current configuration error message text. This method should be called only from the [method _can_export], [method _has_valid_export_configuration], or [method _has_valid_project_configuration] implementations. */ + set_config_error(error_text: string): void + + /** Returns current configuration error message text. This method should be called only from the [method _can_export], [method _has_valid_export_configuration], or [method _has_valid_project_configuration] implementations. */ + get_config_error(): string + + /** Set to `true` is export templates are missing from the current configuration. This method should be called only from the [method _can_export], [method _has_valid_export_configuration], or [method _has_valid_project_configuration] implementations. */ + set_config_missing_templates(missing_templates: boolean): void + + /** Returns `true` is export templates are missing from the current configuration. This method should be called only from the [method _can_export], [method _has_valid_export_configuration], or [method _has_valid_project_configuration] implementations. */ + get_config_missing_templates(): boolean + } /** Exporter for iOS. * - * @link https://docs.godotengine.org/en/4.3/classes/class_editorexportplatformios.html + * @link https://docs.godotengine.org/en/4.4/classes/class_editorexportplatformios.html */ class EditorExportPlatformIOS extends EditorExportPlatform { constructor(identifier?: any) } /** Exporter for Linux/BSD. * - * @link https://docs.godotengine.org/en/4.3/classes/class_editorexportplatformlinuxbsd.html + * @link https://docs.godotengine.org/en/4.4/classes/class_editorexportplatformlinuxbsd.html */ class EditorExportPlatformLinuxBSD extends EditorExportPlatformPC { constructor(identifier?: any) } /** Exporter for macOS. * - * @link https://docs.godotengine.org/en/4.3/classes/class_editorexportplatformmacos.html + * @link https://docs.godotengine.org/en/4.4/classes/class_editorexportplatformmacos.html */ class EditorExportPlatformMacOS extends EditorExportPlatform { constructor(identifier?: any) } /** Base class for the desktop platform exporter (Windows and Linux/BSD). * - * @link https://docs.godotengine.org/en/4.3/classes/class_editorexportplatformpc.html + * @link https://docs.godotengine.org/en/4.4/classes/class_editorexportplatformpc.html */ class EditorExportPlatformPC extends EditorExportPlatform { constructor(identifier?: any) } /** Exporter for the Web. * - * @link https://docs.godotengine.org/en/4.3/classes/class_editorexportplatformweb.html + * @link https://docs.godotengine.org/en/4.4/classes/class_editorexportplatformweb.html */ class EditorExportPlatformWeb extends EditorExportPlatform { constructor(identifier?: any) } /** Exporter for Windows. * - * @link https://docs.godotengine.org/en/4.3/classes/class_editorexportplatformwindows.html + * @link https://docs.godotengine.org/en/4.4/classes/class_editorexportplatformwindows.html */ class EditorExportPlatformWindows extends EditorExportPlatformPC { constructor(identifier?: any) } /** A script that is executed when exporting the project. * - * @link https://docs.godotengine.org/en/4.3/classes/class_editorexportplugin.html + * @link https://docs.godotengine.org/en/4.4/classes/class_editorexportplugin.html */ class EditorExportPlugin extends RefCounted { constructor(identifier?: any) @@ -3628,14 +8755,24 @@ declare module "godot" { */ /* gdvirtual */ _begin_customize_resources(platform: EditorExportPlatform, features: PackedStringArray | string[]): boolean - /** Customize a resource. If changes are made to it, return the same or a new resource. Otherwise, return `null`. - * The *path* argument is only used when customizing an actual file, otherwise this means that this resource is part of another one and it will be empty. + /** Customize a resource. If changes are made to it, return the same or a new resource. Otherwise, return `null`. When a new resource is returned, [param resource] will be replaced by a copy of the new resource. + * The [param path] argument is only used when customizing an actual file, otherwise this means that this resource is part of another one and it will be empty. * Implementing this method is required if [method _begin_customize_resources] returns `true`. + * + * **Note:** When customizing any of the following types and returning another resource, the other resource should not be skipped using [method skip] in [method _export_file]: + * - [AtlasTexture] + * - [CompressedCubemap] + * - [CompressedCubemapArray] + * - [CompressedTexture2D] + * - [CompressedTexture2DArray] + * - [CompressedTexture3D] */ /* gdvirtual */ _customize_resource(resource: Resource, path: string): Resource /** Return `true` if this plugin will customize scenes based on the platform and features used. * When enabled, [method _get_customization_configuration_hash] and [method _customize_scene] will be called and must be implemented. + * + * **Note:** [method _customize_scene] will only be called for scenes that have been modified since the last export. */ /* gdvirtual */ _begin_customize_scenes(platform: EditorExportPlatform, features: PackedStringArray | string[]): boolean @@ -3671,6 +8808,11 @@ declare module "godot" { /** Return `true`, if the result of [method _get_export_options] has changed and the export options of preset corresponding to [param platform] should be updated. */ /* gdvirtual */ _should_update_export_options(platform: EditorExportPlatform): boolean + /** **Optional.** + * Validates [param option] and returns the visibility for the specified [param platform]. The default implementation returns `true` for all options. + */ + /* gdvirtual */ _get_export_option_visibility(platform: EditorExportPlatform, option: string): boolean + /** Check the requirements for the given [param option] and return a non-empty warning string if they are not met. * * **Note:** Use [method get_option] to check the value of the export options. @@ -3780,6 +8922,117 @@ declare module "godot" { /** Returns the current value of an export option supplied by [method _get_export_options]. */ get_option(name: StringName): any + + /** Returns currently used export preset. */ + get_export_preset(): EditorExportPreset + + /** Returns currently used export platform. */ + get_export_platform(): EditorExportPlatform + } + namespace EditorExportPreset { + enum ExportFilter { + EXPORT_ALL_RESOURCES = 0, + EXPORT_SELECTED_SCENES = 1, + EXPORT_SELECTED_RESOURCES = 2, + EXCLUDE_SELECTED_RESOURCES = 3, + EXPORT_CUSTOMIZED = 4, + } + enum FileExportMode { + MODE_FILE_NOT_CUSTOMIZED = 0, + MODE_FILE_STRIP = 1, + MODE_FILE_KEEP = 2, + MODE_FILE_REMOVE = 3, + } + enum ScriptExportMode { + MODE_SCRIPT_TEXT = 0, + MODE_SCRIPT_BINARY_TOKENS = 1, + MODE_SCRIPT_BINARY_TOKENS_COMPRESSED = 2, + } + } + /** Export preset configuration. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_editorexportpreset.html + */ + class EditorExportPreset extends RefCounted { + constructor(identifier?: any) + _get_property_warning(name: StringName): string + + /** Returns `true` if preset has specified property. */ + has(property: StringName): boolean + + /** Returns array of files to export. */ + get_files_to_export(): PackedStringArray + + /** Returns [Dictionary] of files selected in the "Resources" tab of the export dialog. Dictionary keys are file names and values are export mode - `"strip"`, `"keep"`, or `"remove"`. See also [method get_file_export_mode]. */ + get_customized_files(): GDictionary + + /** Returns number of files selected in the "Resources" tab of the export dialog. */ + get_customized_files_count(): int64 + + /** Returns `true` if specified file is exported. */ + has_export_file(path: string): boolean + + /** Returns file export mode for the specified file. */ + get_file_export_mode(path: string, default_: EditorExportPreset.FileExportMode = 0): EditorExportPreset.FileExportMode + + /** Returns export preset name. */ + get_preset_name(): string + + /** Returns `true` if "Runnable" toggle is enabled in the export dialog. */ + is_runnable(): boolean + + /** Returns `true` if "Advanced" toggle is enabled in the export dialog. */ + are_advanced_options_enabled(): boolean + + /** Returns `true` if dedicated server export mode is selected in the export dialog. */ + is_dedicated_server(): boolean + + /** Returns export file filter mode selected in the "Resources" tab of the export dialog. */ + get_export_filter(): EditorExportPreset.ExportFilter + + /** Returns file filters to include during export. */ + get_include_filter(): string + + /** Returns file filters to exclude during export. */ + get_exclude_filter(): string + + /** Returns string with a comma separated list of custom features. */ + get_custom_features(): string + + /** Returns the list of packs on which to base a patch export on. */ + get_patches(): PackedStringArray + + /** Returns export target path. */ + get_export_path(): string + + /** Returns file filters to include during PCK encryption. */ + get_encryption_in_filter(): string + + /** Returns file filters to exclude during PCK encryption. */ + get_encryption_ex_filter(): string + + /** Returns `true`, PCK encryption is enabled in the export dialog. */ + get_encrypt_pck(): boolean + + /** Returns `true`, PCK directory encryption is enabled in the export dialog. */ + get_encrypt_directory(): boolean + + /** Returns PCK encryption key. */ + get_encryption_key(): string + + /** Returns script export mode. */ + get_script_export_mode(): int64 + + /** Returns export option value or value of environment variable if it is set. */ + get_or_env(name: StringName, env_var: string): any + + /** Returns the preset's version number, or fall back to the [member ProjectSettings.application/config/version] project setting if set to an empty string. + * If [param windows_version] is `true`, formats the returned version number to be compatible with Windows executable metadata. + */ + get_version(name: StringName, windows_version: boolean): string + } + class EditorExpressionEvaluator = Record> extends VBoxContainer { + constructor(identifier?: any) } namespace EditorFeatureProfile { enum Feature { @@ -3807,13 +9060,16 @@ declare module "godot" { /** The History dock. If this feature is disabled, the History dock won't be visible. */ FEATURE_HISTORY_DOCK = 7, + /** The Game tab, which allows embedding the game window and selecting nodes by clicking inside of it. If this feature is disabled, the Game tab won't display. */ + FEATURE_GAME = 8, + /** Represents the size of the [enum Feature] enum. */ - FEATURE_MAX = 8, + FEATURE_MAX = 9, } } /** An editor feature profile which can be used to disable specific features. * - * @link https://docs.godotengine.org/en/4.3/classes/class_editorfeatureprofile.html + * @link https://docs.godotengine.org/en/4.4/classes/class_editorfeatureprofile.html */ class EditorFeatureProfile extends RefCounted { constructor(identifier?: any) @@ -3856,7 +9112,7 @@ declare module "godot" { */ load_from_file(path: string): GError } - class EditorFeatureProfileManager extends AcceptDialog { + class EditorFeatureProfileManager = Record> extends AcceptDialog { constructor(identifier?: any) readonly current_feature_profile_changed: Signal0 } @@ -3897,13 +9153,13 @@ declare module "godot" { } /** A modified version of [FileDialog] used by the editor. * - * @link https://docs.godotengine.org/en/4.3/classes/class_editorfiledialog.html + * @link https://docs.godotengine.org/en/4.4/classes/class_editorfiledialog.html */ - class EditorFileDialog extends ConfirmationDialog { + class EditorFileDialog = Record> extends ConfirmationDialog { constructor(identifier?: any) _cancel_pressed(): void - /** Removes all filters except for "All Files (*)". */ + /** Removes all filters except for "All Files (*.*)". */ clear_filters(): void /** Adds a comma-delimited file name [param filter] option to the [EditorFileDialog] with an optional [param description], which restricts what files can be picked. @@ -3938,6 +9194,15 @@ declare module "godot" { /** Returns a [Dictionary] with the selected values of the additional [OptionButton]s and/or [CheckBox]es. [Dictionary] keys are names and values are selected value indices. */ get_selected_options(): GDictionary + /** Clear the filter for file names. */ + clear_filename_filter(): void + + /** Sets the value of the filter for file names. */ + set_filename_filter(filter: string): void + + /** Returns the value of the filter for file names. */ + get_filename_filter(): string + /** Returns the [VBoxContainer] used to display the file system. * **Warning:** This is a required internal node, removing and freeing it may cause a crash. If you wish to hide it or any of its children, use their [member CanvasItem.visible] property. */ @@ -4007,5390 +9272,8 @@ declare module "godot" { /** Emitted when a directory is selected. */ readonly dir_selected: Signal1 - } - class EditorFileServer extends Object { - constructor(identifier?: any) - } - /** Resource filesystem, as the editor sees it. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_editorfilesystem.html - */ - class EditorFileSystem extends Node { - constructor(identifier?: any) - /** Gets the root directory object. */ - get_filesystem(): EditorFileSystemDirectory - /** Returns `true` if the filesystem is being scanned. */ - is_scanning(): boolean - - /** Returns the scan progress for 0 to 1 if the FS is being scanned. */ - get_scanning_progress(): float64 - - /** Scan the filesystem for changes. */ - scan(): void - - /** Check if the source of any imported resource changed. */ - scan_sources(): void - - /** Add a file in an existing directory, or schedule file information to be updated on editor restart. Can be used to update text files saved by an external program. - * This will not import the file. To reimport, call [method reimport_files] or [method scan] methods. - */ - update_file(path: string): void - - /** Returns a view into the filesystem at [param path]. */ - get_filesystem_path(path: string): EditorFileSystemDirectory - - /** Returns the resource type of the file, given the full path. This returns a string such as `"Resource"` or `"GDScript"`, *not* a file extension such as `".gd"`. */ - get_file_type(path: string): string - - /** Reimports a set of files. Call this if these files or their `.import` files were directly edited by script or an external program. - * If the file type changed or the file was newly created, use [method update_file] or [method scan]. - * - * **Note:** This function blocks until the import is finished. However, the main loop iteration, including timers and [method Node._process], will occur during the import process due to progress bar updates. Avoid calls to [method reimport_files] or [method scan] while an import is in progress. - */ - reimport_files(files: PackedStringArray | string[]): void - - /** Emitted if the filesystem changed. */ - readonly filesystem_changed: Signal0 - - /** Emitted when the list of global script classes gets updated. */ - readonly script_classes_updated: Signal0 - - /** Emitted if the source of any imported file changed. */ - readonly sources_changed: Signal1 - - /** Emitted before a resource is reimported. */ - readonly resources_reimporting: Signal1 - - /** Emitted if a resource is reimported. */ - readonly resources_reimported: Signal1 - - /** Emitted if at least one resource is reloaded when the filesystem is scanned. */ - readonly resources_reload: Signal1 - } - /** A directory for the resource filesystem. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_editorfilesystemdirectory.html - */ - class EditorFileSystemDirectory extends Object { - constructor(identifier?: any) - /** Returns the number of subdirectories in this directory. */ - get_subdir_count(): int64 - - /** Returns the subdirectory at index [param idx]. */ - get_subdir(idx: int64): EditorFileSystemDirectory - - /** Returns the number of files in this directory. */ - get_file_count(): int64 - - /** Returns the name of the file at index [param idx]. */ - get_file(idx: int64): string - - /** Returns the path to the file at index [param idx]. */ - get_file_path(idx: int64): string - - /** Returns the resource type of the file at index [param idx]. This returns a string such as `"Resource"` or `"GDScript"`, *not* a file extension such as `".gd"`. */ - get_file_type(idx: int64): StringName - - /** Returns the name of the script class defined in the file at index [param idx]. If the file doesn't define a script class using the `class_name` syntax, this will return an empty string. */ - get_file_script_class_name(idx: int64): string - - /** Returns the base class of the script class defined in the file at index [param idx]. If the file doesn't define a script class using the `class_name` syntax, this will return an empty string. */ - get_file_script_class_extends(idx: int64): string - - /** Returns `true` if the file at index [param idx] imported properly. */ - get_file_import_is_valid(idx: int64): boolean - - /** Returns the name of this directory. */ - get_name(): string - - /** Returns the path to this directory. */ - get_path(): string - - /** Returns the parent directory for this directory or `null` if called on a directory at `res://` or `user://`. */ - get_parent(): EditorFileSystemDirectory - - /** Returns the index of the file with name [param name] or `-1` if not found. */ - find_file_index(name: string): int64 - - /** Returns the index of the directory with name [param name] or `-1` if not found. */ - find_dir_index(name: string): int64 - } - /** Used to query and configure import format support. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_editorfilesystemimportformatsupportquery.html - */ - class EditorFileSystemImportFormatSupportQuery extends RefCounted { - constructor(identifier?: any) - /** Return whether this importer is active. */ - /* gdvirtual */ _is_active(): boolean - - /** Return the file extensions supported. */ - /* gdvirtual */ _get_file_extensions(): PackedStringArray - - /** Query support. Return false if import must not continue. */ - /* gdvirtual */ _query(): boolean - } - class EditorFileSystemImportFormatSupportQueryBlend extends EditorFileSystemImportFormatSupportQuery { - constructor(identifier?: any) - } - class EditorFontPreviewPlugin extends EditorResourcePreviewGenerator { - constructor(identifier?: any) - } - class EditorGradientPreviewPlugin extends EditorResourcePreviewGenerator { - constructor(identifier?: any) - } - class EditorHelpBit extends VBoxContainer { - constructor(identifier?: any) - readonly request_hide: Signal0 - } - class EditorHelpBitTooltip extends PopupPanel { - constructor(identifier?: any) - } - class EditorHelpSearch extends ConfirmationDialog { - constructor(identifier?: any) - readonly go_to_help: Signal0 - } - class EditorImagePreviewPlugin extends EditorResourcePreviewGenerator { - constructor(identifier?: any) - } - class EditorImportBlendRunner extends Node { - constructor(identifier?: any) - } - /** Registers a custom resource importer in the editor. Use the class to parse any file and import it as a new resource type. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_editorimportplugin.html - */ - class EditorImportPlugin extends ResourceImporter { - constructor(identifier?: any) - /** Gets the unique name of the importer. */ - /* gdvirtual */ _get_importer_name(): string - - /** Gets the name to display in the import window. You should choose this name as a continuation to "Import as", e.g. "Import as Special Mesh". */ - /* gdvirtual */ _get_visible_name(): string - - /** Gets the number of initial presets defined by the plugin. Use [method _get_import_options] to get the default options for the preset and [method _get_preset_name] to get the name of the preset. */ - /* gdvirtual */ _get_preset_count(): int64 - - /** Gets the name of the options preset at this index. */ - /* gdvirtual */ _get_preset_name(preset_index: int64): string - - /** Gets the list of file extensions to associate with this loader (case-insensitive). e.g. `["obj"]`. */ - /* gdvirtual */ _get_recognized_extensions(): PackedStringArray - - /** Gets the options and default values for the preset at this index. Returns an Array of Dictionaries with the following keys: `name`, `default_value`, `property_hint` (optional), `hint_string` (optional), `usage` (optional). */ - /* gdvirtual */ _get_import_options(path: string, preset_index: int64): GArray - - /** Gets the extension used to save this resource in the `.godot/imported` directory (see [member ProjectSettings.application/config/use_hidden_project_data_directory]). */ - /* gdvirtual */ _get_save_extension(): string - - /** Gets the Godot resource type associated with this loader. e.g. `"Mesh"` or `"Animation"`. */ - /* gdvirtual */ _get_resource_type(): string - - /** Gets the priority of this plugin for the recognized extension. Higher priority plugins will be preferred. The default priority is `1.0`. */ - /* gdvirtual */ _get_priority(): float64 - - /** Gets the order of this importer to be run when importing resources. Importers with *lower* import orders will be called first, and higher values will be called later. Use this to ensure the importer runs after the dependencies are already imported. The default import order is `0` unless overridden by a specific importer. See [enum ResourceImporter.ImportOrder] for some predefined values. */ - /* gdvirtual */ _get_import_order(): int64 - - /** This method can be overridden to hide specific import options if conditions are met. This is mainly useful for hiding options that depend on others if one of them is disabled. For example: - * - * Returns `true` to make all options always visible. - */ - /* gdvirtual */ _get_option_visibility(path: string, option_name: StringName, options: GDictionary): boolean - - /** Imports [param source_file] into [param save_path] with the import [param options] specified. The [param platform_variants] and [param gen_files] arrays will be modified by this function. - * This method must be overridden to do the actual importing work. See this class' description for an example of overriding this method. - */ - /* gdvirtual */ _import(source_file: string, save_path: string, options: GDictionary, platform_variants: GArray, gen_files: GArray): GError - - /** Tells whether this importer can be run in parallel on threads, or, on the contrary, it's only safe for the editor to call it from the main thread, for one file at a time. - * If this method is not overridden, it will return `true` by default (i.e., safe for parallel importing). - */ - /* gdvirtual */ _can_import_threaded(): boolean - - /** This function can only be called during the [method _import] callback and it allows manually importing resources from it. This is useful when the imported file generates external resources that require importing (as example, images). Custom parameters for the ".import" file can be passed via the [param custom_options]. Additionally, in cases where multiple importers can handle a file, the [param custom_importer] can be specified to force a specific one. This function performs a resource import and returns immediately with a success or error code. [param generator_parameters] defines optional extra metadata which will be stored as [code skip-lint]generator_parameters` in the `remap` section of the `.import` file, for example to store a md5 hash of the source data. */ - append_import_external_resource(path: string, custom_options: GDictionary = new GDictionary(), custom_importer: string = '', generator_parameters: any = {}): GError - } - /** A control used to edit properties of an object. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_editorinspector.html - */ - class EditorInspector extends ScrollContainer { - constructor(identifier?: any) - _edit_request_change(_unnamed_arg0: Object, _unnamed_arg1: string): void - - /** Gets the path of the currently selected property. */ - get_selected_path(): string - - /** Returns the object currently selected in this inspector. */ - get_edited_object(): Object - - /** Emitted when a property is selected in the inspector. */ - readonly property_selected: Signal1 - - /** Emitted when a property is keyed in the inspector. Properties can be keyed by clicking the "key" icon next to a property when the Animation panel is toggled. */ - readonly property_keyed: Signal3 - - /** Emitted when a property is removed from the inspector. */ - readonly property_deleted: Signal1 - - /** Emitted when a resource is selected in the inspector. */ - readonly resource_selected: Signal2 - - /** Emitted when the Edit button of an [Object] has been pressed in the inspector. This is mainly used in the remote scene tree Inspector. */ - readonly object_id_selected: Signal1 - - /** Emitted when a property is edited in the inspector. */ - readonly property_edited: Signal1 - - /** Emitted when a boolean property is toggled in the inspector. - * - * **Note:** This signal is never emitted if the internal `autoclear` property enabled. Since this property is always enabled in the editor inspector, this signal is never emitted by the editor itself. - */ - readonly property_toggled: Signal2 - - /** Emitted when the object being edited by the inspector has changed. */ - readonly edited_object_changed: Signal0 - - /** Emitted when a property that requires a restart to be applied is edited in the inspector. This is only used in the Project Settings and Editor Settings. */ - readonly restart_requested: Signal0 - } - class EditorInspectorCategory extends Control { - constructor(identifier?: any) - } - class EditorInspectorDefaultPlugin extends EditorInspectorPlugin { - constructor(identifier?: any) - } - class EditorInspectorParticleProcessMaterialPlugin extends EditorInspectorPlugin { - constructor(identifier?: any) - } - /** Plugin for adding custom property editors on the inspector. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_editorinspectorplugin.html - */ - class EditorInspectorPlugin extends RefCounted { - constructor(identifier?: any) - /** Returns `true` if this object can be handled by this plugin. */ - /* gdvirtual */ _can_handle(object: Object): boolean - - /** Called to allow adding controls at the beginning of the property list for [param object]. */ - /* gdvirtual */ _parse_begin(object: Object): void - - /** Called to allow adding controls at the beginning of a category in the property list for [param object]. */ - /* gdvirtual */ _parse_category(object: Object, category: string): void - - /** Called to allow adding controls at the beginning of a group or a sub-group in the property list for [param object]. */ - /* gdvirtual */ _parse_group(object: Object, group: string): void - - /** Called to allow adding property-specific editors to the property list for [param object]. The added editor control must extend [EditorProperty]. Returning `true` removes the built-in editor for this property, otherwise allows to insert a custom editor before the built-in one. */ - /* gdvirtual */ _parse_property(object: Object, type: Variant.Type, name: string, hint_type: PropertyHint, hint_string: string, usage_flags: PropertyUsageFlags, wide: boolean): boolean - - /** Called to allow adding controls at the end of the property list for [param object]. */ - /* gdvirtual */ _parse_end(object: Object): void - - /** Adds a custom control, which is not necessarily a property editor. */ - add_custom_control(control: Control): void - - /** Adds a property editor for an individual property. The [param editor] control must extend [EditorProperty]. - * There can be multiple property editors for a property. If [param add_to_end] is `true`, this newly added editor will be displayed after all the other editors of the property whose [param add_to_end] is `false`. For example, the editor uses this parameter to add an "Edit Region" button for [member Sprite2D.region_rect] below the regular [Rect2] editor. - * [param label] can be used to choose a custom label for the property editor in the inspector. If left empty, the label is computed from the name of the property instead. - */ - add_property_editor(property: string, editor: Control, add_to_end: boolean = false, label: string = ''): void - - /** Adds an editor that allows modifying multiple properties. The [param editor] control must extend [EditorProperty]. */ - add_property_editor_for_multiple_properties(label: string, properties: PackedStringArray | string[], editor: Control): void - } - class EditorInspectorPlugin3DTexture extends EditorInspectorPlugin { - constructor(identifier?: any) - } - class EditorInspectorPluginAnimationTrackKeyEdit extends EditorInspectorPlugin { - constructor(identifier?: any) - } - class EditorInspectorPluginAudioStream extends EditorInspectorPlugin { - constructor(identifier?: any) - } - class EditorInspectorPluginAudioStreamInteractive extends EditorInspectorPlugin { - constructor(identifier?: any) - } - class EditorInspectorPluginBitMap extends EditorInspectorPlugin { - constructor(identifier?: any) - } - class EditorInspectorPluginBoneMap extends EditorInspectorPlugin { - constructor(identifier?: any) - } - class EditorInspectorPluginControl extends EditorInspectorPlugin { - constructor(identifier?: any) - } - class EditorInspectorPluginCurve extends EditorInspectorPlugin { - constructor(identifier?: any) - } - class EditorInspectorPluginFontPreview extends EditorInspectorPlugin { - constructor(identifier?: any) - } - class EditorInspectorPluginFontVariation extends EditorInspectorPlugin { - constructor(identifier?: any) - } - class EditorInspectorPluginGradient extends EditorInspectorPlugin { - constructor(identifier?: any) - } - class EditorInspectorPluginGradientTexture2D extends EditorInspectorPlugin { - constructor(identifier?: any) - } - class EditorInspectorPluginInputEvent extends EditorInspectorPlugin { - constructor(identifier?: any) - } - class EditorInspectorPluginLayeredTexture extends EditorInspectorPlugin { - constructor(identifier?: any) - } - class EditorInspectorPluginMaterial extends EditorInspectorPlugin { - constructor(identifier?: any) - } - class EditorInspectorPluginMesh extends EditorInspectorPlugin { - constructor(identifier?: any) - } - class EditorInspectorPluginPackedScene extends EditorInspectorPlugin { - constructor(identifier?: any) - } - class EditorInspectorPluginSkeleton extends EditorInspectorPlugin { - constructor(identifier?: any) - } - class EditorInspectorPluginStyleBox extends EditorInspectorPlugin { - constructor(identifier?: any) - } - class EditorInspectorPluginSubViewportPreview extends EditorInspectorPluginTexture { - constructor(identifier?: any) - } - class EditorInspectorPluginSystemFont extends EditorInspectorPlugin { - constructor(identifier?: any) - } - class EditorInspectorPluginTexture extends EditorInspectorPlugin { - constructor(identifier?: any) - } - class EditorInspectorPluginTextureRegion extends EditorInspectorPlugin { - constructor(identifier?: any) - } - class EditorInspectorPluginTileData extends EditorInspectorPlugin { - constructor(identifier?: any) - } - class EditorInspectorRootMotionPlugin extends EditorInspectorPlugin { - constructor(identifier?: any) - } - class EditorInspectorSection extends Container { - constructor(identifier?: any) - setup(section: string, label: string, object: Object, bg_color: Color, foldable: boolean, indent_depth: int64 = 0, level: int64 = 1): void - get_vbox(): VBoxContainer - unfold(): void - fold(): void - } - class EditorInspectorVisualShaderModePlugin extends EditorInspectorPlugin { - constructor(identifier?: any) - } - class EditorJSONSyntaxHighlighter extends EditorSyntaxHighlighter { - constructor(identifier?: any) - } - class EditorLayoutsDialog extends ConfirmationDialog { - constructor(identifier?: any) - readonly name_confirmed: Signal1 - } - class EditorLocaleDialog extends ConfirmationDialog { - constructor(identifier?: any) - readonly locale_selected: Signal1 - } - class EditorLog extends HBoxContainer { - constructor(identifier?: any) - } - class EditorMaterialPreviewPlugin extends EditorResourcePreviewGenerator { - constructor(identifier?: any) - } - class EditorMeshPreviewPlugin extends EditorResourcePreviewGenerator { - constructor(identifier?: any) - } - class EditorNativeShaderSourceVisualizer extends AcceptDialog { - constructor(identifier?: any) - _inspect_shader(_unnamed_arg0: RID): void - } - class EditorNetworkProfiler extends VBoxContainer { - constructor(identifier?: any) - readonly enable_profiling: Signal1 - readonly open_request: Signal1 - } - class EditorNode extends Node { - constructor(identifier?: any) - push_item(object: Object, property: string = '', inspector_only: boolean = false): void - set_edited_scene(_unnamed_arg0: Node): void - stop_child_process(_unnamed_arg0: int64): void - readonly request_help_search: Signal0 - readonly script_add_function_request: Signal3 - readonly resource_saved: Signal1 - readonly scene_saved: Signal1 - readonly scene_changed: Signal0 - readonly scene_closed: Signal1 - } - /** Gizmo for editing [Node3D] objects. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_editornode3dgizmo.html - */ - class EditorNode3DGizmo extends Node3DGizmo { - constructor(identifier?: any) - /** Override this method to add all the gizmo elements whenever a gizmo update is requested. It's common to call [method clear] at the beginning of this method and then add visual elements depending on the node's properties. */ - /* gdvirtual */ _redraw(): void - - /** Override this method to return the name of an edited handle (handles must have been previously added by [method add_handles]). Handles can be named for reference to the user when editing. - * The [param secondary] argument is `true` when the requested handle is secondary (see [method add_handles] for more information). - */ - /* gdvirtual */ _get_handle_name(id: int64, secondary: boolean): string - - /** Override this method to return `true` whenever the given handle should be highlighted in the editor. - * The [param secondary] argument is `true` when the requested handle is secondary (see [method add_handles] for more information). - */ - /* gdvirtual */ _is_handle_highlighted(id: int64, secondary: boolean): boolean - - /** Override this method to return the current value of a handle. This value will be requested at the start of an edit and used as the `restore` argument in [method _commit_handle]. - * The [param secondary] argument is `true` when the requested handle is secondary (see [method add_handles] for more information). - */ - /* gdvirtual */ _get_handle_value(id: int64, secondary: boolean): any - /* gdvirtual */ _begin_handle_action(id: int64, secondary: boolean): void - - /** Override this method to update the node properties when the user drags a gizmo handle (previously added with [method add_handles]). The provided [param point] is the mouse position in screen coordinates and the [param camera] can be used to convert it to raycasts. - * The [param secondary] argument is `true` when the edited handle is secondary (see [method add_handles] for more information). - */ - /* gdvirtual */ _set_handle(id: int64, secondary: boolean, camera: Camera3D, point: Vector2): void - - /** Override this method to commit a handle being edited (handles must have been previously added by [method add_handles]). This usually means creating an [UndoRedo] action for the change, using the current handle value as "do" and the [param restore] argument as "undo". - * If the [param cancel] argument is `true`, the [param restore] value should be directly set, without any [UndoRedo] action. - * The [param secondary] argument is `true` when the committed handle is secondary (see [method add_handles] for more information). - */ - /* gdvirtual */ _commit_handle(id: int64, secondary: boolean, restore: any, cancel: boolean): void - - /** Override this method to allow selecting subgizmos using mouse clicks. Given a [param camera] and a [param point] in screen coordinates, this method should return which subgizmo should be selected. The returned value should be a unique subgizmo identifier, which can have any non-negative value and will be used in other virtual methods like [method _get_subgizmo_transform] or [method _commit_subgizmos]. */ - /* gdvirtual */ _subgizmos_intersect_ray(camera: Camera3D, point: Vector2): int64 - - /** Override this method to allow selecting subgizmos using mouse drag box selection. Given a [param camera] and a [param frustum], this method should return which subgizmos are contained within the frustum. The [param frustum] argument consists of an array with all the [Plane]s that make up the selection frustum. The returned value should contain a list of unique subgizmo identifiers, which can have any non-negative value and will be used in other virtual methods like [method _get_subgizmo_transform] or [method _commit_subgizmos]. */ - /* gdvirtual */ _subgizmos_intersect_frustum(camera: Camera3D, frustum: GArray): PackedInt32Array - - /** Override this method to update the node properties during subgizmo editing (see [method _subgizmos_intersect_ray] and [method _subgizmos_intersect_frustum]). The [param transform] is given in the [Node3D]'s local coordinate system. */ - /* gdvirtual */ _set_subgizmo_transform(id: int64, transform: Transform3D): void - - /** Override this method to return the current transform of a subgizmo. This transform will be requested at the start of an edit and used as the `restore` argument in [method _commit_subgizmos]. */ - /* gdvirtual */ _get_subgizmo_transform(id: int64): Transform3D - - /** Override this method to commit a group of subgizmos being edited (see [method _subgizmos_intersect_ray] and [method _subgizmos_intersect_frustum]). This usually means creating an [UndoRedo] action for the change, using the current transforms as "do" and the [param restores] transforms as "undo". - * If the [param cancel] argument is `true`, the [param restores] transforms should be directly set, without any [UndoRedo] action. - */ - /* gdvirtual */ _commit_subgizmos(ids: PackedInt32Array | int32[], restores: GArray, cancel: boolean): void - - /** Adds lines to the gizmo (as sets of 2 points), with a given material. The lines are used for visualizing the gizmo. Call this method during [method _redraw]. */ - add_lines(lines: PackedVector3Array | Vector3[], material: Material, billboard: boolean = false, modulate: Color = new Color(1, 1, 1, 1)): void - - /** Adds a mesh to the gizmo with the specified [param material], local [param transform] and [param skeleton]. Call this method during [method _redraw]. */ - add_mesh(mesh: Mesh, material: Material = undefined, transform: Transform3D = new Transform3D(), skeleton: SkinReference = undefined): void - - /** Adds the specified [param segments] to the gizmo's collision shape for picking. Call this method during [method _redraw]. */ - add_collision_segments(segments: PackedVector3Array | Vector3[]): void - - /** Adds collision triangles to the gizmo for picking. A [TriangleMesh] can be generated from a regular [Mesh] too. Call this method during [method _redraw]. */ - add_collision_triangles(triangles: TriangleMesh): void - - /** Adds an unscaled billboard for visualization and selection. Call this method during [method _redraw]. */ - add_unscaled_billboard(material: Material, default_scale: float64 = 1, modulate: Color = new Color(1, 1, 1, 1)): void - - /** Adds a list of handles (points) which can be used to edit the properties of the gizmo's [Node3D]. The [param ids] argument can be used to specify a custom identifier for each handle, if an empty array is passed, the ids will be assigned automatically from the [param handles] argument order. - * The [param secondary] argument marks the added handles as secondary, meaning they will normally have lower selection priority than regular handles. When the user is holding the shift key secondary handles will switch to have higher priority than regular handles. This change in priority can be used to place multiple handles at the same point while still giving the user control on their selection. - * There are virtual methods which will be called upon editing of these handles. Call this method during [method _redraw]. - */ - add_handles(handles: PackedVector3Array | Vector3[], material: Material, ids: PackedInt32Array | int32[], billboard: boolean = false, secondary: boolean = false): void - - /** Sets the reference [Node3D] node for the gizmo. [param node] must inherit from [Node3D]. */ - set_node_3d(node: Node): void - - /** Returns the [Node3D] node associated with this gizmo. */ - get_node_3d(): Node3D - - /** Returns the [EditorNode3DGizmoPlugin] that owns this gizmo. It's useful to retrieve materials using [method EditorNode3DGizmoPlugin.get_material]. */ - get_plugin(): EditorNode3DGizmoPlugin - - /** Removes everything in the gizmo including meshes, collisions and handles. */ - clear(): void - - /** Sets the gizmo's hidden state. If `true`, the gizmo will be hidden. If `false`, it will be shown. */ - set_hidden(hidden: boolean): void - - /** Returns `true` if the given subgizmo is currently selected. Can be used to highlight selected elements during [method _redraw]. */ - is_subgizmo_selected(id: int64): boolean - - /** Returns a list of the currently selected subgizmos. Can be used to highlight selected elements during [method _redraw]. */ - get_subgizmo_selection(): PackedInt32Array - } - /** A class used by the editor to define Node3D gizmo types. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_editornode3dgizmoplugin.html - */ - class EditorNode3DGizmoPlugin extends Resource { - constructor(identifier?: any) - /** Override this method to define which Node3D nodes have a gizmo from this plugin. Whenever a [Node3D] node is added to a scene this method is called, if it returns `true` the node gets a generic [EditorNode3DGizmo] assigned and is added to this plugin's list of active gizmos. */ - /* gdvirtual */ _has_gizmo(for_node_3d: Node3D): boolean - - /** Override this method to return a custom [EditorNode3DGizmo] for the spatial nodes of your choice, return `null` for the rest of nodes. See also [method _has_gizmo]. */ - /* gdvirtual */ _create_gizmo(for_node_3d: Node3D): EditorNode3DGizmo - - /** Override this method to provide the name that will appear in the gizmo visibility menu. */ - /* gdvirtual */ _get_gizmo_name(): string - - /** Override this method to set the gizmo's priority. Gizmos with higher priority will have precedence when processing inputs like handles or subgizmos selection. - * All built-in editor gizmos return a priority of `-1`. If not overridden, this method will return `0`, which means custom gizmos will automatically get higher priority than built-in gizmos. - */ - /* gdvirtual */ _get_priority(): int64 - - /** Override this method to define whether the gizmos handled by this plugin can be hidden or not. Returns `true` if not overridden. */ - /* gdvirtual */ _can_be_hidden(): boolean - - /** Override this method to define whether Node3D with this gizmo should be selectable even when the gizmo is hidden. */ - /* gdvirtual */ _is_selectable_when_hidden(): boolean - - /** Override this method to add all the gizmo elements whenever a gizmo update is requested. It's common to call [method EditorNode3DGizmo.clear] at the beginning of this method and then add visual elements depending on the node's properties. */ - /* gdvirtual */ _redraw(gizmo: EditorNode3DGizmo): void - - /** Override this method to provide gizmo's handle names. The [param secondary] argument is `true` when the requested handle is secondary (see [method EditorNode3DGizmo.add_handles] for more information). Called for this plugin's active gizmos. */ - /* gdvirtual */ _get_handle_name(gizmo: EditorNode3DGizmo, handle_id: int64, secondary: boolean): string - - /** Override this method to return `true` whenever to given handle should be highlighted in the editor. The [param secondary] argument is `true` when the requested handle is secondary (see [method EditorNode3DGizmo.add_handles] for more information). Called for this plugin's active gizmos. */ - /* gdvirtual */ _is_handle_highlighted(gizmo: EditorNode3DGizmo, handle_id: int64, secondary: boolean): boolean - - /** Override this method to return the current value of a handle. This value will be requested at the start of an edit and used as the `restore` argument in [method _commit_handle]. - * The [param secondary] argument is `true` when the requested handle is secondary (see [method EditorNode3DGizmo.add_handles] for more information). - * Called for this plugin's active gizmos. - */ - /* gdvirtual */ _get_handle_value(gizmo: EditorNode3DGizmo, handle_id: int64, secondary: boolean): any - /* gdvirtual */ _begin_handle_action(gizmo: EditorNode3DGizmo, handle_id: int64, secondary: boolean): void - - /** Override this method to update the node's properties when the user drags a gizmo handle (previously added with [method EditorNode3DGizmo.add_handles]). The provided [param screen_pos] is the mouse position in screen coordinates and the [param camera] can be used to convert it to raycasts. - * The [param secondary] argument is `true` when the edited handle is secondary (see [method EditorNode3DGizmo.add_handles] for more information). - * Called for this plugin's active gizmos. - */ - /* gdvirtual */ _set_handle(gizmo: EditorNode3DGizmo, handle_id: int64, secondary: boolean, camera: Camera3D, screen_pos: Vector2): void - - /** Override this method to commit a handle being edited (handles must have been previously added by [method EditorNode3DGizmo.add_handles] during [method _redraw]). This usually means creating an [UndoRedo] action for the change, using the current handle value as "do" and the [param restore] argument as "undo". - * If the [param cancel] argument is `true`, the [param restore] value should be directly set, without any [UndoRedo] action. - * The [param secondary] argument is `true` when the committed handle is secondary (see [method EditorNode3DGizmo.add_handles] for more information). - * Called for this plugin's active gizmos. - */ - /* gdvirtual */ _commit_handle(gizmo: EditorNode3DGizmo, handle_id: int64, secondary: boolean, restore: any, cancel: boolean): void - - /** Override this method to allow selecting subgizmos using mouse clicks. Given a [param camera] and a [param screen_pos] in screen coordinates, this method should return which subgizmo should be selected. The returned value should be a unique subgizmo identifier, which can have any non-negative value and will be used in other virtual methods like [method _get_subgizmo_transform] or [method _commit_subgizmos]. Called for this plugin's active gizmos. */ - /* gdvirtual */ _subgizmos_intersect_ray(gizmo: EditorNode3DGizmo, camera: Camera3D, screen_pos: Vector2): int64 - - /** Override this method to allow selecting subgizmos using mouse drag box selection. Given a [param camera] and [param frustum_planes], this method should return which subgizmos are contained within the frustums. The [param frustum_planes] argument consists of an array with all the [Plane]s that make up the selection frustum. The returned value should contain a list of unique subgizmo identifiers, these identifiers can have any non-negative value and will be used in other virtual methods like [method _get_subgizmo_transform] or [method _commit_subgizmos]. Called for this plugin's active gizmos. */ - /* gdvirtual */ _subgizmos_intersect_frustum(gizmo: EditorNode3DGizmo, camera: Camera3D, frustum_planes: GArray): PackedInt32Array - - /** Override this method to return the current transform of a subgizmo. As with all subgizmo methods, the transform should be in local space respect to the gizmo's Node3D. This transform will be requested at the start of an edit and used in the `restore` argument in [method _commit_subgizmos]. Called for this plugin's active gizmos. */ - /* gdvirtual */ _get_subgizmo_transform(gizmo: EditorNode3DGizmo, subgizmo_id: int64): Transform3D - - /** Override this method to update the node properties during subgizmo editing (see [method _subgizmos_intersect_ray] and [method _subgizmos_intersect_frustum]). The [param transform] is given in the Node3D's local coordinate system. Called for this plugin's active gizmos. */ - /* gdvirtual */ _set_subgizmo_transform(gizmo: EditorNode3DGizmo, subgizmo_id: int64, transform: Transform3D): void - - /** Override this method to commit a group of subgizmos being edited (see [method _subgizmos_intersect_ray] and [method _subgizmos_intersect_frustum]). This usually means creating an [UndoRedo] action for the change, using the current transforms as "do" and the [param restores] transforms as "undo". - * If the [param cancel] argument is `true`, the [param restores] transforms should be directly set, without any [UndoRedo] action. As with all subgizmo methods, transforms are given in local space respect to the gizmo's Node3D. Called for this plugin's active gizmos. - */ - /* gdvirtual */ _commit_subgizmos(gizmo: EditorNode3DGizmo, ids: PackedInt32Array | int32[], restores: GArray, cancel: boolean): void - - /** Creates an unshaded material with its variants (selected and/or editable) and adds them to the internal material list. They can then be accessed with [method get_material] and used in [method EditorNode3DGizmo.add_mesh] and [method EditorNode3DGizmo.add_lines]. Should not be overridden. */ - create_material(name: string, color: Color, billboard: boolean = false, on_top: boolean = false, use_vertex_color: boolean = false): void - - /** Creates an icon material with its variants (selected and/or editable) and adds them to the internal material list. They can then be accessed with [method get_material] and used in [method EditorNode3DGizmo.add_unscaled_billboard]. Should not be overridden. */ - create_icon_material(name: string, texture: Texture2D, on_top: boolean = false, color: Color = new Color(1, 1, 1, 1)): void - - /** Creates a handle material with its variants (selected and/or editable) and adds them to the internal material list. They can then be accessed with [method get_material] and used in [method EditorNode3DGizmo.add_handles]. Should not be overridden. - * You can optionally provide a texture to use instead of the default icon. - */ - create_handle_material(name: string, billboard: boolean = false, texture: Texture2D = undefined): void - - /** Adds a new material to the internal material list for the plugin. It can then be accessed with [method get_material]. Should not be overridden. */ - add_material(name: string, material: StandardMaterial3D): void - - /** Gets material from the internal list of materials. If an [EditorNode3DGizmo] is provided, it will try to get the corresponding variant (selected and/or editable). */ - get_material(name: string, gizmo: EditorNode3DGizmo = undefined): StandardMaterial3D - } - class EditorOBJImporter extends EditorSceneFormatImporter { - constructor(identifier?: any) - } - class EditorObjectSelector extends Button { - constructor(identifier?: any) - } - class EditorPackedScenePreviewPlugin extends EditorResourcePreviewGenerator { - constructor(identifier?: any) - } - class EditorPaginator extends HBoxContainer { - constructor(identifier?: any) - readonly page_changed: Signal1 - } - /** Editor-only singleton that returns paths to various OS-specific data folders and files. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_editorpaths.html - */ - class EditorPaths extends Object { - constructor(identifier?: any) - /** Returns the absolute path to the user's data folder. This folder should be used for *persistent* user data files such as installed export templates. - * **Default paths per platform:** - * [codeblock lang=text] - * - Windows: %APPDATA%\Godot\ (same as `get_config_dir()`) - * - macOS: ~/Library/Application Support/Godot/ (same as `get_config_dir()`) - * - Linux: ~/.local/share/godot/ - * [/codeblock] - */ - get_data_dir(): string - - /** Returns the absolute path to the user's configuration folder. This folder should be used for *persistent* user configuration files. - * **Default paths per platform:** - * [codeblock lang=text] - * - Windows: %APPDATA%\Godot\ (same as `get_data_dir()`) - * - macOS: ~/Library/Application Support/Godot/ (same as `get_data_dir()`) - * - Linux: ~/.config/godot/ - * [/codeblock] - */ - get_config_dir(): string - - /** Returns the absolute path to the user's cache folder. This folder should be used for temporary data that can be removed safely whenever the editor is closed (such as generated resource thumbnails). - * **Default paths per platform:** - * [codeblock lang=text] - * - Windows: %LOCALAPPDATA%\Godot\ - * - macOS: ~/Library/Caches/Godot/ - * - Linux: ~/.cache/godot/ - * [/codeblock] - */ - get_cache_dir(): string - - /** Returns `true` if the editor is marked as self-contained, `false` otherwise. When self-contained mode is enabled, user configuration, data and cache files are saved in an `editor_data/` folder next to the editor binary. This makes portable usage easier and ensures the Godot editor minimizes file writes outside its own folder. Self-contained mode is not available for exported projects. - * Self-contained mode can be enabled by creating a file named `._sc_` or `_sc_` in the same folder as the editor binary or macOS .app bundle while the editor is not running. See also [method get_self_contained_file]. - * - * **Note:** On macOS, quarantine flag should be manually removed before using self-contained mode, see [url=https://docs.godotengine.org/en/stable/tutorials/export/running_on_macos.html]Running on macOS[/url]. - * - * **Note:** On macOS, placing `_sc_` or any other file inside .app bundle will break digital signature and make it non-portable, consider placing it in the same folder as the .app bundle instead. - * - * **Note:** The Steam release of Godot uses self-contained mode by default. - */ - is_self_contained(): boolean - - /** Returns the absolute path to the self-contained file that makes the current Godot editor instance be considered as self-contained. Returns an empty string if the current Godot editor instance isn't self-contained. See also [method is_self_contained]. */ - get_self_contained_file(): string - - /** Returns the project-specific editor settings path. Projects all have a unique subdirectory inside the settings path where project-specific editor settings are saved. */ - get_project_settings_dir(): string - } - class EditorPerformanceProfiler extends HSplitContainer { - constructor(identifier?: any) - } - class EditorPlainTextSyntaxHighlighter extends EditorSyntaxHighlighter { - constructor(identifier?: any) - } - namespace EditorPlugin { - enum CustomControlContainer { - /** Main editor toolbar, next to play buttons. */ - CONTAINER_TOOLBAR = 0, - - /** The toolbar that appears when 3D editor is active. */ - CONTAINER_SPATIAL_EDITOR_MENU = 1, - - /** Left sidebar of the 3D editor. */ - CONTAINER_SPATIAL_EDITOR_SIDE_LEFT = 2, - - /** Right sidebar of the 3D editor. */ - CONTAINER_SPATIAL_EDITOR_SIDE_RIGHT = 3, - - /** Bottom panel of the 3D editor. */ - CONTAINER_SPATIAL_EDITOR_BOTTOM = 4, - - /** The toolbar that appears when 2D editor is active. */ - CONTAINER_CANVAS_EDITOR_MENU = 5, - - /** Left sidebar of the 2D editor. */ - CONTAINER_CANVAS_EDITOR_SIDE_LEFT = 6, - - /** Right sidebar of the 2D editor. */ - CONTAINER_CANVAS_EDITOR_SIDE_RIGHT = 7, - - /** Bottom panel of the 2D editor. */ - CONTAINER_CANVAS_EDITOR_BOTTOM = 8, - - /** Bottom section of the inspector. */ - CONTAINER_INSPECTOR_BOTTOM = 9, - - /** Tab of Project Settings dialog, to the left of other tabs. */ - CONTAINER_PROJECT_SETTING_TAB_LEFT = 10, - - /** Tab of Project Settings dialog, to the right of other tabs. */ - CONTAINER_PROJECT_SETTING_TAB_RIGHT = 11, - } - enum DockSlot { - /** Dock slot, left side, upper-left (empty in default layout). */ - DOCK_SLOT_LEFT_UL = 0, - - /** Dock slot, left side, bottom-left (empty in default layout). */ - DOCK_SLOT_LEFT_BL = 1, - - /** Dock slot, left side, upper-right (in default layout includes Scene and Import docks). */ - DOCK_SLOT_LEFT_UR = 2, - - /** Dock slot, left side, bottom-right (in default layout includes FileSystem dock). */ - DOCK_SLOT_LEFT_BR = 3, - - /** Dock slot, right side, upper-left (in default layout includes Inspector, Node, and History docks). */ - DOCK_SLOT_RIGHT_UL = 4, - - /** Dock slot, right side, bottom-left (empty in default layout). */ - DOCK_SLOT_RIGHT_BL = 5, - - /** Dock slot, right side, upper-right (empty in default layout). */ - DOCK_SLOT_RIGHT_UR = 6, - - /** Dock slot, right side, bottom-right (empty in default layout). */ - DOCK_SLOT_RIGHT_BR = 7, - - /** Represents the size of the [enum DockSlot] enum. */ - DOCK_SLOT_MAX = 8, - } - enum AfterGUIInput { - /** Forwards the [InputEvent] to other EditorPlugins. */ - AFTER_GUI_INPUT_PASS = 0, - - /** Prevents the [InputEvent] from reaching other Editor classes. */ - AFTER_GUI_INPUT_STOP = 1, - - /** Pass the [InputEvent] to other editor plugins except the main [Node3D] one. This can be used to prevent node selection changes and work with sub-gizmos instead. */ - AFTER_GUI_INPUT_CUSTOM = 2, - } - } - /** Used by the editor to extend its functionality. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_editorplugin.html - */ - class EditorPlugin extends Node { - constructor(identifier?: any) - /** Called when there is a root node in the current edited scene, [method _handles] is implemented and an [InputEvent] happens in the 2D viewport. Intercepts the [InputEvent], if `return true` [EditorPlugin] consumes the [param event], otherwise forwards [param event] to other Editor classes. - * **Example:** - * - * Must `return false` in order to forward the [InputEvent] to other Editor classes. - * **Example:** - * - */ - /* gdvirtual */ _forward_canvas_gui_input(event: InputEvent): boolean - - /** Called by the engine when the 2D editor's viewport is updated. Use the `overlay` [Control] for drawing. You can update the viewport manually by calling [method update_overlays]. - * - */ - /* gdvirtual */ _forward_canvas_draw_over_viewport(viewport_control: Control): void - - /** This method is the same as [method _forward_canvas_draw_over_viewport], except it draws on top of everything. Useful when you need an extra layer that shows over anything else. - * You need to enable calling of this method by using [method set_force_draw_over_forwarding_enabled]. - */ - /* gdvirtual */ _forward_canvas_force_draw_over_viewport(viewport_control: Control): void - - /** Called when there is a root node in the current edited scene, [method _handles] is implemented, and an [InputEvent] happens in the 3D viewport. The return value decides whether the [InputEvent] is consumed or forwarded to other [EditorPlugin]s. See [enum AfterGUIInput] for options. - * **Example:** - * - * Must `return EditorPlugin.AFTER_GUI_INPUT_PASS` in order to forward the [InputEvent] to other Editor classes. - * **Example:** - * - */ - /* gdvirtual */ _forward_3d_gui_input(viewport_camera: Camera3D, event: InputEvent): int64 - - /** Called by the engine when the 3D editor's viewport is updated. Use the `overlay` [Control] for drawing. You can update the viewport manually by calling [method update_overlays]. - * - */ - /* gdvirtual */ _forward_3d_draw_over_viewport(viewport_control: Control): void - - /** This method is the same as [method _forward_3d_draw_over_viewport], except it draws on top of everything. Useful when you need an extra layer that shows over anything else. - * You need to enable calling of this method by using [method set_force_draw_over_forwarding_enabled]. - */ - /* gdvirtual */ _forward_3d_force_draw_over_viewport(viewport_control: Control): void - - /** Override this method in your plugin to provide the name of the plugin when displayed in the Godot editor. - * For main screen plugins, this appears at the top of the screen, to the right of the "2D", "3D", "Script", and "AssetLib" buttons. - */ - /* gdvirtual */ _get_plugin_name(): string - - /** Override this method in your plugin to return a [Texture2D] in order to give it an icon. - * For main screen plugins, this appears at the top of the screen, to the right of the "2D", "3D", "Script", and "AssetLib" buttons. - * Ideally, the plugin icon should be white with a transparent background and 16×16 pixels in size. - * - */ - /* gdvirtual */ _get_plugin_icon(): Texture2D - - /** Returns `true` if this is a main screen editor plugin (it goes in the workspace selector together with **2D**, **3D**, **Script** and **AssetLib**). - * When the plugin's workspace is selected, other main screen plugins will be hidden, but your plugin will not appear automatically. It needs to be added as a child of [method EditorInterface.get_editor_main_screen] and made visible inside [method _make_visible]. - * Use [method _get_plugin_name] and [method _get_plugin_icon] to customize the plugin button's appearance. - * - */ - /* gdvirtual */ _has_main_screen(): boolean - - /** This function will be called when the editor is requested to become visible. It is used for plugins that edit a specific object type. - * Remember that you have to manage the visibility of all your editor controls manually. - */ - /* gdvirtual */ _make_visible(visible: boolean): void - - /** This function is used for plugins that edit specific object types (nodes or resources). It requests the editor to edit the given object. - * [param object] can be `null` if the plugin was editing an object, but there is no longer any selected object handled by this plugin. It can be used to cleanup editing state. - */ - /* gdvirtual */ _edit(object: Object): void - - /** Implement this function if your plugin edits a specific type of object (Resource or Node). If you return `true`, then you will get the functions [method _edit] and [method _make_visible] called when the editor requests them. If you have declared the methods [method _forward_canvas_gui_input] and [method _forward_3d_gui_input] these will be called too. - * - * **Note:** Each plugin should handle only one type of objects at a time. If a plugin handles more types of objects and they are edited at the same time, it will result in errors. - */ - /* gdvirtual */ _handles(object: Object): boolean - - /** Override this method to provide a state data you want to be saved, like view position, grid settings, folding, etc. This is used when saving the scene (so state is kept when opening it again) and for switching tabs (so state can be restored when the tab returns). This data is automatically saved for each scene in an `editstate` file in the editor metadata folder. If you want to store global (scene-independent) editor data for your plugin, you can use [method _get_window_layout] instead. - * Use [method _set_state] to restore your saved state. - * - * **Note:** This method should not be used to save important settings that should persist with the project. - * - * **Note:** You must implement [method _get_plugin_name] for the state to be stored and restored correctly. - * - */ - /* gdvirtual */ _get_state(): GDictionary - - /** Restore the state saved by [method _get_state]. This method is called when the current scene tab is changed in the editor. - * - * **Note:** Your plugin must implement [method _get_plugin_name], otherwise it will not be recognized and this method will not be called. - * - */ - /* gdvirtual */ _set_state(state: GDictionary): void - - /** Clear all the state and reset the object being edited to zero. This ensures your plugin does not keep editing a currently existing node, or a node from the wrong scene. */ - /* gdvirtual */ _clear(): void - - /** Override this method to provide a custom message that lists unsaved changes. The editor will call this method when exiting or when closing a scene, and display the returned string in a confirmation dialog. Return empty string if the plugin has no unsaved changes. - * When closing a scene, [param for_scene] is the path to the scene being closed. You can use it to handle built-in resources in that scene. - * If the user confirms saving, [method _save_external_data] will be called, before closing the editor. - * - * If the plugin has no scene-specific changes, you can ignore the calls when closing scenes: - * - */ - /* gdvirtual */ _get_unsaved_status(for_scene: string): string - - /** This method is called after the editor saves the project or when it's closed. It asks the plugin to save edited external scenes/resources. */ - /* gdvirtual */ _save_external_data(): void - - /** This method is called when the editor is about to save the project, switch to another tab, etc. It asks the plugin to apply any pending state changes to ensure consistency. - * This is used, for example, in shader editors to let the plugin know that it must apply the shader code being written by the user to the object. - */ - /* gdvirtual */ _apply_changes(): void - - /** This is for editors that edit script-based objects. You can return a list of breakpoints in the format (`script:line`), for example: `res://path_to_script.gd:25`. */ - /* gdvirtual */ _get_breakpoints(): PackedStringArray - - /** Restore the plugin GUI layout and data saved by [method _get_window_layout]. This method is called for every plugin on editor startup. Use the provided [param configuration] file to read your saved data. - * - */ - /* gdvirtual */ _set_window_layout(configuration: ConfigFile): void - - /** Override this method to provide the GUI layout of the plugin or any other data you want to be stored. This is used to save the project's editor layout when [method queue_save_layout] is called or the editor layout was changed (for example changing the position of a dock). The data is stored in the `editor_layout.cfg` file in the editor metadata directory. - * Use [method _set_window_layout] to restore your saved layout. - * - */ - /* gdvirtual */ _get_window_layout(configuration: ConfigFile): void - - /** This method is called when the editor is about to run the project. The plugin can then perform required operations before the project runs. - * This method must return a boolean. If this method returns `false`, the project will not run. The run is aborted immediately, so this also prevents all other plugins' [method _build] methods from running. - */ - /* gdvirtual */ _build(): boolean - - /** Called by the engine when the user enables the [EditorPlugin] in the Plugin tab of the project settings window. */ - /* gdvirtual */ _enable_plugin(): void - - /** Called by the engine when the user disables the [EditorPlugin] in the Plugin tab of the project settings window. */ - /* gdvirtual */ _disable_plugin(): void - - /** Adds a custom control to a container (see [enum CustomControlContainer]). There are many locations where custom controls can be added in the editor UI. - * Please remember that you have to manage the visibility of your custom controls yourself (and likely hide it after adding it). - * When your plugin is deactivated, make sure to remove your custom control with [method remove_control_from_container] and free it with [method Node.queue_free]. - */ - add_control_to_container(container: EditorPlugin.CustomControlContainer, control: Control): void - - /** Adds a control to the bottom panel (together with Output, Debug, Animation, etc). Returns a reference to the button added. It's up to you to hide/show the button when needed. When your plugin is deactivated, make sure to remove your custom control with [method remove_control_from_bottom_panel] and free it with [method Node.queue_free]. - * Optionally, you can specify a shortcut parameter. When pressed, this shortcut will toggle the bottom panel's visibility. See the default editor bottom panel shortcuts in the Editor Settings for inspiration. Per convention, they all use [kbd]Alt[/kbd] modifier. - */ - add_control_to_bottom_panel(control: Control, title: string, shortcut: Shortcut = undefined): Button - - /** Adds the control to a specific dock slot (see [enum DockSlot] for options). - * If the dock is repositioned and as long as the plugin is active, the editor will save the dock position on further sessions. - * When your plugin is deactivated, make sure to remove your custom control with [method remove_control_from_docks] and free it with [method Node.queue_free]. - * Optionally, you can specify a shortcut parameter. When pressed, this shortcut will toggle the dock's visibility once it's moved to the bottom panel (this shortcut does not affect the dock otherwise). See the default editor bottom panel shortcuts in the Editor Settings for inspiration. Per convention, they all use [kbd]Alt[/kbd] modifier. - */ - add_control_to_dock(slot: EditorPlugin.DockSlot, control: Control, shortcut: Shortcut = undefined): void - - /** Removes the control from the dock. You have to manually [method Node.queue_free] the control. */ - remove_control_from_docks(control: Control): void - - /** Removes the control from the bottom panel. You have to manually [method Node.queue_free] the control. */ - remove_control_from_bottom_panel(control: Control): void - - /** Removes the control from the specified container. You have to manually [method Node.queue_free] the control. */ - remove_control_from_container(container: EditorPlugin.CustomControlContainer, control: Control): void - - /** Sets the tab icon for the given control in a dock slot. Setting to `null` removes the icon. */ - set_dock_tab_icon(control: Control, icon: Texture2D): void - - /** Adds a custom menu item to **Project > Tools** named [param name]. When clicked, the provided [param callable] will be called. */ - add_tool_menu_item(name: string, callable: Callable): void - - /** Adds a custom [PopupMenu] submenu under **Project > Tools >** [param name]. Use [method remove_tool_menu_item] on plugin clean up to remove the menu. */ - add_tool_submenu_item(name: string, submenu: PopupMenu): void - - /** Removes a menu [param name] from **Project > Tools**. */ - remove_tool_menu_item(name: string): void - - /** Returns the [PopupMenu] under **Scene > Export As...**. */ - get_export_as_menu(): PopupMenu - - /** Adds a custom type, which will appear in the list of nodes or resources. - * When a given node or resource is selected, the base type will be instantiated (e.g. "Node3D", "Control", "Resource"), then the script will be loaded and set to this object. - * - * **Note:** The base type is the base engine class which this type's class hierarchy inherits, not any custom type parent classes. - * You can use the virtual method [method _handles] to check if your custom object is being edited by checking the script or using the `is` keyword. - * During run-time, this will be a simple object with a script so this function does not need to be called then. - * - * **Note:** Custom types added this way are not true classes. They are just a helper to create a node with specific script. - */ - add_custom_type(type: string, base: string, script: Script, icon: Texture2D): void - - /** Removes a custom type added by [method add_custom_type]. */ - remove_custom_type(type: string): void - - /** Adds a script at [param path] to the Autoload list as [param name]. */ - add_autoload_singleton(name: string, path: string): void - - /** Removes an Autoload [param name] from the list. */ - remove_autoload_singleton(name: string): void - - /** Updates the overlays of the 2D and 3D editor viewport. Causes methods [method _forward_canvas_draw_over_viewport], [method _forward_canvas_force_draw_over_viewport], [method _forward_3d_draw_over_viewport] and [method _forward_3d_force_draw_over_viewport] to be called. */ - update_overlays(): int64 - - /** Makes a specific item in the bottom panel visible. */ - make_bottom_panel_item_visible(item: Control): void - - /** Minimizes the bottom panel. */ - hide_bottom_panel(): void - - /** Gets the undo/redo object. Most actions in the editor can be undoable, so use this object to make sure this happens when it's worth it. */ - get_undo_redo(): EditorUndoRedoManager - - /** Hooks a callback into the undo/redo action creation when a property is modified in the inspector. This allows, for example, to save other properties that may be lost when a given property is modified. - * The callback should have 4 arguments: [Object] `undo_redo`, [Object] `modified_object`, [String] `property` and [Variant] `new_value`. They are, respectively, the [UndoRedo] object used by the inspector, the currently modified object, the name of the modified property and the new value the property is about to take. - */ - add_undo_redo_inspector_hook_callback(callable: Callable): void - - /** Removes a callback previously added by [method add_undo_redo_inspector_hook_callback]. */ - remove_undo_redo_inspector_hook_callback(callable: Callable): void - - /** Queue save the project's editor layout. */ - queue_save_layout(): void - - /** Registers a custom translation parser plugin for extracting translatable strings from custom files. */ - add_translation_parser_plugin(parser: EditorTranslationParserPlugin): void - - /** Removes a custom translation parser plugin registered by [method add_translation_parser_plugin]. */ - remove_translation_parser_plugin(parser: EditorTranslationParserPlugin): void - - /** Registers a new [EditorImportPlugin]. Import plugins are used to import custom and unsupported assets as a custom [Resource] type. - * If [param first_priority] is `true`, the new import plugin is inserted first in the list and takes precedence over pre-existing plugins. - * - * **Note:** If you want to import custom 3D asset formats use [method add_scene_format_importer_plugin] instead. - * See [method add_inspector_plugin] for an example of how to register a plugin. - */ - add_import_plugin(importer: EditorImportPlugin, first_priority: boolean = false): void - - /** Removes an import plugin registered by [method add_import_plugin]. */ - remove_import_plugin(importer: EditorImportPlugin): void - - /** Registers a new [EditorSceneFormatImporter]. Scene importers are used to import custom 3D asset formats as scenes. - * If [param first_priority] is `true`, the new import plugin is inserted first in the list and takes precedence over pre-existing plugins. - */ - add_scene_format_importer_plugin(scene_format_importer: EditorSceneFormatImporter, first_priority: boolean = false): void - - /** Removes a scene format importer registered by [method add_scene_format_importer_plugin]. */ - remove_scene_format_importer_plugin(scene_format_importer: EditorSceneFormatImporter): void - - /** Add a [EditorScenePostImportPlugin]. These plugins allow customizing the import process of 3D assets by adding new options to the import dialogs. - * If [param first_priority] is `true`, the new import plugin is inserted first in the list and takes precedence over pre-existing plugins. - */ - add_scene_post_import_plugin(scene_import_plugin: EditorScenePostImportPlugin, first_priority: boolean = false): void - - /** Remove the [EditorScenePostImportPlugin], added with [method add_scene_post_import_plugin]. */ - remove_scene_post_import_plugin(scene_import_plugin: EditorScenePostImportPlugin): void - - /** Registers a new [EditorExportPlugin]. Export plugins are used to perform tasks when the project is being exported. - * See [method add_inspector_plugin] for an example of how to register a plugin. - */ - add_export_plugin(plugin: EditorExportPlugin): void - - /** Removes an export plugin registered by [method add_export_plugin]. */ - remove_export_plugin(plugin: EditorExportPlugin): void - - /** Registers a new [EditorNode3DGizmoPlugin]. Gizmo plugins are used to add custom gizmos to the 3D preview viewport for a [Node3D]. - * See [method add_inspector_plugin] for an example of how to register a plugin. - */ - add_node_3d_gizmo_plugin(plugin: EditorNode3DGizmoPlugin): void - - /** Removes a gizmo plugin registered by [method add_node_3d_gizmo_plugin]. */ - remove_node_3d_gizmo_plugin(plugin: EditorNode3DGizmoPlugin): void - - /** Registers a new [EditorInspectorPlugin]. Inspector plugins are used to extend [EditorInspector] and provide custom configuration tools for your object's properties. - * - * **Note:** Always use [method remove_inspector_plugin] to remove the registered [EditorInspectorPlugin] when your [EditorPlugin] is disabled to prevent leaks and an unexpected behavior. - * - */ - add_inspector_plugin(plugin: EditorInspectorPlugin): void - - /** Removes an inspector plugin registered by [method add_import_plugin] */ - remove_inspector_plugin(plugin: EditorInspectorPlugin): void - - /** Registers a new [EditorResourceConversionPlugin]. Resource conversion plugins are used to add custom resource converters to the editor inspector. - * See [EditorResourceConversionPlugin] for an example of how to create a resource conversion plugin. - */ - add_resource_conversion_plugin(plugin: EditorResourceConversionPlugin): void - - /** Removes a resource conversion plugin registered by [method add_resource_conversion_plugin]. */ - remove_resource_conversion_plugin(plugin: EditorResourceConversionPlugin): void - - /** Use this method if you always want to receive inputs from 3D view screen inside [method _forward_3d_gui_input]. It might be especially usable if your plugin will want to use raycast in the scene. */ - set_input_event_forwarding_always_enabled(): void - - /** Enables calling of [method _forward_canvas_force_draw_over_viewport] for the 2D editor and [method _forward_3d_force_draw_over_viewport] for the 3D editor when their viewports are updated. You need to call this method only once and it will work permanently for this plugin. */ - set_force_draw_over_forwarding_enabled(): void - - /** Returns the [EditorInterface] singleton instance. */ - get_editor_interface(): EditorInterface - - /** Gets the Editor's dialog used for making scripts. - * - * **Note:** Users can configure it before use. - * **Warning:** Removing and freeing this node will render a part of the editor useless and may cause a crash. - */ - get_script_create_dialog(): ScriptCreateDialog - - /** Adds a [Script] as debugger plugin to the Debugger. The script must extend [EditorDebuggerPlugin]. */ - add_debugger_plugin(script: EditorDebuggerPlugin): void - - /** Removes the debugger plugin with given script from the Debugger. */ - remove_debugger_plugin(script: EditorDebuggerPlugin): void - - /** Provide the version of the plugin declared in the `plugin.cfg` config file. */ - get_plugin_version(): string - - /** Emitted when the scene is changed in the editor. The argument will return the root node of the scene that has just become active. If this scene is new and empty, the argument will be `null`. */ - readonly scene_changed: Signal1 - - /** Emitted when user closes a scene. The argument is a file path to the closed scene. */ - readonly scene_closed: Signal1 - - /** Emitted when user changes the workspace (**2D**, **3D**, **Script**, **AssetLib**). Also works with custom screens defined by plugins. */ - readonly main_screen_changed: Signal1 - - /** Emitted when the given [param resource] was saved on disc. See also [signal scene_saved]. */ - readonly resource_saved: Signal1 - - /** Emitted when a scene was saved on disc. The argument is a file path to the saved scene. See also [signal resource_saved]. */ - readonly scene_saved: Signal1 - - /** Emitted when any project setting has changed. */ - readonly project_settings_changed: Signal0 - } - class EditorPluginCSG extends EditorPlugin { - constructor(identifier?: any) - } - class EditorPluginSettings extends VBoxContainer { - constructor(identifier?: any) - } - class EditorProfiler extends VBoxContainer { - constructor(identifier?: any) - readonly enable_profiling: Signal1 - readonly break_request: Signal0 - } - /** Custom control for editing properties that can be added to the [EditorInspector]. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_editorproperty.html - */ - class EditorProperty extends Container { - constructor(identifier?: any) - /** When this virtual function is called, you must update your editor. */ - /* gdvirtual */ _update_property(): void - - /** Called when the read-only status of the property is changed. It may be used to change custom controls into a read-only or modifiable state. */ - /* gdvirtual */ _set_read_only(read_only: boolean): void - - /** Gets the edited property. If your editor is for a single property (added via [method EditorInspectorPlugin._parse_property]), then this will return the property. */ - get_edited_property(): StringName - - /** Gets the edited object. */ - get_edited_object(): Object - - /** Forces refresh of the property display. */ - update_property(): void - - /** If any of the controls added can gain keyboard focus, add it here. This ensures that focus will be restored if the inspector is refreshed. */ - add_focusable(control: Control): void - - /** Puts the [param editor] control below the property label. The control must be previously added using [method Node.add_child]. */ - set_bottom_editor(editor: Control): void - - /** If one or several properties have changed, this must be called. [param field] is used in case your editor can modify fields separately (as an example, Vector3.x). The [param changing] argument avoids the editor requesting this property to be refreshed (leave as `false` if unsure). */ - emit_changed(property: StringName, value: any, field: StringName = '', changing: boolean = false): void - _update_editor_property_status(): void - - /** Set this property to change the label (if you want to show one). */ - get label(): string - set label(value: string) - - /** Used by the inspector, set to `true` when the property is read-only. */ - get read_only(): boolean - set read_only(value: boolean) - - /** Used by the inspector, set to `true` when the property is checkable. */ - get checkable(): boolean - set checkable(value: boolean) - - /** Used by the inspector, set to `true` when the property is checked. */ - get checked(): boolean - set checked(value: boolean) - - /** Used by the inspector, set to `true` when the property is drawn with the editor theme's warning color. This is used for editable children's properties. */ - get draw_warning(): boolean - set draw_warning(value: boolean) - - /** Used by the inspector, set to `true` when the property can add keys for animation. */ - get keying(): boolean - set keying(value: boolean) - - /** Used by the inspector, set to `true` when the property can be deleted by the user. */ - get deletable(): boolean - set deletable(value: boolean) - - /** Do not emit this manually, use the [method emit_changed] method instead. */ - readonly property_changed: Signal4 - - /** Emit it if you want multiple properties modified at the same time. Do not use if added via [method EditorInspectorPlugin._parse_property]. */ - readonly multiple_properties_changed: Signal2 - - /** Emit it if you want to add this value as an animation key (check for keying being enabled first). */ - readonly property_keyed: Signal1 - - /** Emitted when a property was deleted. Used internally. */ - readonly property_deleted: Signal1 - - /** Emit it if you want to key a property with a single value. */ - readonly property_keyed_with_value: Signal2 - - /** Emitted when a property was checked. Used internally. */ - readonly property_checked: Signal2 - - /** Emit it if you want to mark (or unmark) the value of a property for being saved regardless of being equal to the default value. - * The default value is the one the property will get when the node is just instantiated and can come from an ancestor scene in the inheritance/instantiation chain, a script or a builtin class. - */ - readonly property_pinned: Signal2 - - /** Emitted when the revertability (i.e., whether it has a non-default value and thus is displayed with a revert icon) of a property has changed. */ - readonly property_can_revert_changed: Signal2 - - /** If you want a sub-resource to be edited, emit this signal with the resource. */ - readonly resource_selected: Signal2 - - /** Used by sub-inspectors. Emit it if what was selected was an Object ID. */ - readonly object_id_selected: Signal2 - - /** Emitted when selected. Used internally. */ - readonly selected: Signal2 - } - class EditorPropertyArray extends EditorProperty { - constructor(identifier?: any) - } - class EditorPropertyArrayObject extends RefCounted { - constructor(identifier?: any) - } - class EditorPropertyCheck extends EditorProperty { - constructor(identifier?: any) - } - class EditorPropertyColor extends EditorProperty { - constructor(identifier?: any) - } - class EditorPropertyDictionaryObject extends RefCounted { - constructor(identifier?: any) - } - class EditorPropertyEnum extends EditorProperty { - constructor(identifier?: any) - } - class EditorPropertyFloat extends EditorProperty { - constructor(identifier?: any) - } - class EditorPropertyFontNamesArray extends EditorPropertyArray { - constructor(identifier?: any) - } - class EditorPropertyFontOTObject extends RefCounted { - constructor(identifier?: any) - } - class EditorPropertyInteger extends EditorProperty { - constructor(identifier?: any) - } - class EditorPropertyLayers extends EditorProperty { - constructor(identifier?: any) - } - class EditorPropertyLayersGrid extends Control { - constructor(identifier?: any) - readonly flag_changed: Signal1 - readonly rename_confirmed: Signal2 - } - class EditorPropertyLocale extends EditorProperty { - constructor(identifier?: any) - } - class EditorPropertyLocalizableString extends EditorProperty { - constructor(identifier?: any) - } - class EditorPropertyMultilineText extends EditorProperty { - constructor(identifier?: any) - } - class EditorPropertyNameProcessor extends Node { - constructor(identifier?: any) - } - class EditorPropertyNil extends EditorProperty { - constructor(identifier?: any) - } - class EditorPropertyNodePath extends EditorProperty { - constructor(identifier?: any) - } - class EditorPropertyOTFeatures extends EditorProperty { - constructor(identifier?: any) - } - class EditorPropertyOTVariation extends EditorProperty { - constructor(identifier?: any) - } - class EditorPropertyPath extends EditorProperty { - constructor(identifier?: any) - } - class EditorPropertyResource extends EditorProperty { - constructor(identifier?: any) - } - class EditorPropertySizeFlags extends EditorProperty { - constructor(identifier?: any) - } - class EditorPropertyText extends EditorProperty { - constructor(identifier?: any) - } - class EditorPropertyTextEnum extends EditorProperty { - constructor(identifier?: any) - } - class EditorPropertyTransform2D extends EditorProperty { - constructor(identifier?: any) - } - class EditorPropertyVector2 extends EditorPropertyVectorN { - constructor(identifier?: any) - } - class EditorPropertyVector2i extends EditorPropertyVectorN { - constructor(identifier?: any) - } - class EditorPropertyVectorN extends EditorProperty { - constructor(identifier?: any) - } - class EditorQuickOpen extends ConfirmationDialog { - constructor(identifier?: any) - readonly quick_open: Signal0 - } - /** Plugin for adding custom converters from one resource format to another in the editor resource picker context menu; for example, converting a [StandardMaterial3D] to a [ShaderMaterial]. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_editorresourceconversionplugin.html - */ - class EditorResourceConversionPlugin extends RefCounted { - constructor(identifier?: any) - /** Returns the class name of the target type of [Resource] that this plugin converts source resources to. */ - /* gdvirtual */ _converts_to(): string - - /** Called to determine whether a particular [Resource] can be converted to the target resource type by this plugin. */ - /* gdvirtual */ _handles(resource: Resource): boolean - - /** Takes an input [Resource] and converts it to the type given in [method _converts_to]. The returned [Resource] is the result of the conversion, and the input [Resource] remains unchanged. */ - /* gdvirtual */ _convert(resource: Resource): Resource - } - /** Godot editor's control for selecting [Resource] type properties. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_editorresourcepicker.html - */ - class EditorResourcePicker extends HBoxContainer { - constructor(identifier?: any) - /** This virtual method is called when updating the context menu of [EditorResourcePicker]. Implement this method to override the "New ..." items with your own options. [param menu_node] is a reference to the [PopupMenu] node. - * - * **Note:** Implement [method _handle_menu_selected] to handle these custom items. - */ - /* gdvirtual */ _set_create_options(menu_node: Object): void - - /** This virtual method can be implemented to handle context menu items not handled by default. See [method _set_create_options]. */ - /* gdvirtual */ _handle_menu_selected(id: int64): boolean - _update_resource_preview(_unnamed_arg0: string, _unnamed_arg1: Texture2D, _unnamed_arg2: Texture2D, _unnamed_arg3: int64): void - - /** Returns a list of all allowed types and subtypes corresponding to the [member base_type]. If the [member base_type] is empty, an empty list is returned. */ - get_allowed_types(): PackedStringArray - - /** Sets the toggle mode state for the main button. Works only if [member toggle_mode] is set to `true`. */ - set_toggle_pressed(pressed: boolean): void - - /** The base type of allowed resource types. Can be a comma-separated list of several options. */ - get base_type(): string - set base_type(value: string) - - /** The edited resource value. */ - get edited_resource(): Resource - set edited_resource(value: Resource) - - /** If `true`, the value can be selected and edited. */ - get editable(): boolean - set editable(value: boolean) - - /** If `true`, the main button with the resource preview works in the toggle mode. Use [method set_toggle_pressed] to manually set the state. */ - get toggle_mode(): boolean - set toggle_mode(value: boolean) - - /** Emitted when the resource value was set and user clicked to edit it. When [param inspect] is `true`, the signal was caused by the context menu "Edit" or "Inspect" option. */ - readonly resource_selected: Signal2 - - /** Emitted when the value of the edited resource was changed. */ - readonly resource_changed: Signal1 - } - /** A node used to generate previews of resources or files. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_editorresourcepreview.html - */ - class EditorResourcePreview extends Node { - constructor(identifier?: any) - /** Queue a resource file located at [param path] for preview. Once the preview is ready, the [param receiver]'s [param receiver_func] will be called. The [param receiver_func] must take the following four arguments: [String] path, [Texture2D] preview, [Texture2D] thumbnail_preview, [Variant] userdata. [param userdata] can be anything, and will be returned when [param receiver_func] is called. - * - * **Note:** If it was not possible to create the preview the [param receiver_func] will still be called, but the preview will be null. - */ - queue_resource_preview(path: string, receiver: Object, receiver_func: StringName, userdata: any): void - - /** Queue the [param resource] being edited for preview. Once the preview is ready, the [param receiver]'s [param receiver_func] will be called. The [param receiver_func] must take the following four arguments: [String] path, [Texture2D] preview, [Texture2D] thumbnail_preview, [Variant] userdata. [param userdata] can be anything, and will be returned when [param receiver_func] is called. - * - * **Note:** If it was not possible to create the preview the [param receiver_func] will still be called, but the preview will be null. - */ - queue_edited_resource_preview(resource: Resource, receiver: Object, receiver_func: StringName, userdata: any): void - - /** Create an own, custom preview generator. */ - add_preview_generator(generator: EditorResourcePreviewGenerator): void - - /** Removes a custom preview generator. */ - remove_preview_generator(generator: EditorResourcePreviewGenerator): void - - /** Check if the resource changed, if so, it will be invalidated and the corresponding signal emitted. */ - check_for_invalidation(path: string): void - - /** Emitted if a preview was invalidated (changed). [param path] corresponds to the path of the preview. */ - readonly preview_invalidated: Signal1 - } - /** Custom generator of previews. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_editorresourcepreviewgenerator.html - */ - class EditorResourcePreviewGenerator extends RefCounted { - constructor(identifier?: any) - /** Returns `true` if your generator supports the resource of type [param type]. */ - /* gdvirtual */ _handles(type: string): boolean - - /** Generate a preview from a given resource with the specified size. This must always be implemented. - * Returning an empty texture is an OK way to fail and let another generator take care. - * Care must be taken because this function is always called from a thread (not the main thread). - * [param metadata] dictionary can be modified to store file-specific metadata that can be used in [method EditorResourceTooltipPlugin._make_tooltip_for_path] (like image size, sample length etc.). - */ - /* gdvirtual */ _generate(resource: Resource, size: Vector2i, metadata: GDictionary): Texture2D - - /** Generate a preview directly from a path with the specified size. Implementing this is optional, as default code will load and call [method _generate]. - * Returning an empty texture is an OK way to fail and let another generator take care. - * Care must be taken because this function is always called from a thread (not the main thread). - * [param metadata] dictionary can be modified to store file-specific metadata that can be used in [method EditorResourceTooltipPlugin._make_tooltip_for_path] (like image size, sample length etc.). - */ - /* gdvirtual */ _generate_from_path(path: string, size: Vector2i, metadata: GDictionary): Texture2D - - /** If this function returns `true`, the generator will automatically generate the small previews from the normal preview texture generated by the methods [method _generate] or [method _generate_from_path]. - * By default, it returns `false`. - */ - /* gdvirtual */ _generate_small_preview_automatically(): boolean - - /** If this function returns `true`, the generator will call [method _generate] or [method _generate_from_path] for small previews as well. - * By default, it returns `false`. - */ - /* gdvirtual */ _can_generate_small_preview(): boolean - } - /** A plugin that advanced tooltip for its handled resource type. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_editorresourcetooltipplugin.html - */ - class EditorResourceTooltipPlugin extends RefCounted { - constructor(identifier?: any) - /** Return `true` if the plugin is going to handle the given [Resource] [param type]. */ - /* gdvirtual */ _handles(type: string): boolean - - /** Create and return a tooltip that will be displayed when the user hovers a resource under the given [param path] in filesystem dock. - * The [param metadata] dictionary is provided by preview generator (see [method EditorResourcePreviewGenerator._generate]). - * [param base] is the base default tooltip, which is a [VBoxContainer] with a file name, type and size labels. If another plugin handled the same file type, [param base] will be output from the previous plugin. For best result, make sure the base tooltip is part of the returned [Control]. - * - * **Note:** It's unadvised to use [method ResourceLoader.load], especially with heavy resources like models or textures, because it will make the editor unresponsive when creating the tooltip. You can use [method request_thumbnail] if you want to display a preview in your tooltip. - * - * **Note:** If you decide to discard the [param base], make sure to call [method Node.queue_free], because it's not freed automatically. - * - */ - /* gdvirtual */ _make_tooltip_for_path(path: string, metadata: GDictionary, base: Control): Control - _thumbnail_ready(_unnamed_arg0: string, _unnamed_arg1: Texture2D, _unnamed_arg2: Texture2D, _unnamed_arg3: any): void - - /** Requests a thumbnail for the given [TextureRect]. The thumbnail is created asynchronously by [EditorResourcePreview] and automatically set when available. */ - request_thumbnail(path: string, control: TextureRect): void - } - class EditorRunBar extends MarginContainer { - constructor(identifier?: any) - readonly play_pressed: Signal0 - readonly stop_pressed: Signal0 - } - class EditorRunNative extends HBoxContainer { - constructor(identifier?: any) - readonly native_run: Signal1 - } - class EditorSceneExporterGLTFSettings extends RefCounted { - constructor(identifier?: any) - get copyright(): string - set copyright(value: string) - get bake_fps(): float64 - set bake_fps(value: float64) - } - /** Imports scenes from third-parties' 3D files. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_editorsceneformatimporter.html - */ - class EditorSceneFormatImporter extends RefCounted { - static readonly IMPORT_SCENE = 1 - static readonly IMPORT_ANIMATION = 2 - static readonly IMPORT_FAIL_ON_MISSING_DEPENDENCIES = 4 - static readonly IMPORT_GENERATE_TANGENT_ARRAYS = 8 - static readonly IMPORT_USE_NAMED_SKIN_BINDS = 16 - static readonly IMPORT_DISCARD_MESHES_AND_MATERIALS = 32 - static readonly IMPORT_FORCE_DISABLE_MESH_COMPRESSION = 64 - constructor(identifier?: any) - /* gdvirtual */ _get_import_flags(): int64 - /* gdvirtual */ _get_extensions(): PackedStringArray - /* gdvirtual */ _import_scene(path: string, flags: int64, options: GDictionary): Object - /* gdvirtual */ _get_import_options(path: string): void - /* gdvirtual */ _get_option_visibility(path: string, for_animation: boolean, option: string): any - } - /** Importer for Blender's `.blend` scene file format. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_editorsceneformatimporterblend.html - */ - class EditorSceneFormatImporterBlend extends EditorSceneFormatImporter { - constructor(identifier?: any) - } - class EditorSceneFormatImporterCollada extends EditorSceneFormatImporter { - constructor(identifier?: any) - } - class EditorSceneFormatImporterESCN extends EditorSceneFormatImporter { - constructor(identifier?: any) - } - /** Importer for the `.fbx` scene file format. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_editorsceneformatimporterfbx2gltf.html - */ - class EditorSceneFormatImporterFBX2GLTF extends EditorSceneFormatImporter { - constructor(identifier?: any) - } - /** @link https://docs.godotengine.org/en/4.3/classes/class_editorsceneformatimportergltf.html */ - class EditorSceneFormatImporterGLTF extends EditorSceneFormatImporter { - constructor(identifier?: any) - } - /** Import FBX files using the ufbx library. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_editorsceneformatimporterufbx.html - */ - class EditorSceneFormatImporterUFBX extends EditorSceneFormatImporter { - constructor(identifier?: any) - } - /** Post-processes scenes after import. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_editorscenepostimport.html - */ - class EditorScenePostImport extends RefCounted { - constructor(identifier?: any) - /** Called after the scene was imported. This method must return the modified version of the scene. */ - /* gdvirtual */ _post_import(scene: Node): Object - - /** Returns the source file path which got imported (e.g. `res://scene.dae`). */ - get_source_file(): string - } - namespace EditorScenePostImportPlugin { - enum InternalImportCategory { - INTERNAL_IMPORT_CATEGORY_NODE = 0, - INTERNAL_IMPORT_CATEGORY_MESH_3D_NODE = 1, - INTERNAL_IMPORT_CATEGORY_MESH = 2, - INTERNAL_IMPORT_CATEGORY_MATERIAL = 3, - INTERNAL_IMPORT_CATEGORY_ANIMATION = 4, - INTERNAL_IMPORT_CATEGORY_ANIMATION_NODE = 5, - INTERNAL_IMPORT_CATEGORY_SKELETON_3D_NODE = 6, - INTERNAL_IMPORT_CATEGORY_MAX = 7, - } - } - /** Plugin to control and modifying the process of importing a scene. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_editorscenepostimportplugin.html - */ - class EditorScenePostImportPlugin extends RefCounted { - constructor(identifier?: any) - /** Override to add internal import options. These will appear in the 3D scene import dialog. Add options via [method add_import_option] and [method add_import_option_advanced]. */ - /* gdvirtual */ _get_internal_import_options(category: int64): void - - /** Return true or false whether a given option should be visible. Return null to ignore. */ - /* gdvirtual */ _get_internal_option_visibility(category: int64, for_animation: boolean, option: string): any - - /** Return true whether updating the 3D view of the import dialog needs to be updated if an option has changed. */ - /* gdvirtual */ _get_internal_option_update_view_required(category: int64, option: string): any - - /** Process a specific node or resource for a given category. */ - /* gdvirtual */ _internal_process(category: int64, base_node: Node, node: Node, resource: Resource): void - - /** Override to add general import options. These will appear in the main import dock on the editor. Add options via [method add_import_option] and [method add_import_option_advanced]. */ - /* gdvirtual */ _get_import_options(path: string): void - - /** Return true or false whether a given option should be visible. Return null to ignore. */ - /* gdvirtual */ _get_option_visibility(path: string, for_animation: boolean, option: string): any - - /** Pre Process the scene. This function is called right after the scene format loader loaded the scene and no changes have been made. */ - /* gdvirtual */ _pre_process(scene: Node): void - - /** Post process the scene. This function is called after the final scene has been configured. */ - /* gdvirtual */ _post_process(scene: Node): void - - /** Query the value of an option. This function can only be called from those querying visibility, or processing. */ - get_option_value(name: StringName): any - - /** Add a specific import option (name and default value only). This function can only be called from [method _get_import_options] and [method _get_internal_import_options]. */ - add_import_option(name: string, value: any): void - - /** Add a specific import option. This function can only be called from [method _get_import_options] and [method _get_internal_import_options]. */ - add_import_option_advanced(type: Variant.Type, name: string, default_value: any, hint: PropertyHint = 0, hint_string: string = '', usage_flags: int64 = 6): void - } - class EditorSceneTabs extends MarginContainer { - constructor(identifier?: any) - _tab_preview_done(_unnamed_arg0: string, _unnamed_arg1: Texture2D, _unnamed_arg2: Texture2D, _unnamed_arg3: any): void - readonly tab_changed: Signal1 - readonly tab_closed: Signal1 - } - /** Base script that can be used to add extension functions to the editor. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_editorscript.html - */ - class EditorScript extends RefCounted { - constructor(identifier?: any) - /** This method is executed by the Editor when **File > Run** is used. */ - /* gdvirtual */ _run(): void - - /** Makes [param node] root of the currently opened scene. Only works if the scene is empty. If the [param node] is a scene instance, an inheriting scene will be created. */ - add_root_node(node: Node): void - - /** Returns the edited (current) scene's root [Node]. Equivalent of [method EditorInterface.get_edited_scene_root]. */ - get_scene(): Node - - /** Returns the [EditorInterface] singleton instance. */ - get_editor_interface(): EditorInterface - } - /** Godot editor's control for selecting the `script` property of a [Node]. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_editorscriptpicker.html - */ - class EditorScriptPicker extends EditorResourcePicker { - constructor(identifier?: any) - /** The owner [Node] of the script property that holds the edited resource. */ - get script_owner(): Node - set script_owner(value: Node) - } - class EditorScriptPreviewPlugin extends EditorResourcePreviewGenerator { - constructor(identifier?: any) - } - /** Manages the SceneTree selection in the editor. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_editorselection.html - */ - class EditorSelection extends Object { - constructor(identifier?: any) - /** Clear the selection. */ - clear(): void - - /** Adds a node to the selection. - * - * **Note:** The newly selected node will not be automatically edited in the inspector. If you want to edit a node, use [method EditorInterface.edit_node]. - */ - add_node(node: Node): void - - /** Removes a node from the selection. */ - remove_node(node: Node): void - - /** Returns the list of selected nodes. */ - get_selected_nodes(): GArray - - /** Returns the list of selected nodes, optimized for transform operations (i.e. moving them, rotating, etc.). This list can be used to avoid situations where a node is selected and is also a child/grandchild. */ - get_transformable_selected_nodes(): GArray - - /** Emitted when the selection changes. */ - readonly selection_changed: Signal0 - } - /** Object that holds the project-independent editor settings. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_editorsettings.html - */ - class EditorSettings extends Resource { - /** Emitted after any editor setting has changed. It's used by various editor plugins to update their visuals on theme changes or logic on configuration changes. */ - static readonly NOTIFICATION_EDITOR_SETTINGS_CHANGED = 10000 - constructor(identifier?: any) - - /** Returns `true` if the setting specified by [param name] exists, `false` otherwise. */ - has_setting(name: string): boolean - - /** Sets the [param value] of the setting specified by [param name]. This is equivalent to using [method Object.set] on the EditorSettings instance. */ - set_setting(name: string, value: any): void - - /** Returns the value of the setting specified by [param name]. This is equivalent to using [method Object.get] on the EditorSettings instance. */ - get_setting(name: string): any - - /** Erases the setting whose name is specified by [param property]. */ - erase(property: string): void - - /** Sets the initial value of the setting specified by [param name] to [param value]. This is used to provide a value for the Revert button in the Editor Settings. If [param update_current] is true, the current value of the setting will be set to [param value] as well. */ - set_initial_value(name: StringName, value: any, update_current: boolean): void - - /** Adds a custom property info to a property. The dictionary must contain: - * - `name`: [String] (the name of the property) - * - `type`: [int] (see [enum Variant.Type]) - * - optionally `hint`: [int] (see [enum PropertyHint]) and `hint_string`: [String] - * **Example:** - * - */ - add_property_info(info: GDictionary): void - - /** Sets project-specific metadata with the [param section], [param key] and [param data] specified. This metadata is stored outside the project folder and therefore won't be checked into version control. See also [method get_project_metadata]. */ - set_project_metadata(section: string, key: string, data: any): void - - /** Returns project-specific metadata for the [param section] and [param key] specified. If the metadata doesn't exist, [param default] will be returned instead. See also [method set_project_metadata]. */ - get_project_metadata(section: string, key: string, default_: any = {}): any - - /** Sets the list of favorite files and directories for this project. */ - set_favorites(dirs: PackedStringArray | string[]): void - - /** Returns the list of favorite files and directories for this project. */ - get_favorites(): PackedStringArray - - /** Sets the list of recently visited folders in the file dialog for this project. */ - set_recent_dirs(dirs: PackedStringArray | string[]): void - - /** Returns the list of recently visited folders in the file dialog for this project. */ - get_recent_dirs(): PackedStringArray - - /** Overrides the built-in editor action [param name] with the input actions defined in [param actions_list]. */ - set_builtin_action_override(name: string, actions_list: GArray): void - - /** Checks if any settings with the prefix [param setting_prefix] exist in the set of changed settings. See also [method get_changed_settings]. */ - check_changed_settings_in_group(setting_prefix: string): boolean - - /** Gets an array of the settings which have been changed since the last save. Note that internally `changed_settings` is cleared after a successful save, so generally the most appropriate place to use this method is when processing [constant NOTIFICATION_EDITOR_SETTINGS_CHANGED]. */ - get_changed_settings(): PackedStringArray - - /** Marks the passed editor setting as being changed, see [method get_changed_settings]. Only settings which exist (see [method has_setting]) will be accepted. */ - mark_setting_changed(setting: string): void - - /** Emitted after any editor setting has changed. */ - readonly settings_changed: Signal0 - } - class EditorSettingsDialog extends AcceptDialog { - constructor(identifier?: any) - _update_shortcuts(): void - _settings_changed(): void - } - /** Godot editor's control for editing numeric values. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_editorspinslider.html - */ - class EditorSpinSlider extends Range { - constructor(identifier?: any) - /** The text that displays to the left of the value. */ - get label(): string - set label(value: string) - - /** The suffix to display after the value (in a faded color). This should generally be a plural word. You may have to use an abbreviation if the suffix is too long to be displayed. */ - get suffix(): string - set suffix(value: string) - - /** If `true`, the slider can't be interacted with. */ - get read_only(): boolean - set read_only(value: boolean) - - /** If `true`, the slider will not draw background. */ - get flat(): boolean - set flat(value: boolean) - - /** If `true`, the slider and up/down arrows are hidden. */ - get hide_slider(): boolean - set hide_slider(value: boolean) - - /** Emitted when the spinner/slider is grabbed. */ - readonly grabbed: Signal0 - - /** Emitted when the spinner/slider is ungrabbed. */ - readonly ungrabbed: Signal0 - - /** Emitted when the value form gains focus. */ - readonly value_focus_entered: Signal0 - - /** Emitted when the value form loses focus. */ - readonly value_focus_exited: Signal0 - } - class EditorStandardSyntaxHighlighter extends EditorSyntaxHighlighter { - constructor(identifier?: any) - } - /** Base class for [SyntaxHighlighter] used by the [ScriptEditor]. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_editorsyntaxhighlighter.html - */ - class EditorSyntaxHighlighter extends SyntaxHighlighter { - constructor(identifier?: any) - /** Virtual method which can be overridden to return the syntax highlighter name. */ - /* gdvirtual */ _get_name(): string - - /** Virtual method which can be overridden to return the supported language names. */ - /* gdvirtual */ _get_supported_languages(): PackedStringArray - _get_edited_resource(): RefCounted - } - class EditorTexturePreviewPlugin extends EditorResourcePreviewGenerator { - constructor(identifier?: any) - } - class EditorTextureTooltipPlugin extends EditorResourceTooltipPlugin { - constructor(identifier?: any) - } - class EditorTheme extends Theme { - constructor(identifier?: any) - } - class EditorTitleBar extends HBoxContainer { - constructor(identifier?: any) - } - class EditorToaster extends HBoxContainer { - constructor(identifier?: any) - } - /** Plugin for adding custom parsers to extract strings that are to be translated from custom files (.csv, .json etc.). - * - * @link https://docs.godotengine.org/en/4.3/classes/class_editortranslationparserplugin.html - */ - class EditorTranslationParserPlugin extends RefCounted { - constructor(identifier?: any) - /** Override this method to define a custom parsing logic to extract the translatable strings. */ - /* gdvirtual */ _parse_file(path: string, msgids: GArray, msgids_context_plural: GArray): void - - /** Gets the list of file extensions to associate with this parser, e.g. `["csv"]`. */ - /* gdvirtual */ _get_recognized_extensions(): PackedStringArray - } - namespace EditorUndoRedoManager { - enum SpecialHistory { - /** Global history not associated with any scene, but with external resources etc. */ - GLOBAL_HISTORY = 0, - - /** History associated with remote inspector. Used when live editing a running project. */ - REMOTE_HISTORY = -9, - - /** Invalid "null" history. It's a special value, not associated with any object. */ - INVALID_HISTORY = -99, - } - } - /** Manages undo history of scenes opened in the editor. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_editorundoredomanager.html - */ - class EditorUndoRedoManager extends Object { - constructor(identifier?: any) - /** Create a new action. After this is called, do all your calls to [method add_do_method], [method add_undo_method], [method add_do_property], and [method add_undo_property], then commit the action with [method commit_action]. - * The way actions are merged is dictated by the [param merge_mode] argument. See [enum UndoRedo.MergeMode] for details. - * If [param custom_context] object is provided, it will be used for deducing target history (instead of using the first operation). - * The way undo operation are ordered in actions is dictated by [param backward_undo_ops]. When [param backward_undo_ops] is `false` undo option are ordered in the same order they were added. Which means the first operation to be added will be the first to be undone. - */ - create_action(name: string, merge_mode: UndoRedo.MergeMode = 0, custom_context: Object = undefined, backward_undo_ops: boolean = false): void - - /** Commit the action. If [param execute] is true (default), all "do" methods/properties are called/set when this function is called. */ - commit_action(execute: boolean = true): void - - /** Returns `true` if the [EditorUndoRedoManager] is currently committing the action, i.e. running its "do" method or property change (see [method commit_action]). */ - is_committing_action(): boolean - - /** Forces the next operation (e.g. [method add_do_method]) to use the action's history rather than guessing it from the object. This is sometimes needed when a history can't be correctly determined, like for a nested resource that doesn't have a path yet. - * This method should only be used when absolutely necessary, otherwise it might cause invalid history state. For most of complex cases, the `custom_context` parameter of [method create_action] is sufficient. - */ - force_fixed_history(): void - - /** Register a method that will be called when the action is committed (i.e. the "do" action). - * If this is the first operation, the [param object] will be used to deduce target undo history. - */ - add_do_method(object: Object, method: StringName, ...vargargs: any[]): void - - /** Register a method that will be called when the action is undone (i.e. the "undo" action). - * If this is the first operation, the [param object] will be used to deduce target undo history. - */ - add_undo_method(object: Object, method: StringName, ...vargargs: any[]): void - - /** Register a property value change for "do". - * If this is the first operation, the [param object] will be used to deduce target undo history. - */ - add_do_property(object: Object, property: StringName, value: any): void - - /** Register a property value change for "undo". - * If this is the first operation, the [param object] will be used to deduce target undo history. - */ - add_undo_property(object: Object, property: StringName, value: any): void - - /** Register a reference for "do" that will be erased if the "do" history is lost. This is useful mostly for new nodes created for the "do" call. Do not use for resources. */ - add_do_reference(object: Object): void - - /** Register a reference for "undo" that will be erased if the "undo" history is lost. This is useful mostly for nodes removed with the "do" call (not the "undo" call!). */ - add_undo_reference(object: Object): void - - /** Returns the history ID deduced from the given [param object]. It can be used with [method get_history_undo_redo]. */ - get_object_history_id(object: Object): int64 - - /** Returns the [UndoRedo] object associated with the given history [param id]. - * [param id] above `0` are mapped to the opened scene tabs (but it doesn't match their order). [param id] of `0` or lower have special meaning (see [enum SpecialHistory]). - * Best used with [method get_object_history_id]. This method is only provided in case you need some more advanced methods of [UndoRedo] (but keep in mind that directly operating on the [UndoRedo] object might affect editor's stability). - */ - get_history_undo_redo(id: int64): UndoRedo - - /** Emitted when the list of actions in any history has changed, either when an action is committed or a history is cleared. */ - readonly history_changed: Signal0 - - /** Emitted when the version of any history has changed as a result of undo or redo call. */ - readonly version_changed: Signal0 - } - namespace EditorVCSInterface { - enum ChangeType { - /** A new file has been added. */ - CHANGE_TYPE_NEW = 0, - - /** An earlier added file has been modified. */ - CHANGE_TYPE_MODIFIED = 1, - - /** An earlier added file has been renamed. */ - CHANGE_TYPE_RENAMED = 2, - - /** An earlier added file has been deleted. */ - CHANGE_TYPE_DELETED = 3, - - /** An earlier added file has been typechanged. */ - CHANGE_TYPE_TYPECHANGE = 4, - - /** A file is left unmerged. */ - CHANGE_TYPE_UNMERGED = 5, - } - enum TreeArea { - /** A commit is encountered from the commit area. */ - TREE_AREA_COMMIT = 0, - - /** A file is encountered from the staged area. */ - TREE_AREA_STAGED = 1, - - /** A file is encountered from the unstaged area. */ - TREE_AREA_UNSTAGED = 2, - } - } - /** Version Control System (VCS) interface, which reads and writes to the local VCS in use. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_editorvcsinterface.html - */ - class EditorVCSInterface extends Object { - constructor(identifier?: any) - /** Initializes the VCS plugin when called from the editor. Returns whether or not the plugin was successfully initialized. A VCS project is initialized at [param project_path]. */ - /* gdvirtual */ _initialize(project_path: string): boolean - - /** Set user credentials in the underlying VCS. [param username] and [param password] are used only during HTTPS authentication unless not already mentioned in the remote URL. [param ssh_public_key_path], [param ssh_private_key_path], and [param ssh_passphrase] are only used during SSH authentication. */ - /* gdvirtual */ _set_credentials(username: string, password: string, ssh_public_key_path: string, ssh_private_key_path: string, ssh_passphrase: string): void - - /** Returns an [Array] of [Dictionary] items (see [method create_status_file]), each containing the status data of every modified file in the project folder. */ - /* gdvirtual */ _get_modified_files_data(): GArray - - /** Stages the file present at [param file_path] to the staged area. */ - /* gdvirtual */ _stage_file(file_path: string): void - - /** Unstages the file present at [param file_path] from the staged area to the unstaged area. */ - /* gdvirtual */ _unstage_file(file_path: string): void - - /** Discards the changes made in a file present at [param file_path]. */ - /* gdvirtual */ _discard_file(file_path: string): void - - /** Commits the currently staged changes and applies the commit [param msg] to the resulting commit. */ - /* gdvirtual */ _commit(msg: string): void - - /** Returns an array of [Dictionary] items (see [method create_diff_file], [method create_diff_hunk], [method create_diff_line], [method add_line_diffs_into_diff_hunk] and [method add_diff_hunks_into_diff_file]), each containing information about a diff. If [param identifier] is a file path, returns a file diff, and if it is a commit identifier, then returns a commit diff. */ - /* gdvirtual */ _get_diff(identifier: string, area: int64): GArray - - /** Shuts down VCS plugin instance. Called when the user either closes the editor or shuts down the VCS plugin through the editor UI. */ - /* gdvirtual */ _shut_down(): boolean - - /** Returns the name of the underlying VCS provider. */ - /* gdvirtual */ _get_vcs_name(): string - - /** Returns an [Array] of [Dictionary] items (see [method create_commit]), each containing the data for a past commit. */ - /* gdvirtual */ _get_previous_commits(max_commits: int64): GArray - - /** Gets an instance of an [Array] of [String]s containing available branch names in the VCS. */ - /* gdvirtual */ _get_branch_list(): GArray - - /** Returns an [Array] of [String]s, each containing the name of a remote configured in the VCS. */ - /* gdvirtual */ _get_remotes(): GArray - - /** Creates a new branch named [param branch_name] in the VCS. */ - /* gdvirtual */ _create_branch(branch_name: string): void - - /** Remove a branch from the local VCS. */ - /* gdvirtual */ _remove_branch(branch_name: string): void - - /** Creates a new remote destination with name [param remote_name] and points it to [param remote_url]. This can be an HTTPS remote or an SSH remote. */ - /* gdvirtual */ _create_remote(remote_name: string, remote_url: string): void - - /** Remove a remote from the local VCS. */ - /* gdvirtual */ _remove_remote(remote_name: string): void - - /** Gets the current branch name defined in the VCS. */ - /* gdvirtual */ _get_current_branch_name(): string - - /** Checks out a [param branch_name] in the VCS. */ - /* gdvirtual */ _checkout_branch(branch_name: string): boolean - - /** Pulls changes from the remote. This can give rise to merge conflicts. */ - /* gdvirtual */ _pull(remote: string): void - - /** Pushes changes to the [param remote]. If [param force] is `true`, a force push will override the change history already present on the remote. */ - /* gdvirtual */ _push(remote: string, force: boolean): void - - /** Fetches new changes from the [param remote], but doesn't write changes to the current working directory. Equivalent to `git fetch`. */ - /* gdvirtual */ _fetch(remote: string): void - - /** Returns an [Array] of [Dictionary] items (see [method create_diff_hunk]), each containing a line diff between a file at [param file_path] and the [param text] which is passed in. */ - /* gdvirtual */ _get_line_diff(file_path: string, text: string): GArray - - /** Helper function to create a [Dictionary] for storing a line diff. [param new_line_no] is the line number in the new file (can be `-1` if the line is deleted). [param old_line_no] is the line number in the old file (can be `-1` if the line is added). [param content] is the diff text. [param status] is a single character string which stores the line origin. */ - create_diff_line(new_line_no: int64, old_line_no: int64, content: string, status: string): GDictionary - - /** Helper function to create a [Dictionary] for storing diff hunk data. [param old_start] is the starting line number in old file. [param new_start] is the starting line number in new file. [param old_lines] is the number of lines in the old file. [param new_lines] is the number of lines in the new file. */ - create_diff_hunk(old_start: int64, new_start: int64, old_lines: int64, new_lines: int64): GDictionary - - /** Helper function to create a [Dictionary] for storing old and new diff file paths. */ - create_diff_file(new_file: string, old_file: string): GDictionary - - /** Helper function to create a commit [Dictionary] item. [param msg] is the commit message of the commit. [param author] is a single human-readable string containing all the author's details, e.g. the email and name configured in the VCS. [param id] is the identifier of the commit, in whichever format your VCS may provide an identifier to commits. [param unix_timestamp] is the UTC Unix timestamp of when the commit was created. [param offset_minutes] is the timezone offset in minutes, recorded from the system timezone where the commit was created. */ - create_commit(msg: string, author: string, id: string, unix_timestamp: int64, offset_minutes: int64): GDictionary - - /** Helper function to create a [Dictionary] used by editor to read the status of a file. */ - create_status_file(file_path: string, change_type: EditorVCSInterface.ChangeType, area: EditorVCSInterface.TreeArea): GDictionary - - /** Helper function to add an array of [param diff_hunks] into a [param diff_file]. */ - add_diff_hunks_into_diff_file(diff_file: GDictionary, diff_hunks: GArray): GDictionary - - /** Helper function to add an array of [param line_diffs] into a [param diff_hunk]. */ - add_line_diffs_into_diff_hunk(diff_hunk: GDictionary, line_diffs: GArray): GDictionary - - /** Pops up an error message in the editor which is shown as coming from the underlying VCS. Use this to show VCS specific error messages. */ - popup_error(msg: string): void - } - class EditorValidationPanel extends PanelContainer { - constructor(identifier?: any) - } - class EditorVisualProfiler extends VBoxContainer { - constructor(identifier?: any) - readonly enable_profiling: Signal1 - } - class EditorZoomWidget extends HBoxContainer { - constructor(identifier?: any) - set_zoom_by_increments(increment: int64, integer_only: boolean): void - get zoom(): float64 - set zoom(value: float64) - readonly zoom_changed: Signal1 - } - /** Holds a reference to an [Object]'s instance ID. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_encodedobjectasid.html - */ - class EncodedObjectAsID extends RefCounted { - constructor(identifier?: any) - /** The [Object] identifier stored in this [EncodedObjectAsID] instance. The object instance can be retrieved with [method @GlobalScope.instance_from_id]. */ - get object_id(): int64 - set object_id(value: int64) - } - /** Base class for creating custom profilers. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_engineprofiler.html - */ - class EngineProfiler extends RefCounted { - constructor(identifier?: any) - /** Called when the profiler is enabled/disabled, along with a set of [param options]. */ - /* gdvirtual */ _toggle(enable: boolean, options: GArray): void - - /** Called when data is added to profiler using [method EngineDebugger.profiler_add_frame_data]. */ - /* gdvirtual */ _add_frame(data: GArray): void - - /** Called once every engine iteration when the profiler is active with information about the current frame. All time values are in seconds. Lower values represent faster processing times and are therefore considered better. */ - /* gdvirtual */ _tick(frame_time: float64, process_time: float64, physics_time: float64, physics_frame_time: float64): void - } - namespace Environment { - enum BGMode { - /** Clears the background using the clear color defined in [member ProjectSettings.rendering/environment/defaults/default_clear_color]. */ - BG_CLEAR_COLOR = 0, - - /** Clears the background using a custom clear color. */ - BG_COLOR = 1, - - /** Displays a user-defined sky in the background. */ - BG_SKY = 2, - - /** Displays a [CanvasLayer] in the background. */ - BG_CANVAS = 3, - - /** Keeps on screen every pixel drawn in the background. This is the fastest background mode, but it can only be safely used in fully-interior scenes (no visible sky or sky reflections). If enabled in a scene where the background is visible, "ghost trail" artifacts will be visible when moving the camera. */ - BG_KEEP = 4, - - /** Displays a camera feed in the background. */ - BG_CAMERA_FEED = 5, - - /** Represents the size of the [enum BGMode] enum. */ - BG_MAX = 6, - } - enum AmbientSource { - /** Gather ambient light from whichever source is specified as the background. */ - AMBIENT_SOURCE_BG = 0, - - /** Disable ambient light. This provides a slight performance boost over [constant AMBIENT_SOURCE_SKY]. */ - AMBIENT_SOURCE_DISABLED = 1, - - /** Specify a specific [Color] for ambient light. This provides a slight performance boost over [constant AMBIENT_SOURCE_SKY]. */ - AMBIENT_SOURCE_COLOR = 2, - - /** Gather ambient light from the [Sky] regardless of what the background is. */ - AMBIENT_SOURCE_SKY = 3, - } - enum ReflectionSource { - /** Use the background for reflections. */ - REFLECTION_SOURCE_BG = 0, - - /** Disable reflections. This provides a slight performance boost over other options. */ - REFLECTION_SOURCE_DISABLED = 1, - - /** Use the [Sky] for reflections regardless of what the background is. */ - REFLECTION_SOURCE_SKY = 2, - } - enum ToneMapper { - /** Linear tonemapper operator. Reads the linear data and passes it on unmodified. This can cause bright lighting to look blown out, with noticeable clipping in the output colors. */ - TONE_MAPPER_LINEAR = 0, - - /** Reinhardt tonemapper operator. Performs a variation on rendered pixels' colors by this formula: `color = color / (1 + color)`. This avoids clipping bright highlights, but the resulting image can look a bit dull. */ - TONE_MAPPER_REINHARDT = 1, - - /** Filmic tonemapper operator. This avoids clipping bright highlights, with a resulting image that usually looks more vivid than [constant TONE_MAPPER_REINHARDT]. */ - TONE_MAPPER_FILMIC = 2, - - /** Use the Academy Color Encoding System tonemapper. ACES is slightly more expensive than other options, but it handles bright lighting in a more realistic fashion by desaturating it as it becomes brighter. ACES typically has a more contrasted output compared to [constant TONE_MAPPER_REINHARDT] and [constant TONE_MAPPER_FILMIC]. - * - * **Note:** This tonemapping operator is called "ACES Fitted" in Godot 3.x. - */ - TONE_MAPPER_ACES = 3, - } - enum GlowBlendMode { - /** Additive glow blending mode. Mostly used for particles, glows (bloom), lens flare, bright sources. */ - GLOW_BLEND_MODE_ADDITIVE = 0, - - /** Screen glow blending mode. Increases brightness, used frequently with bloom. */ - GLOW_BLEND_MODE_SCREEN = 1, - - /** Soft light glow blending mode. Modifies contrast, exposes shadows and highlights (vivid bloom). */ - GLOW_BLEND_MODE_SOFTLIGHT = 2, - - /** Replace glow blending mode. Replaces all pixels' color by the glow value. This can be used to simulate a full-screen blur effect by tweaking the glow parameters to match the original image's brightness. */ - GLOW_BLEND_MODE_REPLACE = 3, - - /** Mixes the glow with the underlying color to avoid increasing brightness as much while still maintaining a glow effect. */ - GLOW_BLEND_MODE_MIX = 4, - } - enum FogMode { - /** Use a physically-based fog model defined primarily by fog density. */ - FOG_MODE_EXPONENTIAL = 0, - - /** Use a simple fog model defined by start and end positions and a custom curve. While not physically accurate, this model can be useful when you need more artistic control. */ - FOG_MODE_DEPTH = 1, - } - enum SDFGIYScale { - /** Use 50% scale for SDFGI on the Y (vertical) axis. SDFGI cells will be twice as short as they are wide. This allows providing increased GI detail and reduced light leaking with thin floors and ceilings. This is usually the best choice for scenes that don't feature much verticality. */ - SDFGI_Y_SCALE_50_PERCENT = 0, - - /** Use 75% scale for SDFGI on the Y (vertical) axis. This is a balance between the 50% and 100% SDFGI Y scales. */ - SDFGI_Y_SCALE_75_PERCENT = 1, - - /** Use 100% scale for SDFGI on the Y (vertical) axis. SDFGI cells will be as tall as they are wide. This is usually the best choice for highly vertical scenes. The downside is that light leaking may become more noticeable with thin floors and ceilings. */ - SDFGI_Y_SCALE_100_PERCENT = 2, - } - } - /** Resource for environment nodes (like [WorldEnvironment]) that define multiple rendering options. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_environment.html - */ - class Environment extends Resource { - constructor(identifier?: any) - /** Sets the intensity of the glow level [param idx]. A value above `0.0` enables the level. Each level relies on the previous level. This means that enabling higher glow levels will slow down the glow effect rendering, even if previous levels aren't enabled. */ - set_glow_level(idx: int64, intensity: float64): void - - /** Returns the intensity of the glow level [param idx]. */ - get_glow_level(idx: int64): float64 - - /** The background mode. See [enum BGMode] for possible values. */ - get background_mode(): int64 - set background_mode(value: int64) - - /** The [Color] displayed for clear areas of the scene. Only effective when using the [constant BG_COLOR] background mode. */ - get background_color(): Color - set background_color(value: Color) - - /** Multiplier for background energy. Increase to make background brighter, decrease to make background dimmer. */ - get background_energy_multiplier(): float64 - set background_energy_multiplier(value: float64) - - /** Luminance of background measured in nits (candela per square meter). Only used when [member ProjectSettings.rendering/lights_and_shadows/use_physical_light_units] is enabled. The default value is roughly equivalent to the sky at midday. */ - get background_intensity(): float64 - set background_intensity(value: float64) - - /** The maximum layer ID to display. Only effective when using the [constant BG_CANVAS] background mode. */ - get background_canvas_max_layer(): int64 - set background_canvas_max_layer(value: int64) - - /** The ID of the camera feed to show in the background. */ - get background_camera_feed_id(): int64 - set background_camera_feed_id(value: int64) - - /** The [Sky] resource used for this [Environment]. */ - get sky(): Sky - set sky(value: Sky) - - /** If set to a value greater than `0.0`, overrides the field of view to use for sky rendering. If set to `0.0`, the same FOV as the current [Camera3D] is used for sky rendering. */ - get sky_custom_fov(): float64 - set sky_custom_fov(value: float64) - - /** The rotation to use for sky rendering. */ - get sky_rotation(): Vector3 - set sky_rotation(value: Vector3) - - /** The ambient light source to use for rendering materials and global illumination. */ - get ambient_light_source(): int64 - set ambient_light_source(value: int64) - - /** The ambient light's [Color]. Only effective if [member ambient_light_sky_contribution] is lower than `1.0` (exclusive). */ - get ambient_light_color(): Color - set ambient_light_color(value: Color) - - /** Defines the amount of light that the sky brings on the scene. A value of `0.0` means that the sky's light emission has no effect on the scene illumination, thus all ambient illumination is provided by the ambient light. On the contrary, a value of `1.0` means that *all* the light that affects the scene is provided by the sky, thus the ambient light parameter has no effect on the scene. - * - * **Note:** [member ambient_light_sky_contribution] is internally clamped between `0.0` and `1.0` (inclusive). - */ - get ambient_light_sky_contribution(): float64 - set ambient_light_sky_contribution(value: float64) - - /** The ambient light's energy. The higher the value, the stronger the light. Only effective if [member ambient_light_sky_contribution] is lower than `1.0` (exclusive). */ - get ambient_light_energy(): float64 - set ambient_light_energy(value: float64) - - /** The reflected (specular) light source. */ - get reflected_light_source(): int64 - set reflected_light_source(value: int64) - - /** The tonemapping mode to use. Tonemapping is the process that "converts" HDR values to be suitable for rendering on an LDR display. (Godot doesn't support rendering on HDR displays yet.) */ - get tonemap_mode(): int64 - set tonemap_mode(value: int64) - - /** The default exposure used for tonemapping. Higher values result in a brighter image. See also [member tonemap_white]. */ - get tonemap_exposure(): float64 - set tonemap_exposure(value: float64) - - /** The white reference value for tonemapping (also called "whitepoint"). Higher values can make highlights look less blown out, and will also slightly darken the whole scene as a result. Only effective if the [member tonemap_mode] isn't set to [constant TONE_MAPPER_LINEAR]. See also [member tonemap_exposure]. */ - get tonemap_white(): float64 - set tonemap_white(value: float64) - - /** If `true`, screen-space reflections are enabled. Screen-space reflections are more accurate than reflections from [VoxelGI]s or [ReflectionProbe]s, but are slower and can't reflect surfaces occluded by others. - * - * **Note:** SSR is only supported in the Forward+ rendering method, not Mobile or Compatibility. - */ - get ssr_enabled(): boolean - set ssr_enabled(value: boolean) - - /** The maximum number of steps for screen-space reflections. Higher values are slower. */ - get ssr_max_steps(): int64 - set ssr_max_steps(value: int64) - - /** The fade-in distance for screen-space reflections. Affects the area from the reflected material to the screen-space reflection. Only positive values are valid (negative values will be clamped to `0.0`). */ - get ssr_fade_in(): float64 - set ssr_fade_in(value: float64) - - /** The fade-out distance for screen-space reflections. Affects the area from the screen-space reflection to the "global" reflection. Only positive values are valid (negative values will be clamped to `0.0`). */ - get ssr_fade_out(): float64 - set ssr_fade_out(value: float64) - - /** The depth tolerance for screen-space reflections. */ - get ssr_depth_tolerance(): float64 - set ssr_depth_tolerance(value: float64) - - /** If `true`, the screen-space ambient occlusion effect is enabled. This darkens objects' corners and cavities to simulate ambient light not reaching the entire object as in real life. This works well for small, dynamic objects, but baked lighting or ambient occlusion textures will do a better job at displaying ambient occlusion on large static objects. Godot uses a form of SSAO called Adaptive Screen Space Ambient Occlusion which is itself a form of Horizon Based Ambient Occlusion. - * - * **Note:** SSAO is only supported in the Forward+ rendering method, not Mobile or Compatibility. - */ - get ssao_enabled(): boolean - set ssao_enabled(value: boolean) - - /** The distance at which objects can occlude each other when calculating screen-space ambient occlusion. Higher values will result in occlusion over a greater distance at the cost of performance and quality. */ - get ssao_radius(): float64 - set ssao_radius(value: float64) - - /** The primary screen-space ambient occlusion intensity. Acts as a multiplier for the screen-space ambient occlusion effect. A higher value results in darker occlusion. */ - get ssao_intensity(): float64 - set ssao_intensity(value: float64) - - /** The distribution of occlusion. A higher value results in darker occlusion, similar to [member ssao_intensity], but with a sharper falloff. */ - get ssao_power(): float64 - set ssao_power(value: float64) - - /** Sets the strength of the additional level of detail for the screen-space ambient occlusion effect. A high value makes the detail pass more prominent, but it may contribute to aliasing in your final image. */ - get ssao_detail(): float64 - set ssao_detail(value: float64) - - /** The threshold for considering whether a given point on a surface is occluded or not represented as an angle from the horizon mapped into the `0.0-1.0` range. A value of `1.0` results in no occlusion. */ - get ssao_horizon(): float64 - set ssao_horizon(value: float64) - - /** The amount that the screen-space ambient occlusion effect is allowed to blur over the edges of objects. Setting too high will result in aliasing around the edges of objects. Setting too low will make object edges appear blurry. */ - get ssao_sharpness(): float64 - set ssao_sharpness(value: float64) - - /** The screen-space ambient occlusion intensity in direct light. In real life, ambient occlusion only applies to indirect light, which means its effects can't be seen in direct light. Values higher than `0` will make the SSAO effect visible in direct light. */ - get ssao_light_affect(): float64 - set ssao_light_affect(value: float64) - - /** The screen-space ambient occlusion intensity on materials that have an AO texture defined. Values higher than `0` will make the SSAO effect visible in areas darkened by AO textures. */ - get ssao_ao_channel_affect(): float64 - set ssao_ao_channel_affect(value: float64) - - /** If `true`, the screen-space indirect lighting effect is enabled. Screen space indirect lighting is a form of indirect lighting that allows diffuse light to bounce between nearby objects. Screen-space indirect lighting works very similarly to screen-space ambient occlusion, in that it only affects a limited range. It is intended to be used along with a form of proper global illumination like SDFGI or [VoxelGI]. Screen-space indirect lighting is not affected by individual light's [member Light3D.light_indirect_energy]. - * - * **Note:** SSIL is only supported in the Forward+ rendering method, not Mobile or Compatibility. - */ - get ssil_enabled(): boolean - set ssil_enabled(value: boolean) - - /** The distance that bounced lighting can travel when using the screen space indirect lighting effect. A larger value will result in light bouncing further in a scene, but may result in under-sampling artifacts which look like long spikes surrounding light sources. */ - get ssil_radius(): float64 - set ssil_radius(value: float64) - - /** The brightness multiplier for the screen-space indirect lighting effect. A higher value will result in brighter light. */ - get ssil_intensity(): float64 - set ssil_intensity(value: float64) - - /** The amount that the screen-space indirect lighting effect is allowed to blur over the edges of objects. Setting too high will result in aliasing around the edges of objects. Setting too low will make object edges appear blurry. */ - get ssil_sharpness(): float64 - set ssil_sharpness(value: float64) - - /** Amount of normal rejection used when calculating screen-space indirect lighting. Normal rejection uses the normal of a given sample point to reject samples that are facing away from the current pixel. Normal rejection is necessary to avoid light leaking when only one side of an object is illuminated. However, normal rejection can be disabled if light leaking is desirable, such as when the scene mostly contains emissive objects that emit light from faces that cannot be seen from the camera. */ - get ssil_normal_rejection(): float64 - set ssil_normal_rejection(value: float64) - - /** If `true`, enables signed distance field global illumination for meshes that have their [member GeometryInstance3D.gi_mode] set to [constant GeometryInstance3D.GI_MODE_STATIC]. SDFGI is a real-time global illumination technique that works well with procedurally generated and user-built levels, including in situations where geometry is created during gameplay. The signed distance field is automatically generated around the camera as it moves. Dynamic lights are supported, but dynamic occluders and emissive surfaces are not. - * - * **Note:** SDFGI is only supported in the Forward+ rendering method, not Mobile or Compatibility. - * **Performance:** SDFGI is relatively demanding on the GPU and is not suited to low-end hardware such as integrated graphics (consider [LightmapGI] instead). To improve SDFGI performance, enable [member ProjectSettings.rendering/global_illumination/gi/use_half_resolution] in the Project Settings. - * - * **Note:** Meshes should have sufficiently thick walls to avoid light leaks (avoid one-sided walls). For interior levels, enclose your level geometry in a sufficiently large box and bridge the loops to close the mesh. - */ - get sdfgi_enabled(): boolean - set sdfgi_enabled(value: boolean) - - /** If `true`, SDFGI uses an occlusion detection approach to reduce light leaking. Occlusion may however introduce dark blotches in certain spots, which may be undesired in mostly outdoor scenes. [member sdfgi_use_occlusion] has a performance impact and should only be enabled when needed. */ - get sdfgi_use_occlusion(): boolean - set sdfgi_use_occlusion(value: boolean) - - /** If `true`, SDFGI takes the environment lighting into account. This should be set to `false` for interior scenes. */ - get sdfgi_read_sky_light(): boolean - set sdfgi_read_sky_light(value: boolean) - - /** The energy multiplier applied to light every time it bounces from a surface when using SDFGI. Values greater than `0.0` will simulate multiple bounces, resulting in a more realistic appearance. Increasing [member sdfgi_bounce_feedback] generally has no performance impact. See also [member sdfgi_energy]. - * - * **Note:** Values greater than `0.5` can cause infinite feedback loops and should be avoided in scenes with bright materials. - * - * **Note:** If [member sdfgi_bounce_feedback] is `0.0`, indirect lighting will not be represented in reflections as light will only bounce one time. - */ - get sdfgi_bounce_feedback(): float64 - set sdfgi_bounce_feedback(value: float64) - - /** The number of cascades to use for SDFGI (between 1 and 8). A higher number of cascades allows displaying SDFGI further away while preserving detail up close, at the cost of performance. When using SDFGI on small-scale levels, [member sdfgi_cascades] can often be decreased between `1` and `4` to improve performance. */ - get sdfgi_cascades(): int64 - set sdfgi_cascades(value: int64) - - /** The cell size to use for the closest SDFGI cascade (in 3D units). Lower values allow SDFGI to be more precise up close, at the cost of making SDFGI updates more demanding. This can cause stuttering when the camera moves fast. Higher values allow SDFGI to cover more ground, while also reducing the performance impact of SDFGI updates. - * - * **Note:** This property is linked to [member sdfgi_max_distance] and [member sdfgi_cascade0_distance]. Changing its value will automatically change those properties as well. - */ - get sdfgi_min_cell_size(): float64 - set sdfgi_min_cell_size(value: float64) - - /** - * **Note:** This property is linked to [member sdfgi_min_cell_size] and [member sdfgi_max_distance]. Changing its value will automatically change those properties as well. - */ - get sdfgi_cascade0_distance(): float64 - set sdfgi_cascade0_distance(value: float64) - - /** The maximum distance at which SDFGI is visible. Beyond this distance, environment lighting or other sources of GI such as [ReflectionProbe] will be used as a fallback. - * - * **Note:** This property is linked to [member sdfgi_min_cell_size] and [member sdfgi_cascade0_distance]. Changing its value will automatically change those properties as well. - */ - get sdfgi_max_distance(): float64 - set sdfgi_max_distance(value: float64) - - /** The Y scale to use for SDFGI cells. Lower values will result in SDFGI cells being packed together more closely on the Y axis. This is used to balance between quality and covering a lot of vertical ground. [member sdfgi_y_scale] should be set depending on how vertical your scene is (and how fast your camera may move on the Y axis). */ - get sdfgi_y_scale(): int64 - set sdfgi_y_scale(value: int64) - - /** The energy multiplier to use for SDFGI. Higher values will result in brighter indirect lighting and reflections. See also [member sdfgi_bounce_feedback]. */ - get sdfgi_energy(): float64 - set sdfgi_energy(value: float64) - - /** The normal bias to use for SDFGI probes. Increasing this value can reduce visible streaking artifacts on sloped surfaces, at the cost of increased light leaking. */ - get sdfgi_normal_bias(): float64 - set sdfgi_normal_bias(value: float64) - - /** The constant bias to use for SDFGI probes. Increasing this value can reduce visible streaking artifacts on sloped surfaces, at the cost of increased light leaking. */ - get sdfgi_probe_bias(): float64 - set sdfgi_probe_bias(value: float64) - - /** If `true`, the glow effect is enabled. This simulates real world eye/camera behavior where bright pixels bleed onto surrounding pixels. - * - * **Note:** When using the Mobile rendering method, glow looks different due to the lower dynamic range available in the Mobile rendering method. - * - * **Note:** When using the Compatibility rendering method, glow uses a different implementation with some properties being unavailable and hidden from the inspector: `glow_levels/*`, [member glow_normalized], [member glow_strength], [member glow_blend_mode], [member glow_mix], [member glow_map], and [member glow_map_strength]. This implementation is optimized to run on low-end devices and is less flexible as a result. - */ - get glow_enabled(): boolean - set glow_enabled(value: boolean) - - /** If `true`, glow levels will be normalized so that summed together their intensities equal `1.0`. - * - * **Note:** [member glow_normalized] has no effect when using the Compatibility rendering method, due to this rendering method using a simpler glow implementation optimized for low-end devices. - */ - get glow_normalized(): boolean - set glow_normalized(value: boolean) - - /** The overall brightness multiplier of the glow effect. When using the Mobile rendering method (which only supports a lower dynamic range up to `2.0`), this should be increased to `1.5` to compensate. */ - get glow_intensity(): float64 - set glow_intensity(value: float64) - - /** The strength of the glow effect. This applies as the glow is blurred across the screen and increases the distance and intensity of the blur. When using the Mobile rendering method, this should be increased to compensate for the lower dynamic range. - * - * **Note:** [member glow_strength] has no effect when using the Compatibility rendering method, due to this rendering method using a simpler glow implementation optimized for low-end devices. - */ - get glow_strength(): float64 - set glow_strength(value: float64) - - /** When using the [constant GLOW_BLEND_MODE_MIX] [member glow_blend_mode], this controls how much the source image is blended with the glow layer. A value of `0.0` makes the glow rendering invisible, while a value of `1.0` is equivalent to [constant GLOW_BLEND_MODE_REPLACE]. - * - * **Note:** [member glow_mix] has no effect when using the Compatibility rendering method, due to this rendering method using a simpler glow implementation optimized for low-end devices. - */ - get glow_mix(): float64 - set glow_mix(value: float64) - - /** The bloom's intensity. If set to a value higher than `0`, this will make glow visible in areas darker than the [member glow_hdr_threshold]. */ - get glow_bloom(): float64 - set glow_bloom(value: float64) - - /** The glow blending mode. - * - * **Note:** [member glow_blend_mode] has no effect when using the Compatibility rendering method, due to this rendering method using a simpler glow implementation optimized for low-end devices. - */ - get glow_blend_mode(): int64 - set glow_blend_mode(value: int64) - - /** The lower threshold of the HDR glow. When using the Mobile rendering method (which only supports a lower dynamic range up to `2.0`), this may need to be below `1.0` for glow to be visible. A value of `0.9` works well in this case. This value also needs to be decreased below `1.0` when using glow in 2D, as 2D rendering is performed in SDR. */ - get glow_hdr_threshold(): float64 - set glow_hdr_threshold(value: float64) - - /** The bleed scale of the HDR glow. */ - get glow_hdr_scale(): float64 - set glow_hdr_scale(value: float64) - - /** The higher threshold of the HDR glow. Areas brighter than this threshold will be clamped for the purposes of the glow effect. */ - get glow_hdr_luminance_cap(): float64 - set glow_hdr_luminance_cap(value: float64) - - /** How strong of an impact the [member glow_map] should have on the overall glow effect. A strength of `0.0` means the glow map has no effect on the overall glow effect. A strength of `1.0` means the glow has a full effect on the overall glow effect (and can turn off glow entirely in specific areas of the screen if the glow map has black areas). - * - * **Note:** [member glow_map_strength] has no effect when using the Compatibility rendering method, due to this rendering method using a simpler glow implementation optimized for low-end devices. - */ - get glow_map_strength(): float64 - set glow_map_strength(value: float64) - - /** The texture that should be used as a glow map to *multiply* the resulting glow color according to [member glow_map_strength]. This can be used to create a "lens dirt" effect. The texture's RGB color channels are used for modulation, but the alpha channel is ignored. - * - * **Note:** The texture will be stretched to fit the screen. Therefore, it's recommended to use a texture with an aspect ratio that matches your project's base aspect ratio (typically 16:9). - * - * **Note:** [member glow_map] has no effect when using the Compatibility rendering method, due to this rendering method using a simpler glow implementation optimized for low-end devices. - */ - get glow_map(): Texture2D - set glow_map(value: Texture2D) - - /** If `true`, fog effects are enabled. */ - get fog_enabled(): boolean - set fog_enabled(value: boolean) - - /** The fog mode. See [enum FogMode] for possible values. */ - get fog_mode(): int64 - set fog_mode(value: int64) - - /** The fog's color. */ - get fog_light_color(): Color - set fog_light_color(value: Color) - - /** The fog's brightness. Higher values result in brighter fog. */ - get fog_light_energy(): float64 - set fog_light_energy(value: float64) - - /** If set above `0.0`, renders the scene's directional light(s) in the fog color depending on the view angle. This can be used to give the impression that the sun is "piercing" through the fog. */ - get fog_sun_scatter(): float64 - set fog_sun_scatter(value: float64) - - /** The fog density to be used. This is demonstrated in different ways depending on the [member fog_mode] mode chosen: - * **Exponential Fog Mode:** Higher values result in denser fog. The fog rendering is exponential like in real life. - * **Depth Fog mode:** The maximum intensity of the deep fog, effect will appear in the distance (relative to the camera). At `1.0` the fog will fully obscure the scene, at `0.0` the fog will not be visible. - */ - get fog_density(): float64 - set fog_density(value: float64) - - /** If set above `0.0` (exclusive), blends between the fog's color and the color of the background [Sky]. This has a small performance cost when set above `0.0`. Must have [member background_mode] set to [constant BG_SKY]. - * This is useful to simulate [url=https://en.wikipedia.org/wiki/Aerial_perspective]aerial perspective[/url] in large scenes with low density fog. However, it is not very useful for high-density fog, as the sky will shine through. When set to `1.0`, the fog color comes completely from the [Sky]. If set to `0.0`, aerial perspective is disabled. - */ - get fog_aerial_perspective(): float64 - set fog_aerial_perspective(value: float64) - - /** The factor to use when affecting the sky with non-volumetric fog. `1.0` means that fog can fully obscure the sky. Lower values reduce the impact of fog on sky rendering, with `0.0` not affecting sky rendering at all. - * - * **Note:** [member fog_sky_affect] has no visual effect if [member fog_aerial_perspective] is `1.0`. - */ - get fog_sky_affect(): float64 - set fog_sky_affect(value: float64) - - /** The height at which the height fog effect begins. */ - get fog_height(): float64 - set fog_height(value: float64) - - /** The density used to increase fog as height decreases. To make fog increase as height increases, use a negative value. */ - get fog_height_density(): float64 - set fog_height_density(value: float64) - - /** The fog depth's intensity curve. A number of presets are available in the Inspector by right-clicking the curve. Only available when [member fog_mode] is set to [constant FOG_MODE_DEPTH]. */ - get fog_depth_curve(): float64 - set fog_depth_curve(value: float64) - - /** The fog's depth starting distance from the camera. Only available when [member fog_mode] is set to [constant FOG_MODE_DEPTH]. */ - get fog_depth_begin(): float64 - set fog_depth_begin(value: float64) - - /** The fog's depth end distance from the camera. If this value is set to `0`, it will be equal to the current camera's [member Camera3D.far] value. Only available when [member fog_mode] is set to [constant FOG_MODE_DEPTH]. */ - get fog_depth_end(): float64 - set fog_depth_end(value: float64) - - /** Enables the volumetric fog effect. Volumetric fog uses a screen-aligned froxel buffer to calculate accurate volumetric scattering in the short to medium range. Volumetric fog interacts with [FogVolume]s and lights to calculate localized and global fog. Volumetric fog uses a PBR single-scattering model based on extinction, scattering, and emission which it exposes to users as density, albedo, and emission. - * - * **Note:** Volumetric fog is only supported in the Forward+ rendering method, not Mobile or Compatibility. - */ - get volumetric_fog_enabled(): boolean - set volumetric_fog_enabled(value: boolean) - - /** The base *exponential* density of the volumetric fog. Set this to the lowest density you want to have globally. [FogVolume]s can be used to add to or subtract from this density in specific areas. Fog rendering is exponential as in real life. - * A value of `0.0` disables global volumetric fog while allowing [FogVolume]s to display volumetric fog in specific areas. - * To make volumetric fog work as a volumetric *lighting* solution, set [member volumetric_fog_density] to the lowest non-zero value (`0.0001`) then increase lights' [member Light3D.light_volumetric_fog_energy] to values between `10000` and `100000` to compensate for the very low density. - */ - get volumetric_fog_density(): float64 - set volumetric_fog_density(value: float64) - - /** The [Color] of the volumetric fog when interacting with lights. Mist and fog have an albedo close to `Color(1, 1, 1, 1)` while smoke has a darker albedo. */ - get volumetric_fog_albedo(): Color - set volumetric_fog_albedo(value: Color) - - /** The emitted light from the volumetric fog. Even with emission, volumetric fog will not cast light onto other surfaces. Emission is useful to establish an ambient color. As the volumetric fog effect uses single-scattering only, fog tends to need a little bit of emission to soften the harsh shadows. */ - get volumetric_fog_emission(): Color - set volumetric_fog_emission(value: Color) - - /** The brightness of the emitted light from the volumetric fog. */ - get volumetric_fog_emission_energy(): float64 - set volumetric_fog_emission_energy(value: float64) - - /** Scales the strength of Global Illumination used in the volumetric fog's albedo color. A value of `0.0` means that Global Illumination will not impact the volumetric fog. [member volumetric_fog_gi_inject] has a small performance cost when set above `0.0`. - * - * **Note:** This has no visible effect if [member volumetric_fog_density] is `0.0` or if [member volumetric_fog_albedo] is a fully black color. - * - * **Note:** Only [VoxelGI] and SDFGI ([member Environment.sdfgi_enabled]) are taken into account when using [member volumetric_fog_gi_inject]. Global illumination from [LightmapGI], [ReflectionProbe] and SSIL (see [member ssil_enabled]) will be ignored by volumetric fog. - */ - get volumetric_fog_gi_inject(): float64 - set volumetric_fog_gi_inject(value: float64) - - /** The direction of scattered light as it goes through the volumetric fog. A value close to `1.0` means almost all light is scattered forward. A value close to `0.0` means light is scattered equally in all directions. A value close to `-1.0` means light is scattered mostly backward. Fog and mist scatter light slightly forward, while smoke scatters light equally in all directions. */ - get volumetric_fog_anisotropy(): float64 - set volumetric_fog_anisotropy(value: float64) - - /** The distance over which the volumetric fog is computed. Increase to compute fog over a greater range, decrease to add more detail when a long range is not needed. For best quality fog, keep this as low as possible. See also [member ProjectSettings.rendering/environment/volumetric_fog/volume_depth]. */ - get volumetric_fog_length(): float64 - set volumetric_fog_length(value: float64) - - /** The distribution of size down the length of the froxel buffer. A higher value compresses the froxels closer to the camera and places more detail closer to the camera. */ - get volumetric_fog_detail_spread(): float64 - set volumetric_fog_detail_spread(value: float64) - - /** Scales the strength of ambient light used in the volumetric fog. A value of `0.0` means that ambient light will not impact the volumetric fog. [member volumetric_fog_ambient_inject] has a small performance cost when set above `0.0`. - * - * **Note:** This has no visible effect if [member volumetric_fog_density] is `0.0` or if [member volumetric_fog_albedo] is a fully black color. - */ - get volumetric_fog_ambient_inject(): float64 - set volumetric_fog_ambient_inject(value: float64) - - /** The factor to use when affecting the sky with volumetric fog. `1.0` means that volumetric fog can fully obscure the sky. Lower values reduce the impact of volumetric fog on sky rendering, with `0.0` not affecting sky rendering at all. - * - * **Note:** [member volumetric_fog_sky_affect] also affects [FogVolume]s, even if [member volumetric_fog_density] is `0.0`. If you notice [FogVolume]s are disappearing when looking towards the sky, set [member volumetric_fog_sky_affect] to `1.0`. - */ - get volumetric_fog_sky_affect(): float64 - set volumetric_fog_sky_affect(value: float64) - - /** Enables temporal reprojection in the volumetric fog. Temporal reprojection blends the current frame's volumetric fog with the last frame's volumetric fog to smooth out jagged edges. The performance cost is minimal; however, it leads to moving [FogVolume]s and [Light3D]s "ghosting" and leaving a trail behind them. When temporal reprojection is enabled, try to avoid moving [FogVolume]s or [Light3D]s too fast. Short-lived dynamic lighting effects should have [member Light3D.light_volumetric_fog_energy] set to `0.0` to avoid ghosting. */ - get volumetric_fog_temporal_reprojection_enabled(): boolean - set volumetric_fog_temporal_reprojection_enabled(value: boolean) - - /** The amount by which to blend the last frame with the current frame. A higher number results in smoother volumetric fog, but makes "ghosting" much worse. A lower value reduces ghosting but can result in the per-frame temporal jitter becoming visible. */ - get volumetric_fog_temporal_reprojection_amount(): float64 - set volumetric_fog_temporal_reprojection_amount(value: float64) - - /** If `true`, enables the `adjustment_*` properties provided by this resource. If `false`, modifications to the `adjustment_*` properties will have no effect on the rendered scene. */ - get adjustment_enabled(): boolean - set adjustment_enabled(value: boolean) - - /** The global brightness value of the rendered scene. Effective only if [member adjustment_enabled] is `true`. */ - get adjustment_brightness(): float64 - set adjustment_brightness(value: float64) - - /** The global contrast value of the rendered scene (default value is 1). Effective only if [member adjustment_enabled] is `true`. */ - get adjustment_contrast(): float64 - set adjustment_contrast(value: float64) - - /** The global color saturation value of the rendered scene (default value is 1). Effective only if [member adjustment_enabled] is `true`. */ - get adjustment_saturation(): float64 - set adjustment_saturation(value: float64) - - /** The [Texture2D] or [Texture3D] lookup table (LUT) to use for the built-in post-process color grading. Can use a [GradientTexture1D] for a 1-dimensional LUT, or a [Texture3D] for a more complex LUT. Effective only if [member adjustment_enabled] is `true`. */ - get adjustment_color_correction(): Texture2D | Texture3D - set adjustment_color_correction(value: Texture2D | Texture3D) - } - class EventListenerLineEdit extends LineEdit { - constructor(identifier?: any) - readonly event_changed: Signal1 - } - class ExportTemplateManager extends AcceptDialog { - constructor(identifier?: any) - } - /** A class that stores an expression you can execute. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_expression.html - */ - class Expression extends RefCounted { - constructor(identifier?: any) - /** Parses the expression and returns an [enum Error] code. - * You can optionally specify names of variables that may appear in the expression with [param input_names], so that you can bind them when it gets executed. - */ - parse(expression: string, input_names: PackedStringArray | string[] = []): GError - - /** Executes the expression that was previously parsed by [method parse] and returns the result. Before you use the returned object, you should check if the method failed by calling [method has_execute_failed]. - * If you defined input variables in [method parse], you can specify their values in the inputs array, in the same order. - */ - execute(inputs: GArray = [], base_instance: Object = undefined, show_error: boolean = true, const_calls_only: boolean = false): any - - /** Returns `true` if [method execute] has failed. */ - has_execute_failed(): boolean - - /** Returns the error text if [method parse] or [method execute] has failed. */ - get_error_text(): string - } - /** Handles FBX documents. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_fbxdocument.html - */ - class FBXDocument extends GLTFDocument { - constructor(identifier?: any) - } - class FBXImporterManager extends ConfirmationDialog { - constructor(identifier?: any) - } - /** @link https://docs.godotengine.org/en/4.3/classes/class_fbxstate.html */ - class FBXState extends GLTFState { - constructor(identifier?: any) - /** If `true`, the import process used auxiliary nodes called geometry helper nodes. These nodes help preserve the pivots and transformations of the original 3D model during import. */ - get allow_geometry_helper_nodes(): boolean - set allow_geometry_helper_nodes(value: boolean) - } - namespace FastNoiseLite { - enum NoiseType { - /** A lattice of points are assigned random values then interpolated based on neighboring values. */ - TYPE_VALUE = 5, - - /** Similar to Value noise, but slower. Has more variance in peaks and valleys. - * Cubic noise can be used to avoid certain artifacts when using value noise to create a bumpmap. In general, you should always use this mode if the value noise is being used for a heightmap or bumpmap. - */ - TYPE_VALUE_CUBIC = 4, - - /** A lattice of random gradients. Their dot products are interpolated to obtain values in between the lattices. */ - TYPE_PERLIN = 3, - - /** Cellular includes both Worley noise and Voronoi diagrams which creates various regions of the same value. */ - TYPE_CELLULAR = 2, - - /** As opposed to [constant TYPE_PERLIN], gradients exist in a simplex lattice rather than a grid lattice, avoiding directional artifacts. */ - TYPE_SIMPLEX = 0, - - /** Modified, higher quality version of [constant TYPE_SIMPLEX], but slower. */ - TYPE_SIMPLEX_SMOOTH = 1, - } - enum FractalType { - /** No fractal noise. */ - FRACTAL_NONE = 0, - - /** Method using Fractional Brownian Motion to combine octaves into a fractal. */ - FRACTAL_FBM = 1, - - /** Method of combining octaves into a fractal resulting in a "ridged" look. */ - FRACTAL_RIDGED = 2, - - /** Method of combining octaves into a fractal with a ping pong effect. */ - FRACTAL_PING_PONG = 3, - } - enum CellularDistanceFunction { - /** Euclidean distance to the nearest point. */ - DISTANCE_EUCLIDEAN = 0, - - /** Squared Euclidean distance to the nearest point. */ - DISTANCE_EUCLIDEAN_SQUARED = 1, - - /** Manhattan distance (taxicab metric) to the nearest point. */ - DISTANCE_MANHATTAN = 2, - - /** Blend of [constant DISTANCE_EUCLIDEAN] and [constant DISTANCE_MANHATTAN] to give curved cell boundaries */ - DISTANCE_HYBRID = 3, - } - enum CellularReturnType { - /** The cellular distance function will return the same value for all points within a cell. */ - RETURN_CELL_VALUE = 0, - - /** The cellular distance function will return a value determined by the distance to the nearest point. */ - RETURN_DISTANCE = 1, - - /** The cellular distance function returns the distance to the second-nearest point. */ - RETURN_DISTANCE2 = 2, - - /** The distance to the nearest point is added to the distance to the second-nearest point. */ - RETURN_DISTANCE2_ADD = 3, - - /** The distance to the nearest point is subtracted from the distance to the second-nearest point. */ - RETURN_DISTANCE2_SUB = 4, - - /** The distance to the nearest point is multiplied with the distance to the second-nearest point. */ - RETURN_DISTANCE2_MUL = 5, - - /** The distance to the nearest point is divided by the distance to the second-nearest point. */ - RETURN_DISTANCE2_DIV = 6, - } - enum DomainWarpType { - /** The domain is warped using the simplex noise algorithm. */ - DOMAIN_WARP_SIMPLEX = 0, - - /** The domain is warped using a simplified version of the simplex noise algorithm. */ - DOMAIN_WARP_SIMPLEX_REDUCED = 1, - - /** The domain is warped using a simple noise grid (not as smooth as the other methods, but more performant). */ - DOMAIN_WARP_BASIC_GRID = 2, - } - enum DomainWarpFractalType { - /** No fractal noise for warping the space. */ - DOMAIN_WARP_FRACTAL_NONE = 0, - - /** Warping the space progressively, octave for octave, resulting in a more "liquified" distortion. */ - DOMAIN_WARP_FRACTAL_PROGRESSIVE = 1, - - /** Warping the space independently for each octave, resulting in a more chaotic distortion. */ - DOMAIN_WARP_FRACTAL_INDEPENDENT = 2, - } - } - /** Generates noise using the FastNoiseLite library. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_fastnoiselite.html - */ - class FastNoiseLite extends Noise { - constructor(identifier?: any) - _changed(): void - - /** The noise algorithm used. See [enum NoiseType]. */ - get noise_type(): int64 - set noise_type(value: int64) - - /** The random number seed for all noise types. */ - get seed(): int64 - set seed(value: int64) - - /** The frequency for all noise types. Low frequency results in smooth noise while high frequency results in rougher, more granular noise. */ - get frequency(): float64 - set frequency(value: float64) - - /** Translate the noise input coordinates by the given [Vector3]. */ - get offset(): Vector3 - set offset(value: Vector3) - - /** The method for combining octaves into a fractal. See [enum FractalType]. */ - get fractal_type(): int64 - set fractal_type(value: int64) - - /** The number of noise layers that are sampled to get the final value for fractal noise types. */ - get fractal_octaves(): int64 - set fractal_octaves(value: int64) - - /** Frequency multiplier between subsequent octaves. Increasing this value results in higher octaves producing noise with finer details and a rougher appearance. */ - get fractal_lacunarity(): float64 - set fractal_lacunarity(value: float64) - - /** Determines the strength of each subsequent layer of noise in fractal noise. - * A low value places more emphasis on the lower frequency base layers, while a high value puts more emphasis on the higher frequency layers. - */ - get fractal_gain(): float64 - set fractal_gain(value: float64) - - /** Higher weighting means higher octaves have less impact if lower octaves have a large impact. */ - get fractal_weighted_strength(): float64 - set fractal_weighted_strength(value: float64) - - /** Sets the strength of the fractal ping pong type. */ - get fractal_ping_pong_strength(): float64 - set fractal_ping_pong_strength(value: float64) - - /** Determines how the distance to the nearest/second-nearest point is computed. See [enum CellularDistanceFunction] for options. */ - get cellular_distance_function(): int64 - set cellular_distance_function(value: int64) - - /** Maximum distance a point can move off of its grid position. Set to `0` for an even grid. */ - get cellular_jitter(): float64 - set cellular_jitter(value: float64) - - /** Return type from cellular noise calculations. See [enum CellularReturnType]. */ - get cellular_return_type(): int64 - set cellular_return_type(value: int64) - - /** If enabled, another FastNoiseLite instance is used to warp the space, resulting in a distortion of the noise. */ - get domain_warp_enabled(): boolean - set domain_warp_enabled(value: boolean) - - /** Sets the warp algorithm. See [enum DomainWarpType]. */ - get domain_warp_type(): int64 - set domain_warp_type(value: int64) - - /** Sets the maximum warp distance from the origin. */ - get domain_warp_amplitude(): float64 - set domain_warp_amplitude(value: float64) - - /** Frequency of the noise which warps the space. Low frequency results in smooth noise while high frequency results in rougher, more granular noise. */ - get domain_warp_frequency(): float64 - set domain_warp_frequency(value: float64) - - /** The method for combining octaves into a fractal which is used to warp the space. See [enum DomainWarpFractalType]. */ - get domain_warp_fractal_type(): int64 - set domain_warp_fractal_type(value: int64) - - /** The number of noise layers that are sampled to get the final value for the fractal noise which warps the space. */ - get domain_warp_fractal_octaves(): int64 - set domain_warp_fractal_octaves(value: int64) - - /** Octave lacunarity of the fractal noise which warps the space. Increasing this value results in higher octaves producing noise with finer details and a rougher appearance. */ - get domain_warp_fractal_lacunarity(): float64 - set domain_warp_fractal_lacunarity(value: float64) - - /** Determines the strength of each subsequent layer of the noise which is used to warp the space. - * A low value places more emphasis on the lower frequency base layers, while a high value puts more emphasis on the higher frequency layers. - */ - get domain_warp_fractal_gain(): float64 - set domain_warp_fractal_gain(value: float64) - } - namespace FileAccess { - enum ModeFlags { - /** Opens the file for read operations. The cursor is positioned at the beginning of the file. */ - READ = 1, - - /** Opens the file for write operations. The file is created if it does not exist, and truncated if it does. - * - * **Note:** When creating a file it must be in an already existing directory. To recursively create directories for a file path, see [method DirAccess.make_dir_recursive]. - */ - WRITE = 2, - - /** Opens the file for read and write operations. Does not truncate the file. The cursor is positioned at the beginning of the file. */ - READ_WRITE = 3, - - /** Opens the file for read and write operations. The file is created if it does not exist, and truncated if it does. The cursor is positioned at the beginning of the file. - * - * **Note:** When creating a file it must be in an already existing directory. To recursively create directories for a file path, see [method DirAccess.make_dir_recursive]. - */ - WRITE_READ = 7, - } - enum CompressionMode { - /** Uses the [url=https://fastlz.org/]FastLZ[/url] compression method. */ - COMPRESSION_FASTLZ = 0, - - /** Uses the [url=https://en.wikipedia.org/wiki/DEFLATE]DEFLATE[/url] compression method. */ - COMPRESSION_DEFLATE = 1, - - /** Uses the [url=https://facebook.github.io/zstd/]Zstandard[/url] compression method. */ - COMPRESSION_ZSTD = 2, - - /** Uses the [url=https://www.gzip.org/]gzip[/url] compression method. */ - COMPRESSION_GZIP = 3, - - /** Uses the [url=https://github.com/google/brotli]brotli[/url] compression method (only decompression is supported). */ - COMPRESSION_BROTLI = 4, - } - enum UnixPermissionFlags { - /** Read for owner bit. */ - UNIX_READ_OWNER = 256, - - /** Write for owner bit. */ - UNIX_WRITE_OWNER = 128, - - /** Execute for owner bit. */ - UNIX_EXECUTE_OWNER = 64, - - /** Read for group bit. */ - UNIX_READ_GROUP = 32, - - /** Write for group bit. */ - UNIX_WRITE_GROUP = 16, - - /** Execute for group bit. */ - UNIX_EXECUTE_GROUP = 8, - - /** Read for other bit. */ - UNIX_READ_OTHER = 4, - - /** Write for other bit. */ - UNIX_WRITE_OTHER = 2, - - /** Execute for other bit. */ - UNIX_EXECUTE_OTHER = 1, - - /** Set user id on execution bit. */ - UNIX_SET_USER_ID = 2048, - - /** Set group id on execution bit. */ - UNIX_SET_GROUP_ID = 1024, - - /** Restricted deletion (sticky) bit. */ - UNIX_RESTRICTED_DELETE = 512, - } - } - /** Provides methods for file reading and writing operations. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_fileaccess.html - */ - class FileAccess extends RefCounted { - constructor(identifier?: any) - /** Creates a new [FileAccess] object and opens the file for writing or reading, depending on the flags. - * Returns `null` if opening the file failed. You can use [method get_open_error] to check the error that occurred. - */ - static open(path: string, flags: FileAccess.ModeFlags): FileAccess - - /** Creates a new [FileAccess] object and opens an encrypted file in write or read mode. You need to pass a binary key to encrypt/decrypt it. - * - * **Note:** The provided key must be 32 bytes long. - * Returns `null` if opening the file failed. You can use [method get_open_error] to check the error that occurred. - */ - static open_encrypted(path: string, mode_flags: FileAccess.ModeFlags, key: PackedByteArray | byte[] | ArrayBuffer): FileAccess - - /** Creates a new [FileAccess] object and opens an encrypted file in write or read mode. You need to pass a password to encrypt/decrypt it. - * Returns `null` if opening the file failed. You can use [method get_open_error] to check the error that occurred. - */ - static open_encrypted_with_pass(path: string, mode_flags: FileAccess.ModeFlags, pass: string): FileAccess - - /** Creates a new [FileAccess] object and opens a compressed file for reading or writing. - * - * **Note:** [method open_compressed] can only read files that were saved by Godot, not third-party compression formats. See [url=https://github.com/godotengine/godot/issues/28999]GitHub issue #28999[/url] for a workaround. - * Returns `null` if opening the file failed. You can use [method get_open_error] to check the error that occurred. - */ - static open_compressed(path: string, mode_flags: FileAccess.ModeFlags, compression_mode: FileAccess.CompressionMode = 0): FileAccess - - /** Returns the result of the last [method open] call in the current thread. */ - static get_open_error(): GError - - /** Returns the whole [param path] file contents as a [PackedByteArray] without any decoding. - * Returns an empty [PackedByteArray] if an error occurred while opening the file. You can use [method get_open_error] to check the error that occurred. - */ - static get_file_as_bytes(path: string): PackedByteArray - - /** Returns the whole [param path] file contents as a [String]. Text is interpreted as being UTF-8 encoded. - * Returns an empty [String] if an error occurred while opening the file. You can use [method get_open_error] to check the error that occurred. - */ - static get_file_as_string(path: string): string - - /** Resizes the file to a specified length. The file must be open in a mode that permits writing. If the file is extended, NUL characters are appended. If the file is truncated, all data from the end file to the original length of the file is lost. */ - resize(length: int64): GError - - /** Writes the file's buffer to disk. Flushing is automatically performed when the file is closed. This means you don't need to call [method flush] manually before closing a file. Still, calling [method flush] can be used to ensure the data is safe even if the project crashes instead of being closed gracefully. - * - * **Note:** Only call [method flush] when you actually need it. Otherwise, it will decrease performance due to constant disk writes. - */ - flush(): void - - /** Returns the path as a [String] for the current open file. */ - get_path(): string - - /** Returns the absolute path as a [String] for the current open file. */ - get_path_absolute(): string - - /** Returns `true` if the file is currently opened. */ - is_open(): boolean - - /** Changes the file reading/writing cursor to the specified position (in bytes from the beginning of the file). */ - seek(position: int64): void - - /** Changes the file reading/writing cursor to the specified position (in bytes from the end of the file). - * - * **Note:** This is an offset, so you should use negative numbers or the cursor will be at the end of the file. - */ - seek_end(position: int64 = 0): void - - /** Returns the file cursor's position. */ - get_position(): int64 - - /** Returns the size of the file in bytes. */ - get_length(): int64 - - /** Returns `true` if the file cursor has already read past the end of the file. - * - * **Note:** `eof_reached() == false` cannot be used to check whether there is more data available. To loop while there is more data available, use: - * - */ - eof_reached(): boolean - - /** Returns the next 8 bits from the file as an integer. See [method store_8] for details on what values can be stored and retrieved this way. */ - get_8(): int64 - - /** Returns the next 16 bits from the file as an integer. See [method store_16] for details on what values can be stored and retrieved this way. */ - get_16(): int64 - - /** Returns the next 32 bits from the file as an integer. See [method store_32] for details on what values can be stored and retrieved this way. */ - get_32(): int64 - - /** Returns the next 64 bits from the file as an integer. See [method store_64] for details on what values can be stored and retrieved this way. */ - get_64(): int64 - - /** Returns the next 32 bits from the file as a floating-point number. */ - get_float(): float64 - - /** Returns the next 64 bits from the file as a floating-point number. */ - get_double(): float64 - - /** Returns the next bits from the file as a floating-point number. */ - get_real(): float64 - - /** Returns next [param length] bytes of the file as a [PackedByteArray]. */ - get_buffer(length: int64): PackedByteArray - - /** Returns the next line of the file as a [String]. The returned string doesn't include newline (`\n`) or carriage return (`\r`) characters, but does include any other leading or trailing whitespace. - * Text is interpreted as being UTF-8 encoded. - */ - get_line(): string - - /** Returns the next value of the file in CSV (Comma-Separated Values) format. You can pass a different delimiter [param delim] to use other than the default `","` (comma). This delimiter must be one-character long, and cannot be a double quotation mark. - * Text is interpreted as being UTF-8 encoded. Text values must be enclosed in double quotes if they include the delimiter character. Double quotes within a text value can be escaped by doubling their occurrence. - * For example, the following CSV lines are valid and will be properly parsed as two strings each: - * [codeblock lang=text] - * Alice,"Hello, Bob!" - * Bob,Alice! What a surprise! - * Alice,"I thought you'd reply with ""Hello, world""." - * [/codeblock] - * Note how the second line can omit the enclosing quotes as it does not include the delimiter. However it *could* very well use quotes, it was only written without for demonstration purposes. The third line must use `""` for each quotation mark that needs to be interpreted as such instead of the end of a text value. - */ - get_csv_line(delim: string = ','): PackedStringArray - - /** Returns the whole file as a [String]. Text is interpreted as being UTF-8 encoded. - * If [param skip_cr] is `true`, carriage return characters (`\r`, CR) will be ignored when parsing the UTF-8, so that only line feed characters (`\n`, LF) represent a new line (Unix convention). - */ - get_as_text(skip_cr: boolean = false): string - - /** Returns an MD5 String representing the file at the given path or an empty [String] on failure. */ - static get_md5(path: string): string - - /** Returns an SHA-256 [String] representing the file at the given path or an empty [String] on failure. */ - static get_sha256(path: string): string - - /** Returns the last error that happened when trying to perform operations. Compare with the `ERR_FILE_*` constants from [enum Error]. */ - get_error(): GError - - /** Returns the next [Variant] value from the file. If [param allow_objects] is `true`, decoding objects is allowed. - * Internally, this uses the same decoding mechanism as the [method @GlobalScope.bytes_to_var] method. - * **Warning:** Deserialized objects can contain code which gets executed. Do not use this option if the serialized object comes from untrusted sources to avoid potential security threats such as remote code execution. - */ - get_var(allow_objects: boolean = false): any - - /** Stores an integer as 8 bits in the file. - * - * **Note:** The [param value] should lie in the interval `[0, 255]`. Any other value will overflow and wrap around. - * To store a signed integer, use [method store_64], or convert it manually (see [method store_16] for an example). - */ - store_8(value: int64): void - - /** Stores an integer as 16 bits in the file. - * - * **Note:** The [param value] should lie in the interval `[0, 2^16 - 1]`. Any other value will overflow and wrap around. - * To store a signed integer, use [method store_64] or store a signed integer from the interval `[-2^15, 2^15 - 1]` (i.e. keeping one bit for the signedness) and compute its sign manually when reading. For example: - * - */ - store_16(value: int64): void - - /** Stores an integer as 32 bits in the file. - * - * **Note:** The [param value] should lie in the interval `[0, 2^32 - 1]`. Any other value will overflow and wrap around. - * To store a signed integer, use [method store_64], or convert it manually (see [method store_16] for an example). - */ - store_32(value: int64): void - - /** Stores an integer as 64 bits in the file. - * - * **Note:** The [param value] must lie in the interval `[-2^63, 2^63 - 1]` (i.e. be a valid [int] value). - */ - store_64(value: int64): void - - /** Stores a floating-point number as 32 bits in the file. */ - store_float(value: float64): void - - /** Stores a floating-point number as 64 bits in the file. */ - store_double(value: float64): void - - /** Stores a floating-point number in the file. */ - store_real(value: float64): void - - /** Stores the given array of bytes in the file. */ - store_buffer(buffer: PackedByteArray | byte[] | ArrayBuffer): void - - /** Appends [param line] to the file followed by a line return character (`\n`), encoding the text as UTF-8. */ - store_line(line: string): void - - /** Store the given [PackedStringArray] in the file as a line formatted in the CSV (Comma-Separated Values) format. You can pass a different delimiter [param delim] to use other than the default `","` (comma). This delimiter must be one-character long. - * Text will be encoded as UTF-8. - */ - store_csv_line(values: PackedStringArray | string[], delim: string = ','): void - - /** Appends [param string] to the file without a line return, encoding the text as UTF-8. - * - * **Note:** This method is intended to be used to write text files. The string is stored as a UTF-8 encoded buffer without string length or terminating zero, which means that it can't be loaded back easily. If you want to store a retrievable string in a binary file, consider using [method store_pascal_string] instead. For retrieving strings from a text file, you can use `get_buffer(length).get_string_from_utf8()` (if you know the length) or [method get_as_text]. - */ - store_string(string_: string): void - - /** Stores any Variant value in the file. If [param full_objects] is `true`, encoding objects is allowed (and can potentially include code). - * Internally, this uses the same encoding mechanism as the [method @GlobalScope.var_to_bytes] method. - * - * **Note:** Not all properties are included. Only properties that are configured with the [constant PROPERTY_USAGE_STORAGE] flag set will be serialized. You can add a new usage flag to a property by overriding the [method Object._get_property_list] method in your class. You can also check how property usage is configured by calling [method Object._get_property_list]. See [enum PropertyUsageFlags] for the possible usage flags. - */ - store_var(value: any, full_objects: boolean = false): void - - /** Stores the given [String] as a line in the file in Pascal format (i.e. also store the length of the string). - * Text will be encoded as UTF-8. - */ - store_pascal_string(string_: string): void - - /** Returns a [String] saved in Pascal format from the file. - * Text is interpreted as being UTF-8 encoded. - */ - get_pascal_string(): string - - /** Closes the currently opened file and prevents subsequent read/write operations. Use [method flush] to persist the data to disk without closing the file. - * - * **Note:** [FileAccess] will automatically close when it's freed, which happens when it goes out of scope or when it gets assigned with `null`. In C# the reference must be disposed after we are done using it, this can be done with the `using` statement or calling the `Dispose` method directly. - */ - close(): void - - /** Returns `true` if the file exists in the given path. - * - * **Note:** Many resources types are imported (e.g. textures or sound files), and their source asset will not be included in the exported game, as only the imported version is used. See [method ResourceLoader.exists] for an alternative approach that takes resource remapping into account. - * For a non-static, relative equivalent, use [method DirAccess.file_exists]. - */ - static file_exists(path: string): boolean - - /** Returns the last time the [param file] was modified in Unix timestamp format, or `0` on error. This Unix timestamp can be converted to another format using the [Time] singleton. */ - static get_modified_time(file: string): int64 - - /** Returns file UNIX permissions. - * - * **Note:** This method is implemented on iOS, Linux/BSD, and macOS. - */ - static get_unix_permissions(file: string): FileAccess.UnixPermissionFlags - - /** Sets file UNIX permissions. - * - * **Note:** This method is implemented on iOS, Linux/BSD, and macOS. - */ - static set_unix_permissions(file: string, permissions: FileAccess.UnixPermissionFlags): GError - - /** Returns `true`, if file `hidden` attribute is set. - * - * **Note:** This method is implemented on iOS, BSD, macOS, and Windows. - */ - static get_hidden_attribute(file: string): boolean - - /** Sets file **hidden** attribute. - * - * **Note:** This method is implemented on iOS, BSD, macOS, and Windows. - */ - static set_hidden_attribute(file: string, hidden: boolean): GError - - /** Sets file **read only** attribute. - * - * **Note:** This method is implemented on iOS, BSD, macOS, and Windows. - */ - static set_read_only_attribute(file: string, ro: boolean): GError - - /** Returns `true`, if file `read only` attribute is set. - * - * **Note:** This method is implemented on iOS, BSD, macOS, and Windows. - */ - static get_read_only_attribute(file: string): boolean - - /** If `true`, the file is read with big-endian [url=https://en.wikipedia.org/wiki/Endianness]endianness[/url]. If `false`, the file is read with little-endian endianness. If in doubt, leave this to `false` as most files are written with little-endian endianness. - * - * **Note:** [member big_endian] is only about the file format, not the CPU type. The CPU endianness doesn't affect the default endianness for files written. - * - * **Note:** This is always reset to `false` whenever you open the file. Therefore, you must set [member big_endian] *after* opening the file, not before. - */ - get big_endian(): boolean - set big_endian(value: boolean) - } - namespace FileDialog { - enum FileMode { - /** The dialog allows selecting one, and only one file. */ - FILE_MODE_OPEN_FILE = 0, - - /** The dialog allows selecting multiple files. */ - FILE_MODE_OPEN_FILES = 1, - - /** The dialog only allows selecting a directory, disallowing the selection of any file. */ - FILE_MODE_OPEN_DIR = 2, - - /** The dialog allows selecting one file or directory. */ - FILE_MODE_OPEN_ANY = 3, - - /** The dialog will warn when a file exists. */ - FILE_MODE_SAVE_FILE = 4, - } - enum Access { - /** The dialog only allows accessing files under the [Resource] path (`res://`). */ - ACCESS_RESOURCES = 0, - - /** The dialog only allows accessing files under user data path (`user://`). */ - ACCESS_USERDATA = 1, - - /** The dialog allows accessing files on the whole file system. */ - ACCESS_FILESYSTEM = 2, - } - } - /** A dialog for selecting files or directories in the filesystem. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_filedialog.html - */ - class FileDialog extends ConfirmationDialog { - constructor(identifier?: any) - _cancel_pressed(): void - - /** Clear all the added filters in the dialog. */ - clear_filters(): void - - /** Adds a comma-delimited file name [param filter] option to the [FileDialog] with an optional [param description], which restricts what files can be picked. - * A [param filter] should be of the form `"filename.extension"`, where filename and extension can be `*` to match any string. Filters starting with `.` (i.e. empty filenames) are not allowed. - * For example, a [param filter] of `"*.png, *.jpg"` and a [param description] of `"Images"` results in filter text "Images (*.png, *.jpg)". - */ - add_filter(filter: string, description: string = ''): void - - /** Returns the name of the [OptionButton] or [CheckBox] with index [param option]. */ - get_option_name(option: int64): string - - /** Returns an array of values of the [OptionButton] with index [param option]. */ - get_option_values(option: int64): PackedStringArray - - /** Returns the default value index of the [OptionButton] or [CheckBox] with index [param option]. */ - get_option_default(option: int64): int64 - - /** Sets the name of the [OptionButton] or [CheckBox] with index [param option]. */ - set_option_name(option: int64, name: string): void - - /** Sets the option values of the [OptionButton] with index [param option]. */ - set_option_values(option: int64, values: PackedStringArray | string[]): void - - /** Sets the default value index of the [OptionButton] or [CheckBox] with index [param option]. */ - set_option_default(option: int64, default_value_index: int64): void - - /** Adds an additional [OptionButton] to the file dialog. If [param values] is empty, a [CheckBox] is added instead. - * [param default_value_index] should be an index of the value in the [param values]. If [param values] is empty it should be either `1` (checked), or `0` (unchecked). - */ - add_option(name: string, values: PackedStringArray | string[], default_value_index: int64): void - - /** Returns a [Dictionary] with the selected values of the additional [OptionButton]s and/or [CheckBox]es. [Dictionary] keys are names and values are selected value indices. */ - get_selected_options(): GDictionary - - /** Returns the vertical box container of the dialog, custom controls can be added to it. - * **Warning:** This is a required internal node, removing and freeing it may cause a crash. If you wish to hide it or any of its children, use their [member CanvasItem.visible] property. - * - * **Note:** Changes to this node are ignored by native file dialogs, use [method add_option] to add custom elements to the dialog instead. - */ - get_vbox(): VBoxContainer - - /** Returns the LineEdit for the selected file. - * **Warning:** This is a required internal node, removing and freeing it may cause a crash. If you wish to hide it or any of its children, use their [member CanvasItem.visible] property. - */ - get_line_edit(): LineEdit - - /** Clear all currently selected items in the dialog. */ - deselect_all(): void - - /** Invalidate and update the current dialog content list. - * - * **Note:** This method does nothing on native file dialogs. - */ - invalidate(): void - - /** If `true`, changing the [member file_mode] property will set the window title accordingly (e.g. setting [member file_mode] to [constant FILE_MODE_OPEN_FILE] will change the window title to "Open a File"). */ - get mode_overrides_title(): boolean - set mode_overrides_title(value: boolean) - - /** The dialog's open or save mode, which affects the selection behavior. See [enum FileMode]. */ - get file_mode(): int64 - set file_mode(value: int64) - - /** The file system access scope. See [enum Access] constants. - * **Warning:** In Web builds, FileDialog cannot access the host file system. In sandboxed Linux and macOS environments, [member use_native_dialog] is automatically used to allow limited access to host file system. - */ - get access(): int64 - set access(value: int64) - - /** If non-empty, the given sub-folder will be "root" of this [FileDialog], i.e. user won't be able to go to its parent directory. - * - * **Note:** This property is ignored by native file dialogs. - */ - get root_subfolder(): string - set root_subfolder(value: string) - - /** The available file type filters. Each filter string in the array should be formatted like this: `*.txt,*.doc;Text Files`. The description text of the filter is optional and can be omitted. */ - get filters(): PackedStringArray - set filters(value: PackedStringArray | string[]) - - /** The number of additional [OptionButton]s and [CheckBox]es in the dialog. */ - get option_count(): any /*Options,option_*/ - set option_count(value: any /*Options,option_*/) - - /** If `true`, the dialog will show hidden files. - * - * **Note:** This property is ignored by native file dialogs on Linux. - */ - get show_hidden_files(): boolean - set show_hidden_files(value: boolean) - - /** If `true`, [member access] is set to [constant ACCESS_FILESYSTEM], and it is supported by the current [DisplayServer], OS native dialog will be used instead of custom one. - * - * **Note:** On Linux and macOS, sandboxed apps always use native dialogs to access the host file system. - * - * **Note:** On macOS, sandboxed apps will save security-scoped bookmarks to retain access to the opened folders across multiple sessions. Use [method OS.get_granted_permissions] to get a list of saved bookmarks. - * - * **Note:** Native dialogs are isolated from the base process, file dialog properties can't be modified once the dialog is shown. - */ - get use_native_dialog(): boolean - set use_native_dialog(value: boolean) - - /** The current working directory of the file dialog. - * - * **Note:** For native file dialogs, this property is only treated as a hint and may not be respected by specific OS implementations. - */ - get current_dir(): string - set current_dir(value: string) - - /** The currently selected file of the file dialog. */ - get current_file(): string - set current_file(value: string) - - /** The currently selected file path of the file dialog. */ - get current_path(): string - set current_path(value: string) - - /** Emitted when the user selects a file by double-clicking it or pressing the **OK** button. */ - readonly file_selected: Signal1 - - /** Emitted when the user selects multiple files. */ - readonly files_selected: Signal1 - - /** Emitted when the user selects a directory. */ - readonly dir_selected: Signal1 - } - /** Godot editor's dock for managing files in the project. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_filesystemdock.html - */ - class FileSystemDock extends VBoxContainer { - constructor(identifier?: any) - _file_list_thumbnail_done(_unnamed_arg0: string, _unnamed_arg1: Texture2D, _unnamed_arg2: Texture2D, _unnamed_arg3: any): void - _tree_thumbnail_done(_unnamed_arg0: string, _unnamed_arg1: Texture2D, _unnamed_arg2: Texture2D, _unnamed_arg3: any): void - - /** Sets the given [param path] as currently selected, ensuring that the selected file/directory is visible. */ - navigate_to_path(path: string): void - - /** Registers a new [EditorResourceTooltipPlugin]. */ - add_resource_tooltip_plugin(plugin: EditorResourceTooltipPlugin): void - - /** Removes an [EditorResourceTooltipPlugin]. Fails if the plugin wasn't previously added. */ - remove_resource_tooltip_plugin(plugin: EditorResourceTooltipPlugin): void - _set_dock_horizontal(enable: boolean): void - _can_dock_horizontal(): boolean - - /** Emitted when a new scene is created that inherits the scene at [param file] path. */ - readonly inherit: Signal1 - - /** Emitted when the given scenes are being instantiated in the editor. */ - readonly instantiate: Signal1 - - /** Emitted when an external [param resource] had its file removed. */ - readonly resource_removed: Signal1 - - /** Emitted when the given [param file] was removed. */ - readonly file_removed: Signal1 - - /** Emitted when the given [param folder] was removed. */ - readonly folder_removed: Signal1 - - /** Emitted when a file is moved from [param old_file] path to [param new_file] path. */ - readonly files_moved: Signal2 - - /** Emitted when a folder is moved from [param old_folder] path to [param new_folder] path. */ - readonly folder_moved: Signal2 - - /** Emitted when folders change color. */ - readonly folder_color_changed: Signal0 - - /** Emitted when the user switches file display mode or split mode. */ - readonly display_mode_changed: Signal0 - } - class FileSystemList extends ItemList { - constructor(identifier?: any) - readonly item_edited: Signal0 - } - class FindInFiles extends Node { - constructor(identifier?: any) - readonly result_found: Signal5 - readonly finished: Signal0 - } - class FindInFilesDialog extends AcceptDialog { - constructor(identifier?: any) - readonly find_requested: Signal0 - readonly replace_requested: Signal0 - } - class FindInFilesPanel extends Control { - constructor(identifier?: any) - _on_result_found(_unnamed_arg0: string, _unnamed_arg1: int64, _unnamed_arg2: int64, _unnamed_arg3: int64, _unnamed_arg4: string): void - _on_finished(): void - readonly result_selected: Signal4 - readonly files_modified: Signal1 - readonly close_button_clicked: Signal0 - } - class FindReplaceBar extends HBoxContainer { - constructor(identifier?: any) - _search_current(): boolean - readonly error: Signal0 - } - namespace FlowContainer { - enum AlignmentMode { - /** The child controls will be arranged at the beginning of the container, i.e. top if orientation is vertical, left if orientation is horizontal (right for RTL layout). */ - ALIGNMENT_BEGIN = 0, - - /** The child controls will be centered in the container. */ - ALIGNMENT_CENTER = 1, - - /** The child controls will be arranged at the end of the container, i.e. bottom if orientation is vertical, right if orientation is horizontal (left for RTL layout). */ - ALIGNMENT_END = 2, - } - enum LastWrapAlignmentMode { - /** The last partially filled row or column will wrap aligned to the previous row or column in accordance with [member alignment]. */ - LAST_WRAP_ALIGNMENT_INHERIT = 0, - - /** The last partially filled row or column will wrap aligned to the beginning of the previous row or column. */ - LAST_WRAP_ALIGNMENT_BEGIN = 1, - - /** The last partially filled row or column will wrap aligned to the center of the previous row or column. */ - LAST_WRAP_ALIGNMENT_CENTER = 2, - - /** The last partially filled row or column will wrap aligned to the end of the previous row or column. */ - LAST_WRAP_ALIGNMENT_END = 3, - } - } - /** A container that arranges its child controls horizontally or vertically and wraps them around at the borders. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_flowcontainer.html - */ - class FlowContainer extends Container { - constructor(identifier?: any) - /** Returns the current line count. */ - get_line_count(): int64 - - /** The alignment of the container's children (must be one of [constant ALIGNMENT_BEGIN], [constant ALIGNMENT_CENTER], or [constant ALIGNMENT_END]). */ - get alignment(): int64 - set alignment(value: int64) - - /** The wrap behavior of the last, partially filled row or column (must be one of [constant LAST_WRAP_ALIGNMENT_INHERIT], [constant LAST_WRAP_ALIGNMENT_BEGIN], [constant LAST_WRAP_ALIGNMENT_CENTER], or [constant LAST_WRAP_ALIGNMENT_END]). */ - get last_wrap_alignment(): int64 - set last_wrap_alignment(value: int64) - - /** If `true`, the [FlowContainer] will arrange its children vertically, rather than horizontally. - * Can't be changed when using [HFlowContainer] and [VFlowContainer]. - */ - get vertical(): boolean - set vertical(value: boolean) - - /** If `true`, reverses fill direction. Horizontal [FlowContainer]s will fill rows bottom to top, vertical [FlowContainer]s will fill columns right to left. - * When using a vertical [FlowContainer] with a right to left [member Control.layout_direction], columns will fill left to right instead. - */ - get reverse_fill(): boolean - set reverse_fill(value: boolean) - } - /** A material that controls how volumetric fog is rendered, to be assigned to a [FogVolume]. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_fogmaterial.html - */ - class FogMaterial extends Material { - constructor(identifier?: any) - /** The density of the [FogVolume]. Denser objects are more opaque, but may suffer from under-sampling artifacts that look like stripes. Negative values can be used to subtract fog from other [FogVolume]s or global volumetric fog. - * - * **Note:** Due to limited precision, [member density] values between `-0.001` and `0.001` (exclusive) act like `0.0`. This does not apply to [member Environment.volumetric_fog_density]. - */ - get density(): float64 - set density(value: float64) - - /** The single-scattering [Color] of the [FogVolume]. Internally, [member albedo] is converted into single-scattering, which is additively blended with other [FogVolume]s and the [member Environment.volumetric_fog_albedo]. */ - get albedo(): Color - set albedo(value: Color) - - /** The [Color] of the light emitted by the [FogVolume]. Emitted light will not cast light or shadows on other objects, but can be useful for modulating the [Color] of the [FogVolume] independently from light sources. */ - get emission(): Color - set emission(value: Color) - - /** The rate by which the height-based fog decreases in density as height increases in world space. A high falloff will result in a sharp transition, while a low falloff will result in a smoother transition. A value of `0.0` results in uniform-density fog. The height threshold is determined by the height of the associated [FogVolume]. */ - get height_falloff(): float64 - set height_falloff(value: float64) - - /** The hardness of the edges of the [FogVolume]. A higher value will result in softer edges, while a lower value will result in harder edges. */ - get edge_fade(): float64 - set edge_fade(value: float64) - - /** The 3D texture that is used to scale the [member density] of the [FogVolume]. This can be used to vary fog density within the [FogVolume] with any kind of static pattern. For animated effects, consider using a custom [url=https://docs.godotengine.org/en/4.3/tutorials/shaders/shader_reference/fog_shader.html]fog shader[/url]. */ - get density_texture(): Texture3D - set density_texture(value: Texture3D) - } - class FogMaterialConversionPlugin extends EditorResourceConversionPlugin { - constructor(identifier?: any) - } - /** A region that contributes to the default volumetric fog from the world environment. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_fogvolume.html - */ - class FogVolume extends VisualInstance3D { - constructor(identifier?: any) - /** The size of the [FogVolume] when [member shape] is [constant RenderingServer.FOG_VOLUME_SHAPE_ELLIPSOID], [constant RenderingServer.FOG_VOLUME_SHAPE_CONE], [constant RenderingServer.FOG_VOLUME_SHAPE_CYLINDER] or [constant RenderingServer.FOG_VOLUME_SHAPE_BOX]. - * - * **Note:** Thin fog volumes may appear to flicker when the camera moves or rotates. This can be alleviated by increasing [member ProjectSettings.rendering/environment/volumetric_fog/volume_depth] (at a performance cost) or by decreasing [member Environment.volumetric_fog_length] (at no performance cost, but at the cost of lower fog range). Alternatively, the [FogVolume] can be made thicker and use a lower density in the [member material]. - * - * **Note:** If [member shape] is [constant RenderingServer.FOG_VOLUME_SHAPE_CONE] or [constant RenderingServer.FOG_VOLUME_SHAPE_CYLINDER], the cone/cylinder will be adjusted to fit within the size. Non-uniform scaling of cone/cylinder shapes via the [member size] property is not supported, but you can scale the [FogVolume] node instead. - */ - get size(): Vector3 - set size(value: Vector3) - - /** The shape of the [FogVolume]. This can be set to either [constant RenderingServer.FOG_VOLUME_SHAPE_ELLIPSOID], [constant RenderingServer.FOG_VOLUME_SHAPE_CONE], [constant RenderingServer.FOG_VOLUME_SHAPE_CYLINDER], [constant RenderingServer.FOG_VOLUME_SHAPE_BOX] or [constant RenderingServer.FOG_VOLUME_SHAPE_WORLD]. */ - get shape(): int64 - set shape(value: int64) - - /** The [Material] used by the [FogVolume]. Can be either a built-in [FogMaterial] or a custom [ShaderMaterial]. */ - get material(): FogMaterial | ShaderMaterial - set material(value: FogMaterial | ShaderMaterial) - } - class FogVolumeGizmoPlugin extends EditorNode3DGizmoPlugin { - constructor(identifier?: any) - } - /** Abstract base class for fonts and font variations. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_font.html - */ - class Font extends Resource { - constructor(identifier?: any) - /** Returns [TextServer] RID of the font cache for specific variation. */ - find_variation(variation_coordinates: GDictionary, face_index: int64 = 0, strength: float64 = 0, transform: Transform2D = new Transform2D(), spacing_top: int64 = 0, spacing_bottom: int64 = 0, spacing_space: int64 = 0, spacing_glyph: int64 = 0, baseline_offset: float64 = 0): RID - - /** Returns [Array] of valid [Font] [RID]s, which can be passed to the [TextServer] methods. */ - get_rids(): GArray - - /** Returns the total average font height (ascent plus descent) in pixels. - * - * **Note:** Real height of the string is context-dependent and can be significantly different from the value returned by this function. Use it only as rough estimate (e.g. as the height of empty line). - */ - get_height(font_size: int64 = 16): float64 - - /** Returns the average font ascent (number of pixels above the baseline). - * - * **Note:** Real ascent of the string is context-dependent and can be significantly different from the value returned by this function. Use it only as rough estimate (e.g. as the ascent of empty line). - */ - get_ascent(font_size: int64 = 16): float64 - - /** Returns the average font descent (number of pixels below the baseline). - * - * **Note:** Real descent of the string is context-dependent and can be significantly different from the value returned by this function. Use it only as rough estimate (e.g. as the descent of empty line). - */ - get_descent(font_size: int64 = 16): float64 - - /** Returns average pixel offset of the underline below the baseline. - * - * **Note:** Real underline position of the string is context-dependent and can be significantly different from the value returned by this function. Use it only as rough estimate. - */ - get_underline_position(font_size: int64 = 16): float64 - - /** Returns average thickness of the underline. - * - * **Note:** Real underline thickness of the string is context-dependent and can be significantly different from the value returned by this function. Use it only as rough estimate. - */ - get_underline_thickness(font_size: int64 = 16): float64 - - /** Returns font family name. */ - get_font_name(): string - - /** Returns font style name. */ - get_font_style_name(): string - - /** Returns [Dictionary] with OpenType font name strings (localized font names, version, description, license information, sample text, etc.). */ - get_ot_name_strings(): GDictionary - - /** Returns font style flags, see [enum TextServer.FontStyle]. */ - get_font_style(): TextServer.FontStyle - - /** Returns weight (boldness) of the font. A value in the `100...999` range, normal font weight is `400`, bold font weight is `700`. */ - get_font_weight(): int64 - - /** Returns font stretch amount, compared to a normal width. A percentage value between `50%` and `200%`. */ - get_font_stretch(): int64 - - /** Returns the spacing for the given `type` (see [enum TextServer.SpacingType]). */ - get_spacing(spacing: TextServer.SpacingType): int64 - - /** Returns a set of OpenType feature tags. More info: [url=https://docs.microsoft.com/en-us/typography/opentype/spec/featuretags]OpenType feature tags[/url]. */ - get_opentype_features(): GDictionary - - /** Sets LRU cache capacity for `draw_*` methods. */ - set_cache_capacity(single_line: int64, multi_line: int64): void - - /** Returns the size of a bounding box of a single-line string, taking kerning, advance and subpixel positioning into account. See also [method get_multiline_string_size] and [method draw_string]. - * For example, to get the string size as displayed by a single-line Label, use: - * - * - * **Note:** Since kerning, advance and subpixel positioning are taken into account by [method get_string_size], using separate [method get_string_size] calls on substrings of a string then adding the results together will return a different result compared to using a single [method get_string_size] call on the full string. - * - * **Note:** Real height of the string is context-dependent and can be significantly different from the value returned by [method get_height]. - */ - get_string_size(text: string, alignment: HorizontalAlignment = 0, width: float64 = -1, font_size: int64 = 16, justification_flags: TextServer.JustificationFlag = 3, direction: TextServer.Direction = 0, orientation: TextServer.Orientation = 0): Vector2 - - /** Returns the size of a bounding box of a string broken into the lines, taking kerning and advance into account. - * See also [method draw_multiline_string]. - */ - get_multiline_string_size(text: string, alignment: HorizontalAlignment = 0, width: float64 = -1, font_size: int64 = 16, max_lines: int64 = -1, brk_flags: TextServer.LineBreakFlag = 3, justification_flags: TextServer.JustificationFlag = 3, direction: TextServer.Direction = 0, orientation: TextServer.Orientation = 0): Vector2 - - /** Draw [param text] into a canvas item using the font, at a given position, with [param modulate] color, optionally clipping the width and aligning horizontally. [param pos] specifies the baseline, not the top. To draw from the top, *ascent* must be added to the Y axis. - * See also [method CanvasItem.draw_string]. - */ - draw_string(canvas_item: RID, pos: Vector2, text: string, alignment: HorizontalAlignment = 0, width: float64 = -1, font_size: int64 = 16, modulate: Color = new Color(1, 1, 1, 1), justification_flags: TextServer.JustificationFlag = 3, direction: TextServer.Direction = 0, orientation: TextServer.Orientation = 0): void - - /** Breaks [param text] into lines using rules specified by [param brk_flags] and draws it into a canvas item using the font, at a given position, with [param modulate] color, optionally clipping the width and aligning horizontally. [param pos] specifies the baseline of the first line, not the top. To draw from the top, *ascent* must be added to the Y axis. - * See also [method CanvasItem.draw_multiline_string]. - */ - draw_multiline_string(canvas_item: RID, pos: Vector2, text: string, alignment: HorizontalAlignment = 0, width: float64 = -1, font_size: int64 = 16, max_lines: int64 = -1, modulate: Color = new Color(1, 1, 1, 1), brk_flags: TextServer.LineBreakFlag = 3, justification_flags: TextServer.JustificationFlag = 3, direction: TextServer.Direction = 0, orientation: TextServer.Orientation = 0): void - - /** Draw [param text] outline into a canvas item using the font, at a given position, with [param modulate] color and [param size] outline size, optionally clipping the width and aligning horizontally. [param pos] specifies the baseline, not the top. To draw from the top, *ascent* must be added to the Y axis. - * See also [method CanvasItem.draw_string_outline]. - */ - draw_string_outline(canvas_item: RID, pos: Vector2, text: string, alignment: HorizontalAlignment = 0, width: float64 = -1, font_size: int64 = 16, size: int64 = 1, modulate: Color = new Color(1, 1, 1, 1), justification_flags: TextServer.JustificationFlag = 3, direction: TextServer.Direction = 0, orientation: TextServer.Orientation = 0): void - - /** Breaks [param text] to the lines using rules specified by [param brk_flags] and draws text outline into a canvas item using the font, at a given position, with [param modulate] color and [param size] outline size, optionally clipping the width and aligning horizontally. [param pos] specifies the baseline of the first line, not the top. To draw from the top, *ascent* must be added to the Y axis. - * See also [method CanvasItem.draw_multiline_string_outline]. - */ - draw_multiline_string_outline(canvas_item: RID, pos: Vector2, text: string, alignment: HorizontalAlignment = 0, width: float64 = -1, font_size: int64 = 16, max_lines: int64 = -1, size: int64 = 1, modulate: Color = new Color(1, 1, 1, 1), brk_flags: TextServer.LineBreakFlag = 3, justification_flags: TextServer.JustificationFlag = 3, direction: TextServer.Direction = 0, orientation: TextServer.Orientation = 0): void - - /** Returns the size of a character. Does not take kerning into account. - * - * **Note:** Do not use this function to calculate width of the string character by character, use [method get_string_size] or [TextLine] instead. The height returned is the font height (see also [method get_height]) and has no relation to the glyph height. - */ - get_char_size(char: int64, font_size: int64): Vector2 - - /** Draw a single Unicode character [param char] into a canvas item using the font, at a given position, with [param modulate] color. [param pos] specifies the baseline, not the top. To draw from the top, *ascent* must be added to the Y axis. - * - * **Note:** Do not use this function to draw strings character by character, use [method draw_string] or [TextLine] instead. - */ - draw_char(canvas_item: RID, pos: Vector2, char: int64, font_size: int64, modulate: Color = new Color(1, 1, 1, 1)): float64 - - /** Draw a single Unicode character [param char] outline into a canvas item using the font, at a given position, with [param modulate] color and [param size] outline size. [param pos] specifies the baseline, not the top. To draw from the top, *ascent* must be added to the Y axis. - * - * **Note:** Do not use this function to draw strings character by character, use [method draw_string] or [TextLine] instead. - */ - draw_char_outline(canvas_item: RID, pos: Vector2, char: int64, font_size: int64, size: int64 = -1, modulate: Color = new Color(1, 1, 1, 1)): float64 - - /** Returns `true` if a Unicode [param char] is available in the font. */ - has_char(char: int64): boolean - - /** Returns a string containing all the characters available in the font. - * If a given character is included in more than one font data source, it appears only once in the returned string. - */ - get_supported_chars(): string - - /** Returns `true`, if font supports given language ([url=https://en.wikipedia.org/wiki/ISO_639-1]ISO 639[/url] code). */ - is_language_supported(language: string): boolean - - /** Returns `true`, if font supports given script ([url=https://en.wikipedia.org/wiki/ISO_15924]ISO 15924[/url] code). */ - is_script_supported(script: string): boolean - - /** Returns list of OpenType features supported by font. */ - get_supported_feature_list(): GDictionary - - /** Returns list of supported [url=https://docs.microsoft.com/en-us/typography/opentype/spec/dvaraxisreg]variation coordinates[/url], each coordinate is returned as `tag: Vector3i(min_value,max_value,default_value)`. - * Font variations allow for continuous change of glyph characteristics along some given design axis, such as weight, width or slant. - * To print available variation axes of a variable font: - * - * - * **Note:** To set and get variation coordinates of a [FontVariation], use [member FontVariation.variation_opentype]. - */ - get_supported_variation_list(): GDictionary - - /** Returns number of faces in the TrueType / OpenType collection. */ - get_face_count(): int64 - - /** Array of fallback [Font]s to use as a substitute if a glyph is not found in this current [Font]. - * If this array is empty in a [FontVariation], the [member FontVariation.base_font]'s fallbacks are used instead. - */ - get fallbacks(): GArray - set fallbacks(value: GArray) - } - class FontEditorPlugin extends EditorPlugin { - constructor(identifier?: any) - } - /** Holds font source data and prerendered glyph cache, imported from a dynamic or a bitmap font. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_fontfile.html - */ - class FontFile extends Font { - constructor(identifier?: any) - /** Loads an AngelCode BMFont (.fnt, .font) bitmap font from file [param path]. - * **Warning:** This method should only be used in the editor or in cases when you need to load external fonts at run-time, such as fonts located at the `user://` directory. - */ - load_bitmap_font(path: string): GError - - /** Loads a TrueType (.ttf), OpenType (.otf), WOFF (.woff), WOFF2 (.woff2) or Type 1 (.pfb, .pfm) dynamic font from file [param path]. - * **Warning:** This method should only be used in the editor or in cases when you need to load external fonts at run-time, such as fonts located at the `user://` directory. - */ - load_dynamic_font(path: string): GError - - /** Returns number of the font cache entries. */ - get_cache_count(): int64 - - /** Removes all font cache entries. */ - clear_cache(): void - - /** Removes specified font cache entry. */ - remove_cache(cache_index: int64): void - - /** Returns list of the font sizes in the cache. Each size is [Vector2i] with font size and outline size. */ - get_size_cache_list(cache_index: int64): GArray - - /** Removes all font sizes from the cache entry */ - clear_size_cache(cache_index: int64): void - - /** Removes specified font size from the cache entry. */ - remove_size_cache(cache_index: int64, size: Vector2i): void - - /** Sets variation coordinates for the specified font cache entry. See [method Font.get_supported_variation_list] for more info. */ - set_variation_coordinates(cache_index: int64, variation_coordinates: GDictionary): void - - /** Returns variation coordinates for the specified font cache entry. See [method Font.get_supported_variation_list] for more info. */ - get_variation_coordinates(cache_index: int64): GDictionary - - /** Sets embolden strength, if is not equal to zero, emboldens the font outlines. Negative values reduce the outline thickness. */ - set_embolden(cache_index: int64, strength: float64): void - - /** Returns embolden strength, if is not equal to zero, emboldens the font outlines. Negative values reduce the outline thickness. */ - get_embolden(cache_index: int64): float64 - - /** Sets 2D transform, applied to the font outlines, can be used for slanting, flipping, and rotating glyphs. */ - set_transform(cache_index: int64, transform: Transform2D): void - - /** Returns 2D transform, applied to the font outlines, can be used for slanting, flipping and rotating glyphs. */ - get_transform(cache_index: int64): Transform2D - - /** Sets the spacing for [param spacing] (see [enum TextServer.SpacingType]) to [param value] in pixels (not relative to the font size). */ - set_extra_spacing(cache_index: int64, spacing: TextServer.SpacingType, value: int64): void - - /** Returns spacing for [param spacing] (see [enum TextServer.SpacingType]) in pixels (not relative to the font size). */ - get_extra_spacing(cache_index: int64, spacing: TextServer.SpacingType): int64 - - /** Sets extra baseline offset (as a fraction of font height). */ - set_extra_baseline_offset(cache_index: int64, baseline_offset: float64): void - - /** Returns extra baseline offset (as a fraction of font height). */ - get_extra_baseline_offset(cache_index: int64): float64 - - /** Sets an active face index in the TrueType / OpenType collection. */ - set_face_index(cache_index: int64, face_index: int64): void - - /** Returns an active face index in the TrueType / OpenType collection. */ - get_face_index(cache_index: int64): int64 - - /** Sets the font ascent (number of pixels above the baseline). */ - set_cache_ascent(cache_index: int64, size: int64, ascent: float64): void - - /** Returns the font ascent (number of pixels above the baseline). */ - get_cache_ascent(cache_index: int64, size: int64): float64 - - /** Sets the font descent (number of pixels below the baseline). */ - set_cache_descent(cache_index: int64, size: int64, descent: float64): void - - /** Returns the font descent (number of pixels below the baseline). */ - get_cache_descent(cache_index: int64, size: int64): float64 - - /** Sets pixel offset of the underline below the baseline. */ - set_cache_underline_position(cache_index: int64, size: int64, underline_position: float64): void - - /** Returns pixel offset of the underline below the baseline. */ - get_cache_underline_position(cache_index: int64, size: int64): float64 - - /** Sets thickness of the underline in pixels. */ - set_cache_underline_thickness(cache_index: int64, size: int64, underline_thickness: float64): void - - /** Returns thickness of the underline in pixels. */ - get_cache_underline_thickness(cache_index: int64, size: int64): float64 - - /** Sets scaling factor of the color bitmap font. */ - set_cache_scale(cache_index: int64, size: int64, scale: float64): void - - /** Returns scaling factor of the color bitmap font. */ - get_cache_scale(cache_index: int64, size: int64): float64 - - /** Returns number of textures used by font cache entry. */ - get_texture_count(cache_index: int64, size: Vector2i): int64 - - /** Removes all textures from font cache entry. - * - * **Note:** This function will not remove glyphs associated with the texture, use [method remove_glyph] to remove them manually. - */ - clear_textures(cache_index: int64, size: Vector2i): void - - /** Removes specified texture from the cache entry. - * - * **Note:** This function will not remove glyphs associated with the texture. Remove them manually using [method remove_glyph]. - */ - remove_texture(cache_index: int64, size: Vector2i, texture_index: int64): void - - /** Sets font cache texture image. */ - set_texture_image(cache_index: int64, size: Vector2i, texture_index: int64, image: Image): void - - /** Returns a copy of the font cache texture image. */ - get_texture_image(cache_index: int64, size: Vector2i, texture_index: int64): Image - - /** Sets array containing glyph packing data. */ - set_texture_offsets(cache_index: int64, size: Vector2i, texture_index: int64, offset: PackedInt32Array | int32[]): void - - /** Returns a copy of the array containing glyph packing data. */ - get_texture_offsets(cache_index: int64, size: Vector2i, texture_index: int64): PackedInt32Array - - /** Returns list of rendered glyphs in the cache entry. */ - get_glyph_list(cache_index: int64, size: Vector2i): PackedInt32Array - - /** Removes all rendered glyph information from the cache entry. - * - * **Note:** This function will not remove textures associated with the glyphs, use [method remove_texture] to remove them manually. - */ - clear_glyphs(cache_index: int64, size: Vector2i): void - - /** Removes specified rendered glyph information from the cache entry. - * - * **Note:** This function will not remove textures associated with the glyphs, use [method remove_texture] to remove them manually. - */ - remove_glyph(cache_index: int64, size: Vector2i, glyph: int64): void - - /** Sets glyph advance (offset of the next glyph). - * - * **Note:** Advance for glyphs outlines is the same as the base glyph advance and is not saved. - */ - set_glyph_advance(cache_index: int64, size: int64, glyph: int64, advance: Vector2): void - - /** Returns glyph advance (offset of the next glyph). - * - * **Note:** Advance for glyphs outlines is the same as the base glyph advance and is not saved. - */ - get_glyph_advance(cache_index: int64, size: int64, glyph: int64): Vector2 - - /** Sets glyph offset from the baseline. */ - set_glyph_offset(cache_index: int64, size: Vector2i, glyph: int64, offset: Vector2): void - - /** Returns glyph offset from the baseline. */ - get_glyph_offset(cache_index: int64, size: Vector2i, glyph: int64): Vector2 - - /** Sets glyph size. */ - set_glyph_size(cache_index: int64, size: Vector2i, glyph: int64, gl_size: Vector2): void - - /** Returns glyph size. */ - get_glyph_size(cache_index: int64, size: Vector2i, glyph: int64): Vector2 - - /** Sets rectangle in the cache texture containing the glyph. */ - set_glyph_uv_rect(cache_index: int64, size: Vector2i, glyph: int64, uv_rect: Rect2): void - - /** Returns rectangle in the cache texture containing the glyph. */ - get_glyph_uv_rect(cache_index: int64, size: Vector2i, glyph: int64): Rect2 - - /** Sets index of the cache texture containing the glyph. */ - set_glyph_texture_idx(cache_index: int64, size: Vector2i, glyph: int64, texture_idx: int64): void - - /** Returns index of the cache texture containing the glyph. */ - get_glyph_texture_idx(cache_index: int64, size: Vector2i, glyph: int64): int64 - - /** Returns list of the kerning overrides. */ - get_kerning_list(cache_index: int64, size: int64): GArray - - /** Removes all kerning overrides. */ - clear_kerning_map(cache_index: int64, size: int64): void - - /** Removes kerning override for the pair of glyphs. */ - remove_kerning(cache_index: int64, size: int64, glyph_pair: Vector2i): void - - /** Sets kerning for the pair of glyphs. */ - set_kerning(cache_index: int64, size: int64, glyph_pair: Vector2i, kerning: Vector2): void - - /** Returns kerning for the pair of glyphs. */ - get_kerning(cache_index: int64, size: int64, glyph_pair: Vector2i): Vector2 - - /** Renders the range of characters to the font cache texture. */ - render_range(cache_index: int64, size: Vector2i, start: int64, end: int64): void - - /** Renders specified glyph to the font cache texture. */ - render_glyph(cache_index: int64, size: Vector2i, index: int64): void - - /** Adds override for [method Font.is_language_supported]. */ - set_language_support_override(language: string, supported: boolean): void - - /** Returns `true` if support override is enabled for the [param language]. */ - get_language_support_override(language: string): boolean - - /** Remove language support override. */ - remove_language_support_override(language: string): void - - /** Returns list of language support overrides. */ - get_language_support_overrides(): PackedStringArray - - /** Adds override for [method Font.is_script_supported]. */ - set_script_support_override(script: string, supported: boolean): void - - /** Returns `true` if support override is enabled for the [param script]. */ - get_script_support_override(script: string): boolean - - /** Removes script support override. */ - remove_script_support_override(script: string): void - - /** Returns list of script support overrides. */ - get_script_support_overrides(): PackedStringArray - - /** Returns the glyph index of a [param char], optionally modified by the [param variation_selector]. */ - get_glyph_index(size: int64, char: int64, variation_selector: int64): int64 - - /** Returns character code associated with [param glyph_index], or `0` if [param glyph_index] is invalid. See [method get_glyph_index]. */ - get_char_from_glyph_index(size: int64, glyph_index: int64): int64 - - /** Contents of the dynamic font source file. */ - get data(): PackedByteArray - set data(value: PackedByteArray | byte[] | ArrayBuffer) - - /** If set to `true`, generate mipmaps for the font textures. */ - get generate_mipmaps(): boolean - set generate_mipmaps(value: boolean) - - /** If set to `true`, embedded font bitmap loading is disabled (bitmap-only and color fonts ignore this property). */ - get disable_embedded_bitmaps(): boolean - set disable_embedded_bitmaps(value: boolean) - - /** Font anti-aliasing mode. */ - get antialiasing(): int64 - set antialiasing(value: int64) - - /** Font family name. */ - get font_name(): string - set font_name(value: string) - - /** Font style name. */ - get style_name(): string - set style_name(value: string) - - /** Font style flags, see [enum TextServer.FontStyle]. */ - get font_style(): int64 - set font_style(value: int64) - - /** Weight (boldness) of the font. A value in the `100...999` range, normal font weight is `400`, bold font weight is `700`. */ - get font_weight(): int64 - set font_weight(value: int64) - - /** Font stretch amount, compared to a normal width. A percentage value between `50%` and `200%`. */ - get font_stretch(): int64 - set font_stretch(value: int64) - - /** Font glyph subpixel positioning mode. Subpixel positioning provides shaper text and better kerning for smaller font sizes, at the cost of higher memory usage and lower font rasterization speed. Use [constant TextServer.SUBPIXEL_POSITIONING_AUTO] to automatically enable it based on the font size. */ - get subpixel_positioning(): int64 - set subpixel_positioning(value: int64) - - /** If set to `true`, glyphs of all sizes are rendered using single multichannel signed distance field (MSDF) generated from the dynamic font vector data. Since this approach does not rely on rasterizing the font every time its size changes, this allows for resizing the font in real-time without any performance penalty. Text will also not look grainy for [Control]s that are scaled down (or for [Label3D]s viewed from a long distance). As a downside, font hinting is not available with MSDF. The lack of font hinting may result in less crisp and less readable fonts at small sizes. - * - * **Note:** If using font outlines, [member msdf_pixel_range] must be set to at least *twice* the size of the largest font outline. - * - * **Note:** MSDF font rendering does not render glyphs with overlapping shapes correctly. Overlapping shapes are not valid per the OpenType standard, but are still commonly found in many font files, especially those converted by Google Fonts. To avoid issues with overlapping glyphs, consider downloading the font file directly from the type foundry instead of relying on Google Fonts. - */ - get multichannel_signed_distance_field(): boolean - set multichannel_signed_distance_field(value: boolean) - - /** The width of the range around the shape between the minimum and maximum representable signed distance. If using font outlines, [member msdf_pixel_range] must be set to at least *twice* the size of the largest font outline. The default [member msdf_pixel_range] value of `16` allows outline sizes up to `8` to look correct. */ - get msdf_pixel_range(): int64 - set msdf_pixel_range(value: int64) - - /** Source font size used to generate MSDF textures. Higher values allow for more precision, but are slower to render and require more memory. Only increase this value if you notice a visible lack of precision in glyph rendering. */ - get msdf_size(): int64 - set msdf_size(value: int64) - - /** If set to `true`, system fonts can be automatically used as fallbacks. */ - get allow_system_fallback(): boolean - set allow_system_fallback(value: boolean) - - /** If set to `true`, auto-hinting is supported and preferred over font built-in hinting. Used by dynamic fonts only (MSDF fonts don't support hinting). */ - get force_autohinter(): boolean - set force_autohinter(value: boolean) - - /** Font hinting mode. Used by dynamic fonts only. */ - get hinting(): int64 - set hinting(value: int64) - - /** Font oversampling factor. If set to `0.0`, the global oversampling factor is used instead. Used by dynamic fonts only (MSDF fonts ignore oversampling). */ - get oversampling(): float64 - set oversampling(value: float64) - - /** Font size, used only for the bitmap fonts. */ - get fixed_size(): int64 - set fixed_size(value: int64) - - /** Scaling mode, used only for the bitmap fonts with [member fixed_size] greater than zero. */ - get fixed_size_scale_mode(): int64 - set fixed_size_scale_mode(value: int64) - - /** Font OpenType feature set override. */ - get opentype_feature_overrides(): GDictionary - set opentype_feature_overrides(value: GDictionary) - } - class FontPreview extends Control { - constructor(identifier?: any) - } - /** A variation of a font with additional settings. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_fontvariation.html - */ - class FontVariation extends Font { - constructor(identifier?: any) - /** Sets the spacing for [param spacing] (see [enum TextServer.SpacingType]) to [param value] in pixels (not relative to the font size). */ - set_spacing(spacing: TextServer.SpacingType, value: int64): void - - /** Base font used to create a variation. If not set, default [Theme] font is used. */ - get base_font(): Font - set base_font(value: Font) - - /** Font OpenType variation coordinates. More info: [url=https://docs.microsoft.com/en-us/typography/opentype/spec/dvaraxisreg]OpenType variation tags[/url]. - * - * **Note:** This [Dictionary] uses OpenType tags as keys. Variation axes can be identified both by tags ([int], e.g. `0x77678674`) and names ([String], e.g. `wght`). Some axes might be accessible by multiple names. For example, `wght` refers to the same axis as `weight`. Tags on the other hand are unique. To convert between names and tags, use [method TextServer.name_to_tag] and [method TextServer.tag_to_name]. - * - * **Note:** To get available variation axes of a font, use [method Font.get_supported_variation_list]. - */ - get variation_opentype(): GDictionary - set variation_opentype(value: GDictionary) - - /** Active face index in the TrueType / OpenType collection file. */ - get variation_face_index(): int64 - set variation_face_index(value: int64) - - /** If is not equal to zero, emboldens the font outlines. Negative values reduce the outline thickness. - * - * **Note:** Emboldened fonts might have self-intersecting outlines, which will prevent MSDF fonts and [TextMesh] from working correctly. - */ - get variation_embolden(): float64 - set variation_embolden(value: float64) - - /** 2D transform, applied to the font outlines, can be used for slanting, flipping and rotating glyphs. - * For example, to simulate italic typeface by slanting, apply the following transform `Transform2D(1.0, slant, 0.0, 1.0, 0.0, 0.0)`. - */ - get variation_transform(): Transform2D - set variation_transform(value: Transform2D) - - /** A set of OpenType feature tags. More info: [url=https://docs.microsoft.com/en-us/typography/opentype/spec/featuretags]OpenType feature tags[/url]. */ - get opentype_features(): GDictionary - set opentype_features(value: GDictionary) - - /** Extra spacing between graphical glyphs. */ - get spacing_glyph(): int64 - set spacing_glyph(value: int64) - - /** Extra width of the space glyphs. */ - get spacing_space(): int64 - set spacing_space(value: int64) - - /** Extra spacing at the top of the line in pixels. */ - get spacing_top(): int64 - set spacing_top(value: int64) - - /** Extra spacing at the bottom of the line in pixels. */ - get spacing_bottom(): int64 - set spacing_bottom(value: int64) - - /** Extra baseline offset (as a fraction of font height). */ - get baseline_offset(): float64 - set baseline_offset(value: float64) - } - /** Framebuffer cache manager for Rendering Device based renderers. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_framebuffercacherd.html - */ - class FramebufferCacheRD extends Object { - constructor(identifier?: any) - /** Creates, or obtains a cached, framebuffer. [param textures] lists textures accessed. [param passes] defines the subpasses and texture allocation, if left empty a single pass is created and textures are allocated depending on their usage flags. [param views] defines the number of views used when rendering. */ - static get_cache_multipass(textures: GArray, passes: GArray, views: int64): RID - } - namespace GDExtension { - enum InitializationLevel { - /** The library is initialized at the same time as the core features of the engine. */ - INITIALIZATION_LEVEL_CORE = 0, - - /** The library is initialized at the same time as the engine's servers (such as [RenderingServer] or [PhysicsServer3D]). */ - INITIALIZATION_LEVEL_SERVERS = 1, - - /** The library is initialized at the same time as the engine's scene-related classes. */ - INITIALIZATION_LEVEL_SCENE = 2, - - /** The library is initialized at the same time as the engine's editor classes. Only happens when loading the GDExtension in the editor. */ - INITIALIZATION_LEVEL_EDITOR = 3, - } - } - /** A native library for GDExtension. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_gdextension.html - */ - class GDExtension extends Resource { - constructor(identifier?: any) - /** Returns `true` if this extension's library has been opened. */ - is_library_open(): boolean - - /** Returns the lowest level required for this extension to be properly initialized (see the [enum InitializationLevel] enum). */ - get_minimum_library_initialization_level(): GDExtension.InitializationLevel - } - class GDScriptLanguageServer extends EditorPlugin { - constructor(identifier?: any) - } - /** @link https://docs.godotengine.org/en/4.3/classes/class_gdscripttextdocument.html */ - class GDScriptTextDocument extends RefCounted { - constructor(identifier?: any) - didOpen(_unnamed_arg0: any): void - didClose(_unnamed_arg0: any): void - didChange(_unnamed_arg0: any): void - willSaveWaitUntil(_unnamed_arg0: any): void - didSave(_unnamed_arg0: any): void - nativeSymbol(_unnamed_arg0: GDictionary): any - documentSymbol(_unnamed_arg0: GDictionary): GArray - completion(_unnamed_arg0: GDictionary): GArray - resolve(_unnamed_arg0: GDictionary): GDictionary - rename(_unnamed_arg0: GDictionary): GDictionary - prepareRename(_unnamed_arg0: GDictionary): any - references(_unnamed_arg0: GDictionary): GArray - foldingRange(_unnamed_arg0: GDictionary): GArray - codeLens(_unnamed_arg0: GDictionary): GArray - documentLink(_unnamed_arg0: GDictionary): GArray - colorPresentation(_unnamed_arg0: GDictionary): GArray - hover(_unnamed_arg0: GDictionary): any - definition(_unnamed_arg0: GDictionary): GArray - declaration(_unnamed_arg0: GDictionary): any - signatureHelp(_unnamed_arg0: GDictionary): any - show_native_symbol_in_editor(_unnamed_arg0: string): void - } - /** @link https://docs.godotengine.org/en/4.3/classes/class_gdscriptworkspace.html */ - class GDScriptWorkspace extends RefCounted { - constructor(identifier?: any) - apply_new_signal(_unnamed_arg0: Object, _unnamed_arg1: string, _unnamed_arg2: PackedStringArray | string[]): void - didDeleteFiles(_unnamed_arg0: GDictionary): void - parse_script(path: string, content: string): GError - parse_local_script(path: string): GError - get_file_path(uri: string): string - get_file_uri(path: string): string - publish_diagnostics(path: string): void - generate_script_api(path: string): GDictionary - } - namespace GLTFAccessor { - enum GLTFAccessorType { - /** Accessor type "SCALAR". For the glTF object model, this can be used to map to a single float, int, or bool value, or a float array. */ - TYPE_SCALAR = 0, - - /** Accessor type "VEC2". For the glTF object model, this maps to "float2", represented in the glTF JSON as an array of two floats. */ - TYPE_VEC2 = 1, - - /** Accessor type "VEC3". For the glTF object model, this maps to "float3", represented in the glTF JSON as an array of three floats. */ - TYPE_VEC3 = 2, - - /** Accessor type "VEC4". For the glTF object model, this maps to "float4", represented in the glTF JSON as an array of four floats. */ - TYPE_VEC4 = 3, - - /** Accessor type "MAT2". For the glTF object model, this maps to "float2x2", represented in the glTF JSON as an array of four floats. */ - TYPE_MAT2 = 4, - - /** Accessor type "MAT3". For the glTF object model, this maps to "float3x3", represented in the glTF JSON as an array of nine floats. */ - TYPE_MAT3 = 5, - - /** Accessor type "MAT4". For the glTF object model, this maps to "float4x4", represented in the glTF JSON as an array of sixteen floats. */ - TYPE_MAT4 = 6, - } - } - /** Represents a GLTF accessor. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_gltfaccessor.html - */ - class GLTFAccessor extends Resource { - constructor(identifier?: any) - /** The index of the buffer view this accessor is referencing. If `-1`, this accessor is not referencing any buffer view. */ - get buffer_view(): int64 - set buffer_view(value: int64) - - /** The offset relative to the start of the buffer view in bytes. */ - get byte_offset(): int64 - set byte_offset(value: int64) - - /** The GLTF component type as an enum. Possible values are 5120 for "BYTE", 5121 for "UNSIGNED_BYTE", 5122 for "SHORT", 5123 for "UNSIGNED_SHORT", 5125 for "UNSIGNED_INT", and 5126 for "FLOAT". A value of 5125 or "UNSIGNED_INT" must not be used for any accessor that is not referenced by mesh.primitive.indices. */ - get component_type(): int64 - set component_type(value: int64) - - /** Specifies whether integer data values are normalized before usage. */ - get normalized(): boolean - set normalized(value: boolean) - - /** The number of elements referenced by this accessor. */ - get count(): int64 - set count(value: int64) - - /** The GLTF accessor type as an enum. Possible values are 0 for "SCALAR", 1 for "VEC2", 2 for "VEC3", 3 for "VEC4", 4 for "MAT2", 5 for "MAT3", and 6 for "MAT4". */ - get accessor_type(): int64 - set accessor_type(value: int64) - - /** The GLTF accessor type as an enum. Use [member accessor_type] instead. */ - get type(): int64 - set type(value: int64) - - /** Minimum value of each component in this accessor. */ - get min(): PackedFloat64Array - set min(value: PackedFloat64Array | float64[]) - - /** Maximum value of each component in this accessor. */ - get max(): PackedFloat64Array - set max(value: PackedFloat64Array | float64[]) - - /** Number of deviating accessor values stored in the sparse array. */ - get sparse_count(): int64 - set sparse_count(value: int64) - - /** The index of the buffer view with sparse indices. The referenced buffer view MUST NOT have its target or byteStride properties defined. The buffer view and the optional byteOffset MUST be aligned to the componentType byte length. */ - get sparse_indices_buffer_view(): int64 - set sparse_indices_buffer_view(value: int64) - - /** The offset relative to the start of the buffer view in bytes. */ - get sparse_indices_byte_offset(): int64 - set sparse_indices_byte_offset(value: int64) - - /** The indices component data type as an enum. Possible values are 5121 for "UNSIGNED_BYTE", 5123 for "UNSIGNED_SHORT", and 5125 for "UNSIGNED_INT". */ - get sparse_indices_component_type(): int64 - set sparse_indices_component_type(value: int64) - - /** The index of the bufferView with sparse values. The referenced buffer view MUST NOT have its target or byteStride properties defined. */ - get sparse_values_buffer_view(): int64 - set sparse_values_buffer_view(value: int64) - - /** The offset relative to the start of the bufferView in bytes. */ - get sparse_values_byte_offset(): int64 - set sparse_values_byte_offset(value: int64) - } - /** @link https://docs.godotengine.org/en/4.3/classes/class_gltfanimation.html */ - class GLTFAnimation extends Resource { - constructor(identifier?: any) - /** Gets additional arbitrary data in this [GLTFAnimation] instance. This can be used to keep per-node state data in [GLTFDocumentExtension] classes, which is important because they are stateless. - * The argument should be the [GLTFDocumentExtension] name (does not have to match the extension name in the GLTF file), and the return value can be anything you set. If nothing was set, the return value is null. - */ - get_additional_data(extension_name: StringName): any - - /** Sets additional arbitrary data in this [GLTFAnimation] instance. This can be used to keep per-node state data in [GLTFDocumentExtension] classes, which is important because they are stateless. - * The first argument should be the [GLTFDocumentExtension] name (does not have to match the extension name in the GLTF file), and the second argument can be anything you want. - */ - set_additional_data(extension_name: StringName, additional_data: any): void - - /** The original name of the animation. */ - get original_name(): string - set original_name(value: string) - get loop(): boolean - set loop(value: boolean) - } - /** Represents a GLTF buffer view. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_gltfbufferview.html - */ - class GLTFBufferView extends Resource { - constructor(identifier?: any) - /** Loads the buffer view data from the buffer referenced by this buffer view in the given [GLTFState]. Interleaved data with a byte stride is not yet supported by this method. The data is returned as a [PackedByteArray]. */ - load_buffer_view_data(state: GLTFState): PackedByteArray - - /** The index of the buffer this buffer view is referencing. If `-1`, this buffer view is not referencing any buffer. */ - get buffer(): int64 - set buffer(value: int64) - - /** The offset, in bytes, from the start of the buffer to the start of this buffer view. */ - get byte_offset(): int64 - set byte_offset(value: int64) - - /** The length, in bytes, of this buffer view. If `0`, this buffer view is empty. */ - get byte_length(): int64 - set byte_length(value: int64) - - /** The stride, in bytes, between interleaved data. If `-1`, this buffer view is not interleaved. */ - get byte_stride(): int64 - set byte_stride(value: int64) - - /** True if the GLTFBufferView's OpenGL GPU buffer type is an `ELEMENT_ARRAY_BUFFER` used for vertex indices (integer constant `34963`). False if the buffer type is any other value. See [url=https://github.com/KhronosGroup/glTF-Tutorials/blob/master/gltfTutorial/gltfTutorial_005_BuffersBufferViewsAccessors.md]Buffers, BufferViews, and Accessors[/url] for possible values. This property is set on import and used on export. */ - get indices(): boolean - set indices(value: boolean) - - /** True if the GLTFBufferView's OpenGL GPU buffer type is an `ARRAY_BUFFER` used for vertex attributes (integer constant `34962`). False if the buffer type is any other value. See [url=https://github.com/KhronosGroup/glTF-Tutorials/blob/master/gltfTutorial/gltfTutorial_005_BuffersBufferViewsAccessors.md]Buffers, BufferViews, and Accessors[/url] for possible values. This property is set on import and used on export. */ - get vertex_attributes(): boolean - set vertex_attributes(value: boolean) - } - /** Represents a GLTF camera. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_gltfcamera.html - */ - class GLTFCamera extends Resource { - constructor(identifier?: any) - /** Create a new GLTFCamera instance from the given Godot [Camera3D] node. */ - static from_node(camera_node: Camera3D): GLTFCamera - - /** Converts this GLTFCamera instance into a Godot [Camera3D] node. */ - to_node(): Camera3D - - /** Creates a new GLTFCamera instance by parsing the given [Dictionary]. */ - static from_dictionary(dictionary: GDictionary): GLTFCamera - - /** Serializes this GLTFCamera instance into a [Dictionary]. */ - to_dictionary(): GDictionary - - /** Whether or not the camera is in perspective mode. If false, the camera is in orthographic/orthogonal mode. This maps to GLTF's camera `type` property. See [member Camera3D.projection] and the GLTF spec for more information. */ - get perspective(): boolean - set perspective(value: boolean) - - /** The FOV of the camera. This class and GLTF define the camera FOV in radians, while Godot uses degrees. This maps to GLTF's `yfov` property. This value is only used for perspective cameras, when [member perspective] is true. */ - get fov(): float64 - set fov(value: float64) - - /** The size of the camera. This class and GLTF define the camera size magnitude as a radius in meters, while Godot defines it as a diameter in meters. This maps to GLTF's `ymag` property. This value is only used for orthographic/orthogonal cameras, when [member perspective] is false. */ - get size_mag(): float64 - set size_mag(value: float64) - - /** The distance to the far culling boundary for this camera relative to its local Z axis, in meters. This maps to GLTF's `zfar` property. */ - get depth_far(): float64 - set depth_far(value: float64) - - /** The distance to the near culling boundary for this camera relative to its local Z axis, in meters. This maps to GLTF's `znear` property. */ - get depth_near(): float64 - set depth_near(value: float64) - } - namespace GLTFDocument { - enum RootNodeMode { - /** Treat the Godot scene's root node as the root node of the glTF file, and mark it as the single root node via the `GODOT_single_root` glTF extension. This will be parsed the same as [constant ROOT_NODE_MODE_KEEP_ROOT] if the implementation does not support `GODOT_single_root`. */ - ROOT_NODE_MODE_SINGLE_ROOT = 0, - - /** Treat the Godot scene's root node as the root node of the glTF file, but do not mark it as anything special. An extra root node will be generated when importing into Godot. This uses only vanilla glTF features. This is equivalent to the behavior in Godot 4.1 and earlier. */ - ROOT_NODE_MODE_KEEP_ROOT = 1, - - /** Treat the Godot scene's root node as the name of the glTF scene, and add all of its children as root nodes of the glTF file. This uses only vanilla glTF features. This avoids an extra root node, but only the name of the Godot scene's root node will be preserved, as it will not be saved as a node. */ - ROOT_NODE_MODE_MULTI_ROOT = 2, - } - } - /** Class for importing and exporting glTF files in and out of Godot. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_gltfdocument.html - */ - class GLTFDocument extends Resource { - constructor(identifier?: any) - /** Takes a path to a GLTF file and imports the data at that file path to the given [GLTFState] object through the [param state] parameter. - * - * **Note:** The [param base_path] tells [method append_from_file] where to find dependencies and can be empty. - */ - append_from_file(path: string, state: GLTFState, flags: int64 = 0, base_path: string = ''): GError - - /** Takes a [PackedByteArray] defining a GLTF and imports the data to the given [GLTFState] object through the [param state] parameter. - * - * **Note:** The [param base_path] tells [method append_from_buffer] where to find dependencies and can be empty. - */ - append_from_buffer(bytes: PackedByteArray | byte[] | ArrayBuffer, base_path: string, state: GLTFState, flags: int64 = 0): GError - - /** Takes a Godot Engine scene node and exports it and its descendants to the given [GLTFState] object through the [param state] parameter. */ - append_from_scene(node: Node, state: GLTFState, flags: int64 = 0): GError - - /** Takes a [GLTFState] object through the [param state] parameter and returns a Godot Engine scene node. - * The [param bake_fps] parameter overrides the bake_fps in [param state]. - */ - generate_scene(state: GLTFState, bake_fps: float64 = 30, trimming: boolean = false, remove_immutable_tracks: boolean = true): Node - - /** Takes a [GLTFState] object through the [param state] parameter and returns a GLTF [PackedByteArray]. */ - generate_buffer(state: GLTFState): PackedByteArray - - /** Takes a [GLTFState] object through the [param state] parameter and writes a glTF file to the filesystem. - * - * **Note:** The extension of the glTF file determines if it is a .glb binary file or a .gltf text file. - */ - write_to_filesystem(state: GLTFState, path: string): GError - - /** Registers the given [GLTFDocumentExtension] instance with GLTFDocument. If [param first_priority] is true, this extension will be run first. Otherwise, it will be run last. - * - * **Note:** Like GLTFDocument itself, all GLTFDocumentExtension classes must be stateless in order to function properly. If you need to store data, use the `set_additional_data` and `get_additional_data` methods in [GLTFState] or [GLTFNode]. - */ - static register_gltf_document_extension(extension: GLTFDocumentExtension, first_priority: boolean = false): void - - /** Unregisters the given [GLTFDocumentExtension] instance. */ - static unregister_gltf_document_extension(extension: GLTFDocumentExtension): void - - /** The user-friendly name of the export image format. This is used when exporting the GLTF file, including writing to a file and writing to a byte array. - * By default, Godot allows the following options: "None", "PNG", "JPEG", "Lossless WebP", and "Lossy WebP". Support for more image formats can be added in [GLTFDocumentExtension] classes. - */ - get image_format(): string - set image_format(value: string) - - /** If [member image_format] is a lossy image format, this determines the lossy quality of the image. On a range of `0.0` to `1.0`, where `0.0` is the lowest quality and `1.0` is the highest quality. A lossy quality of `1.0` is not the same as lossless. */ - get lossy_quality(): float64 - set lossy_quality(value: float64) - - /** How to process the root node during export. See [enum RootNodeMode] for details. The default and recommended value is [constant ROOT_NODE_MODE_SINGLE_ROOT]. - * - * **Note:** Regardless of how the glTF file is exported, when importing, the root node type and name can be overridden in the scene import settings tab. - */ - get root_node_mode(): int64 - set root_node_mode(value: int64) - } - /** [GLTFDocument] extension class. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_gltfdocumentextension.html - */ - class GLTFDocumentExtension extends Resource { - constructor(identifier?: any) - /** Part of the import process. This method is run first, before all other parts of the import process. - * The return value is used to determine if this [GLTFDocumentExtension] instance should be used for importing a given GLTF file. If [constant OK], the import will use this [GLTFDocumentExtension] instance. If not overridden, [constant OK] is returned. - */ - /* gdvirtual */ _import_preflight(state: GLTFState, extensions: PackedStringArray | string[]): GError - - /** Part of the import process. This method is run after [method _import_preflight] and before [method _parse_node_extensions]. - * Returns an array of the GLTF extensions supported by this GLTFDocumentExtension class. This is used to validate if a GLTF file with required extensions can be loaded. - */ - /* gdvirtual */ _get_supported_extensions(): PackedStringArray - - /** Part of the import process. This method is run after [method _get_supported_extensions] and before [method _import_post_parse]. - * Runs when parsing the node extensions of a GLTFNode. This method can be used to process the extension JSON data into a format that can be used by [method _generate_scene_node]. The return value should be a member of the [enum Error] enum. - */ - /* gdvirtual */ _parse_node_extensions(state: GLTFState, gltf_node: GLTFNode, extensions: GDictionary): GError - - /** Part of the import process. This method is run after [method _parse_node_extensions] and before [method _parse_texture_json]. - * Runs when parsing image data from a GLTF file. The data could be sourced from a separate file, a URI, or a buffer, and then is passed as a byte array. - */ - /* gdvirtual */ _parse_image_data(state: GLTFState, image_data: PackedByteArray | byte[] | ArrayBuffer, mime_type: string, ret_image: Image): GError - - /** Returns the file extension to use for saving image data into, for example, `".png"`. If defined, when this extension is used to handle images, and the images are saved to a separate file, the image bytes will be copied to a file with this extension. If this is set, there should be a [ResourceImporter] class able to import the file. If not defined or empty, Godot will save the image into a PNG file. */ - /* gdvirtual */ _get_image_file_extension(): string - - /** Part of the import process. This method is run after [method _parse_image_data] and before [method _generate_scene_node]. - * Runs when parsing the texture JSON from the GLTF textures array. This can be used to set the source image index to use as the texture. - */ - /* gdvirtual */ _parse_texture_json(state: GLTFState, texture_json: GDictionary, ret_gltf_texture: GLTFTexture): GError - - /** Part of the import process. This method is run after [method _import_post_parse] and before [method _import_node]. - * Runs when generating a Godot scene node from a GLTFNode. The returned node will be added to the scene tree. Multiple nodes can be generated in this step if they are added as a child of the returned node. - * - * **Note:** The [param scene_parent] parameter may be null if this is the single root node. - */ - /* gdvirtual */ _generate_scene_node(state: GLTFState, gltf_node: GLTFNode, scene_parent: Node): Node3D - - /** Part of the import process. This method is run after [method _parse_node_extensions] and before [method _generate_scene_node]. - * This method can be used to modify any of the data imported so far after parsing, before generating the nodes and then running the final per-node import step. - */ - /* gdvirtual */ _import_post_parse(state: GLTFState): GError - - /** Part of the import process. This method is run after [method _generate_scene_node] and before [method _import_post]. - * This method can be used to make modifications to each of the generated Godot scene nodes. - */ - /* gdvirtual */ _import_node(state: GLTFState, gltf_node: GLTFNode, json: GDictionary, node: Node): GError - - /** Part of the import process. This method is run last, after all other parts of the import process. - * This method can be used to modify the final Godot scene generated by the import process. - */ - /* gdvirtual */ _import_post(state: GLTFState, root: Node): GError - - /** Part of the export process. This method is run first, before all other parts of the export process. - * The return value is used to determine if this [GLTFDocumentExtension] instance should be used for exporting a given GLTF file. If [constant OK], the export will use this [GLTFDocumentExtension] instance. If not overridden, [constant OK] is returned. - */ - /* gdvirtual */ _export_preflight(state: GLTFState, root: Node): GError - - /** Part of the export process. This method is run after [method _export_preflight] and before [method _export_preserialize]. - * Runs when converting the data from a Godot scene node. This method can be used to process the Godot scene node data into a format that can be used by [method _export_node]. - */ - /* gdvirtual */ _convert_scene_node(state: GLTFState, gltf_node: GLTFNode, scene_node: Node): void - - /** Part of the export process. This method is run after [method _convert_scene_node] and before [method _get_saveable_image_formats]. - * This method can be used to alter the state before performing serialization. It runs every time when generating a buffer with [method GLTFDocument.generate_buffer] or writing to the file system with [method GLTFDocument.write_to_filesystem]. - */ - /* gdvirtual */ _export_preserialize(state: GLTFState): GError - - /** Part of the export process. This method is run after [method _convert_scene_node] and before [method _export_node]. - * Returns an array of the image formats that can be saved/exported by this extension. This extension will only be selected as the image exporter if the [GLTFDocument]'s [member GLTFDocument.image_format] is in this array. If this [GLTFDocumentExtension] is selected as the image exporter, one of the [method _save_image_at_path] or [method _serialize_image_to_bytes] methods will run next, otherwise [method _export_node] will run next. If the format name contains `"Lossy"`, the lossy quality slider will be displayed. - */ - /* gdvirtual */ _get_saveable_image_formats(): PackedStringArray - - /** Part of the export process. This method is run after [method _get_saveable_image_formats] and before [method _serialize_texture_json]. - * This method is run when embedding images in the GLTF file. When images are saved separately, [method _save_image_at_path] runs instead. Note that these methods only run when this [GLTFDocumentExtension] is selected as the image exporter. - * This method must set the image MIME type in the [param image_dict] with the `"mimeType"` key. For example, for a PNG image, it would be set to `"image/png"`. The return value must be a [PackedByteArray] containing the image data. - */ - /* gdvirtual */ _serialize_image_to_bytes(state: GLTFState, image: Image, image_dict: GDictionary, image_format: string, lossy_quality: float64): PackedByteArray - - /** Part of the export process. This method is run after [method _get_saveable_image_formats] and before [method _serialize_texture_json]. - * This method is run when saving images separately from the GLTF file. When images are embedded, [method _serialize_image_to_bytes] runs instead. Note that these methods only run when this [GLTFDocumentExtension] is selected as the image exporter. - */ - /* gdvirtual */ _save_image_at_path(state: GLTFState, image: Image, file_path: string, image_format: string, lossy_quality: float64): GError - - /** Part of the export process. This method is run after [method _save_image_at_path] or [method _serialize_image_to_bytes], and before [method _export_node]. Note that this method only runs when this [GLTFDocumentExtension] is selected as the image exporter. - * This method can be used to set up the extensions for the texture JSON by editing [param texture_json]. The extension must also be added as used extension with [method GLTFState.add_used_extension], be sure to set `required` to `true` if you are not providing a fallback. - */ - /* gdvirtual */ _serialize_texture_json(state: GLTFState, texture_json: GDictionary, gltf_texture: GLTFTexture, image_format: string): GError - - /** Part of the export process. This method is run after [method _get_saveable_image_formats] and before [method _export_post]. If this [GLTFDocumentExtension] is used for exporting images, this runs after [method _serialize_texture_json]. - * This method can be used to modify the final JSON of each node. Data should be primarily stored in [param gltf_node] prior to serializing the JSON, but the original Godot [param node] is also provided if available. The node may be null if not available, such as when exporting GLTF data not generated from a Godot scene. - */ - /* gdvirtual */ _export_node(state: GLTFState, gltf_node: GLTFNode, json: GDictionary, node: Node): GError - - /** Part of the export process. This method is run last, after all other parts of the export process. - * This method can be used to modify the final JSON of the generated GLTF file. - */ - /* gdvirtual */ _export_post(state: GLTFState): GError - } - /** @link https://docs.godotengine.org/en/4.3/classes/class_gltfdocumentextensionconvertimportermesh.html */ - class GLTFDocumentExtensionConvertImporterMesh extends GLTFDocumentExtension { - constructor(identifier?: any) - } - class GLTFDocumentExtensionPhysics extends GLTFDocumentExtension { - constructor(identifier?: any) - } - class GLTFDocumentExtensionTextureKTX extends GLTFDocumentExtension { - constructor(identifier?: any) - } - class GLTFDocumentExtensionTextureWebP extends GLTFDocumentExtension { - constructor(identifier?: any) - } - /** Represents a GLTF light. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_gltflight.html - */ - class GLTFLight extends Resource { - constructor(identifier?: any) - /** Create a new GLTFLight instance from the given Godot [Light3D] node. */ - static from_node(light_node: Light3D): GLTFLight - - /** Converts this GLTFLight instance into a Godot [Light3D] node. */ - to_node(): Light3D - - /** Creates a new GLTFLight instance by parsing the given [Dictionary]. */ - static from_dictionary(dictionary: GDictionary): GLTFLight - - /** Serializes this GLTFLight instance into a [Dictionary]. */ - to_dictionary(): GDictionary - get_additional_data(extension_name: StringName): any - set_additional_data(extension_name: StringName, additional_data: any): void - - /** The [Color] of the light. Defaults to white. A black color causes the light to have no effect. */ - get color(): Color - set color(value: Color) - - /** The intensity of the light. This is expressed in candelas (lumens per steradian) for point and spot lights, and lux (lumens per m²) for directional lights. When creating a Godot light, this value is converted to a unitless multiplier. */ - get intensity(): float64 - set intensity(value: float64) - - /** The type of the light. The values accepted by Godot are "point", "spot", and "directional", which correspond to Godot's [OmniLight3D], [SpotLight3D], and [DirectionalLight3D] respectively. */ - get light_type(): string - set light_type(value: string) - - /** The range of the light, beyond which the light has no effect. GLTF lights with no range defined behave like physical lights (which have infinite range). When creating a Godot light, the range is clamped to 4096. */ - get range(): float64 - set range(value: float64) - - /** The inner angle of the cone in a spotlight. Must be less than or equal to the outer cone angle. - * Within this angle, the light is at full brightness. Between the inner and outer cone angles, there is a transition from full brightness to zero brightness. When creating a Godot [SpotLight3D], the ratio between the inner and outer cone angles is used to calculate the attenuation of the light. - */ - get inner_cone_angle(): float64 - set inner_cone_angle(value: float64) - - /** The outer angle of the cone in a spotlight. Must be greater than or equal to the inner angle. - * At this angle, the light drops off to zero brightness. Between the inner and outer cone angles, there is a transition from full brightness to zero brightness. If this angle is a half turn, then the spotlight emits in all directions. When creating a Godot [SpotLight3D], the outer cone angle is used as the angle of the spotlight. - */ - get outer_cone_angle(): float64 - set outer_cone_angle(value: float64) - } - /** GLTFMesh represents a GLTF mesh. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_gltfmesh.html - */ - class GLTFMesh extends Resource { - constructor(identifier?: any) - /** Gets additional arbitrary data in this [GLTFMesh] instance. This can be used to keep per-node state data in [GLTFDocumentExtension] classes, which is important because they are stateless. - * The argument should be the [GLTFDocumentExtension] name (does not have to match the extension name in the GLTF file), and the return value can be anything you set. If nothing was set, the return value is null. - */ - get_additional_data(extension_name: StringName): any - - /** Sets additional arbitrary data in this [GLTFMesh] instance. This can be used to keep per-node state data in [GLTFDocumentExtension] classes, which is important because they are stateless. - * The first argument should be the [GLTFDocumentExtension] name (does not have to match the extension name in the GLTF file), and the second argument can be anything you want. - */ - set_additional_data(extension_name: StringName, additional_data: any): void - - /** The original name of the mesh. */ - get original_name(): string - set original_name(value: string) - - /** The [ImporterMesh] object representing the mesh itself. */ - get mesh(): Object - set mesh(value: Object) - - /** An array of floats representing the blend weights of the mesh. */ - get blend_weights(): PackedFloat32Array - set blend_weights(value: PackedFloat32Array | float32[]) - - /** An array of Material objects representing the materials used in the mesh. */ - get instance_materials(): GArray - set instance_materials(value: GArray) - } - /** GLTF node class. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_gltfnode.html - */ - class GLTFNode extends Resource { - constructor(identifier?: any) - /** Gets additional arbitrary data in this [GLTFNode] instance. This can be used to keep per-node state data in [GLTFDocumentExtension] classes, which is important because they are stateless. - * The argument should be the [GLTFDocumentExtension] name (does not have to match the extension name in the GLTF file), and the return value can be anything you set. If nothing was set, the return value is null. - */ - get_additional_data(extension_name: StringName): any - - /** Sets additional arbitrary data in this [GLTFNode] instance. This can be used to keep per-node state data in [GLTFDocumentExtension] classes, which is important because they are stateless. - * The first argument should be the [GLTFDocumentExtension] name (does not have to match the extension name in the GLTF file), and the second argument can be anything you want. - */ - set_additional_data(extension_name: StringName, additional_data: any): void - - /** The original name of the node. */ - get original_name(): string - set original_name(value: string) - - /** The index of the parent node in the [GLTFState]. If -1, this node is a root node. */ - get parent(): int64 - set parent(value: int64) - - /** How deep into the node hierarchy this node is. A root node will have a height of 0, its children will have a height of 1, and so on. If -1, the height has not been calculated. */ - get height(): int64 - set height(value: int64) - - /** The transform of the GLTF node relative to its parent. This property is usually unused since the position, rotation, and scale properties are preferred. */ - get xform(): Transform3D - set xform(value: Transform3D) - - /** If this GLTF node is a mesh, the index of the [GLTFMesh] in the [GLTFState] that describes the mesh's properties. If -1, this node is not a mesh. */ - get mesh(): int64 - set mesh(value: int64) - - /** If this GLTF node is a camera, the index of the [GLTFCamera] in the [GLTFState] that describes the camera's properties. If -1, this node is not a camera. */ - get camera(): int64 - set camera(value: int64) - - /** If this GLTF node has a skin, the index of the [GLTFSkin] in the [GLTFState] that describes the skin's properties. If -1, this node does not have a skin. */ - get skin(): int64 - set skin(value: int64) - - /** If this GLTF node has a skeleton, the index of the [GLTFSkeleton] in the [GLTFState] that describes the skeleton's properties. If -1, this node does not have a skeleton. */ - get skeleton(): int64 - set skeleton(value: int64) - - /** The position of the GLTF node relative to its parent. */ - get position(): Vector3 - set position(value: Vector3) - - /** The rotation of the GLTF node relative to its parent. */ - get rotation(): Quaternion - set rotation(value: Quaternion) - - /** The scale of the GLTF node relative to its parent. */ - get scale(): Vector3 - set scale(value: Vector3) - - /** The indices of the child nodes in the [GLTFState]. If this GLTF node has no children, this will be an empty array. */ - get children(): PackedInt32Array - set children(value: PackedInt32Array | int32[]) - - /** If this GLTF node is a light, the index of the [GLTFLight] in the [GLTFState] that describes the light's properties. If -1, this node is not a light. */ - get light(): int64 - set light(value: int64) - } - /** Represents a GLTF physics body. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_gltfphysicsbody.html - */ - class GLTFPhysicsBody extends Resource { - constructor(identifier?: any) - /** Creates a new GLTFPhysicsBody instance from the given Godot [CollisionObject3D] node. */ - static from_node(body_node: CollisionObject3D): GLTFPhysicsBody - - /** Converts this GLTFPhysicsBody instance into a Godot [CollisionObject3D] node. */ - to_node(): CollisionObject3D - - /** Creates a new GLTFPhysicsBody instance by parsing the given [Dictionary] in the `OMI_physics_body` GLTF extension format. */ - static from_dictionary(dictionary: GDictionary): GLTFPhysicsBody - - /** Serializes this GLTFPhysicsBody instance into a [Dictionary]. It will be in the format expected by the `OMI_physics_body` GLTF extension. */ - to_dictionary(): GDictionary - - /** The type of the body. When importing, this controls what type of [CollisionObject3D] node Godot should generate. Valid values are "static", "animatable", "character", "rigid", "vehicle", and "trigger". When exporting, this will be squashed down to one of "static", "kinematic", or "dynamic" motion types, or the "trigger" property. */ - get body_type(): string - set body_type(value: string) - - /** The mass of the physics body, in kilograms. This is only used when the body type is "rigid" or "vehicle". */ - get mass(): float64 - set mass(value: float64) - - /** The linear velocity of the physics body, in meters per second. This is only used when the body type is "rigid" or "vehicle". */ - get linear_velocity(): Vector3 - set linear_velocity(value: Vector3) - - /** The angular velocity of the physics body, in radians per second. This is only used when the body type is "rigid" or "vehicle". */ - get angular_velocity(): Vector3 - set angular_velocity(value: Vector3) - - /** The center of mass of the body, in meters. This is in local space relative to the body. By default, the center of the mass is the body's origin. */ - get center_of_mass(): Vector3 - set center_of_mass(value: Vector3) - - /** The inertia strength of the physics body, in kilogram meter squared (kg⋅m²). This represents the inertia around the principle axes, the diagonal of the inertia tensor matrix. This is only used when the body type is "rigid" or "vehicle". - * When converted to a Godot [RigidBody3D] node, if this value is zero, then the inertia will be calculated automatically. - */ - get inertia_diagonal(): Vector3 - set inertia_diagonal(value: Vector3) - - /** The inertia orientation of the physics body. This defines the rotation of the inertia's principle axes relative to the object's local axes. This is only used when the body type is "rigid" or "vehicle" and [member inertia_diagonal] is set to a non-zero value. */ - get inertia_orientation(): Quaternion - set inertia_orientation(value: Quaternion) - - /** The inertia tensor of the physics body, in kilogram meter squared (kg⋅m²). This is only used when the body type is "rigid" or "vehicle". - * When converted to a Godot [RigidBody3D] node, if this value is zero, then the inertia will be calculated automatically. - */ - get inertia_tensor(): Basis - set inertia_tensor(value: Basis) - } - /** Represents a GLTF physics shape. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_gltfphysicsshape.html - */ - class GLTFPhysicsShape extends Resource { - constructor(identifier?: any) - /** Creates a new GLTFPhysicsShape instance from the given Godot [CollisionShape3D] node. */ - static from_node(shape_node: CollisionShape3D): GLTFPhysicsShape - - /** Converts this GLTFPhysicsShape instance into a Godot [CollisionShape3D] node. */ - to_node(cache_shapes: boolean = false): CollisionShape3D - - /** Creates a new GLTFPhysicsShape instance from the given Godot [Shape3D] resource. */ - static from_resource(shape_resource: Shape3D): GLTFPhysicsShape - - /** Converts this GLTFPhysicsShape instance into a Godot [Shape3D] resource. */ - to_resource(cache_shapes: boolean = false): Shape3D - - /** Creates a new GLTFPhysicsShape instance by parsing the given [Dictionary]. */ - static from_dictionary(dictionary: GDictionary): GLTFPhysicsShape - - /** Serializes this GLTFPhysicsShape instance into a [Dictionary] in the format defined by `OMI_physics_shape`. */ - to_dictionary(): GDictionary - - /** The type of shape this shape represents. Valid values are "box", "capsule", "cylinder", "sphere", "hull", and "trimesh". */ - get shape_type(): string - set shape_type(value: string) - - /** The size of the shape, in meters. This is only used when the shape type is "box", and it represents the "diameter" of the box. This value should not be negative. */ - get size(): Vector3 - set size(value: Vector3) - - /** The radius of the shape, in meters. This is only used when the shape type is "capsule", "cylinder", or "sphere". This value should not be negative. */ - get radius(): float64 - set radius(value: float64) - - /** The height of the shape, in meters. This is only used when the shape type is "capsule" or "cylinder". This value should not be negative, and for "capsule" it should be at least twice the radius. */ - get height(): float64 - set height(value: float64) - - /** If `true`, indicates that this shape is a trigger. For Godot, this means that the shape should be a child of an Area3D node. - * This is the only variable not used in the [method to_node] method, it's intended to be used alongside when deciding where to add the generated node as a child. - */ - get is_trigger(): boolean - set is_trigger(value: boolean) - - /** The index of the shape's mesh in the GLTF file. This is only used when the shape type is "hull" (convex hull) or "trimesh" (concave trimesh). */ - get mesh_index(): int64 - set mesh_index(value: int64) - - /** The [ImporterMesh] resource of the shape. This is only used when the shape type is "hull" (convex hull) or "trimesh" (concave trimesh). */ - get importer_mesh(): ImporterMesh - set importer_mesh(value: ImporterMesh) - } - /** @link https://docs.godotengine.org/en/4.3/classes/class_gltfskeleton.html */ - class GLTFSkeleton extends Resource { - constructor(identifier?: any) - get_godot_skeleton(): Skeleton3D - get_bone_attachment_count(): int64 - get_bone_attachment(idx: int64): BoneAttachment3D - get joints(): PackedInt32Array - set joints(value: PackedInt32Array | int32[]) - get roots(): PackedInt32Array - set roots(value: PackedInt32Array | int32[]) - get unique_names(): GArray - set unique_names(value: GArray) - get godot_bone_node(): GDictionary - set godot_bone_node(value: GDictionary) - } - /** @link https://docs.godotengine.org/en/4.3/classes/class_gltfskin.html */ - class GLTFSkin extends Resource { - constructor(identifier?: any) - get skin_root(): int64 - set skin_root(value: int64) - get joints_original(): PackedInt32Array - set joints_original(value: PackedInt32Array | int32[]) - get inverse_binds(): GArray - set inverse_binds(value: GArray) - get joints(): PackedInt32Array - set joints(value: PackedInt32Array | int32[]) - get non_joints(): PackedInt32Array - set non_joints(value: PackedInt32Array | int32[]) - get roots(): PackedInt32Array - set roots(value: PackedInt32Array | int32[]) - get skeleton(): int64 - set skeleton(value: int64) - get joint_i_to_bone_i(): GDictionary - set joint_i_to_bone_i(value: GDictionary) - get joint_i_to_name(): GDictionary - set joint_i_to_name(value: GDictionary) - get godot_skin(): Skin - set godot_skin(value: Skin) - } - /** Archived GLTF extension for specular/glossy materials. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_gltfspecgloss.html - */ - class GLTFSpecGloss extends Resource { - constructor(identifier?: any) - /** The diffuse texture. */ - get diffuse_img(): Object - set diffuse_img(value: Object) - - /** The reflected diffuse factor of the material. */ - get diffuse_factor(): Color - set diffuse_factor(value: Color) - - /** The glossiness or smoothness of the material. */ - get gloss_factor(): float64 - set gloss_factor(value: float64) - - /** The specular RGB color of the material. The alpha channel is unused. */ - get specular_factor(): Color - set specular_factor(value: Color) - - /** The specular-glossiness texture. */ - get spec_gloss_img(): Object - set spec_gloss_img(value: Object) - } - /** Represents all data of a GLTF file. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_gltfstate.html - */ - class GLTFState extends Resource { - /** Discards all embedded textures and uses untextured materials. */ - static readonly HANDLE_BINARY_DISCARD_TEXTURES = 0 - - /** Extracts embedded textures to be reimported and compressed. Editor only. Acts as uncompressed at runtime. */ - static readonly HANDLE_BINARY_EXTRACT_TEXTURES = 1 - - /** Embeds textures VRAM compressed with Basis Universal into the generated scene. */ - static readonly HANDLE_BINARY_EMBED_AS_BASISU = 2 - - /** Embeds textures compressed losslessly into the generated scene, matching old behavior. */ - static readonly HANDLE_BINARY_EMBED_AS_UNCOMPRESSED = 3 - constructor(identifier?: any) - - /** Appends an extension to the list of extensions used by this GLTF file during serialization. If [param required] is true, the extension will also be added to the list of required extensions. Do not run this in [method GLTFDocumentExtension._export_post], as that stage is too late to add extensions. The final list is sorted alphabetically. */ - add_used_extension(extension_name: string, required: boolean): void - - /** Appends the given byte array data to the buffers and creates a [GLTFBufferView] for it. The index of the destination [GLTFBufferView] is returned. If [param deduplication] is true, the buffers will first be searched for duplicate data, otherwise new bytes will always be appended. */ - append_data_to_buffers(data: PackedByteArray | byte[] | ArrayBuffer, deduplication: boolean): int64 - - /** Returns the number of [AnimationPlayer] nodes in this [GLTFState]. These nodes are only used during the export process when converting Godot [AnimationPlayer] nodes to GLTF animations. */ - get_animation_players_count(idx: int64): int64 - - /** Returns the [AnimationPlayer] node with the given index. These nodes are only used during the export process when converting Godot [AnimationPlayer] nodes to GLTF animations. */ - get_animation_player(idx: int64): AnimationPlayer - - /** Returns the Godot scene node that corresponds to the same index as the [GLTFNode] it was generated from. This is the inverse of [method get_node_index]. Useful during the import process. - * - * **Note:** Not every [GLTFNode] will have a scene node generated, and not every generated scene node will have a corresponding [GLTFNode]. If there is no scene node for this [GLTFNode] index, `null` is returned. - */ - get_scene_node(idx: int64): Node - - /** Returns the index of the [GLTFNode] corresponding to this Godot scene node. This is the inverse of [method get_scene_node]. Useful during the export process. - * - * **Note:** Not every Godot scene node will have a corresponding [GLTFNode], and not every [GLTFNode] will have a scene node generated. If there is no [GLTFNode] index for this scene node, `-1` is returned. - */ - get_node_index(scene_node: Node): int64 - - /** Gets additional arbitrary data in this [GLTFState] instance. This can be used to keep per-file state data in [GLTFDocumentExtension] classes, which is important because they are stateless. - * The argument should be the [GLTFDocumentExtension] name (does not have to match the extension name in the GLTF file), and the return value can be anything you set. If nothing was set, the return value is null. - */ - get_additional_data(extension_name: StringName): any - - /** Sets additional arbitrary data in this [GLTFState] instance. This can be used to keep per-file state data in [GLTFDocumentExtension] classes, which is important because they are stateless. - * The first argument should be the [GLTFDocumentExtension] name (does not have to match the extension name in the GLTF file), and the second argument can be anything you want. - */ - set_additional_data(extension_name: StringName, additional_data: any): void - - /** The original raw JSON document corresponding to this GLTFState. */ - get json(): GDictionary - set json(value: GDictionary) - get major_version(): int64 - set major_version(value: int64) - get minor_version(): int64 - set minor_version(value: int64) - - /** The copyright string in the asset header of the GLTF file. This is set during import if present and export if non-empty. See the GLTF asset header documentation for more information. */ - get copyright(): string - set copyright(value: string) - - /** The binary buffer attached to a .glb file. */ - get glb_data(): PackedByteArray - set glb_data(value: PackedByteArray | byte[] | ArrayBuffer) - get use_named_skin_binds(): boolean - set use_named_skin_binds(value: boolean) - get nodes(): GArray - set nodes(value: GArray) - get buffers(): GArray - set buffers(value: GArray) - get buffer_views(): GArray - set buffer_views(value: GArray) - get accessors(): GArray - set accessors(value: GArray) - get meshes(): GArray - set meshes(value: GArray) - get materials(): GArray - set materials(value: GArray) - - /** The name of the scene. When importing, if not specified, this will be the file name. When exporting, if specified, the scene name will be saved to the GLTF file. */ - get scene_name(): string - set scene_name(value: string) - - /** The folder path associated with this GLTF data. This is used to find other files the GLTF file references, like images or binary buffers. This will be set during import when appending from a file, and will be set during export when writing to a file. */ - get base_path(): string - set base_path(value: string) - - /** The file name associated with this GLTF data. If it ends with `.gltf`, this is text-based GLTF, otherwise this is binary GLB. This will be set during import when appending from a file, and will be set during export when writing to a file. If writing to a buffer, this will be an empty string. */ - get filename(): string - set filename(value: string) - - /** The root nodes of the GLTF file. Typically, a GLTF file will only have one scene, and therefore one root node. However, a GLTF file may have multiple scenes and therefore multiple root nodes, which will be generated as siblings of each other and as children of the root node of the generated Godot scene. */ - get root_nodes(): PackedInt32Array - set root_nodes(value: PackedInt32Array | int32[]) - get textures(): GArray - set textures(value: GArray) - get texture_samplers(): GArray - set texture_samplers(value: GArray) - get images(): GArray - set images(value: GArray) - get skins(): GArray - set skins(value: GArray) - get cameras(): GArray - set cameras(value: GArray) - get lights(): GArray - set lights(value: GArray) - get unique_names(): GArray - set unique_names(value: GArray) - get unique_animation_names(): GArray - set unique_animation_names(value: GArray) - get skeletons(): GArray - set skeletons(value: GArray) - get create_animations(): boolean - set create_animations(value: boolean) - - /** True to force all GLTFNodes in the document to be bones of a single Skeleton3D godot node. */ - get import_as_skeleton_bones(): boolean - set import_as_skeleton_bones(value: boolean) - get animations(): GArray - set animations(value: GArray) - get handle_binary_image(): int64 - set handle_binary_image(value: int64) - - /** The baking fps of the animation for either import or export. */ - get bake_fps(): float64 - set bake_fps(value: float64) - } - /** GLTFTexture represents a texture in a GLTF file. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_gltftexture.html - */ - class GLTFTexture extends Resource { - constructor(identifier?: any) - /** The index of the image associated with this texture, see [method GLTFState.get_images]. If -1, then this texture does not have an image assigned. */ - get src_image(): int64 - set src_image(value: int64) - - /** ID of the texture sampler to use when sampling the image. If -1, then the default texture sampler is used (linear filtering, and repeat wrapping in both axes). */ - get sampler(): int64 - set sampler(value: int64) - } - /** Represents a GLTF texture sampler - * - * @link https://docs.godotengine.org/en/4.3/classes/class_gltftexturesampler.html - */ - class GLTFTextureSampler extends Resource { - constructor(identifier?: any) - /** Texture's magnification filter, used when texture appears larger on screen than the source image. */ - get mag_filter(): int64 - set mag_filter(value: int64) - - /** Texture's minification filter, used when the texture appears smaller on screen than the source image. */ - get min_filter(): int64 - set min_filter(value: int64) - - /** Wrapping mode to use for S-axis (horizontal) texture coordinates. */ - get wrap_s(): int64 - set wrap_s(value: int64) - - /** Wrapping mode to use for T-axis (vertical) texture coordinates. */ - get wrap_t(): int64 - set wrap_t(value: int64) - } - namespace GPUParticles2D { - enum DrawOrder { - /** Particles are drawn in the order emitted. */ - DRAW_ORDER_INDEX = 0, - - /** Particles are drawn in order of remaining lifetime. In other words, the particle with the highest lifetime is drawn at the front. */ - DRAW_ORDER_LIFETIME = 1, - - /** Particles are drawn in reverse order of remaining lifetime. In other words, the particle with the lowest lifetime is drawn at the front. */ - DRAW_ORDER_REVERSE_LIFETIME = 2, - } - enum EmitFlags { - /** Particle starts at the specified position. */ - EMIT_FLAG_POSITION = 1, - - /** Particle starts with specified rotation and scale. */ - EMIT_FLAG_ROTATION_SCALE = 2, - - /** Particle starts with the specified velocity vector, which defines the emission direction and speed. */ - EMIT_FLAG_VELOCITY = 4, - - /** Particle starts with specified color. */ - EMIT_FLAG_COLOR = 8, - - /** Particle starts with specified `CUSTOM` data. */ - EMIT_FLAG_CUSTOM = 16, - } - } - /** A 2D particle emitter. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_gpuparticles2d.html - */ - class GPUParticles2D extends Node2D { - constructor(identifier?: any) - /** Returns a rectangle containing the positions of all existing particles. - * - * **Note:** When using threaded rendering this method synchronizes the rendering thread. Calling it often may have a negative impact on performance. - */ - capture_rect(): Rect2 - - /** Restarts the particle emission cycle, clearing existing particles. To avoid particles vanishing from the viewport, wait for the [signal finished] signal before calling. - * - * **Note:** The [signal finished] signal is only emitted by [member one_shot] emitters. - */ - restart(): void - - /** Emits a single particle. Whether [param xform], [param velocity], [param color] and [param custom] are applied depends on the value of [param flags]. See [enum EmitFlags]. - * The default ParticleProcessMaterial will overwrite [param color] and use the contents of [param custom] as `(rotation, age, animation, lifetime)`. - */ - emit_particle(xform: Transform2D, velocity: Vector2, color: Color, custom: Color, flags: int64): void - - /** Sets this node's properties to match a given [CPUParticles2D] node. */ - convert_from_particles(particles: Node): void - - /** If `true`, particles are being emitted. [member emitting] can be used to start and stop particles from emitting. However, if [member one_shot] is `true` setting [member emitting] to `true` will not restart the emission cycle unless all active particles have finished processing. Use the [signal finished] signal to be notified once all active particles finish processing. - * - * **Note:** For [member one_shot] emitters, due to the particles being computed on the GPU, there may be a short period after receiving the [signal finished] signal during which setting this to `true` will not restart the emission cycle. - * **Tip:** If your [member one_shot] emitter needs to immediately restart emitting particles once [signal finished] signal is received, consider calling [method restart] instead of setting [member emitting]. - */ - get emitting(): boolean - set emitting(value: boolean) - - /** The number of particles to emit in one emission cycle. The effective emission rate is `(amount * amount_ratio) / lifetime` particles per second. Higher values will increase GPU requirements, even if not all particles are visible at a given time or if [member amount_ratio] is decreased. - * - * **Note:** Changing this value will cause the particle system to restart. To avoid this, change [member amount_ratio] instead. - */ - get amount(): int64 - set amount(value: int64) - - /** The ratio of particles that should actually be emitted. If set to a value lower than `1.0`, this will set the amount of emitted particles throughout the lifetime to `amount * amount_ratio`. Unlike changing [member amount], changing [member amount_ratio] while emitting does not affect already-emitted particles and doesn't cause the particle system to restart. [member amount_ratio] can be used to create effects that make the number of emitted particles vary over time. - * - * **Note:** Reducing the [member amount_ratio] has no performance benefit, since resources need to be allocated and processed for the total [member amount] of particles regardless of the [member amount_ratio]. If you don't intend to change the number of particles emitted while the particles are emitting, make sure [member amount_ratio] is set to `1` and change [member amount] to your liking instead. - */ - get amount_ratio(): float64 - set amount_ratio(value: float64) - - /** Path to another [GPUParticles2D] node that will be used as a subemitter (see [member ParticleProcessMaterial.sub_emitter_mode]). Subemitters can be used to achieve effects such as fireworks, sparks on collision, bubbles popping into water drops, and more. - * - * **Note:** When [member sub_emitter] is set, the target [GPUParticles2D] node will no longer emit particles on its own. - */ - get sub_emitter(): NodePath - set sub_emitter(value: NodePath | string) - - /** [Material] for processing particles. Can be a [ParticleProcessMaterial] or a [ShaderMaterial]. */ - get process_material(): ParticleProcessMaterial | ShaderMaterial - set process_material(value: ParticleProcessMaterial | ShaderMaterial) - - /** Particle texture. If `null`, particles will be squares with a size of 1×1 pixels. - * - * **Note:** To use a flipbook texture, assign a new [CanvasItemMaterial] to the [GPUParticles2D]'s [member CanvasItem.material] property, then enable [member CanvasItemMaterial.particles_animation] and set [member CanvasItemMaterial.particles_anim_h_frames], [member CanvasItemMaterial.particles_anim_v_frames], and [member CanvasItemMaterial.particles_anim_loop] to match the flipbook texture. - */ - get texture(): Texture2D - set texture(value: Texture2D) - - /** The amount of time each particle will exist (in seconds). The effective emission rate is `(amount * amount_ratio) / lifetime` particles per second. */ - get lifetime(): float64 - set lifetime(value: float64) - - /** If `true`, only one emission cycle occurs. If set `true` during a cycle, emission will stop at the cycle's end. */ - get one_shot(): boolean - set one_shot(value: boolean) - - /** Particle system starts as if it had already run for this many seconds. */ - get preprocess(): float64 - set preprocess(value: float64) - - /** Particle system's running speed scaling ratio. A value of `0` can be used to pause the particles. */ - get speed_scale(): float64 - set speed_scale(value: float64) - - /** How rapidly particles in an emission cycle are emitted. If greater than `0`, there will be a gap in emissions before the next cycle begins. */ - get explosiveness(): float64 - set explosiveness(value: float64) - - /** Emission lifetime randomness ratio. */ - get randomness(): float64 - set randomness(value: float64) - - /** The particle system's frame rate is fixed to a value. For example, changing the value to 2 will make the particles render at 2 frames per second. Note this does not slow down the simulation of the particle system itself. */ - get fixed_fps(): int64 - set fixed_fps(value: int64) - - /** Enables particle interpolation, which makes the particle movement smoother when their [member fixed_fps] is lower than the screen refresh rate. */ - get interpolate(): boolean - set interpolate(value: boolean) - - /** If `true`, results in fractional delta calculation which has a smoother particles display effect. */ - get fract_delta(): boolean - set fract_delta(value: boolean) - - /** Causes all the particles in this node to interpolate towards the end of their lifetime. - * - * **Note:** This only works when used with a [ParticleProcessMaterial]. It needs to be manually implemented for custom process shaders. - */ - get interp_to_end(): float64 - set interp_to_end(value: float64) - - /** Multiplier for particle's collision radius. `1.0` corresponds to the size of the sprite. If particles appear to sink into the ground when colliding, increase this value. If particles appear to float when colliding, decrease this value. Only effective if [member ParticleProcessMaterial.collision_mode] is [constant ParticleProcessMaterial.COLLISION_RIGID] or [constant ParticleProcessMaterial.COLLISION_HIDE_ON_CONTACT]. - * - * **Note:** Particles always have a spherical collision shape. - */ - get collision_base_size(): float64 - set collision_base_size(value: float64) - - /** The [Rect2] that determines the node's region which needs to be visible on screen for the particle system to be active. - * Grow the rect if particles suddenly appear/disappear when the node enters/exits the screen. The [Rect2] can be grown via code or with the **Particles → Generate Visibility Rect** editor tool. - */ - get visibility_rect(): Rect2 - set visibility_rect(value: Rect2) - - /** If `true`, particles use the parent node's coordinate space (known as local coordinates). This will cause particles to move and rotate along the [GPUParticles2D] node (and its parents) when it is moved or rotated. If `false`, particles use global coordinates; they will not move or rotate along the [GPUParticles2D] node (and its parents) when it is moved or rotated. */ - get local_coords(): boolean - set local_coords(value: boolean) - - /** Particle draw order. Uses [enum DrawOrder] values. */ - get draw_order(): int64 - set draw_order(value: int64) - - /** If `true`, enables particle trails using a mesh skinning system. - * - * **Note:** Unlike [GPUParticles3D], the number of trail sections and subdivisions is set with the [member trail_sections] and [member trail_section_subdivisions] properties. - */ - get trail_enabled(): boolean - set trail_enabled(value: boolean) - - /** The amount of time the particle's trail should represent (in seconds). Only effective if [member trail_enabled] is `true`. */ - get trail_lifetime(): float64 - set trail_lifetime(value: float64) - - /** The number of sections to use for the particle trail rendering. Higher values can result in smoother trail curves, at the cost of performance due to increased mesh complexity. See also [member trail_section_subdivisions]. Only effective if [member trail_enabled] is `true`. */ - get trail_sections(): int64 - set trail_sections(value: int64) - - /** The number of subdivisions to use for the particle trail rendering. Higher values can result in smoother trail curves, at the cost of performance due to increased mesh complexity. See also [member trail_sections]. Only effective if [member trail_enabled] is `true`. */ - get trail_section_subdivisions(): int64 - set trail_section_subdivisions(value: int64) - - /** Emitted when all active particles have finished processing. To immediately restart the emission cycle, call [method restart]. - * Never emitted when [member one_shot] is disabled, as particles will be emitted and processed continuously. - * - * **Note:** For [member one_shot] emitters, due to the particles being computed on the GPU, there may be a short period after receiving the signal during which setting [member emitting] to `true` will not restart the emission cycle. This delay is avoided by instead calling [method restart]. - */ - readonly finished: Signal0 - } - class GPUParticles2DEditorPlugin extends EditorPlugin { - constructor(identifier?: any) - } - namespace GPUParticles3D { - enum DrawOrder { - /** Particles are drawn in the order emitted. */ - DRAW_ORDER_INDEX = 0, - - /** Particles are drawn in order of remaining lifetime. In other words, the particle with the highest lifetime is drawn at the front. */ - DRAW_ORDER_LIFETIME = 1, - - /** Particles are drawn in reverse order of remaining lifetime. In other words, the particle with the lowest lifetime is drawn at the front. */ - DRAW_ORDER_REVERSE_LIFETIME = 2, - - /** Particles are drawn in order of depth. */ - DRAW_ORDER_VIEW_DEPTH = 3, - } - enum EmitFlags { - /** Particle starts at the specified position. */ - EMIT_FLAG_POSITION = 1, - - /** Particle starts with specified rotation and scale. */ - EMIT_FLAG_ROTATION_SCALE = 2, - - /** Particle starts with the specified velocity vector, which defines the emission direction and speed. */ - EMIT_FLAG_VELOCITY = 4, - - /** Particle starts with specified color. */ - EMIT_FLAG_COLOR = 8, - - /** Particle starts with specified `CUSTOM` data. */ - EMIT_FLAG_CUSTOM = 16, - } - enum TransformAlign { - TRANSFORM_ALIGN_DISABLED = 0, - TRANSFORM_ALIGN_Z_BILLBOARD = 1, - TRANSFORM_ALIGN_Y_TO_VELOCITY = 2, - TRANSFORM_ALIGN_Z_BILLBOARD_Y_TO_VELOCITY = 3, - } - } - /** A 3D particle emitter. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_gpuparticles3d.html - */ - class GPUParticles3D extends GeometryInstance3D { - /** Maximum number of draw passes supported. */ - static readonly MAX_DRAW_PASSES = 4 - constructor(identifier?: any) - - /** Sets the [Mesh] that is drawn at index [param pass]. */ - set_draw_pass_mesh(pass: int64, mesh: Mesh): void - - /** Returns the [Mesh] that is drawn at index [param pass]. */ - get_draw_pass_mesh(pass: int64): Mesh - - /** Restarts the particle emission cycle, clearing existing particles. To avoid particles vanishing from the viewport, wait for the [signal finished] signal before calling. - * - * **Note:** The [signal finished] signal is only emitted by [member one_shot] emitters. - */ - restart(): void - - /** Returns the axis-aligned bounding box that contains all the particles that are active in the current frame. */ - capture_aabb(): AABB - - /** Emits a single particle. Whether [param xform], [param velocity], [param color] and [param custom] are applied depends on the value of [param flags]. See [enum EmitFlags]. - * The default ParticleProcessMaterial will overwrite [param color] and use the contents of [param custom] as `(rotation, age, animation, lifetime)`. - */ - emit_particle(xform: Transform3D, velocity: Vector3, color: Color, custom: Color, flags: int64): void - - /** Sets this node's properties to match a given [CPUParticles3D] node. */ - convert_from_particles(particles: Node): void - - /** If `true`, particles are being emitted. [member emitting] can be used to start and stop particles from emitting. However, if [member one_shot] is `true` setting [member emitting] to `true` will not restart the emission cycle unless all active particles have finished processing. Use the [signal finished] signal to be notified once all active particles finish processing. - * - * **Note:** For [member one_shot] emitters, due to the particles being computed on the GPU, there may be a short period after receiving the [signal finished] signal during which setting this to `true` will not restart the emission cycle. - * **Tip:** If your [member one_shot] emitter needs to immediately restart emitting particles once [signal finished] signal is received, consider calling [method restart] instead of setting [member emitting]. - */ - get emitting(): boolean - set emitting(value: boolean) - - /** The number of particles to emit in one emission cycle. The effective emission rate is `(amount * amount_ratio) / lifetime` particles per second. Higher values will increase GPU requirements, even if not all particles are visible at a given time or if [member amount_ratio] is decreased. - * - * **Note:** Changing this value will cause the particle system to restart. To avoid this, change [member amount_ratio] instead. - */ - get amount(): int64 - set amount(value: int64) - - /** The ratio of particles that should actually be emitted. If set to a value lower than `1.0`, this will set the amount of emitted particles throughout the lifetime to `amount * amount_ratio`. Unlike changing [member amount], changing [member amount_ratio] while emitting does not affect already-emitted particles and doesn't cause the particle system to restart. [member amount_ratio] can be used to create effects that make the number of emitted particles vary over time. - * - * **Note:** Reducing the [member amount_ratio] has no performance benefit, since resources need to be allocated and processed for the total [member amount] of particles regardless of the [member amount_ratio]. If you don't intend to change the number of particles emitted while the particles are emitting, make sure [member amount_ratio] is set to `1` and change [member amount] to your liking instead. - */ - get amount_ratio(): float64 - set amount_ratio(value: float64) - - /** Path to another [GPUParticles3D] node that will be used as a subemitter (see [member ParticleProcessMaterial.sub_emitter_mode]). Subemitters can be used to achieve effects such as fireworks, sparks on collision, bubbles popping into water drops, and more. - * - * **Note:** When [member sub_emitter] is set, the target [GPUParticles3D] node will no longer emit particles on its own. - */ - get sub_emitter(): NodePath - set sub_emitter(value: NodePath | string) - - /** The amount of time each particle will exist (in seconds). The effective emission rate is `(amount * amount_ratio) / lifetime` particles per second. */ - get lifetime(): float64 - set lifetime(value: float64) - - /** Causes all the particles in this node to interpolate towards the end of their lifetime. - * - * **Note:** This only works when used with a [ParticleProcessMaterial]. It needs to be manually implemented for custom process shaders. - */ - get interp_to_end(): float64 - set interp_to_end(value: float64) - - /** If `true`, only the number of particles equal to [member amount] will be emitted. */ - get one_shot(): boolean - set one_shot(value: boolean) - - /** Amount of time to preprocess the particles before animation starts. Lets you start the animation some time after particles have started emitting. */ - get preprocess(): float64 - set preprocess(value: float64) - - /** Speed scaling ratio. A value of `0` can be used to pause the particles. */ - get speed_scale(): float64 - set speed_scale(value: float64) - - /** Time ratio between each emission. If `0`, particles are emitted continuously. If `1`, all particles are emitted simultaneously. */ - get explosiveness(): float64 - set explosiveness(value: float64) - - /** Emission randomness ratio. */ - get randomness(): float64 - set randomness(value: float64) - - /** The particle system's frame rate is fixed to a value. For example, changing the value to 2 will make the particles render at 2 frames per second. Note this does not slow down the simulation of the particle system itself. */ - get fixed_fps(): int64 - set fixed_fps(value: int64) - - /** Enables particle interpolation, which makes the particle movement smoother when their [member fixed_fps] is lower than the screen refresh rate. */ - get interpolate(): boolean - set interpolate(value: boolean) - - /** If `true`, results in fractional delta calculation which has a smoother particles display effect. */ - get fract_delta(): boolean - set fract_delta(value: boolean) - - /** The base diameter for particle collision in meters. If particles appear to sink into the ground when colliding, increase this value. If particles appear to float when colliding, decrease this value. Only effective if [member ParticleProcessMaterial.collision_mode] is [constant ParticleProcessMaterial.COLLISION_RIGID] or [constant ParticleProcessMaterial.COLLISION_HIDE_ON_CONTACT]. - * - * **Note:** Particles always have a spherical collision shape. - */ - get collision_base_size(): float64 - set collision_base_size(value: float64) - - /** The [AABB] that determines the node's region which needs to be visible on screen for the particle system to be active. [member GeometryInstance3D.extra_cull_margin] is added on each of the AABB's axes. Particle collisions and attraction will only occur within this area. - * Grow the box if particles suddenly appear/disappear when the node enters/exits the screen. The [AABB] can be grown via code or with the **Particles → Generate AABB** editor tool. - * - * **Note:** [member visibility_aabb] is overridden by [member GeometryInstance3D.custom_aabb] if that property is set to a non-default value. - */ - get visibility_aabb(): AABB - set visibility_aabb(value: AABB) - - /** If `true`, particles use the parent node's coordinate space (known as local coordinates). This will cause particles to move and rotate along the [GPUParticles3D] node (and its parents) when it is moved or rotated. If `false`, particles use global coordinates; they will not move or rotate along the [GPUParticles3D] node (and its parents) when it is moved or rotated. */ - get local_coords(): boolean - set local_coords(value: boolean) - - /** Particle draw order. Uses [enum DrawOrder] values. - * - * **Note:** [constant DRAW_ORDER_INDEX] is the only option that supports motion vectors for effects like TAA. It is suggested to use this draw order if the particles are opaque to fix ghosting artifacts. - */ - get draw_order(): int64 - set draw_order(value: int64) - get transform_align(): int64 - set transform_align(value: int64) - - /** If `true`, enables particle trails using a mesh skinning system. Designed to work with [RibbonTrailMesh] and [TubeTrailMesh]. - * - * **Note:** [member BaseMaterial3D.use_particle_trails] must also be enabled on the particle mesh's material. Otherwise, setting [member trail_enabled] to `true` will have no effect. - * - * **Note:** Unlike [GPUParticles2D], the number of trail sections and subdivisions is set in the [RibbonTrailMesh] or the [TubeTrailMesh]'s properties. - */ - get trail_enabled(): boolean - set trail_enabled(value: boolean) - - /** The amount of time the particle's trail should represent (in seconds). Only effective if [member trail_enabled] is `true`. */ - get trail_lifetime(): float64 - set trail_lifetime(value: float64) - - /** [Material] for processing particles. Can be a [ParticleProcessMaterial] or a [ShaderMaterial]. */ - get process_material(): ParticleProcessMaterial | ShaderMaterial - set process_material(value: ParticleProcessMaterial | ShaderMaterial) - - /** The number of draw passes when rendering particles. */ - get draw_passes(): int64 - set draw_passes(value: int64) - - /** [Mesh] that is drawn for the first draw pass. */ - get draw_pass_1(): Mesh - set draw_pass_1(value: Mesh) - - /** [Mesh] that is drawn for the second draw pass. */ - get draw_pass_2(): Mesh - set draw_pass_2(value: Mesh) - - /** [Mesh] that is drawn for the third draw pass. */ - get draw_pass_3(): Mesh - set draw_pass_3(value: Mesh) - - /** [Mesh] that is drawn for the fourth draw pass. */ - get draw_pass_4(): Mesh - set draw_pass_4(value: Mesh) - get draw_skin(): Skin - set draw_skin(value: Skin) - - /** Emitted when all active particles have finished processing. To immediately emit new particles, call [method restart]. - * Never emitted when [member one_shot] is disabled, as particles will be emitted and processed continuously. - * - * **Note:** For [member one_shot] emitters, due to the particles being computed on the GPU, there may be a short period after receiving the signal during which setting [member emitting] to `true` will not restart the emission cycle. This delay is avoided by instead calling [method restart]. - */ - readonly finished: Signal0 + /** Emitted when the filter for file names changes. */ + readonly filename_filter_changed: Signal1 } } diff --git a/typings/godot3.gen.d.ts b/typings/godot3.gen.d.ts index 45263b5..05bf86a 100644 --- a/typings/godot3.gen.d.ts +++ b/typings/godot3.gen.d.ts @@ -1,13 +1,5843 @@ // AUTO-GENERATED /// declare module "godot" { - class GPUParticles3DEditor extends GPUParticles3DEditorBase { + class EditorFileServer extends Object { constructor(identifier?: any) } - class GPUParticles3DEditorBase extends Control { + /** Resource filesystem, as the editor sees it. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_editorfilesystem.html + */ + class EditorFileSystem = Record> extends Node { + constructor(identifier?: any) + /** Gets the root directory object. */ + get_filesystem(): EditorFileSystemDirectory + + /** Returns `true` if the filesystem is being scanned. */ + is_scanning(): boolean + + /** Returns the scan progress for 0 to 1 if the FS is being scanned. */ + get_scanning_progress(): float64 + + /** Scan the filesystem for changes. */ + scan(): void + + /** Check if the source of any imported resource changed. */ + scan_sources(): void + + /** Add a file in an existing directory, or schedule file information to be updated on editor restart. Can be used to update text files saved by an external program. + * This will not import the file. To reimport, call [method reimport_files] or [method scan] methods. + */ + update_file(path: string): void + + /** Returns a view into the filesystem at [param path]. */ + get_filesystem_path(path: string): EditorFileSystemDirectory + + /** Returns the resource type of the file, given the full path. This returns a string such as `"Resource"` or `"GDScript"`, *not* a file extension such as `".gd"`. */ + get_file_type(path: string): string + + /** Reimports a set of files. Call this if these files or their `.import` files were directly edited by script or an external program. + * If the file type changed or the file was newly created, use [method update_file] or [method scan]. + * + * **Note:** This function blocks until the import is finished. However, the main loop iteration, including timers and [method Node._process], will occur during the import process due to progress bar updates. Avoid calls to [method reimport_files] or [method scan] while an import is in progress. + */ + reimport_files(files: PackedStringArray | string[]): void + + /** Emitted if the filesystem changed. */ + readonly filesystem_changed: Signal0 + + /** Emitted when the list of global script classes gets updated. */ + readonly script_classes_updated: Signal0 + + /** Emitted if the source of any imported file changed. */ + readonly sources_changed: Signal1 + + /** Emitted before a resource is reimported. */ + readonly resources_reimporting: Signal1 + + /** Emitted if a resource is reimported. */ + readonly resources_reimported: Signal1 + + /** Emitted if at least one resource is reloaded when the filesystem is scanned. */ + readonly resources_reload: Signal1 + } + /** A directory for the resource filesystem. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_editorfilesystemdirectory.html + */ + class EditorFileSystemDirectory extends Object { + constructor(identifier?: any) + /** Returns the number of subdirectories in this directory. */ + get_subdir_count(): int64 + + /** Returns the subdirectory at index [param idx]. */ + get_subdir(idx: int64): EditorFileSystemDirectory + + /** Returns the number of files in this directory. */ + get_file_count(): int64 + + /** Returns the name of the file at index [param idx]. */ + get_file(idx: int64): string + + /** Returns the path to the file at index [param idx]. */ + get_file_path(idx: int64): string + + /** Returns the resource type of the file at index [param idx]. This returns a string such as `"Resource"` or `"GDScript"`, *not* a file extension such as `".gd"`. */ + get_file_type(idx: int64): StringName + + /** Returns the name of the script class defined in the file at index [param idx]. If the file doesn't define a script class using the `class_name` syntax, this will return an empty string. */ + get_file_script_class_name(idx: int64): string + + /** Returns the base class of the script class defined in the file at index [param idx]. If the file doesn't define a script class using the `class_name` syntax, this will return an empty string. */ + get_file_script_class_extends(idx: int64): string + + /** Returns `true` if the file at index [param idx] imported properly. */ + get_file_import_is_valid(idx: int64): boolean + + /** Returns the name of this directory. */ + get_name(): string + + /** Returns the path to this directory. */ + get_path(): string + + /** Returns the parent directory for this directory or `null` if called on a directory at `res://` or `user://`. */ + get_parent(): EditorFileSystemDirectory + + /** Returns the index of the file with name [param name] or `-1` if not found. */ + find_file_index(name: string): int64 + + /** Returns the index of the directory with name [param name] or `-1` if not found. */ + find_dir_index(name: string): int64 + } + /** Used to query and configure import format support. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_editorfilesystemimportformatsupportquery.html + */ + class EditorFileSystemImportFormatSupportQuery extends RefCounted { + constructor(identifier?: any) + /** Return whether this importer is active. */ + /* gdvirtual */ _is_active(): boolean + + /** Return the file extensions supported. */ + /* gdvirtual */ _get_file_extensions(): PackedStringArray + + /** Query support. Return `false` if import must not continue. */ + /* gdvirtual */ _query(): boolean + } + class EditorFileSystemImportFormatSupportQueryBlend extends EditorFileSystemImportFormatSupportQuery { constructor(identifier?: any) } - class GPUParticles3DEditorPlugin extends EditorPlugin { + class EditorFontPreviewPlugin extends EditorResourcePreviewGenerator { + constructor(identifier?: any) + } + class EditorGradientPreviewPlugin extends EditorResourcePreviewGenerator { + constructor(identifier?: any) + } + class EditorHelpBit = Record> extends VBoxContainer { + constructor(identifier?: any) + readonly request_hide: Signal0 + } + class EditorHelpSearch = Record> extends ConfirmationDialog { + constructor(identifier?: any) + readonly go_to_help: Signal0 + } + class EditorImagePreviewPlugin extends EditorResourcePreviewGenerator { + constructor(identifier?: any) + } + class EditorImportBlendRunner = Record> extends Node { + constructor(identifier?: any) + } + /** Registers a custom resource importer in the editor. Use the class to parse any file and import it as a new resource type. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_editorimportplugin.html + */ + class EditorImportPlugin extends ResourceImporter { + constructor(identifier?: any) + /** Gets the unique name of the importer. */ + /* gdvirtual */ _get_importer_name(): string + + /** Gets the name to display in the import window. You should choose this name as a continuation to "Import as", e.g. "Import as Special Mesh". */ + /* gdvirtual */ _get_visible_name(): string + + /** Gets the number of initial presets defined by the plugin. Use [method _get_import_options] to get the default options for the preset and [method _get_preset_name] to get the name of the preset. */ + /* gdvirtual */ _get_preset_count(): int64 + + /** Gets the name of the options preset at this index. */ + /* gdvirtual */ _get_preset_name(preset_index: int64): string + + /** Gets the list of file extensions to associate with this loader (case-insensitive). e.g. `["obj"]`. */ + /* gdvirtual */ _get_recognized_extensions(): PackedStringArray + + /** Gets the options and default values for the preset at this index. Returns an Array of Dictionaries with the following keys: `name`, `default_value`, `property_hint` (optional), `hint_string` (optional), `usage` (optional). */ + /* gdvirtual */ _get_import_options(path: string, preset_index: int64): GArray + + /** Gets the extension used to save this resource in the `.godot/imported` directory (see [member ProjectSettings.application/config/use_hidden_project_data_directory]). */ + /* gdvirtual */ _get_save_extension(): string + + /** Gets the Godot resource type associated with this loader. e.g. `"Mesh"` or `"Animation"`. */ + /* gdvirtual */ _get_resource_type(): string + + /** Gets the priority of this plugin for the recognized extension. Higher priority plugins will be preferred. The default priority is `1.0`. */ + /* gdvirtual */ _get_priority(): float64 + + /** Gets the order of this importer to be run when importing resources. Importers with *lower* import orders will be called first, and higher values will be called later. Use this to ensure the importer runs after the dependencies are already imported. The default import order is `0` unless overridden by a specific importer. See [enum ResourceImporter.ImportOrder] for some predefined values. */ + /* gdvirtual */ _get_import_order(): int64 + + /** Gets the format version of this importer. Increment this version when making incompatible changes to the format of the imported resources. */ + /* gdvirtual */ _get_format_version(): int64 + + /** This method can be overridden to hide specific import options if conditions are met. This is mainly useful for hiding options that depend on others if one of them is disabled. + * + * Returns `true` to make all options always visible. + */ + /* gdvirtual */ _get_option_visibility(path: string, option_name: StringName, options: GDictionary): boolean + + /** Imports [param source_file] into [param save_path] with the import [param options] specified. The [param platform_variants] and [param gen_files] arrays will be modified by this function. + * This method must be overridden to do the actual importing work. See this class' description for an example of overriding this method. + */ + /* gdvirtual */ _import(source_file: string, save_path: string, options: GDictionary, platform_variants: GArray, gen_files: GArray): GError + + /** Tells whether this importer can be run in parallel on threads, or, on the contrary, it's only safe for the editor to call it from the main thread, for one file at a time. + * If this method is not overridden, it will return `false` by default. + * If this importer's implementation is thread-safe and can be run in parallel, override this with `true` to optimize for concurrency. + */ + /* gdvirtual */ _can_import_threaded(): boolean + + /** This function can only be called during the [method _import] callback and it allows manually importing resources from it. This is useful when the imported file generates external resources that require importing (as example, images). Custom parameters for the ".import" file can be passed via the [param custom_options]. Additionally, in cases where multiple importers can handle a file, the [param custom_importer] can be specified to force a specific one. This function performs a resource import and returns immediately with a success or error code. [param generator_parameters] defines optional extra metadata which will be stored as [code skip-lint]generator_parameters` in the `remap` section of the `.import` file, for example to store a md5 hash of the source data. */ + append_import_external_resource(path: string, custom_options: GDictionary = new GDictionary(), custom_importer: string = '', generator_parameters: any = {}): GError + } + /** A control used to edit properties of an object. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_editorinspector.html + */ + class EditorInspector = Record> extends ScrollContainer { + constructor(identifier?: any) + /** Shows the properties of the given [param object] in this inspector for editing. To clear the inspector, call this method with `null`. + * + * **Note:** If you want to edit an object in the editor's main inspector, use the `edit_*` methods in [EditorInterface] instead. + */ + edit(object: Object): void + _edit_request_change(_unnamed_arg0: Object, _unnamed_arg1: string): void + + /** Gets the path of the currently selected property. */ + get_selected_path(): string + + /** Returns the object currently selected in this inspector. */ + get_edited_object(): Object + + /** Creates a property editor that can be used by plugin UI to edit the specified property of an [param object]. */ + static instantiate_property_editor(object: Object, type: Variant.Type, path: string, hint: PropertyHint, hint_text: string, usage: int64, wide: boolean = false): EditorProperty + + /** Emitted when a property is selected in the inspector. */ + readonly property_selected: Signal1 + + /** Emitted when a property is keyed in the inspector. Properties can be keyed by clicking the "key" icon next to a property when the Animation panel is toggled. */ + readonly property_keyed: Signal3 + + /** Emitted when a property is removed from the inspector. */ + readonly property_deleted: Signal1 + + /** Emitted when a resource is selected in the inspector. */ + readonly resource_selected: Signal2 + + /** Emitted when the Edit button of an [Object] has been pressed in the inspector. This is mainly used in the remote scene tree Inspector. */ + readonly object_id_selected: Signal1 + + /** Emitted when a property is edited in the inspector. */ + readonly property_edited: Signal1 + + /** Emitted when a boolean property is toggled in the inspector. + * + * **Note:** This signal is never emitted if the internal `autoclear` property enabled. Since this property is always enabled in the editor inspector, this signal is never emitted by the editor itself. + */ + readonly property_toggled: Signal2 + + /** Emitted when the object being edited by the inspector has changed. */ + readonly edited_object_changed: Signal0 + + /** Emitted when a property that requires a restart to be applied is edited in the inspector. This is only used in the Project Settings and Editor Settings. */ + readonly restart_requested: Signal0 + } + class EditorInspectorCategory = Record> extends Control { + constructor(identifier?: any) + } + class EditorInspectorDefaultPlugin extends EditorInspectorPlugin { + constructor(identifier?: any) + } + class EditorInspectorParticleProcessMaterialPlugin extends EditorInspectorPlugin { + constructor(identifier?: any) + } + /** Plugin for adding custom property editors on the inspector. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_editorinspectorplugin.html + */ + class EditorInspectorPlugin extends RefCounted { + constructor(identifier?: any) + /** Returns `true` if this object can be handled by this plugin. */ + /* gdvirtual */ _can_handle(object: Object): boolean + + /** Called to allow adding controls at the beginning of the property list for [param object]. */ + /* gdvirtual */ _parse_begin(object: Object): void + + /** Called to allow adding controls at the beginning of a category in the property list for [param object]. */ + /* gdvirtual */ _parse_category(object: Object, category: string): void + + /** Called to allow adding controls at the beginning of a group or a sub-group in the property list for [param object]. */ + /* gdvirtual */ _parse_group(object: Object, group: string): void + + /** Called to allow adding property-specific editors to the property list for [param object]. The added editor control must extend [EditorProperty]. Returning `true` removes the built-in editor for this property, otherwise allows to insert a custom editor before the built-in one. */ + /* gdvirtual */ _parse_property(object: Object, type: Variant.Type, name: string, hint_type: PropertyHint, hint_string: string, usage_flags: PropertyUsageFlags, wide: boolean): boolean + + /** Called to allow adding controls at the end of the property list for [param object]. */ + /* gdvirtual */ _parse_end(object: Object): void + + /** Adds a custom control, which is not necessarily a property editor. */ + add_custom_control(control: Control): void + + /** Adds a property editor for an individual property. The [param editor] control must extend [EditorProperty]. + * There can be multiple property editors for a property. If [param add_to_end] is `true`, this newly added editor will be displayed after all the other editors of the property whose [param add_to_end] is `false`. For example, the editor uses this parameter to add an "Edit Region" button for [member Sprite2D.region_rect] below the regular [Rect2] editor. + * [param label] can be used to choose a custom label for the property editor in the inspector. If left empty, the label is computed from the name of the property instead. + */ + add_property_editor(property: string, editor: Control, add_to_end: boolean = false, label: string = ''): void + + /** Adds an editor that allows modifying multiple properties. The [param editor] control must extend [EditorProperty]. */ + add_property_editor_for_multiple_properties(label: string, properties: PackedStringArray | string[], editor: Control): void + } + class EditorInspectorPlugin3DTexture extends EditorInspectorPlugin { + constructor(identifier?: any) + } + class EditorInspectorPluginAnimationMarkerKeyEdit extends EditorInspectorPlugin { + constructor(identifier?: any) + } + class EditorInspectorPluginAnimationNodeAnimation extends EditorInspectorPlugin { + constructor(identifier?: any) + } + class EditorInspectorPluginAnimationTrackKeyEdit extends EditorInspectorPlugin { + constructor(identifier?: any) + } + class EditorInspectorPluginAudioStream extends EditorInspectorPlugin { + constructor(identifier?: any) + } + class EditorInspectorPluginAudioStreamInteractive extends EditorInspectorPlugin { + constructor(identifier?: any) + } + class EditorInspectorPluginBitMap extends EditorInspectorPlugin { + constructor(identifier?: any) + } + class EditorInspectorPluginBoneMap extends EditorInspectorPlugin { + constructor(identifier?: any) + } + class EditorInspectorPluginCamera3DPreview extends EditorInspectorPluginTexture { + constructor(identifier?: any) + } + class EditorInspectorPluginControl extends EditorInspectorPlugin { + constructor(identifier?: any) + } + class EditorInspectorPluginCurve extends EditorInspectorPlugin { + constructor(identifier?: any) + } + class EditorInspectorPluginFontPreview extends EditorInspectorPlugin { + constructor(identifier?: any) + } + class EditorInspectorPluginFontVariation extends EditorInspectorPlugin { + constructor(identifier?: any) + } + class EditorInspectorPluginGradient extends EditorInspectorPlugin { + constructor(identifier?: any) + } + class EditorInspectorPluginGradientTexture2D extends EditorInspectorPlugin { + constructor(identifier?: any) + } + class EditorInspectorPluginInputEvent extends EditorInspectorPlugin { + constructor(identifier?: any) + } + class EditorInspectorPluginLayeredTexture extends EditorInspectorPlugin { + constructor(identifier?: any) + } + class EditorInspectorPluginMaterial extends EditorInspectorPlugin { + constructor(identifier?: any) + } + class EditorInspectorPluginMesh extends EditorInspectorPlugin { + constructor(identifier?: any) + } + class EditorInspectorPluginPackedScene extends EditorInspectorPlugin { + constructor(identifier?: any) + } + class EditorInspectorPluginSkeleton extends EditorInspectorPlugin { + constructor(identifier?: any) + } + class EditorInspectorPluginStyleBox extends EditorInspectorPlugin { + constructor(identifier?: any) + } + class EditorInspectorPluginSubViewportPreview extends EditorInspectorPluginTexture { + constructor(identifier?: any) + } + class EditorInspectorPluginSystemFont extends EditorInspectorPlugin { + constructor(identifier?: any) + } + class EditorInspectorPluginTexture extends EditorInspectorPlugin { + constructor(identifier?: any) + } + class EditorInspectorPluginTextureRegion extends EditorInspectorPlugin { + constructor(identifier?: any) + } + class EditorInspectorPluginTileData extends EditorInspectorPlugin { + constructor(identifier?: any) + } + class EditorInspectorRootMotionPlugin extends EditorInspectorPlugin { + constructor(identifier?: any) + } + class EditorInspectorSection = Record> extends Container { + constructor(identifier?: any) + setup(section: string, label: string, object: Object, bg_color: Color, foldable: boolean, indent_depth: int64 = 0, level: int64 = 1): void + get_vbox(): VBoxContainer + unfold(): void + fold(): void + } + class EditorInspectorToolButtonPlugin extends EditorInspectorPlugin { + constructor(identifier?: any) + } + class EditorInspectorVisualShaderModePlugin extends EditorInspectorPlugin { + constructor(identifier?: any) + } + class EditorJSONSyntaxHighlighter extends EditorSyntaxHighlighter { + constructor(identifier?: any) + } + class EditorLayoutsDialog = Record> extends ConfirmationDialog { + constructor(identifier?: any) + readonly name_confirmed: Signal1 + } + class EditorLocaleDialog = Record> extends ConfirmationDialog { + constructor(identifier?: any) + readonly locale_selected: Signal1 + } + class EditorLog = Record> extends HBoxContainer { + constructor(identifier?: any) + } + class EditorMainScreen = Record> extends PanelContainer { + constructor(identifier?: any) + } + class EditorMarkdownSyntaxHighlighter extends EditorSyntaxHighlighter { + constructor(identifier?: any) + } + class EditorMaterialPreviewPlugin extends EditorResourcePreviewGenerator { + constructor(identifier?: any) + } + class EditorMeshPreviewPlugin extends EditorResourcePreviewGenerator { + constructor(identifier?: any) + } + class EditorNativeShaderSourceVisualizer = Record> extends AcceptDialog { + constructor(identifier?: any) + _inspect_shader(_unnamed_arg0: RID): void + } + class EditorNetworkProfiler = Record> extends VBoxContainer { + constructor(identifier?: any) + readonly enable_profiling: Signal1 + readonly open_request: Signal1 + } + class EditorNode = Record> extends Node { + constructor(identifier?: any) + push_item(object: Object, property: string = '', inspector_only: boolean = false): void + set_edited_scene(_unnamed_arg0: Node): void + stop_child_process(_unnamed_arg0: int64): void + readonly request_help_search: Signal0 + readonly script_add_function_request: Signal3 + readonly resource_saved: Signal1 + readonly scene_saved: Signal1 + readonly scene_changed: Signal0 + readonly scene_closed: Signal1 + } + /** Gizmo for editing [Node3D] objects. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_editornode3dgizmo.html + */ + class EditorNode3DGizmo extends Node3DGizmo { + constructor(identifier?: any) + /** Override this method to add all the gizmo elements whenever a gizmo update is requested. It's common to call [method clear] at the beginning of this method and then add visual elements depending on the node's properties. */ + /* gdvirtual */ _redraw(): void + + /** Override this method to return the name of an edited handle (handles must have been previously added by [method add_handles]). Handles can be named for reference to the user when editing. + * The [param secondary] argument is `true` when the requested handle is secondary (see [method add_handles] for more information). + */ + /* gdvirtual */ _get_handle_name(id: int64, secondary: boolean): string + + /** Override this method to return `true` whenever the given handle should be highlighted in the editor. + * The [param secondary] argument is `true` when the requested handle is secondary (see [method add_handles] for more information). + */ + /* gdvirtual */ _is_handle_highlighted(id: int64, secondary: boolean): boolean + + /** Override this method to return the current value of a handle. This value will be requested at the start of an edit and used as the `restore` argument in [method _commit_handle]. + * The [param secondary] argument is `true` when the requested handle is secondary (see [method add_handles] for more information). + */ + /* gdvirtual */ _get_handle_value(id: int64, secondary: boolean): any + /* gdvirtual */ _begin_handle_action(id: int64, secondary: boolean): void + + /** Override this method to update the node properties when the user drags a gizmo handle (previously added with [method add_handles]). The provided [param point] is the mouse position in screen coordinates and the [param camera] can be used to convert it to raycasts. + * The [param secondary] argument is `true` when the edited handle is secondary (see [method add_handles] for more information). + */ + /* gdvirtual */ _set_handle(id: int64, secondary: boolean, camera: Camera3D, point: Vector2): void + + /** Override this method to commit a handle being edited (handles must have been previously added by [method add_handles]). This usually means creating an [UndoRedo] action for the change, using the current handle value as "do" and the [param restore] argument as "undo". + * If the [param cancel] argument is `true`, the [param restore] value should be directly set, without any [UndoRedo] action. + * The [param secondary] argument is `true` when the committed handle is secondary (see [method add_handles] for more information). + */ + /* gdvirtual */ _commit_handle(id: int64, secondary: boolean, restore: any, cancel: boolean): void + + /** Override this method to allow selecting subgizmos using mouse clicks. Given a [param camera] and a [param point] in screen coordinates, this method should return which subgizmo should be selected. The returned value should be a unique subgizmo identifier, which can have any non-negative value and will be used in other virtual methods like [method _get_subgizmo_transform] or [method _commit_subgizmos]. */ + /* gdvirtual */ _subgizmos_intersect_ray(camera: Camera3D, point: Vector2): int64 + + /** Override this method to allow selecting subgizmos using mouse drag box selection. Given a [param camera] and a [param frustum], this method should return which subgizmos are contained within the frustum. The [param frustum] argument consists of an array with all the [Plane]s that make up the selection frustum. The returned value should contain a list of unique subgizmo identifiers, which can have any non-negative value and will be used in other virtual methods like [method _get_subgizmo_transform] or [method _commit_subgizmos]. */ + /* gdvirtual */ _subgizmos_intersect_frustum(camera: Camera3D, frustum: GArray): PackedInt32Array + + /** Override this method to update the node properties during subgizmo editing (see [method _subgizmos_intersect_ray] and [method _subgizmos_intersect_frustum]). The [param transform] is given in the [Node3D]'s local coordinate system. */ + /* gdvirtual */ _set_subgizmo_transform(id: int64, transform: Transform3D): void + + /** Override this method to return the current transform of a subgizmo. This transform will be requested at the start of an edit and used as the `restore` argument in [method _commit_subgizmos]. */ + /* gdvirtual */ _get_subgizmo_transform(id: int64): Transform3D + + /** Override this method to commit a group of subgizmos being edited (see [method _subgizmos_intersect_ray] and [method _subgizmos_intersect_frustum]). This usually means creating an [UndoRedo] action for the change, using the current transforms as "do" and the [param restores] transforms as "undo". + * If the [param cancel] argument is `true`, the [param restores] transforms should be directly set, without any [UndoRedo] action. + */ + /* gdvirtual */ _commit_subgizmos(ids: PackedInt32Array | int32[], restores: GArray, cancel: boolean): void + + /** Adds lines to the gizmo (as sets of 2 points), with a given material. The lines are used for visualizing the gizmo. Call this method during [method _redraw]. */ + add_lines(lines: PackedVector3Array | Vector3[], material: Material, billboard: boolean = false, modulate: Color = new Color(1, 1, 1, 1)): void + + /** Adds a mesh to the gizmo with the specified [param material], local [param transform] and [param skeleton]. Call this method during [method _redraw]. */ + add_mesh(mesh: Mesh, material: Material = undefined, transform: Transform3D = new Transform3D(), skeleton: SkinReference = undefined): void + + /** Adds the specified [param segments] to the gizmo's collision shape for picking. Call this method during [method _redraw]. */ + add_collision_segments(segments: PackedVector3Array | Vector3[]): void + + /** Adds collision triangles to the gizmo for picking. A [TriangleMesh] can be generated from a regular [Mesh] too. Call this method during [method _redraw]. */ + add_collision_triangles(triangles: TriangleMesh): void + + /** Adds an unscaled billboard for visualization and selection. Call this method during [method _redraw]. */ + add_unscaled_billboard(material: Material, default_scale: float64 = 1, modulate: Color = new Color(1, 1, 1, 1)): void + + /** Adds a list of handles (points) which can be used to edit the properties of the gizmo's [Node3D]. The [param ids] argument can be used to specify a custom identifier for each handle, if an empty array is passed, the ids will be assigned automatically from the [param handles] argument order. + * The [param secondary] argument marks the added handles as secondary, meaning they will normally have lower selection priority than regular handles. When the user is holding the shift key secondary handles will switch to have higher priority than regular handles. This change in priority can be used to place multiple handles at the same point while still giving the user control on their selection. + * There are virtual methods which will be called upon editing of these handles. Call this method during [method _redraw]. + */ + add_handles(handles: PackedVector3Array | Vector3[], material: Material, ids: PackedInt32Array | int32[], billboard: boolean = false, secondary: boolean = false): void + + /** Sets the reference [Node3D] node for the gizmo. [param node] must inherit from [Node3D]. */ + set_node_3d(node: Node): void + + /** Returns the [Node3D] node associated with this gizmo. */ + get_node_3d(): Node3D + + /** Returns the [EditorNode3DGizmoPlugin] that owns this gizmo. It's useful to retrieve materials using [method EditorNode3DGizmoPlugin.get_material]. */ + get_plugin(): EditorNode3DGizmoPlugin + + /** Removes everything in the gizmo including meshes, collisions and handles. */ + clear(): void + + /** Sets the gizmo's hidden state. If `true`, the gizmo will be hidden. If `false`, it will be shown. */ + set_hidden(hidden: boolean): void + + /** Returns `true` if the given subgizmo is currently selected. Can be used to highlight selected elements during [method _redraw]. */ + is_subgizmo_selected(id: int64): boolean + + /** Returns a list of the currently selected subgizmos. Can be used to highlight selected elements during [method _redraw]. */ + get_subgizmo_selection(): PackedInt32Array + } + /** A class used by the editor to define Node3D gizmo types. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_editornode3dgizmoplugin.html + */ + class EditorNode3DGizmoPlugin extends Resource { + constructor(identifier?: any) + /** Override this method to define which Node3D nodes have a gizmo from this plugin. Whenever a [Node3D] node is added to a scene this method is called, if it returns `true` the node gets a generic [EditorNode3DGizmo] assigned and is added to this plugin's list of active gizmos. */ + /* gdvirtual */ _has_gizmo(for_node_3d: Node3D): boolean + + /** Override this method to return a custom [EditorNode3DGizmo] for the 3D nodes of your choice, return `null` for the rest of nodes. See also [method _has_gizmo]. */ + /* gdvirtual */ _create_gizmo(for_node_3d: Node3D): EditorNode3DGizmo + + /** Override this method to provide the name that will appear in the gizmo visibility menu. */ + /* gdvirtual */ _get_gizmo_name(): string + + /** Override this method to set the gizmo's priority. Gizmos with higher priority will have precedence when processing inputs like handles or subgizmos selection. + * All built-in editor gizmos return a priority of `-1`. If not overridden, this method will return `0`, which means custom gizmos will automatically get higher priority than built-in gizmos. + */ + /* gdvirtual */ _get_priority(): int64 + + /** Override this method to define whether the gizmos handled by this plugin can be hidden or not. Returns `true` if not overridden. */ + /* gdvirtual */ _can_be_hidden(): boolean + + /** Override this method to define whether Node3D with this gizmo should be selectable even when the gizmo is hidden. */ + /* gdvirtual */ _is_selectable_when_hidden(): boolean + + /** Override this method to add all the gizmo elements whenever a gizmo update is requested. It's common to call [method EditorNode3DGizmo.clear] at the beginning of this method and then add visual elements depending on the node's properties. */ + /* gdvirtual */ _redraw(gizmo: EditorNode3DGizmo): void + + /** Override this method to provide gizmo's handle names. The [param secondary] argument is `true` when the requested handle is secondary (see [method EditorNode3DGizmo.add_handles] for more information). Called for this plugin's active gizmos. */ + /* gdvirtual */ _get_handle_name(gizmo: EditorNode3DGizmo, handle_id: int64, secondary: boolean): string + + /** Override this method to return `true` whenever to given handle should be highlighted in the editor. The [param secondary] argument is `true` when the requested handle is secondary (see [method EditorNode3DGizmo.add_handles] for more information). Called for this plugin's active gizmos. */ + /* gdvirtual */ _is_handle_highlighted(gizmo: EditorNode3DGizmo, handle_id: int64, secondary: boolean): boolean + + /** Override this method to return the current value of a handle. This value will be requested at the start of an edit and used as the `restore` argument in [method _commit_handle]. + * The [param secondary] argument is `true` when the requested handle is secondary (see [method EditorNode3DGizmo.add_handles] for more information). + * Called for this plugin's active gizmos. + */ + /* gdvirtual */ _get_handle_value(gizmo: EditorNode3DGizmo, handle_id: int64, secondary: boolean): any + /* gdvirtual */ _begin_handle_action(gizmo: EditorNode3DGizmo, handle_id: int64, secondary: boolean): void + + /** Override this method to update the node's properties when the user drags a gizmo handle (previously added with [method EditorNode3DGizmo.add_handles]). The provided [param screen_pos] is the mouse position in screen coordinates and the [param camera] can be used to convert it to raycasts. + * The [param secondary] argument is `true` when the edited handle is secondary (see [method EditorNode3DGizmo.add_handles] for more information). + * Called for this plugin's active gizmos. + */ + /* gdvirtual */ _set_handle(gizmo: EditorNode3DGizmo, handle_id: int64, secondary: boolean, camera: Camera3D, screen_pos: Vector2): void + + /** Override this method to commit a handle being edited (handles must have been previously added by [method EditorNode3DGizmo.add_handles] during [method _redraw]). This usually means creating an [UndoRedo] action for the change, using the current handle value as "do" and the [param restore] argument as "undo". + * If the [param cancel] argument is `true`, the [param restore] value should be directly set, without any [UndoRedo] action. + * The [param secondary] argument is `true` when the committed handle is secondary (see [method EditorNode3DGizmo.add_handles] for more information). + * Called for this plugin's active gizmos. + */ + /* gdvirtual */ _commit_handle(gizmo: EditorNode3DGizmo, handle_id: int64, secondary: boolean, restore: any, cancel: boolean): void + + /** Override this method to allow selecting subgizmos using mouse clicks. Given a [param camera] and a [param screen_pos] in screen coordinates, this method should return which subgizmo should be selected. The returned value should be a unique subgizmo identifier, which can have any non-negative value and will be used in other virtual methods like [method _get_subgizmo_transform] or [method _commit_subgizmos]. Called for this plugin's active gizmos. */ + /* gdvirtual */ _subgizmos_intersect_ray(gizmo: EditorNode3DGizmo, camera: Camera3D, screen_pos: Vector2): int64 + + /** Override this method to allow selecting subgizmos using mouse drag box selection. Given a [param camera] and [param frustum_planes], this method should return which subgizmos are contained within the frustums. The [param frustum_planes] argument consists of an array with all the [Plane]s that make up the selection frustum. The returned value should contain a list of unique subgizmo identifiers, these identifiers can have any non-negative value and will be used in other virtual methods like [method _get_subgizmo_transform] or [method _commit_subgizmos]. Called for this plugin's active gizmos. */ + /* gdvirtual */ _subgizmos_intersect_frustum(gizmo: EditorNode3DGizmo, camera: Camera3D, frustum_planes: GArray): PackedInt32Array + + /** Override this method to return the current transform of a subgizmo. As with all subgizmo methods, the transform should be in local space respect to the gizmo's Node3D. This transform will be requested at the start of an edit and used in the `restore` argument in [method _commit_subgizmos]. Called for this plugin's active gizmos. */ + /* gdvirtual */ _get_subgizmo_transform(gizmo: EditorNode3DGizmo, subgizmo_id: int64): Transform3D + + /** Override this method to update the node properties during subgizmo editing (see [method _subgizmos_intersect_ray] and [method _subgizmos_intersect_frustum]). The [param transform] is given in the Node3D's local coordinate system. Called for this plugin's active gizmos. */ + /* gdvirtual */ _set_subgizmo_transform(gizmo: EditorNode3DGizmo, subgizmo_id: int64, transform: Transform3D): void + + /** Override this method to commit a group of subgizmos being edited (see [method _subgizmos_intersect_ray] and [method _subgizmos_intersect_frustum]). This usually means creating an [UndoRedo] action for the change, using the current transforms as "do" and the [param restores] transforms as "undo". + * If the [param cancel] argument is `true`, the [param restores] transforms should be directly set, without any [UndoRedo] action. As with all subgizmo methods, transforms are given in local space respect to the gizmo's Node3D. Called for this plugin's active gizmos. + */ + /* gdvirtual */ _commit_subgizmos(gizmo: EditorNode3DGizmo, ids: PackedInt32Array | int32[], restores: GArray, cancel: boolean): void + + /** Creates an unshaded material with its variants (selected and/or editable) and adds them to the internal material list. They can then be accessed with [method get_material] and used in [method EditorNode3DGizmo.add_mesh] and [method EditorNode3DGizmo.add_lines]. Should not be overridden. */ + create_material(name: string, color: Color, billboard: boolean = false, on_top: boolean = false, use_vertex_color: boolean = false): void + + /** Creates an icon material with its variants (selected and/or editable) and adds them to the internal material list. They can then be accessed with [method get_material] and used in [method EditorNode3DGizmo.add_unscaled_billboard]. Should not be overridden. */ + create_icon_material(name: string, texture: Texture2D, on_top: boolean = false, color: Color = new Color(1, 1, 1, 1)): void + + /** Creates a handle material with its variants (selected and/or editable) and adds them to the internal material list. They can then be accessed with [method get_material] and used in [method EditorNode3DGizmo.add_handles]. Should not be overridden. + * You can optionally provide a texture to use instead of the default icon. + */ + create_handle_material(name: string, billboard: boolean = false, texture: Texture2D = undefined): void + + /** Adds a new material to the internal material list for the plugin. It can then be accessed with [method get_material]. Should not be overridden. */ + add_material(name: string, material: StandardMaterial3D): void + + /** Gets material from the internal list of materials. If an [EditorNode3DGizmo] is provided, it will try to get the corresponding variant (selected and/or editable). */ + get_material(name: string, gizmo: EditorNode3DGizmo = undefined): StandardMaterial3D + } + class EditorOBJImporter extends EditorSceneFormatImporter { + constructor(identifier?: any) + } + class EditorObjectSelector = Record> extends Button { + constructor(identifier?: any) + } + class EditorPackedScenePreviewPlugin extends EditorResourcePreviewGenerator { + constructor(identifier?: any) + } + /** Editor-only singleton that returns paths to various OS-specific data folders and files. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_editorpaths.html + */ + class EditorPaths extends Object { + constructor(identifier?: any) + /** Returns the absolute path to the user's data folder. This folder should be used for *persistent* user data files such as installed export templates. + * **Default paths per platform:** + * [codeblock lang=text] + * - Windows: %APPDATA%\Godot\ (same as `get_config_dir()`) + * - macOS: ~/Library/Application Support/Godot/ (same as `get_config_dir()`) + * - Linux: ~/.local/share/godot/ + * [/codeblock] + */ + get_data_dir(): string + + /** Returns the absolute path to the user's configuration folder. This folder should be used for *persistent* user configuration files. + * **Default paths per platform:** + * [codeblock lang=text] + * - Windows: %APPDATA%\Godot\ (same as `get_data_dir()`) + * - macOS: ~/Library/Application Support/Godot/ (same as `get_data_dir()`) + * - Linux: ~/.config/godot/ + * [/codeblock] + */ + get_config_dir(): string + + /** Returns the absolute path to the user's cache folder. This folder should be used for temporary data that can be removed safely whenever the editor is closed (such as generated resource thumbnails). + * **Default paths per platform:** + * [codeblock lang=text] + * - Windows: %LOCALAPPDATA%\Godot\ + * - macOS: ~/Library/Caches/Godot/ + * - Linux: ~/.cache/godot/ + * [/codeblock] + */ + get_cache_dir(): string + + /** Returns `true` if the editor is marked as self-contained, `false` otherwise. When self-contained mode is enabled, user configuration, data and cache files are saved in an `editor_data/` folder next to the editor binary. This makes portable usage easier and ensures the Godot editor minimizes file writes outside its own folder. Self-contained mode is not available for exported projects. + * Self-contained mode can be enabled by creating a file named `._sc_` or `_sc_` in the same folder as the editor binary or macOS .app bundle while the editor is not running. See also [method get_self_contained_file]. + * + * **Note:** On macOS, quarantine flag should be manually removed before using self-contained mode, see [url=https://docs.godotengine.org/en/stable/tutorials/export/running_on_macos.html]Running on macOS[/url]. + * + * **Note:** On macOS, placing `_sc_` or any other file inside .app bundle will break digital signature and make it non-portable, consider placing it in the same folder as the .app bundle instead. + * + * **Note:** The Steam release of Godot uses self-contained mode by default. + */ + is_self_contained(): boolean + + /** Returns the absolute path to the self-contained file that makes the current Godot editor instance be considered as self-contained. Returns an empty string if the current Godot editor instance isn't self-contained. See also [method is_self_contained]. */ + get_self_contained_file(): string + + /** Returns the project-specific editor settings path. Projects all have a unique subdirectory inside the settings path where project-specific editor settings are saved. */ + get_project_settings_dir(): string + } + class EditorPerformanceProfiler = Record> extends HSplitContainer { + constructor(identifier?: any) + } + namespace EditorPlugin { + enum CustomControlContainer { + /** Main editor toolbar, next to play buttons. */ + CONTAINER_TOOLBAR = 0, + + /** The toolbar that appears when 3D editor is active. */ + CONTAINER_SPATIAL_EDITOR_MENU = 1, + + /** Left sidebar of the 3D editor. */ + CONTAINER_SPATIAL_EDITOR_SIDE_LEFT = 2, + + /** Right sidebar of the 3D editor. */ + CONTAINER_SPATIAL_EDITOR_SIDE_RIGHT = 3, + + /** Bottom panel of the 3D editor. */ + CONTAINER_SPATIAL_EDITOR_BOTTOM = 4, + + /** The toolbar that appears when 2D editor is active. */ + CONTAINER_CANVAS_EDITOR_MENU = 5, + + /** Left sidebar of the 2D editor. */ + CONTAINER_CANVAS_EDITOR_SIDE_LEFT = 6, + + /** Right sidebar of the 2D editor. */ + CONTAINER_CANVAS_EDITOR_SIDE_RIGHT = 7, + + /** Bottom panel of the 2D editor. */ + CONTAINER_CANVAS_EDITOR_BOTTOM = 8, + + /** Bottom section of the inspector. */ + CONTAINER_INSPECTOR_BOTTOM = 9, + + /** Tab of Project Settings dialog, to the left of other tabs. */ + CONTAINER_PROJECT_SETTING_TAB_LEFT = 10, + + /** Tab of Project Settings dialog, to the right of other tabs. */ + CONTAINER_PROJECT_SETTING_TAB_RIGHT = 11, + } + enum DockSlot { + /** Dock slot, left side, upper-left (empty in default layout). */ + DOCK_SLOT_LEFT_UL = 0, + + /** Dock slot, left side, bottom-left (empty in default layout). */ + DOCK_SLOT_LEFT_BL = 1, + + /** Dock slot, left side, upper-right (in default layout includes Scene and Import docks). */ + DOCK_SLOT_LEFT_UR = 2, + + /** Dock slot, left side, bottom-right (in default layout includes FileSystem dock). */ + DOCK_SLOT_LEFT_BR = 3, + + /** Dock slot, right side, upper-left (in default layout includes Inspector, Node, and History docks). */ + DOCK_SLOT_RIGHT_UL = 4, + + /** Dock slot, right side, bottom-left (empty in default layout). */ + DOCK_SLOT_RIGHT_BL = 5, + + /** Dock slot, right side, upper-right (empty in default layout). */ + DOCK_SLOT_RIGHT_UR = 6, + + /** Dock slot, right side, bottom-right (empty in default layout). */ + DOCK_SLOT_RIGHT_BR = 7, + + /** Represents the size of the [enum DockSlot] enum. */ + DOCK_SLOT_MAX = 8, + } + enum AfterGUIInput { + /** Forwards the [InputEvent] to other EditorPlugins. */ + AFTER_GUI_INPUT_PASS = 0, + + /** Prevents the [InputEvent] from reaching other Editor classes. */ + AFTER_GUI_INPUT_STOP = 1, + + /** Pass the [InputEvent] to other editor plugins except the main [Node3D] one. This can be used to prevent node selection changes and work with sub-gizmos instead. */ + AFTER_GUI_INPUT_CUSTOM = 2, + } + } + /** Used by the editor to extend its functionality. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_editorplugin.html + */ + class EditorPlugin = Record> extends Node { + constructor(identifier?: any) + /** Called when there is a root node in the current edited scene, [method _handles] is implemented, and an [InputEvent] happens in the 2D viewport. If this method returns `true`, [param event] is intercepted by this [EditorPlugin], otherwise [param event] is forwarded to other Editor classes. + * + * This method must return `false` in order to forward the [InputEvent] to other Editor classes. + * + */ + /* gdvirtual */ _forward_canvas_gui_input(event: InputEvent): boolean + + /** Called by the engine when the 2D editor's viewport is updated. Use the `overlay` [Control] for drawing. You can update the viewport manually by calling [method update_overlays]. + * + */ + /* gdvirtual */ _forward_canvas_draw_over_viewport(viewport_control: Control): void + + /** This method is the same as [method _forward_canvas_draw_over_viewport], except it draws on top of everything. Useful when you need an extra layer that shows over anything else. + * You need to enable calling of this method by using [method set_force_draw_over_forwarding_enabled]. + */ + /* gdvirtual */ _forward_canvas_force_draw_over_viewport(viewport_control: Control): void + + /** Called when there is a root node in the current edited scene, [method _handles] is implemented, and an [InputEvent] happens in the 3D viewport. The return value decides whether the [InputEvent] is consumed or forwarded to other [EditorPlugin]s. See [enum AfterGUIInput] for options. + * + * This method must return [constant AFTER_GUI_INPUT_PASS] in order to forward the [InputEvent] to other Editor classes. + * + */ + /* gdvirtual */ _forward_3d_gui_input(viewport_camera: Camera3D, event: InputEvent): int64 + + /** Called by the engine when the 3D editor's viewport is updated. Use the `overlay` [Control] for drawing. You can update the viewport manually by calling [method update_overlays]. + * + */ + /* gdvirtual */ _forward_3d_draw_over_viewport(viewport_control: Control): void + + /** This method is the same as [method _forward_3d_draw_over_viewport], except it draws on top of everything. Useful when you need an extra layer that shows over anything else. + * You need to enable calling of this method by using [method set_force_draw_over_forwarding_enabled]. + */ + /* gdvirtual */ _forward_3d_force_draw_over_viewport(viewport_control: Control): void + + /** Override this method in your plugin to provide the name of the plugin when displayed in the Godot editor. + * For main screen plugins, this appears at the top of the screen, to the right of the "2D", "3D", "Script", and "AssetLib" buttons. + */ + /* gdvirtual */ _get_plugin_name(): string + + /** Override this method in your plugin to return a [Texture2D] in order to give it an icon. + * For main screen plugins, this appears at the top of the screen, to the right of the "2D", "3D", "Script", and "AssetLib" buttons. + * Ideally, the plugin icon should be white with a transparent background and 16×16 pixels in size. + * + */ + /* gdvirtual */ _get_plugin_icon(): Texture2D + + /** Returns `true` if this is a main screen editor plugin (it goes in the workspace selector together with **2D**, **3D**, **Script** and **AssetLib**). + * When the plugin's workspace is selected, other main screen plugins will be hidden, but your plugin will not appear automatically. It needs to be added as a child of [method EditorInterface.get_editor_main_screen] and made visible inside [method _make_visible]. + * Use [method _get_plugin_name] and [method _get_plugin_icon] to customize the plugin button's appearance. + * + */ + /* gdvirtual */ _has_main_screen(): boolean + + /** This function will be called when the editor is requested to become visible. It is used for plugins that edit a specific object type. + * Remember that you have to manage the visibility of all your editor controls manually. + */ + /* gdvirtual */ _make_visible(visible: boolean): void + + /** This function is used for plugins that edit specific object types (nodes or resources). It requests the editor to edit the given object. + * [param object] can be `null` if the plugin was editing an object, but there is no longer any selected object handled by this plugin. It can be used to cleanup editing state. + */ + /* gdvirtual */ _edit(object: Object): void + + /** Implement this function if your plugin edits a specific type of object (Resource or Node). If you return `true`, then you will get the functions [method _edit] and [method _make_visible] called when the editor requests them. If you have declared the methods [method _forward_canvas_gui_input] and [method _forward_3d_gui_input] these will be called too. + * + * **Note:** Each plugin should handle only one type of objects at a time. If a plugin handles more types of objects and they are edited at the same time, it will result in errors. + */ + /* gdvirtual */ _handles(object: Object): boolean + + /** Override this method to provide a state data you want to be saved, like view position, grid settings, folding, etc. This is used when saving the scene (so state is kept when opening it again) and for switching tabs (so state can be restored when the tab returns). This data is automatically saved for each scene in an `editstate` file in the editor metadata folder. If you want to store global (scene-independent) editor data for your plugin, you can use [method _get_window_layout] instead. + * Use [method _set_state] to restore your saved state. + * + * **Note:** This method should not be used to save important settings that should persist with the project. + * + * **Note:** You must implement [method _get_plugin_name] for the state to be stored and restored correctly. + * + */ + /* gdvirtual */ _get_state(): GDictionary + + /** Restore the state saved by [method _get_state]. This method is called when the current scene tab is changed in the editor. + * + * **Note:** Your plugin must implement [method _get_plugin_name], otherwise it will not be recognized and this method will not be called. + * + */ + /* gdvirtual */ _set_state(state: GDictionary): void + + /** Clear all the state and reset the object being edited to zero. This ensures your plugin does not keep editing a currently existing node, or a node from the wrong scene. */ + /* gdvirtual */ _clear(): void + + /** Override this method to provide a custom message that lists unsaved changes. The editor will call this method when exiting or when closing a scene, and display the returned string in a confirmation dialog. Return empty string if the plugin has no unsaved changes. + * When closing a scene, [param for_scene] is the path to the scene being closed. You can use it to handle built-in resources in that scene. + * If the user confirms saving, [method _save_external_data] will be called, before closing the editor. + * + * If the plugin has no scene-specific changes, you can ignore the calls when closing scenes: + * + */ + /* gdvirtual */ _get_unsaved_status(for_scene: string): string + + /** This method is called after the editor saves the project or when it's closed. It asks the plugin to save edited external scenes/resources. */ + /* gdvirtual */ _save_external_data(): void + + /** This method is called when the editor is about to save the project, switch to another tab, etc. It asks the plugin to apply any pending state changes to ensure consistency. + * This is used, for example, in shader editors to let the plugin know that it must apply the shader code being written by the user to the object. + */ + /* gdvirtual */ _apply_changes(): void + + /** This is for editors that edit script-based objects. You can return a list of breakpoints in the format (`script:line`), for example: `res://path_to_script.gd:25`. */ + /* gdvirtual */ _get_breakpoints(): PackedStringArray + + /** Restore the plugin GUI layout and data saved by [method _get_window_layout]. This method is called for every plugin on editor startup. Use the provided [param configuration] file to read your saved data. + * + */ + /* gdvirtual */ _set_window_layout(configuration: ConfigFile): void + + /** Override this method to provide the GUI layout of the plugin or any other data you want to be stored. This is used to save the project's editor layout when [method queue_save_layout] is called or the editor layout was changed (for example changing the position of a dock). The data is stored in the `editor_layout.cfg` file in the editor metadata directory. + * Use [method _set_window_layout] to restore your saved layout. + * + */ + /* gdvirtual */ _get_window_layout(configuration: ConfigFile): void + + /** This method is called when the editor is about to run the project. The plugin can then perform required operations before the project runs. + * This method must return a boolean. If this method returns `false`, the project will not run. The run is aborted immediately, so this also prevents all other plugins' [method _build] methods from running. + */ + /* gdvirtual */ _build(): boolean + + /** Called by the engine when the user enables the [EditorPlugin] in the Plugin tab of the project settings window. */ + /* gdvirtual */ _enable_plugin(): void + + /** Called by the engine when the user disables the [EditorPlugin] in the Plugin tab of the project settings window. */ + /* gdvirtual */ _disable_plugin(): void + + /** Adds a custom control to a container (see [enum CustomControlContainer]). There are many locations where custom controls can be added in the editor UI. + * Please remember that you have to manage the visibility of your custom controls yourself (and likely hide it after adding it). + * When your plugin is deactivated, make sure to remove your custom control with [method remove_control_from_container] and free it with [method Node.queue_free]. + */ + add_control_to_container(container: EditorPlugin.CustomControlContainer, control: Control): void + + /** Adds a control to the bottom panel (together with Output, Debug, Animation, etc.). Returns a reference to the button added. It's up to you to hide/show the button when needed. When your plugin is deactivated, make sure to remove your custom control with [method remove_control_from_bottom_panel] and free it with [method Node.queue_free]. + * Optionally, you can specify a shortcut parameter. When pressed, this shortcut will toggle the bottom panel's visibility. See the default editor bottom panel shortcuts in the Editor Settings for inspiration. Per convention, they all use [kbd]Alt[/kbd] modifier. + */ + add_control_to_bottom_panel(control: Control, title: string, shortcut: Shortcut = undefined): Button + + /** Adds the control to a specific dock slot (see [enum DockSlot] for options). + * If the dock is repositioned and as long as the plugin is active, the editor will save the dock position on further sessions. + * When your plugin is deactivated, make sure to remove your custom control with [method remove_control_from_docks] and free it with [method Node.queue_free]. + * Optionally, you can specify a shortcut parameter. When pressed, this shortcut will toggle the dock's visibility once it's moved to the bottom panel (this shortcut does not affect the dock otherwise). See the default editor bottom panel shortcuts in the Editor Settings for inspiration. Per convention, they all use [kbd]Alt[/kbd] modifier. + */ + add_control_to_dock(slot: EditorPlugin.DockSlot, control: Control, shortcut: Shortcut = undefined): void + + /** Removes the control from the dock. You have to manually [method Node.queue_free] the control. */ + remove_control_from_docks(control: Control): void + + /** Removes the control from the bottom panel. You have to manually [method Node.queue_free] the control. */ + remove_control_from_bottom_panel(control: Control): void + + /** Removes the control from the specified container. You have to manually [method Node.queue_free] the control. */ + remove_control_from_container(container: EditorPlugin.CustomControlContainer, control: Control): void + + /** Sets the tab icon for the given control in a dock slot. Setting to `null` removes the icon. */ + set_dock_tab_icon(control: Control, icon: Texture2D): void + + /** Adds a custom menu item to **Project > Tools** named [param name]. When clicked, the provided [param callable] will be called. */ + add_tool_menu_item(name: string, callable: Callable): void + + /** Adds a custom [PopupMenu] submenu under **Project > Tools >** [param name]. Use [method remove_tool_menu_item] on plugin clean up to remove the menu. */ + add_tool_submenu_item(name: string, submenu: PopupMenu): void + + /** Removes a menu [param name] from **Project > Tools**. */ + remove_tool_menu_item(name: string): void + + /** Returns the [PopupMenu] under **Scene > Export As...**. */ + get_export_as_menu(): PopupMenu + + /** Adds a custom type, which will appear in the list of nodes or resources. + * When a given node or resource is selected, the base type will be instantiated (e.g. "Node3D", "Control", "Resource"), then the script will be loaded and set to this object. + * + * **Note:** The base type is the base engine class which this type's class hierarchy inherits, not any custom type parent classes. + * You can use the virtual method [method _handles] to check if your custom object is being edited by checking the script or using the `is` keyword. + * During run-time, this will be a simple object with a script so this function does not need to be called then. + * + * **Note:** Custom types added this way are not true classes. They are just a helper to create a node with specific script. + */ + add_custom_type(type: string, base: string, script: Script, icon: Texture2D): void + + /** Removes a custom type added by [method add_custom_type]. */ + remove_custom_type(type: string): void + + /** Adds a script at [param path] to the Autoload list as [param name]. */ + add_autoload_singleton(name: string, path: string): void + + /** Removes an Autoload [param name] from the list. */ + remove_autoload_singleton(name: string): void + + /** Updates the overlays of the 2D and 3D editor viewport. Causes methods [method _forward_canvas_draw_over_viewport], [method _forward_canvas_force_draw_over_viewport], [method _forward_3d_draw_over_viewport] and [method _forward_3d_force_draw_over_viewport] to be called. */ + update_overlays(): int64 + + /** Makes a specific item in the bottom panel visible. */ + make_bottom_panel_item_visible(item: Control): void + + /** Minimizes the bottom panel. */ + hide_bottom_panel(): void + + /** Gets the undo/redo object. Most actions in the editor can be undoable, so use this object to make sure this happens when it's worth it. */ + get_undo_redo(): EditorUndoRedoManager + + /** Hooks a callback into the undo/redo action creation when a property is modified in the inspector. This allows, for example, to save other properties that may be lost when a given property is modified. + * The callback should have 4 arguments: [Object] `undo_redo`, [Object] `modified_object`, [String] `property` and [Variant] `new_value`. They are, respectively, the [UndoRedo] object used by the inspector, the currently modified object, the name of the modified property and the new value the property is about to take. + */ + add_undo_redo_inspector_hook_callback(callable: Callable): void + + /** Removes a callback previously added by [method add_undo_redo_inspector_hook_callback]. */ + remove_undo_redo_inspector_hook_callback(callable: Callable): void + + /** Queue save the project's editor layout. */ + queue_save_layout(): void + + /** Registers a custom translation parser plugin for extracting translatable strings from custom files. */ + add_translation_parser_plugin(parser: EditorTranslationParserPlugin): void + + /** Removes a custom translation parser plugin registered by [method add_translation_parser_plugin]. */ + remove_translation_parser_plugin(parser: EditorTranslationParserPlugin): void + + /** Registers a new [EditorImportPlugin]. Import plugins are used to import custom and unsupported assets as a custom [Resource] type. + * If [param first_priority] is `true`, the new import plugin is inserted first in the list and takes precedence over pre-existing plugins. + * + * **Note:** If you want to import custom 3D asset formats use [method add_scene_format_importer_plugin] instead. + * See [method add_inspector_plugin] for an example of how to register a plugin. + */ + add_import_plugin(importer: EditorImportPlugin, first_priority: boolean = false): void + + /** Removes an import plugin registered by [method add_import_plugin]. */ + remove_import_plugin(importer: EditorImportPlugin): void + + /** Registers a new [EditorSceneFormatImporter]. Scene importers are used to import custom 3D asset formats as scenes. + * If [param first_priority] is `true`, the new import plugin is inserted first in the list and takes precedence over pre-existing plugins. + */ + add_scene_format_importer_plugin(scene_format_importer: EditorSceneFormatImporter, first_priority: boolean = false): void + + /** Removes a scene format importer registered by [method add_scene_format_importer_plugin]. */ + remove_scene_format_importer_plugin(scene_format_importer: EditorSceneFormatImporter): void + + /** Add a [EditorScenePostImportPlugin]. These plugins allow customizing the import process of 3D assets by adding new options to the import dialogs. + * If [param first_priority] is `true`, the new import plugin is inserted first in the list and takes precedence over pre-existing plugins. + */ + add_scene_post_import_plugin(scene_import_plugin: EditorScenePostImportPlugin, first_priority: boolean = false): void + + /** Remove the [EditorScenePostImportPlugin], added with [method add_scene_post_import_plugin]. */ + remove_scene_post_import_plugin(scene_import_plugin: EditorScenePostImportPlugin): void + + /** Registers a new [EditorExportPlugin]. Export plugins are used to perform tasks when the project is being exported. + * See [method add_inspector_plugin] for an example of how to register a plugin. + */ + add_export_plugin(plugin: EditorExportPlugin): void + + /** Removes an export plugin registered by [method add_export_plugin]. */ + remove_export_plugin(plugin: EditorExportPlugin): void + + /** Registers a new [EditorExportPlatform]. Export platforms provides functionality of exporting to the specific platform. */ + add_export_platform(platform: EditorExportPlatform): void + + /** Removes an export platform registered by [method add_export_platform]. */ + remove_export_platform(platform: EditorExportPlatform): void + + /** Registers a new [EditorNode3DGizmoPlugin]. Gizmo plugins are used to add custom gizmos to the 3D preview viewport for a [Node3D]. + * See [method add_inspector_plugin] for an example of how to register a plugin. + */ + add_node_3d_gizmo_plugin(plugin: EditorNode3DGizmoPlugin): void + + /** Removes a gizmo plugin registered by [method add_node_3d_gizmo_plugin]. */ + remove_node_3d_gizmo_plugin(plugin: EditorNode3DGizmoPlugin): void + + /** Registers a new [EditorInspectorPlugin]. Inspector plugins are used to extend [EditorInspector] and provide custom configuration tools for your object's properties. + * + * **Note:** Always use [method remove_inspector_plugin] to remove the registered [EditorInspectorPlugin] when your [EditorPlugin] is disabled to prevent leaks and an unexpected behavior. + * + */ + add_inspector_plugin(plugin: EditorInspectorPlugin): void + + /** Removes an inspector plugin registered by [method add_inspector_plugin]. */ + remove_inspector_plugin(plugin: EditorInspectorPlugin): void + + /** Registers a new [EditorResourceConversionPlugin]. Resource conversion plugins are used to add custom resource converters to the editor inspector. + * See [EditorResourceConversionPlugin] for an example of how to create a resource conversion plugin. + */ + add_resource_conversion_plugin(plugin: EditorResourceConversionPlugin): void + + /** Removes a resource conversion plugin registered by [method add_resource_conversion_plugin]. */ + remove_resource_conversion_plugin(plugin: EditorResourceConversionPlugin): void + + /** Use this method if you always want to receive inputs from 3D view screen inside [method _forward_3d_gui_input]. It might be especially usable if your plugin will want to use raycast in the scene. */ + set_input_event_forwarding_always_enabled(): void + + /** Enables calling of [method _forward_canvas_force_draw_over_viewport] for the 2D editor and [method _forward_3d_force_draw_over_viewport] for the 3D editor when their viewports are updated. You need to call this method only once and it will work permanently for this plugin. */ + set_force_draw_over_forwarding_enabled(): void + + /** Adds a plugin to the context menu. [param slot] is the context menu where the plugin will be added. + * See [enum EditorContextMenuPlugin.ContextMenuSlot] for available context menus. A plugin instance can belong only to a single context menu slot. + */ + add_context_menu_plugin(slot: EditorContextMenuPlugin.ContextMenuSlot, plugin: EditorContextMenuPlugin): void + + /** Removes the specified context menu plugin. */ + remove_context_menu_plugin(plugin: EditorContextMenuPlugin): void + + /** Returns the [EditorInterface] singleton instance. */ + get_editor_interface(): EditorInterface + + /** Gets the Editor's dialog used for making scripts. + * + * **Note:** Users can configure it before use. + * **Warning:** Removing and freeing this node will render a part of the editor useless and may cause a crash. + */ + get_script_create_dialog(): ScriptCreateDialog + + /** Adds a [Script] as debugger plugin to the Debugger. The script must extend [EditorDebuggerPlugin]. */ + add_debugger_plugin(script: EditorDebuggerPlugin): void + + /** Removes the debugger plugin with given script from the Debugger. */ + remove_debugger_plugin(script: EditorDebuggerPlugin): void + + /** Provide the version of the plugin declared in the `plugin.cfg` config file. */ + get_plugin_version(): string + + /** Emitted when the scene is changed in the editor. The argument will return the root node of the scene that has just become active. If this scene is new and empty, the argument will be `null`. */ + readonly scene_changed: Signal1 + + /** Emitted when user closes a scene. The argument is a file path to the closed scene. */ + readonly scene_closed: Signal1 + + /** Emitted when user changes the workspace (**2D**, **3D**, **Script**, **AssetLib**). Also works with custom screens defined by plugins. */ + readonly main_screen_changed: Signal1 + + /** Emitted when the given [param resource] was saved on disc. See also [signal scene_saved]. */ + readonly resource_saved: Signal1 + + /** Emitted when a scene was saved on disc. The argument is a file path to the saved scene. See also [signal resource_saved]. */ + readonly scene_saved: Signal1 + + /** Emitted when any project setting has changed. */ + readonly project_settings_changed: Signal0 + } + class EditorPluginCSG = Record> extends EditorPlugin { + constructor(identifier?: any) + } + class EditorPluginSettings = Record> extends VBoxContainer { + constructor(identifier?: any) + } + class EditorProfiler = Record> extends VBoxContainer { + constructor(identifier?: any) + readonly enable_profiling: Signal1 + readonly break_request: Signal0 + } + /** Custom control for editing properties that can be added to the [EditorInspector]. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_editorproperty.html + */ + class EditorProperty = Record> extends Container { + constructor(identifier?: any) + /** When this virtual function is called, you must update your editor. */ + /* gdvirtual */ _update_property(): void + + /** Called when the read-only status of the property is changed. It may be used to change custom controls into a read-only or modifiable state. */ + /* gdvirtual */ _set_read_only(read_only: boolean): void + + /** Gets the edited property. If your editor is for a single property (added via [method EditorInspectorPlugin._parse_property]), then this will return the property. */ + get_edited_property(): StringName + + /** Gets the edited object. */ + get_edited_object(): Object + + /** Forces refresh of the property display. */ + update_property(): void + + /** If any of the controls added can gain keyboard focus, add it here. This ensures that focus will be restored if the inspector is refreshed. */ + add_focusable(control: Control): void + + /** Puts the [param editor] control below the property label. The control must be previously added using [method Node.add_child]. */ + set_bottom_editor(editor: Control): void + + /** Draw property as not selected. Used by the inspector. */ + deselect(): void + + /** Returns `true` if property is drawn as selected. Used by the inspector. */ + is_selected(): boolean + + /** Draw property as selected. Used by the inspector. */ + select(focusable: int64 = -1): void + + /** Assigns object and property to edit. */ + set_object_and_property(object: Object, property: StringName): void + + /** Used by the inspector, set to a control that will be used as a reference to calculate the size of the label. */ + set_label_reference(control: Control): void + + /** If one or several properties have changed, this must be called. [param field] is used in case your editor can modify fields separately (as an example, Vector3.x). The [param changing] argument avoids the editor requesting this property to be refreshed (leave as `false` if unsure). */ + emit_changed(property: StringName, value: any, field: StringName = '', changing: boolean = false): void + _update_editor_property_status(): void + + /** Set this property to change the label (if you want to show one). */ + get label(): string + set label(value: string) + + /** Used by the inspector, set to `true` when the property is read-only. */ + get read_only(): boolean + set read_only(value: boolean) + + /** Used by the inspector, set to `true` when the property background is drawn. */ + get draw_label(): boolean + set draw_label(value: boolean) + + /** Used by the inspector, set to `true` when the property label is drawn. */ + get draw_background(): boolean + set draw_background(value: boolean) + + /** Used by the inspector, set to `true` when the property is checkable. */ + get checkable(): boolean + set checkable(value: boolean) + + /** Used by the inspector, set to `true` when the property is checked. */ + get checked(): boolean + set checked(value: boolean) + + /** Used by the inspector, set to `true` when the property is drawn with the editor theme's warning color. This is used for editable children's properties. */ + get draw_warning(): boolean + set draw_warning(value: boolean) + + /** Used by the inspector, set to `true` when the property can add keys for animation. */ + get keying(): boolean + set keying(value: boolean) + + /** Used by the inspector, set to `true` when the property can be deleted by the user. */ + get deletable(): boolean + set deletable(value: boolean) + + /** Used by the inspector, set to `true` when the property is selectable. */ + get selectable(): boolean + set selectable(value: boolean) + + /** Used by the inspector, set to `true` when the property is using folding. */ + get use_folding(): boolean + set use_folding(value: boolean) + + /** Space distribution ratio between the label and the editing field. */ + get name_split_ratio(): float64 + set name_split_ratio(value: float64) + + /** Do not emit this manually, use the [method emit_changed] method instead. */ + readonly property_changed: Signal4 + + /** Emit it if you want multiple properties modified at the same time. Do not use if added via [method EditorInspectorPlugin._parse_property]. */ + readonly multiple_properties_changed: Signal2 + + /** Emit it if you want to add this value as an animation key (check for keying being enabled first). */ + readonly property_keyed: Signal1 + + /** Emitted when a property was deleted. Used internally. */ + readonly property_deleted: Signal1 + + /** Emit it if you want to key a property with a single value. */ + readonly property_keyed_with_value: Signal2 + + /** Emitted when a property was checked. Used internally. */ + readonly property_checked: Signal2 + + /** Emit it if you want to mark a property as favorited, making it appear at the top of the inspector. */ + readonly property_favorited: Signal2 + + /** Emit it if you want to mark (or unmark) the value of a property for being saved regardless of being equal to the default value. + * The default value is the one the property will get when the node is just instantiated and can come from an ancestor scene in the inheritance/instantiation chain, a script or a builtin class. + */ + readonly property_pinned: Signal2 + + /** Emitted when the revertability (i.e., whether it has a non-default value and thus is displayed with a revert icon) of a property has changed. */ + readonly property_can_revert_changed: Signal2 + + /** If you want a sub-resource to be edited, emit this signal with the resource. */ + readonly resource_selected: Signal2 + + /** Used by sub-inspectors. Emit it if what was selected was an Object ID. */ + readonly object_id_selected: Signal2 + + /** Emitted when selected. Used internally. */ + readonly selected: Signal2 + } + class EditorPropertyCheck = Record> extends EditorProperty { + constructor(identifier?: any) + } + class EditorPropertyDictionaryObject extends RefCounted { + constructor(identifier?: any) + } + class EditorPropertyEnum = Record> extends EditorProperty { + constructor(identifier?: any) + } + class EditorPropertyFloat = Record> extends EditorProperty { + constructor(identifier?: any) + } + class EditorPropertyInteger = Record> extends EditorProperty { + constructor(identifier?: any) + } + class EditorPropertyLayers = Record> extends EditorProperty { + constructor(identifier?: any) + } + class EditorPropertyLayersGrid = Record> extends Control { + constructor(identifier?: any) + readonly flag_changed: Signal1 + readonly rename_confirmed: Signal2 + } + class EditorPropertyLocalizableString = Record> extends EditorProperty { + constructor(identifier?: any) + } + class EditorPropertyMultilineText = Record> extends EditorProperty { + constructor(identifier?: any) + } + class EditorPropertyNameProcessor = Record> extends Node { + constructor(identifier?: any) + } + class EditorPropertyNodePath = Record> extends EditorProperty { + constructor(identifier?: any) + } + class EditorPropertyPath = Record> extends EditorProperty { + constructor(identifier?: any) + } + class EditorPropertyResource = Record> extends EditorProperty { + constructor(identifier?: any) + _should_stop_editing(): boolean + } + class EditorPropertyText = Record> extends EditorProperty { + constructor(identifier?: any) + } + class EditorPropertyVector2i = Record> extends EditorPropertyVectorN { + constructor(identifier?: any) + } + class EditorPropertyVector3 = Record> extends EditorPropertyVectorN { + constructor(identifier?: any) + } + class EditorPropertyVectorN = Record> extends EditorProperty { + constructor(identifier?: any) + } + class EditorQuickOpenDialog = Record> extends AcceptDialog { + constructor(identifier?: any) + } + /** Plugin for adding custom converters from one resource format to another in the editor resource picker context menu; for example, converting a [StandardMaterial3D] to a [ShaderMaterial]. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_editorresourceconversionplugin.html + */ + class EditorResourceConversionPlugin extends RefCounted { + constructor(identifier?: any) + /** Returns the class name of the target type of [Resource] that this plugin converts source resources to. */ + /* gdvirtual */ _converts_to(): string + + /** Called to determine whether a particular [Resource] can be converted to the target resource type by this plugin. */ + /* gdvirtual */ _handles(resource: Resource): boolean + + /** Takes an input [Resource] and converts it to the type given in [method _converts_to]. The returned [Resource] is the result of the conversion, and the input [Resource] remains unchanged. */ + /* gdvirtual */ _convert(resource: Resource): Resource + } + /** Godot editor's control for selecting [Resource] type properties. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_editorresourcepicker.html + */ + class EditorResourcePicker = Record> extends HBoxContainer { + constructor(identifier?: any) + /** This virtual method is called when updating the context menu of [EditorResourcePicker]. Implement this method to override the "New ..." items with your own options. [param menu_node] is a reference to the [PopupMenu] node. + * + * **Note:** Implement [method _handle_menu_selected] to handle these custom items. + */ + /* gdvirtual */ _set_create_options(menu_node: Object): void + + /** This virtual method can be implemented to handle context menu items not handled by default. See [method _set_create_options]. */ + /* gdvirtual */ _handle_menu_selected(id: int64): boolean + _update_resource_preview(_unnamed_arg0: string, _unnamed_arg1: Texture2D, _unnamed_arg2: Texture2D, _unnamed_arg3: int64): void + + /** Returns a list of all allowed types and subtypes corresponding to the [member base_type]. If the [member base_type] is empty, an empty list is returned. */ + get_allowed_types(): PackedStringArray + + /** Sets the toggle mode state for the main button. Works only if [member toggle_mode] is set to `true`. */ + set_toggle_pressed(pressed: boolean): void + + /** The base type of allowed resource types. Can be a comma-separated list of several options. */ + get base_type(): string + set base_type(value: string) + + /** The edited resource value. */ + get edited_resource(): Resource + set edited_resource(value: Resource) + + /** If `true`, the value can be selected and edited. */ + get editable(): boolean + set editable(value: boolean) + + /** If `true`, the main button with the resource preview works in the toggle mode. Use [method set_toggle_pressed] to manually set the state. */ + get toggle_mode(): boolean + set toggle_mode(value: boolean) + + /** Emitted when the resource value was set and user clicked to edit it. When [param inspect] is `true`, the signal was caused by the context menu "Edit" or "Inspect" option. */ + readonly resource_selected: Signal2 + + /** Emitted when the value of the edited resource was changed. */ + readonly resource_changed: Signal1 + } + /** A node used to generate previews of resources or files. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_editorresourcepreview.html + */ + class EditorResourcePreview = Record> extends Node { + constructor(identifier?: any) + /** Queue a resource file located at [param path] for preview. Once the preview is ready, the [param receiver]'s [param receiver_func] will be called. The [param receiver_func] must take the following four arguments: [String] path, [Texture2D] preview, [Texture2D] thumbnail_preview, [Variant] userdata. [param userdata] can be anything, and will be returned when [param receiver_func] is called. + * + * **Note:** If it was not possible to create the preview the [param receiver_func] will still be called, but the preview will be `null`. + */ + queue_resource_preview(path: string, receiver: Object, receiver_func: StringName, userdata: any): void + + /** Queue the [param resource] being edited for preview. Once the preview is ready, the [param receiver]'s [param receiver_func] will be called. The [param receiver_func] must take the following four arguments: [String] path, [Texture2D] preview, [Texture2D] thumbnail_preview, [Variant] userdata. [param userdata] can be anything, and will be returned when [param receiver_func] is called. + * + * **Note:** If it was not possible to create the preview the [param receiver_func] will still be called, but the preview will be `null`. + */ + queue_edited_resource_preview(resource: Resource, receiver: Object, receiver_func: StringName, userdata: any): void + + /** Create an own, custom preview generator. */ + add_preview_generator(generator: EditorResourcePreviewGenerator): void + + /** Removes a custom preview generator. */ + remove_preview_generator(generator: EditorResourcePreviewGenerator): void + + /** Check if the resource changed, if so, it will be invalidated and the corresponding signal emitted. */ + check_for_invalidation(path: string): void + + /** Emitted if a preview was invalidated (changed). [param path] corresponds to the path of the preview. */ + readonly preview_invalidated: Signal1 + } + /** Custom generator of previews. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_editorresourcepreviewgenerator.html + */ + class EditorResourcePreviewGenerator extends RefCounted { + constructor(identifier?: any) + /** Returns `true` if your generator supports the resource of type [param type]. */ + /* gdvirtual */ _handles(type: string): boolean + + /** Generate a preview from a given resource with the specified size. This must always be implemented. + * Returning `null` is an OK way to fail and let another generator take care. + * Care must be taken because this function is always called from a thread (not the main thread). + * [param metadata] dictionary can be modified to store file-specific metadata that can be used in [method EditorResourceTooltipPlugin._make_tooltip_for_path] (like image size, sample length etc.). + */ + /* gdvirtual */ _generate(resource: Resource, size: Vector2i, metadata: GDictionary): Texture2D + + /** Generate a preview directly from a path with the specified size. Implementing this is optional, as default code will load and call [method _generate]. + * Returning `null` is an OK way to fail and let another generator take care. + * Care must be taken because this function is always called from a thread (not the main thread). + * [param metadata] dictionary can be modified to store file-specific metadata that can be used in [method EditorResourceTooltipPlugin._make_tooltip_for_path] (like image size, sample length etc.). + */ + /* gdvirtual */ _generate_from_path(path: string, size: Vector2i, metadata: GDictionary): Texture2D + + /** If this function returns `true`, the generator will automatically generate the small previews from the normal preview texture generated by the methods [method _generate] or [method _generate_from_path]. + * By default, it returns `false`. + */ + /* gdvirtual */ _generate_small_preview_automatically(): boolean + + /** If this function returns `true`, the generator will call [method _generate] or [method _generate_from_path] for small previews as well. + * By default, it returns `false`. + */ + /* gdvirtual */ _can_generate_small_preview(): boolean + } + /** A plugin that advanced tooltip for its handled resource type. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_editorresourcetooltipplugin.html + */ + class EditorResourceTooltipPlugin extends RefCounted { + constructor(identifier?: any) + /** Return `true` if the plugin is going to handle the given [Resource] [param type]. */ + /* gdvirtual */ _handles(type: string): boolean + + /** Create and return a tooltip that will be displayed when the user hovers a resource under the given [param path] in filesystem dock. + * The [param metadata] dictionary is provided by preview generator (see [method EditorResourcePreviewGenerator._generate]). + * [param base] is the base default tooltip, which is a [VBoxContainer] with a file name, type and size labels. If another plugin handled the same file type, [param base] will be output from the previous plugin. For best result, make sure the base tooltip is part of the returned [Control]. + * + * **Note:** It's unadvised to use [method ResourceLoader.load], especially with heavy resources like models or textures, because it will make the editor unresponsive when creating the tooltip. You can use [method request_thumbnail] if you want to display a preview in your tooltip. + * + * **Note:** If you decide to discard the [param base], make sure to call [method Node.queue_free], because it's not freed automatically. + * + */ + /* gdvirtual */ _make_tooltip_for_path(path: string, metadata: GDictionary, base: Control): Control + _thumbnail_ready(_unnamed_arg0: string, _unnamed_arg1: Texture2D, _unnamed_arg2: Texture2D, _unnamed_arg3: any): void + + /** Requests a thumbnail for the given [TextureRect]. The thumbnail is created asynchronously by [EditorResourcePreview] and automatically set when available. */ + request_thumbnail(path: string, control: TextureRect): void + } + class EditorRunBar = Record> extends MarginContainer { + constructor(identifier?: any) + readonly play_pressed: Signal0 + readonly stop_pressed: Signal0 + } + class EditorRunNative = Record> extends HBoxContainer { + constructor(identifier?: any) + readonly native_run: Signal1 + } + class EditorSceneExporterGLTFSettings extends RefCounted { + constructor(identifier?: any) + get copyright(): string + set copyright(value: string) + get bake_fps(): float64 + set bake_fps(value: float64) + } + /** Imports scenes from third-parties' 3D files. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_editorsceneformatimporter.html + */ + class EditorSceneFormatImporter extends RefCounted { + static readonly IMPORT_SCENE = 1 + static readonly IMPORT_ANIMATION = 2 + static readonly IMPORT_FAIL_ON_MISSING_DEPENDENCIES = 4 + static readonly IMPORT_GENERATE_TANGENT_ARRAYS = 8 + static readonly IMPORT_USE_NAMED_SKIN_BINDS = 16 + static readonly IMPORT_DISCARD_MESHES_AND_MATERIALS = 32 + static readonly IMPORT_FORCE_DISABLE_MESH_COMPRESSION = 64 + constructor(identifier?: any) + + /** Return supported file extensions for this scene importer. */ + /* gdvirtual */ _get_extensions(): PackedStringArray + + /** Perform the bulk of the scene import logic here, for example using [GLTFDocument] or [FBXDocument]. */ + /* gdvirtual */ _import_scene(path: string, flags: int64, options: GDictionary): Object + + /** Override to add general import options. These will appear in the main import dock on the editor. Add options via [method add_import_option] and [method add_import_option_advanced]. + * + * **Note:** All [EditorSceneFormatImporter] and [EditorScenePostImportPlugin] instances will add options for all files. It is good practice to check the file extension when [param path] is non-empty. + * When the user is editing project settings, [param path] will be empty. It is recommended to add all options when [param path] is empty to allow the user to customize Import Defaults. + */ + /* gdvirtual */ _get_import_options(path: string): void + + /** Should return `true` to show the given option, `false` to hide the given option, or `null` to ignore. */ + /* gdvirtual */ _get_option_visibility(path: string, for_animation: boolean, option: string): any + + /** Add a specific import option (name and default value only). This function can only be called from [method _get_import_options]. */ + add_import_option(name: string, value: any): void + + /** Add a specific import option. This function can only be called from [method _get_import_options]. */ + add_import_option_advanced(type: Variant.Type, name: string, default_value: any, hint: PropertyHint = 0, hint_string: string = '', usage_flags: int64 = 6): void + } + /** Importer for Blender's `.blend` scene file format. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_editorsceneformatimporterblend.html + */ + class EditorSceneFormatImporterBlend extends EditorSceneFormatImporter { + constructor(identifier?: any) + } + class EditorSceneFormatImporterCollada extends EditorSceneFormatImporter { + constructor(identifier?: any) + } + class EditorSceneFormatImporterESCN extends EditorSceneFormatImporter { + constructor(identifier?: any) + } + /** Importer for the `.fbx` scene file format. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_editorsceneformatimporterfbx2gltf.html + */ + class EditorSceneFormatImporterFBX2GLTF extends EditorSceneFormatImporter { + constructor(identifier?: any) + } + /** @link https://docs.godotengine.org/en/4.4/classes/class_editorsceneformatimportergltf.html */ + class EditorSceneFormatImporterGLTF extends EditorSceneFormatImporter { + constructor(identifier?: any) + } + /** Import FBX files using the ufbx library. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_editorsceneformatimporterufbx.html + */ + class EditorSceneFormatImporterUFBX extends EditorSceneFormatImporter { + constructor(identifier?: any) + } + /** Post-processes scenes after import. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_editorscenepostimport.html + */ + class EditorScenePostImport extends RefCounted { + constructor(identifier?: any) + /** Called after the scene was imported. This method must return the modified version of the scene. */ + /* gdvirtual */ _post_import(scene: Node): Object + + /** Returns the source file path which got imported (e.g. `res://scene.dae`). */ + get_source_file(): string + } + namespace EditorScenePostImportPlugin { + enum InternalImportCategory { + INTERNAL_IMPORT_CATEGORY_NODE = 0, + INTERNAL_IMPORT_CATEGORY_MESH_3D_NODE = 1, + INTERNAL_IMPORT_CATEGORY_MESH = 2, + INTERNAL_IMPORT_CATEGORY_MATERIAL = 3, + INTERNAL_IMPORT_CATEGORY_ANIMATION = 4, + INTERNAL_IMPORT_CATEGORY_ANIMATION_NODE = 5, + INTERNAL_IMPORT_CATEGORY_SKELETON_3D_NODE = 6, + INTERNAL_IMPORT_CATEGORY_MAX = 7, + } + } + /** Plugin to control and modifying the process of importing a scene. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_editorscenepostimportplugin.html + */ + class EditorScenePostImportPlugin extends RefCounted { + constructor(identifier?: any) + /** Override to add internal import options. These will appear in the 3D scene import dialog. Add options via [method add_import_option] and [method add_import_option_advanced]. */ + /* gdvirtual */ _get_internal_import_options(category: int64): void + + /** Should return `true` to show the given option, `false` to hide the given option, or `null` to ignore. */ + /* gdvirtual */ _get_internal_option_visibility(category: int64, for_animation: boolean, option: string): any + + /** Should return `true` if the 3D view of the import dialog needs to update when changing the given option. */ + /* gdvirtual */ _get_internal_option_update_view_required(category: int64, option: string): any + + /** Process a specific node or resource for a given category. */ + /* gdvirtual */ _internal_process(category: int64, base_node: Node, node: Node, resource: Resource): void + + /** Override to add general import options. These will appear in the main import dock on the editor. Add options via [method add_import_option] and [method add_import_option_advanced]. */ + /* gdvirtual */ _get_import_options(path: string): void + + /** Should return `true` to show the given option, `false` to hide the given option, or `null` to ignore. */ + /* gdvirtual */ _get_option_visibility(path: string, for_animation: boolean, option: string): any + + /** Pre Process the scene. This function is called right after the scene format loader loaded the scene and no changes have been made. + * Pre process may be used to adjust internal import options in the `"nodes"`, `"meshes"`, `"animations"` or `"materials"` keys inside `get_option_value("_subresources")`. + */ + /* gdvirtual */ _pre_process(scene: Node): void + + /** Post process the scene. This function is called after the final scene has been configured. */ + /* gdvirtual */ _post_process(scene: Node): void + + /** Query the value of an option. This function can only be called from those querying visibility, or processing. */ + get_option_value(name: StringName): any + + /** Add a specific import option (name and default value only). This function can only be called from [method _get_import_options] and [method _get_internal_import_options]. */ + add_import_option(name: string, value: any): void + + /** Add a specific import option. This function can only be called from [method _get_import_options] and [method _get_internal_import_options]. */ + add_import_option_advanced(type: Variant.Type, name: string, default_value: any, hint: PropertyHint = 0, hint_string: string = '', usage_flags: int64 = 6): void + } + class EditorSceneTabs = Record> extends MarginContainer { + constructor(identifier?: any) + _tab_preview_done(_unnamed_arg0: string, _unnamed_arg1: Texture2D, _unnamed_arg2: Texture2D, _unnamed_arg3: any): void + readonly tab_changed: Signal1 + readonly tab_closed: Signal1 + } + /** Base script that can be used to add extension functions to the editor. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_editorscript.html + */ + class EditorScript extends RefCounted { + constructor(identifier?: any) + /** This method is executed by the Editor when **File > Run** is used. */ + /* gdvirtual */ _run(): void + + /** Makes [param node] root of the currently opened scene. Only works if the scene is empty. If the [param node] is a scene instance, an inheriting scene will be created. */ + add_root_node(node: Node): void + + /** Returns the edited (current) scene's root [Node]. Equivalent of [method EditorInterface.get_edited_scene_root]. */ + get_scene(): Node + + /** Returns the [EditorInterface] singleton instance. */ + get_editor_interface(): EditorInterface + } + /** Godot editor's control for selecting the `script` property of a [Node]. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_editorscriptpicker.html + */ + class EditorScriptPicker = Record> extends EditorResourcePicker { + constructor(identifier?: any) + /** The owner [Node] of the script property that holds the edited resource. */ + get script_owner(): Node + set script_owner(value: Node) + } + class EditorScriptPreviewPlugin extends EditorResourcePreviewGenerator { + constructor(identifier?: any) + } + /** Manages the SceneTree selection in the editor. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_editorselection.html + */ + class EditorSelection extends Object { + constructor(identifier?: any) + /** Clear the selection. */ + clear(): void + + /** Adds a node to the selection. + * + * **Note:** The newly selected node will not be automatically edited in the inspector. If you want to edit a node, use [method EditorInterface.edit_node]. + */ + add_node(node: Node): void + + /** Removes a node from the selection. */ + remove_node(node: Node): void + + /** Returns the list of selected nodes. */ + get_selected_nodes(): GArray + + /** Returns the list of selected nodes, optimized for transform operations (i.e. moving them, rotating, etc.). This list can be used to avoid situations where a node is selected and is also a child/grandchild. */ + get_transformable_selected_nodes(): GArray + + /** Emitted when the selection changes. */ + readonly selection_changed: Signal0 + } + /** Object that holds the project-independent editor settings. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_editorsettings.html + */ + class EditorSettings extends Resource { + /** Emitted after any editor setting has changed. It's used by various editor plugins to update their visuals on theme changes or logic on configuration changes. */ + static readonly NOTIFICATION_EDITOR_SETTINGS_CHANGED = 10000 + constructor(identifier?: any) + + /** Returns `true` if the setting specified by [param name] exists, `false` otherwise. */ + has_setting(name: string): boolean + + /** Sets the [param value] of the setting specified by [param name]. This is equivalent to using [method Object.set] on the EditorSettings instance. */ + set_setting(name: string, value: any): void + + /** Returns the value of the setting specified by [param name]. This is equivalent to using [method Object.get] on the EditorSettings instance. */ + get_setting(name: string): any + + /** Erases the setting whose name is specified by [param property]. */ + erase(property: string): void + + /** Sets the initial value of the setting specified by [param name] to [param value]. This is used to provide a value for the Revert button in the Editor Settings. If [param update_current] is `true`, the setting is reset to [param value] as well. */ + set_initial_value(name: StringName, value: any, update_current: boolean): void + + /** Adds a custom property info to a property. The dictionary must contain: + * - `name`: [String] (the name of the property) + * - `type`: [int] (see [enum Variant.Type]) + * - optionally `hint`: [int] (see [enum PropertyHint]) and `hint_string`: [String] + * + */ + add_property_info(info: GDictionary): void + + /** Sets project-specific metadata with the [param section], [param key] and [param data] specified. This metadata is stored outside the project folder and therefore won't be checked into version control. See also [method get_project_metadata]. */ + set_project_metadata(section: string, key: string, data: any): void + + /** Returns project-specific metadata for the [param section] and [param key] specified. If the metadata doesn't exist, [param default] will be returned instead. See also [method set_project_metadata]. */ + get_project_metadata(section: string, key: string, default_: any = {}): any + + /** Sets the list of favorite files and directories for this project. */ + set_favorites(dirs: PackedStringArray | string[]): void + + /** Returns the list of favorite files and directories for this project. */ + get_favorites(): PackedStringArray + + /** Sets the list of recently visited folders in the file dialog for this project. */ + set_recent_dirs(dirs: PackedStringArray | string[]): void + + /** Returns the list of recently visited folders in the file dialog for this project. */ + get_recent_dirs(): PackedStringArray + + /** Overrides the built-in editor action [param name] with the input actions defined in [param actions_list]. */ + set_builtin_action_override(name: string, actions_list: GArray): void + + /** Checks if any settings with the prefix [param setting_prefix] exist in the set of changed settings. See also [method get_changed_settings]. */ + check_changed_settings_in_group(setting_prefix: string): boolean + + /** Gets an array of the settings which have been changed since the last save. Note that internally `changed_settings` is cleared after a successful save, so generally the most appropriate place to use this method is when processing [constant NOTIFICATION_EDITOR_SETTINGS_CHANGED]. */ + get_changed_settings(): PackedStringArray + + /** Marks the passed editor setting as being changed, see [method get_changed_settings]. Only settings which exist (see [method has_setting]) will be accepted. */ + mark_setting_changed(setting: string): void + + /** Emitted after any editor setting has changed. */ + readonly settings_changed: Signal0 + } + class EditorSettingsDialog = Record> extends AcceptDialog { + constructor(identifier?: any) + _update_shortcuts(): void + _settings_changed(): void + } + /** Godot editor's control for editing numeric values. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_editorspinslider.html + */ + class EditorSpinSlider = Record> extends Range { + constructor(identifier?: any) + /** The text that displays to the left of the value. */ + get label(): string + set label(value: string) + + /** The suffix to display after the value (in a faded color). This should generally be a plural word. You may have to use an abbreviation if the suffix is too long to be displayed. */ + get suffix(): string + set suffix(value: string) + + /** If `true`, the slider can't be interacted with. */ + get read_only(): boolean + set read_only(value: boolean) + + /** If `true`, the slider will not draw background. */ + get flat(): boolean + set flat(value: boolean) + + /** If `true`, the slider and up/down arrows are hidden. */ + get hide_slider(): boolean + set hide_slider(value: boolean) + + /** If `true`, the [EditorSpinSlider] is considered to be editing an integer value. If `false`, the [EditorSpinSlider] is considered to be editing a floating-point value. This is used to determine whether a slider should be drawn. The slider is only drawn for floats; integers use up-down arrows similar to [SpinBox] instead. */ + get editing_integer(): boolean + set editing_integer(value: boolean) + + /** Emitted when the spinner/slider is grabbed. */ + readonly grabbed: Signal0 + + /** Emitted when the spinner/slider is ungrabbed. */ + readonly ungrabbed: Signal0 + + /** Emitted when the updown button is pressed. */ + readonly updown_pressed: Signal0 + + /** Emitted when the value form gains focus. */ + readonly value_focus_entered: Signal0 + + /** Emitted when the value form loses focus. */ + readonly value_focus_exited: Signal0 + } + /** Base class for [SyntaxHighlighter] used by the [ScriptEditor]. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_editorsyntaxhighlighter.html + */ + class EditorSyntaxHighlighter extends SyntaxHighlighter { + constructor(identifier?: any) + /** Virtual method which can be overridden to return the syntax highlighter name. */ + /* gdvirtual */ _get_name(): string + + /** Virtual method which can be overridden to return the supported language names. */ + /* gdvirtual */ _get_supported_languages(): PackedStringArray + _get_edited_resource(): RefCounted + } + class EditorTexturePreviewPlugin extends EditorResourcePreviewGenerator { + constructor(identifier?: any) + } + class EditorTextureTooltipPlugin extends EditorResourceTooltipPlugin { + constructor(identifier?: any) + } + class EditorTheme extends Theme { + constructor(identifier?: any) + } + class EditorTitleBar = Record> extends HBoxContainer { + constructor(identifier?: any) + } + namespace EditorToaster { + enum Severity { + /** Toast will display with an INFO severity. */ + SEVERITY_INFO = 0, + + /** Toast will display with a WARNING severity and have a corresponding color. */ + SEVERITY_WARNING = 1, + + /** Toast will display with an ERROR severity and have a corresponding color. */ + SEVERITY_ERROR = 2, + } + } + /** Manages toast notifications within the editor. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_editortoaster.html + */ + class EditorToaster = Record> extends HBoxContainer { + constructor(identifier?: any) + /** Pushes a toast notification to the editor for display. */ + push_toast(message: string, severity: EditorToaster.Severity = 0, tooltip: string = ''): void + } + /** Plugin for adding custom parsers to extract strings that are to be translated from custom files (.csv, .json etc.). + * + * @link https://docs.godotengine.org/en/4.4/classes/class_editortranslationparserplugin.html + */ + class EditorTranslationParserPlugin extends RefCounted { + constructor(identifier?: any) + /** Override this method to define a custom parsing logic to extract the translatable strings. */ + /* gdvirtual */ _parse_file(path: string): GArray + + /** Gets the list of file extensions to associate with this parser, e.g. `["csv"]`. */ + /* gdvirtual */ _get_recognized_extensions(): PackedStringArray + } + namespace EditorUndoRedoManager { + enum SpecialHistory { + /** Global history not associated with any scene, but with external resources etc. */ + GLOBAL_HISTORY = 0, + + /** History associated with remote inspector. Used when live editing a running project. */ + REMOTE_HISTORY = -9, + + /** Invalid "null" history. It's a special value, not associated with any object. */ + INVALID_HISTORY = -99, + } + } + /** Manages undo history of scenes opened in the editor. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_editorundoredomanager.html + */ + class EditorUndoRedoManager extends Object { + constructor(identifier?: any) + /** Create a new action. After this is called, do all your calls to [method add_do_method], [method add_undo_method], [method add_do_property], and [method add_undo_property], then commit the action with [method commit_action]. + * The way actions are merged is dictated by the [param merge_mode] argument. See [enum UndoRedo.MergeMode] for details. + * If [param custom_context] object is provided, it will be used for deducing target history (instead of using the first operation). + * The way undo operation are ordered in actions is dictated by [param backward_undo_ops]. When [param backward_undo_ops] is `false` undo option are ordered in the same order they were added. Which means the first operation to be added will be the first to be undone. + */ + create_action(name: string, merge_mode: UndoRedo.MergeMode = 0, custom_context: Object = undefined, backward_undo_ops: boolean = false): void + + /** Commits the action. If [param execute] is `true` (default), all "do" methods/properties are called/set when this function is called. */ + commit_action(execute: boolean = true): void + + /** Returns `true` if the [EditorUndoRedoManager] is currently committing the action, i.e. running its "do" method or property change (see [method commit_action]). */ + is_committing_action(): boolean + + /** Forces the next operation (e.g. [method add_do_method]) to use the action's history rather than guessing it from the object. This is sometimes needed when a history can't be correctly determined, like for a nested resource that doesn't have a path yet. + * This method should only be used when absolutely necessary, otherwise it might cause invalid history state. For most of complex cases, the `custom_context` parameter of [method create_action] is sufficient. + */ + force_fixed_history(): void + + /** Register a method that will be called when the action is committed (i.e. the "do" action). + * If this is the first operation, the [param object] will be used to deduce target undo history. + */ + add_do_method(object: Object, method: StringName, ...vargargs: any[]): void + + /** Register a method that will be called when the action is undone (i.e. the "undo" action). + * If this is the first operation, the [param object] will be used to deduce target undo history. + */ + add_undo_method(object: Object, method: StringName, ...vargargs: any[]): void + + /** Register a property value change for "do". + * If this is the first operation, the [param object] will be used to deduce target undo history. + */ + add_do_property(object: Object, property: StringName, value: any): void + + /** Register a property value change for "undo". + * If this is the first operation, the [param object] will be used to deduce target undo history. + */ + add_undo_property(object: Object, property: StringName, value: any): void + + /** Register a reference for "do" that will be erased if the "do" history is lost. This is useful mostly for new nodes created for the "do" call. Do not use for resources. */ + add_do_reference(object: Object): void + + /** Register a reference for "undo" that will be erased if the "undo" history is lost. This is useful mostly for nodes removed with the "do" call (not the "undo" call!). */ + add_undo_reference(object: Object): void + + /** Returns the history ID deduced from the given [param object]. It can be used with [method get_history_undo_redo]. */ + get_object_history_id(object: Object): int64 + + /** Returns the [UndoRedo] object associated with the given history [param id]. + * [param id] above `0` are mapped to the opened scene tabs (but it doesn't match their order). [param id] of `0` or lower have special meaning (see [enum SpecialHistory]). + * Best used with [method get_object_history_id]. This method is only provided in case you need some more advanced methods of [UndoRedo] (but keep in mind that directly operating on the [UndoRedo] object might affect editor's stability). + */ + get_history_undo_redo(id: int64): UndoRedo + + /** Clears the given undo history. You can clear history for a specific scene, global history, or for all scenes at once if [param id] is [constant INVALID_HISTORY]. + * If [param increase_version] is `true`, the undo history version will be increased, marking it as unsaved. Useful for operations that modify the scene, but don't support undo. + * + * + * **Note:** If you want to mark an edited scene as unsaved without clearing its history, use [method EditorInterface.mark_scene_as_unsaved] instead. + */ + clear_history(id: int64 = -99, increase_version: boolean = true): void + + /** Emitted when the list of actions in any history has changed, either when an action is committed or a history is cleared. */ + readonly history_changed: Signal0 + + /** Emitted when the version of any history has changed as a result of undo or redo call. */ + readonly version_changed: Signal0 + } + namespace EditorVCSInterface { + enum ChangeType { + /** A new file has been added. */ + CHANGE_TYPE_NEW = 0, + + /** An earlier added file has been modified. */ + CHANGE_TYPE_MODIFIED = 1, + + /** An earlier added file has been renamed. */ + CHANGE_TYPE_RENAMED = 2, + + /** An earlier added file has been deleted. */ + CHANGE_TYPE_DELETED = 3, + + /** An earlier added file has been typechanged. */ + CHANGE_TYPE_TYPECHANGE = 4, + + /** A file is left unmerged. */ + CHANGE_TYPE_UNMERGED = 5, + } + enum TreeArea { + /** A commit is encountered from the commit area. */ + TREE_AREA_COMMIT = 0, + + /** A file is encountered from the staged area. */ + TREE_AREA_STAGED = 1, + + /** A file is encountered from the unstaged area. */ + TREE_AREA_UNSTAGED = 2, + } + } + /** Version Control System (VCS) interface, which reads and writes to the local VCS in use. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_editorvcsinterface.html + */ + class EditorVCSInterface extends Object { + constructor(identifier?: any) + /** Initializes the VCS plugin when called from the editor. Returns whether or not the plugin was successfully initialized. A VCS project is initialized at [param project_path]. */ + /* gdvirtual */ _initialize(project_path: string): boolean + + /** Set user credentials in the underlying VCS. [param username] and [param password] are used only during HTTPS authentication unless not already mentioned in the remote URL. [param ssh_public_key_path], [param ssh_private_key_path], and [param ssh_passphrase] are only used during SSH authentication. */ + /* gdvirtual */ _set_credentials(username: string, password: string, ssh_public_key_path: string, ssh_private_key_path: string, ssh_passphrase: string): void + + /** Returns an [Array] of [Dictionary] items (see [method create_status_file]), each containing the status data of every modified file in the project folder. */ + /* gdvirtual */ _get_modified_files_data(): GArray + + /** Stages the file present at [param file_path] to the staged area. */ + /* gdvirtual */ _stage_file(file_path: string): void + + /** Unstages the file present at [param file_path] from the staged area to the unstaged area. */ + /* gdvirtual */ _unstage_file(file_path: string): void + + /** Discards the changes made in a file present at [param file_path]. */ + /* gdvirtual */ _discard_file(file_path: string): void + + /** Commits the currently staged changes and applies the commit [param msg] to the resulting commit. */ + /* gdvirtual */ _commit(msg: string): void + + /** Returns an array of [Dictionary] items (see [method create_diff_file], [method create_diff_hunk], [method create_diff_line], [method add_line_diffs_into_diff_hunk] and [method add_diff_hunks_into_diff_file]), each containing information about a diff. If [param identifier] is a file path, returns a file diff, and if it is a commit identifier, then returns a commit diff. */ + /* gdvirtual */ _get_diff(identifier: string, area: int64): GArray + + /** Shuts down VCS plugin instance. Called when the user either closes the editor or shuts down the VCS plugin through the editor UI. */ + /* gdvirtual */ _shut_down(): boolean + + /** Returns the name of the underlying VCS provider. */ + /* gdvirtual */ _get_vcs_name(): string + + /** Returns an [Array] of [Dictionary] items (see [method create_commit]), each containing the data for a past commit. */ + /* gdvirtual */ _get_previous_commits(max_commits: int64): GArray + + /** Gets an instance of an [Array] of [String]s containing available branch names in the VCS. */ + /* gdvirtual */ _get_branch_list(): GArray + + /** Returns an [Array] of [String]s, each containing the name of a remote configured in the VCS. */ + /* gdvirtual */ _get_remotes(): GArray + + /** Creates a new branch named [param branch_name] in the VCS. */ + /* gdvirtual */ _create_branch(branch_name: string): void + + /** Remove a branch from the local VCS. */ + /* gdvirtual */ _remove_branch(branch_name: string): void + + /** Creates a new remote destination with name [param remote_name] and points it to [param remote_url]. This can be an HTTPS remote or an SSH remote. */ + /* gdvirtual */ _create_remote(remote_name: string, remote_url: string): void + + /** Remove a remote from the local VCS. */ + /* gdvirtual */ _remove_remote(remote_name: string): void + + /** Gets the current branch name defined in the VCS. */ + /* gdvirtual */ _get_current_branch_name(): string + + /** Checks out a [param branch_name] in the VCS. */ + /* gdvirtual */ _checkout_branch(branch_name: string): boolean + + /** Pulls changes from the remote. This can give rise to merge conflicts. */ + /* gdvirtual */ _pull(remote: string): void + + /** Pushes changes to the [param remote]. If [param force] is `true`, a force push will override the change history already present on the remote. */ + /* gdvirtual */ _push(remote: string, force: boolean): void + + /** Fetches new changes from the [param remote], but doesn't write changes to the current working directory. Equivalent to `git fetch`. */ + /* gdvirtual */ _fetch(remote: string): void + + /** Returns an [Array] of [Dictionary] items (see [method create_diff_hunk]), each containing a line diff between a file at [param file_path] and the [param text] which is passed in. */ + /* gdvirtual */ _get_line_diff(file_path: string, text: string): GArray + + /** Helper function to create a [Dictionary] for storing a line diff. [param new_line_no] is the line number in the new file (can be `-1` if the line is deleted). [param old_line_no] is the line number in the old file (can be `-1` if the line is added). [param content] is the diff text. [param status] is a single character string which stores the line origin. */ + create_diff_line(new_line_no: int64, old_line_no: int64, content: string, status: string): GDictionary + + /** Helper function to create a [Dictionary] for storing diff hunk data. [param old_start] is the starting line number in old file. [param new_start] is the starting line number in new file. [param old_lines] is the number of lines in the old file. [param new_lines] is the number of lines in the new file. */ + create_diff_hunk(old_start: int64, new_start: int64, old_lines: int64, new_lines: int64): GDictionary + + /** Helper function to create a [Dictionary] for storing old and new diff file paths. */ + create_diff_file(new_file: string, old_file: string): GDictionary + + /** Helper function to create a commit [Dictionary] item. [param msg] is the commit message of the commit. [param author] is a single human-readable string containing all the author's details, e.g. the email and name configured in the VCS. [param id] is the identifier of the commit, in whichever format your VCS may provide an identifier to commits. [param unix_timestamp] is the UTC Unix timestamp of when the commit was created. [param offset_minutes] is the timezone offset in minutes, recorded from the system timezone where the commit was created. */ + create_commit(msg: string, author: string, id: string, unix_timestamp: int64, offset_minutes: int64): GDictionary + + /** Helper function to create a [Dictionary] used by editor to read the status of a file. */ + create_status_file(file_path: string, change_type: EditorVCSInterface.ChangeType, area: EditorVCSInterface.TreeArea): GDictionary + + /** Helper function to add an array of [param diff_hunks] into a [param diff_file]. */ + add_diff_hunks_into_diff_file(diff_file: GDictionary, diff_hunks: GArray): GDictionary + + /** Helper function to add an array of [param line_diffs] into a [param diff_hunk]. */ + add_line_diffs_into_diff_hunk(diff_hunk: GDictionary, line_diffs: GArray): GDictionary + + /** Pops up an error message in the editor which is shown as coming from the underlying VCS. Use this to show VCS specific error messages. */ + popup_error(msg: string): void + } + class EditorValidationPanel = Record> extends PanelContainer { + constructor(identifier?: any) + } + class EditorVersionButton = Record> extends LinkButton { + constructor(identifier?: any) + } + class EditorVisualProfiler = Record> extends VBoxContainer { + constructor(identifier?: any) + readonly enable_profiling: Signal1 + } + class EditorZoomWidget = Record> extends HBoxContainer { + constructor(identifier?: any) + set_zoom_by_increments(increment: int64, integer_only: boolean): void + get zoom(): float64 + set zoom(value: float64) + readonly zoom_changed: Signal1 + } + class EmbeddedProcess = Record> extends Control { + constructor(identifier?: any) + readonly embedding_completed: Signal0 + readonly embedding_failed: Signal0 + readonly embedded_process_updated: Signal0 + readonly embedded_process_focused: Signal0 + } + /** Holds a reference to an [Object]'s instance ID. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_encodedobjectasid.html + */ + class EncodedObjectAsID extends RefCounted { + constructor(identifier?: any) + /** The [Object] identifier stored in this [EncodedObjectAsID] instance. The object instance can be retrieved with [method @GlobalScope.instance_from_id]. */ + get object_id(): int64 + set object_id(value: int64) + } + /** Base class for creating custom profilers. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_engineprofiler.html + */ + class EngineProfiler extends RefCounted { + constructor(identifier?: any) + /** Called when the profiler is enabled/disabled, along with a set of [param options]. */ + /* gdvirtual */ _toggle(enable: boolean, options: GArray): void + + /** Called when data is added to profiler using [method EngineDebugger.profiler_add_frame_data]. */ + /* gdvirtual */ _add_frame(data: GArray): void + + /** Called once every engine iteration when the profiler is active with information about the current frame. All time values are in seconds. Lower values represent faster processing times and are therefore considered better. */ + /* gdvirtual */ _tick(frame_time: float64, process_time: float64, physics_time: float64, physics_frame_time: float64): void + } + namespace Environment { + enum BGMode { + /** Clears the background using the clear color defined in [member ProjectSettings.rendering/environment/defaults/default_clear_color]. */ + BG_CLEAR_COLOR = 0, + + /** Clears the background using a custom clear color. */ + BG_COLOR = 1, + + /** Displays a user-defined sky in the background. */ + BG_SKY = 2, + + /** Displays a [CanvasLayer] in the background. */ + BG_CANVAS = 3, + + /** Keeps on screen every pixel drawn in the background. This is the fastest background mode, but it can only be safely used in fully-interior scenes (no visible sky or sky reflections). If enabled in a scene where the background is visible, "ghost trail" artifacts will be visible when moving the camera. */ + BG_KEEP = 4, + + /** Displays a camera feed in the background. */ + BG_CAMERA_FEED = 5, + + /** Represents the size of the [enum BGMode] enum. */ + BG_MAX = 6, + } + enum AmbientSource { + /** Gather ambient light from whichever source is specified as the background. */ + AMBIENT_SOURCE_BG = 0, + + /** Disable ambient light. This provides a slight performance boost over [constant AMBIENT_SOURCE_SKY]. */ + AMBIENT_SOURCE_DISABLED = 1, + + /** Specify a specific [Color] for ambient light. This provides a slight performance boost over [constant AMBIENT_SOURCE_SKY]. */ + AMBIENT_SOURCE_COLOR = 2, + + /** Gather ambient light from the [Sky] regardless of what the background is. */ + AMBIENT_SOURCE_SKY = 3, + } + enum ReflectionSource { + /** Use the background for reflections. */ + REFLECTION_SOURCE_BG = 0, + + /** Disable reflections. This provides a slight performance boost over other options. */ + REFLECTION_SOURCE_DISABLED = 1, + + /** Use the [Sky] for reflections regardless of what the background is. */ + REFLECTION_SOURCE_SKY = 2, + } + enum ToneMapper { + /** Does not modify color data, resulting in a linear tonemapping curve which unnaturally clips bright values, causing bright lighting to look blown out. The simplest and fastest tonemapper. */ + TONE_MAPPER_LINEAR = 0, + + /** A simple tonemapping curve that rolls off bright values to prevent clipping. This results in an image that can appear dull and low contrast. Slower than [constant TONE_MAPPER_LINEAR]. + * + * **Note:** When [member tonemap_white] is left at the default value of `1.0`, [constant TONE_MAPPER_REINHARDT] produces an identical image to [constant TONE_MAPPER_LINEAR]. + */ + TONE_MAPPER_REINHARDT = 1, + + /** Uses a film-like tonemapping curve to prevent clipping of bright values and provide better contrast than [constant TONE_MAPPER_REINHARDT]. Slightly slower than [constant TONE_MAPPER_REINHARDT]. */ + TONE_MAPPER_FILMIC = 2, + + /** Uses a high-contrast film-like tonemapping curve and desaturates bright values for a more realistic appearance. Slightly slower than [constant TONE_MAPPER_FILMIC]. + * + * **Note:** This tonemapping operator is called "ACES Fitted" in Godot 3.x. + */ + TONE_MAPPER_ACES = 3, + + /** Uses a film-like tonemapping curve and desaturates bright values for a more realistic appearance. Better than other tonemappers at maintaining the hue of colors as they become brighter. The slowest tonemapping option. + * + * **Note:** [member tonemap_white] is fixed at a value of `16.29`, which makes [constant TONE_MAPPER_AGX] unsuitable for use with the Mobile rendering method. + */ + TONE_MAPPER_AGX = 4, + } + enum GlowBlendMode { + /** Additive glow blending mode. Mostly used for particles, glows (bloom), lens flare, bright sources. */ + GLOW_BLEND_MODE_ADDITIVE = 0, + + /** Screen glow blending mode. Increases brightness, used frequently with bloom. */ + GLOW_BLEND_MODE_SCREEN = 1, + + /** Soft light glow blending mode. Modifies contrast, exposes shadows and highlights (vivid bloom). */ + GLOW_BLEND_MODE_SOFTLIGHT = 2, + + /** Replace glow blending mode. Replaces all pixels' color by the glow value. This can be used to simulate a full-screen blur effect by tweaking the glow parameters to match the original image's brightness. */ + GLOW_BLEND_MODE_REPLACE = 3, + + /** Mixes the glow with the underlying color to avoid increasing brightness as much while still maintaining a glow effect. */ + GLOW_BLEND_MODE_MIX = 4, + } + enum FogMode { + /** Use a physically-based fog model defined primarily by fog density. */ + FOG_MODE_EXPONENTIAL = 0, + + /** Use a simple fog model defined by start and end positions and a custom curve. While not physically accurate, this model can be useful when you need more artistic control. */ + FOG_MODE_DEPTH = 1, + } + enum SDFGIYScale { + /** Use 50% scale for SDFGI on the Y (vertical) axis. SDFGI cells will be twice as short as they are wide. This allows providing increased GI detail and reduced light leaking with thin floors and ceilings. This is usually the best choice for scenes that don't feature much verticality. */ + SDFGI_Y_SCALE_50_PERCENT = 0, + + /** Use 75% scale for SDFGI on the Y (vertical) axis. This is a balance between the 50% and 100% SDFGI Y scales. */ + SDFGI_Y_SCALE_75_PERCENT = 1, + + /** Use 100% scale for SDFGI on the Y (vertical) axis. SDFGI cells will be as tall as they are wide. This is usually the best choice for highly vertical scenes. The downside is that light leaking may become more noticeable with thin floors and ceilings. */ + SDFGI_Y_SCALE_100_PERCENT = 2, + } + } + /** Resource for environment nodes (like [WorldEnvironment]) that define multiple rendering options. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_environment.html + */ + class Environment extends Resource { + constructor(identifier?: any) + /** Sets the intensity of the glow level [param idx]. A value above `0.0` enables the level. Each level relies on the previous level. This means that enabling higher glow levels will slow down the glow effect rendering, even if previous levels aren't enabled. */ + set_glow_level(idx: int64, intensity: float64): void + + /** Returns the intensity of the glow level [param idx]. */ + get_glow_level(idx: int64): float64 + + /** The background mode. See [enum BGMode] for possible values. */ + get background_mode(): int64 + set background_mode(value: int64) + + /** The [Color] displayed for clear areas of the scene. Only effective when using the [constant BG_COLOR] background mode. */ + get background_color(): Color + set background_color(value: Color) + + /** Multiplier for background energy. Increase to make background brighter, decrease to make background dimmer. */ + get background_energy_multiplier(): float64 + set background_energy_multiplier(value: float64) + + /** Luminance of background measured in nits (candela per square meter). Only used when [member ProjectSettings.rendering/lights_and_shadows/use_physical_light_units] is enabled. The default value is roughly equivalent to the sky at midday. */ + get background_intensity(): float64 + set background_intensity(value: float64) + + /** The maximum layer ID to display. Only effective when using the [constant BG_CANVAS] background mode. */ + get background_canvas_max_layer(): int64 + set background_canvas_max_layer(value: int64) + + /** The ID of the camera feed to show in the background. */ + get background_camera_feed_id(): int64 + set background_camera_feed_id(value: int64) + + /** The [Sky] resource used for this [Environment]. */ + get sky(): Sky + set sky(value: Sky) + + /** If set to a value greater than `0.0`, overrides the field of view to use for sky rendering. If set to `0.0`, the same FOV as the current [Camera3D] is used for sky rendering. */ + get sky_custom_fov(): float64 + set sky_custom_fov(value: float64) + + /** The rotation to use for sky rendering. */ + get sky_rotation(): Vector3 + set sky_rotation(value: Vector3) + + /** The ambient light source to use for rendering materials and global illumination. */ + get ambient_light_source(): int64 + set ambient_light_source(value: int64) + + /** The ambient light's [Color]. Only effective if [member ambient_light_sky_contribution] is lower than `1.0` (exclusive). */ + get ambient_light_color(): Color + set ambient_light_color(value: Color) + + /** Defines the amount of light that the sky brings on the scene. A value of `0.0` means that the sky's light emission has no effect on the scene illumination, thus all ambient illumination is provided by the ambient light. On the contrary, a value of `1.0` means that *all* the light that affects the scene is provided by the sky, thus the ambient light parameter has no effect on the scene. + * + * **Note:** [member ambient_light_sky_contribution] is internally clamped between `0.0` and `1.0` (inclusive). + */ + get ambient_light_sky_contribution(): float64 + set ambient_light_sky_contribution(value: float64) + + /** The ambient light's energy. The higher the value, the stronger the light. Only effective if [member ambient_light_sky_contribution] is lower than `1.0` (exclusive). */ + get ambient_light_energy(): float64 + set ambient_light_energy(value: float64) + + /** The reflected (specular) light source. */ + get reflected_light_source(): int64 + set reflected_light_source(value: int64) + + /** The tonemapping mode to use. Tonemapping is the process that "converts" HDR values to be suitable for rendering on an LDR display. (Godot doesn't support rendering on HDR displays yet.) */ + get tonemap_mode(): int64 + set tonemap_mode(value: int64) + + /** Adjusts the brightness of values before they are provided to the tonemapper. Higher [member tonemap_exposure] values result in a brighter image. See also [member tonemap_white]. + * + * **Note:** Values provided to the tonemapper will also be multiplied by `2.0` and `1.8` for [constant TONE_MAPPER_FILMIC] and [constant TONE_MAPPER_ACES] respectively to produce a similar apparent brightness as [constant TONE_MAPPER_LINEAR]. + */ + get tonemap_exposure(): float64 + set tonemap_exposure(value: float64) + + /** The white reference value for tonemapping, which indicates where bright white is located in the scale of values provided to the tonemapper. For photorealistic lighting, recommended values are between `6.0` and `8.0`. Higher values result in less blown out highlights, but may make the scene appear lower contrast. See also [member tonemap_exposure]. + * + * **Note:** [member tonemap_white] is ignored when using [constant TONE_MAPPER_LINEAR] or [constant TONE_MAPPER_AGX]. + */ + get tonemap_white(): float64 + set tonemap_white(value: float64) + + /** If `true`, screen-space reflections are enabled. Screen-space reflections are more accurate than reflections from [VoxelGI]s or [ReflectionProbe]s, but are slower and can't reflect surfaces occluded by others. + * + * **Note:** SSR is only supported in the Forward+ rendering method, not Mobile or Compatibility. + */ + get ssr_enabled(): boolean + set ssr_enabled(value: boolean) + + /** The maximum number of steps for screen-space reflections. Higher values are slower. */ + get ssr_max_steps(): int64 + set ssr_max_steps(value: int64) + + /** The fade-in distance for screen-space reflections. Affects the area from the reflected material to the screen-space reflection. Only positive values are valid (negative values will be clamped to `0.0`). */ + get ssr_fade_in(): float64 + set ssr_fade_in(value: float64) + + /** The fade-out distance for screen-space reflections. Affects the area from the screen-space reflection to the "global" reflection. Only positive values are valid (negative values will be clamped to `0.0`). */ + get ssr_fade_out(): float64 + set ssr_fade_out(value: float64) + + /** The depth tolerance for screen-space reflections. */ + get ssr_depth_tolerance(): float64 + set ssr_depth_tolerance(value: float64) + + /** If `true`, the screen-space ambient occlusion effect is enabled. This darkens objects' corners and cavities to simulate ambient light not reaching the entire object as in real life. This works well for small, dynamic objects, but baked lighting or ambient occlusion textures will do a better job at displaying ambient occlusion on large static objects. Godot uses a form of SSAO called Adaptive Screen Space Ambient Occlusion which is itself a form of Horizon Based Ambient Occlusion. + * + * **Note:** SSAO is only supported in the Forward+ rendering method, not Mobile or Compatibility. + */ + get ssao_enabled(): boolean + set ssao_enabled(value: boolean) + + /** The distance at which objects can occlude each other when calculating screen-space ambient occlusion. Higher values will result in occlusion over a greater distance at the cost of performance and quality. */ + get ssao_radius(): float64 + set ssao_radius(value: float64) + + /** The primary screen-space ambient occlusion intensity. Acts as a multiplier for the screen-space ambient occlusion effect. A higher value results in darker occlusion. */ + get ssao_intensity(): float64 + set ssao_intensity(value: float64) + + /** The distribution of occlusion. A higher value results in darker occlusion, similar to [member ssao_intensity], but with a sharper falloff. */ + get ssao_power(): float64 + set ssao_power(value: float64) + + /** Sets the strength of the additional level of detail for the screen-space ambient occlusion effect. A high value makes the detail pass more prominent, but it may contribute to aliasing in your final image. */ + get ssao_detail(): float64 + set ssao_detail(value: float64) + + /** The threshold for considering whether a given point on a surface is occluded or not represented as an angle from the horizon mapped into the `0.0-1.0` range. A value of `1.0` results in no occlusion. */ + get ssao_horizon(): float64 + set ssao_horizon(value: float64) + + /** The amount that the screen-space ambient occlusion effect is allowed to blur over the edges of objects. Setting too high will result in aliasing around the edges of objects. Setting too low will make object edges appear blurry. */ + get ssao_sharpness(): float64 + set ssao_sharpness(value: float64) + + /** The screen-space ambient occlusion intensity in direct light. In real life, ambient occlusion only applies to indirect light, which means its effects can't be seen in direct light. Values higher than `0` will make the SSAO effect visible in direct light. */ + get ssao_light_affect(): float64 + set ssao_light_affect(value: float64) + + /** The screen-space ambient occlusion intensity on materials that have an AO texture defined. Values higher than `0` will make the SSAO effect visible in areas darkened by AO textures. */ + get ssao_ao_channel_affect(): float64 + set ssao_ao_channel_affect(value: float64) + + /** If `true`, the screen-space indirect lighting effect is enabled. Screen space indirect lighting is a form of indirect lighting that allows diffuse light to bounce between nearby objects. Screen-space indirect lighting works very similarly to screen-space ambient occlusion, in that it only affects a limited range. It is intended to be used along with a form of proper global illumination like SDFGI or [VoxelGI]. Screen-space indirect lighting is not affected by individual light's [member Light3D.light_indirect_energy]. + * + * **Note:** SSIL is only supported in the Forward+ rendering method, not Mobile or Compatibility. + */ + get ssil_enabled(): boolean + set ssil_enabled(value: boolean) + + /** The distance that bounced lighting can travel when using the screen space indirect lighting effect. A larger value will result in light bouncing further in a scene, but may result in under-sampling artifacts which look like long spikes surrounding light sources. */ + get ssil_radius(): float64 + set ssil_radius(value: float64) + + /** The brightness multiplier for the screen-space indirect lighting effect. A higher value will result in brighter light. */ + get ssil_intensity(): float64 + set ssil_intensity(value: float64) + + /** The amount that the screen-space indirect lighting effect is allowed to blur over the edges of objects. Setting too high will result in aliasing around the edges of objects. Setting too low will make object edges appear blurry. */ + get ssil_sharpness(): float64 + set ssil_sharpness(value: float64) + + /** Amount of normal rejection used when calculating screen-space indirect lighting. Normal rejection uses the normal of a given sample point to reject samples that are facing away from the current pixel. Normal rejection is necessary to avoid light leaking when only one side of an object is illuminated. However, normal rejection can be disabled if light leaking is desirable, such as when the scene mostly contains emissive objects that emit light from faces that cannot be seen from the camera. */ + get ssil_normal_rejection(): float64 + set ssil_normal_rejection(value: float64) + + /** If `true`, enables signed distance field global illumination for meshes that have their [member GeometryInstance3D.gi_mode] set to [constant GeometryInstance3D.GI_MODE_STATIC]. SDFGI is a real-time global illumination technique that works well with procedurally generated and user-built levels, including in situations where geometry is created during gameplay. The signed distance field is automatically generated around the camera as it moves. Dynamic lights are supported, but dynamic occluders and emissive surfaces are not. + * + * **Note:** SDFGI is only supported in the Forward+ rendering method, not Mobile or Compatibility. + * **Performance:** SDFGI is relatively demanding on the GPU and is not suited to low-end hardware such as integrated graphics (consider [LightmapGI] instead). To improve SDFGI performance, enable [member ProjectSettings.rendering/global_illumination/gi/use_half_resolution] in the Project Settings. + * + * **Note:** Meshes should have sufficiently thick walls to avoid light leaks (avoid one-sided walls). For interior levels, enclose your level geometry in a sufficiently large box and bridge the loops to close the mesh. + */ + get sdfgi_enabled(): boolean + set sdfgi_enabled(value: boolean) + + /** If `true`, SDFGI uses an occlusion detection approach to reduce light leaking. Occlusion may however introduce dark blotches in certain spots, which may be undesired in mostly outdoor scenes. [member sdfgi_use_occlusion] has a performance impact and should only be enabled when needed. */ + get sdfgi_use_occlusion(): boolean + set sdfgi_use_occlusion(value: boolean) + + /** If `true`, SDFGI takes the environment lighting into account. This should be set to `false` for interior scenes. */ + get sdfgi_read_sky_light(): boolean + set sdfgi_read_sky_light(value: boolean) + + /** The energy multiplier applied to light every time it bounces from a surface when using SDFGI. Values greater than `0.0` will simulate multiple bounces, resulting in a more realistic appearance. Increasing [member sdfgi_bounce_feedback] generally has no performance impact. See also [member sdfgi_energy]. + * + * **Note:** Values greater than `0.5` can cause infinite feedback loops and should be avoided in scenes with bright materials. + * + * **Note:** If [member sdfgi_bounce_feedback] is `0.0`, indirect lighting will not be represented in reflections as light will only bounce one time. + */ + get sdfgi_bounce_feedback(): float64 + set sdfgi_bounce_feedback(value: float64) + + /** The number of cascades to use for SDFGI (between 1 and 8). A higher number of cascades allows displaying SDFGI further away while preserving detail up close, at the cost of performance. When using SDFGI on small-scale levels, [member sdfgi_cascades] can often be decreased between `1` and `4` to improve performance. */ + get sdfgi_cascades(): int64 + set sdfgi_cascades(value: int64) + + /** The cell size to use for the closest SDFGI cascade (in 3D units). Lower values allow SDFGI to be more precise up close, at the cost of making SDFGI updates more demanding. This can cause stuttering when the camera moves fast. Higher values allow SDFGI to cover more ground, while also reducing the performance impact of SDFGI updates. + * + * **Note:** This property is linked to [member sdfgi_max_distance] and [member sdfgi_cascade0_distance]. Changing its value will automatically change those properties as well. + */ + get sdfgi_min_cell_size(): float64 + set sdfgi_min_cell_size(value: float64) + + /** + * **Note:** This property is linked to [member sdfgi_min_cell_size] and [member sdfgi_max_distance]. Changing its value will automatically change those properties as well. + */ + get sdfgi_cascade0_distance(): float64 + set sdfgi_cascade0_distance(value: float64) + + /** The maximum distance at which SDFGI is visible. Beyond this distance, environment lighting or other sources of GI such as [ReflectionProbe] will be used as a fallback. + * + * **Note:** This property is linked to [member sdfgi_min_cell_size] and [member sdfgi_cascade0_distance]. Changing its value will automatically change those properties as well. + */ + get sdfgi_max_distance(): float64 + set sdfgi_max_distance(value: float64) + + /** The Y scale to use for SDFGI cells. Lower values will result in SDFGI cells being packed together more closely on the Y axis. This is used to balance between quality and covering a lot of vertical ground. [member sdfgi_y_scale] should be set depending on how vertical your scene is (and how fast your camera may move on the Y axis). */ + get sdfgi_y_scale(): int64 + set sdfgi_y_scale(value: int64) + + /** The energy multiplier to use for SDFGI. Higher values will result in brighter indirect lighting and reflections. See also [member sdfgi_bounce_feedback]. */ + get sdfgi_energy(): float64 + set sdfgi_energy(value: float64) + + /** The normal bias to use for SDFGI probes. Increasing this value can reduce visible streaking artifacts on sloped surfaces, at the cost of increased light leaking. */ + get sdfgi_normal_bias(): float64 + set sdfgi_normal_bias(value: float64) + + /** The constant bias to use for SDFGI probes. Increasing this value can reduce visible streaking artifacts on sloped surfaces, at the cost of increased light leaking. */ + get sdfgi_probe_bias(): float64 + set sdfgi_probe_bias(value: float64) + + /** If `true`, the glow effect is enabled. This simulates real world eye/camera behavior where bright pixels bleed onto surrounding pixels. + * + * **Note:** When using the Mobile rendering method, glow looks different due to the lower dynamic range available in the Mobile rendering method. + * + * **Note:** When using the Compatibility rendering method, glow uses a different implementation with some properties being unavailable and hidden from the inspector: `glow_levels/*`, [member glow_normalized], [member glow_strength], [member glow_blend_mode], [member glow_mix], [member glow_map], and [member glow_map_strength]. This implementation is optimized to run on low-end devices and is less flexible as a result. + */ + get glow_enabled(): boolean + set glow_enabled(value: boolean) + + /** The intensity of the 1st level of glow. This is the most "local" level (least blurry). + * + * **Note:** [member glow_levels/1] has no effect when using the Compatibility rendering method, due to this rendering method using a simpler glow implementation optimized for low-end devices. + */ + get "glow_levels/1"(): float64 + set "glow_levels/1"(value: float64) + + /** The intensity of the 2nd level of glow. + * + * **Note:** [member glow_levels/2] has no effect when using the Compatibility rendering method, due to this rendering method using a simpler glow implementation optimized for low-end devices. + */ + get "glow_levels/2"(): float64 + set "glow_levels/2"(value: float64) + + /** The intensity of the 3rd level of glow. + * + * **Note:** [member glow_levels/3] has no effect when using the Compatibility rendering method, due to this rendering method using a simpler glow implementation optimized for low-end devices. + */ + get "glow_levels/3"(): float64 + set "glow_levels/3"(value: float64) + + /** The intensity of the 4th level of glow. + * + * **Note:** [member glow_levels/4] has no effect when using the Compatibility rendering method, due to this rendering method using a simpler glow implementation optimized for low-end devices. + */ + get "glow_levels/4"(): float64 + set "glow_levels/4"(value: float64) + + /** The intensity of the 5th level of glow. + * + * **Note:** [member glow_levels/5] has no effect when using the Compatibility rendering method, due to this rendering method using a simpler glow implementation optimized for low-end devices. + */ + get "glow_levels/5"(): float64 + set "glow_levels/5"(value: float64) + + /** The intensity of the 6th level of glow. + * + * **Note:** [member glow_levels/6] has no effect when using the Compatibility rendering method, due to this rendering method using a simpler glow implementation optimized for low-end devices. + */ + get "glow_levels/6"(): float64 + set "glow_levels/6"(value: float64) + + /** The intensity of the 7th level of glow. This is the most "global" level (blurriest). + * + * **Note:** [member glow_levels/7] has no effect when using the Compatibility rendering method, due to this rendering method using a simpler glow implementation optimized for low-end devices. + */ + get "glow_levels/7"(): float64 + set "glow_levels/7"(value: float64) + + /** If `true`, glow levels will be normalized so that summed together their intensities equal `1.0`. + * + * **Note:** [member glow_normalized] has no effect when using the Compatibility rendering method, due to this rendering method using a simpler glow implementation optimized for low-end devices. + */ + get glow_normalized(): boolean + set glow_normalized(value: boolean) + + /** The overall brightness multiplier of the glow effect. When using the Mobile rendering method (which only supports a lower dynamic range up to `2.0`), this should be increased to `1.5` to compensate. */ + get glow_intensity(): float64 + set glow_intensity(value: float64) + + /** The strength of the glow effect. This applies as the glow is blurred across the screen and increases the distance and intensity of the blur. When using the Mobile rendering method, this should be increased to compensate for the lower dynamic range. + * + * **Note:** [member glow_strength] has no effect when using the Compatibility rendering method, due to this rendering method using a simpler glow implementation optimized for low-end devices. + */ + get glow_strength(): float64 + set glow_strength(value: float64) + + /** When using the [constant GLOW_BLEND_MODE_MIX] [member glow_blend_mode], this controls how much the source image is blended with the glow layer. A value of `0.0` makes the glow rendering invisible, while a value of `1.0` is equivalent to [constant GLOW_BLEND_MODE_REPLACE]. + * + * **Note:** [member glow_mix] has no effect when using the Compatibility rendering method, due to this rendering method using a simpler glow implementation optimized for low-end devices. + */ + get glow_mix(): float64 + set glow_mix(value: float64) + + /** The bloom's intensity. If set to a value higher than `0`, this will make glow visible in areas darker than the [member glow_hdr_threshold]. */ + get glow_bloom(): float64 + set glow_bloom(value: float64) + + /** The glow blending mode. + * + * **Note:** [member glow_blend_mode] has no effect when using the Compatibility rendering method, due to this rendering method using a simpler glow implementation optimized for low-end devices. + */ + get glow_blend_mode(): int64 + set glow_blend_mode(value: int64) + + /** The lower threshold of the HDR glow. When using the Mobile rendering method (which only supports a lower dynamic range up to `2.0`), this may need to be below `1.0` for glow to be visible. A value of `0.9` works well in this case. This value also needs to be decreased below `1.0` when using glow in 2D, as 2D rendering is performed in SDR. */ + get glow_hdr_threshold(): float64 + set glow_hdr_threshold(value: float64) + + /** The bleed scale of the HDR glow. */ + get glow_hdr_scale(): float64 + set glow_hdr_scale(value: float64) + + /** The higher threshold of the HDR glow. Areas brighter than this threshold will be clamped for the purposes of the glow effect. */ + get glow_hdr_luminance_cap(): float64 + set glow_hdr_luminance_cap(value: float64) + + /** How strong of an influence the [member glow_map] should have on the overall glow effect. A strength of `0.0` means the glow map has no influence, while a strength of `1.0` means the glow map has full influence. + * + * **Note:** If the glow map has black areas, a value of `1.0` can also turn off the glow effect entirely in specific areas of the screen. + * + * **Note:** [member glow_map_strength] has no effect when using the Compatibility rendering method, due to this rendering method using a simpler glow implementation optimized for low-end devices. + */ + get glow_map_strength(): float64 + set glow_map_strength(value: float64) + + /** The texture that should be used as a glow map to *multiply* the resulting glow color according to [member glow_map_strength]. This can be used to create a "lens dirt" effect. The texture's RGB color channels are used for modulation, but the alpha channel is ignored. + * + * **Note:** The texture will be stretched to fit the screen. Therefore, it's recommended to use a texture with an aspect ratio that matches your project's base aspect ratio (typically 16:9). + * + * **Note:** [member glow_map] has no effect when using the Compatibility rendering method, due to this rendering method using a simpler glow implementation optimized for low-end devices. + */ + get glow_map(): Texture2D + set glow_map(value: Texture2D) + + /** If `true`, fog effects are enabled. */ + get fog_enabled(): boolean + set fog_enabled(value: boolean) + + /** The fog mode. See [enum FogMode] for possible values. */ + get fog_mode(): int64 + set fog_mode(value: int64) + + /** The fog's color. */ + get fog_light_color(): Color + set fog_light_color(value: Color) + + /** The fog's brightness. Higher values result in brighter fog. */ + get fog_light_energy(): float64 + set fog_light_energy(value: float64) + + /** If set above `0.0`, renders the scene's directional light(s) in the fog color depending on the view angle. This can be used to give the impression that the sun is "piercing" through the fog. */ + get fog_sun_scatter(): float64 + set fog_sun_scatter(value: float64) + + /** The fog density to be used. This is demonstrated in different ways depending on the [member fog_mode] mode chosen: + * **Exponential Fog Mode:** Higher values result in denser fog. The fog rendering is exponential like in real life. + * **Depth Fog mode:** The maximum intensity of the deep fog, effect will appear in the distance (relative to the camera). At `1.0` the fog will fully obscure the scene, at `0.0` the fog will not be visible. + */ + get fog_density(): float64 + set fog_density(value: float64) + + /** If set above `0.0` (exclusive), blends between the fog's color and the color of the background [Sky], as read from the radiance cubemap. This has a small performance cost when set above `0.0`. Must have [member background_mode] set to [constant BG_SKY]. + * This is useful to simulate [url=https://en.wikipedia.org/wiki/Aerial_perspective]aerial perspective[/url] in large scenes with low density fog. However, it is not very useful for high-density fog, as the sky will shine through. When set to `1.0`, the fog color comes completely from the [Sky]. If set to `0.0`, aerial perspective is disabled. + * Notice that this does not sample the [Sky] directly, but rather the radiance cubemap. The cubemap is sampled at a mipmap level depending on the depth of the rendered pixel; the farther away, the higher the resolution of the sampled mipmap. This results in the actual color being a blurred version of the sky, with more blur closer to the camera. The highest mipmap resolution is used at a depth of [member Camera3D.far]. + */ + get fog_aerial_perspective(): float64 + set fog_aerial_perspective(value: float64) + + /** The factor to use when affecting the sky with non-volumetric fog. `1.0` means that fog can fully obscure the sky. Lower values reduce the impact of fog on sky rendering, with `0.0` not affecting sky rendering at all. + * + * **Note:** [member fog_sky_affect] has no visual effect if [member fog_aerial_perspective] is `1.0`. + */ + get fog_sky_affect(): float64 + set fog_sky_affect(value: float64) + + /** The height at which the height fog effect begins. */ + get fog_height(): float64 + set fog_height(value: float64) + + /** The density used to increase fog as height decreases. To make fog increase as height increases, use a negative value. */ + get fog_height_density(): float64 + set fog_height_density(value: float64) + + /** The fog depth's intensity curve. A number of presets are available in the Inspector by right-clicking the curve. Only available when [member fog_mode] is set to [constant FOG_MODE_DEPTH]. */ + get fog_depth_curve(): float64 + set fog_depth_curve(value: float64) + + /** The fog's depth starting distance from the camera. Only available when [member fog_mode] is set to [constant FOG_MODE_DEPTH]. */ + get fog_depth_begin(): float64 + set fog_depth_begin(value: float64) + + /** The fog's depth end distance from the camera. If this value is set to `0`, it will be equal to the current camera's [member Camera3D.far] value. Only available when [member fog_mode] is set to [constant FOG_MODE_DEPTH]. */ + get fog_depth_end(): float64 + set fog_depth_end(value: float64) + + /** Enables the volumetric fog effect. Volumetric fog uses a screen-aligned froxel buffer to calculate accurate volumetric scattering in the short to medium range. Volumetric fog interacts with [FogVolume]s and lights to calculate localized and global fog. Volumetric fog uses a PBR single-scattering model based on extinction, scattering, and emission which it exposes to users as density, albedo, and emission. + * + * **Note:** Volumetric fog is only supported in the Forward+ rendering method, not Mobile or Compatibility. + */ + get volumetric_fog_enabled(): boolean + set volumetric_fog_enabled(value: boolean) + + /** The base *exponential* density of the volumetric fog. Set this to the lowest density you want to have globally. [FogVolume]s can be used to add to or subtract from this density in specific areas. Fog rendering is exponential as in real life. + * A value of `0.0` disables global volumetric fog while allowing [FogVolume]s to display volumetric fog in specific areas. + * To make volumetric fog work as a volumetric *lighting* solution, set [member volumetric_fog_density] to the lowest non-zero value (`0.0001`) then increase lights' [member Light3D.light_volumetric_fog_energy] to values between `10000` and `100000` to compensate for the very low density. + */ + get volumetric_fog_density(): float64 + set volumetric_fog_density(value: float64) + + /** The [Color] of the volumetric fog when interacting with lights. Mist and fog have an albedo close to `Color(1, 1, 1, 1)` while smoke has a darker albedo. */ + get volumetric_fog_albedo(): Color + set volumetric_fog_albedo(value: Color) + + /** The emitted light from the volumetric fog. Even with emission, volumetric fog will not cast light onto other surfaces. Emission is useful to establish an ambient color. As the volumetric fog effect uses single-scattering only, fog tends to need a little bit of emission to soften the harsh shadows. */ + get volumetric_fog_emission(): Color + set volumetric_fog_emission(value: Color) + + /** The brightness of the emitted light from the volumetric fog. */ + get volumetric_fog_emission_energy(): float64 + set volumetric_fog_emission_energy(value: float64) + + /** Scales the strength of Global Illumination used in the volumetric fog's albedo color. A value of `0.0` means that Global Illumination will not impact the volumetric fog. [member volumetric_fog_gi_inject] has a small performance cost when set above `0.0`. + * + * **Note:** This has no visible effect if [member volumetric_fog_density] is `0.0` or if [member volumetric_fog_albedo] is a fully black color. + * + * **Note:** Only [VoxelGI] and SDFGI ([member Environment.sdfgi_enabled]) are taken into account when using [member volumetric_fog_gi_inject]. Global illumination from [LightmapGI], [ReflectionProbe] and SSIL (see [member ssil_enabled]) will be ignored by volumetric fog. + */ + get volumetric_fog_gi_inject(): float64 + set volumetric_fog_gi_inject(value: float64) + + /** The direction of scattered light as it goes through the volumetric fog. A value close to `1.0` means almost all light is scattered forward. A value close to `0.0` means light is scattered equally in all directions. A value close to `-1.0` means light is scattered mostly backward. Fog and mist scatter light slightly forward, while smoke scatters light equally in all directions. */ + get volumetric_fog_anisotropy(): float64 + set volumetric_fog_anisotropy(value: float64) + + /** The distance over which the volumetric fog is computed. Increase to compute fog over a greater range, decrease to add more detail when a long range is not needed. For best quality fog, keep this as low as possible. See also [member ProjectSettings.rendering/environment/volumetric_fog/volume_depth]. */ + get volumetric_fog_length(): float64 + set volumetric_fog_length(value: float64) + + /** The distribution of size down the length of the froxel buffer. A higher value compresses the froxels closer to the camera and places more detail closer to the camera. */ + get volumetric_fog_detail_spread(): float64 + set volumetric_fog_detail_spread(value: float64) + + /** Scales the strength of ambient light used in the volumetric fog. A value of `0.0` means that ambient light will not impact the volumetric fog. [member volumetric_fog_ambient_inject] has a small performance cost when set above `0.0`. + * + * **Note:** This has no visible effect if [member volumetric_fog_density] is `0.0` or if [member volumetric_fog_albedo] is a fully black color. + */ + get volumetric_fog_ambient_inject(): float64 + set volumetric_fog_ambient_inject(value: float64) + + /** The factor to use when affecting the sky with volumetric fog. `1.0` means that volumetric fog can fully obscure the sky. Lower values reduce the impact of volumetric fog on sky rendering, with `0.0` not affecting sky rendering at all. + * + * **Note:** [member volumetric_fog_sky_affect] also affects [FogVolume]s, even if [member volumetric_fog_density] is `0.0`. If you notice [FogVolume]s are disappearing when looking towards the sky, set [member volumetric_fog_sky_affect] to `1.0`. + */ + get volumetric_fog_sky_affect(): float64 + set volumetric_fog_sky_affect(value: float64) + + /** Enables temporal reprojection in the volumetric fog. Temporal reprojection blends the current frame's volumetric fog with the last frame's volumetric fog to smooth out jagged edges. The performance cost is minimal; however, it leads to moving [FogVolume]s and [Light3D]s "ghosting" and leaving a trail behind them. When temporal reprojection is enabled, try to avoid moving [FogVolume]s or [Light3D]s too fast. Short-lived dynamic lighting effects should have [member Light3D.light_volumetric_fog_energy] set to `0.0` to avoid ghosting. */ + get volumetric_fog_temporal_reprojection_enabled(): boolean + set volumetric_fog_temporal_reprojection_enabled(value: boolean) + + /** The amount by which to blend the last frame with the current frame. A higher number results in smoother volumetric fog, but makes "ghosting" much worse. A lower value reduces ghosting but can result in the per-frame temporal jitter becoming visible. */ + get volumetric_fog_temporal_reprojection_amount(): float64 + set volumetric_fog_temporal_reprojection_amount(value: float64) + + /** If `true`, enables the `adjustment_*` properties provided by this resource. If `false`, modifications to the `adjustment_*` properties will have no effect on the rendered scene. */ + get adjustment_enabled(): boolean + set adjustment_enabled(value: boolean) + + /** The global brightness value of the rendered scene. Effective only if [member adjustment_enabled] is `true`. */ + get adjustment_brightness(): float64 + set adjustment_brightness(value: float64) + + /** The global contrast value of the rendered scene (default value is 1). Effective only if [member adjustment_enabled] is `true`. */ + get adjustment_contrast(): float64 + set adjustment_contrast(value: float64) + + /** The global color saturation value of the rendered scene (default value is 1). Effective only if [member adjustment_enabled] is `true`. */ + get adjustment_saturation(): float64 + set adjustment_saturation(value: float64) + + /** The [Texture2D] or [Texture3D] lookup table (LUT) to use for the built-in post-process color grading. Can use a [GradientTexture1D] for a 1-dimensional LUT, or a [Texture3D] for a more complex LUT. Effective only if [member adjustment_enabled] is `true`. */ + get adjustment_color_correction(): Texture2D | Texture3D + set adjustment_color_correction(value: Texture2D | Texture3D) + } + class EventListenerLineEdit = Record> extends LineEdit { + constructor(identifier?: any) + readonly event_changed: Signal1 + } + class ExportTemplateManager = Record> extends AcceptDialog { + constructor(identifier?: any) + } + /** A class that stores an expression you can execute. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_expression.html + */ + class Expression extends RefCounted { + constructor(identifier?: any) + /** Parses the expression and returns an [enum Error] code. + * You can optionally specify names of variables that may appear in the expression with [param input_names], so that you can bind them when it gets executed. + */ + parse(expression: string, input_names: PackedStringArray | string[] = []): GError + + /** Executes the expression that was previously parsed by [method parse] and returns the result. Before you use the returned object, you should check if the method failed by calling [method has_execute_failed]. + * If you defined input variables in [method parse], you can specify their values in the inputs array, in the same order. + */ + execute(inputs: GArray = [], base_instance: Object = undefined, show_error: boolean = true, const_calls_only: boolean = false): any + + /** Returns `true` if [method execute] has failed. */ + has_execute_failed(): boolean + + /** Returns the error text if [method parse] or [method execute] has failed. */ + get_error_text(): string + } + /** Texture which displays the content of an external buffer. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_externaltexture.html + */ + class ExternalTexture extends Texture2D { + constructor(identifier?: any) + /** Returns the external texture ID. + * Depending on your use case, you may need to pass this to platform APIs, for example, when creating an `android.graphics.SurfaceTexture` on Android. + */ + get_external_texture_id(): int64 + + /** Sets the external buffer ID. + * Depending on your use case, you may need to call this with data received from a platform API, for example, `SurfaceTexture.getHardwareBuffer()` on Android. + */ + set_external_buffer_id(external_buffer_id: int64): void + + /** External texture size. */ + get size(): Vector2 + set size(value: Vector2) + } + /** Handles FBX documents. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_fbxdocument.html + */ + class FBXDocument extends GLTFDocument { + constructor(identifier?: any) + } + class FBXImporterManager = Record> extends ConfirmationDialog { + constructor(identifier?: any) + } + /** @link https://docs.godotengine.org/en/4.4/classes/class_fbxstate.html */ + class FBXState extends GLTFState { + constructor(identifier?: any) + /** If `true`, the import process used auxiliary nodes called geometry helper nodes. These nodes help preserve the pivots and transformations of the original 3D model during import. */ + get allow_geometry_helper_nodes(): boolean + set allow_geometry_helper_nodes(value: boolean) + } + namespace FastNoiseLite { + enum NoiseType { + /** A lattice of points are assigned random values then interpolated based on neighboring values. */ + TYPE_VALUE = 5, + + /** Similar to Value noise, but slower. Has more variance in peaks and valleys. + * Cubic noise can be used to avoid certain artifacts when using value noise to create a bumpmap. In general, you should always use this mode if the value noise is being used for a heightmap or bumpmap. + */ + TYPE_VALUE_CUBIC = 4, + + /** A lattice of random gradients. Their dot products are interpolated to obtain values in between the lattices. */ + TYPE_PERLIN = 3, + + /** Cellular includes both Worley noise and Voronoi diagrams which creates various regions of the same value. */ + TYPE_CELLULAR = 2, + + /** As opposed to [constant TYPE_PERLIN], gradients exist in a simplex lattice rather than a grid lattice, avoiding directional artifacts. Internally uses FastNoiseLite's OpenSimplex2 noise type. */ + TYPE_SIMPLEX = 0, + + /** Modified, higher quality version of [constant TYPE_SIMPLEX], but slower. Internally uses FastNoiseLite's OpenSimplex2S noise type. */ + TYPE_SIMPLEX_SMOOTH = 1, + } + enum FractalType { + /** No fractal noise. */ + FRACTAL_NONE = 0, + + /** Method using Fractional Brownian Motion to combine octaves into a fractal. */ + FRACTAL_FBM = 1, + + /** Method of combining octaves into a fractal resulting in a "ridged" look. */ + FRACTAL_RIDGED = 2, + + /** Method of combining octaves into a fractal with a ping pong effect. */ + FRACTAL_PING_PONG = 3, + } + enum CellularDistanceFunction { + /** Euclidean distance to the nearest point. */ + DISTANCE_EUCLIDEAN = 0, + + /** Squared Euclidean distance to the nearest point. */ + DISTANCE_EUCLIDEAN_SQUARED = 1, + + /** Manhattan distance (taxicab metric) to the nearest point. */ + DISTANCE_MANHATTAN = 2, + + /** Blend of [constant DISTANCE_EUCLIDEAN] and [constant DISTANCE_MANHATTAN] to give curved cell boundaries. */ + DISTANCE_HYBRID = 3, + } + enum CellularReturnType { + /** The cellular distance function will return the same value for all points within a cell. */ + RETURN_CELL_VALUE = 0, + + /** The cellular distance function will return a value determined by the distance to the nearest point. */ + RETURN_DISTANCE = 1, + + /** The cellular distance function returns the distance to the second-nearest point. */ + RETURN_DISTANCE2 = 2, + + /** The distance to the nearest point is added to the distance to the second-nearest point. */ + RETURN_DISTANCE2_ADD = 3, + + /** The distance to the nearest point is subtracted from the distance to the second-nearest point. */ + RETURN_DISTANCE2_SUB = 4, + + /** The distance to the nearest point is multiplied with the distance to the second-nearest point. */ + RETURN_DISTANCE2_MUL = 5, + + /** The distance to the nearest point is divided by the distance to the second-nearest point. */ + RETURN_DISTANCE2_DIV = 6, + } + enum DomainWarpType { + /** The domain is warped using the simplex noise algorithm. */ + DOMAIN_WARP_SIMPLEX = 0, + + /** The domain is warped using a simplified version of the simplex noise algorithm. */ + DOMAIN_WARP_SIMPLEX_REDUCED = 1, + + /** The domain is warped using a simple noise grid (not as smooth as the other methods, but more performant). */ + DOMAIN_WARP_BASIC_GRID = 2, + } + enum DomainWarpFractalType { + /** No fractal noise for warping the space. */ + DOMAIN_WARP_FRACTAL_NONE = 0, + + /** Warping the space progressively, octave for octave, resulting in a more "liquified" distortion. */ + DOMAIN_WARP_FRACTAL_PROGRESSIVE = 1, + + /** Warping the space independently for each octave, resulting in a more chaotic distortion. */ + DOMAIN_WARP_FRACTAL_INDEPENDENT = 2, + } + } + /** Generates noise using the FastNoiseLite library. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_fastnoiselite.html + */ + class FastNoiseLite extends Noise { + constructor(identifier?: any) + _changed(): void + + /** The noise algorithm used. See [enum NoiseType]. */ + get noise_type(): int64 + set noise_type(value: int64) + + /** The random number seed for all noise types. */ + get seed(): int64 + set seed(value: int64) + + /** The frequency for all noise types. Low frequency results in smooth noise while high frequency results in rougher, more granular noise. */ + get frequency(): float64 + set frequency(value: float64) + + /** Translate the noise input coordinates by the given [Vector3]. */ + get offset(): Vector3 + set offset(value: Vector3) + + /** The method for combining octaves into a fractal. See [enum FractalType]. */ + get fractal_type(): int64 + set fractal_type(value: int64) + + /** The number of noise layers that are sampled to get the final value for fractal noise types. */ + get fractal_octaves(): int64 + set fractal_octaves(value: int64) + + /** Frequency multiplier between subsequent octaves. Increasing this value results in higher octaves producing noise with finer details and a rougher appearance. */ + get fractal_lacunarity(): float64 + set fractal_lacunarity(value: float64) + + /** Determines the strength of each subsequent layer of noise in fractal noise. + * A low value places more emphasis on the lower frequency base layers, while a high value puts more emphasis on the higher frequency layers. + */ + get fractal_gain(): float64 + set fractal_gain(value: float64) + + /** Higher weighting means higher octaves have less impact if lower octaves have a large impact. */ + get fractal_weighted_strength(): float64 + set fractal_weighted_strength(value: float64) + + /** Sets the strength of the fractal ping pong type. */ + get fractal_ping_pong_strength(): float64 + set fractal_ping_pong_strength(value: float64) + + /** Determines how the distance to the nearest/second-nearest point is computed. See [enum CellularDistanceFunction] for options. */ + get cellular_distance_function(): int64 + set cellular_distance_function(value: int64) + + /** Maximum distance a point can move off of its grid position. Set to `0` for an even grid. */ + get cellular_jitter(): float64 + set cellular_jitter(value: float64) + + /** Return type from cellular noise calculations. See [enum CellularReturnType]. */ + get cellular_return_type(): int64 + set cellular_return_type(value: int64) + + /** If enabled, another FastNoiseLite instance is used to warp the space, resulting in a distortion of the noise. */ + get domain_warp_enabled(): boolean + set domain_warp_enabled(value: boolean) + + /** Sets the warp algorithm. See [enum DomainWarpType]. */ + get domain_warp_type(): int64 + set domain_warp_type(value: int64) + + /** Sets the maximum warp distance from the origin. */ + get domain_warp_amplitude(): float64 + set domain_warp_amplitude(value: float64) + + /** Frequency of the noise which warps the space. Low frequency results in smooth noise while high frequency results in rougher, more granular noise. */ + get domain_warp_frequency(): float64 + set domain_warp_frequency(value: float64) + + /** The method for combining octaves into a fractal which is used to warp the space. See [enum DomainWarpFractalType]. */ + get domain_warp_fractal_type(): int64 + set domain_warp_fractal_type(value: int64) + + /** The number of noise layers that are sampled to get the final value for the fractal noise which warps the space. */ + get domain_warp_fractal_octaves(): int64 + set domain_warp_fractal_octaves(value: int64) + + /** Octave lacunarity of the fractal noise which warps the space. Increasing this value results in higher octaves producing noise with finer details and a rougher appearance. */ + get domain_warp_fractal_lacunarity(): float64 + set domain_warp_fractal_lacunarity(value: float64) + + /** Determines the strength of each subsequent layer of the noise which is used to warp the space. + * A low value places more emphasis on the lower frequency base layers, while a high value puts more emphasis on the higher frequency layers. + */ + get domain_warp_fractal_gain(): float64 + set domain_warp_fractal_gain(value: float64) + } + namespace FileAccess { + enum ModeFlags { + /** Opens the file for read operations. The cursor is positioned at the beginning of the file. */ + READ = 1, + + /** Opens the file for write operations. The file is created if it does not exist, and truncated if it does. + * + * **Note:** When creating a file it must be in an already existing directory. To recursively create directories for a file path, see [method DirAccess.make_dir_recursive]. + */ + WRITE = 2, + + /** Opens the file for read and write operations. Does not truncate the file. The cursor is positioned at the beginning of the file. */ + READ_WRITE = 3, + + /** Opens the file for read and write operations. The file is created if it does not exist, and truncated if it does. The cursor is positioned at the beginning of the file. + * + * **Note:** When creating a file it must be in an already existing directory. To recursively create directories for a file path, see [method DirAccess.make_dir_recursive]. + */ + WRITE_READ = 7, + } + enum CompressionMode { + /** Uses the [url=https://fastlz.org/]FastLZ[/url] compression method. */ + COMPRESSION_FASTLZ = 0, + + /** Uses the [url=https://en.wikipedia.org/wiki/DEFLATE]DEFLATE[/url] compression method. */ + COMPRESSION_DEFLATE = 1, + + /** Uses the [url=https://facebook.github.io/zstd/]Zstandard[/url] compression method. */ + COMPRESSION_ZSTD = 2, + + /** Uses the [url=https://www.gzip.org/]gzip[/url] compression method. */ + COMPRESSION_GZIP = 3, + + /** Uses the [url=https://github.com/google/brotli]brotli[/url] compression method (only decompression is supported). */ + COMPRESSION_BROTLI = 4, + } + enum UnixPermissionFlags { + /** Read for owner bit. */ + UNIX_READ_OWNER = 256, + + /** Write for owner bit. */ + UNIX_WRITE_OWNER = 128, + + /** Execute for owner bit. */ + UNIX_EXECUTE_OWNER = 64, + + /** Read for group bit. */ + UNIX_READ_GROUP = 32, + + /** Write for group bit. */ + UNIX_WRITE_GROUP = 16, + + /** Execute for group bit. */ + UNIX_EXECUTE_GROUP = 8, + + /** Read for other bit. */ + UNIX_READ_OTHER = 4, + + /** Write for other bit. */ + UNIX_WRITE_OTHER = 2, + + /** Execute for other bit. */ + UNIX_EXECUTE_OTHER = 1, + + /** Set user id on execution bit. */ + UNIX_SET_USER_ID = 2048, + + /** Set group id on execution bit. */ + UNIX_SET_GROUP_ID = 1024, + + /** Restricted deletion (sticky) bit. */ + UNIX_RESTRICTED_DELETE = 512, + } + } + /** Provides methods for file reading and writing operations. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_fileaccess.html + */ + class FileAccess extends RefCounted { + constructor(identifier?: any) + /** Creates a new [FileAccess] object and opens the file for writing or reading, depending on the flags. + * Returns `null` if opening the file failed. You can use [method get_open_error] to check the error that occurred. + */ + static open(path: string, flags: FileAccess.ModeFlags): FileAccess + + /** Creates a new [FileAccess] object and opens an encrypted file in write or read mode. You need to pass a binary key to encrypt/decrypt it. + * + * **Note:** The provided key must be 32 bytes long. + * Returns `null` if opening the file failed. You can use [method get_open_error] to check the error that occurred. + */ + static open_encrypted(path: string, mode_flags: FileAccess.ModeFlags, key: PackedByteArray | byte[] | ArrayBuffer, iv: PackedByteArray | byte[] | ArrayBuffer = []): FileAccess + + /** Creates a new [FileAccess] object and opens an encrypted file in write or read mode. You need to pass a password to encrypt/decrypt it. + * Returns `null` if opening the file failed. You can use [method get_open_error] to check the error that occurred. + */ + static open_encrypted_with_pass(path: string, mode_flags: FileAccess.ModeFlags, pass: string): FileAccess + + /** Creates a new [FileAccess] object and opens a compressed file for reading or writing. + * + * **Note:** [method open_compressed] can only read files that were saved by Godot, not third-party compression formats. See [url=https://github.com/godotengine/godot/issues/28999]GitHub issue #28999[/url] for a workaround. + * Returns `null` if opening the file failed. You can use [method get_open_error] to check the error that occurred. + */ + static open_compressed(path: string, mode_flags: FileAccess.ModeFlags, compression_mode: FileAccess.CompressionMode = 0): FileAccess + + /** Returns the result of the last [method open] call in the current thread. */ + static get_open_error(): GError + + /** Creates a temporary file. This file will be freed when the returned [FileAccess] is freed. + * If [param prefix] is not empty, it will be prefixed to the file name, separated by a `-`. + * If [param extension] is not empty, it will be appended to the temporary file name. + * If [param keep] is `true`, the file is not deleted when the returned [FileAccess] is freed. + * Returns `null` if opening the file failed. You can use [method get_open_error] to check the error that occurred. + */ + static create_temp(mode_flags: int64, prefix: string = '', extension: string = '', keep: boolean = false): FileAccess + + /** Returns the whole [param path] file contents as a [PackedByteArray] without any decoding. + * Returns an empty [PackedByteArray] if an error occurred while opening the file. You can use [method get_open_error] to check the error that occurred. + */ + static get_file_as_bytes(path: string): PackedByteArray + + /** Returns the whole [param path] file contents as a [String]. Text is interpreted as being UTF-8 encoded. + * Returns an empty [String] if an error occurred while opening the file. You can use [method get_open_error] to check the error that occurred. + */ + static get_file_as_string(path: string): string + + /** Resizes the file to a specified length. The file must be open in a mode that permits writing. If the file is extended, NUL characters are appended. If the file is truncated, all data from the end file to the original length of the file is lost. */ + resize(length: int64): GError + + /** Writes the file's buffer to disk. Flushing is automatically performed when the file is closed. This means you don't need to call [method flush] manually before closing a file. Still, calling [method flush] can be used to ensure the data is safe even if the project crashes instead of being closed gracefully. + * + * **Note:** Only call [method flush] when you actually need it. Otherwise, it will decrease performance due to constant disk writes. + */ + flush(): void + + /** Returns the path as a [String] for the current open file. */ + get_path(): string + + /** Returns the absolute path as a [String] for the current open file. */ + get_path_absolute(): string + + /** Returns `true` if the file is currently opened. */ + is_open(): boolean + + /** Changes the file reading/writing cursor to the specified position (in bytes from the beginning of the file). */ + seek(position: int64): void + + /** Changes the file reading/writing cursor to the specified position (in bytes from the end of the file). + * + * **Note:** This is an offset, so you should use negative numbers or the cursor will be at the end of the file. + */ + seek_end(position: int64 = 0): void + + /** Returns the file cursor's position. */ + get_position(): int64 + + /** Returns the size of the file in bytes. For a pipe, returns the number of bytes available for reading from the pipe. */ + get_length(): int64 + + /** Returns `true` if the file cursor has already read past the end of the file. + * + * **Note:** `eof_reached() == false` cannot be used to check whether there is more data available. To loop while there is more data available, use: + * + */ + eof_reached(): boolean + + /** Returns the next 8 bits from the file as an integer. See [method store_8] for details on what values can be stored and retrieved this way. */ + get_8(): int64 + + /** Returns the next 16 bits from the file as an integer. See [method store_16] for details on what values can be stored and retrieved this way. */ + get_16(): int64 + + /** Returns the next 32 bits from the file as an integer. See [method store_32] for details on what values can be stored and retrieved this way. */ + get_32(): int64 + + /** Returns the next 64 bits from the file as an integer. See [method store_64] for details on what values can be stored and retrieved this way. */ + get_64(): int64 + + /** Returns the next 16 bits from the file as a half-precision floating-point number. */ + get_half(): float64 + + /** Returns the next 32 bits from the file as a floating-point number. */ + get_float(): float64 + + /** Returns the next 64 bits from the file as a floating-point number. */ + get_double(): float64 + + /** Returns the next bits from the file as a floating-point number. */ + get_real(): float64 + + /** Returns next [param length] bytes of the file as a [PackedByteArray]. */ + get_buffer(length: int64): PackedByteArray + + /** Returns the next line of the file as a [String]. The returned string doesn't include newline (`\n`) or carriage return (`\r`) characters, but does include any other leading or trailing whitespace. + * Text is interpreted as being UTF-8 encoded. + */ + get_line(): string + + /** Returns the next value of the file in CSV (Comma-Separated Values) format. You can pass a different delimiter [param delim] to use other than the default `","` (comma). This delimiter must be one-character long, and cannot be a double quotation mark. + * Text is interpreted as being UTF-8 encoded. Text values must be enclosed in double quotes if they include the delimiter character. Double quotes within a text value can be escaped by doubling their occurrence. + * For example, the following CSV lines are valid and will be properly parsed as two strings each: + * [codeblock lang=text] + * Alice,"Hello, Bob!" + * Bob,Alice! What a surprise! + * Alice,"I thought you'd reply with ""Hello, world""." + * [/codeblock] + * Note how the second line can omit the enclosing quotes as it does not include the delimiter. However it *could* very well use quotes, it was only written without for demonstration purposes. The third line must use `""` for each quotation mark that needs to be interpreted as such instead of the end of a text value. + */ + get_csv_line(delim: string = ','): PackedStringArray + + /** Returns the whole file as a [String]. Text is interpreted as being UTF-8 encoded. + * If [param skip_cr] is `true`, carriage return characters (`\r`, CR) will be ignored when parsing the UTF-8, so that only line feed characters (`\n`, LF) represent a new line (Unix convention). + */ + get_as_text(skip_cr: boolean = false): string + + /** Returns an MD5 String representing the file at the given path or an empty [String] on failure. */ + static get_md5(path: string): string + + /** Returns an SHA-256 [String] representing the file at the given path or an empty [String] on failure. */ + static get_sha256(path: string): string + + /** Returns the last error that happened when trying to perform operations. Compare with the `ERR_FILE_*` constants from [enum Error]. */ + get_error(): GError + + /** Returns the next [Variant] value from the file. If [param allow_objects] is `true`, decoding objects is allowed. + * Internally, this uses the same decoding mechanism as the [method @GlobalScope.bytes_to_var] method. + * **Warning:** Deserialized objects can contain code which gets executed. Do not use this option if the serialized object comes from untrusted sources to avoid potential security threats such as remote code execution. + */ + get_var(allow_objects: boolean = false): any + + /** Stores an integer as 8 bits in the file. + * + * **Note:** The [param value] should lie in the interval `[0, 255]`. Any other value will overflow and wrap around. + * + * **Note:** If an error occurs, the resulting value of the file position indicator is indeterminate. + * To store a signed integer, use [method store_64], or convert it manually (see [method store_16] for an example). + */ + store_8(value: int64): boolean + + /** Stores an integer as 16 bits in the file. + * + * **Note:** The [param value] should lie in the interval `[0, 2^16 - 1]`. Any other value will overflow and wrap around. + * + * **Note:** If an error occurs, the resulting value of the file position indicator is indeterminate. + * To store a signed integer, use [method store_64] or store a signed integer from the interval `[-2^15, 2^15 - 1]` (i.e. keeping one bit for the signedness) and compute its sign manually when reading. For example: + * + */ + store_16(value: int64): boolean + + /** Stores an integer as 32 bits in the file. + * + * **Note:** The [param value] should lie in the interval `[0, 2^32 - 1]`. Any other value will overflow and wrap around. + * + * **Note:** If an error occurs, the resulting value of the file position indicator is indeterminate. + * To store a signed integer, use [method store_64], or convert it manually (see [method store_16] for an example). + */ + store_32(value: int64): boolean + + /** Stores an integer as 64 bits in the file. + * + * **Note:** The [param value] must lie in the interval `[-2^63, 2^63 - 1]` (i.e. be a valid [int] value). + * + * **Note:** If an error occurs, the resulting value of the file position indicator is indeterminate. + */ + store_64(value: int64): boolean + + /** Stores a half-precision floating-point number as 16 bits in the file. */ + store_half(value: float64): boolean + + /** Stores a floating-point number as 32 bits in the file. + * + * **Note:** If an error occurs, the resulting value of the file position indicator is indeterminate. + */ + store_float(value: float64): boolean + + /** Stores a floating-point number as 64 bits in the file. + * + * **Note:** If an error occurs, the resulting value of the file position indicator is indeterminate. + */ + store_double(value: float64): boolean + + /** Stores a floating-point number in the file. + * + * **Note:** If an error occurs, the resulting value of the file position indicator is indeterminate. + */ + store_real(value: float64): boolean + + /** Stores the given array of bytes in the file. + * + * **Note:** If an error occurs, the resulting value of the file position indicator is indeterminate. + */ + store_buffer(buffer: PackedByteArray | byte[] | ArrayBuffer): boolean + + /** Stores [param line] in the file followed by a newline character (`\n`), encoding the text as UTF-8. + * + * **Note:** If an error occurs, the resulting value of the file position indicator is indeterminate. + */ + store_line(line: string): boolean + + /** Store the given [PackedStringArray] in the file as a line formatted in the CSV (Comma-Separated Values) format. You can pass a different delimiter [param delim] to use other than the default `","` (comma). This delimiter must be one-character long. + * Text will be encoded as UTF-8. + * + * **Note:** If an error occurs, the resulting value of the file position indicator is indeterminate. + */ + store_csv_line(values: PackedStringArray | string[], delim: string = ','): boolean + + /** Stores [param string] in the file without a newline character (`\n`), encoding the text as UTF-8. + * + * **Note:** This method is intended to be used to write text files. The string is stored as a UTF-8 encoded buffer without string length or terminating zero, which means that it can't be loaded back easily. If you want to store a retrievable string in a binary file, consider using [method store_pascal_string] instead. For retrieving strings from a text file, you can use `get_buffer(length).get_string_from_utf8()` (if you know the length) or [method get_as_text]. + * + * **Note:** If an error occurs, the resulting value of the file position indicator is indeterminate. + */ + store_string(string_: string): boolean + + /** Stores any Variant value in the file. If [param full_objects] is `true`, encoding objects is allowed (and can potentially include code). + * Internally, this uses the same encoding mechanism as the [method @GlobalScope.var_to_bytes] method. + * + * **Note:** Not all properties are included. Only properties that are configured with the [constant PROPERTY_USAGE_STORAGE] flag set will be serialized. You can add a new usage flag to a property by overriding the [method Object._get_property_list] method in your class. You can also check how property usage is configured by calling [method Object._get_property_list]. See [enum PropertyUsageFlags] for the possible usage flags. + * + * **Note:** If an error occurs, the resulting value of the file position indicator is indeterminate. + */ + store_var(value: any, full_objects: boolean = false): boolean + + /** Stores the given [String] as a line in the file in Pascal format (i.e. also store the length of the string). + * Text will be encoded as UTF-8. + * + * **Note:** If an error occurs, the resulting value of the file position indicator is indeterminate. + */ + store_pascal_string(string_: string): boolean + + /** Returns a [String] saved in Pascal format from the file. + * Text is interpreted as being UTF-8 encoded. + */ + get_pascal_string(): string + + /** Closes the currently opened file and prevents subsequent read/write operations. Use [method flush] to persist the data to disk without closing the file. + * + * **Note:** [FileAccess] will automatically close when it's freed, which happens when it goes out of scope or when it gets assigned with `null`. In C# the reference must be disposed after we are done using it, this can be done with the `using` statement or calling the `Dispose` method directly. + */ + close(): void + + /** Returns `true` if the file exists in the given path. + * + * **Note:** Many resources types are imported (e.g. textures or sound files), and their source asset will not be included in the exported game, as only the imported version is used. See [method ResourceLoader.exists] for an alternative approach that takes resource remapping into account. + * For a non-static, relative equivalent, use [method DirAccess.file_exists]. + */ + static file_exists(path: string): boolean + + /** Returns the last time the [param file] was modified in Unix timestamp format, or `0` on error. This Unix timestamp can be converted to another format using the [Time] singleton. */ + static get_modified_time(file: string): int64 + + /** Returns file UNIX permissions. + * + * **Note:** This method is implemented on iOS, Linux/BSD, and macOS. + */ + static get_unix_permissions(file: string): FileAccess.UnixPermissionFlags + + /** Sets file UNIX permissions. + * + * **Note:** This method is implemented on iOS, Linux/BSD, and macOS. + */ + static set_unix_permissions(file: string, permissions: FileAccess.UnixPermissionFlags): GError + + /** Returns `true`, if file `hidden` attribute is set. + * + * **Note:** This method is implemented on iOS, BSD, macOS, and Windows. + */ + static get_hidden_attribute(file: string): boolean + + /** Sets file **hidden** attribute. + * + * **Note:** This method is implemented on iOS, BSD, macOS, and Windows. + */ + static set_hidden_attribute(file: string, hidden: boolean): GError + + /** Sets file **read only** attribute. + * + * **Note:** This method is implemented on iOS, BSD, macOS, and Windows. + */ + static set_read_only_attribute(file: string, ro: boolean): GError + + /** Returns `true`, if file `read only` attribute is set. + * + * **Note:** This method is implemented on iOS, BSD, macOS, and Windows. + */ + static get_read_only_attribute(file: string): boolean + + /** If `true`, the file is read with big-endian [url=https://en.wikipedia.org/wiki/Endianness]endianness[/url]. If `false`, the file is read with little-endian endianness. If in doubt, leave this to `false` as most files are written with little-endian endianness. + * + * **Note:** [member big_endian] is only about the file format, not the CPU type. The CPU endianness doesn't affect the default endianness for files written. + * + * **Note:** This is always reset to `false` whenever you open the file. Therefore, you must set [member big_endian] *after* opening the file, not before. + */ + get big_endian(): boolean + set big_endian(value: boolean) + } + namespace FileDialog { + enum FileMode { + /** The dialog allows selecting one, and only one file. */ + FILE_MODE_OPEN_FILE = 0, + + /** The dialog allows selecting multiple files. */ + FILE_MODE_OPEN_FILES = 1, + + /** The dialog only allows selecting a directory, disallowing the selection of any file. */ + FILE_MODE_OPEN_DIR = 2, + + /** The dialog allows selecting one file or directory. */ + FILE_MODE_OPEN_ANY = 3, + + /** The dialog will warn when a file exists. */ + FILE_MODE_SAVE_FILE = 4, + } + enum Access { + /** The dialog only allows accessing files under the [Resource] path (`res://`). */ + ACCESS_RESOURCES = 0, + + /** The dialog only allows accessing files under user data path (`user://`). */ + ACCESS_USERDATA = 1, + + /** The dialog allows accessing files on the whole file system. */ + ACCESS_FILESYSTEM = 2, + } + } + /** A dialog for selecting files or directories in the filesystem. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_filedialog.html + */ + class FileDialog = Record> extends ConfirmationDialog { + constructor(identifier?: any) + _cancel_pressed(): void + + /** Clear all the added filters in the dialog. */ + clear_filters(): void + + /** Adds a comma-delimited file name [param filter] option to the [FileDialog] with an optional [param description], which restricts what files can be picked. + * A [param filter] should be of the form `"filename.extension"`, where filename and extension can be `*` to match any string. Filters starting with `.` (i.e. empty filenames) are not allowed. + * For example, a [param filter] of `"*.png, *.jpg"` and a [param description] of `"Images"` results in filter text "Images (*.png, *.jpg)". + */ + add_filter(filter: string, description: string = ''): void + + /** Clear the filter for file names. */ + clear_filename_filter(): void + + /** Returns the name of the [OptionButton] or [CheckBox] with index [param option]. */ + get_option_name(option: int64): string + + /** Returns an array of values of the [OptionButton] with index [param option]. */ + get_option_values(option: int64): PackedStringArray + + /** Returns the default value index of the [OptionButton] or [CheckBox] with index [param option]. */ + get_option_default(option: int64): int64 + + /** Sets the name of the [OptionButton] or [CheckBox] with index [param option]. */ + set_option_name(option: int64, name: string): void + + /** Sets the option values of the [OptionButton] with index [param option]. */ + set_option_values(option: int64, values: PackedStringArray | string[]): void + + /** Sets the default value index of the [OptionButton] or [CheckBox] with index [param option]. */ + set_option_default(option: int64, default_value_index: int64): void + + /** Adds an additional [OptionButton] to the file dialog. If [param values] is empty, a [CheckBox] is added instead. + * [param default_value_index] should be an index of the value in the [param values]. If [param values] is empty it should be either `1` (checked), or `0` (unchecked). + */ + add_option(name: string, values: PackedStringArray | string[], default_value_index: int64): void + + /** Returns a [Dictionary] with the selected values of the additional [OptionButton]s and/or [CheckBox]es. [Dictionary] keys are names and values are selected value indices. */ + get_selected_options(): GDictionary + + /** Returns the vertical box container of the dialog, custom controls can be added to it. + * **Warning:** This is a required internal node, removing and freeing it may cause a crash. If you wish to hide it or any of its children, use their [member CanvasItem.visible] property. + * + * **Note:** Changes to this node are ignored by native file dialogs, use [method add_option] to add custom elements to the dialog instead. + */ + get_vbox(): VBoxContainer + + /** Returns the LineEdit for the selected file. + * **Warning:** This is a required internal node, removing and freeing it may cause a crash. If you wish to hide it or any of its children, use their [member CanvasItem.visible] property. + */ + get_line_edit(): LineEdit + + /** Clear all currently selected items in the dialog. */ + deselect_all(): void + + /** Invalidate and update the current dialog content list. + * + * **Note:** This method does nothing on native file dialogs. + */ + invalidate(): void + + /** If `true`, changing the [member file_mode] property will set the window title accordingly (e.g. setting [member file_mode] to [constant FILE_MODE_OPEN_FILE] will change the window title to "Open a File"). */ + get mode_overrides_title(): boolean + set mode_overrides_title(value: boolean) + + /** The dialog's open or save mode, which affects the selection behavior. See [enum FileMode]. */ + get file_mode(): int64 + set file_mode(value: int64) + + /** The file system access scope. See [enum Access] constants. + * **Warning:** In Web builds, FileDialog cannot access the host file system. In sandboxed Linux and macOS environments, [member use_native_dialog] is automatically used to allow limited access to host file system. + */ + get access(): int64 + set access(value: int64) + + /** If non-empty, the given sub-folder will be "root" of this [FileDialog], i.e. user won't be able to go to its parent directory. + * + * **Note:** This property is ignored by native file dialogs. + */ + get root_subfolder(): string + set root_subfolder(value: string) + + /** The available file type filters. Each filter string in the array should be formatted like this: `*.png,*.jpg,*.jpeg;Image Files;image/png,image/jpeg`. The description text of the filter is optional and can be omitted. Both file extensions and MIME type should be always set. + * + * **Note:** Embedded file dialog and Windows file dialog support only file extensions, while Android, Linux, and macOS file dialogs also support MIME types. + */ + get filters(): PackedStringArray + set filters(value: PackedStringArray | string[]) + + /** The filter for file names (case-insensitive). When set to a non-empty string, only files that contains the substring will be shown. [member filename_filter] can be edited by the user with the filter button at the top of the file dialog. + * See also [member filters], which should be used to restrict the file types that can be selected instead of [member filename_filter] which is meant to be set by the user. + */ + get filename_filter(): string + set filename_filter(value: string) + + /** The number of additional [OptionButton]s and [CheckBox]es in the dialog. */ + get option_count(): any /*Options,option_*/ + set option_count(value: any /*Options,option_*/) + + /** If `true`, the dialog will show hidden files. + * + * **Note:** This property is ignored by native file dialogs on Android and Linux. + */ + get show_hidden_files(): boolean + set show_hidden_files(value: boolean) + + /** If `true`, and if supported by the current [DisplayServer], OS native dialog will be used instead of custom one. + * + * **Note:** On Android, it is only supported when using [constant ACCESS_FILESYSTEM]. For access mode [constant ACCESS_RESOURCES] and [constant ACCESS_USERDATA], the system will fall back to custom FileDialog. + * + * **Note:** On Linux and macOS, sandboxed apps always use native dialogs to access the host file system. + * + * **Note:** On macOS, sandboxed apps will save security-scoped bookmarks to retain access to the opened folders across multiple sessions. Use [method OS.get_granted_permissions] to get a list of saved bookmarks. + * + * **Note:** Native dialogs are isolated from the base process, file dialog properties can't be modified once the dialog is shown. + */ + get use_native_dialog(): boolean + set use_native_dialog(value: boolean) + + /** The current working directory of the file dialog. + * + * **Note:** For native file dialogs, this property is only treated as a hint and may not be respected by specific OS implementations. + */ + get current_dir(): string + set current_dir(value: string) + + /** The currently selected file of the file dialog. */ + get current_file(): string + set current_file(value: string) + + /** The currently selected file path of the file dialog. */ + get current_path(): string + set current_path(value: string) + + /** Emitted when the user selects a file by double-clicking it or pressing the **OK** button. */ + readonly file_selected: Signal1 + + /** Emitted when the user selects multiple files. */ + readonly files_selected: Signal1 + + /** Emitted when the user selects a directory. */ + readonly dir_selected: Signal1 + + /** Emitted when the filter for file names changes. */ + readonly filename_filter_changed: Signal1 + } + /** Godot editor's dock for managing files in the project. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_filesystemdock.html + */ + class FileSystemDock = Record> extends VBoxContainer { + constructor(identifier?: any) + _file_list_thumbnail_done(_unnamed_arg0: string, _unnamed_arg1: Texture2D, _unnamed_arg2: Texture2D, _unnamed_arg3: any): void + _tree_thumbnail_done(_unnamed_arg0: string, _unnamed_arg1: Texture2D, _unnamed_arg2: Texture2D, _unnamed_arg3: any): void + + /** Sets the given [param path] as currently selected, ensuring that the selected file/directory is visible. */ + navigate_to_path(path: string): void + + /** Registers a new [EditorResourceTooltipPlugin]. */ + add_resource_tooltip_plugin(plugin: EditorResourceTooltipPlugin): void + + /** Removes an [EditorResourceTooltipPlugin]. Fails if the plugin wasn't previously added. */ + remove_resource_tooltip_plugin(plugin: EditorResourceTooltipPlugin): void + _set_dock_horizontal(enable: boolean): void + _can_dock_horizontal(): boolean + _save_layout_to_config(_unnamed_arg0: ConfigFile, _unnamed_arg1: string): void + _load_layout_from_config(_unnamed_arg0: ConfigFile, _unnamed_arg1: string): void + + /** Emitted when a new scene is created that inherits the scene at [param file] path. */ + readonly inherit: Signal1 + + /** Emitted when the given scenes are being instantiated in the editor. */ + readonly instantiate: Signal1 + + /** Emitted when an external [param resource] had its file removed. */ + readonly resource_removed: Signal1 + + /** Emitted when the given [param file] was removed. */ + readonly file_removed: Signal1 + + /** Emitted when the given [param folder] was removed. */ + readonly folder_removed: Signal1 + + /** Emitted when a file is moved from [param old_file] path to [param new_file] path. */ + readonly files_moved: Signal2 + + /** Emitted when a folder is moved from [param old_folder] path to [param new_folder] path. */ + readonly folder_moved: Signal2 + + /** Emitted when folders change color. */ + readonly folder_color_changed: Signal0 + + /** Emitted when the user switches file display mode or split mode. */ + readonly display_mode_changed: Signal0 + } + class FileSystemList = Record> extends ItemList { + constructor(identifier?: any) + readonly item_edited: Signal0 + } + class FindInFiles = Record> extends Node { + constructor(identifier?: any) + readonly result_found: Signal5 + readonly finished: Signal0 + } + class FindInFilesDialog = Record> extends AcceptDialog { + constructor(identifier?: any) + readonly find_requested: Signal0 + readonly replace_requested: Signal0 + } + class FindInFilesPanel = Record> extends Control { + constructor(identifier?: any) + _on_result_found(_unnamed_arg0: string, _unnamed_arg1: int64, _unnamed_arg2: int64, _unnamed_arg3: int64, _unnamed_arg4: string): void + _on_finished(): void + readonly result_selected: Signal4 + readonly files_modified: Signal1 + readonly close_button_clicked: Signal0 + } + class FindReplaceBar = Record> extends HBoxContainer { + constructor(identifier?: any) + _search_current(): boolean + readonly error: Signal0 + } + namespace FlowContainer { + enum AlignmentMode { + /** The child controls will be arranged at the beginning of the container, i.e. top if orientation is vertical, left if orientation is horizontal (right for RTL layout). */ + ALIGNMENT_BEGIN = 0, + + /** The child controls will be centered in the container. */ + ALIGNMENT_CENTER = 1, + + /** The child controls will be arranged at the end of the container, i.e. bottom if orientation is vertical, right if orientation is horizontal (left for RTL layout). */ + ALIGNMENT_END = 2, + } + enum LastWrapAlignmentMode { + /** The last partially filled row or column will wrap aligned to the previous row or column in accordance with [member alignment]. */ + LAST_WRAP_ALIGNMENT_INHERIT = 0, + + /** The last partially filled row or column will wrap aligned to the beginning of the previous row or column. */ + LAST_WRAP_ALIGNMENT_BEGIN = 1, + + /** The last partially filled row or column will wrap aligned to the center of the previous row or column. */ + LAST_WRAP_ALIGNMENT_CENTER = 2, + + /** The last partially filled row or column will wrap aligned to the end of the previous row or column. */ + LAST_WRAP_ALIGNMENT_END = 3, + } + } + /** A container that arranges its child controls horizontally or vertically and wraps them around at the borders. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_flowcontainer.html + */ + class FlowContainer = Record> extends Container { + constructor(identifier?: any) + /** Returns the current line count. */ + get_line_count(): int64 + + /** The alignment of the container's children (must be one of [constant ALIGNMENT_BEGIN], [constant ALIGNMENT_CENTER], or [constant ALIGNMENT_END]). */ + get alignment(): int64 + set alignment(value: int64) + + /** The wrap behavior of the last, partially filled row or column (must be one of [constant LAST_WRAP_ALIGNMENT_INHERIT], [constant LAST_WRAP_ALIGNMENT_BEGIN], [constant LAST_WRAP_ALIGNMENT_CENTER], or [constant LAST_WRAP_ALIGNMENT_END]). */ + get last_wrap_alignment(): int64 + set last_wrap_alignment(value: int64) + + /** If `true`, the [FlowContainer] will arrange its children vertically, rather than horizontally. + * Can't be changed when using [HFlowContainer] and [VFlowContainer]. + */ + get vertical(): boolean + set vertical(value: boolean) + + /** If `true`, reverses fill direction. Horizontal [FlowContainer]s will fill rows bottom to top, vertical [FlowContainer]s will fill columns right to left. + * When using a vertical [FlowContainer] with a right to left [member Control.layout_direction], columns will fill left to right instead. + */ + get reverse_fill(): boolean + set reverse_fill(value: boolean) + } + /** A material that controls how volumetric fog is rendered, to be assigned to a [FogVolume]. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_fogmaterial.html + */ + class FogMaterial extends Material { + constructor(identifier?: any) + /** The density of the [FogVolume]. Denser objects are more opaque, but may suffer from under-sampling artifacts that look like stripes. Negative values can be used to subtract fog from other [FogVolume]s or global volumetric fog. + * + * **Note:** Due to limited precision, [member density] values between `-0.001` and `0.001` (exclusive) act like `0.0`. This does not apply to [member Environment.volumetric_fog_density]. + */ + get density(): float64 + set density(value: float64) + + /** The single-scattering [Color] of the [FogVolume]. Internally, [member albedo] is converted into single-scattering, which is additively blended with other [FogVolume]s and the [member Environment.volumetric_fog_albedo]. */ + get albedo(): Color + set albedo(value: Color) + + /** The [Color] of the light emitted by the [FogVolume]. Emitted light will not cast light or shadows on other objects, but can be useful for modulating the [Color] of the [FogVolume] independently from light sources. */ + get emission(): Color + set emission(value: Color) + + /** The rate by which the height-based fog decreases in density as height increases in world space. A high falloff will result in a sharp transition, while a low falloff will result in a smoother transition. A value of `0.0` results in uniform-density fog. The height threshold is determined by the height of the associated [FogVolume]. */ + get height_falloff(): float64 + set height_falloff(value: float64) + + /** The hardness of the edges of the [FogVolume]. A higher value will result in softer edges, while a lower value will result in harder edges. */ + get edge_fade(): float64 + set edge_fade(value: float64) + + /** The 3D texture that is used to scale the [member density] of the [FogVolume]. This can be used to vary fog density within the [FogVolume] with any kind of static pattern. For animated effects, consider using a custom [url=https://docs.godotengine.org/en/4.4/tutorials/shaders/shader_reference/fog_shader.html]fog shader[/url]. */ + get density_texture(): Texture3D + set density_texture(value: Texture3D) + } + class FogMaterialConversionPlugin extends EditorResourceConversionPlugin { + constructor(identifier?: any) + } + /** A region that contributes to the default volumetric fog from the world environment. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_fogvolume.html + */ + class FogVolume = Record> extends VisualInstance3D { + constructor(identifier?: any) + /** The size of the [FogVolume] when [member shape] is [constant RenderingServer.FOG_VOLUME_SHAPE_ELLIPSOID], [constant RenderingServer.FOG_VOLUME_SHAPE_CONE], [constant RenderingServer.FOG_VOLUME_SHAPE_CYLINDER] or [constant RenderingServer.FOG_VOLUME_SHAPE_BOX]. + * + * **Note:** Thin fog volumes may appear to flicker when the camera moves or rotates. This can be alleviated by increasing [member ProjectSettings.rendering/environment/volumetric_fog/volume_depth] (at a performance cost) or by decreasing [member Environment.volumetric_fog_length] (at no performance cost, but at the cost of lower fog range). Alternatively, the [FogVolume] can be made thicker and use a lower density in the [member material]. + * + * **Note:** If [member shape] is [constant RenderingServer.FOG_VOLUME_SHAPE_CONE] or [constant RenderingServer.FOG_VOLUME_SHAPE_CYLINDER], the cone/cylinder will be adjusted to fit within the size. Non-uniform scaling of cone/cylinder shapes via the [member size] property is not supported, but you can scale the [FogVolume] node instead. + */ + get size(): Vector3 + set size(value: Vector3) + + /** The shape of the [FogVolume]. This can be set to either [constant RenderingServer.FOG_VOLUME_SHAPE_ELLIPSOID], [constant RenderingServer.FOG_VOLUME_SHAPE_CONE], [constant RenderingServer.FOG_VOLUME_SHAPE_CYLINDER], [constant RenderingServer.FOG_VOLUME_SHAPE_BOX] or [constant RenderingServer.FOG_VOLUME_SHAPE_WORLD]. */ + get shape(): int64 + set shape(value: int64) + + /** The [Material] used by the [FogVolume]. Can be either a built-in [FogMaterial] or a custom [ShaderMaterial]. */ + get material(): FogMaterial | ShaderMaterial + set material(value: FogMaterial | ShaderMaterial) + } + class FogVolumeGizmoPlugin extends EditorNode3DGizmoPlugin { + constructor(identifier?: any) + } + /** Abstract base class for fonts and font variations. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_font.html + */ + class Font extends Resource { + constructor(identifier?: any) + /** Returns [TextServer] RID of the font cache for specific variation. */ + find_variation(variation_coordinates: GDictionary, face_index: int64 = 0, strength: float64 = 0, transform: Transform2D = new Transform2D(), spacing_top: int64 = 0, spacing_bottom: int64 = 0, spacing_space: int64 = 0, spacing_glyph: int64 = 0, baseline_offset: float64 = 0): RID + + /** Returns [Array] of valid [Font] [RID]s, which can be passed to the [TextServer] methods. */ + get_rids(): GArray + + /** Returns the total average font height (ascent plus descent) in pixels. + * + * **Note:** Real height of the string is context-dependent and can be significantly different from the value returned by this function. Use it only as rough estimate (e.g. as the height of empty line). + */ + get_height(font_size: int64 = 16): float64 + + /** Returns the average font ascent (number of pixels above the baseline). + * + * **Note:** Real ascent of the string is context-dependent and can be significantly different from the value returned by this function. Use it only as rough estimate (e.g. as the ascent of empty line). + */ + get_ascent(font_size: int64 = 16): float64 + + /** Returns the average font descent (number of pixels below the baseline). + * + * **Note:** Real descent of the string is context-dependent and can be significantly different from the value returned by this function. Use it only as rough estimate (e.g. as the descent of empty line). + */ + get_descent(font_size: int64 = 16): float64 + + /** Returns average pixel offset of the underline below the baseline. + * + * **Note:** Real underline position of the string is context-dependent and can be significantly different from the value returned by this function. Use it only as rough estimate. + */ + get_underline_position(font_size: int64 = 16): float64 + + /** Returns average thickness of the underline. + * + * **Note:** Real underline thickness of the string is context-dependent and can be significantly different from the value returned by this function. Use it only as rough estimate. + */ + get_underline_thickness(font_size: int64 = 16): float64 + + /** Returns font family name. */ + get_font_name(): string + + /** Returns font style name. */ + get_font_style_name(): string + + /** Returns [Dictionary] with OpenType font name strings (localized font names, version, description, license information, sample text, etc.). */ + get_ot_name_strings(): GDictionary + + /** Returns font style flags, see [enum TextServer.FontStyle]. */ + get_font_style(): TextServer.FontStyle + + /** Returns weight (boldness) of the font. A value in the `100...999` range, normal font weight is `400`, bold font weight is `700`. */ + get_font_weight(): int64 + + /** Returns font stretch amount, compared to a normal width. A percentage value between `50%` and `200%`. */ + get_font_stretch(): int64 + + /** Returns the spacing for the given `type` (see [enum TextServer.SpacingType]). */ + get_spacing(spacing: TextServer.SpacingType): int64 + + /** Returns a set of OpenType feature tags. More info: [url=https://docs.microsoft.com/en-us/typography/opentype/spec/featuretags]OpenType feature tags[/url]. */ + get_opentype_features(): GDictionary + + /** Sets LRU cache capacity for `draw_*` methods. */ + set_cache_capacity(single_line: int64, multi_line: int64): void + + /** Returns the size of a bounding box of a single-line string, taking kerning, advance and subpixel positioning into account. See also [method get_multiline_string_size] and [method draw_string]. + * For example, to get the string size as displayed by a single-line Label, use: + * + * + * **Note:** Since kerning, advance and subpixel positioning are taken into account by [method get_string_size], using separate [method get_string_size] calls on substrings of a string then adding the results together will return a different result compared to using a single [method get_string_size] call on the full string. + * + * **Note:** Real height of the string is context-dependent and can be significantly different from the value returned by [method get_height]. + */ + get_string_size(text: string, alignment: HorizontalAlignment = 0, width: float64 = -1, font_size: int64 = 16, justification_flags: TextServer.JustificationFlag = 3, direction: TextServer.Direction = 0, orientation: TextServer.Orientation = 0): Vector2 + + /** Returns the size of a bounding box of a string broken into the lines, taking kerning and advance into account. + * See also [method draw_multiline_string]. + */ + get_multiline_string_size(text: string, alignment: HorizontalAlignment = 0, width: float64 = -1, font_size: int64 = 16, max_lines: int64 = -1, brk_flags: TextServer.LineBreakFlag = 3, justification_flags: TextServer.JustificationFlag = 3, direction: TextServer.Direction = 0, orientation: TextServer.Orientation = 0): Vector2 + + /** Draw [param text] into a canvas item using the font, at a given position, with [param modulate] color, optionally clipping the width and aligning horizontally. [param pos] specifies the baseline, not the top. To draw from the top, *ascent* must be added to the Y axis. + * See also [method CanvasItem.draw_string]. + */ + draw_string(canvas_item: RID, pos: Vector2, text: string, alignment: HorizontalAlignment = 0, width: float64 = -1, font_size: int64 = 16, modulate: Color = new Color(1, 1, 1, 1), justification_flags: TextServer.JustificationFlag = 3, direction: TextServer.Direction = 0, orientation: TextServer.Orientation = 0): void + + /** Breaks [param text] into lines using rules specified by [param brk_flags] and draws it into a canvas item using the font, at a given position, with [param modulate] color, optionally clipping the width and aligning horizontally. [param pos] specifies the baseline of the first line, not the top. To draw from the top, *ascent* must be added to the Y axis. + * See also [method CanvasItem.draw_multiline_string]. + */ + draw_multiline_string(canvas_item: RID, pos: Vector2, text: string, alignment: HorizontalAlignment = 0, width: float64 = -1, font_size: int64 = 16, max_lines: int64 = -1, modulate: Color = new Color(1, 1, 1, 1), brk_flags: TextServer.LineBreakFlag = 3, justification_flags: TextServer.JustificationFlag = 3, direction: TextServer.Direction = 0, orientation: TextServer.Orientation = 0): void + + /** Draw [param text] outline into a canvas item using the font, at a given position, with [param modulate] color and [param size] outline size, optionally clipping the width and aligning horizontally. [param pos] specifies the baseline, not the top. To draw from the top, *ascent* must be added to the Y axis. + * See also [method CanvasItem.draw_string_outline]. + */ + draw_string_outline(canvas_item: RID, pos: Vector2, text: string, alignment: HorizontalAlignment = 0, width: float64 = -1, font_size: int64 = 16, size: int64 = 1, modulate: Color = new Color(1, 1, 1, 1), justification_flags: TextServer.JustificationFlag = 3, direction: TextServer.Direction = 0, orientation: TextServer.Orientation = 0): void + + /** Breaks [param text] to the lines using rules specified by [param brk_flags] and draws text outline into a canvas item using the font, at a given position, with [param modulate] color and [param size] outline size, optionally clipping the width and aligning horizontally. [param pos] specifies the baseline of the first line, not the top. To draw from the top, *ascent* must be added to the Y axis. + * See also [method CanvasItem.draw_multiline_string_outline]. + */ + draw_multiline_string_outline(canvas_item: RID, pos: Vector2, text: string, alignment: HorizontalAlignment = 0, width: float64 = -1, font_size: int64 = 16, max_lines: int64 = -1, size: int64 = 1, modulate: Color = new Color(1, 1, 1, 1), brk_flags: TextServer.LineBreakFlag = 3, justification_flags: TextServer.JustificationFlag = 3, direction: TextServer.Direction = 0, orientation: TextServer.Orientation = 0): void + + /** Returns the size of a character. Does not take kerning into account. + * + * **Note:** Do not use this function to calculate width of the string character by character, use [method get_string_size] or [TextLine] instead. The height returned is the font height (see also [method get_height]) and has no relation to the glyph height. + */ + get_char_size(char: int64, font_size: int64): Vector2 + + /** Draw a single Unicode character [param char] into a canvas item using the font, at a given position, with [param modulate] color. [param pos] specifies the baseline, not the top. To draw from the top, *ascent* must be added to the Y axis. + * + * **Note:** Do not use this function to draw strings character by character, use [method draw_string] or [TextLine] instead. + */ + draw_char(canvas_item: RID, pos: Vector2, char: int64, font_size: int64, modulate: Color = new Color(1, 1, 1, 1)): float64 + + /** Draw a single Unicode character [param char] outline into a canvas item using the font, at a given position, with [param modulate] color and [param size] outline size. [param pos] specifies the baseline, not the top. To draw from the top, *ascent* must be added to the Y axis. + * + * **Note:** Do not use this function to draw strings character by character, use [method draw_string] or [TextLine] instead. + */ + draw_char_outline(canvas_item: RID, pos: Vector2, char: int64, font_size: int64, size: int64 = -1, modulate: Color = new Color(1, 1, 1, 1)): float64 + + /** Returns `true` if a Unicode [param char] is available in the font. */ + has_char(char: int64): boolean + + /** Returns a string containing all the characters available in the font. + * If a given character is included in more than one font data source, it appears only once in the returned string. + */ + get_supported_chars(): string + + /** Returns `true`, if font supports given language ([url=https://en.wikipedia.org/wiki/ISO_639-1]ISO 639[/url] code). */ + is_language_supported(language: string): boolean + + /** Returns `true`, if font supports given script ([url=https://en.wikipedia.org/wiki/ISO_15924]ISO 15924[/url] code). */ + is_script_supported(script: string): boolean + + /** Returns list of OpenType features supported by font. */ + get_supported_feature_list(): GDictionary + + /** Returns list of supported [url=https://docs.microsoft.com/en-us/typography/opentype/spec/dvaraxisreg]variation coordinates[/url], each coordinate is returned as `tag: Vector3i(min_value,max_value,default_value)`. + * Font variations allow for continuous change of glyph characteristics along some given design axis, such as weight, width or slant. + * To print available variation axes of a variable font: + * + * + * **Note:** To set and get variation coordinates of a [FontVariation], use [member FontVariation.variation_opentype]. + */ + get_supported_variation_list(): GDictionary + + /** Returns number of faces in the TrueType / OpenType collection. */ + get_face_count(): int64 + + /** Array of fallback [Font]s to use as a substitute if a glyph is not found in this current [Font]. + * If this array is empty in a [FontVariation], the [member FontVariation.base_font]'s fallbacks are used instead. + */ + get fallbacks(): GArray + set fallbacks(value: GArray) + } + class FontEditorPlugin = Record> extends EditorPlugin { + constructor(identifier?: any) + } + /** Holds font source data and prerendered glyph cache, imported from a dynamic or a bitmap font. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_fontfile.html + */ + class FontFile extends Font { + constructor(identifier?: any) + /** Loads an AngelCode BMFont (.fnt, .font) bitmap font from file [param path]. + * **Warning:** This method should only be used in the editor or in cases when you need to load external fonts at run-time, such as fonts located at the `user://` directory. + */ + load_bitmap_font(path: string): GError + + /** Loads a TrueType (.ttf), OpenType (.otf), WOFF (.woff), WOFF2 (.woff2) or Type 1 (.pfb, .pfm) dynamic font from file [param path]. + * **Warning:** This method should only be used in the editor or in cases when you need to load external fonts at run-time, such as fonts located at the `user://` directory. + */ + load_dynamic_font(path: string): GError + + /** Returns number of the font cache entries. */ + get_cache_count(): int64 + + /** Removes all font cache entries. */ + clear_cache(): void + + /** Removes specified font cache entry. */ + remove_cache(cache_index: int64): void + + /** Returns list of the font sizes in the cache. Each size is [Vector2i] with font size and outline size. */ + get_size_cache_list(cache_index: int64): GArray + + /** Removes all font sizes from the cache entry. */ + clear_size_cache(cache_index: int64): void + + /** Removes specified font size from the cache entry. */ + remove_size_cache(cache_index: int64, size: Vector2i): void + + /** Sets variation coordinates for the specified font cache entry. See [method Font.get_supported_variation_list] for more info. */ + set_variation_coordinates(cache_index: int64, variation_coordinates: GDictionary): void + + /** Returns variation coordinates for the specified font cache entry. See [method Font.get_supported_variation_list] for more info. */ + get_variation_coordinates(cache_index: int64): GDictionary + + /** Sets embolden strength, if is not equal to zero, emboldens the font outlines. Negative values reduce the outline thickness. */ + set_embolden(cache_index: int64, strength: float64): void + + /** Returns embolden strength, if is not equal to zero, emboldens the font outlines. Negative values reduce the outline thickness. */ + get_embolden(cache_index: int64): float64 + + /** Sets 2D transform, applied to the font outlines, can be used for slanting, flipping, and rotating glyphs. */ + set_transform(cache_index: int64, transform: Transform2D): void + + /** Returns 2D transform, applied to the font outlines, can be used for slanting, flipping and rotating glyphs. */ + get_transform(cache_index: int64): Transform2D + + /** Sets the spacing for [param spacing] (see [enum TextServer.SpacingType]) to [param value] in pixels (not relative to the font size). */ + set_extra_spacing(cache_index: int64, spacing: TextServer.SpacingType, value: int64): void + + /** Returns spacing for [param spacing] (see [enum TextServer.SpacingType]) in pixels (not relative to the font size). */ + get_extra_spacing(cache_index: int64, spacing: TextServer.SpacingType): int64 + + /** Sets extra baseline offset (as a fraction of font height). */ + set_extra_baseline_offset(cache_index: int64, baseline_offset: float64): void + + /** Returns extra baseline offset (as a fraction of font height). */ + get_extra_baseline_offset(cache_index: int64): float64 + + /** Sets an active face index in the TrueType / OpenType collection. */ + set_face_index(cache_index: int64, face_index: int64): void + + /** Returns an active face index in the TrueType / OpenType collection. */ + get_face_index(cache_index: int64): int64 + + /** Sets the font ascent (number of pixels above the baseline). */ + set_cache_ascent(cache_index: int64, size: int64, ascent: float64): void + + /** Returns the font ascent (number of pixels above the baseline). */ + get_cache_ascent(cache_index: int64, size: int64): float64 + + /** Sets the font descent (number of pixels below the baseline). */ + set_cache_descent(cache_index: int64, size: int64, descent: float64): void + + /** Returns the font descent (number of pixels below the baseline). */ + get_cache_descent(cache_index: int64, size: int64): float64 + + /** Sets pixel offset of the underline below the baseline. */ + set_cache_underline_position(cache_index: int64, size: int64, underline_position: float64): void + + /** Returns pixel offset of the underline below the baseline. */ + get_cache_underline_position(cache_index: int64, size: int64): float64 + + /** Sets thickness of the underline in pixels. */ + set_cache_underline_thickness(cache_index: int64, size: int64, underline_thickness: float64): void + + /** Returns thickness of the underline in pixels. */ + get_cache_underline_thickness(cache_index: int64, size: int64): float64 + + /** Sets scaling factor of the color bitmap font. */ + set_cache_scale(cache_index: int64, size: int64, scale: float64): void + + /** Returns scaling factor of the color bitmap font. */ + get_cache_scale(cache_index: int64, size: int64): float64 + + /** Returns number of textures used by font cache entry. */ + get_texture_count(cache_index: int64, size: Vector2i): int64 + + /** Removes all textures from font cache entry. + * + * **Note:** This function will not remove glyphs associated with the texture, use [method remove_glyph] to remove them manually. + */ + clear_textures(cache_index: int64, size: Vector2i): void + + /** Removes specified texture from the cache entry. + * + * **Note:** This function will not remove glyphs associated with the texture. Remove them manually using [method remove_glyph]. + */ + remove_texture(cache_index: int64, size: Vector2i, texture_index: int64): void + + /** Sets font cache texture image. */ + set_texture_image(cache_index: int64, size: Vector2i, texture_index: int64, image: Image): void + + /** Returns a copy of the font cache texture image. */ + get_texture_image(cache_index: int64, size: Vector2i, texture_index: int64): Image + + /** Sets array containing glyph packing data. */ + set_texture_offsets(cache_index: int64, size: Vector2i, texture_index: int64, offset: PackedInt32Array | int32[]): void + + /** Returns a copy of the array containing glyph packing data. */ + get_texture_offsets(cache_index: int64, size: Vector2i, texture_index: int64): PackedInt32Array + + /** Returns list of rendered glyphs in the cache entry. */ + get_glyph_list(cache_index: int64, size: Vector2i): PackedInt32Array + + /** Removes all rendered glyph information from the cache entry. + * + * **Note:** This function will not remove textures associated with the glyphs, use [method remove_texture] to remove them manually. + */ + clear_glyphs(cache_index: int64, size: Vector2i): void + + /** Removes specified rendered glyph information from the cache entry. + * + * **Note:** This function will not remove textures associated with the glyphs, use [method remove_texture] to remove them manually. + */ + remove_glyph(cache_index: int64, size: Vector2i, glyph: int64): void + + /** Sets glyph advance (offset of the next glyph). + * + * **Note:** Advance for glyphs outlines is the same as the base glyph advance and is not saved. + */ + set_glyph_advance(cache_index: int64, size: int64, glyph: int64, advance: Vector2): void + + /** Returns glyph advance (offset of the next glyph). + * + * **Note:** Advance for glyphs outlines is the same as the base glyph advance and is not saved. + */ + get_glyph_advance(cache_index: int64, size: int64, glyph: int64): Vector2 + + /** Sets glyph offset from the baseline. */ + set_glyph_offset(cache_index: int64, size: Vector2i, glyph: int64, offset: Vector2): void + + /** Returns glyph offset from the baseline. */ + get_glyph_offset(cache_index: int64, size: Vector2i, glyph: int64): Vector2 + + /** Sets glyph size. */ + set_glyph_size(cache_index: int64, size: Vector2i, glyph: int64, gl_size: Vector2): void + + /** Returns glyph size. */ + get_glyph_size(cache_index: int64, size: Vector2i, glyph: int64): Vector2 + + /** Sets rectangle in the cache texture containing the glyph. */ + set_glyph_uv_rect(cache_index: int64, size: Vector2i, glyph: int64, uv_rect: Rect2): void + + /** Returns rectangle in the cache texture containing the glyph. */ + get_glyph_uv_rect(cache_index: int64, size: Vector2i, glyph: int64): Rect2 + + /** Sets index of the cache texture containing the glyph. */ + set_glyph_texture_idx(cache_index: int64, size: Vector2i, glyph: int64, texture_idx: int64): void + + /** Returns index of the cache texture containing the glyph. */ + get_glyph_texture_idx(cache_index: int64, size: Vector2i, glyph: int64): int64 + + /** Returns list of the kerning overrides. */ + get_kerning_list(cache_index: int64, size: int64): GArray + + /** Removes all kerning overrides. */ + clear_kerning_map(cache_index: int64, size: int64): void + + /** Removes kerning override for the pair of glyphs. */ + remove_kerning(cache_index: int64, size: int64, glyph_pair: Vector2i): void + + /** Sets kerning for the pair of glyphs. */ + set_kerning(cache_index: int64, size: int64, glyph_pair: Vector2i, kerning: Vector2): void + + /** Returns kerning for the pair of glyphs. */ + get_kerning(cache_index: int64, size: int64, glyph_pair: Vector2i): Vector2 + + /** Renders the range of characters to the font cache texture. */ + render_range(cache_index: int64, size: Vector2i, start: int64, end: int64): void + + /** Renders specified glyph to the font cache texture. */ + render_glyph(cache_index: int64, size: Vector2i, index: int64): void + + /** Adds override for [method Font.is_language_supported]. */ + set_language_support_override(language: string, supported: boolean): void + + /** Returns `true` if support override is enabled for the [param language]. */ + get_language_support_override(language: string): boolean + + /** Remove language support override. */ + remove_language_support_override(language: string): void + + /** Returns list of language support overrides. */ + get_language_support_overrides(): PackedStringArray + + /** Adds override for [method Font.is_script_supported]. */ + set_script_support_override(script: string, supported: boolean): void + + /** Returns `true` if support override is enabled for the [param script]. */ + get_script_support_override(script: string): boolean + + /** Removes script support override. */ + remove_script_support_override(script: string): void + + /** Returns list of script support overrides. */ + get_script_support_overrides(): PackedStringArray + + /** Returns the glyph index of a [param char], optionally modified by the [param variation_selector]. */ + get_glyph_index(size: int64, char: int64, variation_selector: int64): int64 + + /** Returns character code associated with [param glyph_index], or `0` if [param glyph_index] is invalid. See [method get_glyph_index]. */ + get_char_from_glyph_index(size: int64, glyph_index: int64): int64 + + /** Contents of the dynamic font source file. */ + get data(): PackedByteArray + set data(value: PackedByteArray | byte[] | ArrayBuffer) + + /** If set to `true`, generate mipmaps for the font textures. */ + get generate_mipmaps(): boolean + set generate_mipmaps(value: boolean) + + /** If set to `true`, embedded font bitmap loading is disabled (bitmap-only and color fonts ignore this property). */ + get disable_embedded_bitmaps(): boolean + set disable_embedded_bitmaps(value: boolean) + + /** Font anti-aliasing mode. */ + get antialiasing(): int64 + set antialiasing(value: int64) + + /** Font family name. */ + get font_name(): string + set font_name(value: string) + + /** Font style name. */ + get style_name(): string + set style_name(value: string) + + /** Font style flags, see [enum TextServer.FontStyle]. */ + get font_style(): int64 + set font_style(value: int64) + + /** Weight (boldness) of the font. A value in the `100...999` range, normal font weight is `400`, bold font weight is `700`. */ + get font_weight(): int64 + set font_weight(value: int64) + + /** Font stretch amount, compared to a normal width. A percentage value between `50%` and `200%`. */ + get font_stretch(): int64 + set font_stretch(value: int64) + + /** Font glyph subpixel positioning mode. Subpixel positioning provides shaper text and better kerning for smaller font sizes, at the cost of higher memory usage and lower font rasterization speed. Use [constant TextServer.SUBPIXEL_POSITIONING_AUTO] to automatically enable it based on the font size. */ + get subpixel_positioning(): int64 + set subpixel_positioning(value: int64) + + /** If set to `true`, when aligning glyphs to the pixel boundaries rounding remainders are accumulated to ensure more uniform glyph distribution. This setting has no effect if subpixel positioning is enabled. */ + get keep_rounding_remainders(): boolean + set keep_rounding_remainders(value: boolean) + + /** If set to `true`, glyphs of all sizes are rendered using single multichannel signed distance field (MSDF) generated from the dynamic font vector data. Since this approach does not rely on rasterizing the font every time its size changes, this allows for resizing the font in real-time without any performance penalty. Text will also not look grainy for [Control]s that are scaled down (or for [Label3D]s viewed from a long distance). As a downside, font hinting is not available with MSDF. The lack of font hinting may result in less crisp and less readable fonts at small sizes. + * + * **Note:** If using font outlines, [member msdf_pixel_range] must be set to at least *twice* the size of the largest font outline. + * + * **Note:** MSDF font rendering does not render glyphs with overlapping shapes correctly. Overlapping shapes are not valid per the OpenType standard, but are still commonly found in many font files, especially those converted by Google Fonts. To avoid issues with overlapping glyphs, consider downloading the font file directly from the type foundry instead of relying on Google Fonts. + */ + get multichannel_signed_distance_field(): boolean + set multichannel_signed_distance_field(value: boolean) + + /** The width of the range around the shape between the minimum and maximum representable signed distance. If using font outlines, [member msdf_pixel_range] must be set to at least *twice* the size of the largest font outline. The default [member msdf_pixel_range] value of `16` allows outline sizes up to `8` to look correct. */ + get msdf_pixel_range(): int64 + set msdf_pixel_range(value: int64) + + /** Source font size used to generate MSDF textures. Higher values allow for more precision, but are slower to render and require more memory. Only increase this value if you notice a visible lack of precision in glyph rendering. */ + get msdf_size(): int64 + set msdf_size(value: int64) + + /** If set to `true`, system fonts can be automatically used as fallbacks. */ + get allow_system_fallback(): boolean + set allow_system_fallback(value: boolean) + + /** If set to `true`, auto-hinting is supported and preferred over font built-in hinting. Used by dynamic fonts only (MSDF fonts don't support hinting). */ + get force_autohinter(): boolean + set force_autohinter(value: boolean) + + /** Font hinting mode. Used by dynamic fonts only. */ + get hinting(): int64 + set hinting(value: int64) + + /** Font oversampling factor. If set to `0.0`, the global oversampling factor is used instead. Used by dynamic fonts only (MSDF fonts ignore oversampling). */ + get oversampling(): float64 + set oversampling(value: float64) + + /** Font size, used only for the bitmap fonts. */ + get fixed_size(): int64 + set fixed_size(value: int64) + + /** Scaling mode, used only for the bitmap fonts with [member fixed_size] greater than zero. */ + get fixed_size_scale_mode(): int64 + set fixed_size_scale_mode(value: int64) + + /** Font OpenType feature set override. */ + get opentype_feature_overrides(): GDictionary + set opentype_feature_overrides(value: GDictionary) + } + /** A variation of a font with additional settings. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_fontvariation.html + */ + class FontVariation extends Font { + constructor(identifier?: any) + /** Sets the spacing for [param spacing] (see [enum TextServer.SpacingType]) to [param value] in pixels (not relative to the font size). */ + set_spacing(spacing: TextServer.SpacingType, value: int64): void + + /** Base font used to create a variation. If not set, default [Theme] font is used. */ + get base_font(): Font + set base_font(value: Font) + + /** Font OpenType variation coordinates. More info: [url=https://docs.microsoft.com/en-us/typography/opentype/spec/dvaraxisreg]OpenType variation tags[/url]. + * + * **Note:** This [Dictionary] uses OpenType tags as keys. Variation axes can be identified both by tags ([int], e.g. `0x77678674`) and names ([String], e.g. `wght`). Some axes might be accessible by multiple names. For example, `wght` refers to the same axis as `weight`. Tags on the other hand are unique. To convert between names and tags, use [method TextServer.name_to_tag] and [method TextServer.tag_to_name]. + * + * **Note:** To get available variation axes of a font, use [method Font.get_supported_variation_list]. + */ + get variation_opentype(): GDictionary + set variation_opentype(value: GDictionary) + + /** Active face index in the TrueType / OpenType collection file. */ + get variation_face_index(): int64 + set variation_face_index(value: int64) + + /** If is not equal to zero, emboldens the font outlines. Negative values reduce the outline thickness. + * + * **Note:** Emboldened fonts might have self-intersecting outlines, which will prevent MSDF fonts and [TextMesh] from working correctly. + */ + get variation_embolden(): float64 + set variation_embolden(value: float64) + + /** 2D transform, applied to the font outlines, can be used for slanting, flipping and rotating glyphs. + * For example, to simulate italic typeface by slanting, apply the following transform `Transform2D(1.0, slant, 0.0, 1.0, 0.0, 0.0)`. + */ + get variation_transform(): Transform2D + set variation_transform(value: Transform2D) + + /** A set of OpenType feature tags. More info: [url=https://docs.microsoft.com/en-us/typography/opentype/spec/featuretags]OpenType feature tags[/url]. */ + get opentype_features(): GDictionary + set opentype_features(value: GDictionary) + + /** Extra spacing between graphical glyphs. */ + get spacing_glyph(): int64 + set spacing_glyph(value: int64) + + /** Extra width of the space glyphs. */ + get spacing_space(): int64 + set spacing_space(value: int64) + + /** Extra spacing at the top of the line in pixels. */ + get spacing_top(): int64 + set spacing_top(value: int64) + + /** Extra spacing at the bottom of the line in pixels. */ + get spacing_bottom(): int64 + set spacing_bottom(value: int64) + + /** Extra baseline offset (as a fraction of font height). */ + get baseline_offset(): float64 + set baseline_offset(value: float64) + } + /** Framebuffer cache manager for Rendering Device based renderers. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_framebuffercacherd.html + */ + class FramebufferCacheRD extends Object { + constructor(identifier?: any) + /** Creates, or obtains a cached, framebuffer. [param textures] lists textures accessed. [param passes] defines the subpasses and texture allocation, if left empty a single pass is created and textures are allocated depending on their usage flags. [param views] defines the number of views used when rendering. */ + static get_cache_multipass(textures: GArray, passes: GArray, views: int64): RID + } + namespace GDExtension { + enum InitializationLevel { + /** The library is initialized at the same time as the core features of the engine. */ + INITIALIZATION_LEVEL_CORE = 0, + + /** The library is initialized at the same time as the engine's servers (such as [RenderingServer] or [PhysicsServer3D]). */ + INITIALIZATION_LEVEL_SERVERS = 1, + + /** The library is initialized at the same time as the engine's scene-related classes. */ + INITIALIZATION_LEVEL_SCENE = 2, + + /** The library is initialized at the same time as the engine's editor classes. Only happens when loading the GDExtension in the editor. */ + INITIALIZATION_LEVEL_EDITOR = 3, + } + } + /** A native library for GDExtension. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_gdextension.html + */ + class GDExtension extends Resource { + constructor(identifier?: any) + /** Returns `true` if this extension's library has been opened. */ + is_library_open(): boolean + + /** Returns the lowest level required for this extension to be properly initialized (see the [enum InitializationLevel] enum). */ + get_minimum_library_initialization_level(): GDExtension.InitializationLevel + } + class GDScriptLanguageServer = Record> extends EditorPlugin { + constructor(identifier?: any) + } + /** @link https://docs.godotengine.org/en/4.4/classes/class_gdscripttextdocument.html */ + class GDScriptTextDocument extends RefCounted { + constructor(identifier?: any) + didOpen(_unnamed_arg0: any): void + didClose(_unnamed_arg0: any): void + didChange(_unnamed_arg0: any): void + willSaveWaitUntil(_unnamed_arg0: any): void + didSave(_unnamed_arg0: any): void + nativeSymbol(_unnamed_arg0: GDictionary): any + documentSymbol(_unnamed_arg0: GDictionary): GArray + completion(_unnamed_arg0: GDictionary): GArray + resolve(_unnamed_arg0: GDictionary): GDictionary + rename(_unnamed_arg0: GDictionary): GDictionary + prepareRename(_unnamed_arg0: GDictionary): any + references(_unnamed_arg0: GDictionary): GArray + foldingRange(_unnamed_arg0: GDictionary): GArray + codeLens(_unnamed_arg0: GDictionary): GArray + documentLink(_unnamed_arg0: GDictionary): GArray + colorPresentation(_unnamed_arg0: GDictionary): GArray + hover(_unnamed_arg0: GDictionary): any + definition(_unnamed_arg0: GDictionary): GArray + declaration(_unnamed_arg0: GDictionary): any + signatureHelp(_unnamed_arg0: GDictionary): any + show_native_symbol_in_editor(_unnamed_arg0: string): void + } + /** @link https://docs.godotengine.org/en/4.4/classes/class_gdscriptworkspace.html */ + class GDScriptWorkspace extends RefCounted { + constructor(identifier?: any) + apply_new_signal(_unnamed_arg0: Object, _unnamed_arg1: string, _unnamed_arg2: PackedStringArray | string[]): void + didDeleteFiles(_unnamed_arg0: GDictionary): void + parse_script(path: string, content: string): GError + parse_local_script(path: string): GError + get_file_path(uri: string): string + get_file_uri(path: string): string + publish_diagnostics(path: string): void + generate_script_api(path: string): GDictionary + } + namespace GLTFAccessor { + enum GLTFAccessorType { + /** Accessor type "SCALAR". For the glTF object model, this can be used to map to a single float, int, or bool value, or a float array. */ + TYPE_SCALAR = 0, + + /** Accessor type "VEC2". For the glTF object model, this maps to "float2", represented in the glTF JSON as an array of two floats. */ + TYPE_VEC2 = 1, + + /** Accessor type "VEC3". For the glTF object model, this maps to "float3", represented in the glTF JSON as an array of three floats. */ + TYPE_VEC3 = 2, + + /** Accessor type "VEC4". For the glTF object model, this maps to "float4", represented in the glTF JSON as an array of four floats. */ + TYPE_VEC4 = 3, + + /** Accessor type "MAT2". For the glTF object model, this maps to "float2x2", represented in the glTF JSON as an array of four floats. */ + TYPE_MAT2 = 4, + + /** Accessor type "MAT3". For the glTF object model, this maps to "float3x3", represented in the glTF JSON as an array of nine floats. */ + TYPE_MAT3 = 5, + + /** Accessor type "MAT4". For the glTF object model, this maps to "float4x4", represented in the glTF JSON as an array of sixteen floats. */ + TYPE_MAT4 = 6, + } + enum GLTFComponentType { + /** Component type "NONE". This is not a valid component type, and is used to indicate that the component type is not set. */ + COMPONENT_TYPE_NONE = 0, + + /** Component type "BYTE". The value is `0x1400` which comes from OpenGL. This indicates data is stored in 1-byte or 8-bit signed integers. This is a core part of the glTF specification. */ + COMPONENT_TYPE_SIGNED_BYTE = 5120, + + /** Component type "UNSIGNED_BYTE". The value is `0x1401` which comes from OpenGL. This indicates data is stored in 1-byte or 8-bit unsigned integers. This is a core part of the glTF specification. */ + COMPONENT_TYPE_UNSIGNED_BYTE = 5121, + + /** Component type "SHORT". The value is `0x1402` which comes from OpenGL. This indicates data is stored in 2-byte or 16-bit signed integers. This is a core part of the glTF specification. */ + COMPONENT_TYPE_SIGNED_SHORT = 5122, + + /** Component type "UNSIGNED_SHORT". The value is `0x1403` which comes from OpenGL. This indicates data is stored in 2-byte or 16-bit unsigned integers. This is a core part of the glTF specification. */ + COMPONENT_TYPE_UNSIGNED_SHORT = 5123, + + /** Component type "INT". The value is `0x1404` which comes from OpenGL. This indicates data is stored in 4-byte or 32-bit signed integers. This is NOT a core part of the glTF specification, and may not be supported by all glTF importers. May be used by some extensions including `KHR_interactivity`. */ + COMPONENT_TYPE_SIGNED_INT = 5124, + + /** Component type "UNSIGNED_INT". The value is `0x1405` which comes from OpenGL. This indicates data is stored in 4-byte or 32-bit unsigned integers. This is a core part of the glTF specification. */ + COMPONENT_TYPE_UNSIGNED_INT = 5125, + + /** Component type "FLOAT". The value is `0x1406` which comes from OpenGL. This indicates data is stored in 4-byte or 32-bit floating-point numbers. This is a core part of the glTF specification. */ + COMPONENT_TYPE_SINGLE_FLOAT = 5126, + + /** Component type "DOUBLE". The value is `0x140A` which comes from OpenGL. This indicates data is stored in 8-byte or 64-bit floating-point numbers. This is NOT a core part of the glTF specification, and may not be supported by all glTF importers. May be used by some extensions including `KHR_interactivity`. */ + COMPONENT_TYPE_DOUBLE_FLOAT = 5130, + + /** Component type "HALF_FLOAT". The value is `0x140B` which comes from OpenGL. This indicates data is stored in 2-byte or 16-bit floating-point numbers. This is NOT a core part of the glTF specification, and may not be supported by all glTF importers. May be used by some extensions including `KHR_interactivity`. */ + COMPONENT_TYPE_HALF_FLOAT = 5131, + + /** Component type "LONG". The value is `0x140E` which comes from OpenGL. This indicates data is stored in 8-byte or 64-bit signed integers. This is NOT a core part of the glTF specification, and may not be supported by all glTF importers. May be used by some extensions including `KHR_interactivity`. */ + COMPONENT_TYPE_SIGNED_LONG = 5134, + + /** Component type "UNSIGNED_LONG". The value is `0x140F` which comes from OpenGL. This indicates data is stored in 8-byte or 64-bit unsigned integers. This is NOT a core part of the glTF specification, and may not be supported by all glTF importers. May be used by some extensions including `KHR_interactivity`. */ + COMPONENT_TYPE_UNSIGNED_LONG = 5135, + } + } + /** Represents a glTF accessor. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_gltfaccessor.html + */ + class GLTFAccessor extends Resource { + constructor(identifier?: any) + /** The index of the buffer view this accessor is referencing. If `-1`, this accessor is not referencing any buffer view. */ + get buffer_view(): int64 + set buffer_view(value: int64) + + /** The offset relative to the start of the buffer view in bytes. */ + get byte_offset(): int64 + set byte_offset(value: int64) + + /** The glTF component type as an enum. See [enum GLTFComponentType] for possible values. Within the core glTF specification, a value of 5125 or "UNSIGNED_INT" must not be used for any accessor that is not referenced by mesh.primitive.indices. */ + get component_type(): int64 + set component_type(value: int64) + + /** Specifies whether integer data values are normalized before usage. */ + get normalized(): boolean + set normalized(value: boolean) + + /** The number of elements referenced by this accessor. */ + get count(): int64 + set count(value: int64) + + /** The glTF accessor type as an enum. Possible values are 0 for "SCALAR", 1 for "VEC2", 2 for "VEC3", 3 for "VEC4", 4 for "MAT2", 5 for "MAT3", and 6 for "MAT4". */ + get accessor_type(): int64 + set accessor_type(value: int64) + + /** The glTF accessor type as an enum. Use [member accessor_type] instead. */ + get type(): int64 + set type(value: int64) + + /** Minimum value of each component in this accessor. */ + get min(): PackedFloat64Array + set min(value: PackedFloat64Array | float64[]) + + /** Maximum value of each component in this accessor. */ + get max(): PackedFloat64Array + set max(value: PackedFloat64Array | float64[]) + + /** Number of deviating accessor values stored in the sparse array. */ + get sparse_count(): int64 + set sparse_count(value: int64) + + /** The index of the buffer view with sparse indices. The referenced buffer view MUST NOT have its target or byteStride properties defined. The buffer view and the optional byteOffset MUST be aligned to the componentType byte length. */ + get sparse_indices_buffer_view(): int64 + set sparse_indices_buffer_view(value: int64) + + /** The offset relative to the start of the buffer view in bytes. */ + get sparse_indices_byte_offset(): int64 + set sparse_indices_byte_offset(value: int64) + + /** The indices component data type as an enum. Possible values are 5121 for "UNSIGNED_BYTE", 5123 for "UNSIGNED_SHORT", and 5125 for "UNSIGNED_INT". */ + get sparse_indices_component_type(): int64 + set sparse_indices_component_type(value: int64) + + /** The index of the bufferView with sparse values. The referenced buffer view MUST NOT have its target or byteStride properties defined. */ + get sparse_values_buffer_view(): int64 + set sparse_values_buffer_view(value: int64) + + /** The offset relative to the start of the bufferView in bytes. */ + get sparse_values_byte_offset(): int64 + set sparse_values_byte_offset(value: int64) + } + /** @link https://docs.godotengine.org/en/4.4/classes/class_gltfanimation.html */ + class GLTFAnimation extends Resource { + constructor(identifier?: any) + /** Gets additional arbitrary data in this [GLTFAnimation] instance. This can be used to keep per-node state data in [GLTFDocumentExtension] classes, which is important because they are stateless. + * The argument should be the [GLTFDocumentExtension] name (does not have to match the extension name in the glTF file), and the return value can be anything you set. If nothing was set, the return value is `null`. + */ + get_additional_data(extension_name: StringName): any + + /** Sets additional arbitrary data in this [GLTFAnimation] instance. This can be used to keep per-node state data in [GLTFDocumentExtension] classes, which is important because they are stateless. + * The first argument should be the [GLTFDocumentExtension] name (does not have to match the extension name in the glTF file), and the second argument can be anything you want. + */ + set_additional_data(extension_name: StringName, additional_data: any): void + + /** The original name of the animation. */ + get original_name(): string + set original_name(value: string) + get loop(): boolean + set loop(value: boolean) + } + /** Represents a glTF buffer view. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_gltfbufferview.html + */ + class GLTFBufferView extends Resource { + constructor(identifier?: any) + /** Loads the buffer view data from the buffer referenced by this buffer view in the given [GLTFState]. Interleaved data with a byte stride is not yet supported by this method. The data is returned as a [PackedByteArray]. */ + load_buffer_view_data(state: GLTFState): PackedByteArray + + /** The index of the buffer this buffer view is referencing. If `-1`, this buffer view is not referencing any buffer. */ + get buffer(): int64 + set buffer(value: int64) + + /** The offset, in bytes, from the start of the buffer to the start of this buffer view. */ + get byte_offset(): int64 + set byte_offset(value: int64) + + /** The length, in bytes, of this buffer view. If `0`, this buffer view is empty. */ + get byte_length(): int64 + set byte_length(value: int64) + + /** The stride, in bytes, between interleaved data. If `-1`, this buffer view is not interleaved. */ + get byte_stride(): int64 + set byte_stride(value: int64) + + /** `true` if the GLTFBufferView's OpenGL GPU buffer type is an `ELEMENT_ARRAY_BUFFER` used for vertex indices (integer constant `34963`). `false` if the buffer type is any other value. See [url=https://github.com/KhronosGroup/glTF-Tutorials/blob/master/gltfTutorial/gltfTutorial_005_BuffersBufferViewsAccessors.md]Buffers, BufferViews, and Accessors[/url] for possible values. This property is set on import and used on export. */ + get indices(): boolean + set indices(value: boolean) + + /** `true` if the GLTFBufferView's OpenGL GPU buffer type is an `ARRAY_BUFFER` used for vertex attributes (integer constant `34962`). `false` if the buffer type is any other value. See [url=https://github.com/KhronosGroup/glTF-Tutorials/blob/master/gltfTutorial/gltfTutorial_005_BuffersBufferViewsAccessors.md]Buffers, BufferViews, and Accessors[/url] for possible values. This property is set on import and used on export. */ + get vertex_attributes(): boolean + set vertex_attributes(value: boolean) + } + /** Represents a glTF camera. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_gltfcamera.html + */ + class GLTFCamera extends Resource { + constructor(identifier?: any) + /** Create a new GLTFCamera instance from the given Godot [Camera3D] node. */ + static from_node(camera_node: Camera3D): GLTFCamera + + /** Converts this GLTFCamera instance into a Godot [Camera3D] node. */ + to_node(): Camera3D + + /** Creates a new GLTFCamera instance by parsing the given [Dictionary]. */ + static from_dictionary(dictionary: GDictionary): GLTFCamera + + /** Serializes this GLTFCamera instance into a [Dictionary]. */ + to_dictionary(): GDictionary + + /** If `true`, the camera is in perspective mode. Otherwise, the camera is in orthographic/orthogonal mode. This maps to glTF's camera `type` property. See [member Camera3D.projection] and the glTF spec for more information. */ + get perspective(): boolean + set perspective(value: boolean) + + /** The FOV of the camera. This class and glTF define the camera FOV in radians, while Godot uses degrees. This maps to glTF's `yfov` property. This value is only used for perspective cameras, when [member perspective] is `true`. */ + get fov(): float64 + set fov(value: float64) + + /** The size of the camera. This class and glTF define the camera size magnitude as a radius in meters, while Godot defines it as a diameter in meters. This maps to glTF's `ymag` property. This value is only used for orthographic/orthogonal cameras, when [member perspective] is `false`. */ + get size_mag(): float64 + set size_mag(value: float64) + + /** The distance to the far culling boundary for this camera relative to its local Z axis, in meters. This maps to glTF's `zfar` property. */ + get depth_far(): float64 + set depth_far(value: float64) + + /** The distance to the near culling boundary for this camera relative to its local Z axis, in meters. This maps to glTF's `znear` property. */ + get depth_near(): float64 + set depth_near(value: float64) + } + namespace GLTFDocument { + enum RootNodeMode { + /** Treat the Godot scene's root node as the root node of the glTF file, and mark it as the single root node via the `GODOT_single_root` glTF extension. This will be parsed the same as [constant ROOT_NODE_MODE_KEEP_ROOT] if the implementation does not support `GODOT_single_root`. */ + ROOT_NODE_MODE_SINGLE_ROOT = 0, + + /** Treat the Godot scene's root node as the root node of the glTF file, but do not mark it as anything special. An extra root node will be generated when importing into Godot. This uses only vanilla glTF features. This is equivalent to the behavior in Godot 4.1 and earlier. */ + ROOT_NODE_MODE_KEEP_ROOT = 1, + + /** Treat the Godot scene's root node as the name of the glTF scene, and add all of its children as root nodes of the glTF file. This uses only vanilla glTF features. This avoids an extra root node, but only the name of the Godot scene's root node will be preserved, as it will not be saved as a node. */ + ROOT_NODE_MODE_MULTI_ROOT = 2, + } + } + /** Class for importing and exporting glTF files in and out of Godot. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_gltfdocument.html + */ + class GLTFDocument extends Resource { + constructor(identifier?: any) + /** Takes a path to a glTF file and imports the data at that file path to the given [GLTFState] object through the [param state] parameter. + * + * **Note:** The [param base_path] tells [method append_from_file] where to find dependencies and can be empty. + */ + append_from_file(path: string, state: GLTFState, flags: int64 = 0, base_path: string = ''): GError + + /** Takes a [PackedByteArray] defining a glTF and imports the data to the given [GLTFState] object through the [param state] parameter. + * + * **Note:** The [param base_path] tells [method append_from_buffer] where to find dependencies and can be empty. + */ + append_from_buffer(bytes: PackedByteArray | byte[] | ArrayBuffer, base_path: string, state: GLTFState, flags: int64 = 0): GError + + /** Takes a Godot Engine scene node and exports it and its descendants to the given [GLTFState] object through the [param state] parameter. */ + append_from_scene(node: Node, state: GLTFState, flags: int64 = 0): GError + + /** Takes a [GLTFState] object through the [param state] parameter and returns a Godot Engine scene node. + * The [param bake_fps] parameter overrides the bake_fps in [param state]. + */ + generate_scene(state: GLTFState, bake_fps: float64 = 30, trimming: boolean = false, remove_immutable_tracks: boolean = true): Node + + /** Takes a [GLTFState] object through the [param state] parameter and returns a glTF [PackedByteArray]. */ + generate_buffer(state: GLTFState): PackedByteArray + + /** Takes a [GLTFState] object through the [param state] parameter and writes a glTF file to the filesystem. + * + * **Note:** The extension of the glTF file determines if it is a .glb binary file or a .gltf text file. + */ + write_to_filesystem(state: GLTFState, path: string): GError + + /** Determines a mapping between the given glTF Object Model [param json_pointer] and the corresponding Godot node path(s) in the generated Godot scene. The details of this mapping are returned in a [GLTFObjectModelProperty] object. Additional mappings can be supplied via the [method GLTFDocumentExtension._export_object_model_property] callback method. */ + static import_object_model_property(state: GLTFState, json_pointer: string): GLTFObjectModelProperty + + /** Determines a mapping between the given Godot [param node_path] and the corresponding glTF Object Model JSON pointer(s) in the generated glTF file. The details of this mapping are returned in a [GLTFObjectModelProperty] object. Additional mappings can be supplied via the [method GLTFDocumentExtension._import_object_model_property] callback method. */ + static export_object_model_property(state: GLTFState, node_path: NodePath | string, godot_node: Node, gltf_node_index: int64): GLTFObjectModelProperty + + /** Registers the given [GLTFDocumentExtension] instance with GLTFDocument. If [param first_priority] is `true`, this extension will be run first. Otherwise, it will be run last. + * + * **Note:** Like GLTFDocument itself, all GLTFDocumentExtension classes must be stateless in order to function properly. If you need to store data, use the `set_additional_data` and `get_additional_data` methods in [GLTFState] or [GLTFNode]. + */ + static register_gltf_document_extension(extension: GLTFDocumentExtension, first_priority: boolean = false): void + + /** Unregisters the given [GLTFDocumentExtension] instance. */ + static unregister_gltf_document_extension(extension: GLTFDocumentExtension): void + + /** Returns a list of all support glTF extensions, including extensions supported directly by the engine, and extensions supported by user plugins registering [GLTFDocumentExtension] classes. + * + * **Note:** If this method is run before a GLTFDocumentExtension is registered, its extensions won't be included in the list. Be sure to only run this method after all extensions are registered. If you run this when the engine starts, consider waiting a frame before calling this method to ensure all extensions are registered. + */ + static get_supported_gltf_extensions(): PackedStringArray + + /** The user-friendly name of the export image format. This is used when exporting the glTF file, including writing to a file and writing to a byte array. + * By default, Godot allows the following options: "None", "PNG", "JPEG", "Lossless WebP", and "Lossy WebP". Support for more image formats can be added in [GLTFDocumentExtension] classes. + */ + get image_format(): string + set image_format(value: string) + + /** If [member image_format] is a lossy image format, this determines the lossy quality of the image. On a range of `0.0` to `1.0`, where `0.0` is the lowest quality and `1.0` is the highest quality. A lossy quality of `1.0` is not the same as lossless. */ + get lossy_quality(): float64 + set lossy_quality(value: float64) + + /** How to process the root node during export. See [enum RootNodeMode] for details. The default and recommended value is [constant ROOT_NODE_MODE_SINGLE_ROOT]. + * + * **Note:** Regardless of how the glTF file is exported, when importing, the root node type and name can be overridden in the scene import settings tab. + */ + get root_node_mode(): int64 + set root_node_mode(value: int64) + } + /** [GLTFDocument] extension class. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_gltfdocumentextension.html + */ + class GLTFDocumentExtension extends Resource { + constructor(identifier?: any) + /** Part of the import process. This method is run first, before all other parts of the import process. + * The return value is used to determine if this [GLTFDocumentExtension] instance should be used for importing a given glTF file. If [constant OK], the import will use this [GLTFDocumentExtension] instance. If not overridden, [constant OK] is returned. + */ + /* gdvirtual */ _import_preflight(state: GLTFState, extensions: PackedStringArray | string[]): GError + + /** Part of the import process. This method is run after [method _import_preflight] and before [method _parse_node_extensions]. + * Returns an array of the glTF extensions supported by this GLTFDocumentExtension class. This is used to validate if a glTF file with required extensions can be loaded. + */ + /* gdvirtual */ _get_supported_extensions(): PackedStringArray + + /** Part of the import process. This method is run after [method _get_supported_extensions] and before [method _import_post_parse]. + * Runs when parsing the node extensions of a GLTFNode. This method can be used to process the extension JSON data into a format that can be used by [method _generate_scene_node]. The return value should be a member of the [enum Error] enum. + */ + /* gdvirtual */ _parse_node_extensions(state: GLTFState, gltf_node: GLTFNode, extensions: GDictionary): GError + + /** Part of the import process. This method is run after [method _parse_node_extensions] and before [method _parse_texture_json]. + * Runs when parsing image data from a glTF file. The data could be sourced from a separate file, a URI, or a buffer, and then is passed as a byte array. + */ + /* gdvirtual */ _parse_image_data(state: GLTFState, image_data: PackedByteArray | byte[] | ArrayBuffer, mime_type: string, ret_image: Image): GError + + /** Returns the file extension to use for saving image data into, for example, `".png"`. If defined, when this extension is used to handle images, and the images are saved to a separate file, the image bytes will be copied to a file with this extension. If this is set, there should be a [ResourceImporter] class able to import the file. If not defined or empty, Godot will save the image into a PNG file. */ + /* gdvirtual */ _get_image_file_extension(): string + + /** Part of the import process. This method is run after [method _parse_image_data] and before [method _generate_scene_node]. + * Runs when parsing the texture JSON from the glTF textures array. This can be used to set the source image index to use as the texture. + */ + /* gdvirtual */ _parse_texture_json(state: GLTFState, texture_json: GDictionary, ret_gltf_texture: GLTFTexture): GError + + /** Part of the import process. Allows GLTFDocumentExtension classes to provide mappings for JSON pointers to glTF properties, as defined by the glTF object model, to properties of nodes in the Godot scene tree. + * Returns a [GLTFObjectModelProperty] instance that defines how the property should be mapped. If your extension can't handle the property, return `null` or an instance without any NodePaths (see [method GLTFObjectModelProperty.has_node_paths]). You should use [method GLTFObjectModelProperty.set_types] to set the types, and [method GLTFObjectModelProperty.append_path_to_property] function is useful for most simple cases. + * In many cases, [param partial_paths] will contain the start of a path, allowing the extension to complete the path. For example, for `/nodes/3/extensions/MY_ext/prop`, Godot will pass you a NodePath that leads to node 3, so the GLTFDocumentExtension class only needs to resolve the last `MY_ext/prop` part of the path. In this example, the extension should check `split.size() > 4 and split[0] == "nodes" and split[2] == "extensions" and split[3] == "MY_ext"` at the start of the function to check if this JSON pointer applies to it, then it can use [param partial_paths] and handle `split[4]`. + */ + /* gdvirtual */ _import_object_model_property(state: GLTFState, split_json_pointer: PackedStringArray | string[], partial_paths: GArray): GLTFObjectModelProperty + + /** Part of the import process. This method is run after [method _parse_node_extensions] and before [method _import_pre_generate]. + * This method can be used to modify any of the data imported so far after parsing each node, but before generating the scene or any of its nodes. + */ + /* gdvirtual */ _import_post_parse(state: GLTFState): GError + + /** Part of the import process. This method is run after [method _import_post_parse] and before [method _generate_scene_node]. + * This method can be used to modify or read from any of the processed data structures, before generating the nodes and then running the final per-node import step. + */ + /* gdvirtual */ _import_pre_generate(state: GLTFState): GError + + /** Part of the import process. This method is run after [method _import_pre_generate] and before [method _import_node]. + * Runs when generating a Godot scene node from a GLTFNode. The returned node will be added to the scene tree. Multiple nodes can be generated in this step if they are added as a child of the returned node. + * + * **Note:** The [param scene_parent] parameter may be `null` if this is the single root node. + */ + /* gdvirtual */ _generate_scene_node(state: GLTFState, gltf_node: GLTFNode, scene_parent: Node): Node3D + + /** Part of the import process. This method is run after [method _generate_scene_node] and before [method _import_post]. + * This method can be used to make modifications to each of the generated Godot scene nodes. + */ + /* gdvirtual */ _import_node(state: GLTFState, gltf_node: GLTFNode, json: GDictionary, node: Node): GError + + /** Part of the import process. This method is run last, after all other parts of the import process. + * This method can be used to modify the final Godot scene generated by the import process. + */ + /* gdvirtual */ _import_post(state: GLTFState, root: Node): GError + + /** Part of the export process. This method is run first, before all other parts of the export process. + * The return value is used to determine if this [GLTFDocumentExtension] instance should be used for exporting a given glTF file. If [constant OK], the export will use this [GLTFDocumentExtension] instance. If not overridden, [constant OK] is returned. + */ + /* gdvirtual */ _export_preflight(state: GLTFState, root: Node): GError + + /** Part of the export process. This method is run after [method _export_preflight] and before [method _export_post_convert]. + * Runs when converting the data from a Godot scene node. This method can be used to process the Godot scene node data into a format that can be used by [method _export_node]. + */ + /* gdvirtual */ _convert_scene_node(state: GLTFState, gltf_node: GLTFNode, scene_node: Node): void + + /** Part of the export process. This method is run after [method _convert_scene_node] and before [method _export_preserialize]. + * This method can be used to modify the converted node data structures before serialization with any additional data from the scene tree. + */ + /* gdvirtual */ _export_post_convert(state: GLTFState, root: Node): GError + + /** Part of the export process. This method is run after [method _export_post_convert] and before [method _get_saveable_image_formats]. + * This method can be used to alter the state before performing serialization. It runs every time when generating a buffer with [method GLTFDocument.generate_buffer] or writing to the file system with [method GLTFDocument.write_to_filesystem]. + */ + /* gdvirtual */ _export_preserialize(state: GLTFState): GError + + /** Part of the export process. Allows GLTFDocumentExtension classes to provide mappings for properties of nodes in the Godot scene tree, to JSON pointers to glTF properties, as defined by the glTF object model. + * Returns a [GLTFObjectModelProperty] instance that defines how the property should be mapped. If your extension can't handle the property, return `null` or an instance without any JSON pointers (see [method GLTFObjectModelProperty.has_json_pointers]). You should use [method GLTFObjectModelProperty.set_types] to set the types, and set the JSON pointer(s) using the [member GLTFObjectModelProperty.json_pointers] property. + * The parameters provide context for the property, including the NodePath, the Godot node, the GLTF node index, and the target object. The [param target_object] will be equal to [param godot_node] if no sub-object can be found, otherwise it will point to a sub-object. For example, if the path is `^"A/B/C/MeshInstance3D:mesh:surface_0/material:emission_intensity"`, it will get the node, then the mesh, and then the material, so [param target_object] will be the [Material] resource, and [param target_depth] will be 2 because 2 levels were traversed to get to the target. + */ + /* gdvirtual */ _export_object_model_property(state: GLTFState, node_path: NodePath | string, godot_node: Node, gltf_node_index: int64, target_object: Object, target_depth: int64): GLTFObjectModelProperty + + /** Part of the export process. This method is run after [method _convert_scene_node] and before [method _export_node]. + * Returns an array of the image formats that can be saved/exported by this extension. This extension will only be selected as the image exporter if the [GLTFDocument]'s [member GLTFDocument.image_format] is in this array. If this [GLTFDocumentExtension] is selected as the image exporter, one of the [method _save_image_at_path] or [method _serialize_image_to_bytes] methods will run next, otherwise [method _export_node] will run next. If the format name contains `"Lossy"`, the lossy quality slider will be displayed. + */ + /* gdvirtual */ _get_saveable_image_formats(): PackedStringArray + + /** Part of the export process. This method is run after [method _get_saveable_image_formats] and before [method _serialize_texture_json]. + * This method is run when embedding images in the glTF file. When images are saved separately, [method _save_image_at_path] runs instead. Note that these methods only run when this [GLTFDocumentExtension] is selected as the image exporter. + * This method must set the image MIME type in the [param image_dict] with the `"mimeType"` key. For example, for a PNG image, it would be set to `"image/png"`. The return value must be a [PackedByteArray] containing the image data. + */ + /* gdvirtual */ _serialize_image_to_bytes(state: GLTFState, image: Image, image_dict: GDictionary, image_format: string, lossy_quality: float64): PackedByteArray + + /** Part of the export process. This method is run after [method _get_saveable_image_formats] and before [method _serialize_texture_json]. + * This method is run when saving images separately from the glTF file. When images are embedded, [method _serialize_image_to_bytes] runs instead. Note that these methods only run when this [GLTFDocumentExtension] is selected as the image exporter. + */ + /* gdvirtual */ _save_image_at_path(state: GLTFState, image: Image, file_path: string, image_format: string, lossy_quality: float64): GError + + /** Part of the export process. This method is run after [method _save_image_at_path] or [method _serialize_image_to_bytes], and before [method _export_node]. Note that this method only runs when this [GLTFDocumentExtension] is selected as the image exporter. + * This method can be used to set up the extensions for the texture JSON by editing [param texture_json]. The extension must also be added as used extension with [method GLTFState.add_used_extension], be sure to set `required` to `true` if you are not providing a fallback. + */ + /* gdvirtual */ _serialize_texture_json(state: GLTFState, texture_json: GDictionary, gltf_texture: GLTFTexture, image_format: string): GError + + /** Part of the export process. This method is run after [method _get_saveable_image_formats] and before [method _export_post]. If this [GLTFDocumentExtension] is used for exporting images, this runs after [method _serialize_texture_json]. + * This method can be used to modify the final JSON of each node. Data should be primarily stored in [param gltf_node] prior to serializing the JSON, but the original Godot [Node] is also provided if available. [param node] may be `null` if not available, such as when exporting glTF data not generated from a Godot scene. + */ + /* gdvirtual */ _export_node(state: GLTFState, gltf_node: GLTFNode, json: GDictionary, node: Node): GError + + /** Part of the export process. This method is run last, after all other parts of the export process. + * This method can be used to modify the final JSON of the generated glTF file. + */ + /* gdvirtual */ _export_post(state: GLTFState): GError + } + /** @link https://docs.godotengine.org/en/4.4/classes/class_gltfdocumentextensionconvertimportermesh.html */ + class GLTFDocumentExtensionConvertImporterMesh extends GLTFDocumentExtension { + constructor(identifier?: any) + } + class GLTFDocumentExtensionPhysics extends GLTFDocumentExtension { + constructor(identifier?: any) + } + class GLTFDocumentExtensionTextureKTX extends GLTFDocumentExtension { + constructor(identifier?: any) + } + class GLTFDocumentExtensionTextureWebP extends GLTFDocumentExtension { + constructor(identifier?: any) + } + /** Represents a glTF light. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_gltflight.html + */ + class GLTFLight extends Resource { + constructor(identifier?: any) + /** Create a new GLTFLight instance from the given Godot [Light3D] node. */ + static from_node(light_node: Light3D): GLTFLight + + /** Converts this GLTFLight instance into a Godot [Light3D] node. */ + to_node(): Light3D + + /** Creates a new GLTFLight instance by parsing the given [Dictionary]. */ + static from_dictionary(dictionary: GDictionary): GLTFLight + + /** Serializes this GLTFLight instance into a [Dictionary]. */ + to_dictionary(): GDictionary + get_additional_data(extension_name: StringName): any + set_additional_data(extension_name: StringName, additional_data: any): void + + /** The [Color] of the light. Defaults to white. A black color causes the light to have no effect. */ + get color(): Color + set color(value: Color) + + /** The intensity of the light. This is expressed in candelas (lumens per steradian) for point and spot lights, and lux (lumens per m²) for directional lights. When creating a Godot light, this value is converted to a unitless multiplier. */ + get intensity(): float64 + set intensity(value: float64) + + /** The type of the light. The values accepted by Godot are "point", "spot", and "directional", which correspond to Godot's [OmniLight3D], [SpotLight3D], and [DirectionalLight3D] respectively. */ + get light_type(): string + set light_type(value: string) + + /** The range of the light, beyond which the light has no effect. glTF lights with no range defined behave like physical lights (which have infinite range). When creating a Godot light, the range is clamped to 4096. */ + get range(): float64 + set range(value: float64) + + /** The inner angle of the cone in a spotlight. Must be less than or equal to the outer cone angle. + * Within this angle, the light is at full brightness. Between the inner and outer cone angles, there is a transition from full brightness to zero brightness. When creating a Godot [SpotLight3D], the ratio between the inner and outer cone angles is used to calculate the attenuation of the light. + */ + get inner_cone_angle(): float64 + set inner_cone_angle(value: float64) + + /** The outer angle of the cone in a spotlight. Must be greater than or equal to the inner angle. + * At this angle, the light drops off to zero brightness. Between the inner and outer cone angles, there is a transition from full brightness to zero brightness. If this angle is a half turn, then the spotlight emits in all directions. When creating a Godot [SpotLight3D], the outer cone angle is used as the angle of the spotlight. + */ + get outer_cone_angle(): float64 + set outer_cone_angle(value: float64) + } + /** GLTFMesh represents a glTF mesh. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_gltfmesh.html + */ + class GLTFMesh extends Resource { + constructor(identifier?: any) + /** Gets additional arbitrary data in this [GLTFMesh] instance. This can be used to keep per-node state data in [GLTFDocumentExtension] classes, which is important because they are stateless. + * The argument should be the [GLTFDocumentExtension] name (does not have to match the extension name in the glTF file), and the return value can be anything you set. If nothing was set, the return value is `null`. + */ + get_additional_data(extension_name: StringName): any + + /** Sets additional arbitrary data in this [GLTFMesh] instance. This can be used to keep per-node state data in [GLTFDocumentExtension] classes, which is important because they are stateless. + * The first argument should be the [GLTFDocumentExtension] name (does not have to match the extension name in the glTF file), and the second argument can be anything you want. + */ + set_additional_data(extension_name: StringName, additional_data: any): void + + /** The original name of the mesh. */ + get original_name(): string + set original_name(value: string) + + /** The [ImporterMesh] object representing the mesh itself. */ + get mesh(): Object + set mesh(value: Object) + + /** An array of floats representing the blend weights of the mesh. */ + get blend_weights(): PackedFloat32Array + set blend_weights(value: PackedFloat32Array | float32[]) + + /** An array of Material objects representing the materials used in the mesh. */ + get instance_materials(): GArray + set instance_materials(value: GArray) + } + /** glTF node class. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_gltfnode.html + */ + class GLTFNode extends Resource { + constructor(identifier?: any) + /** Appends the given child node index to the [member children] array. */ + append_child_index(child_index: int64): void + + /** Gets additional arbitrary data in this [GLTFNode] instance. This can be used to keep per-node state data in [GLTFDocumentExtension] classes, which is important because they are stateless. + * The argument should be the [GLTFDocumentExtension] name (does not have to match the extension name in the glTF file), and the return value can be anything you set. If nothing was set, the return value is `null`. + */ + get_additional_data(extension_name: StringName): any + + /** Sets additional arbitrary data in this [GLTFNode] instance. This can be used to keep per-node state data in [GLTFDocumentExtension] classes, which is important because they are stateless. + * The first argument should be the [GLTFDocumentExtension] name (does not have to match the extension name in the glTF file), and the second argument can be anything you want. + */ + set_additional_data(extension_name: StringName, additional_data: any): void + + /** Returns the [NodePath] that this GLTF node will have in the Godot scene tree after being imported. This is useful when importing glTF object model pointers with [GLTFObjectModelProperty], for handling extensions such as `KHR_animation_pointer` or `KHR_interactivity`. + * If [param handle_skeletons] is `true`, paths to skeleton bone glTF nodes will be resolved properly. For example, a path that would be `^"A/B/C/Bone1/Bone2/Bone3"` if `false` will become `^"A/B/C/Skeleton3D:Bone3"`. + */ + get_scene_node_path(gltf_state: GLTFState, handle_skeletons: boolean = true): NodePath + + /** The original name of the node. */ + get original_name(): string + set original_name(value: string) + + /** The index of the parent node in the [GLTFState]. If -1, this node is a root node. */ + get parent(): int64 + set parent(value: int64) + + /** How deep into the node hierarchy this node is. A root node will have a height of 0, its children will have a height of 1, and so on. If -1, the height has not been calculated. */ + get height(): int64 + set height(value: int64) + + /** The transform of the glTF node relative to its parent. This property is usually unused since the position, rotation, and scale properties are preferred. */ + get xform(): Transform3D + set xform(value: Transform3D) + + /** If this glTF node is a mesh, the index of the [GLTFMesh] in the [GLTFState] that describes the mesh's properties. If -1, this node is not a mesh. */ + get mesh(): int64 + set mesh(value: int64) + + /** If this glTF node is a camera, the index of the [GLTFCamera] in the [GLTFState] that describes the camera's properties. If -1, this node is not a camera. */ + get camera(): int64 + set camera(value: int64) + + /** If this glTF node has a skin, the index of the [GLTFSkin] in the [GLTFState] that describes the skin's properties. If -1, this node does not have a skin. */ + get skin(): int64 + set skin(value: int64) + + /** If this glTF node has a skeleton, the index of the [GLTFSkeleton] in the [GLTFState] that describes the skeleton's properties. If -1, this node does not have a skeleton. */ + get skeleton(): int64 + set skeleton(value: int64) + + /** The position of the glTF node relative to its parent. */ + get position(): Vector3 + set position(value: Vector3) + + /** The rotation of the glTF node relative to its parent. */ + get rotation(): Quaternion + set rotation(value: Quaternion) + + /** The scale of the glTF node relative to its parent. */ + get scale(): Vector3 + set scale(value: Vector3) + + /** The indices of the child nodes in the [GLTFState]. If this glTF node has no children, this will be an empty array. */ + get children(): PackedInt32Array + set children(value: PackedInt32Array | int32[]) + + /** If this glTF node is a light, the index of the [GLTFLight] in the [GLTFState] that describes the light's properties. If -1, this node is not a light. */ + get light(): int64 + set light(value: int64) + } + namespace GLTFObjectModelProperty { + enum GLTFObjectModelType { + /** Unknown or not set object model type. If the object model type is set to this value, the real type still needs to be determined. */ + GLTF_OBJECT_MODEL_TYPE_UNKNOWN = 0, + + /** Object model type "bool". Represented in the glTF JSON as a boolean, and encoded in a [GLTFAccessor] as "SCALAR". When encoded in an accessor, a value of `0` is `false`, and any other value is `true`. */ + GLTF_OBJECT_MODEL_TYPE_BOOL = 1, + + /** Object model type "float". Represented in the glTF JSON as a number, and encoded in a [GLTFAccessor] as "SCALAR". */ + GLTF_OBJECT_MODEL_TYPE_FLOAT = 2, + + /** Object model type "float[lb][rb]". Represented in the glTF JSON as an array of numbers, and encoded in a [GLTFAccessor] as "SCALAR". */ + GLTF_OBJECT_MODEL_TYPE_FLOAT_ARRAY = 3, + + /** Object model type "float2". Represented in the glTF JSON as an array of two numbers, and encoded in a [GLTFAccessor] as "VEC2". */ + GLTF_OBJECT_MODEL_TYPE_FLOAT2 = 4, + + /** Object model type "float3". Represented in the glTF JSON as an array of three numbers, and encoded in a [GLTFAccessor] as "VEC3". */ + GLTF_OBJECT_MODEL_TYPE_FLOAT3 = 5, + + /** Object model type "float4". Represented in the glTF JSON as an array of four numbers, and encoded in a [GLTFAccessor] as "VEC4". */ + GLTF_OBJECT_MODEL_TYPE_FLOAT4 = 6, + + /** Object model type "float2x2". Represented in the glTF JSON as an array of four numbers, and encoded in a [GLTFAccessor] as "MAT2". */ + GLTF_OBJECT_MODEL_TYPE_FLOAT2X2 = 7, + + /** Object model type "float3x3". Represented in the glTF JSON as an array of nine numbers, and encoded in a [GLTFAccessor] as "MAT3". */ + GLTF_OBJECT_MODEL_TYPE_FLOAT3X3 = 8, + + /** Object model type "float4x4". Represented in the glTF JSON as an array of sixteen numbers, and encoded in a [GLTFAccessor] as "MAT4". */ + GLTF_OBJECT_MODEL_TYPE_FLOAT4X4 = 9, + + /** Object model type "int". Represented in the glTF JSON as a number, and encoded in a [GLTFAccessor] as "SCALAR". The range of values is limited to signed integers. For `KHR_interactivity`, only 32-bit integers are supported. */ + GLTF_OBJECT_MODEL_TYPE_INT = 10, + } + } + /** Describes how to access a property as defined in the glTF object model. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_gltfobjectmodelproperty.html + */ + class GLTFObjectModelProperty extends RefCounted { + constructor(identifier?: any) + /** Appends a [NodePath] to [member node_paths]. This can be used by [GLTFDocumentExtension] classes to define how a glTF object model property maps to a Godot property, or multiple Godot properties. Prefer using [method append_path_to_property] for simple cases. Be sure to also call [method set_types] once (the order does not matter). */ + append_node_path(node_path: NodePath | string): void + + /** High-level wrapper over [method append_node_path] that handles the most common cases. It constructs a new [NodePath] using [param node_path] as a base and appends [param prop_name] to the subpath. Be sure to also call [method set_types] once (the order does not matter). */ + append_path_to_property(node_path: NodePath | string, prop_name: StringName): void + + /** The GLTF accessor type associated with this property's [member object_model_type]. See [member GLTFAccessor.accessor_type] for possible values, and see [enum GLTFObjectModelType] for how the object model type maps to accessor types. */ + get_accessor_type(): GLTFAccessor.GLTFAccessorType + + /** Returns `true` if [member node_paths] is not empty. This is used during import to determine if a [GLTFObjectModelProperty] can handle converting a glTF object model property to a Godot property. */ + has_node_paths(): boolean + + /** Returns `true` if [member json_pointers] is not empty. This is used during export to determine if a [GLTFObjectModelProperty] can handle converting a Godot property to a glTF object model property. */ + has_json_pointers(): boolean + + /** Sets the [member variant_type] and [member object_model_type] properties. This is a convenience method to set both properties at once, since they are almost always known at the same time. This method should be called once. Calling it again with the same values will have no effect. */ + set_types(variant_type: Variant.Type, obj_model_type: GLTFObjectModelProperty.GLTFObjectModelType): void + + /** If set, this [Expression] will be used to convert the property value from the glTF object model to the value expected by the Godot property. This is useful when the glTF object model uses a different unit system, or when the data needs to be transformed in some way. If `null`, the value will be copied as-is. */ + get gltf_to_godot_expression(): Expression + set gltf_to_godot_expression(value: Expression) + + /** If set, this [Expression] will be used to convert the property value from the Godot property to the value expected by the glTF object model. This is useful when the glTF object model uses a different unit system, or when the data needs to be transformed in some way. If `null`, the value will be copied as-is. */ + get godot_to_gltf_expression(): Expression + set godot_to_gltf_expression(value: Expression) + + /** An array of [NodePath]s that point to a property, or multiple properties, in the Godot scene tree. On import, this will either be set by [GLTFDocument], or by a [GLTFDocumentExtension] class. For simple cases, use [method append_path_to_property] to add properties to this array. + * In most cases [member node_paths] will only have one item, but in some cases a single glTF JSON pointer will map to multiple Godot properties. For example, a [GLTFCamera] or [GLTFLight] used on multiple glTF nodes will be represented by multiple Godot nodes. + */ + get node_paths(): GArray + set node_paths(value: GArray) + + /** The type of data stored in the glTF file as defined by the object model. This is a superset of the available accessor types, and determines the accessor type. See [enum GLTFObjectModelType] for possible values. */ + get object_model_type(): int64 + set object_model_type(value: int64) + + /** The glTF object model JSON pointers used to identify the property in the glTF object model. In most cases, there will be only one item in this array, but niche cases may require multiple pointers. The items are themselves arrays which represent the JSON pointer split into its components. */ + get json_pointers(): PackedStringArray + set json_pointers(value: PackedStringArray | string[]) + + /** The type of data stored in the Godot property. This is the type of the property that the [member node_paths] point to. */ + get variant_type(): int64 + set variant_type(value: int64) + } + /** Represents a glTF physics body. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_gltfphysicsbody.html + */ + class GLTFPhysicsBody extends Resource { + constructor(identifier?: any) + /** Creates a new GLTFPhysicsBody instance from the given Godot [CollisionObject3D] node. */ + static from_node(body_node: CollisionObject3D): GLTFPhysicsBody + + /** Converts this GLTFPhysicsBody instance into a Godot [CollisionObject3D] node. */ + to_node(): CollisionObject3D + + /** Creates a new GLTFPhysicsBody instance by parsing the given [Dictionary] in the `OMI_physics_body` glTF extension format. */ + static from_dictionary(dictionary: GDictionary): GLTFPhysicsBody + + /** Serializes this GLTFPhysicsBody instance into a [Dictionary]. It will be in the format expected by the `OMI_physics_body` glTF extension. */ + to_dictionary(): GDictionary + + /** The type of the body. When importing, this controls what type of [CollisionObject3D] node Godot should generate. Valid values are "static", "animatable", "character", "rigid", "vehicle", and "trigger". When exporting, this will be squashed down to one of "static", "kinematic", or "dynamic" motion types, or the "trigger" property. */ + get body_type(): string + set body_type(value: string) + + /** The mass of the physics body, in kilograms. This is only used when the body type is "rigid" or "vehicle". */ + get mass(): float64 + set mass(value: float64) + + /** The linear velocity of the physics body, in meters per second. This is only used when the body type is "rigid" or "vehicle". */ + get linear_velocity(): Vector3 + set linear_velocity(value: Vector3) + + /** The angular velocity of the physics body, in radians per second. This is only used when the body type is "rigid" or "vehicle". */ + get angular_velocity(): Vector3 + set angular_velocity(value: Vector3) + + /** The center of mass of the body, in meters. This is in local space relative to the body. By default, the center of the mass is the body's origin. */ + get center_of_mass(): Vector3 + set center_of_mass(value: Vector3) + + /** The inertia strength of the physics body, in kilogram meter squared (kg⋅m²). This represents the inertia around the principle axes, the diagonal of the inertia tensor matrix. This is only used when the body type is "rigid" or "vehicle". + * When converted to a Godot [RigidBody3D] node, if this value is zero, then the inertia will be calculated automatically. + */ + get inertia_diagonal(): Vector3 + set inertia_diagonal(value: Vector3) + + /** The inertia orientation of the physics body. This defines the rotation of the inertia's principle axes relative to the object's local axes. This is only used when the body type is "rigid" or "vehicle" and [member inertia_diagonal] is set to a non-zero value. */ + get inertia_orientation(): Quaternion + set inertia_orientation(value: Quaternion) + + /** The inertia tensor of the physics body, in kilogram meter squared (kg⋅m²). This is only used when the body type is "rigid" or "vehicle". + * When converted to a Godot [RigidBody3D] node, if this value is zero, then the inertia will be calculated automatically. + */ + get inertia_tensor(): Basis + set inertia_tensor(value: Basis) + } + /** Represents a glTF physics shape. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_gltfphysicsshape.html + */ + class GLTFPhysicsShape extends Resource { + constructor(identifier?: any) + /** Creates a new GLTFPhysicsShape instance from the given Godot [CollisionShape3D] node. */ + static from_node(shape_node: CollisionShape3D): GLTFPhysicsShape + + /** Converts this GLTFPhysicsShape instance into a Godot [CollisionShape3D] node. */ + to_node(cache_shapes: boolean = false): CollisionShape3D + + /** Creates a new GLTFPhysicsShape instance from the given Godot [Shape3D] resource. */ + static from_resource(shape_resource: Shape3D): GLTFPhysicsShape + + /** Converts this GLTFPhysicsShape instance into a Godot [Shape3D] resource. */ + to_resource(cache_shapes: boolean = false): Shape3D + + /** Creates a new GLTFPhysicsShape instance by parsing the given [Dictionary]. */ + static from_dictionary(dictionary: GDictionary): GLTFPhysicsShape + + /** Serializes this GLTFPhysicsShape instance into a [Dictionary] in the format defined by `OMI_physics_shape`. */ + to_dictionary(): GDictionary + + /** The type of shape this shape represents. Valid values are "box", "capsule", "cylinder", "sphere", "hull", and "trimesh". */ + get shape_type(): string + set shape_type(value: string) + + /** The size of the shape, in meters. This is only used when the shape type is "box", and it represents the "diameter" of the box. This value should not be negative. */ + get size(): Vector3 + set size(value: Vector3) + + /** The radius of the shape, in meters. This is only used when the shape type is "capsule", "cylinder", or "sphere". This value should not be negative. */ + get radius(): float64 + set radius(value: float64) + + /** The height of the shape, in meters. This is only used when the shape type is "capsule" or "cylinder". This value should not be negative, and for "capsule" it should be at least twice the radius. */ + get height(): float64 + set height(value: float64) + + /** If `true`, indicates that this shape is a trigger. For Godot, this means that the shape should be a child of an Area3D node. + * This is the only variable not used in the [method to_node] method, it's intended to be used alongside when deciding where to add the generated node as a child. + */ + get is_trigger(): boolean + set is_trigger(value: boolean) + + /** The index of the shape's mesh in the glTF file. This is only used when the shape type is "hull" (convex hull) or "trimesh" (concave trimesh). */ + get mesh_index(): int64 + set mesh_index(value: int64) + + /** The [ImporterMesh] resource of the shape. This is only used when the shape type is "hull" (convex hull) or "trimesh" (concave trimesh). */ + get importer_mesh(): ImporterMesh + set importer_mesh(value: ImporterMesh) + } + /** @link https://docs.godotengine.org/en/4.4/classes/class_gltfskeleton.html */ + class GLTFSkeleton extends Resource { + constructor(identifier?: any) + get_godot_skeleton(): Skeleton3D + get_bone_attachment_count(): int64 + get_bone_attachment(idx: int64): BoneAttachment3D + get joints(): PackedInt32Array + set joints(value: PackedInt32Array | int32[]) + get roots(): PackedInt32Array + set roots(value: PackedInt32Array | int32[]) + get unique_names(): GArray + set unique_names(value: GArray) + get godot_bone_node(): GDictionary + set godot_bone_node(value: GDictionary) + } + /** @link https://docs.godotengine.org/en/4.4/classes/class_gltfskin.html */ + class GLTFSkin extends Resource { + constructor(identifier?: any) + get skin_root(): int64 + set skin_root(value: int64) + get joints_original(): PackedInt32Array + set joints_original(value: PackedInt32Array | int32[]) + get inverse_binds(): GArray + set inverse_binds(value: GArray) + get joints(): PackedInt32Array + set joints(value: PackedInt32Array | int32[]) + get non_joints(): PackedInt32Array + set non_joints(value: PackedInt32Array | int32[]) + get roots(): PackedInt32Array + set roots(value: PackedInt32Array | int32[]) + get skeleton(): int64 + set skeleton(value: int64) + get joint_i_to_bone_i(): GDictionary + set joint_i_to_bone_i(value: GDictionary) + get joint_i_to_name(): GDictionary + set joint_i_to_name(value: GDictionary) + get godot_skin(): Skin + set godot_skin(value: Skin) + } + /** Archived glTF extension for specular/glossy materials. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_gltfspecgloss.html + */ + class GLTFSpecGloss extends Resource { + constructor(identifier?: any) + /** The diffuse texture. */ + get diffuse_img(): Object + set diffuse_img(value: Object) + + /** The reflected diffuse factor of the material. */ + get diffuse_factor(): Color + set diffuse_factor(value: Color) + + /** The glossiness or smoothness of the material. */ + get gloss_factor(): float64 + set gloss_factor(value: float64) + + /** The specular RGB color of the material. The alpha channel is unused. */ + get specular_factor(): Color + set specular_factor(value: Color) + + /** The specular-glossiness texture. */ + get spec_gloss_img(): Object + set spec_gloss_img(value: Object) + } + /** Represents all data of a glTF file. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_gltfstate.html + */ + class GLTFState extends Resource { + /** Discards all embedded textures and uses untextured materials. */ + static readonly HANDLE_BINARY_DISCARD_TEXTURES = 0 + + /** Extracts embedded textures to be reimported and compressed. Editor only. Acts as uncompressed at runtime. */ + static readonly HANDLE_BINARY_EXTRACT_TEXTURES = 1 + + /** Embeds textures VRAM compressed with Basis Universal into the generated scene. */ + static readonly HANDLE_BINARY_EMBED_AS_BASISU = 2 + + /** Embeds textures compressed losslessly into the generated scene, matching old behavior. */ + static readonly HANDLE_BINARY_EMBED_AS_UNCOMPRESSED = 3 + constructor(identifier?: any) + + /** Appends an extension to the list of extensions used by this glTF file during serialization. If [param required] is `true`, the extension will also be added to the list of required extensions. Do not run this in [method GLTFDocumentExtension._export_post], as that stage is too late to add extensions. The final list is sorted alphabetically. */ + add_used_extension(extension_name: string, required: boolean): void + + /** Appends the given byte array data to the buffers and creates a [GLTFBufferView] for it. The index of the destination [GLTFBufferView] is returned. If [param deduplication] is `true`, the buffers will first be searched for duplicate data, otherwise new bytes will always be appended. */ + append_data_to_buffers(data: PackedByteArray | byte[] | ArrayBuffer, deduplication: boolean): int64 + + /** Append the given [GLTFNode] to the state, and return its new index. This can be used to export one Godot node as multiple glTF nodes, or inject new glTF nodes at import time. On import, this must be called before [method GLTFDocumentExtension._generate_scene_node] finishes for the parent node. On export, this must be called before [method GLTFDocumentExtension._export_node] runs for the parent node. + * The [param godot_scene_node] parameter is the Godot scene node that corresponds to this glTF node. This is highly recommended to be set to a valid node, but may be `null` if there is no corresponding Godot scene node. One Godot scene node may be used for multiple glTF nodes, so if exporting multiple glTF nodes for one Godot scene node, use the same Godot scene node for each. + * The [param parent_node_index] parameter is the index of the parent [GLTFNode] in the state. If `-1`, the node will be a root node, otherwise the new node will be added to the parent's list of children. The index will also be written to the [member GLTFNode.parent] property of the new node. + */ + append_gltf_node(gltf_node: GLTFNode, godot_scene_node: Node, parent_node_index: int64): int64 + + /** Returns the number of [AnimationPlayer] nodes in this [GLTFState]. These nodes are only used during the export process when converting Godot [AnimationPlayer] nodes to glTF animations. */ + get_animation_players_count(idx: int64): int64 + + /** Returns the [AnimationPlayer] node with the given index. These nodes are only used during the export process when converting Godot [AnimationPlayer] nodes to glTF animations. */ + get_animation_player(idx: int64): AnimationPlayer + + /** Returns the Godot scene node that corresponds to the same index as the [GLTFNode] it was generated from. This is the inverse of [method get_node_index]. Useful during the import process. + * + * **Note:** Not every [GLTFNode] will have a scene node generated, and not every generated scene node will have a corresponding [GLTFNode]. If there is no scene node for this [GLTFNode] index, `null` is returned. + */ + get_scene_node(idx: int64): Node + + /** Returns the index of the [GLTFNode] corresponding to this Godot scene node. This is the inverse of [method get_scene_node]. Useful during the export process. + * + * **Note:** Not every Godot scene node will have a corresponding [GLTFNode], and not every [GLTFNode] will have a scene node generated. If there is no [GLTFNode] index for this scene node, `-1` is returned. + */ + get_node_index(scene_node: Node): int64 + + /** Gets additional arbitrary data in this [GLTFState] instance. This can be used to keep per-file state data in [GLTFDocumentExtension] classes, which is important because they are stateless. + * The argument should be the [GLTFDocumentExtension] name (does not have to match the extension name in the glTF file), and the return value can be anything you set. If nothing was set, the return value is `null`. + */ + get_additional_data(extension_name: StringName): any + + /** Sets additional arbitrary data in this [GLTFState] instance. This can be used to keep per-file state data in [GLTFDocumentExtension] classes, which is important because they are stateless. + * The first argument should be the [GLTFDocumentExtension] name (does not have to match the extension name in the glTF file), and the second argument can be anything you want. + */ + set_additional_data(extension_name: StringName, additional_data: any): void + + /** The original raw JSON document corresponding to this GLTFState. */ + get json(): GDictionary + set json(value: GDictionary) + get major_version(): int64 + set major_version(value: int64) + get minor_version(): int64 + set minor_version(value: int64) + + /** The copyright string in the asset header of the glTF file. This is set during import if present and export if non-empty. See the glTF asset header documentation for more information. */ + get copyright(): string + set copyright(value: string) + + /** The binary buffer attached to a .glb file. */ + get glb_data(): PackedByteArray + set glb_data(value: PackedByteArray | byte[] | ArrayBuffer) + get use_named_skin_binds(): boolean + set use_named_skin_binds(value: boolean) + get nodes(): GArray + set nodes(value: GArray) + get buffers(): GArray + set buffers(value: GArray) + get buffer_views(): GArray + set buffer_views(value: GArray) + get accessors(): GArray + set accessors(value: GArray) + get meshes(): GArray + set meshes(value: GArray) + get materials(): GArray + set materials(value: GArray) + + /** The name of the scene. When importing, if not specified, this will be the file name. When exporting, if specified, the scene name will be saved to the glTF file. */ + get scene_name(): string + set scene_name(value: string) + + /** The folder path associated with this glTF data. This is used to find other files the glTF file references, like images or binary buffers. This will be set during import when appending from a file, and will be set during export when writing to a file. */ + get base_path(): string + set base_path(value: string) + + /** The file name associated with this glTF data. If it ends with `.gltf`, this is text-based glTF, otherwise this is binary GLB. This will be set during import when appending from a file, and will be set during export when writing to a file. If writing to a buffer, this will be an empty string. */ + get filename(): string + set filename(value: string) + + /** The root nodes of the glTF file. Typically, a glTF file will only have one scene, and therefore one root node. However, a glTF file may have multiple scenes and therefore multiple root nodes, which will be generated as siblings of each other and as children of the root node of the generated Godot scene. */ + get root_nodes(): PackedInt32Array + set root_nodes(value: PackedInt32Array | int32[]) + get textures(): GArray + set textures(value: GArray) + get texture_samplers(): GArray + set texture_samplers(value: GArray) + get images(): GArray + set images(value: GArray) + get skins(): GArray + set skins(value: GArray) + get cameras(): GArray + set cameras(value: GArray) + get lights(): GArray + set lights(value: GArray) + get unique_names(): GArray + set unique_names(value: GArray) + get unique_animation_names(): GArray + set unique_animation_names(value: GArray) + get skeletons(): GArray + set skeletons(value: GArray) + get create_animations(): boolean + set create_animations(value: boolean) + + /** If `true`, forces all GLTFNodes in the document to be bones of a single [Skeleton3D] Godot node. */ + get import_as_skeleton_bones(): boolean + set import_as_skeleton_bones(value: boolean) + get animations(): GArray + set animations(value: GArray) + get handle_binary_image(): int64 + set handle_binary_image(value: int64) + + /** The baking fps of the animation for either import or export. */ + get bake_fps(): float64 + set bake_fps(value: float64) + } + /** GLTFTexture represents a texture in a glTF file. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_gltftexture.html + */ + class GLTFTexture extends Resource { + constructor(identifier?: any) + /** The index of the image associated with this texture, see [method GLTFState.get_images]. If -1, then this texture does not have an image assigned. */ + get src_image(): int64 + set src_image(value: int64) + + /** ID of the texture sampler to use when sampling the image. If -1, then the default texture sampler is used (linear filtering, and repeat wrapping in both axes). */ + get sampler(): int64 + set sampler(value: int64) + } + /** Represents a glTF texture sampler + * + * @link https://docs.godotengine.org/en/4.4/classes/class_gltftexturesampler.html + */ + class GLTFTextureSampler extends Resource { + constructor(identifier?: any) + /** Texture's magnification filter, used when texture appears larger on screen than the source image. */ + get mag_filter(): int64 + set mag_filter(value: int64) + + /** Texture's minification filter, used when the texture appears smaller on screen than the source image. */ + get min_filter(): int64 + set min_filter(value: int64) + + /** Wrapping mode to use for S-axis (horizontal) texture coordinates. */ + get wrap_s(): int64 + set wrap_s(value: int64) + + /** Wrapping mode to use for T-axis (vertical) texture coordinates. */ + get wrap_t(): int64 + set wrap_t(value: int64) + } + namespace GPUParticles2D { + enum DrawOrder { + /** Particles are drawn in the order emitted. */ + DRAW_ORDER_INDEX = 0, + + /** Particles are drawn in order of remaining lifetime. In other words, the particle with the highest lifetime is drawn at the front. */ + DRAW_ORDER_LIFETIME = 1, + + /** Particles are drawn in reverse order of remaining lifetime. In other words, the particle with the lowest lifetime is drawn at the front. */ + DRAW_ORDER_REVERSE_LIFETIME = 2, + } + enum EmitFlags { + /** Particle starts at the specified position. */ + EMIT_FLAG_POSITION = 1, + + /** Particle starts with specified rotation and scale. */ + EMIT_FLAG_ROTATION_SCALE = 2, + + /** Particle starts with the specified velocity vector, which defines the emission direction and speed. */ + EMIT_FLAG_VELOCITY = 4, + + /** Particle starts with specified color. */ + EMIT_FLAG_COLOR = 8, + + /** Particle starts with specified `CUSTOM` data. */ + EMIT_FLAG_CUSTOM = 16, + } + } + /** A 2D particle emitter. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_gpuparticles2d.html + */ + class GPUParticles2D = Record> extends Node2D { + constructor(identifier?: any) + /** Requests the particles to process for extra process time during a single frame. + * Useful for particle playback, if used in combination with [member use_fixed_seed] or by calling [method restart] with parameter `keep_seed` set to `true`. + */ + request_particles_process(process_time: float64): void + + /** Returns a rectangle containing the positions of all existing particles. + * + * **Note:** When using threaded rendering this method synchronizes the rendering thread. Calling it often may have a negative impact on performance. + */ + capture_rect(): Rect2 + + /** Restarts the particle emission cycle, clearing existing particles. To avoid particles vanishing from the viewport, wait for the [signal finished] signal before calling. + * + * **Note:** The [signal finished] signal is only emitted by [member one_shot] emitters. + * If [param keep_seed] is `true`, the current random seed will be preserved. Useful for seeking and playback. + */ + restart(keep_seed: boolean = false): void + + /** Emits a single particle. Whether [param xform], [param velocity], [param color] and [param custom] are applied depends on the value of [param flags]. See [enum EmitFlags]. + * The default ParticleProcessMaterial will overwrite [param color] and use the contents of [param custom] as `(rotation, age, animation, lifetime)`. + * + * **Note:** [method emit_particle] is only supported on the Forward+ and Mobile rendering methods, not Compatibility. + */ + emit_particle(xform: Transform2D, velocity: Vector2, color: Color, custom: Color, flags: int64): void + + /** Sets this node's properties to match a given [CPUParticles2D] node. */ + convert_from_particles(particles: Node): void + + /** If `true`, particles are being emitted. [member emitting] can be used to start and stop particles from emitting. However, if [member one_shot] is `true` setting [member emitting] to `true` will not restart the emission cycle unless all active particles have finished processing. Use the [signal finished] signal to be notified once all active particles finish processing. + * + * **Note:** For [member one_shot] emitters, due to the particles being computed on the GPU, there may be a short period after receiving the [signal finished] signal during which setting this to `true` will not restart the emission cycle. + * **Tip:** If your [member one_shot] emitter needs to immediately restart emitting particles once [signal finished] signal is received, consider calling [method restart] instead of setting [member emitting]. + */ + get emitting(): boolean + set emitting(value: boolean) + + /** The number of particles to emit in one emission cycle. The effective emission rate is `(amount * amount_ratio) / lifetime` particles per second. Higher values will increase GPU requirements, even if not all particles are visible at a given time or if [member amount_ratio] is decreased. + * + * **Note:** Changing this value will cause the particle system to restart. To avoid this, change [member amount_ratio] instead. + */ + get amount(): int64 + set amount(value: int64) + + /** The ratio of particles that should actually be emitted. If set to a value lower than `1.0`, this will set the amount of emitted particles throughout the lifetime to `amount * amount_ratio`. Unlike changing [member amount], changing [member amount_ratio] while emitting does not affect already-emitted particles and doesn't cause the particle system to restart. [member amount_ratio] can be used to create effects that make the number of emitted particles vary over time. + * + * **Note:** Reducing the [member amount_ratio] has no performance benefit, since resources need to be allocated and processed for the total [member amount] of particles regardless of the [member amount_ratio]. If you don't intend to change the number of particles emitted while the particles are emitting, make sure [member amount_ratio] is set to `1` and change [member amount] to your liking instead. + */ + get amount_ratio(): float64 + set amount_ratio(value: float64) + + /** Path to another [GPUParticles2D] node that will be used as a subemitter (see [member ParticleProcessMaterial.sub_emitter_mode]). Subemitters can be used to achieve effects such as fireworks, sparks on collision, bubbles popping into water drops, and more. + * + * **Note:** When [member sub_emitter] is set, the target [GPUParticles2D] node will no longer emit particles on its own. + */ + get sub_emitter(): NodePath + set sub_emitter(value: NodePath | string) + + /** Particle texture. If `null`, particles will be squares with a size of 1×1 pixels. + * + * **Note:** To use a flipbook texture, assign a new [CanvasItemMaterial] to the [GPUParticles2D]'s [member CanvasItem.material] property, then enable [member CanvasItemMaterial.particles_animation] and set [member CanvasItemMaterial.particles_anim_h_frames], [member CanvasItemMaterial.particles_anim_v_frames], and [member CanvasItemMaterial.particles_anim_loop] to match the flipbook texture. + */ + get texture(): Texture2D + set texture(value: Texture2D) + + /** The amount of time each particle will exist (in seconds). The effective emission rate is `(amount * amount_ratio) / lifetime` particles per second. */ + get lifetime(): float64 + set lifetime(value: float64) + + /** Causes all the particles in this node to interpolate towards the end of their lifetime. + * + * **Note:** This only works when used with a [ParticleProcessMaterial]. It needs to be manually implemented for custom process shaders. + */ + get interp_to_end(): float64 + set interp_to_end(value: float64) + + /** If `true`, only one emission cycle occurs. If set `true` during a cycle, emission will stop at the cycle's end. */ + get one_shot(): boolean + set one_shot(value: boolean) + + /** Particle system starts as if it had already run for this many seconds. + * + * **Note:** This can be very expensive if set to a high number as it requires running the particle shader a number of times equal to the [member fixed_fps] (or 30, if [member fixed_fps] is 0) for every second. In extreme cases it can even lead to a GPU crash due to the volume of work done in a single frame. + */ + get preprocess(): float64 + set preprocess(value: float64) + + /** Particle system's running speed scaling ratio. A value of `0` can be used to pause the particles. */ + get speed_scale(): float64 + set speed_scale(value: float64) + + /** How rapidly particles in an emission cycle are emitted. If greater than `0`, there will be a gap in emissions before the next cycle begins. */ + get explosiveness(): float64 + set explosiveness(value: float64) + + /** Emission lifetime randomness ratio. */ + get randomness(): float64 + set randomness(value: float64) + + /** If `true`, particles will use the same seed for every simulation using the seed defined in [member seed]. This is useful for situations where the visual outcome should be consistent across replays, for example when using Movie Maker mode. */ + get use_fixed_seed(): boolean + set use_fixed_seed(value: boolean) + + /** Sets the random seed used by the particle system. Only effective if [member use_fixed_seed] is `true`. */ + get seed(): int64 + set seed(value: int64) + + /** The particle system's frame rate is fixed to a value. For example, changing the value to 2 will make the particles render at 2 frames per second. Note this does not slow down the simulation of the particle system itself. */ + get fixed_fps(): int64 + set fixed_fps(value: int64) + + /** Enables particle interpolation, which makes the particle movement smoother when their [member fixed_fps] is lower than the screen refresh rate. */ + get interpolate(): boolean + set interpolate(value: boolean) + + /** If `true`, results in fractional delta calculation which has a smoother particles display effect. */ + get fract_delta(): boolean + set fract_delta(value: boolean) + + /** Multiplier for particle's collision radius. `1.0` corresponds to the size of the sprite. If particles appear to sink into the ground when colliding, increase this value. If particles appear to float when colliding, decrease this value. Only effective if [member ParticleProcessMaterial.collision_mode] is [constant ParticleProcessMaterial.COLLISION_RIGID] or [constant ParticleProcessMaterial.COLLISION_HIDE_ON_CONTACT]. + * + * **Note:** Particles always have a spherical collision shape. + */ + get collision_base_size(): float64 + set collision_base_size(value: float64) + + /** The [Rect2] that determines the node's region which needs to be visible on screen for the particle system to be active. + * Grow the rect if particles suddenly appear/disappear when the node enters/exits the screen. The [Rect2] can be grown via code or with the **Particles → Generate Visibility Rect** editor tool. + */ + get visibility_rect(): Rect2 + set visibility_rect(value: Rect2) + + /** If `true`, particles use the parent node's coordinate space (known as local coordinates). This will cause particles to move and rotate along the [GPUParticles2D] node (and its parents) when it is moved or rotated. If `false`, particles use global coordinates; they will not move or rotate along the [GPUParticles2D] node (and its parents) when it is moved or rotated. */ + get local_coords(): boolean + set local_coords(value: boolean) + + /** Particle draw order. Uses [enum DrawOrder] values. */ + get draw_order(): int64 + set draw_order(value: int64) + + /** If `true`, enables particle trails using a mesh skinning system. + * + * **Note:** Unlike [GPUParticles3D], the number of trail sections and subdivisions is set with the [member trail_sections] and [member trail_section_subdivisions] properties. + */ + get trail_enabled(): boolean + set trail_enabled(value: boolean) + + /** The amount of time the particle's trail should represent (in seconds). Only effective if [member trail_enabled] is `true`. */ + get trail_lifetime(): float64 + set trail_lifetime(value: float64) + + /** The number of sections to use for the particle trail rendering. Higher values can result in smoother trail curves, at the cost of performance due to increased mesh complexity. See also [member trail_section_subdivisions]. Only effective if [member trail_enabled] is `true`. */ + get trail_sections(): int64 + set trail_sections(value: int64) + + /** The number of subdivisions to use for the particle trail rendering. Higher values can result in smoother trail curves, at the cost of performance due to increased mesh complexity. See also [member trail_sections]. Only effective if [member trail_enabled] is `true`. */ + get trail_section_subdivisions(): int64 + set trail_section_subdivisions(value: int64) + + /** [Material] for processing particles. Can be a [ParticleProcessMaterial] or a [ShaderMaterial]. */ + get process_material(): ParticleProcessMaterial | ShaderMaterial + set process_material(value: ParticleProcessMaterial | ShaderMaterial) + + /** Emitted when all active particles have finished processing. To immediately restart the emission cycle, call [method restart]. + * This signal is never emitted when [member one_shot] is disabled, as particles will be emitted and processed continuously. + * + * **Note:** For [member one_shot] emitters, due to the particles being computed on the GPU, there may be a short period after receiving the signal during which setting [member emitting] to `true` will not restart the emission cycle. This delay is avoided by instead calling [method restart]. + */ + readonly finished: Signal0 + } + class GPUParticles2DEditorPlugin = Record> extends Particles2DEditorPlugin { + constructor(identifier?: any) + } + namespace GPUParticles3D { + enum DrawOrder { + /** Particles are drawn in the order emitted. */ + DRAW_ORDER_INDEX = 0, + + /** Particles are drawn in order of remaining lifetime. In other words, the particle with the highest lifetime is drawn at the front. */ + DRAW_ORDER_LIFETIME = 1, + + /** Particles are drawn in reverse order of remaining lifetime. In other words, the particle with the lowest lifetime is drawn at the front. */ + DRAW_ORDER_REVERSE_LIFETIME = 2, + + /** Particles are drawn in order of depth. */ + DRAW_ORDER_VIEW_DEPTH = 3, + } + enum EmitFlags { + /** Particle starts at the specified position. */ + EMIT_FLAG_POSITION = 1, + + /** Particle starts with specified rotation and scale. */ + EMIT_FLAG_ROTATION_SCALE = 2, + + /** Particle starts with the specified velocity vector, which defines the emission direction and speed. */ + EMIT_FLAG_VELOCITY = 4, + + /** Particle starts with specified color. */ + EMIT_FLAG_COLOR = 8, + + /** Particle starts with specified `CUSTOM` data. */ + EMIT_FLAG_CUSTOM = 16, + } + enum TransformAlign { + TRANSFORM_ALIGN_DISABLED = 0, + TRANSFORM_ALIGN_Z_BILLBOARD = 1, + TRANSFORM_ALIGN_Y_TO_VELOCITY = 2, + TRANSFORM_ALIGN_Z_BILLBOARD_Y_TO_VELOCITY = 3, + } + } + /** A 3D particle emitter. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_gpuparticles3d.html + */ + class GPUParticles3D = Record> extends GeometryInstance3D { + /** Maximum number of draw passes supported. */ + static readonly MAX_DRAW_PASSES = 4 + constructor(identifier?: any) + + /** Sets the [Mesh] that is drawn at index [param pass]. */ + set_draw_pass_mesh(pass: int64, mesh: Mesh): void + + /** Returns the [Mesh] that is drawn at index [param pass]. */ + get_draw_pass_mesh(pass: int64): Mesh + + /** Restarts the particle emission cycle, clearing existing particles. To avoid particles vanishing from the viewport, wait for the [signal finished] signal before calling. + * + * **Note:** The [signal finished] signal is only emitted by [member one_shot] emitters. + * If [param keep_seed] is `true`, the current random seed will be preserved. Useful for seeking and playback. + */ + restart(keep_seed: boolean = false): void + + /** Returns the axis-aligned bounding box that contains all the particles that are active in the current frame. */ + capture_aabb(): AABB + + /** Emits a single particle. Whether [param xform], [param velocity], [param color] and [param custom] are applied depends on the value of [param flags]. See [enum EmitFlags]. + * The default ParticleProcessMaterial will overwrite [param color] and use the contents of [param custom] as `(rotation, age, animation, lifetime)`. + * + * **Note:** [method emit_particle] is only supported on the Forward+ and Mobile rendering methods, not Compatibility. + */ + emit_particle(xform: Transform3D, velocity: Vector3, color: Color, custom: Color, flags: int64): void + + /** Sets this node's properties to match a given [CPUParticles3D] node. */ + convert_from_particles(particles: Node): void + + /** Requests the particles to process for extra process time during a single frame. + * Useful for particle playback, if used in combination with [member use_fixed_seed] or by calling [method restart] with parameter `keep_seed` set to `true`. + */ + request_particles_process(process_time: float64): void + + /** If `true`, particles are being emitted. [member emitting] can be used to start and stop particles from emitting. However, if [member one_shot] is `true` setting [member emitting] to `true` will not restart the emission cycle unless all active particles have finished processing. Use the [signal finished] signal to be notified once all active particles finish processing. + * + * **Note:** For [member one_shot] emitters, due to the particles being computed on the GPU, there may be a short period after receiving the [signal finished] signal during which setting this to `true` will not restart the emission cycle. + * **Tip:** If your [member one_shot] emitter needs to immediately restart emitting particles once [signal finished] signal is received, consider calling [method restart] instead of setting [member emitting]. + */ + get emitting(): boolean + set emitting(value: boolean) + + /** The number of particles to emit in one emission cycle. The effective emission rate is `(amount * amount_ratio) / lifetime` particles per second. Higher values will increase GPU requirements, even if not all particles are visible at a given time or if [member amount_ratio] is decreased. + * + * **Note:** Changing this value will cause the particle system to restart. To avoid this, change [member amount_ratio] instead. + */ + get amount(): int64 + set amount(value: int64) + + /** The ratio of particles that should actually be emitted. If set to a value lower than `1.0`, this will set the amount of emitted particles throughout the lifetime to `amount * amount_ratio`. Unlike changing [member amount], changing [member amount_ratio] while emitting does not affect already-emitted particles and doesn't cause the particle system to restart. [member amount_ratio] can be used to create effects that make the number of emitted particles vary over time. + * + * **Note:** Reducing the [member amount_ratio] has no performance benefit, since resources need to be allocated and processed for the total [member amount] of particles regardless of the [member amount_ratio]. If you don't intend to change the number of particles emitted while the particles are emitting, make sure [member amount_ratio] is set to `1` and change [member amount] to your liking instead. + */ + get amount_ratio(): float64 + set amount_ratio(value: float64) + + /** Path to another [GPUParticles3D] node that will be used as a subemitter (see [member ParticleProcessMaterial.sub_emitter_mode]). Subemitters can be used to achieve effects such as fireworks, sparks on collision, bubbles popping into water drops, and more. + * + * **Note:** When [member sub_emitter] is set, the target [GPUParticles3D] node will no longer emit particles on its own. + */ + get sub_emitter(): NodePath + set sub_emitter(value: NodePath | string) + + /** The amount of time each particle will exist (in seconds). The effective emission rate is `(amount * amount_ratio) / lifetime` particles per second. */ + get lifetime(): float64 + set lifetime(value: float64) + + /** Causes all the particles in this node to interpolate towards the end of their lifetime. + * + * **Note:** This only works when used with a [ParticleProcessMaterial]. It needs to be manually implemented for custom process shaders. + */ + get interp_to_end(): float64 + set interp_to_end(value: float64) + + /** If `true`, only the number of particles equal to [member amount] will be emitted. */ + get one_shot(): boolean + set one_shot(value: boolean) + + /** Amount of time to preprocess the particles before animation starts. Lets you start the animation some time after particles have started emitting. + * + * **Note:** This can be very expensive if set to a high number as it requires running the particle shader a number of times equal to the [member fixed_fps] (or 30, if [member fixed_fps] is 0) for every second. In extreme cases it can even lead to a GPU crash due to the volume of work done in a single frame. + */ + get preprocess(): float64 + set preprocess(value: float64) + + /** Speed scaling ratio. A value of `0` can be used to pause the particles. */ + get speed_scale(): float64 + set speed_scale(value: float64) + + /** Time ratio between each emission. If `0`, particles are emitted continuously. If `1`, all particles are emitted simultaneously. */ + get explosiveness(): float64 + set explosiveness(value: float64) + + /** Emission randomness ratio. */ + get randomness(): float64 + set randomness(value: float64) + + /** If `true`, particles will use the same seed for every simulation using the seed defined in [member seed]. This is useful for situations where the visual outcome should be consistent across replays, for example when using Movie Maker mode. */ + get use_fixed_seed(): boolean + set use_fixed_seed(value: boolean) + + /** Sets the random seed used by the particle system. Only effective if [member use_fixed_seed] is `true`. */ + get seed(): int64 + set seed(value: int64) + + /** The particle system's frame rate is fixed to a value. For example, changing the value to 2 will make the particles render at 2 frames per second. Note this does not slow down the simulation of the particle system itself. */ + get fixed_fps(): int64 + set fixed_fps(value: int64) + + /** Enables particle interpolation, which makes the particle movement smoother when their [member fixed_fps] is lower than the screen refresh rate. */ + get interpolate(): boolean + set interpolate(value: boolean) + + /** If `true`, results in fractional delta calculation which has a smoother particles display effect. */ + get fract_delta(): boolean + set fract_delta(value: boolean) + + /** The base diameter for particle collision in meters. If particles appear to sink into the ground when colliding, increase this value. If particles appear to float when colliding, decrease this value. Only effective if [member ParticleProcessMaterial.collision_mode] is [constant ParticleProcessMaterial.COLLISION_RIGID] or [constant ParticleProcessMaterial.COLLISION_HIDE_ON_CONTACT]. + * + * **Note:** Particles always have a spherical collision shape. + */ + get collision_base_size(): float64 + set collision_base_size(value: float64) + + /** The [AABB] that determines the node's region which needs to be visible on screen for the particle system to be active. [member GeometryInstance3D.extra_cull_margin] is added on each of the AABB's axes. Particle collisions and attraction will only occur within this area. + * Grow the box if particles suddenly appear/disappear when the node enters/exits the screen. The [AABB] can be grown via code or with the **Particles → Generate AABB** editor tool. + * + * **Note:** [member visibility_aabb] is overridden by [member GeometryInstance3D.custom_aabb] if that property is set to a non-default value. + */ + get visibility_aabb(): AABB + set visibility_aabb(value: AABB) + + /** If `true`, particles use the parent node's coordinate space (known as local coordinates). This will cause particles to move and rotate along the [GPUParticles3D] node (and its parents) when it is moved or rotated. If `false`, particles use global coordinates; they will not move or rotate along the [GPUParticles3D] node (and its parents) when it is moved or rotated. */ + get local_coords(): boolean + set local_coords(value: boolean) + + /** Particle draw order. Uses [enum DrawOrder] values. + * + * **Note:** [constant DRAW_ORDER_INDEX] is the only option that supports motion vectors for effects like TAA. It is suggested to use this draw order if the particles are opaque to fix ghosting artifacts. + */ + get draw_order(): int64 + set draw_order(value: int64) + get transform_align(): int64 + set transform_align(value: int64) + + /** If `true`, enables particle trails using a mesh skinning system. Designed to work with [RibbonTrailMesh] and [TubeTrailMesh]. + * + * **Note:** [member BaseMaterial3D.use_particle_trails] must also be enabled on the particle mesh's material. Otherwise, setting [member trail_enabled] to `true` will have no effect. + * + * **Note:** Unlike [GPUParticles2D], the number of trail sections and subdivisions is set in the [RibbonTrailMesh] or the [TubeTrailMesh]'s properties. + */ + get trail_enabled(): boolean + set trail_enabled(value: boolean) + + /** The amount of time the particle's trail should represent (in seconds). Only effective if [member trail_enabled] is `true`. */ + get trail_lifetime(): float64 + set trail_lifetime(value: float64) + + /** [Material] for processing particles. Can be a [ParticleProcessMaterial] or a [ShaderMaterial]. */ + get process_material(): ParticleProcessMaterial | ShaderMaterial + set process_material(value: ParticleProcessMaterial | ShaderMaterial) + + /** The number of draw passes when rendering particles. */ + get draw_passes(): int64 + set draw_passes(value: int64) + + /** [Mesh] that is drawn for the first draw pass. */ + get draw_pass_1(): Mesh + set draw_pass_1(value: Mesh) + + /** [Mesh] that is drawn for the second draw pass. */ + get draw_pass_2(): Mesh + set draw_pass_2(value: Mesh) + + /** [Mesh] that is drawn for the third draw pass. */ + get draw_pass_3(): Mesh + set draw_pass_3(value: Mesh) + + /** [Mesh] that is drawn for the fourth draw pass. */ + get draw_pass_4(): Mesh + set draw_pass_4(value: Mesh) + get draw_skin(): Skin + set draw_skin(value: Skin) + + /** Emitted when all active particles have finished processing. To immediately restart the emission cycle, call [method restart]. + * This signal is never emitted when [member one_shot] is disabled, as particles will be emitted and processed continuously. + * + * **Note:** For [member one_shot] emitters, due to the particles being computed on the GPU, there may be a short period after receiving the signal during which setting [member emitting] to `true` will not restart the emission cycle. This delay is avoided by instead calling [method restart]. + */ + readonly finished: Signal0 + } + class GPUParticles3DEditorPlugin = Record> extends Particles3DEditorPlugin { constructor(identifier?: any) } class GPUParticles3DGizmoPlugin extends EditorNode3DGizmoPlugin { @@ -15,9 +5845,9 @@ declare module "godot" { } /** Abstract base class for 3D particle attractors. * - * @link https://docs.godotengine.org/en/4.3/classes/class_gpuparticlesattractor3d.html + * @link https://docs.godotengine.org/en/4.4/classes/class_gpuparticlesattractor3d.html */ - class GPUParticlesAttractor3D extends VisualInstance3D { + class GPUParticlesAttractor3D = Record> extends VisualInstance3D { constructor(identifier?: any) /** Adjusts the strength of the attractor. If [member strength] is negative, particles will be pushed in the opposite direction. Particles will be pushed *away* from the attractor's origin if [member directionality] is `0.0`, or towards local +Z if [member directionality] is greater than `0.0`. */ get strength(): float64 @@ -43,9 +5873,9 @@ declare module "godot" { } /** A box-shaped attractor that influences particles from [GPUParticles3D] nodes. * - * @link https://docs.godotengine.org/en/4.3/classes/class_gpuparticlesattractorbox3d.html + * @link https://docs.godotengine.org/en/4.4/classes/class_gpuparticlesattractorbox3d.html */ - class GPUParticlesAttractorBox3D extends GPUParticlesAttractor3D { + class GPUParticlesAttractorBox3D = Record> extends GPUParticlesAttractor3D { constructor(identifier?: any) /** The attractor box's size in 3D units. */ get size(): Vector3 @@ -53,9 +5883,9 @@ declare module "godot" { } /** A spheroid-shaped attractor that influences particles from [GPUParticles3D] nodes. * - * @link https://docs.godotengine.org/en/4.3/classes/class_gpuparticlesattractorsphere3d.html + * @link https://docs.godotengine.org/en/4.4/classes/class_gpuparticlesattractorsphere3d.html */ - class GPUParticlesAttractorSphere3D extends GPUParticlesAttractor3D { + class GPUParticlesAttractorSphere3D = Record> extends GPUParticlesAttractor3D { constructor(identifier?: any) /** The attractor sphere's radius in 3D units. * @@ -66,9 +5896,9 @@ declare module "godot" { } /** A box-shaped attractor with varying directions and strengths defined in it that influences particles from [GPUParticles3D] nodes. * - * @link https://docs.godotengine.org/en/4.3/classes/class_gpuparticlesattractorvectorfield3d.html + * @link https://docs.godotengine.org/en/4.4/classes/class_gpuparticlesattractorvectorfield3d.html */ - class GPUParticlesAttractorVectorField3D extends GPUParticlesAttractor3D { + class GPUParticlesAttractorVectorField3D = Record> extends GPUParticlesAttractor3D { constructor(identifier?: any) /** The size of the vector field box in 3D units. */ get size(): Vector3 @@ -83,13 +5913,13 @@ declare module "godot" { } /** Abstract base class for 3D particle collision shapes affecting [GPUParticles3D] nodes. * - * @link https://docs.godotengine.org/en/4.3/classes/class_gpuparticlescollision3d.html + * @link https://docs.godotengine.org/en/4.4/classes/class_gpuparticlescollision3d.html */ - class GPUParticlesCollision3D extends VisualInstance3D { + class GPUParticlesCollision3D = Record> extends VisualInstance3D { constructor(identifier?: any) /** The particle rendering layers ([member VisualInstance3D.layers]) that will be affected by the collision shape. By default, all particles that have [member ParticleProcessMaterial.collision_mode] set to [constant ParticleProcessMaterial.COLLISION_RIGID] or [constant ParticleProcessMaterial.COLLISION_HIDE_ON_CONTACT] will be affected by a collision shape. - * After configuring particle nodes accordingly, specific layers can be unchecked to prevent certain particles from being affected by attractors. For example, this can be used if you're using an attractor as part of a spell effect but don't want the attractor to affect unrelated weather particles at the same position. - * Particle attraction can also be disabled on a per-process material basis by setting [member ParticleProcessMaterial.attractor_interaction_enabled] on the [GPUParticles3D] node. + * After configuring particle nodes accordingly, specific layers can be unchecked to prevent certain particles from being affected by colliders. For example, this can be used if you're using a collider as part of a spell effect but don't want the collider to affect unrelated weather particles at the same position. + * Particle collision can also be disabled on a per-process material basis by setting [member ParticleProcessMaterial.collision_mode] on the [GPUParticles3D] node. */ get cull_mask(): int64 set cull_mask(value: int64) @@ -99,9 +5929,9 @@ declare module "godot" { } /** A box-shaped 3D particle collision shape affecting [GPUParticles3D] nodes. * - * @link https://docs.godotengine.org/en/4.3/classes/class_gpuparticlescollisionbox3d.html + * @link https://docs.godotengine.org/en/4.4/classes/class_gpuparticlescollisionbox3d.html */ - class GPUParticlesCollisionBox3D extends GPUParticlesCollision3D { + class GPUParticlesCollisionBox3D = Record> extends GPUParticlesCollision3D { constructor(identifier?: any) /** The collision box's size in 3D units. */ get size(): Vector3 @@ -140,10 +5970,16 @@ declare module "godot" { } /** A real-time heightmap-shaped 3D particle collision shape affecting [GPUParticles3D] nodes. * - * @link https://docs.godotengine.org/en/4.3/classes/class_gpuparticlescollisionheightfield3d.html + * @link https://docs.godotengine.org/en/4.4/classes/class_gpuparticlescollisionheightfield3d.html */ - class GPUParticlesCollisionHeightField3D extends GPUParticlesCollision3D { + class GPUParticlesCollisionHeightField3D = Record> extends GPUParticlesCollision3D { constructor(identifier?: any) + /** Based on [param value], enables or disables the specified layer in the [member heightfield_mask], given a [param layer_number] between `1` and `20`, inclusive. */ + set_heightfield_mask_value(layer_number: int64, value: boolean): void + + /** Returns `true` if the specified layer of the [member heightfield_mask] is enabled, given a [param layer_number] between `1` and `20`, inclusive. */ + get_heightfield_mask_value(layer_number: int64): boolean + /** The collision heightmap's size in 3D units. To improve heightmap quality, [member size] should be set as small as possible while covering the parts of the scene you need. */ get size(): Vector3 set size(value: Vector3) @@ -161,6 +5997,14 @@ declare module "godot" { */ get follow_camera_enabled(): boolean set follow_camera_enabled(value: boolean) + + /** The visual layers to account for when updating the heightmap. Only [MeshInstance3D]s whose [member VisualInstance3D.layers] match with this [member heightfield_mask] will be included in the heightmap collision update. By default, all 20 user-visible layers are taken into account for updating the heightmap collision. + * + * **Note:** Since the [member heightfield_mask] allows for 32 layers to be stored in total, there are an additional 12 layers that are only used internally by the engine and aren't exposed in the editor. Setting [member heightfield_mask] using a script allows you to toggle those reserved layers, which can be useful for editor plugins. + * To adjust [member heightfield_mask] more easily using a script, use [method get_heightfield_mask_value] and [method set_heightfield_mask_value]. + */ + get heightfield_mask(): int64 + set heightfield_mask(value: int64) } namespace GPUParticlesCollisionSDF3D { enum Resolution { @@ -188,9 +6032,9 @@ declare module "godot" { } /** A baked signed distance field 3D particle collision shape affecting [GPUParticles3D] nodes. * - * @link https://docs.godotengine.org/en/4.3/classes/class_gpuparticlescollisionsdf3d.html + * @link https://docs.godotengine.org/en/4.4/classes/class_gpuparticlescollisionsdf3d.html */ - class GPUParticlesCollisionSDF3D extends GPUParticlesCollision3D { + class GPUParticlesCollisionSDF3D = Record> extends GPUParticlesCollision3D { constructor(identifier?: any) /** Based on [param value], enables or disables the specified layer in the [member bake_mask], given a [param layer_number] between 1 and 32. */ set_bake_mask_value(layer_number: int64, value: boolean): void @@ -218,19 +6062,30 @@ declare module "godot" { get texture(): Texture3D set texture(value: Texture3D) } - class GPUParticlesCollisionSDF3DEditorPlugin extends EditorPlugin { + class GPUParticlesCollisionSDF3DEditorPlugin = Record> extends EditorPlugin { constructor(identifier?: any) } /** A sphere-shaped 3D particle collision shape affecting [GPUParticles3D] nodes. * - * @link https://docs.godotengine.org/en/4.3/classes/class_gpuparticlescollisionsphere3d.html + * @link https://docs.godotengine.org/en/4.4/classes/class_gpuparticlescollisionsphere3d.html */ - class GPUParticlesCollisionSphere3D extends GPUParticlesCollision3D { + class GPUParticlesCollisionSphere3D = Record> extends GPUParticlesCollision3D { constructor(identifier?: any) /** The collision sphere's radius in 3D units. */ get radius(): float64 set radius(value: float64) } + class GameView = Record> extends VBoxContainer { + constructor(identifier?: any) + } + class GameViewDebugger extends EditorDebuggerPlugin { + constructor(identifier?: any) + readonly session_started: Signal0 + readonly session_stopped: Signal0 + } + class GameViewPlugin = Record> extends EditorPlugin { + constructor(identifier?: any) + } namespace Generic6DOFJoint3D { enum Param { /** The minimum difference between the pivot points' axes. */ @@ -311,9 +6166,9 @@ declare module "godot" { } /** A physics joint that allows for complex movement and rotation between two 3D physics bodies. * - * @link https://docs.godotengine.org/en/4.3/classes/class_generic6dofjoint3d.html + * @link https://docs.godotengine.org/en/4.4/classes/class_generic6dofjoint3d.html */ - class Generic6DOFJoint3D extends Joint3D { + class Generic6DOFJoint3D = Record> extends Joint3D { constructor(identifier?: any) set_param_x(param: Generic6DOFJoint3D.Param, value: float64): void get_param_x(param: Generic6DOFJoint3D.Param): float64 @@ -327,6 +6182,296 @@ declare module "godot" { get_flag_y(flag: Generic6DOFJoint3D.Flag): boolean set_flag_z(flag: Generic6DOFJoint3D.Flag, value: boolean): void get_flag_z(flag: Generic6DOFJoint3D.Flag): boolean + + /** If `true`, the linear motion across the X axis is limited. */ + get "linear_limit_x/enabled"(): boolean + set "linear_limit_x/enabled"(value: boolean) + + /** The maximum difference between the pivot points' X axis. */ + get "linear_limit_x/upper_distance"(): float64 + set "linear_limit_x/upper_distance"(value: float64) + + /** The minimum difference between the pivot points' X axis. */ + get "linear_limit_x/lower_distance"(): float64 + set "linear_limit_x/lower_distance"(value: float64) + + /** A factor applied to the movement across the X axis. The lower, the slower the movement. */ + get "linear_limit_x/softness"(): float64 + set "linear_limit_x/softness"(value: float64) + + /** The amount of restitution on the X axis movement. The lower, the more momentum gets lost. */ + get "linear_limit_x/restitution"(): float64 + set "linear_limit_x/restitution"(value: float64) + + /** The amount of damping that happens at the X motion. */ + get "linear_limit_x/damping"(): float64 + set "linear_limit_x/damping"(value: float64) + + /** If `true`, the linear motion across the Y axis is limited. */ + get "linear_limit_y/enabled"(): boolean + set "linear_limit_y/enabled"(value: boolean) + + /** The maximum difference between the pivot points' Y axis. */ + get "linear_limit_y/upper_distance"(): float64 + set "linear_limit_y/upper_distance"(value: float64) + + /** The minimum difference between the pivot points' Y axis. */ + get "linear_limit_y/lower_distance"(): float64 + set "linear_limit_y/lower_distance"(value: float64) + + /** A factor applied to the movement across the Y axis. The lower, the slower the movement. */ + get "linear_limit_y/softness"(): float64 + set "linear_limit_y/softness"(value: float64) + + /** The amount of restitution on the Y axis movement. The lower, the more momentum gets lost. */ + get "linear_limit_y/restitution"(): float64 + set "linear_limit_y/restitution"(value: float64) + + /** The amount of damping that happens at the Y motion. */ + get "linear_limit_y/damping"(): float64 + set "linear_limit_y/damping"(value: float64) + + /** If `true`, the linear motion across the Z axis is limited. */ + get "linear_limit_z/enabled"(): boolean + set "linear_limit_z/enabled"(value: boolean) + + /** The maximum difference between the pivot points' Z axis. */ + get "linear_limit_z/upper_distance"(): float64 + set "linear_limit_z/upper_distance"(value: float64) + + /** The minimum difference between the pivot points' Z axis. */ + get "linear_limit_z/lower_distance"(): float64 + set "linear_limit_z/lower_distance"(value: float64) + + /** A factor applied to the movement across the Z axis. The lower, the slower the movement. */ + get "linear_limit_z/softness"(): float64 + set "linear_limit_z/softness"(value: float64) + + /** The amount of restitution on the Z axis movement. The lower, the more momentum gets lost. */ + get "linear_limit_z/restitution"(): float64 + set "linear_limit_z/restitution"(value: float64) + + /** The amount of damping that happens at the Z motion. */ + get "linear_limit_z/damping"(): float64 + set "linear_limit_z/damping"(value: float64) + + /** If `true`, then there is a linear motor on the X axis. It will attempt to reach the target velocity while staying within the force limits. */ + get "linear_motor_x/enabled"(): boolean + set "linear_motor_x/enabled"(value: boolean) + + /** The speed that the linear motor will attempt to reach on the X axis. */ + get "linear_motor_x/target_velocity"(): float64 + set "linear_motor_x/target_velocity"(value: float64) + + /** The maximum force the linear motor can apply on the X axis while trying to reach the target velocity. */ + get "linear_motor_x/force_limit"(): float64 + set "linear_motor_x/force_limit"(value: float64) + + /** If `true`, then there is a linear motor on the Y axis. It will attempt to reach the target velocity while staying within the force limits. */ + get "linear_motor_y/enabled"(): boolean + set "linear_motor_y/enabled"(value: boolean) + + /** The speed that the linear motor will attempt to reach on the Y axis. */ + get "linear_motor_y/target_velocity"(): float64 + set "linear_motor_y/target_velocity"(value: float64) + + /** The maximum force the linear motor can apply on the Y axis while trying to reach the target velocity. */ + get "linear_motor_y/force_limit"(): float64 + set "linear_motor_y/force_limit"(value: float64) + + /** If `true`, then there is a linear motor on the Z axis. It will attempt to reach the target velocity while staying within the force limits. */ + get "linear_motor_z/enabled"(): boolean + set "linear_motor_z/enabled"(value: boolean) + + /** The speed that the linear motor will attempt to reach on the Z axis. */ + get "linear_motor_z/target_velocity"(): float64 + set "linear_motor_z/target_velocity"(value: float64) + + /** The maximum force the linear motor can apply on the Z axis while trying to reach the target velocity. */ + get "linear_motor_z/force_limit"(): float64 + set "linear_motor_z/force_limit"(value: float64) + get "linear_spring_x/enabled"(): boolean + set "linear_spring_x/enabled"(value: boolean) + get "linear_spring_x/stiffness"(): float64 + set "linear_spring_x/stiffness"(value: float64) + get "linear_spring_x/damping"(): float64 + set "linear_spring_x/damping"(value: float64) + get "linear_spring_x/equilibrium_point"(): float64 + set "linear_spring_x/equilibrium_point"(value: float64) + get "linear_spring_y/enabled"(): boolean + set "linear_spring_y/enabled"(value: boolean) + get "linear_spring_y/stiffness"(): float64 + set "linear_spring_y/stiffness"(value: float64) + get "linear_spring_y/damping"(): float64 + set "linear_spring_y/damping"(value: float64) + get "linear_spring_y/equilibrium_point"(): float64 + set "linear_spring_y/equilibrium_point"(value: float64) + get "linear_spring_z/enabled"(): boolean + set "linear_spring_z/enabled"(value: boolean) + get "linear_spring_z/stiffness"(): float64 + set "linear_spring_z/stiffness"(value: float64) + get "linear_spring_z/damping"(): float64 + set "linear_spring_z/damping"(value: float64) + get "linear_spring_z/equilibrium_point"(): float64 + set "linear_spring_z/equilibrium_point"(value: float64) + + /** If `true`, rotation across the X axis is limited. */ + get "angular_limit_x/enabled"(): boolean + set "angular_limit_x/enabled"(value: boolean) + + /** The minimum rotation in positive direction to break loose and rotate around the X axis. */ + get "angular_limit_x/upper_angle"(): float64 + set "angular_limit_x/upper_angle"(value: float64) + + /** The minimum rotation in negative direction to break loose and rotate around the X axis. */ + get "angular_limit_x/lower_angle"(): float64 + set "angular_limit_x/lower_angle"(value: float64) + + /** The speed of all rotations across the X axis. */ + get "angular_limit_x/softness"(): float64 + set "angular_limit_x/softness"(value: float64) + + /** The amount of rotational restitution across the X axis. The lower, the more restitution occurs. */ + get "angular_limit_x/restitution"(): float64 + set "angular_limit_x/restitution"(value: float64) + + /** The amount of rotational damping across the X axis. + * The lower, the longer an impulse from one side takes to travel to the other side. + */ + get "angular_limit_x/damping"(): float64 + set "angular_limit_x/damping"(value: float64) + + /** The maximum amount of force that can occur, when rotating around the X axis. */ + get "angular_limit_x/force_limit"(): float64 + set "angular_limit_x/force_limit"(value: float64) + + /** When rotating across the X axis, this error tolerance factor defines how much the correction gets slowed down. The lower, the slower. */ + get "angular_limit_x/erp"(): float64 + set "angular_limit_x/erp"(value: float64) + + /** If `true`, rotation across the Y axis is limited. */ + get "angular_limit_y/enabled"(): boolean + set "angular_limit_y/enabled"(value: boolean) + + /** The minimum rotation in positive direction to break loose and rotate around the Y axis. */ + get "angular_limit_y/upper_angle"(): float64 + set "angular_limit_y/upper_angle"(value: float64) + + /** The minimum rotation in negative direction to break loose and rotate around the Y axis. */ + get "angular_limit_y/lower_angle"(): float64 + set "angular_limit_y/lower_angle"(value: float64) + + /** The speed of all rotations across the Y axis. */ + get "angular_limit_y/softness"(): float64 + set "angular_limit_y/softness"(value: float64) + + /** The amount of rotational restitution across the Y axis. The lower, the more restitution occurs. */ + get "angular_limit_y/restitution"(): float64 + set "angular_limit_y/restitution"(value: float64) + + /** The amount of rotational damping across the Y axis. The lower, the more damping occurs. */ + get "angular_limit_y/damping"(): float64 + set "angular_limit_y/damping"(value: float64) + + /** The maximum amount of force that can occur, when rotating around the Y axis. */ + get "angular_limit_y/force_limit"(): float64 + set "angular_limit_y/force_limit"(value: float64) + + /** When rotating across the Y axis, this error tolerance factor defines how much the correction gets slowed down. The lower, the slower. */ + get "angular_limit_y/erp"(): float64 + set "angular_limit_y/erp"(value: float64) + + /** If `true`, rotation across the Z axis is limited. */ + get "angular_limit_z/enabled"(): boolean + set "angular_limit_z/enabled"(value: boolean) + + /** The minimum rotation in positive direction to break loose and rotate around the Z axis. */ + get "angular_limit_z/upper_angle"(): float64 + set "angular_limit_z/upper_angle"(value: float64) + + /** The minimum rotation in negative direction to break loose and rotate around the Z axis. */ + get "angular_limit_z/lower_angle"(): float64 + set "angular_limit_z/lower_angle"(value: float64) + + /** The speed of all rotations across the Z axis. */ + get "angular_limit_z/softness"(): float64 + set "angular_limit_z/softness"(value: float64) + + /** The amount of rotational restitution across the Z axis. The lower, the more restitution occurs. */ + get "angular_limit_z/restitution"(): float64 + set "angular_limit_z/restitution"(value: float64) + + /** The amount of rotational damping across the Z axis. The lower, the more damping occurs. */ + get "angular_limit_z/damping"(): float64 + set "angular_limit_z/damping"(value: float64) + + /** The maximum amount of force that can occur, when rotating around the Z axis. */ + get "angular_limit_z/force_limit"(): float64 + set "angular_limit_z/force_limit"(value: float64) + + /** When rotating across the Z axis, this error tolerance factor defines how much the correction gets slowed down. The lower, the slower. */ + get "angular_limit_z/erp"(): float64 + set "angular_limit_z/erp"(value: float64) + + /** If `true`, a rotating motor at the X axis is enabled. */ + get "angular_motor_x/enabled"(): boolean + set "angular_motor_x/enabled"(value: boolean) + + /** Target speed for the motor at the X axis. */ + get "angular_motor_x/target_velocity"(): float64 + set "angular_motor_x/target_velocity"(value: float64) + + /** Maximum acceleration for the motor at the X axis. */ + get "angular_motor_x/force_limit"(): float64 + set "angular_motor_x/force_limit"(value: float64) + + /** If `true`, a rotating motor at the Y axis is enabled. */ + get "angular_motor_y/enabled"(): boolean + set "angular_motor_y/enabled"(value: boolean) + + /** Target speed for the motor at the Y axis. */ + get "angular_motor_y/target_velocity"(): float64 + set "angular_motor_y/target_velocity"(value: float64) + + /** Maximum acceleration for the motor at the Y axis. */ + get "angular_motor_y/force_limit"(): float64 + set "angular_motor_y/force_limit"(value: float64) + + /** If `true`, a rotating motor at the Z axis is enabled. */ + get "angular_motor_z/enabled"(): boolean + set "angular_motor_z/enabled"(value: boolean) + + /** Target speed for the motor at the Z axis. */ + get "angular_motor_z/target_velocity"(): float64 + set "angular_motor_z/target_velocity"(value: float64) + + /** Maximum acceleration for the motor at the Z axis. */ + get "angular_motor_z/force_limit"(): float64 + set "angular_motor_z/force_limit"(value: float64) + get "angular_spring_x/enabled"(): boolean + set "angular_spring_x/enabled"(value: boolean) + get "angular_spring_x/stiffness"(): float64 + set "angular_spring_x/stiffness"(value: float64) + get "angular_spring_x/damping"(): float64 + set "angular_spring_x/damping"(value: float64) + get "angular_spring_x/equilibrium_point"(): float64 + set "angular_spring_x/equilibrium_point"(value: float64) + get "angular_spring_y/enabled"(): boolean + set "angular_spring_y/enabled"(value: boolean) + get "angular_spring_y/stiffness"(): float64 + set "angular_spring_y/stiffness"(value: float64) + get "angular_spring_y/damping"(): float64 + set "angular_spring_y/damping"(value: float64) + get "angular_spring_y/equilibrium_point"(): float64 + set "angular_spring_y/equilibrium_point"(value: float64) + get "angular_spring_z/enabled"(): boolean + set "angular_spring_z/enabled"(value: boolean) + get "angular_spring_z/stiffness"(): float64 + set "angular_spring_z/stiffness"(value: float64) + get "angular_spring_z/damping"(): float64 + set "angular_spring_z/damping"(value: float64) + get "angular_spring_z/equilibrium_point"(): float64 + set "angular_spring_z/equilibrium_point"(value: float64) } namespace GeometryInstance3D { enum ShadowCastingSetting { @@ -393,17 +6538,17 @@ declare module "godot" { } /** Base node for geometry-based visual instances. * - * @link https://docs.godotengine.org/en/4.3/classes/class_geometryinstance3d.html + * @link https://docs.godotengine.org/en/4.4/classes/class_geometryinstance3d.html */ - class GeometryInstance3D extends VisualInstance3D { + class GeometryInstance3D = Record> extends VisualInstance3D { constructor(identifier?: any) - /** Set the value of a shader uniform for this instance only ([url=https://docs.godotengine.org/en/4.3/tutorials/shaders/shader_reference/shading_language.html#per-instance-uniforms]per-instance uniform[/url]). See also [method ShaderMaterial.set_shader_parameter] to assign a uniform on all instances using the same [ShaderMaterial]. + /** Set the value of a shader uniform for this instance only ([url=https://docs.godotengine.org/en/4.4/tutorials/shaders/shader_reference/shading_language.html#per-instance-uniforms]per-instance uniform[/url]). See also [method ShaderMaterial.set_shader_parameter] to assign a uniform on all instances using the same [ShaderMaterial]. * * **Note:** For a shader uniform to be assignable on a per-instance basis, it *must* be defined with `instance uniform ...` rather than `uniform ...` in the shader code. * * **Note:** [param name] is case-sensitive and must match the name of the uniform in the code exactly (not the capitalized name in the inspector). * - * **Note:** Per-instance shader uniforms are currently only available in 3D, so there is no 2D equivalent of this method. + * **Note:** Per-instance shader uniforms are only available in Spatial and CanvasItem shaders, but not for Fog, Sky, or Particles shaders. */ set_instance_shader_parameter(name: StringName, value: any): void @@ -464,7 +6609,13 @@ declare module "godot" { get gi_mode(): int64 set gi_mode(value: int64) - /** The texel density to use for lightmapping in [LightmapGI]. Greater scale values provide higher resolution in the lightmap, which can result in sharper shadows for lights that have both direct and indirect light baked. However, greater scale values will also increase the space taken by the mesh in the lightmap texture, which increases the memory, storage, and bake time requirements. When using a single mesh at different scales, consider adjusting this value to keep the lightmap texel density consistent across meshes. */ + /** The texel density to use for lightmapping in [LightmapGI]. Greater scale values provide higher resolution in the lightmap, which can result in sharper shadows for lights that have both direct and indirect light baked. However, greater scale values will also increase the space taken by the mesh in the lightmap texture, which increases the memory, storage, and bake time requirements. When using a single mesh at different scales, consider adjusting this value to keep the lightmap texel density consistent across meshes. + * For example, doubling [member gi_lightmap_texel_scale] doubles the lightmap texture resolution for this object *on each axis* , so it will *quadruple* the texel count. + */ + get gi_lightmap_texel_scale(): float64 + set gi_lightmap_texel_scale(value: float64) + + /** The texel density to use for lightmapping in [LightmapGI]. */ get gi_lightmap_scale(): int64 set gi_lightmap_scale(value: int64) @@ -498,7 +6649,7 @@ declare module "godot" { class Gizmo3DHelper extends RefCounted { constructor(identifier?: any) } - class GodotJSDockedPanel extends MarginContainer { + class GodotJSDockedPanel = Record> extends MarginContainer { constructor(identifier?: any) } class GodotJSMonitor extends Object { @@ -511,7 +6662,7 @@ declare module "godot" { get_value_allocated_variants(): any get_value_memory_used_size(): any } - class GodotJSStatisticsViewer extends VBoxContainer { + class GodotJSStatisticsViewer = Record> extends VBoxContainer { constructor(identifier?: any) } class GodotNavigationServer2D extends NavigationServer2D { @@ -529,9 +6680,6 @@ declare module "godot" { class GodotPhysicsServer3D extends PhysicsServer3D { constructor(identifier?: any) } - class GotoLineDialog extends ConfirmationDialog { - constructor(identifier?: any) - } namespace Gradient { enum InterpolationMode { /** Linear interpolation. */ @@ -556,7 +6704,7 @@ declare module "godot" { } /** A color transition. * - * @link https://docs.godotengine.org/en/4.3/classes/class_gradient.html + * @link https://docs.godotengine.org/en/4.4/classes/class_gradient.html */ class Gradient extends Resource { constructor(identifier?: any) @@ -615,12 +6763,12 @@ declare module "godot" { get colors(): PackedColorArray set colors(value: PackedColorArray | Color[]) } - class GradientEditorPlugin extends EditorPlugin { + class GradientEditorPlugin = Record> extends EditorPlugin { constructor(identifier?: any) } /** A 1D texture that uses colors obtained from a [Gradient]. * - * @link https://docs.godotengine.org/en/4.3/classes/class_gradienttexture1d.html + * @link https://docs.godotengine.org/en/4.4/classes/class_gradienttexture1d.html */ class GradientTexture1D extends Texture2D { constructor(identifier?: any) @@ -660,7 +6808,7 @@ declare module "godot" { } /** A 2D texture that creates a pattern with colors obtained from a [Gradient]. * - * @link https://docs.godotengine.org/en/4.3/classes/class_gradienttexture2d.html + * @link https://docs.godotengine.org/en/4.4/classes/class_gradienttexture2d.html */ class GradientTexture2D extends Texture2D { constructor(identifier?: any) @@ -696,7 +6844,7 @@ declare module "godot" { get repeat(): int64 set repeat(value: int64) } - class GradientTexture2DEditorPlugin extends EditorPlugin { + class GradientTexture2DEditorPlugin = Record> extends EditorPlugin { constructor(identifier?: any) } namespace GraphEdit { @@ -717,9 +6865,9 @@ declare module "godot" { } /** An editor for graph-like structures, using [GraphNode]s. * - * @link https://docs.godotengine.org/en/4.3/classes/class_graphedit.html + * @link https://docs.godotengine.org/en/4.4/classes/class_graphedit.html */ - class GraphEdit extends Control { + class GraphEdit = Record> extends Control { constructor(identifier?: any) /** Returns whether the [param mouse_position] is in the input hot zone. * By default, a hot zone is a [Rect2] positioned such that its center is at [param in_node].[method GraphNode.get_input_port_position]([param in_port]) (For output's case, call [method GraphNode.get_output_port_position] instead). The hot zone's width is twice the Theme Property `port_grab_distance_horizontal`, and its height is twice the `port_grab_distance_vertical`. @@ -744,8 +6892,10 @@ declare module "godot" { */ /* gdvirtual */ _is_node_hover_valid(from_node: StringName, from_port: int64, to_node: StringName, to_port: int64): boolean - /** Create a connection between the [param from_port] of the [param from_node] [GraphNode] and the [param to_port] of the [param to_node] [GraphNode]. If the connection already exists, no connection is created. */ - connect_node(from_node: StringName, from_port: int64, to_node: StringName, to_port: int64): GError + /** Create a connection between the [param from_port] of the [param from_node] [GraphNode] and the [param to_port] of the [param to_node] [GraphNode]. If the connection already exists, no connection is created. + * Connections with [param keep_alive] set to `false` may be deleted automatically if invalid during a redraw. + */ + connect_node(from_node: StringName, from_port: int64, to_node: StringName, to_port: int64, keep_alive: boolean = false): GError /** Returns `true` if the [param from_port] of the [param from_node] [GraphNode] is connected to the [param to_port] of the [param to_node] [GraphNode]. */ is_node_connected(from_node: StringName, from_port: int64, to_node: StringName, to_port: int64): boolean @@ -756,17 +6906,21 @@ declare module "godot" { /** Sets the coloration of the connection between [param from_node]'s [param from_port] and [param to_node]'s [param to_port] with the color provided in the [theme_item activity] theme property. The color is linearly interpolated between the connection color and the activity color using [param amount] as weight. */ set_connection_activity(from_node: StringName, from_port: int64, to_node: StringName, to_port: int64, amount: float64): void - /** Returns an [Array] containing the list of connections. A connection consists in a structure of the form `{ from_port: 0, from_node: "GraphNode name 0", to_port: 1, to_node: "GraphNode name 1" }`. */ - get_connection_list(): GArray + /** Returns the number of connections from [param from_port] of [param from_node]. */ + get_connection_count(from_node: StringName, from_port: int64): int64 /** Returns the closest connection to the given point in screen space. If no connection is found within [param max_distance] pixels, an empty [Dictionary] is returned. - * A connection consists in a structure of the form `{ from_port: 0, from_node: "GraphNode name 0", to_port: 1, to_node: "GraphNode name 1" }`. + * A connection is represented as a [Dictionary] in the form of: + * * For example, getting a connection at a given mouse position can be achieved like this: * */ get_closest_connection_at_point(point: Vector2, max_distance: float64 = 4): GDictionary - /** Returns an [Array] containing the list of connections that intersect with the given [Rect2]. A connection consists in a structure of the form `{ from_port: 0, from_node: "GraphNode name 0", to_port: 1, to_node: "GraphNode name 1" }`. */ + /** Returns an [Array] containing the list of connections that intersect with the given [Rect2]. + * A connection is represented as a [Dictionary] in the form of: + * + */ get_connections_intersecting_with_rect(rect: Rect2): GArray /** Removes all connections between nodes. */ @@ -872,6 +7026,14 @@ declare module "godot" { get connection_lines_antialiased(): boolean set connection_lines_antialiased(value: boolean) + /** The connections between [GraphNode]s. + * A connection is represented as a [Dictionary] in the form of: + * + * Connections with `keep_alive` set to `false` may be deleted automatically if invalid during a redraw. + */ + get connections(): GArray + set connections(value: GArray) + /** The current zoom value. */ get zoom(): float64 set zoom(value: float64) @@ -945,6 +7107,9 @@ declare module "godot" { /** Emitted when this [GraphEdit] captures a `ui_copy` action ([kbd]Ctrl + C[/kbd] by default). In general, this signal indicates that the selected [GraphElement]s should be copied. */ readonly copy_nodes_request: Signal0 + /** Emitted when this [GraphEdit] captures a `ui_cut` action ([kbd]Ctrl + X[/kbd] by default). In general, this signal indicates that the selected [GraphElement]s should be cut. */ + readonly cut_nodes_request: Signal0 + /** Emitted when this [GraphEdit] captures a `ui_paste` action ([kbd]Ctrl + V[/kbd] by default). In general, this signal indicates that previously copied [GraphElement]s should be pasted. */ readonly paste_nodes_request: Signal0 @@ -963,7 +7128,7 @@ declare module "godot" { readonly node_deselected: Signal1 /** Emitted when the [GraphFrame] [param frame] is resized to [param new_rect]. */ - readonly frame_rect_changed: Signal2 + readonly frame_rect_changed: Signal2 /** Emitted when a popup is requested. Happens on right-clicking in the GraphEdit. [param at_position] is the position of the mouse pointer when the signal is sent. */ readonly popup_request: Signal1 @@ -982,17 +7147,17 @@ declare module "godot" { /** Emitted when the scroll offset is changed by the user. It will not be emitted when changed in code. */ readonly scroll_offset_changed: Signal1 } - class GraphEditFilter extends Control { + class GraphEditFilter = Record> extends Control { constructor(identifier?: any) } - class GraphEditMinimap extends Control { + class GraphEditMinimap = Record> extends Control { constructor(identifier?: any) } /** A container that represents a basic element that can be placed inside a [GraphEdit] control. * - * @link https://docs.godotengine.org/en/4.3/classes/class_graphelement.html + * @link https://docs.godotengine.org/en/4.4/classes/class_graphelement.html */ - class GraphElement extends Container { + class GraphElement = Record> extends Container { constructor(identifier?: any) /** The offset of the GraphElement, relative to the scroll offset of the [GraphEdit]. */ get position_offset(): Vector2 @@ -1043,9 +7208,9 @@ declare module "godot" { } /** GraphFrame is a special [GraphElement] that can be used to organize other [GraphElement]s inside a [GraphEdit]. * - * @link https://docs.godotengine.org/en/4.3/classes/class_graphframe.html + * @link https://docs.godotengine.org/en/4.4/classes/class_graphframe.html */ - class GraphFrame extends GraphElement { + class GraphFrame = Record> extends GraphElement { constructor(identifier?: any) /** Returns the [HBoxContainer] used for the title bar, only containing a [Label] for displaying the title by default. * This can be used to add custom controls to the title bar such as option or close buttons. @@ -1081,9 +7246,9 @@ declare module "godot" { } /** A container with connection ports, representing a node in a [GraphEdit]. * - * @link https://docs.godotengine.org/en/4.3/classes/class_graphnode.html + * @link https://docs.godotengine.org/en/4.4/classes/class_graphnode.html */ - class GraphNode extends GraphElement { + class GraphNode = Record> extends GraphElement { constructor(identifier?: any) /* gdvirtual */ _draw_port(slot_index: int64, position: Vector2i, left: boolean, color: Color): void @@ -1155,7 +7320,7 @@ declare module "godot" { /** Returns the right (output) custom [Texture2D] of the slot with the given [param slot_index]. */ get_slot_custom_icon_right(slot_index: int64): Texture2D - /** Returns true if the background [StyleBox] of the slot with the given [param slot_index] is drawn. */ + /** Returns `true` if the background [StyleBox] of the slot with the given [param slot_index] is drawn. */ is_slot_draw_stylebox(slot_index: int64): boolean /** Toggles the background [StyleBox] of the slot with the given [param slot_index]. */ @@ -1204,9 +7369,9 @@ declare module "godot" { } /** A container that arranges its child controls in a grid layout. * - * @link https://docs.godotengine.org/en/4.3/classes/class_gridcontainer.html + * @link https://docs.godotengine.org/en/4.4/classes/class_gridcontainer.html */ - class GridContainer extends Container { + class GridContainer = Record> extends Container { constructor(identifier?: any) /** The number of columns in the [GridContainer]. If modified, [GridContainer] reorders its Control-derived children to accommodate the new layout. */ get columns(): int64 @@ -1214,9 +7379,9 @@ declare module "godot" { } /** Node for 3D tile-based maps. * - * @link https://docs.godotengine.org/en/4.3/classes/class_gridmap.html + * @link https://docs.godotengine.org/en/4.4/classes/class_gridmap.html */ - class GridMap extends Node3D { + class GridMap = Record> extends Node3D { /** Invalid cell item that can be used in [method set_cell_item] to clear cells (or represent an empty cell in [method get_cell_item]). */ static readonly INVALID_CELL_ITEM = -1 constructor(identifier?: any) @@ -1337,7 +7502,7 @@ declare module "godot" { get collision_layer(): int64 set collision_layer(value: int64) - /** The physics layers this GridMap detects collisions in. See [url=https://docs.godotengine.org/en/4.3/tutorials/physics/physics_introduction.html#collision-layers-and-masks]Collision layers and masks[/url] in the documentation for more information. */ + /** The physics layers this GridMap detects collisions in. See [url=https://docs.godotengine.org/en/4.4/tutorials/physics/physics_introduction.html#collision-layers-and-masks]Collision layers and masks[/url] in the documentation for more information. */ get collision_mask(): int64 set collision_mask(value: int64) @@ -1355,19 +7520,52 @@ declare module "godot" { /** Emitted when the [MeshLibrary] of this GridMap changes. */ readonly changed: Signal0 } - class GridMapEditor extends VBoxContainer { + class GridMapEditor = Record> extends VBoxContainer { constructor(identifier?: any) _configure(): void _set_selection(_unnamed_arg0: boolean, _unnamed_arg1: Vector3, _unnamed_arg2: Vector3): void } - class GridMapEditorPlugin extends EditorPlugin { + /** Editor for [GridMap] nodes. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_gridmapeditorplugin.html + */ + class GridMapEditorPlugin = Record> extends EditorPlugin { constructor(identifier?: any) + /** Returns the [GridMap] node currently edited by the grid map editor. */ + get_current_grid_map(): GridMap + + /** Selects the cells inside the given bounds from [param begin] to [param end]. */ + set_selection(begin: Vector3i, end: Vector3i): void + + /** Deselects any currently selected cells. */ + clear_selection(): void + + /** Returns the cell coordinate bounds of the current selection. Use [method has_selection] to check if there is an active selection. */ + get_selection(): AABB + + /** Returns `true` if there are selected cells. */ + has_selection(): boolean + + /** Returns an array of [Vector3i]s with the selected cells' coordinates. */ + get_selected_cells(): GArray + + /** Selects the [MeshLibrary] item with the given index in the grid map editor's palette. If a negative index is given, no item will be selected. If a value greater than the last index is given, the last item will be selected. + * + * **Note:** The indices might not be in the same order as they appear in the editor's interface. + */ + set_selected_palette_item(item: int64): void + + /** Returns the index of the selected [MeshLibrary] item in the grid map editor's palette or `-1` if no item is selected. + * + * **Note:** The indices might not be in the same order as they appear in the editor's interface. + */ + get_selected_palette_item(): int64 } /** A physics joint that restricts the movement of two 2D physics bodies to a fixed axis. * - * @link https://docs.godotengine.org/en/4.3/classes/class_groovejoint2d.html + * @link https://docs.godotengine.org/en/4.4/classes/class_groovejoint2d.html */ - class GrooveJoint2D extends Joint2D { + class GrooveJoint2D = Record> extends Joint2D { constructor(identifier?: any) /** The groove's length. The groove is from the joint's origin towards [member length] along the joint's local Y axis. */ get length(): float64 @@ -1377,14 +7575,14 @@ declare module "godot" { get initial_offset(): float64 set initial_offset(value: float64) } - class GroupSettingsEditor extends VBoxContainer { + class GroupSettingsEditor = Record> extends VBoxContainer { constructor(identifier?: any) remove_references(_unnamed_arg0: StringName): void rename_references(_unnamed_arg0: StringName, _unnamed_arg1: StringName): void update_groups(): void readonly group_changed: Signal0 } - class GroupsEditor extends VBoxContainer { + class GroupsEditor = Record> extends VBoxContainer { constructor(identifier?: any) _update_tree(): void _update_groups(): void @@ -1396,21 +7594,21 @@ declare module "godot" { } /** A container that arranges its child controls horizontally. * - * @link https://docs.godotengine.org/en/4.3/classes/class_hboxcontainer.html + * @link https://docs.godotengine.org/en/4.4/classes/class_hboxcontainer.html */ - class HBoxContainer extends BoxContainer { + class HBoxContainer = Record> extends BoxContainer { constructor(identifier?: any) } /** A container that arranges its child controls horizontally and wraps them around at the borders. * - * @link https://docs.godotengine.org/en/4.3/classes/class_hflowcontainer.html + * @link https://docs.godotengine.org/en/4.4/classes/class_hflowcontainer.html */ - class HFlowContainer extends FlowContainer { + class HFlowContainer = Record> extends FlowContainer { constructor(identifier?: any) } /** Used to create an HMAC for a message using a key. * - * @link https://docs.godotengine.org/en/4.3/classes/class_hmaccontext.html + * @link https://docs.godotengine.org/en/4.4/classes/class_hmaccontext.html */ class HMACContext extends RefCounted { constructor(identifier?: any) @@ -1425,30 +7623,30 @@ declare module "godot" { } /** A horizontal scrollbar that goes from left (min) to right (max). * - * @link https://docs.godotengine.org/en/4.3/classes/class_hscrollbar.html + * @link https://docs.godotengine.org/en/4.4/classes/class_hscrollbar.html */ - class HScrollBar extends ScrollBar { + class HScrollBar = Record> extends ScrollBar { constructor(identifier?: any) } /** A horizontal line used for separating other controls. * - * @link https://docs.godotengine.org/en/4.3/classes/class_hseparator.html + * @link https://docs.godotengine.org/en/4.4/classes/class_hseparator.html */ - class HSeparator extends Separator { + class HSeparator = Record> extends Separator { constructor(identifier?: any) } /** A horizontal slider that goes from left (min) to right (max). * - * @link https://docs.godotengine.org/en/4.3/classes/class_hslider.html + * @link https://docs.godotengine.org/en/4.4/classes/class_hslider.html */ - class HSlider extends Slider { + class HSlider = Record> extends Slider { constructor(identifier?: any) } /** A container that splits two child controls horizontally and provides a grabber for adjusting the split ratio. * - * @link https://docs.godotengine.org/en/4.3/classes/class_hsplitcontainer.html + * @link https://docs.godotengine.org/en/4.4/classes/class_hsplitcontainer.html */ - class HSplitContainer extends SplitContainer { + class HSplitContainer = Record> extends SplitContainer { constructor(identifier?: any) } namespace HTTPClient { @@ -1524,7 +7722,12 @@ declare module "godot" { /** HTTP status code `102 Processing` (WebDAV). Indicates that the server has received and is processing the request, but no response is available yet. */ RESPONSE_PROCESSING = 102, - /** HTTP status code `200 OK`. The request has succeeded. Default response for successful requests. Meaning varies depending on the request. GET: The resource has been fetched and is transmitted in the message body. HEAD: The entity headers are in the message body. POST: The resource describing the result of the action is transmitted in the message body. TRACE: The message body contains the request message as received by the server. */ + /** HTTP status code `200 OK`. The request has succeeded. Default response for successful requests. Meaning varies depending on the request: + * - [constant METHOD_GET]: The resource has been fetched and is transmitted in the message body. + * - [constant METHOD_HEAD]: The entity headers are in the message body. + * - [constant METHOD_POST]: The resource describing the result of the action is transmitted in the message body. + * - [constant METHOD_TRACE]: The message body contains the request message as received by the server. + */ RESPONSE_OK = 200, /** HTTP status code `201 Created`. The request has succeeded and a new resource has been created as a result of it. This is typically the response sent after a PUT request. */ @@ -1701,7 +7904,7 @@ declare module "godot" { } /** Low-level hyper-text transfer protocol client. * - * @link https://docs.godotengine.org/en/4.3/classes/class_httpclient.html + * @link https://docs.godotengine.org/en/4.4/classes/class_httpclient.html */ class HTTPClient extends RefCounted { constructor(identifier?: any) @@ -1711,14 +7914,14 @@ declare module "godot" { connect_to_host(host: string, port: int64 = -1, tls_options: TLSOptions = undefined): GError /** Sends a raw request to the connected host. - * The URL parameter is usually just the part after the host, so for `https://somehost.com/index.php`, it is `/index.php`. When sending requests to an HTTP proxy server, it should be an absolute URL. For [constant HTTPClient.METHOD_OPTIONS] requests, `*` is also allowed. For [constant HTTPClient.METHOD_CONNECT] requests, it should be the authority component (`host:port`). + * The URL parameter is usually just the part after the host, so for `https://example.com/index.php`, it is `/index.php`. When sending requests to an HTTP proxy server, it should be an absolute URL. For [constant HTTPClient.METHOD_OPTIONS] requests, `*` is also allowed. For [constant HTTPClient.METHOD_CONNECT] requests, it should be the authority component (`host:port`). * Headers are HTTP request headers. For available HTTP methods, see [enum Method]. * Sends the body data raw, as a byte array and does not encode it in any way. */ request_raw(method: HTTPClient.Method, url: string, headers: PackedStringArray | string[], body: PackedByteArray | byte[] | ArrayBuffer): GError /** Sends a request to the connected host. - * The URL parameter is usually just the part after the host, so for `https://somehost.com/index.php`, it is `/index.php`. When sending requests to an HTTP proxy server, it should be an absolute URL. For [constant HTTPClient.METHOD_OPTIONS] requests, `*` is also allowed. For [constant HTTPClient.METHOD_CONNECT] requests, it should be the authority component (`host:port`). + * The URL parameter is usually just the part after the host, so for `https://example.com/index.php`, it is `/index.php`. When sending requests to an HTTP proxy server, it should be an absolute URL. For [constant HTTPClient.METHOD_OPTIONS] requests, `*` is also allowed. For [constant HTTPClient.METHOD_CONNECT] requests, it should be the authority component (`host:port`). * Headers are HTTP request headers. For available HTTP methods, see [enum Method]. * To create a POST request with query strings to push to the server, do: * @@ -1742,8 +7945,7 @@ declare module "godot" { /** Returns the response headers. */ get_response_headers(): PackedStringArray - /** Returns all response headers as a Dictionary of structure `{ "key": "value1; value2" }` where the case-sensitivity of the keys and values is kept like the server delivers it. A value is a simple String, this string can have more than one value where "; " is used as separator. - * **Example:** + /** Returns all response headers as a [Dictionary]. Each entry is composed by the header name, and a [String] containing the values separated by `"; "`. The casing is kept the same as the headers were received. * */ get_response_headers_as_dictionary(): GDictionary @@ -1798,6 +8000,8 @@ declare module "godot" { enum Result { /** Request successful. */ RESULT_SUCCESS = 0, + + /** Request failed due to a mismatch between the expected and actual chunked body size during transfer. Possible causes include network errors, server misconfiguration, or issues with chunked encoding. */ RESULT_CHUNKED_BODY_SIZE_MISMATCH = 1, /** Request failed while connecting. */ @@ -1817,6 +8021,8 @@ declare module "godot" { /** Request exceeded its maximum size limit, see [member body_size_limit]. */ RESULT_BODY_SIZE_LIMIT_EXCEEDED = 7, + + /** Request failed due to an error while decompressing the response body. Possible causes include unsupported or incorrect compression format, corrupted data, or incomplete transfer. */ RESULT_BODY_DECOMPRESS_FAILED = 8, /** Request failed (currently unused). */ @@ -1837,9 +8043,9 @@ declare module "godot" { } /** A node with the ability to send HTTP(S) requests. * - * @link https://docs.godotengine.org/en/4.3/classes/class_httprequest.html + * @link https://docs.godotengine.org/en/4.4/classes/class_httprequest.html */ - class HTTPRequest extends Node { + class HTTPRequest = Record> extends Node { constructor(identifier?: any) /** Creates request on the underlying [HTTPClient]. If there is no configuration errors, it tries to connect using [method HTTPClient.connect_to_host] and passes parameters onto [method HTTPClient.request]. * Returns [constant OK] if request is successfully created. (Does not imply that the server has responded), [constant ERR_UNCONFIGURED] if not in the tree, [constant ERR_BUSY] if still processing previous request, [constant ERR_INVALID_PARAMETER] if given string is not a valid URL format, or [constant ERR_CANT_CONNECT] if not using thread and the [HTTPClient] cannot connect to host. @@ -1934,7 +8140,7 @@ declare module "godot" { } /** Provides functionality for computing cryptographic hashes chunk by chunk. * - * @link https://docs.godotengine.org/en/4.3/classes/class_hashingcontext.html + * @link https://docs.godotengine.org/en/4.4/classes/class_hashingcontext.html */ class HashingContext extends RefCounted { constructor(identifier?: any) @@ -1949,7 +8155,7 @@ declare module "godot" { } /** A 3D height map shape used for physics collision. * - * @link https://docs.godotengine.org/en/4.3/classes/class_heightmapshape3d.html + * @link https://docs.godotengine.org/en/4.4/classes/class_heightmapshape3d.html */ class HeightMapShape3D extends Shape3D { constructor(identifier?: any) @@ -2017,9 +8223,9 @@ declare module "godot" { } /** A physics joint that restricts the rotation of a 3D physics body around an axis relative to another physics body. * - * @link https://docs.godotengine.org/en/4.3/classes/class_hingejoint3d.html + * @link https://docs.godotengine.org/en/4.4/classes/class_hingejoint3d.html */ - class HingeJoint3D extends Joint3D { + class HingeJoint3D = Record> extends Joint3D { constructor(identifier?: any) /** Sets the value of the specified parameter. */ set_param(param: HingeJoint3D.Param, value: float64): void @@ -2032,9 +8238,49 @@ declare module "godot" { /** Returns the value of the specified flag. */ get_flag(flag: HingeJoint3D.Flag): boolean + + /** The speed with which the two bodies get pulled together when they move in different directions. */ + get "params/bias"(): float64 + set "params/bias"(value: float64) + + /** If `true`, the hinges maximum and minimum rotation, defined by [member angular_limit/lower] and [member angular_limit/upper] has effects. */ + get "angular_limit/enable"(): boolean + set "angular_limit/enable"(value: boolean) + + /** The maximum rotation. Only active if [member angular_limit/enable] is `true`. */ + get "angular_limit/upper"(): float64 + set "angular_limit/upper"(value: float64) + + /** The minimum rotation. Only active if [member angular_limit/enable] is `true`. */ + get "angular_limit/lower"(): float64 + set "angular_limit/lower"(value: float64) + + /** The speed with which the rotation across the axis perpendicular to the hinge gets corrected. */ + get "angular_limit/bias"(): float64 + set "angular_limit/bias"(value: float64) + get "angular_limit/softness"(): float64 + set "angular_limit/softness"(value: float64) + + /** The lower this value, the more the rotation gets slowed down. */ + get "angular_limit/relaxation"(): float64 + set "angular_limit/relaxation"(value: float64) + + /** When activated, a motor turns the hinge. */ + get "motor/enable"(): boolean + set "motor/enable"(value: boolean) + + /** Target speed for the motor. */ + get "motor/target_velocity"(): float64 + set "motor/target_velocity"(value: float64) + + /** Maximum acceleration for the motor. */ + get "motor/max_impulse"(): float64 + set "motor/max_impulse"(value: float64) } - class HistoryDock extends VBoxContainer { + class HistoryDock = Record> extends VBoxContainer { constructor(identifier?: any) + _save_layout_to_config(_unnamed_arg0: ConfigFile, _unnamed_arg1: string): void + _load_layout_from_config(_unnamed_arg0: ConfigFile, _unnamed_arg1: string): void } namespace Image { enum Format { @@ -2275,7 +8521,7 @@ declare module "godot" { } /** Image datatype. * - * @link https://docs.godotengine.org/en/4.3/classes/class_image.html + * @link https://docs.godotengine.org/en/4.4/classes/class_image.html */ class Image extends Resource { /** The maximal width allowed for [Image] resources. */ @@ -2356,7 +8602,7 @@ declare module "godot" { /** Returns `true` if the image has no data. */ is_empty(): boolean - /** Loads an image from file [param path]. See [url=https://docs.godotengine.org/en/4.3/tutorials/assets_pipeline/importing_images.html#supported-image-formats]Supported image formats[/url] for a list of supported image formats and limitations. + /** Loads an image from file [param path]. See [url=https://docs.godotengine.org/en/4.4/tutorials/assets_pipeline/importing_images.html#supported-image-formats]Supported image formats[/url] for a list of supported image formats and limitations. * **Warning:** This method should only be used in the editor or in cases when you need to load external images at run-time, such as images located at the `user://` directory, and may not work in exported projects. * See also [ImageTexture] description for usage examples. */ @@ -2395,13 +8641,13 @@ declare module "godot" { */ save_exr_to_buffer(grayscale: boolean = false): PackedByteArray - /** Saves the image as a WebP (Web Picture) file to the file at [param path]. By default it will save lossless. If [param lossy] is true, the image will be saved lossy, using the [param quality] setting between 0.0 and 1.0 (inclusive). Lossless WebP offers more efficient compression than PNG. + /** Saves the image as a WebP (Web Picture) file to the file at [param path]. By default it will save lossless. If [param lossy] is `true`, the image will be saved lossy, using the [param quality] setting between `0.0` and `1.0` (inclusive). Lossless WebP offers more efficient compression than PNG. * * **Note:** The WebP format is limited to a size of 16383×16383 pixels, while PNG can save larger images. */ save_webp(path: string, lossy: boolean = false, quality: float64 = 0.75): GError - /** Saves the image as a WebP (Web Picture) file to a byte array. By default it will save lossless. If [param lossy] is true, the image will be saved lossy, using the [param quality] setting between 0.0 and 1.0 (inclusive). Lossless WebP offers more efficient compression than PNG. + /** Saves the image as a WebP (Web Picture) file to a byte array. By default it will save lossless. If [param lossy] is `true`, the image will be saved lossy, using the [param quality] setting between `0.0` and `1.0` (inclusive). Lossless WebP offers more efficient compression than PNG. * * **Note:** The WebP format is limited to a size of 16383×16383 pixels, while PNG can save larger images. */ @@ -2449,9 +8695,12 @@ declare module "godot" { /** Multiplies color values with alpha values. Resulting color values for a pixel are `(color * alpha)/256`. See also [member CanvasItemMaterial.blend_mode]. */ premultiply_alpha(): void - /** Converts the raw data from the sRGB colorspace to a linear scale. */ + /** Converts the raw data from the sRGB colorspace to a linear scale. Only works on images with [constant FORMAT_RGB8] or [constant FORMAT_RGBA8] formats. */ srgb_to_linear(): void + /** Converts the entire image from the linear colorspace to the sRGB colorspace. Only works on images with [constant FORMAT_RGB8] or [constant FORMAT_RGBA8] formats. */ + linear_to_srgb(): void + /** Converts the image's data to represent coordinates on a 3D plane. This is used when the image represents a normal map. A normal map can add lots of detail to a 3D surface without increasing the polygon count. */ normal_map_to_xy(): void @@ -2466,7 +8715,10 @@ declare module "godot" { */ compute_image_metrics(compared_image: Image, use_luma: boolean): GDictionary - /** Copies [param src_rect] from [param src] image to this image at coordinates [param dst], clipped accordingly to both image bounds. This image and [param src] image **must** have the same format. [param src_rect] with non-positive size is treated as empty. */ + /** Copies [param src_rect] from [param src] image to this image at coordinates [param dst], clipped accordingly to both image bounds. This image and [param src] image **must** have the same format. [param src_rect] with non-positive size is treated as empty. + * + * **Note:** The alpha channel data in [param src] will overwrite the corresponding data in this image at the target position. To blend alpha channels, use [method blend_rect] instead. + */ blit_rect(src: Image, src_rect: Rect2i, dst: Vector2i): void /** Blits [param src_rect] area from [param src] image to this image at the coordinates given by [param dst], clipped accordingly to both image bounds. [param src] pixel is copied onto [param dst] if the corresponding [param mask] pixel's alpha value is not 0. This image and [param src] image **must** have the same format. [param src] image and [param mask] image **must** have the same size (width and height) but they can have different formats. [param src_rect] with non-positive size is treated as empty. */ @@ -2504,14 +8756,12 @@ declare module "godot" { get_pixel(x: int64, y: int64): Color /** Sets the [Color] of the pixel at [param point] to [param color]. - * **Example:** * * This is the same as [method set_pixel], but with a [Vector2i] argument instead of two integer arguments. */ set_pixelv(point: Vector2i, color: Color): void /** Sets the [Color] of the pixel at `(x, y)` to [param color]. - * **Example:** * * This is the same as [method set_pixelv], but with a two integer arguments instead of a [Vector2i] argument. */ @@ -2578,14 +8828,14 @@ declare module "godot" { } /** Base class to add support for specific image formats. * - * @link https://docs.godotengine.org/en/4.3/classes/class_imageformatloader.html + * @link https://docs.godotengine.org/en/4.4/classes/class_imageformatloader.html */ class ImageFormatLoader extends RefCounted { constructor(identifier?: any) } /** Base class for creating [ImageFormatLoader] extensions (adding support for extra image formats). * - * @link https://docs.godotengine.org/en/4.3/classes/class_imageformatloaderextension.html + * @link https://docs.godotengine.org/en/4.4/classes/class_imageformatloaderextension.html */ class ImageFormatLoaderExtension extends ImageFormatLoader { constructor(identifier?: any) @@ -2603,7 +8853,7 @@ declare module "godot" { } /** A [Texture2D] based on an [Image]. * - * @link https://docs.godotengine.org/en/4.3/classes/class_imagetexture.html + * @link https://docs.godotengine.org/en/4.4/classes/class_imagetexture.html */ class ImageTexture extends Texture2D { constructor(identifier?: any) @@ -2630,7 +8880,7 @@ declare module "godot" { } /** Texture with 3 dimensions. * - * @link https://docs.godotengine.org/en/4.3/classes/class_imagetexture3d.html + * @link https://docs.godotengine.org/en/4.4/classes/class_imagetexture3d.html */ class ImageTexture3D extends Texture3D { constructor(identifier?: any) @@ -2644,12 +8894,13 @@ declare module "godot" { } /** Base class for texture types which contain the data of multiple [ImageTexture]s. Each image is of the same size and format. * - * @link https://docs.godotengine.org/en/4.3/classes/class_imagetexturelayered.html + * @link https://docs.godotengine.org/en/4.4/classes/class_imagetexturelayered.html */ class ImageTextureLayered extends TextureLayered { constructor(identifier?: any) /** Creates an [ImageTextureLayered] from an array of [Image]s. See [method Image.create] for the expected data format. The first image decides the width, height, image format and mipmapping setting. The other images *must* have the same width, height, image format and mipmapping setting. * Each [Image] represents one `layer`. + * */ create_from_images(images: GArray): GError @@ -2664,7 +8915,7 @@ declare module "godot" { } /** Mesh optimized for creating geometry manually. * - * @link https://docs.godotengine.org/en/4.3/classes/class_immediatemesh.html + * @link https://docs.godotengine.org/en/4.4/classes/class_immediatemesh.html */ class ImmediateMesh extends Mesh { constructor(identifier?: any) @@ -2698,13 +8949,13 @@ declare module "godot" { /** Clear all surfaces. */ clear_surfaces(): void } - class ImportDefaultsEditor extends VBoxContainer { + class ImportDefaultsEditor = Record> extends VBoxContainer { constructor(identifier?: any) } class ImportDefaultsEditorSettings extends Object { constructor(identifier?: any) } - class ImportDock extends VBoxContainer { + class ImportDock = Record> extends VBoxContainer { constructor(identifier?: any) _reimport(): void } @@ -2713,7 +8964,7 @@ declare module "godot" { } /** A [Resource] that contains vertex array-based geometry during the import process. * - * @link https://docs.godotengine.org/en/4.3/classes/class_importermesh.html + * @link https://docs.godotengine.org/en/4.4/classes/class_importermesh.html */ class ImporterMesh extends Resource { constructor(identifier?: any) @@ -2737,7 +8988,7 @@ declare module "godot" { * The [param arrays] argument is an array of arrays. Each of the [constant Mesh.ARRAY_MAX] elements contains an array with some of the mesh data for this surface as described by the corresponding member of [enum Mesh.ArrayType] or `null` if it is not used by the surface. For example, `arrays[0]` is the array of vertices. That first vertex sub-array is always required; the others are optional. Adding an index array puts this surface into "index mode" where the vertex and other arrays become the sources of data and the index array defines the vertex order. All sub-arrays must have the same length as the vertex array (or be an exact multiple of the vertex array's length, when multiple elements of a sub-array correspond to a single vertex) or be empty, except for [constant Mesh.ARRAY_INDEX] if it is used. * The [param blend_shapes] argument is an array of vertex data for each blend shape. Each element is an array of the same structure as [param arrays], but [constant Mesh.ARRAY_VERTEX], [constant Mesh.ARRAY_NORMAL], and [constant Mesh.ARRAY_TANGENT] are set if and only if they are set in [param arrays] and all other entries are `null`. * The [param lods] argument is a dictionary with [float] keys and [PackedInt32Array] values. Each entry in the dictionary represents an LOD level of the surface, where the value is the [constant Mesh.ARRAY_INDEX] array to use for the LOD level and the key is roughly proportional to the distance at which the LOD stats being used. I.e., increasing the key of an LOD also increases the distance that the objects has to be from the camera before the LOD is used. - * The [param flags] argument is the bitwise or of, as required: One value of [enum Mesh.ArrayCustomFormat] left shifted by `ARRAY_FORMAT_CUSTOMn_SHIFT` for each custom channel in use, [constant Mesh.ARRAY_FLAG_USE_DYNAMIC_UPDATE], [constant Mesh.ARRAY_FLAG_USE_8_BONE_WEIGHTS], or [constant Mesh.ARRAY_FLAG_USES_EMPTY_VERTEX_ARRAY]. + * The [param flags] argument is the bitwise OR of, as required: One value of [enum Mesh.ArrayCustomFormat] left shifted by `ARRAY_FORMAT_CUSTOMn_SHIFT` for each custom channel in use, [constant Mesh.ARRAY_FLAG_USE_DYNAMIC_UPDATE], [constant Mesh.ARRAY_FLAG_USE_8_BONE_WEIGHTS], or [constant Mesh.ARRAY_FLAG_USES_EMPTY_VERTEX_ARRAY]. * * **Note:** When using indices, it is recommended to only use points, lines, or triangles. */ @@ -2780,7 +9031,8 @@ declare module "godot" { set_surface_material(surface_idx: int64, material: Material): void /** Generates all lods for this ImporterMesh. - * [param normal_merge_angle] and [param normal_split_angle] are in degrees and used in the same way as the importer settings in `lods`. As a good default, use 25 and 60 respectively. + * [param normal_merge_angle] is in degrees and used in the same way as the importer settings in `lods`. + * [param normal_split_angle] is not used and only remains for compatibility with older versions of the API. * The number of generated lods can be accessed using [method get_surface_lod_count], and each LOD is available in [method get_surface_lod_size] and [method get_surface_lod_indices]. * [param bone_transform_array] is an [Array] which can be either empty or contain [Transform3D]s which, for each of the mesh's bone IDs, will apply mesh skinning when generating the LOD mesh variations. This is usually used to account for discrepancies in scale between the mesh itself and its skinning data. */ @@ -2803,8 +9055,8 @@ declare module "godot" { get _data(): GDictionary set _data(value: GDictionary) } - /** @link https://docs.godotengine.org/en/4.3/classes/class_importermeshinstance3d.html */ - class ImporterMeshInstance3D extends Node3D { + /** @link https://docs.godotengine.org/en/4.4/classes/class_importermeshinstance3d.html */ + class ImporterMeshInstance3D = Record> extends Node3D { constructor(identifier?: any) get mesh(): ImporterMesh set mesh(value: ImporterMesh) @@ -2829,7 +9081,7 @@ declare module "godot" { } /** Abstract base class for input events. * - * @link https://docs.godotengine.org/en/4.3/classes/class_inputevent.html + * @link https://docs.godotengine.org/en/4.4/classes/class_inputevent.html */ class InputEvent extends Resource { /** Device ID used for emulated mouse input from a touchscreen, or for emulated touch input from a mouse. This can be used to distinguish emulated mouse input from physical mouse input, or emulated touch input from physical touch input. */ @@ -2844,7 +9096,7 @@ declare module "godot" { /** Returns `true` if the given action is being pressed (and is not an echo event for [InputEventKey] events, unless [param allow_echo] is `true`). Not relevant for events of type [InputEventMouseMotion] or [InputEventScreenDrag]. * If [param exact_match] is `false`, it ignores additional input modifiers for [InputEventKey] and [InputEventMouseButton] events, and the direction for [InputEventJoypadMotion] events. * - * **Note:** Due to keyboard ghosting, [method is_action_pressed] may return `false` even if one of the action's keys is pressed. See [url=https://docs.godotengine.org/en/4.3/tutorials/inputs/input_examples.html#keyboard-events]Input examples[/url] in the documentation for more information. + * **Note:** Due to keyboard ghosting, [method is_action_pressed] may return `false` even if one of the action's keys is pressed. See [url=https://docs.godotengine.org/en/4.4/tutorials/inputs/input_examples.html#keyboard-events]Input examples[/url] in the documentation for more information. */ is_action_pressed(action: StringName, allow_echo: boolean = false, exact_match: boolean = false): boolean @@ -2863,7 +9115,7 @@ declare module "godot" { /** Returns `true` if this input event is pressed. Not relevant for events of type [InputEventMouseMotion] or [InputEventScreenDrag]. * - * **Note:** Due to keyboard ghosting, [method is_pressed] may return `false` even if one of the action's keys is pressed. See [url=https://docs.godotengine.org/en/4.3/tutorials/inputs/input_examples.html#keyboard-events]Input examples[/url] in the documentation for more information. + * **Note:** Due to keyboard ghosting, [method is_pressed] may return `false` even if one of the action's keys is pressed. See [url=https://docs.godotengine.org/en/4.4/tutorials/inputs/input_examples.html#keyboard-events]Input examples[/url] in the documentation for more information. */ is_pressed(): boolean @@ -2881,6 +9133,8 @@ declare module "godot" { /** Returns `true` if the specified [param event] matches this event. Only valid for action events i.e key ([InputEventKey]), button ([InputEventMouseButton] or [InputEventJoypadButton]), axis [InputEventJoypadMotion] or action ([InputEventAction]) events. * If [param exact_match] is `false`, it ignores additional input modifiers for [InputEventKey] and [InputEventMouseButton] events, and the direction for [InputEventJoypadMotion] events. + * + * **Note:** Only considers the event configuration (such as the keyboard key or joypad axis), not state information like [method is_pressed], [method is_released], [method is_echo], or [method is_canceled]. */ is_match(event: InputEvent, exact_match: boolean = true): boolean @@ -2904,7 +9158,7 @@ declare module "godot" { } /** An input event type for actions. * - * @link https://docs.godotengine.org/en/4.3/classes/class_inputeventaction.html + * @link https://docs.godotengine.org/en/4.4/classes/class_inputeventaction.html */ class InputEventAction extends InputEvent { constructor(identifier?: any) @@ -2924,15 +9178,15 @@ declare module "godot" { get event_index(): int64 set event_index(value: int64) } - class InputEventConfigurationDialog extends ConfirmationDialog { + class InputEventConfigurationDialog = Record> extends ConfirmationDialog { constructor(identifier?: any) } - class InputEventEditorPlugin extends EditorPlugin { + class InputEventEditorPlugin = Record> extends EditorPlugin { constructor(identifier?: any) } /** Abstract base class for [Viewport]-based input events. * - * @link https://docs.godotengine.org/en/4.3/classes/class_inputeventfromwindow.html + * @link https://docs.godotengine.org/en/4.4/classes/class_inputeventfromwindow.html */ class InputEventFromWindow extends InputEvent { constructor(identifier?: any) @@ -2942,7 +9196,7 @@ declare module "godot" { } /** Abstract base class for touch gestures. * - * @link https://docs.godotengine.org/en/4.3/classes/class_inputeventgesture.html + * @link https://docs.godotengine.org/en/4.4/classes/class_inputeventgesture.html */ class InputEventGesture extends InputEventWithModifiers { constructor(identifier?: any) @@ -2950,6590 +9204,4 @@ declare module "godot" { get position(): Vector2 set position(value: Vector2) } - /** Represents a gamepad button being pressed or released. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_inputeventjoypadbutton.html - */ - class InputEventJoypadButton extends InputEvent { - constructor(identifier?: any) - /** Button identifier. One of the [enum JoyButton] button constants. */ - get button_index(): int64 - set button_index(value: int64) - get pressure(): float64 - set pressure(value: float64) - - /** If `true`, the button's state is pressed. If `false`, the button's state is released. */ - get pressed(): boolean - set pressed(value: boolean) - } - /** Represents axis motions (such as joystick or analog triggers) from a gamepad. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_inputeventjoypadmotion.html - */ - class InputEventJoypadMotion extends InputEvent { - constructor(identifier?: any) - /** Axis identifier. Use one of the [enum JoyAxis] axis constants. */ - get axis(): int64 - set axis(value: int64) - - /** Current position of the joystick on the given axis. The value ranges from `-1.0` to `1.0`. A value of `0` means the axis is in its resting position. */ - get axis_value(): float64 - set axis_value(value: float64) - } - /** Represents a key on a keyboard being pressed or released. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_inputeventkey.html - */ - class InputEventKey extends InputEventWithModifiers { - constructor(identifier?: any) - /** Returns the Latin keycode combined with modifier keys such as [kbd]Shift[/kbd] or [kbd]Alt[/kbd]. See also [InputEventWithModifiers]. - * To get a human-readable representation of the [InputEventKey] with modifiers, use `OS.get_keycode_string(event.get_keycode_with_modifiers())` where `event` is the [InputEventKey]. - */ - get_keycode_with_modifiers(): Key - - /** Returns the physical keycode combined with modifier keys such as [kbd]Shift[/kbd] or [kbd]Alt[/kbd]. See also [InputEventWithModifiers]. - * To get a human-readable representation of the [InputEventKey] with modifiers, use `OS.get_keycode_string(event.get_physical_keycode_with_modifiers())` where `event` is the [InputEventKey]. - */ - get_physical_keycode_with_modifiers(): Key - - /** Returns the localized key label combined with modifier keys such as [kbd]Shift[/kbd] or [kbd]Alt[/kbd]. See also [InputEventWithModifiers]. - * To get a human-readable representation of the [InputEventKey] with modifiers, use `OS.get_keycode_string(event.get_key_label_with_modifiers())` where `event` is the [InputEventKey]. - */ - get_key_label_with_modifiers(): Key - - /** Returns a [String] representation of the event's [member keycode] and modifiers. */ - as_text_keycode(): string - - /** Returns a [String] representation of the event's [member physical_keycode] and modifiers. */ - as_text_physical_keycode(): string - - /** Returns a [String] representation of the event's [member key_label] and modifiers. */ - as_text_key_label(): string - - /** Returns a [String] representation of the event's [member location]. This will be a blank string if the event is not specific to a location. */ - as_text_location(): string - - /** If `true`, the key's state is pressed. If `false`, the key's state is released. */ - get pressed(): boolean - set pressed(value: boolean) - - /** Latin label printed on the key in the current keyboard layout, which corresponds to one of the [enum Key] constants. - * To get a human-readable representation of the [InputEventKey], use `OS.get_keycode_string(event.keycode)` where `event` is the [InputEventKey]. - * [codeblock lang=text] - * +-----+ +-----+ - * | Q | | Q | - "Q" - keycode - * | Й | | ض | - "Й" and "ض" - key_label - * +-----+ +-----+ - * [/codeblock] - */ - get keycode(): int64 - set keycode(value: int64) - - /** Represents the physical location of a key on the 101/102-key US QWERTY keyboard, which corresponds to one of the [enum Key] constants. - * To get a human-readable representation of the [InputEventKey], use [method OS.get_keycode_string] in combination with [method DisplayServer.keyboard_get_keycode_from_physical]: - * - */ - get physical_keycode(): int64 - set physical_keycode(value: int64) - - /** Represents the localized label printed on the key in the current keyboard layout, which corresponds to one of the [enum Key] constants or any valid Unicode character. - * For keyboard layouts with a single label on the key, it is equivalent to [member keycode]. - * To get a human-readable representation of the [InputEventKey], use `OS.get_keycode_string(event.key_label)` where `event` is the [InputEventKey]. - * [codeblock lang=text] - * +-----+ +-----+ - * | Q | | Q | - "Q" - keycode - * | Й | | ض | - "Й" and "ض" - key_label - * +-----+ +-----+ - * [/codeblock] - */ - get key_label(): int64 - set key_label(value: int64) - - /** The key Unicode character code (when relevant), shifted by modifier keys. Unicode character codes for composite characters and complex scripts may not be available unless IME input mode is active. See [method Window.set_ime_active] for more information. */ - get unicode(): int64 - set unicode(value: int64) - - /** Represents the location of a key which has both left and right versions, such as [kbd]Shift[/kbd] or [kbd]Alt[/kbd]. */ - get location(): int64 - set location(value: int64) - - /** If `true`, the key was already pressed before this event. An echo event is a repeated key event sent when the user is holding down the key. - * - * **Note:** The rate at which echo events are sent is typically around 20 events per second (after holding down the key for roughly half a second). However, the key repeat delay/speed can be changed by the user or disabled entirely in the operating system settings. To ensure your project works correctly on all configurations, do not assume the user has a specific key repeat configuration in your project's behavior. - */ - get echo(): boolean - set echo(value: boolean) - } - /** Represents a MIDI message from a MIDI device, such as a musical keyboard. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_inputeventmidi.html - */ - class InputEventMIDI extends InputEvent { - constructor(identifier?: any) - /** The MIDI channel of this message, ranging from `0` to `15`. MIDI channel `9` is reserved for percussion instruments. */ - get channel(): int64 - set channel(value: int64) - - /** Represents the type of MIDI message (see the [enum MIDIMessage] enum). - * For more information, see the [url=https://www.midi.org/specifications-old/item/table-2-expanded-messages-list-status-bytes]MIDI message status byte list chart[/url]. - */ - get message(): int64 - set message(value: int64) - - /** The pitch index number of this MIDI message. This value ranges from `0` to `127`. - * On a piano, the **middle C** is `60`, followed by a **C-sharp** (`61`), then a **D** (`62`), and so on. Each octave is split in offsets of 12. See the "MIDI note number" column of the [url=https://en.wikipedia.org/wiki/Piano_key_frequencies]piano key frequency chart[/url] a full list. - */ - get pitch(): int64 - set pitch(value: int64) - - /** The velocity of the MIDI message. This value ranges from `0` to `127`. For a musical keyboard, this corresponds to how quickly the key was pressed, and is rarely above `110` in practice. - * - * **Note:** Some MIDI devices may send a [constant MIDI_MESSAGE_NOTE_ON] message with `0` velocity and expect it to be treated the same as a [constant MIDI_MESSAGE_NOTE_OFF] message. If necessary, this can be handled with a few lines of code: - * - */ - get velocity(): int64 - set velocity(value: int64) - - /** The instrument (also called *program* or *preset* ) used on this MIDI message. This value ranges from `0` to `127`. - * To see what each value means, refer to the [url=https://en.wikipedia.org/wiki/General_MIDI#Program_change_events]General MIDI's instrument list[/url]. Keep in mind that the list is off by 1 because it does not begin from 0. A value of `0` corresponds to the acoustic grand piano. - */ - get instrument(): int64 - set instrument(value: int64) - - /** The strength of the key being pressed. This value ranges from `0` to `127`. - * - * **Note:** For many devices, this value is always `0`. Other devices such as musical keyboards may simulate pressure by changing the [member velocity], instead. - */ - get pressure(): int64 - set pressure(value: int64) - - /** The unique number of the controller, if [member message] is [constant MIDI_MESSAGE_CONTROL_CHANGE], otherwise this is `0`. This value can be used to identify sliders for volume, balance, and panning, as well as switches and pedals on the MIDI device. See the [url=https://en.wikipedia.org/wiki/General_MIDI#Controller_events]General MIDI specification[/url] for a small list. */ - get controller_number(): int64 - set controller_number(value: int64) - - /** The value applied to the controller. If [member message] is [constant MIDI_MESSAGE_CONTROL_CHANGE], this value ranges from `0` to `127`, otherwise it is `0`. See also [member controller_value]. */ - get controller_value(): int64 - set controller_value(value: int64) - } - /** Represents a magnifying touch gesture. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_inputeventmagnifygesture.html - */ - class InputEventMagnifyGesture extends InputEventGesture { - constructor(identifier?: any) - /** The amount (or delta) of the event. This value is closer to `1.0` the slower the gesture is performed. */ - get factor(): float64 - set factor(value: float64) - } - /** Base input event type for mouse events. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_inputeventmouse.html - */ - class InputEventMouse extends InputEventWithModifiers { - constructor(identifier?: any) - /** The mouse button mask identifier, one of or a bitwise combination of the [enum MouseButton] button masks. */ - get button_mask(): int64 - set button_mask(value: int64) - - /** When received in [method Node._input] or [method Node._unhandled_input], returns the mouse's position in the [Viewport] this [Node] is in using the coordinate system of this [Viewport]. - * When received in [method Control._gui_input], returns the mouse's position in the [Control] using the local coordinate system of the [Control]. - */ - get position(): Vector2 - set position(value: Vector2) - - /** When received in [method Node._input] or [method Node._unhandled_input], returns the mouse's position in the root [Viewport] using the coordinate system of the root [Viewport]. - * When received in [method Control._gui_input], returns the mouse's position in the [CanvasLayer] that the [Control] is in using the coordinate system of the [CanvasLayer]. - */ - get global_position(): Vector2 - set global_position(value: Vector2) - } - /** Represents a mouse button being pressed or released. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_inputeventmousebutton.html - */ - class InputEventMouseButton extends InputEventMouse { - constructor(identifier?: any) - /** The amount (or delta) of the event. When used for high-precision scroll events, this indicates the scroll amount (vertical or horizontal). This is only supported on some platforms; the reported sensitivity varies depending on the platform. May be `0` if not supported. */ - get factor(): float64 - set factor(value: float64) - - /** The mouse button identifier, one of the [enum MouseButton] button or button wheel constants. */ - get button_index(): int64 - set button_index(value: int64) - - /** If `true`, the mouse button event has been canceled. */ - get canceled(): boolean - set canceled(value: boolean) - - /** If `true`, the mouse button's state is pressed. If `false`, the mouse button's state is released. */ - get pressed(): boolean - set pressed(value: boolean) - - /** If `true`, the mouse button's state is a double-click. */ - get double_click(): boolean - set double_click(value: boolean) - } - /** Represents a mouse or a pen movement. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_inputeventmousemotion.html - */ - class InputEventMouseMotion extends InputEventMouse { - constructor(identifier?: any) - /** Represents the angles of tilt of the pen. Positive X-coordinate value indicates a tilt to the right. Positive Y-coordinate value indicates a tilt toward the user. Ranges from `-1.0` to `1.0` for both axes. */ - get tilt(): Vector2 - set tilt(value: Vector2) - - /** Represents the pressure the user puts on the pen. Ranges from `0.0` to `1.0`. */ - get pressure(): float64 - set pressure(value: float64) - - /** Returns `true` when using the eraser end of a stylus pen. - * - * **Note:** This property is implemented on Linux, macOS and Windows. - */ - get pen_inverted(): boolean - set pen_inverted(value: boolean) - - /** The mouse position relative to the previous position (position at the last frame). - * - * **Note:** Since [InputEventMouseMotion] is only emitted when the mouse moves, the last event won't have a relative position of `Vector2(0, 0)` when the user stops moving the mouse. - * - * **Note:** [member relative] is automatically scaled according to the content scale factor, which is defined by the project's stretch mode settings. This means mouse sensitivity will appear different depending on resolution when using [member relative] in a script that handles mouse aiming with the [constant Input.MOUSE_MODE_CAPTURED] mouse mode. To avoid this, use [member screen_relative] instead. - */ - get relative(): Vector2 - set relative(value: Vector2) - - /** The unscaled mouse position relative to the previous position in the coordinate system of the screen (position at the last frame). - * - * **Note:** Since [InputEventMouseMotion] is only emitted when the mouse moves, the last event won't have a relative position of `Vector2(0, 0)` when the user stops moving the mouse. This coordinate is *not* scaled according to the content scale factor or calls to [method InputEvent.xformed_by]. This should be preferred over [member relative] for mouse aiming when using the [constant Input.MOUSE_MODE_CAPTURED] mouse mode, regardless of the project's stretch mode. - */ - get screen_relative(): Vector2 - set screen_relative(value: Vector2) - - /** The mouse velocity in pixels per second. - * - * **Note:** [member velocity] is automatically scaled according to the content scale factor, which is defined by the project's stretch mode settings. This means mouse sensitivity will appear different depending on resolution when using [member velocity] in a script that handles mouse aiming with the [constant Input.MOUSE_MODE_CAPTURED] mouse mode. To avoid this, use [member screen_velocity] instead. - */ - get velocity(): Vector2 - set velocity(value: Vector2) - - /** The unscaled mouse velocity in pixels per second in screen coordinates. This velocity is *not* scaled according to the content scale factor or calls to [method InputEvent.xformed_by]. This should be preferred over [member velocity] for mouse aiming when using the [constant Input.MOUSE_MODE_CAPTURED] mouse mode, regardless of the project's stretch mode. */ - get screen_velocity(): Vector2 - set screen_velocity(value: Vector2) - } - /** Represents a panning touch gesture. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_inputeventpangesture.html - */ - class InputEventPanGesture extends InputEventGesture { - constructor(identifier?: any) - /** Panning amount since last pan event. */ - get delta(): Vector2 - set delta(value: Vector2) - } - /** Represents a screen drag event. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_inputeventscreendrag.html - */ - class InputEventScreenDrag extends InputEventFromWindow { - constructor(identifier?: any) - /** The drag event index in the case of a multi-drag event. */ - get index(): int64 - set index(value: int64) - - /** Represents the angles of tilt of the pen. Positive X-coordinate value indicates a tilt to the right. Positive Y-coordinate value indicates a tilt toward the user. Ranges from `-1.0` to `1.0` for both axes. */ - get tilt(): Vector2 - set tilt(value: Vector2) - - /** Represents the pressure the user puts on the pen. Ranges from `0.0` to `1.0`. */ - get pressure(): float64 - set pressure(value: float64) - - /** Returns `true` when using the eraser end of a stylus pen. */ - get pen_inverted(): boolean - set pen_inverted(value: boolean) - - /** The drag position in the viewport the node is in, using the coordinate system of this viewport. */ - get position(): Vector2 - set position(value: Vector2) - - /** The drag position relative to the previous position (position at the last frame). - * - * **Note:** [member relative] is automatically scaled according to the content scale factor, which is defined by the project's stretch mode settings. This means touch sensitivity will appear different depending on resolution when using [member relative] in a script that handles touch aiming. To avoid this, use [member screen_relative] instead. - */ - get relative(): Vector2 - set relative(value: Vector2) - - /** The unscaled drag position relative to the previous position in screen coordinates (position at the last frame). This position is *not* scaled according to the content scale factor or calls to [method InputEvent.xformed_by]. This should be preferred over [member relative] for touch aiming regardless of the project's stretch mode. */ - get screen_relative(): Vector2 - set screen_relative(value: Vector2) - - /** The drag velocity. - * - * **Note:** [member velocity] is automatically scaled according to the content scale factor, which is defined by the project's stretch mode settings. This means touch sensitivity will appear different depending on resolution when using [member velocity] in a script that handles touch aiming. To avoid this, use [member screen_velocity] instead. - */ - get velocity(): Vector2 - set velocity(value: Vector2) - - /** The unscaled drag velocity in pixels per second in screen coordinates. This velocity is *not* scaled according to the content scale factor or calls to [method InputEvent.xformed_by]. This should be preferred over [member velocity] for touch aiming regardless of the project's stretch mode. */ - get screen_velocity(): Vector2 - set screen_velocity(value: Vector2) - } - /** Represents a screen touch event. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_inputeventscreentouch.html - */ - class InputEventScreenTouch extends InputEventFromWindow { - constructor(identifier?: any) - /** The touch index in the case of a multi-touch event. One index = one finger. */ - get index(): int64 - set index(value: int64) - - /** The touch position in the viewport the node is in, using the coordinate system of this viewport. */ - get position(): Vector2 - set position(value: Vector2) - - /** If `true`, the touch event has been canceled. */ - get canceled(): boolean - set canceled(value: boolean) - - /** If `true`, the touch's state is pressed. If `false`, the touch's state is released. */ - get pressed(): boolean - set pressed(value: boolean) - - /** If `true`, the touch's state is a double tap. */ - get double_tap(): boolean - set double_tap(value: boolean) - } - /** Represents a triggered keyboard [Shortcut]. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_inputeventshortcut.html - */ - class InputEventShortcut extends InputEvent { - constructor(identifier?: any) - /** The [Shortcut] represented by this event. Its [method Shortcut.matches_event] method will always return `true` for this event. */ - get shortcut(): Shortcut - set shortcut(value: Shortcut) - } - /** Abstract base class for input events affected by modifier keys like [kbd]Shift[/kbd] and [kbd]Alt[/kbd]. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_inputeventwithmodifiers.html - */ - class InputEventWithModifiers extends InputEventFromWindow { - constructor(identifier?: any) - /** On macOS, returns `true` if [kbd]Meta[/kbd] ([kbd]Cmd[/kbd]) is pressed. - * On other platforms, returns `true` if [kbd]Ctrl[/kbd] is pressed. - */ - is_command_or_control_pressed(): boolean - - /** Returns the keycode combination of modifier keys. */ - get_modifiers_mask(): KeyModifierMask - - /** Automatically use [kbd]Meta[/kbd] ([kbd]Cmd[/kbd]) on macOS and [kbd]Ctrl[/kbd] on other platforms. If `true`, [member ctrl_pressed] and [member meta_pressed] cannot be set. */ - get command_or_control_autoremap(): boolean - set command_or_control_autoremap(value: boolean) - - /** State of the [kbd]Alt[/kbd] modifier. */ - get alt_pressed(): boolean - set alt_pressed(value: boolean) - - /** State of the [kbd]Shift[/kbd] modifier. */ - get shift_pressed(): boolean - set shift_pressed(value: boolean) - - /** State of the [kbd]Ctrl[/kbd] modifier. */ - get ctrl_pressed(): boolean - set ctrl_pressed(value: boolean) - - /** State of the [kbd]Meta[/kbd] modifier. On Windows and Linux, this represents the Windows key (sometimes called "meta" or "super" on Linux). On macOS, this represents the Command key. */ - get meta_pressed(): boolean - set meta_pressed(value: boolean) - } - class InspectorDock extends VBoxContainer { - constructor(identifier?: any) - store_script_properties(_unnamed_arg0: Object): void - apply_script_properties(_unnamed_arg0: Object): void - readonly request_help: Signal0 - } - class InstallGodotJSPresetConfirmationDialog extends ConfirmationDialog { - constructor(identifier?: any) - } - /** Placeholder for the root [Node] of a [PackedScene]. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_instanceplaceholder.html - */ - class InstancePlaceholder extends Node { - constructor(identifier?: any) - /** Returns the list of properties that will be applied to the node when [method create_instance] is called. - * If [param with_order] is `true`, a key named `.order` (note the leading period) is added to the dictionary. This `.order` key is an [Array] of [String] property names specifying the order in which properties will be applied (with index 0 being the first). - */ - get_stored_values(with_order: boolean = false): GDictionary - - /** Call this method to actually load in the node. The created node will be placed as a sibling *above* the [InstancePlaceholder] in the scene tree. The [Node]'s reference is also returned for convenience. - * - * **Note:** [method create_instance] is not thread-safe. Use [method Object.call_deferred] if calling from a thread. - */ - create_instance(replace: boolean = false, custom_scene: PackedScene = undefined): Node - - /** Gets the path to the [PackedScene] resource file that is loaded by default when calling [method create_instance]. Not thread-safe. Use [method Object.call_deferred] if calling from a thread. */ - get_instance_path(): string - } - /** Creates an idle interval in a [Tween] animation. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_intervaltweener.html - */ - class IntervalTweener extends Tweener { - constructor(identifier?: any) - } - namespace ItemList { - enum IconMode { - /** Icon is drawn above the text. */ - ICON_MODE_TOP = 0, - - /** Icon is drawn to the left of the text. */ - ICON_MODE_LEFT = 1, - } - enum SelectMode { - /** Only allow selecting a single item. */ - SELECT_SINGLE = 0, - - /** Allows selecting multiple items by holding [kbd]Ctrl[/kbd] or [kbd]Shift[/kbd]. */ - SELECT_MULTI = 1, - } - } - /** A vertical list of selectable items with one or multiple columns. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_itemlist.html - */ - class ItemList extends Control { - constructor(identifier?: any) - /** Adds an item to the item list with specified text. Returns the index of an added item. - * Specify an [param icon], or use `null` as the [param icon] for a list item with no icon. - * If selectable is `true`, the list item will be selectable. - */ - add_item(text: string, icon: Texture2D = undefined, selectable: boolean = true): int64 - - /** Adds an item to the item list with no text, only an icon. Returns the index of an added item. */ - add_icon_item(icon: Texture2D, selectable: boolean = true): int64 - - /** Sets text of the item associated with the specified index. */ - set_item_text(idx: int64, text: string): void - - /** Returns the text associated with the specified index. */ - get_item_text(idx: int64): string - - /** Sets (or replaces) the icon's [Texture2D] associated with the specified index. */ - set_item_icon(idx: int64, icon: Texture2D): void - - /** Returns the icon associated with the specified index. */ - get_item_icon(idx: int64): Texture2D - - /** Sets item's text base writing direction. */ - set_item_text_direction(idx: int64, direction: Control.TextDirection): void - - /** Returns item's text base writing direction. */ - get_item_text_direction(idx: int64): Control.TextDirection - - /** Sets language code of item's text used for line-breaking and text shaping algorithms, if left empty current locale is used instead. */ - set_item_language(idx: int64, language: string): void - - /** Returns item's text language code. */ - get_item_language(idx: int64): string - - /** Sets whether the item icon will be drawn transposed. */ - set_item_icon_transposed(idx: int64, transposed: boolean): void - - /** Returns `true` if the item icon will be drawn transposed, i.e. the X and Y axes are swapped. */ - is_item_icon_transposed(idx: int64): boolean - - /** Sets the region of item's icon used. The whole icon will be used if the region has no area. */ - set_item_icon_region(idx: int64, rect: Rect2): void - - /** Returns the region of item's icon used. The whole icon will be used if the region has no area. */ - get_item_icon_region(idx: int64): Rect2 - - /** Sets a modulating [Color] of the item associated with the specified index. */ - set_item_icon_modulate(idx: int64, modulate: Color): void - - /** Returns a [Color] modulating item's icon at the specified index. */ - get_item_icon_modulate(idx: int64): Color - - /** Allows or disallows selection of the item associated with the specified index. */ - set_item_selectable(idx: int64, selectable: boolean): void - - /** Returns `true` if the item at the specified index is selectable. */ - is_item_selectable(idx: int64): boolean - - /** Disables (or enables) the item at the specified index. - * Disabled items cannot be selected and do not trigger activation signals (when double-clicking or pressing [kbd]Enter[/kbd]). - */ - set_item_disabled(idx: int64, disabled: boolean): void - - /** Returns `true` if the item at the specified index is disabled. */ - is_item_disabled(idx: int64): boolean - - /** Sets a value (of any type) to be stored with the item associated with the specified index. */ - set_item_metadata(idx: int64, metadata: any): void - - /** Returns the metadata value of the specified index. */ - get_item_metadata(idx: int64): any - - /** Sets the background color of the item specified by [param idx] index to the specified [Color]. */ - set_item_custom_bg_color(idx: int64, custom_bg_color: Color): void - - /** Returns the custom background color of the item specified by [param idx] index. */ - get_item_custom_bg_color(idx: int64): Color - - /** Sets the foreground color of the item specified by [param idx] index to the specified [Color]. */ - set_item_custom_fg_color(idx: int64, custom_fg_color: Color): void - - /** Returns the custom foreground color of the item specified by [param idx] index. */ - get_item_custom_fg_color(idx: int64): Color - - /** Returns the position and size of the item with the specified index, in the coordinate system of the [ItemList] node. If [param expand] is `true` the last column expands to fill the rest of the row. - * - * **Note:** The returned value is unreliable if called right after modifying the [ItemList], before it redraws in the next frame. - */ - get_item_rect(idx: int64, expand: boolean = true): Rect2 - - /** Sets whether the tooltip hint is enabled for specified item index. */ - set_item_tooltip_enabled(idx: int64, enable: boolean): void - - /** Returns `true` if the tooltip is enabled for specified item index. */ - is_item_tooltip_enabled(idx: int64): boolean - - /** Sets the tooltip hint for the item associated with the specified index. */ - set_item_tooltip(idx: int64, tooltip: string): void - - /** Returns the tooltip hint associated with the specified index. */ - get_item_tooltip(idx: int64): string - - /** Select the item at the specified index. - * - * **Note:** This method does not trigger the item selection signal. - */ - select(idx: int64, single: boolean = true): void - - /** Ensures the item associated with the specified index is not selected. */ - deselect(idx: int64): void - - /** Ensures there are no items selected. */ - deselect_all(): void - - /** Returns `true` if the item at the specified index is currently selected. */ - is_selected(idx: int64): boolean - - /** Returns an array with the indexes of the selected items. */ - get_selected_items(): PackedInt32Array - - /** Moves item from index [param from_idx] to [param to_idx]. */ - move_item(from_idx: int64, to_idx: int64): void - - /** Removes the item specified by [param idx] index from the list. */ - remove_item(idx: int64): void - - /** Removes all items from the list. */ - clear(): void - - /** Sorts items in the list by their text. */ - sort_items_by_text(): void - - /** Returns `true` if one or more items are selected. */ - is_anything_selected(): boolean - - /** Returns the item index at the given [param position]. - * When there is no item at that point, -1 will be returned if [param exact] is `true`, and the closest item index will be returned otherwise. - * - * **Note:** The returned value is unreliable if called right after modifying the [ItemList], before it redraws in the next frame. - */ - get_item_at_position(position: Vector2, exact: boolean = false): int64 - - /** Ensure current selection is visible, adjusting the scroll position as necessary. */ - ensure_current_is_visible(): void - - /** Returns the vertical scrollbar. - * **Warning:** This is a required internal node, removing and freeing it may cause a crash. If you wish to hide it or any of its children, use their [member CanvasItem.visible] property. - */ - get_v_scroll_bar(): VScrollBar - - /** Forces an update to the list size based on its items. This happens automatically whenever size of the items, or other relevant settings like [member auto_height], change. The method can be used to trigger the update ahead of next drawing pass. */ - force_update_list_size(): void - - /** Allows single or multiple item selection. See the [enum SelectMode] constants. */ - get select_mode(): int64 - set select_mode(value: int64) - - /** If `true`, the currently selected item can be selected again. */ - get allow_reselect(): boolean - set allow_reselect(value: boolean) - - /** If `true`, right mouse button click can select items. */ - get allow_rmb_select(): boolean - set allow_rmb_select(value: boolean) - - /** If `true`, allows navigating the [ItemList] with letter keys through incremental search. */ - get allow_search(): boolean - set allow_search(value: boolean) - - /** Maximum lines of text allowed in each item. Space will be reserved even when there is not enough lines of text to display. - * - * **Note:** This property takes effect only when [member icon_mode] is [constant ICON_MODE_TOP]. To make the text wrap, [member fixed_column_width] should be greater than zero. - */ - get max_text_lines(): int64 - set max_text_lines(value: int64) - - /** If `true`, the control will automatically resize the height to fit its content. */ - get auto_height(): boolean - set auto_height(value: boolean) - - /** Sets the clipping behavior when the text exceeds an item's bounding rectangle. See [enum TextServer.OverrunBehavior] for a description of all modes. */ - get text_overrun_behavior(): int64 - set text_overrun_behavior(value: int64) - - /** The number of items currently in the list. */ - get item_count(): any /*Items,item_*/ - set item_count(value: any /*Items,item_*/) - - /** Maximum columns the list will have. - * If greater than zero, the content will be split among the specified columns. - * A value of zero means unlimited columns, i.e. all items will be put in the same row. - */ - get max_columns(): int64 - set max_columns(value: int64) - - /** Whether all columns will have the same width. - * If `true`, the width is equal to the largest column width of all columns. - */ - get same_column_width(): boolean - set same_column_width(value: boolean) - - /** The width all columns will be adjusted to. - * A value of zero disables the adjustment, each item will have a width equal to the width of its content and the columns will have an uneven width. - */ - get fixed_column_width(): int64 - set fixed_column_width(value: int64) - - /** The icon position, whether above or to the left of the text. See the [enum IconMode] constants. */ - get icon_mode(): int64 - set icon_mode(value: int64) - - /** The scale of icon applied after [member fixed_icon_size] and transposing takes effect. */ - get icon_scale(): float64 - set icon_scale(value: float64) - - /** The size all icons will be adjusted to. - * If either X or Y component is not greater than zero, icon size won't be affected. - */ - get fixed_icon_size(): Vector2i - set fixed_icon_size(value: Vector2i) - - /** Triggered when specified item has been selected. - * [member allow_reselect] must be enabled to reselect an item. - */ - readonly item_selected: Signal1 - - /** Triggered when any mouse click is issued within the rect of the list but on empty space. */ - readonly empty_clicked: Signal2 - - /** Triggered when specified list item has been clicked with any mouse button. - * The click position is also provided to allow appropriate popup of context menus at the correct location. - */ - readonly item_clicked: Signal3 - - /** Triggered when a multiple selection is altered on a list allowing multiple selection. */ - readonly multi_selected: Signal2 - - /** Triggered when specified list item is activated via double-clicking or by pressing [kbd]Enter[/kbd]. */ - readonly item_activated: Signal1 - } - /** Singleton that connects the engine with Android plugins to interface with native Android code. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_jnisingleton.html - */ - class JNISingleton extends Object { - constructor(identifier?: any) - } - /** Helper class for creating and parsing JSON data. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_json.html - */ - class JSON extends Resource { - constructor(identifier?: any) - /** Converts a [Variant] var to JSON text and returns the result. Useful for serializing data to store or send over the network. - * - * **Note:** The JSON specification does not define integer or float types, but only a *number* type. Therefore, converting a Variant to JSON text will convert all numerical values to [float] types. - * - * **Note:** If [param full_precision] is `true`, when stringifying floats, the unreliable digits are stringified in addition to the reliable digits to guarantee exact decoding. - * The [param indent] parameter controls if and how something is indented; its contents will be used where there should be an indent in the output. Even spaces like `" "` will work. `\t` and `\n` can also be used for a tab indent, or to make a newline for each indent respectively. - * **Example output:** - * - */ - static stringify(data: any, indent: string = '', sort_keys: boolean = true, full_precision: boolean = false): string - - /** Attempts to parse the [param json_string] provided and returns the parsed data. Returns `null` if parse failed. */ - static parse_string(json_string: string): any - - /** Attempts to parse the [param json_text] provided. - * Returns an [enum Error]. If the parse was successful, it returns [constant OK] and the result can be retrieved using [member data]. If unsuccessful, use [method get_error_line] and [method get_error_message] to identify the source of the failure. - * Non-static variant of [method parse_string], if you want custom error handling. - * The optional [param keep_text] argument instructs the parser to keep a copy of the original text. This text can be obtained later by using the [method get_parsed_text] function and is used when saving the resource (instead of generating new text from [member data]). - */ - parse(json_text: string, keep_text: boolean = false): GError - - /** Return the text parsed by [method parse] (requires passing `keep_text` to [method parse]). */ - get_parsed_text(): string - - /** Returns `0` if the last call to [method parse] was successful, or the line number where the parse failed. */ - get_error_line(): int64 - - /** Returns an empty string if the last call to [method parse] was successful, or the error message if it failed. */ - get_error_message(): string - - /** Contains the parsed JSON data in [Variant] form. */ - get data(): any - set data(value: any) - } - namespace JSONRPC { - enum ErrorCode { - /** The request could not be parsed as it was not valid by JSON standard ([method JSON.parse] failed). */ - PARSE_ERROR = -32700, - - /** A method call was requested but the request's format is not valid. */ - INVALID_REQUEST = -32600, - - /** A method call was requested but no function of that name existed in the JSONRPC subclass. */ - METHOD_NOT_FOUND = -32601, - - /** A method call was requested but the given method parameters are not valid. Not used by the built-in JSONRPC. */ - INVALID_PARAMS = -32602, - - /** An internal error occurred while processing the request. Not used by the built-in JSONRPC. */ - INTERNAL_ERROR = -32603, - } - } - /** A helper to handle dictionaries which look like JSONRPC documents. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_jsonrpc.html - */ - class JSONRPC extends Object { - constructor(identifier?: any) - set_scope(scope: string, target: Object): void - - /** Given a Dictionary which takes the form of a JSON-RPC request: unpack the request and run it. Methods are resolved by looking at the field called "method" and looking for an equivalently named function in the JSONRPC object. If one is found that method is called. - * To add new supported methods extend the JSONRPC class and call [method process_action] on your subclass. - * [param action]: The action to be run, as a Dictionary in the form of a JSON-RPC request or notification. - */ - process_action(action: any, recurse: boolean = false): any - process_string(action: string): string - - /** Returns a dictionary in the form of a JSON-RPC request. Requests are sent to a server with the expectation of a response. The ID field is used for the server to specify which exact request it is responding to. - * - [param method]: Name of the method being called. - * - [param params]: An array or dictionary of parameters being passed to the method. - * - [param id]: Uniquely identifies this request. The server is expected to send a response with the same ID. - */ - make_request(method: string, params: any, id: any): GDictionary - - /** When a server has received and processed a request, it is expected to send a response. If you did not want a response then you need to have sent a Notification instead. - * - [param result]: The return value of the function which was called. - * - [param id]: The ID of the request this response is targeted to. - */ - make_response(result: any, id: any): GDictionary - - /** Returns a dictionary in the form of a JSON-RPC notification. Notifications are one-shot messages which do not expect a response. - * - [param method]: Name of the method being called. - * - [param params]: An array or dictionary of parameters being passed to the method. - */ - make_notification(method: string, params: any): GDictionary - - /** Creates a response which indicates a previous reply has failed in some way. - * - [param code]: The error code corresponding to what kind of error this is. See the [enum ErrorCode] constants. - * - [param message]: A custom message about this error. - * - [param id]: The request this error is a response to. - */ - make_response_error(code: int64, message: string, id: any = {}): GDictionary - } - /** Represents an object from the Java Native Interface. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_javaclass.html - */ - class JavaClass extends RefCounted { - constructor(identifier?: any) - } - /** A wrapper class for web native JavaScript objects. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_javascriptobject.html - */ - class JavaScriptObject extends RefCounted { - constructor(identifier?: any) - } - /** Abstract base class for all 2D physics joints. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_joint2d.html - */ - class Joint2D extends Node2D { - constructor(identifier?: any) - /** Returns the joint's internal [RID] from the [PhysicsServer2D]. */ - get_rid(): RID - - /** Path to the first body (A) attached to the joint. The node must inherit [PhysicsBody2D]. */ - get node_a(): NodePath - set node_a(value: NodePath | string) - - /** Path to the second body (B) attached to the joint. The node must inherit [PhysicsBody2D]. */ - get node_b(): NodePath - set node_b(value: NodePath | string) - - /** When [member node_a] and [member node_b] move in different directions the [member bias] controls how fast the joint pulls them back to their original position. The lower the [member bias] the more the two bodies can pull on the joint. - * When set to `0`, the default value from [member ProjectSettings.physics/2d/solver/default_constraint_bias] is used. - */ - get bias(): float64 - set bias(value: float64) - - /** If `true`, the two bodies bound together do not collide with each other. */ - get disable_collision(): boolean - set disable_collision(value: boolean) - } - /** Abstract base class for all 3D physics joints. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_joint3d.html - */ - class Joint3D extends Node3D { - constructor(identifier?: any) - /** Returns the joint's internal [RID] from the [PhysicsServer3D]. */ - get_rid(): RID - - /** Path to the first node (A) attached to the joint. The node must inherit [PhysicsBody3D]. - * If left empty and [member node_b] is set, the body is attached to a fixed [StaticBody3D] without collision shapes. - */ - get node_a(): NodePath - set node_a(value: NodePath | string) - - /** Path to the second node (B) attached to the joint. The node must inherit [PhysicsBody3D]. - * If left empty and [member node_a] is set, the body is attached to a fixed [StaticBody3D] without collision shapes. - */ - get node_b(): NodePath - set node_b(value: NodePath | string) - - /** The priority used to define which solver is executed first for multiple joints. The lower the value, the higher the priority. */ - get solver_priority(): int64 - set solver_priority(value: int64) - - /** If `true`, the two bodies bound together do not collide with each other. */ - get exclude_nodes_from_collision(): boolean - set exclude_nodes_from_collision(value: boolean) - } - class Joint3DGizmoPlugin extends EditorNode3DGizmoPlugin { - constructor(identifier?: any) - } - /** Holds collision data from the movement of a [PhysicsBody2D]. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_kinematiccollision2d.html - */ - class KinematicCollision2D extends RefCounted { - constructor(identifier?: any) - /** Returns the point of collision in global coordinates. */ - get_position(): Vector2 - - /** Returns the colliding body's shape's normal at the point of collision. */ - get_normal(): Vector2 - - /** Returns the moving object's travel before collision. */ - get_travel(): Vector2 - - /** Returns the moving object's remaining movement vector. */ - get_remainder(): Vector2 - - /** Returns the collision angle according to [param up_direction], which is [constant Vector2.UP] by default. This value is always positive. */ - get_angle(up_direction: Vector2 = new Vector2(0, -1)): float64 - - /** Returns the colliding body's length of overlap along the collision normal. */ - get_depth(): float64 - - /** Returns the moving object's colliding shape. */ - get_local_shape(): Object - - /** Returns the colliding body's attached [Object]. */ - get_collider(): Object - - /** Returns the unique instance ID of the colliding body's attached [Object]. See [method Object.get_instance_id]. */ - get_collider_id(): int64 - - /** Returns the colliding body's [RID] used by the [PhysicsServer2D]. */ - get_collider_rid(): RID - - /** Returns the colliding body's shape. */ - get_collider_shape(): Object - - /** Returns the colliding body's shape index. See [CollisionObject2D]. */ - get_collider_shape_index(): int64 - - /** Returns the colliding body's velocity. */ - get_collider_velocity(): Vector2 - } - /** Holds collision data from the movement of a [PhysicsBody3D]. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_kinematiccollision3d.html - */ - class KinematicCollision3D extends RefCounted { - constructor(identifier?: any) - /** Returns the moving object's travel before collision. */ - get_travel(): Vector3 - - /** Returns the moving object's remaining movement vector. */ - get_remainder(): Vector3 - - /** Returns the colliding body's length of overlap along the collision normal. */ - get_depth(): float64 - - /** Returns the number of detected collisions. */ - get_collision_count(): int64 - - /** Returns the point of collision in global coordinates given a collision index (the deepest collision by default). */ - get_position(collision_index: int64 = 0): Vector3 - - /** Returns the colliding body's shape's normal at the point of collision given a collision index (the deepest collision by default). */ - get_normal(collision_index: int64 = 0): Vector3 - - /** Returns the collision angle according to [param up_direction], which is [constant Vector3.UP] by default. This value is always positive. */ - get_angle(collision_index: int64 = 0, up_direction: Vector3 = Vector3.ZERO): float64 - - /** Returns the moving object's colliding shape given a collision index (the deepest collision by default). */ - get_local_shape(collision_index: int64 = 0): Object - - /** Returns the colliding body's attached [Object] given a collision index (the deepest collision by default). */ - get_collider(collision_index: int64 = 0): Object - - /** Returns the unique instance ID of the colliding body's attached [Object] given a collision index (the deepest collision by default). See [method Object.get_instance_id]. */ - get_collider_id(collision_index: int64 = 0): int64 - - /** Returns the colliding body's [RID] used by the [PhysicsServer3D] given a collision index (the deepest collision by default). */ - get_collider_rid(collision_index: int64 = 0): RID - - /** Returns the colliding body's shape given a collision index (the deepest collision by default). */ - get_collider_shape(collision_index: int64 = 0): Object - - /** Returns the colliding body's shape index given a collision index (the deepest collision by default). See [CollisionObject3D]. */ - get_collider_shape_index(collision_index: int64 = 0): int64 - - /** Returns the colliding body's velocity given a collision index (the deepest collision by default). */ - get_collider_velocity(collision_index: int64 = 0): Vector3 - } - /** A control for displaying plain text. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_label.html - */ - class Label extends Control { - constructor(identifier?: any) - /** Returns the height of the line [param line]. - * If [param line] is set to `-1`, returns the biggest line height. - * If there are no lines, returns font size in pixels. - */ - get_line_height(line: int64 = -1): int64 - - /** Returns the number of lines of text the Label has. */ - get_line_count(): int64 - - /** Returns the number of lines shown. Useful if the [Label]'s height cannot currently display all lines. */ - get_visible_line_count(): int64 - - /** Returns the total number of printable characters in the text (excluding spaces and newlines). */ - get_total_character_count(): int64 - - /** Returns the bounding rectangle of the character at position [param pos]. If the character is a non-visual character or [param pos] is outside the valid range, an empty [Rect2] is returned. If the character is a part of a composite grapheme, the bounding rectangle of the whole grapheme is returned. */ - get_character_bounds(pos: int64): Rect2 - - /** The text to display on screen. */ - get text(): string - set text(value: string) - - /** A [LabelSettings] resource that can be shared between multiple [Label] nodes. Takes priority over theme properties. */ - get label_settings(): LabelSettings - set label_settings(value: LabelSettings) - - /** Controls the text's horizontal alignment. Supports left, center, right, and fill, or justify. Set it to one of the [enum HorizontalAlignment] constants. */ - get horizontal_alignment(): int64 - set horizontal_alignment(value: int64) - - /** Controls the text's vertical alignment. Supports top, center, bottom, and fill. Set it to one of the [enum VerticalAlignment] constants. */ - get vertical_alignment(): int64 - set vertical_alignment(value: int64) - - /** If set to something other than [constant TextServer.AUTOWRAP_OFF], the text gets wrapped inside the node's bounding rectangle. If you resize the node, it will change its height automatically to show all the text. To see how each mode behaves, see [enum TextServer.AutowrapMode]. */ - get autowrap_mode(): int64 - set autowrap_mode(value: int64) - - /** Line fill alignment rules. For more info see [enum TextServer.JustificationFlag]. */ - get justification_flags(): int64 - set justification_flags(value: int64) - - /** If `true`, the Label only shows the text that fits inside its bounding rectangle and will clip text horizontally. */ - get clip_text(): boolean - set clip_text(value: boolean) - - /** Sets the clipping behavior when the text exceeds the node's bounding rectangle. See [enum TextServer.OverrunBehavior] for a description of all modes. */ - get text_overrun_behavior(): int64 - set text_overrun_behavior(value: int64) - - /** Ellipsis character used for text clipping. */ - get ellipsis_char(): string - set ellipsis_char(value: string) - - /** If `true`, all the text displays as UPPERCASE. */ - get uppercase(): boolean - set uppercase(value: boolean) - - /** Aligns text to the given tab-stops. */ - get tab_stops(): PackedFloat32Array - set tab_stops(value: PackedFloat32Array | float32[]) - - /** The number of the lines ignored and not displayed from the start of the [member text] value. */ - get lines_skipped(): int64 - set lines_skipped(value: int64) - - /** Limits the lines of text the node shows on screen. */ - get max_lines_visible(): int64 - set max_lines_visible(value: int64) - - /** The number of characters to display. If set to `-1`, all characters are displayed. This can be useful when animating the text appearing in a dialog box. - * - * **Note:** Setting this property updates [member visible_ratio] accordingly. - */ - get visible_characters(): int64 - set visible_characters(value: int64) - - /** Sets the clipping behavior when [member visible_characters] or [member visible_ratio] is set. See [enum TextServer.VisibleCharactersBehavior] for more info. */ - get visible_characters_behavior(): int64 - set visible_characters_behavior(value: int64) - - /** The fraction of characters to display, relative to the total number of characters (see [method get_total_character_count]). If set to `1.0`, all characters are displayed. If set to `0.5`, only half of the characters will be displayed. This can be useful when animating the text appearing in a dialog box. - * - * **Note:** Setting this property updates [member visible_characters] accordingly. - */ - get visible_ratio(): float64 - set visible_ratio(value: float64) - - /** Base text writing direction. */ - get text_direction(): int64 - set text_direction(value: int64) - - /** Language code used for line-breaking and text shaping algorithms, if left empty current locale is used instead. */ - get language(): string - set language(value: string) - - /** Set BiDi algorithm override for the structured text. */ - get structured_text_bidi_override(): int64 - set structured_text_bidi_override(value: int64) - - /** Set additional options for BiDi override. */ - get structured_text_bidi_override_options(): GArray - set structured_text_bidi_override_options(value: GArray) - } - namespace Label3D { - enum DrawFlags { - /** If set, lights in the environment affect the label. */ - FLAG_SHADED = 0, - - /** If set, text can be seen from the back as well. If not, the text is invisible when looking at it from behind. */ - FLAG_DOUBLE_SIDED = 1, - - /** Disables the depth test, so this object is drawn on top of all others. However, objects drawn after it in the draw order may cover it. */ - FLAG_DISABLE_DEPTH_TEST = 2, - - /** Label is scaled by depth so that it always appears the same size on screen. */ - FLAG_FIXED_SIZE = 3, - - /** Represents the size of the [enum DrawFlags] enum. */ - FLAG_MAX = 4, - } - enum AlphaCutMode { - /** This mode performs standard alpha blending. It can display translucent areas, but transparency sorting issues may be visible when multiple transparent materials are overlapping. [member GeometryInstance3D.cast_shadow] has no effect when this transparency mode is used; the [Label3D] will never cast shadows. */ - ALPHA_CUT_DISABLED = 0, - - /** This mode only allows fully transparent or fully opaque pixels. Harsh edges will be visible unless some form of screen-space antialiasing is enabled (see [member ProjectSettings.rendering/anti_aliasing/quality/screen_space_aa]). This mode is also known as *alpha testing* or *1-bit transparency* . - * - * **Note:** This mode might have issues with anti-aliased fonts and outlines, try adjusting [member alpha_scissor_threshold] or using MSDF font. - * - * **Note:** When using text with overlapping glyphs (e.g., cursive scripts), this mode might have transparency sorting issues between the main text and the outline. - */ - ALPHA_CUT_DISCARD = 1, - - /** This mode draws fully opaque pixels in the depth prepass. This is slower than [constant ALPHA_CUT_DISABLED] or [constant ALPHA_CUT_DISCARD], but it allows displaying translucent areas and smooth edges while using proper sorting. - * - * **Note:** When using text with overlapping glyphs (e.g., cursive scripts), this mode might have transparency sorting issues between the main text and the outline. - */ - ALPHA_CUT_OPAQUE_PREPASS = 2, - - /** This mode draws cuts off all values below a spatially-deterministic threshold, the rest will remain opaque. */ - ALPHA_CUT_HASH = 3, - } - } - /** A node for displaying plain text in 3D space. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_label3d.html - */ - class Label3D extends GeometryInstance3D { - constructor(identifier?: any) - /** If `true`, the specified flag will be enabled. See [enum Label3D.DrawFlags] for a list of flags. */ - set_draw_flag(flag: Label3D.DrawFlags, enabled: boolean): void - - /** Returns the value of the specified flag. */ - get_draw_flag(flag: Label3D.DrawFlags): boolean - - /** Returns a [TriangleMesh] with the label's vertices following its current configuration (such as its [member pixel_size]). */ - generate_triangle_mesh(): TriangleMesh - - /** The size of one pixel's width on the label to scale it in 3D. To make the font look more detailed when up close, increase [member font_size] while decreasing [member pixel_size] at the same time. */ - get pixel_size(): float64 - set pixel_size(value: float64) - - /** The text drawing offset (in pixels). */ - get offset(): Vector2 - set offset(value: Vector2) - - /** The billboard mode to use for the label. See [enum BaseMaterial3D.BillboardMode] for possible values. */ - get billboard(): int64 - set billboard(value: int64) - - /** If `true`, the [Light3D] in the [Environment] has effects on the label. */ - get shaded(): boolean - set shaded(value: boolean) - - /** If `true`, text can be seen from the back as well, if `false`, it is invisible when looking at it from behind. */ - get double_sided(): boolean - set double_sided(value: boolean) - - /** If `true`, depth testing is disabled and the object will be drawn in render order. */ - get no_depth_test(): boolean - set no_depth_test(value: boolean) - - /** If `true`, the label is rendered at the same size regardless of distance. */ - get fixed_size(): boolean - set fixed_size(value: boolean) - - /** The alpha cutting mode to use for the sprite. See [enum AlphaCutMode] for possible values. */ - get alpha_cut(): int64 - set alpha_cut(value: int64) - - /** Threshold at which the alpha scissor will discard values. */ - get alpha_scissor_threshold(): float64 - set alpha_scissor_threshold(value: float64) - - /** The hashing scale for Alpha Hash. Recommended values between `0` and `2`. */ - get alpha_hash_scale(): float64 - set alpha_hash_scale(value: float64) - - /** The type of alpha antialiasing to apply. See [enum BaseMaterial3D.AlphaAntiAliasing]. */ - get alpha_antialiasing_mode(): int64 - set alpha_antialiasing_mode(value: int64) - - /** Threshold at which antialiasing will be applied on the alpha channel. */ - get alpha_antialiasing_edge(): float64 - set alpha_antialiasing_edge(value: float64) - - /** Filter flags for the texture. See [enum BaseMaterial3D.TextureFilter] for options. */ - get texture_filter(): int64 - set texture_filter(value: int64) - - /** Sets the render priority for the text. Higher priority objects will be sorted in front of lower priority objects. - * - * **Note:** This only applies if [member alpha_cut] is set to [constant ALPHA_CUT_DISABLED] (default value). - * - * **Note:** This only applies to sorting of transparent objects. This will not impact how transparent objects are sorted relative to opaque objects. This is because opaque objects are not sorted, while transparent objects are sorted from back to front (subject to priority). - */ - get render_priority(): int64 - set render_priority(value: int64) - - /** Sets the render priority for the text outline. Higher priority objects will be sorted in front of lower priority objects. - * - * **Note:** This only applies if [member alpha_cut] is set to [constant ALPHA_CUT_DISABLED] (default value). - * - * **Note:** This only applies to sorting of transparent objects. This will not impact how transparent objects are sorted relative to opaque objects. This is because opaque objects are not sorted, while transparent objects are sorted from back to front (subject to priority). - */ - get outline_render_priority(): int64 - set outline_render_priority(value: int64) - - /** Text [Color] of the [Label3D]. */ - get modulate(): Color - set modulate(value: Color) - - /** The tint of text outline. */ - get outline_modulate(): Color - set outline_modulate(value: Color) - - /** The text to display on screen. */ - get text(): string - set text(value: string) - - /** Font configuration used to display text. */ - get font(): Font - set font(value: Font) - - /** Font size of the [Label3D]'s text. To make the font look more detailed when up close, increase [member font_size] while decreasing [member pixel_size] at the same time. - * Higher font sizes require more time to render new characters, which can cause stuttering during gameplay. - */ - get font_size(): int64 - set font_size(value: int64) - - /** Text outline size. */ - get outline_size(): int64 - set outline_size(value: int64) - - /** Controls the text's horizontal alignment. Supports left, center, right, and fill, or justify. Set it to one of the [enum HorizontalAlignment] constants. */ - get horizontal_alignment(): int64 - set horizontal_alignment(value: int64) - - /** Controls the text's vertical alignment. Supports top, center, bottom. Set it to one of the [enum VerticalAlignment] constants. */ - get vertical_alignment(): int64 - set vertical_alignment(value: int64) - - /** If `true`, all the text displays as UPPERCASE. */ - get uppercase(): boolean - set uppercase(value: boolean) - - /** Vertical space between lines in multiline [Label3D]. */ - get line_spacing(): float64 - set line_spacing(value: float64) - - /** If set to something other than [constant TextServer.AUTOWRAP_OFF], the text gets wrapped inside the node's bounding rectangle. If you resize the node, it will change its height automatically to show all the text. To see how each mode behaves, see [enum TextServer.AutowrapMode]. */ - get autowrap_mode(): int64 - set autowrap_mode(value: int64) - - /** Line fill alignment rules. For more info see [enum TextServer.JustificationFlag]. */ - get justification_flags(): int64 - set justification_flags(value: int64) - - /** Text width (in pixels), used for autowrap and fill alignment. */ - get width(): float64 - set width(value: float64) - - /** Base text writing direction. */ - get text_direction(): int64 - set text_direction(value: int64) - - /** Language code used for line-breaking and text shaping algorithms, if left empty current locale is used instead. */ - get language(): string - set language(value: string) - - /** Set BiDi algorithm override for the structured text. */ - get structured_text_bidi_override(): int64 - set structured_text_bidi_override(value: int64) - - /** Set additional options for BiDi override. */ - get structured_text_bidi_override_options(): GArray - set structured_text_bidi_override_options(value: GArray) - } - class Label3DGizmoPlugin extends EditorNode3DGizmoPlugin { - constructor(identifier?: any) - } - /** Provides common settings to customize the text in a [Label]. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_labelsettings.html - */ - class LabelSettings extends Resource { - constructor(identifier?: any) - /** Vertical space between lines when the text is multiline. */ - get line_spacing(): float64 - set line_spacing(value: float64) - - /** [Font] used for the text. */ - get font(): Font - set font(value: Font) - - /** Size of the text. */ - get font_size(): int64 - set font_size(value: int64) - - /** Color of the text. */ - get font_color(): Color - set font_color(value: Color) - - /** Text outline size. */ - get outline_size(): int64 - set outline_size(value: int64) - - /** The color of the outline. */ - get outline_color(): Color - set outline_color(value: Color) - - /** Size of the shadow effect. */ - get shadow_size(): int64 - set shadow_size(value: int64) - - /** Color of the shadow effect. If alpha is `0`, no shadow will be drawn. */ - get shadow_color(): Color - set shadow_color(value: Color) - - /** Offset of the shadow effect, in pixels. */ - get shadow_offset(): Vector2 - set shadow_offset(value: Vector2) - } - namespace Light2D { - enum ShadowFilter { - /** No filter applies to the shadow map. This provides hard shadow edges and is the fastest to render. See [member shadow_filter]. */ - SHADOW_FILTER_NONE = 0, - - /** Percentage closer filtering (5 samples) applies to the shadow map. This is slower compared to hard shadow rendering. See [member shadow_filter]. */ - SHADOW_FILTER_PCF5 = 1, - - /** Percentage closer filtering (13 samples) applies to the shadow map. This is the slowest shadow filtering mode, and should be used sparingly. See [member shadow_filter]. */ - SHADOW_FILTER_PCF13 = 2, - } - enum BlendMode { - /** Adds the value of pixels corresponding to the Light2D to the values of pixels under it. This is the common behavior of a light. */ - BLEND_MODE_ADD = 0, - - /** Subtracts the value of pixels corresponding to the Light2D to the values of pixels under it, resulting in inversed light effect. */ - BLEND_MODE_SUB = 1, - - /** Mix the value of pixels corresponding to the Light2D to the values of pixels under it by linear interpolation. */ - BLEND_MODE_MIX = 2, - } - } - /** Casts light in a 2D environment. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_light2d.html - */ - class Light2D extends Node2D { - constructor(identifier?: any) - /** Sets the light's height, which is used in 2D normal mapping. See [member PointLight2D.height] and [member DirectionalLight2D.height]. */ - set_height(height: float64): void - - /** Returns the light's height, which is used in 2D normal mapping. See [member PointLight2D.height] and [member DirectionalLight2D.height]. */ - get_height(): float64 - - /** If `true`, Light2D will emit light. */ - get enabled(): boolean - set enabled(value: boolean) - - /** If `true`, Light2D will only appear when editing the scene. */ - get editor_only(): boolean - set editor_only(value: boolean) - - /** The Light2D's [Color]. */ - get color(): Color - set color(value: Color) - - /** The Light2D's energy value. The larger the value, the stronger the light. */ - get energy(): float64 - set energy(value: float64) - - /** The Light2D's blend mode. See [enum BlendMode] constants for values. */ - get blend_mode(): int64 - set blend_mode(value: int64) - - /** Minimum `z` value of objects that are affected by the Light2D. */ - get range_z_min(): int64 - set range_z_min(value: int64) - - /** Maximum `z` value of objects that are affected by the Light2D. */ - get range_z_max(): int64 - set range_z_max(value: int64) - - /** Minimum layer value of objects that are affected by the Light2D. */ - get range_layer_min(): int64 - set range_layer_min(value: int64) - - /** Maximum layer value of objects that are affected by the Light2D. */ - get range_layer_max(): int64 - set range_layer_max(value: int64) - - /** The layer mask. Only objects with a matching [member CanvasItem.light_mask] will be affected by the Light2D. See also [member shadow_item_cull_mask], which affects which objects can cast shadows. - * - * **Note:** [member range_item_cull_mask] is ignored by [DirectionalLight2D], which will always light a 2D node regardless of the 2D node's [member CanvasItem.light_mask]. - */ - get range_item_cull_mask(): int64 - set range_item_cull_mask(value: int64) - - /** If `true`, the Light2D will cast shadows. */ - get shadow_enabled(): boolean - set shadow_enabled(value: boolean) - - /** [Color] of shadows cast by the Light2D. */ - get shadow_color(): Color - set shadow_color(value: Color) - - /** Shadow filter type. See [enum ShadowFilter] for possible values. */ - get shadow_filter(): int64 - set shadow_filter(value: int64) - - /** Smoothing value for shadows. Higher values will result in softer shadows, at the cost of visible streaks that can appear in shadow rendering. [member shadow_filter_smooth] only has an effect if [member shadow_filter] is [constant SHADOW_FILTER_PCF5] or [constant SHADOW_FILTER_PCF13]. */ - get shadow_filter_smooth(): float64 - set shadow_filter_smooth(value: float64) - - /** The shadow mask. Used with [LightOccluder2D] to cast shadows. Only occluders with a matching [member CanvasItem.light_mask] will cast shadows. See also [member range_item_cull_mask], which affects which objects can *receive* the light. */ - get shadow_item_cull_mask(): int64 - set shadow_item_cull_mask(value: int64) - } - namespace Light3D { - enum Param { - /** Constant for accessing [member light_energy]. */ - PARAM_ENERGY = 0, - - /** Constant for accessing [member light_indirect_energy]. */ - PARAM_INDIRECT_ENERGY = 1, - - /** Constant for accessing [member light_volumetric_fog_energy]. */ - PARAM_VOLUMETRIC_FOG_ENERGY = 2, - - /** Constant for accessing [member light_specular]. */ - PARAM_SPECULAR = 3, - - /** Constant for accessing [member OmniLight3D.omni_range] or [member SpotLight3D.spot_range]. */ - PARAM_RANGE = 4, - - /** Constant for accessing [member light_size]. */ - PARAM_SIZE = 5, - - /** Constant for accessing [member OmniLight3D.omni_attenuation] or [member SpotLight3D.spot_attenuation]. */ - PARAM_ATTENUATION = 6, - - /** Constant for accessing [member SpotLight3D.spot_angle]. */ - PARAM_SPOT_ANGLE = 7, - - /** Constant for accessing [member SpotLight3D.spot_angle_attenuation]. */ - PARAM_SPOT_ATTENUATION = 8, - - /** Constant for accessing [member DirectionalLight3D.directional_shadow_max_distance]. */ - PARAM_SHADOW_MAX_DISTANCE = 9, - - /** Constant for accessing [member DirectionalLight3D.directional_shadow_split_1]. */ - PARAM_SHADOW_SPLIT_1_OFFSET = 10, - - /** Constant for accessing [member DirectionalLight3D.directional_shadow_split_2]. */ - PARAM_SHADOW_SPLIT_2_OFFSET = 11, - - /** Constant for accessing [member DirectionalLight3D.directional_shadow_split_3]. */ - PARAM_SHADOW_SPLIT_3_OFFSET = 12, - - /** Constant for accessing [member DirectionalLight3D.directional_shadow_fade_start]. */ - PARAM_SHADOW_FADE_START = 13, - - /** Constant for accessing [member shadow_normal_bias]. */ - PARAM_SHADOW_NORMAL_BIAS = 14, - - /** Constant for accessing [member shadow_bias]. */ - PARAM_SHADOW_BIAS = 15, - - /** Constant for accessing [member DirectionalLight3D.directional_shadow_pancake_size]. */ - PARAM_SHADOW_PANCAKE_SIZE = 16, - - /** Constant for accessing [member shadow_opacity]. */ - PARAM_SHADOW_OPACITY = 17, - - /** Constant for accessing [member shadow_blur]. */ - PARAM_SHADOW_BLUR = 18, - - /** Constant for accessing [member shadow_transmittance_bias]. */ - PARAM_TRANSMITTANCE_BIAS = 19, - - /** Constant for accessing [member light_intensity_lumens] and [member light_intensity_lux]. Only used when [member ProjectSettings.rendering/lights_and_shadows/use_physical_light_units] is `true`. */ - PARAM_INTENSITY = 20, - - /** Represents the size of the [enum Param] enum. */ - PARAM_MAX = 21, - } - enum BakeMode { - /** Light is ignored when baking. This is the fastest mode, but the light will be taken into account when baking global illumination. This mode should generally be used for dynamic lights that change quickly, as the effect of global illumination is less noticeable on those lights. - * - * **Note:** Hiding a light does *not* affect baking [LightmapGI]. Hiding a light will still affect baking [VoxelGI] and SDFGI (see [member Environment.sdfgi_enabled]). - */ - BAKE_DISABLED = 0, - - /** Light is taken into account in static baking ([VoxelGI], [LightmapGI], SDFGI ([member Environment.sdfgi_enabled])). The light can be moved around or modified, but its global illumination will not update in real-time. This is suitable for subtle changes (such as flickering torches), but generally not large changes such as toggling a light on and off. - * - * **Note:** The light is not baked in [LightmapGI] if [member editor_only] is `true`. - */ - BAKE_STATIC = 1, - - /** Light is taken into account in dynamic baking ([VoxelGI] and SDFGI ([member Environment.sdfgi_enabled]) only). The light can be moved around or modified with global illumination updating in real-time. The light's global illumination appearance will be slightly different compared to [constant BAKE_STATIC]. This has a greater performance cost compared to [constant BAKE_STATIC]. When using SDFGI, the update speed of dynamic lights is affected by [member ProjectSettings.rendering/global_illumination/sdfgi/frames_to_update_lights]. */ - BAKE_DYNAMIC = 2, - } - } - /** Provides a base class for different kinds of light nodes. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_light3d.html - */ - class Light3D extends VisualInstance3D { - constructor(identifier?: any) - /** Sets the value of the specified [enum Light3D.Param] parameter. */ - set_param(param: Light3D.Param, value: float64): void - - /** Returns the value of the specified [enum Light3D.Param] parameter. */ - get_param(param: Light3D.Param): float64 - - /** Returns the [Color] of an idealized blackbody at the given [member light_temperature]. This value is calculated internally based on the [member light_temperature]. This [Color] is multiplied by [member light_color] before being sent to the [RenderingServer]. */ - get_correlated_color(): Color - - /** Used by positional lights ([OmniLight3D] and [SpotLight3D]) when [member ProjectSettings.rendering/lights_and_shadows/use_physical_light_units] is `true`. Sets the intensity of the light source measured in Lumens. Lumens are a measure of luminous flux, which is the total amount of visible light emitted by a light source per unit of time. - * For [SpotLight3D]s, we assume that the area outside the visible cone is surrounded by a perfect light absorbing material. Accordingly, the apparent brightness of the cone area does not change as the cone increases and decreases in size. - * A typical household lightbulb can range from around 600 lumens to 1,200 lumens, a candle is about 13 lumens, while a streetlight can be approximately 60,000 lumens. - */ - get light_intensity_lumens(): float64 - set light_intensity_lumens(value: float64) - - /** Used by [DirectionalLight3D]s when [member ProjectSettings.rendering/lights_and_shadows/use_physical_light_units] is `true`. Sets the intensity of the light source measured in Lux. Lux is a measure of luminous flux per unit area, it is equal to one lumen per square meter. Lux is the measure of how much light hits a surface at a given time. - * On a clear sunny day a surface in direct sunlight may be approximately 100,000 lux, a typical room in a home may be approximately 50 lux, while the moonlit ground may be approximately 0.1 lux. - */ - get light_intensity_lux(): float64 - set light_intensity_lux(value: float64) - - /** Sets the color temperature of the light source, measured in Kelvin. This is used to calculate a correlated color temperature which tints the [member light_color]. - * The sun on a cloudy day is approximately 6500 Kelvin, on a clear day it is between 5500 to 6000 Kelvin, and on a clear day at sunrise or sunset it ranges to around 1850 Kelvin. - */ - get light_temperature(): float64 - set light_temperature(value: float64) - - /** The light's color. An *overbright* color can be used to achieve a result equivalent to increasing the light's [member light_energy]. */ - get light_color(): Color - set light_color(value: Color) - - /** The light's strength multiplier (this is not a physical unit). For [OmniLight3D] and [SpotLight3D], changing this value will only change the light color's intensity, not the light's radius. */ - get light_energy(): float64 - set light_energy(value: float64) - - /** Secondary multiplier used with indirect light (light bounces). Used with [VoxelGI] and SDFGI (see [member Environment.sdfgi_enabled]). - * - * **Note:** This property is ignored if [member light_energy] is equal to `0.0`, as the light won't be present at all in the GI shader. - */ - get light_indirect_energy(): float64 - set light_indirect_energy(value: float64) - - /** Secondary multiplier multiplied with [member light_energy] then used with the [Environment]'s volumetric fog (if enabled). If set to `0.0`, computing volumetric fog will be skipped for this light, which can improve performance for large amounts of lights when volumetric fog is enabled. - * - * **Note:** To prevent short-lived dynamic light effects from poorly interacting with volumetric fog, lights used in those effects should have [member light_volumetric_fog_energy] set to `0.0` unless [member Environment.volumetric_fog_temporal_reprojection_enabled] is disabled (or unless the reprojection amount is significantly lowered). - */ - get light_volumetric_fog_energy(): float64 - set light_volumetric_fog_energy(value: float64) - - /** [Texture2D] projected by light. [member shadow_enabled] must be on for the projector to work. Light projectors make the light appear as if it is shining through a colored but transparent object, almost like light shining through stained-glass. - * - * **Note:** Unlike [BaseMaterial3D] whose filter mode can be adjusted on a per-material basis, the filter mode for light projector textures is set globally with [member ProjectSettings.rendering/textures/light_projectors/filter]. - * - * **Note:** Light projector textures are only supported in the Forward+ and Mobile rendering methods, not Compatibility. - */ - get light_projector(): Texture2D - set light_projector(value: Texture2D) - - /** The size of the light in Godot units. Only available for [OmniLight3D]s and [SpotLight3D]s. Increasing this value will make the light fade out slower and shadows appear blurrier (also called percentage-closer soft shadows, or PCSS). This can be used to simulate area lights to an extent. Increasing this value above `0.0` for lights with shadows enabled will have a noticeable performance cost due to PCSS. - * - * **Note:** [member light_size] is not affected by [member Node3D.scale] (the light's scale or its parent's scale). - * - * **Note:** PCSS for positional lights is only supported in the Forward+ and Mobile rendering methods, not Compatibility. - */ - get light_size(): float64 - set light_size(value: float64) - - /** The light's angular size in degrees. Increasing this will make shadows softer at greater distances (also called percentage-closer soft shadows, or PCSS). Only available for [DirectionalLight3D]s. For reference, the Sun from the Earth is approximately `0.5`. Increasing this value above `0.0` for lights with shadows enabled will have a noticeable performance cost due to PCSS. - * - * **Note:** [member light_angular_distance] is not affected by [member Node3D.scale] (the light's scale or its parent's scale). - * - * **Note:** PCSS for directional lights is only supported in the Forward+ rendering method, not Mobile or Compatibility. - */ - get light_angular_distance(): float64 - set light_angular_distance(value: float64) - - /** If `true`, the light's effect is reversed, darkening areas and casting bright shadows. */ - get light_negative(): boolean - set light_negative(value: boolean) - - /** The intensity of the specular blob in objects affected by the light. At `0`, the light becomes a pure diffuse light. When not baking emission, this can be used to avoid unrealistic reflections when placing lights above an emissive surface. */ - get light_specular(): float64 - set light_specular(value: float64) - - /** The light's bake mode. This will affect the global illumination techniques that have an effect on the light's rendering. See [enum BakeMode]. - * - * **Note:** Meshes' global illumination mode will also affect the global illumination rendering. See [member GeometryInstance3D.gi_mode]. - */ - get light_bake_mode(): int64 - set light_bake_mode(value: int64) - - /** The light will affect objects in the selected layers. */ - get light_cull_mask(): int64 - set light_cull_mask(value: int64) - - /** If `true`, the light will cast real-time shadows. This has a significant performance cost. Only enable shadow rendering when it makes a noticeable difference in the scene's appearance, and consider using [member distance_fade_enabled] to hide the light when far away from the [Camera3D]. */ - get shadow_enabled(): boolean - set shadow_enabled(value: boolean) - - /** Used to adjust shadow appearance. Too small a value results in self-shadowing ("shadow acne"), while too large a value causes shadows to separate from casters ("peter-panning"). Adjust as needed. */ - get shadow_bias(): float64 - set shadow_bias(value: float64) - - /** Offsets the lookup into the shadow map by the object's normal. This can be used to reduce self-shadowing artifacts without using [member shadow_bias]. In practice, this value should be tweaked along with [member shadow_bias] to reduce artifacts as much as possible. */ - get shadow_normal_bias(): float64 - set shadow_normal_bias(value: float64) - - /** If `true`, reverses the backface culling of the mesh. This can be useful when you have a flat mesh that has a light behind it. If you need to cast a shadow on both sides of the mesh, set the mesh to use double-sided shadows with [constant GeometryInstance3D.SHADOW_CASTING_SETTING_DOUBLE_SIDED]. */ - get shadow_reverse_cull_face(): boolean - set shadow_reverse_cull_face(value: boolean) - get shadow_transmittance_bias(): float64 - set shadow_transmittance_bias(value: float64) - - /** The opacity to use when rendering the light's shadow map. Values lower than `1.0` make the light appear through shadows. This can be used to fake global illumination at a low performance cost. */ - get shadow_opacity(): float64 - set shadow_opacity(value: float64) - - /** Blurs the edges of the shadow. Can be used to hide pixel artifacts in low-resolution shadow maps. A high value can impact performance, make shadows appear grainy and can cause other unwanted artifacts. Try to keep as near default as possible. */ - get shadow_blur(): float64 - set shadow_blur(value: float64) - - /** If `true`, the light will smoothly fade away when far from the active [Camera3D] starting at [member distance_fade_begin]. This acts as a form of level of detail (LOD). The light will fade out over [member distance_fade_begin] + [member distance_fade_length], after which it will be culled and not sent to the shader at all. Use this to reduce the number of active lights in a scene and thus improve performance. - * - * **Note:** Only effective for [OmniLight3D] and [SpotLight3D]. - */ - get distance_fade_enabled(): boolean - set distance_fade_enabled(value: boolean) - - /** The distance from the camera at which the light begins to fade away (in 3D units). - * - * **Note:** Only effective for [OmniLight3D] and [SpotLight3D]. - */ - get distance_fade_begin(): float64 - set distance_fade_begin(value: float64) - - /** The distance from the camera at which the light's shadow cuts off (in 3D units). Set this to a value lower than [member distance_fade_begin] + [member distance_fade_length] to further improve performance, as shadow rendering is often more expensive than light rendering itself. - * - * **Note:** Only effective for [OmniLight3D] and [SpotLight3D], and only when [member shadow_enabled] is `true`. - */ - get distance_fade_shadow(): float64 - set distance_fade_shadow(value: float64) - - /** Distance over which the light and its shadow fades. The light's energy and shadow's opacity is progressively reduced over this distance and is completely invisible at the end. - * - * **Note:** Only effective for [OmniLight3D] and [SpotLight3D]. - */ - get distance_fade_length(): float64 - set distance_fade_length(value: float64) - - /** If `true`, the light only appears in the editor and will not be visible at runtime. If `true`, the light will never be baked in [LightmapGI] regardless of its [member light_bake_mode]. */ - get editor_only(): boolean - set editor_only(value: boolean) - } - class Light3DGizmoPlugin extends EditorNode3DGizmoPlugin { - constructor(identifier?: any) - } - /** Occludes light cast by a Light2D, casting shadows. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_lightoccluder2d.html - */ - class LightOccluder2D extends Node2D { - constructor(identifier?: any) - /** The [OccluderPolygon2D] used to compute the shadow. */ - get occluder(): OccluderPolygon2D - set occluder(value: OccluderPolygon2D) - - /** If enabled, the occluder will be part of a real-time generated signed distance field that can be used in custom shaders. */ - get sdf_collision(): boolean - set sdf_collision(value: boolean) - - /** The LightOccluder2D's occluder light mask. The LightOccluder2D will cast shadows only from Light2D(s) that have the same light mask(s). */ - get occluder_light_mask(): int64 - set occluder_light_mask(value: int64) - } - class LightOccluder2DEditor extends AbstractPolygon2DEditor { - constructor(identifier?: any) - } - class LightOccluder2DEditorPlugin extends AbstractPolygon2DEditorPlugin { - constructor(identifier?: any) - } - namespace LightmapGI { - enum BakeQuality { - /** Low bake quality (fastest bake times). The quality of this preset can be adjusted by changing [member ProjectSettings.rendering/lightmapping/bake_quality/low_quality_ray_count] and [member ProjectSettings.rendering/lightmapping/bake_quality/low_quality_probe_ray_count]. */ - BAKE_QUALITY_LOW = 0, - - /** Medium bake quality (fast bake times). The quality of this preset can be adjusted by changing [member ProjectSettings.rendering/lightmapping/bake_quality/medium_quality_ray_count] and [member ProjectSettings.rendering/lightmapping/bake_quality/medium_quality_probe_ray_count]. */ - BAKE_QUALITY_MEDIUM = 1, - - /** High bake quality (slow bake times). The quality of this preset can be adjusted by changing [member ProjectSettings.rendering/lightmapping/bake_quality/high_quality_ray_count] and [member ProjectSettings.rendering/lightmapping/bake_quality/high_quality_probe_ray_count]. */ - BAKE_QUALITY_HIGH = 2, - - /** Highest bake quality (slowest bake times). The quality of this preset can be adjusted by changing [member ProjectSettings.rendering/lightmapping/bake_quality/ultra_quality_ray_count] and [member ProjectSettings.rendering/lightmapping/bake_quality/ultra_quality_probe_ray_count]. */ - BAKE_QUALITY_ULTRA = 3, - } - enum GenerateProbes { - /** Don't generate lightmap probes for lighting dynamic objects. */ - GENERATE_PROBES_DISABLED = 0, - - /** Lowest level of subdivision (fastest bake times, smallest file sizes). */ - GENERATE_PROBES_SUBDIV_4 = 1, - - /** Low level of subdivision (fast bake times, small file sizes). */ - GENERATE_PROBES_SUBDIV_8 = 2, - - /** High level of subdivision (slow bake times, large file sizes). */ - GENERATE_PROBES_SUBDIV_16 = 3, - - /** Highest level of subdivision (slowest bake times, largest file sizes). */ - GENERATE_PROBES_SUBDIV_32 = 4, - } - enum BakeError { - /** Lightmap baking was successful. */ - BAKE_ERROR_OK = 0, - - /** Lightmap baking failed because the root node for the edited scene could not be accessed. */ - BAKE_ERROR_NO_SCENE_ROOT = 1, - - /** Lightmap baking failed as the lightmap data resource is embedded in a foreign resource. */ - BAKE_ERROR_FOREIGN_DATA = 2, - - /** Lightmap baking failed as there is no lightmapper available in this Godot build. */ - BAKE_ERROR_NO_LIGHTMAPPER = 3, - - /** Lightmap baking failed as the [LightmapGIData] save path isn't configured in the resource. */ - BAKE_ERROR_NO_SAVE_PATH = 4, - - /** Lightmap baking failed as there are no meshes whose [member GeometryInstance3D.gi_mode] is [constant GeometryInstance3D.GI_MODE_STATIC] and with valid UV2 mapping in the current scene. You may need to select 3D scenes in the Import dock and change their global illumination mode accordingly. */ - BAKE_ERROR_NO_MESHES = 5, - - /** Lightmap baking failed as the lightmapper failed to analyze some of the meshes marked as static for baking. */ - BAKE_ERROR_MESHES_INVALID = 6, - - /** Lightmap baking failed as the resulting image couldn't be saved or imported by Godot after it was saved. */ - BAKE_ERROR_CANT_CREATE_IMAGE = 7, - - /** The user aborted the lightmap baking operation (typically by clicking the **Cancel** button in the progress dialog). */ - BAKE_ERROR_USER_ABORTED = 8, - - /** Lightmap baking failed as the maximum texture size is too small to fit some of the meshes marked for baking. */ - BAKE_ERROR_TEXTURE_SIZE_TOO_SMALL = 9, - - /** Lightmap baking failed as the lightmap is too small. */ - BAKE_ERROR_LIGHTMAP_TOO_SMALL = 10, - - /** Lightmap baking failed as the lightmap was unable to fit into an atlas. */ - BAKE_ERROR_ATLAS_TOO_SMALL = 11, - } - enum EnvironmentMode { - /** Ignore environment lighting when baking lightmaps. */ - ENVIRONMENT_MODE_DISABLED = 0, - - /** Use the scene's environment lighting when baking lightmaps. - * - * **Note:** If baking lightmaps in a scene with no [WorldEnvironment] node, this will act like [constant ENVIRONMENT_MODE_DISABLED]. The editor's preview sky and sun is *not* taken into account by [LightmapGI] when baking lightmaps. - */ - ENVIRONMENT_MODE_SCENE = 1, - - /** Use [member environment_custom_sky] as a source of environment lighting when baking lightmaps. */ - ENVIRONMENT_MODE_CUSTOM_SKY = 2, - - /** Use [member environment_custom_color] multiplied by [member environment_custom_energy] as a constant source of environment lighting when baking lightmaps. */ - ENVIRONMENT_MODE_CUSTOM_COLOR = 3, - } - } - /** Computes and stores baked lightmaps for fast global illumination. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_lightmapgi.html - */ - class LightmapGI extends VisualInstance3D { - constructor(identifier?: any) - /** The quality preset to use when baking lightmaps. This affects bake times, but output file sizes remain mostly identical across quality levels. - * To further speed up bake times, decrease [member bounces], disable [member use_denoiser] and increase the lightmap texel size on 3D scenes in the Import doc. - */ - get quality(): int64 - set quality(value: int64) - - /** Number of light bounces that are taken into account during baking. Higher values result in brighter, more realistic lighting, at the cost of longer bake times. If set to `0`, only environment lighting, direct light and emissive lighting is baked. */ - get bounces(): int64 - set bounces(value: int64) - - /** The energy multiplier for each bounce. Higher values will make indirect lighting brighter. A value of `1.0` represents physically accurate behavior, but higher values can be used to make indirect lighting propagate more visibly when using a low number of bounces. This can be used to speed up bake times by lowering the number of [member bounces] then increasing [member bounce_indirect_energy]. - * - * **Note:** [member bounce_indirect_energy] only has an effect if [member bounces] is set to a value greater than or equal to `1`. - */ - get bounce_indirect_energy(): float64 - set bounce_indirect_energy(value: float64) - - /** If `true`, bakes lightmaps to contain directional information as spherical harmonics. This results in more realistic lighting appearance, especially with normal mapped materials and for lights that have their direct light baked ([member Light3D.light_bake_mode] set to [constant Light3D.BAKE_STATIC] and with [member Light3D.editor_only] set to `false`). The directional information is also used to provide rough reflections for static and dynamic objects. This has a small run-time performance cost as the shader has to perform more work to interpret the direction information from the lightmap. Directional lightmaps also take longer to bake and result in larger file sizes. - * - * **Note:** The property's name has no relationship with [DirectionalLight3D]. [member directional] works with all light types. - */ - get directional(): boolean - set directional(value: boolean) - - /** If `true`, a texture with the lighting information will be generated to speed up the generation of indirect lighting at the cost of some accuracy. The geometry might exhibit extra light leak artifacts when using low resolution lightmaps or UVs that stretch the lightmap significantly across surfaces. Leave [member use_texture_for_bounces] at its default value of `true` if unsure. - * - * **Note:** [member use_texture_for_bounces] only has an effect if [member bounces] is set to a value greater than or equal to `1`. - */ - get use_texture_for_bounces(): boolean - set use_texture_for_bounces(value: boolean) - - /** If `true`, ignore environment lighting when baking lightmaps. */ - get interior(): boolean - set interior(value: boolean) - - /** If `true`, uses a GPU-based denoising algorithm on the generated lightmap. This eliminates most noise within the generated lightmap at the cost of longer bake times. File sizes are generally not impacted significantly by the use of a denoiser, although lossless compression may do a better job at compressing a denoised image. */ - get use_denoiser(): boolean - set use_denoiser(value: boolean) - - /** The strength of denoising step applied to the generated lightmaps. Only effective if [member use_denoiser] is `true` and [member ProjectSettings.rendering/lightmapping/denoising/denoiser] is set to JNLM. */ - get denoiser_strength(): float64 - set denoiser_strength(value: float64) - - /** The distance in pixels from which the denoiser samples. Lower values preserve more details, but may give blotchy results if the lightmap quality is not high enough. Only effective if [member use_denoiser] is `true` and [member ProjectSettings.rendering/lightmapping/denoising/denoiser] is set to JNLM. */ - get denoiser_range(): int64 - set denoiser_range(value: int64) - - /** The bias to use when computing shadows. Increasing [member bias] can fix shadow acne on the resulting baked lightmap, but can introduce peter-panning (shadows not connecting to their casters). Real-time [Light3D] shadows are not affected by this [member bias] property. */ - get bias(): float64 - set bias(value: float64) - - /** Scales the lightmap texel density of all meshes for the current bake. This is a multiplier that builds upon the existing lightmap texel size defined in each imported 3D scene, along with the per-mesh density multiplier (which is designed to be used when the same mesh is used at different scales). Lower values will result in faster bake times. */ - get texel_scale(): float64 - set texel_scale(value: float64) - - /** The maximum texture size for the generated texture atlas. Higher values will result in fewer slices being generated, but may not work on all hardware as a result of hardware limitations on texture sizes. Leave [member max_texture_size] at its default value of `16384` if unsure. */ - get max_texture_size(): int64 - set max_texture_size(value: int64) - - /** The environment mode to use when baking lightmaps. */ - get environment_mode(): int64 - set environment_mode(value: int64) - - /** The sky to use as a source of environment lighting. Only effective if [member environment_mode] is [constant ENVIRONMENT_MODE_CUSTOM_SKY]. */ - get environment_custom_sky(): Sky - set environment_custom_sky(value: Sky) - - /** The color to use for environment lighting. Only effective if [member environment_mode] is [constant ENVIRONMENT_MODE_CUSTOM_COLOR]. */ - get environment_custom_color(): Color - set environment_custom_color(value: Color) - - /** The color multiplier to use for environment lighting. Only effective if [member environment_mode] is [constant ENVIRONMENT_MODE_CUSTOM_COLOR]. */ - get environment_custom_energy(): float64 - set environment_custom_energy(value: float64) - - /** The [CameraAttributes] resource that specifies exposure levels to bake at. Auto-exposure and non exposure properties will be ignored. Exposure settings should be used to reduce the dynamic range present when baking. If exposure is too high, the [LightmapGI] will have banding artifacts or may have over-exposure artifacts. */ - get camera_attributes(): CameraAttributesPractical | CameraAttributesPhysical - set camera_attributes(value: CameraAttributesPractical | CameraAttributesPhysical) - - /** The level of subdivision to use when automatically generating [LightmapProbe]s for dynamic object lighting. Higher values result in more accurate indirect lighting on dynamic objects, at the cost of longer bake times and larger file sizes. - * - * **Note:** Automatically generated [LightmapProbe]s are not visible as nodes in the Scene tree dock, and cannot be modified this way after they are generated. - * - * **Note:** Regardless of [member generate_probes_subdiv], direct lighting on dynamic objects is always applied using [Light3D] nodes in real-time. - */ - get generate_probes_subdiv(): int64 - set generate_probes_subdiv(value: int64) - - /** The [LightmapGIData] associated to this [LightmapGI] node. This resource is automatically created after baking, and is not meant to be created manually. */ - get light_data(): LightmapGIData - set light_data(value: LightmapGIData) - } - /** Contains baked lightmap and dynamic object probe data for [LightmapGI]. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_lightmapgidata.html - */ - class LightmapGIData extends Resource { - constructor(identifier?: any) - /** Adds an object that is considered baked within this [LightmapGIData]. */ - add_user(path: NodePath | string, uv_scale: Rect2, slice_index: int64, sub_instance: int64): void - - /** Returns the number of objects that are considered baked within this [LightmapGIData]. */ - get_user_count(): int64 - - /** Returns the [NodePath] of the baked object at index [param user_idx]. */ - get_user_path(user_idx: int64): NodePath - - /** Clear all objects that are considered baked within this [LightmapGIData]. */ - clear_users(): void - - /** The lightmap atlas textures generated by the lightmapper. */ - get lightmap_textures(): GArray - set lightmap_textures(value: GArray) - get uses_spherical_harmonics(): boolean - set uses_spherical_harmonics(value: boolean) - get user_data(): GArray - set user_data(value: GArray) - get probe_data(): GDictionary - set probe_data(value: GDictionary) - - /** The lightmap atlas texture generated by the lightmapper. */ - get light_texture(): TextureLayered - set light_texture(value: TextureLayered) - get light_textures(): GArray - set light_textures(value: GArray) - } - class LightmapGIEditorPlugin extends EditorPlugin { - constructor(identifier?: any) - _bake(): void - } - class LightmapGIGizmoPlugin extends EditorNode3DGizmoPlugin { - constructor(identifier?: any) - } - /** Represents a single manually placed probe for dynamic object lighting with [LightmapGI]. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_lightmapprobe.html - */ - class LightmapProbe extends Node3D { - constructor(identifier?: any) - } - class LightmapProbeGizmoPlugin extends EditorNode3DGizmoPlugin { - constructor(identifier?: any) - } - /** Abstract class extended by lightmappers, for use in [LightmapGI]. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_lightmapper.html - */ - class Lightmapper extends RefCounted { - constructor(identifier?: any) - } - /** The built-in GPU-based lightmapper for use with [LightmapGI]. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_lightmapperrd.html - */ - class LightmapperRD extends Lightmapper { - constructor(identifier?: any) - } - namespace Line2D { - enum LineJointMode { - /** Makes the polyline's joints pointy, connecting the sides of the two segments by extending them until they intersect. If the rotation of a joint is too big (based on [member sharp_limit]), the joint falls back to [constant LINE_JOINT_BEVEL] to prevent very long miters. */ - LINE_JOINT_SHARP = 0, - - /** Makes the polyline's joints bevelled/chamfered, connecting the sides of the two segments with a simple line. */ - LINE_JOINT_BEVEL = 1, - - /** Makes the polyline's joints rounded, connecting the sides of the two segments with an arc. The detail of this arc depends on [member round_precision]. */ - LINE_JOINT_ROUND = 2, - } - enum LineCapMode { - /** Draws no line cap. */ - LINE_CAP_NONE = 0, - - /** Draws the line cap as a box, slightly extending the first/last segment. */ - LINE_CAP_BOX = 1, - - /** Draws the line cap as a semicircle attached to the first/last segment. */ - LINE_CAP_ROUND = 2, - } - enum LineTextureMode { - /** Takes the left pixels of the texture and renders them over the whole polyline. */ - LINE_TEXTURE_NONE = 0, - - /** Tiles the texture over the polyline. [member CanvasItem.texture_repeat] of the [Line2D] node must be [constant CanvasItem.TEXTURE_REPEAT_ENABLED] or [constant CanvasItem.TEXTURE_REPEAT_MIRROR] for it to work properly. */ - LINE_TEXTURE_TILE = 1, - - /** Stretches the texture across the polyline. [member CanvasItem.texture_repeat] of the [Line2D] node must be [constant CanvasItem.TEXTURE_REPEAT_DISABLED] for best results. */ - LINE_TEXTURE_STRETCH = 2, - } - } - /** A 2D polyline that can optionally be textured. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_line2d.html - */ - class Line2D extends Node2D { - constructor(identifier?: any) - /** Overwrites the position of the point at the given [param index] with the supplied [param position]. */ - set_point_position(index: int64, position: Vector2): void - - /** Returns the position of the point at index [param index]. */ - get_point_position(index: int64): Vector2 - - /** Returns the number of points in the polyline. */ - get_point_count(): int64 - - /** Adds a point with the specified [param position] relative to the polyline's own position. If no [param index] is provided, the new point will be added to the end of the points array. - * If [param index] is given, the new point is inserted before the existing point identified by index [param index]. The indices of the points after the new point get increased by 1. The provided [param index] must not exceed the number of existing points in the polyline. See [method get_point_count]. - */ - add_point(position: Vector2, index: int64 = -1): void - - /** Removes the point at index [param index] from the polyline. */ - remove_point(index: int64): void - - /** Removes all points from the polyline, making it empty. */ - clear_points(): void - - /** The points of the polyline, interpreted in local 2D coordinates. Segments are drawn between the adjacent points in this array. */ - get points(): PackedVector2Array - set points(value: PackedVector2Array | Vector2[]) - - /** If `true` and the polyline has more than 2 points, the last point and the first one will be connected by a segment. - * - * **Note:** The shape of the closing segment is not guaranteed to be seamless if a [member width_curve] is provided. - * - * **Note:** The joint between the closing segment and the first segment is drawn first and it samples the [member gradient] and the [member width_curve] at the beginning. This is an implementation detail that might change in a future version. - */ - get closed(): boolean - set closed(value: boolean) - - /** The polyline's width. */ - get width(): float64 - set width(value: float64) - - /** The polyline's width curve. The width of the polyline over its length will be equivalent to the value of the width curve over its domain. */ - get width_curve(): Curve - set width_curve(value: Curve) - - /** The color of the polyline. Will not be used if a gradient is set. */ - get default_color(): Color - set default_color(value: Color) - - /** The gradient is drawn through the whole line from start to finish. The [member default_color] will not be used if this property is set. */ - get gradient(): Gradient - set gradient(value: Gradient) - - /** The texture used for the polyline. Uses [member texture_mode] for drawing style. */ - get texture(): Texture2D - set texture(value: Texture2D) - - /** The style to render the [member texture] of the polyline. Use [enum LineTextureMode] constants. */ - get texture_mode(): int64 - set texture_mode(value: int64) - - /** The style of the connections between segments of the polyline. Use [enum LineJointMode] constants. */ - get joint_mode(): int64 - set joint_mode(value: int64) - - /** The style of the beginning of the polyline, if [member closed] is `false`. Use [enum LineCapMode] constants. */ - get begin_cap_mode(): int64 - set begin_cap_mode(value: int64) - - /** The style of the end of the polyline, if [member closed] is `false`. Use [enum LineCapMode] constants. */ - get end_cap_mode(): int64 - set end_cap_mode(value: int64) - - /** Determines the miter limit of the polyline. Normally, when [member joint_mode] is set to [constant LINE_JOINT_SHARP], sharp angles fall back to using the logic of [constant LINE_JOINT_BEVEL] joints to prevent very long miters. Higher values of this property mean that the fallback to a bevel joint will happen at sharper angles. */ - get sharp_limit(): float64 - set sharp_limit(value: float64) - - /** The smoothness used for rounded joints and caps. Higher values result in smoother corners, but are more demanding to render and update. */ - get round_precision(): int64 - set round_precision(value: int64) - - /** If `true`, the polyline's border will be anti-aliased. - * - * **Note:** [Line2D] is not accelerated by batching when being anti-aliased. - */ - get antialiased(): boolean - set antialiased(value: boolean) - } - class Line2DEditor extends AbstractPolygon2DEditor { - constructor(identifier?: any) - } - class Line2DEditorPlugin extends AbstractPolygon2DEditorPlugin { - constructor(identifier?: any) - } - namespace LineEdit { - enum MenuItems { - /** Cuts (copies and clears) the selected text. */ - MENU_CUT = 0, - - /** Copies the selected text. */ - MENU_COPY = 1, - - /** Pastes the clipboard text over the selected text (or at the caret's position). - * Non-printable escape characters are automatically stripped from the OS clipboard via [method String.strip_escapes]. - */ - MENU_PASTE = 2, - - /** Erases the whole [LineEdit] text. */ - MENU_CLEAR = 3, - - /** Selects the whole [LineEdit] text. */ - MENU_SELECT_ALL = 4, - - /** Undoes the previous action. */ - MENU_UNDO = 5, - - /** Reverse the last undo action. */ - MENU_REDO = 6, - - /** ID of "Text Writing Direction" submenu. */ - MENU_SUBMENU_TEXT_DIR = 7, - - /** Sets text direction to inherited. */ - MENU_DIR_INHERITED = 8, - - /** Sets text direction to automatic. */ - MENU_DIR_AUTO = 9, - - /** Sets text direction to left-to-right. */ - MENU_DIR_LTR = 10, - - /** Sets text direction to right-to-left. */ - MENU_DIR_RTL = 11, - - /** Toggles control character display. */ - MENU_DISPLAY_UCC = 12, - - /** ID of "Insert Control Character" submenu. */ - MENU_SUBMENU_INSERT_UCC = 13, - - /** Inserts left-to-right mark (LRM) character. */ - MENU_INSERT_LRM = 14, - - /** Inserts right-to-left mark (RLM) character. */ - MENU_INSERT_RLM = 15, - - /** Inserts start of left-to-right embedding (LRE) character. */ - MENU_INSERT_LRE = 16, - - /** Inserts start of right-to-left embedding (RLE) character. */ - MENU_INSERT_RLE = 17, - - /** Inserts start of left-to-right override (LRO) character. */ - MENU_INSERT_LRO = 18, - - /** Inserts start of right-to-left override (RLO) character. */ - MENU_INSERT_RLO = 19, - - /** Inserts pop direction formatting (PDF) character. */ - MENU_INSERT_PDF = 20, - - /** Inserts Arabic letter mark (ALM) character. */ - MENU_INSERT_ALM = 21, - - /** Inserts left-to-right isolate (LRI) character. */ - MENU_INSERT_LRI = 22, - - /** Inserts right-to-left isolate (RLI) character. */ - MENU_INSERT_RLI = 23, - - /** Inserts first strong isolate (FSI) character. */ - MENU_INSERT_FSI = 24, - - /** Inserts pop direction isolate (PDI) character. */ - MENU_INSERT_PDI = 25, - - /** Inserts zero width joiner (ZWJ) character. */ - MENU_INSERT_ZWJ = 26, - - /** Inserts zero width non-joiner (ZWNJ) character. */ - MENU_INSERT_ZWNJ = 27, - - /** Inserts word joiner (WJ) character. */ - MENU_INSERT_WJ = 28, - - /** Inserts soft hyphen (SHY) character. */ - MENU_INSERT_SHY = 29, - - /** Represents the size of the [enum MenuItems] enum. */ - MENU_MAX = 30, - } - enum VirtualKeyboardType { - /** Default text virtual keyboard. */ - KEYBOARD_TYPE_DEFAULT = 0, - - /** Multiline virtual keyboard. */ - KEYBOARD_TYPE_MULTILINE = 1, - - /** Virtual number keypad, useful for PIN entry. */ - KEYBOARD_TYPE_NUMBER = 2, - - /** Virtual number keypad, useful for entering fractional numbers. */ - KEYBOARD_TYPE_NUMBER_DECIMAL = 3, - - /** Virtual phone number keypad. */ - KEYBOARD_TYPE_PHONE = 4, - - /** Virtual keyboard with additional keys to assist with typing email addresses. */ - KEYBOARD_TYPE_EMAIL_ADDRESS = 5, - - /** Virtual keyboard for entering a password. On most platforms, this should disable autocomplete and autocapitalization. - * - * **Note:** This is not supported on Web. Instead, this behaves identically to [constant KEYBOARD_TYPE_DEFAULT]. - */ - KEYBOARD_TYPE_PASSWORD = 6, - - /** Virtual keyboard with additional keys to assist with typing URLs. */ - KEYBOARD_TYPE_URL = 7, - } - } - /** An input field for single-line text. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_lineedit.html - */ - class LineEdit extends Control { - constructor(identifier?: any) - /** Erases the [LineEdit]'s [member text]. */ - clear(): void - - /** Selects characters inside [LineEdit] between [param from] and [param to]. By default, [param from] is at the beginning and [param to] at the end. - * - */ - select(from: int64 = 0, to: int64 = -1): void - - /** Selects the whole [String]. */ - select_all(): void - - /** Clears the current selection. */ - deselect(): void - - /** Returns `true` if the user has selected text. */ - has_selection(): boolean - - /** Returns the text inside the selection. */ - get_selected_text(): string - - /** Returns the selection begin column. */ - get_selection_from_column(): int64 - - /** Returns the selection end column. */ - get_selection_to_column(): int64 - - /** Returns the scroll offset due to [member caret_column], as a number of characters. */ - get_scroll_offset(): float64 - - /** Inserts [param text] at the caret. If the resulting value is longer than [member max_length], nothing happens. */ - insert_text_at_caret(text: string): void - - /** Deletes one character at the caret's current position (equivalent to pressing [kbd]Delete[/kbd]). */ - delete_char_at_caret(): void - - /** Deletes a section of the [member text] going from position [param from_column] to [param to_column]. Both parameters should be within the text's length. */ - delete_text(from_column: int64, to_column: int64): void - - /** Executes a given action as defined in the [enum MenuItems] enum. */ - menu_option(option: int64): void - - /** Returns the [PopupMenu] of this [LineEdit]. By default, this menu is displayed when right-clicking on the [LineEdit]. - * You can add custom menu items or remove standard ones. Make sure your IDs don't conflict with the standard ones (see [enum MenuItems]). For example: - * - * **Warning:** This is a required internal node, removing and freeing it may cause a crash. If you wish to hide it or any of its children, use their [member Window.visible] property. - */ - get_menu(): PopupMenu - - /** Returns whether the menu is visible. Use this instead of `get_menu().visible` to improve performance (so the creation of the menu is avoided). */ - is_menu_visible(): boolean - - /** String value of the [LineEdit]. - * - * **Note:** Changing text using this property won't emit the [signal text_changed] signal. - */ - get text(): string - set text(value: string) - - /** Text shown when the [LineEdit] is empty. It is **not** the [LineEdit]'s default value (see [member text]). */ - get placeholder_text(): string - set placeholder_text(value: string) - - /** Text alignment as defined in the [enum HorizontalAlignment] enum. */ - get alignment(): int64 - set alignment(value: int64) - - /** Maximum number of characters that can be entered inside the [LineEdit]. If `0`, there is no limit. - * When a limit is defined, characters that would exceed [member max_length] are truncated. This happens both for existing [member text] contents when setting the max length, or for new text inserted in the [LineEdit], including pasting. If any input text is truncated, the [signal text_change_rejected] signal is emitted with the truncated substring as parameter. - * **Example:** - * - */ - get max_length(): int64 - set max_length(value: int64) - - /** If `false`, existing text cannot be modified and new text cannot be added. */ - get editable(): boolean - set editable(value: boolean) - - /** If `true`, the [LineEdit] width will increase to stay longer than the [member text]. It will **not** compress if the [member text] is shortened. */ - get expand_to_text_length(): boolean - set expand_to_text_length(value: boolean) - - /** If `true`, the context menu will appear when right-clicked. */ - get context_menu_enabled(): boolean - set context_menu_enabled(value: boolean) - - /** If `true`, the native virtual keyboard is shown when focused on platforms that support it. */ - get virtual_keyboard_enabled(): boolean - set virtual_keyboard_enabled(value: boolean) - - /** Specifies the type of virtual keyboard to show. */ - get virtual_keyboard_type(): int64 - set virtual_keyboard_type(value: int64) - - /** If `true`, the [LineEdit] will show a clear button if [member text] is not empty, which can be used to clear the text quickly. */ - get clear_button_enabled(): boolean - set clear_button_enabled(value: boolean) - - /** If `false`, using shortcuts will be disabled. */ - get shortcut_keys_enabled(): boolean - set shortcut_keys_enabled(value: boolean) - - /** If `false`, using middle mouse button to paste clipboard will be disabled. - * - * **Note:** This method is only implemented on Linux. - */ - get middle_mouse_paste_enabled(): boolean - set middle_mouse_paste_enabled(value: boolean) - - /** If `false`, it's impossible to select the text using mouse nor keyboard. */ - get selecting_enabled(): boolean - set selecting_enabled(value: boolean) - - /** If `true`, the selected text will be deselected when focus is lost. */ - get deselect_on_focus_loss_enabled(): boolean - set deselect_on_focus_loss_enabled(value: boolean) - - /** If `true`, allow drag and drop of selected text. */ - get drag_and_drop_selection_enabled(): boolean - set drag_and_drop_selection_enabled(value: boolean) - - /** Sets the icon that will appear in the right end of the [LineEdit] if there's no [member text], or always, if [member clear_button_enabled] is set to `false`. */ - get right_icon(): Texture2D - set right_icon(value: Texture2D) - - /** If `true`, the [LineEdit] doesn't display decoration. */ - get flat(): boolean - set flat(value: boolean) - - /** If `true`, control characters are displayed. */ - get draw_control_chars(): boolean - set draw_control_chars(value: boolean) - - /** If `true`, the [LineEdit] will select the whole text when it gains focus. */ - get select_all_on_focus(): boolean - set select_all_on_focus(value: boolean) - - /** If `true`, makes the caret blink. */ - get caret_blink(): boolean - set caret_blink(value: boolean) - - /** The interval at which the caret blinks (in seconds). */ - get caret_blink_interval(): float64 - set caret_blink_interval(value: float64) - - /** The caret's column position inside the [LineEdit]. When set, the text may scroll to accommodate it. */ - get caret_column(): int64 - set caret_column(value: int64) - - /** If `true`, the [LineEdit] will always show the caret, even if focus is lost. */ - get caret_force_displayed(): boolean - set caret_force_displayed(value: boolean) - - /** Allow moving caret, selecting and removing the individual composite character components. - * - * **Note:** [kbd]Backspace[/kbd] is always removing individual composite character components. - */ - get caret_mid_grapheme(): boolean - set caret_mid_grapheme(value: boolean) - - /** If `true`, every character is replaced with the secret character (see [member secret_character]). */ - get secret(): boolean - set secret(value: boolean) - - /** The character to use to mask secret input. Only a single character can be used as the secret character. If it is longer than one character, only the first one will be used. If it is empty, a space will be used instead. */ - get secret_character(): string - set secret_character(value: string) - - /** Base text writing direction. */ - get text_direction(): int64 - set text_direction(value: int64) - - /** Language code used for line-breaking and text shaping algorithms. If left empty, current locale is used instead. */ - get language(): string - set language(value: string) - - /** Set BiDi algorithm override for the structured text. */ - get structured_text_bidi_override(): int64 - set structured_text_bidi_override(value: int64) - - /** Set additional options for BiDi override. */ - get structured_text_bidi_override_options(): GArray - set structured_text_bidi_override_options(value: GArray) - - /** Emitted when the text changes. */ - readonly text_changed: Signal1 - - /** Emitted when appending text that overflows the [member max_length]. The appended text is truncated to fit [member max_length], and the part that couldn't fit is passed as the [param rejected_substring] argument. */ - readonly text_change_rejected: Signal1 - - /** Emitted when the user presses [constant KEY_ENTER] on the [LineEdit]. */ - readonly text_submitted: Signal1 - } - namespace LinkButton { - enum UnderlineMode { - /** The LinkButton will always show an underline at the bottom of its text. */ - UNDERLINE_MODE_ALWAYS = 0, - - /** The LinkButton will show an underline at the bottom of its text when the mouse cursor is over it. */ - UNDERLINE_MODE_ON_HOVER = 1, - - /** The LinkButton will never show an underline at the bottom of its text. */ - UNDERLINE_MODE_NEVER = 2, - } - } - /** A button that represents a link. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_linkbutton.html - */ - class LinkButton extends BaseButton { - constructor(identifier?: any) - /** The button's text that will be displayed inside the button's area. */ - get text(): string - set text(value: string) - - /** The underline mode to use for the text. See [enum LinkButton.UnderlineMode] for the available modes. */ - get underline(): int64 - set underline(value: int64) - - /** The [url=https://en.wikipedia.org/wiki/Uniform_Resource_Identifier]URI[/url] for this [LinkButton]. If set to a valid URI, pressing the button opens the URI using the operating system's default program for the protocol (via [method OS.shell_open]). HTTP and HTTPS URLs open the default web browser. - * **Examples:** - * - */ - get uri(): string - set uri(value: string) - - /** Base text writing direction. */ - get text_direction(): int64 - set text_direction(value: int64) - - /** Language code used for line-breaking and text shaping algorithms, if left empty current locale is used instead. */ - get language(): string - set language(value: string) - - /** Set BiDi algorithm override for the structured text. */ - get structured_text_bidi_override(): int64 - set structured_text_bidi_override(value: int64) - - /** Set additional options for BiDi override. */ - get structured_text_bidi_override_options(): GArray - set structured_text_bidi_override_options(value: GArray) - } - class LocalizationEditor extends VBoxContainer { - constructor(identifier?: any) - update_translations(): void - readonly localization_changed: Signal0 - } - /** Abstract base class for the game's main loop. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_mainloop.html - */ - class MainLoop extends Object { - /** Notification received from the OS when the application is exceeding its allocated memory. - * Specific to the iOS platform. - */ - static readonly NOTIFICATION_OS_MEMORY_WARNING = 2009 - - /** Notification received when translations may have changed. Can be triggered by the user changing the locale. Can be used to respond to language changes, for example to change the UI strings on the fly. Useful when working with the built-in translation support, like [method Object.tr]. */ - static readonly NOTIFICATION_TRANSLATION_CHANGED = 2010 - - /** Notification received from the OS when a request for "About" information is sent. - * Specific to the macOS platform. - */ - static readonly NOTIFICATION_WM_ABOUT = 2011 - - /** Notification received from Godot's crash handler when the engine is about to crash. - * Implemented on desktop platforms if the crash handler is enabled. - */ - static readonly NOTIFICATION_CRASH = 2012 - - /** Notification received from the OS when an update of the Input Method Engine occurs (e.g. change of IME cursor position or composition string). - * Specific to the macOS platform. - */ - static readonly NOTIFICATION_OS_IME_UPDATE = 2013 - - /** Notification received from the OS when the application is resumed. - * Specific to the Android and iOS platforms. - */ - static readonly NOTIFICATION_APPLICATION_RESUMED = 2014 - - /** Notification received from the OS when the application is paused. - * Specific to the Android and iOS platforms. - * - * **Note:** On iOS, you only have approximately 5 seconds to finish a task started by this signal. If you go over this allotment, iOS will kill the app instead of pausing it. - */ - static readonly NOTIFICATION_APPLICATION_PAUSED = 2015 - - /** Notification received from the OS when the application is focused, i.e. when changing the focus from the OS desktop or a thirdparty application to any open window of the Godot instance. - * Implemented on desktop and mobile platforms. - */ - static readonly NOTIFICATION_APPLICATION_FOCUS_IN = 2016 - - /** Notification received from the OS when the application is defocused, i.e. when changing the focus from any open window of the Godot instance to the OS desktop or a thirdparty application. - * Implemented on desktop and mobile platforms. - */ - static readonly NOTIFICATION_APPLICATION_FOCUS_OUT = 2017 - - /** Notification received when text server is changed. */ - static readonly NOTIFICATION_TEXT_SERVER_CHANGED = 2018 - constructor(identifier?: any) - - /** Called once during initialization. */ - /* gdvirtual */ _initialize(): void - - /** Called each physics frame with the time since the last physics frame as argument ([param delta], in seconds). Equivalent to [method Node._physics_process]. - * If implemented, the method must return a boolean value. `true` ends the main loop, while `false` lets it proceed to the next frame. - */ - /* gdvirtual */ _physics_process(delta: float64): boolean - - /** Called each process (idle) frame with the time since the last process frame as argument (in seconds). Equivalent to [method Node._process]. - * If implemented, the method must return a boolean value. `true` ends the main loop, while `false` lets it proceed to the next frame. - */ - /* gdvirtual */ _process(delta: float64): boolean - - /** Called before the program exits. */ - /* gdvirtual */ _finalize(): void - - /** Emitted when a user responds to a permission request. */ - readonly on_request_permissions_result: Signal2 - } - /** A container that keeps a margin around its child controls. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_margincontainer.html - */ - class MarginContainer extends Container { - constructor(identifier?: any) - } - /** Generic 2D position hint for editing. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_marker2d.html - */ - class Marker2D extends Node2D { - constructor(identifier?: any) - /** Size of the gizmo cross that appears in the editor. */ - get gizmo_extents(): float64 - set gizmo_extents(value: float64) - } - /** Generic 3D position hint for editing. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_marker3d.html - */ - class Marker3D extends Node3D { - constructor(identifier?: any) - /** Size of the gizmo cross that appears in the editor. */ - get gizmo_extents(): float64 - set gizmo_extents(value: float64) - } - class Marker3DGizmoPlugin extends EditorNode3DGizmoPlugin { - constructor(identifier?: any) - } - /** Virtual base class for applying visual properties to an object, such as color and roughness. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_material.html - */ - class Material extends Resource { - /** Maximum value for the [member render_priority] parameter. */ - static readonly RENDER_PRIORITY_MAX = 127 - - /** Minimum value for the [member render_priority] parameter. */ - static readonly RENDER_PRIORITY_MIN = -128 - constructor(identifier?: any) - - /** Only exposed for the purpose of overriding. You cannot call this function directly. Used internally by various editor tools. Used to access the RID of the [Material]'s [Shader]. */ - /* gdvirtual */ _get_shader_rid(): RID - - /** Only exposed for the purpose of overriding. You cannot call this function directly. Used internally by various editor tools. */ - /* gdvirtual */ _get_shader_mode(): Shader.Mode - - /** Only exposed for the purpose of overriding. You cannot call this function directly. Used internally to determine if [member next_pass] should be shown in the editor or not. */ - /* gdvirtual */ _can_do_next_pass(): boolean - - /** Only exposed for the purpose of overriding. You cannot call this function directly. Used internally to determine if [member render_priority] should be shown in the editor or not. */ - /* gdvirtual */ _can_use_render_priority(): boolean - - /** Only available when running in the editor. Opens a popup that visualizes the generated shader code, including all variants and internal shader code. */ - inspect_native_shader_code(): void - - /** Creates a placeholder version of this resource ([PlaceholderMaterial]). */ - create_placeholder(): Resource - - /** Sets the render priority for objects in 3D scenes. Higher priority objects will be sorted in front of lower priority objects. In other words, all objects with [member render_priority] `1` will render before all objects with [member render_priority] `0`. - * - * **Note:** This only applies to [StandardMaterial3D]s and [ShaderMaterial]s with type "Spatial". - * - * **Note:** This will not impact how transparent objects are sorted relative to opaque objects or how dynamic meshes will be sorted relative to other opaque meshes. This is because all transparent objects are drawn after all opaque objects and all dynamic opaque meshes are drawn before other opaque meshes. - */ - get render_priority(): int64 - set render_priority(value: int64) - - /** Sets the [Material] to be used for the next pass. This renders the object again using a different material. - * - * **Note:** [member next_pass] materials are not necessarily drawn immediately after the source [Material]. Draw order is determined by material properties, [member render_priority], and distance to camera. - * - * **Note:** This only applies to [StandardMaterial3D]s and [ShaderMaterial]s with type "Spatial". - */ - get next_pass(): Material - set next_pass(value: Material) - } - class MaterialEditorPlugin extends EditorPlugin { - constructor(identifier?: any) - } - /** A horizontal menu bar that creates a [MenuButton] for each [PopupMenu] child. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_menubar.html - */ - class MenuBar extends Control { - constructor(identifier?: any) - /** If `true`, shortcuts are disabled and cannot be used to trigger the button. */ - set_disable_shortcuts(disabled: boolean): void - - /** Returns `true`, if system global menu is supported and used by this [MenuBar]. */ - is_native_menu(): boolean - - /** Returns number of menu items. */ - get_menu_count(): int64 - - /** Sets menu item title. */ - set_menu_title(menu: int64, title: string): void - - /** Returns menu item title. */ - get_menu_title(menu: int64): string - - /** Sets menu item tooltip. */ - set_menu_tooltip(menu: int64, tooltip: string): void - - /** Returns menu item tooltip. */ - get_menu_tooltip(menu: int64): string - - /** If `true`, menu item is disabled. */ - set_menu_disabled(menu: int64, disabled: boolean): void - - /** Returns `true`, if menu item is disabled. */ - is_menu_disabled(menu: int64): boolean - - /** If `true`, menu item is hidden. */ - set_menu_hidden(menu: int64, hidden: boolean): void - - /** Returns `true`, if menu item is hidden. */ - is_menu_hidden(menu: int64): boolean - - /** Returns [PopupMenu] associated with menu item. */ - get_menu_popup(menu: int64): PopupMenu - - /** Flat [MenuBar] don't display item decoration. */ - get flat(): boolean - set flat(value: boolean) - - /** Position in the global menu to insert first [MenuBar] item at. */ - get start_index(): int64 - set start_index(value: int64) - - /** If `true`, when the cursor hovers above menu item, it will close the current [PopupMenu] and open the other one. */ - get switch_on_hover(): boolean - set switch_on_hover(value: boolean) - - /** If `true`, [MenuBar] will use system global menu when supported. */ - get prefer_global_menu(): boolean - set prefer_global_menu(value: boolean) - - /** Base text writing direction. */ - get text_direction(): int64 - set text_direction(value: int64) - - /** Language code used for line-breaking and text shaping algorithms, if left empty current locale is used instead. */ - get language(): string - set language(value: string) - } - /** A button that brings up a [PopupMenu] when clicked. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_menubutton.html - */ - class MenuButton extends Button { - constructor(identifier?: any) - /** Returns the [PopupMenu] contained in this button. - * **Warning:** This is a required internal node, removing and freeing it may cause a crash. If you wish to hide it or any of its children, use their [member Window.visible] property. - */ - get_popup(): PopupMenu - - /** Adjusts popup position and sizing for the [MenuButton], then shows the [PopupMenu]. Prefer this over using `get_popup().popup()`. */ - show_popup(): void - - /** If `true`, shortcuts are disabled and cannot be used to trigger the button. */ - set_disable_shortcuts(disabled: boolean): void - - /** If `true`, when the cursor hovers above another [MenuButton] within the same parent which also has [member switch_on_hover] enabled, it will close the current [MenuButton] and open the other one. */ - get switch_on_hover(): boolean - set switch_on_hover(value: boolean) - - /** The number of items currently in the list. */ - get item_count(): any /*Items,popup/item_*/ - set item_count(value: any /*Items,popup/item_*/) - - /** Emitted when the [PopupMenu] of this MenuButton is about to show. */ - readonly about_to_popup: Signal0 - } - namespace Mesh { - enum PrimitiveType { - /** Render array as points (one vertex equals one point). */ - PRIMITIVE_POINTS = 0, - - /** Render array as lines (every two vertices a line is created). */ - PRIMITIVE_LINES = 1, - - /** Render array as line strip. */ - PRIMITIVE_LINE_STRIP = 2, - - /** Render array as triangles (every three vertices a triangle is created). */ - PRIMITIVE_TRIANGLES = 3, - - /** Render array as triangle strips. */ - PRIMITIVE_TRIANGLE_STRIP = 4, - } - enum ArrayType { - /** [PackedVector3Array], [PackedVector2Array], or [Array] of vertex positions. */ - ARRAY_VERTEX = 0, - - /** [PackedVector3Array] of vertex normals. - * - * **Note:** The array has to consist of normal vectors, otherwise they will be normalized by the engine, potentially causing visual discrepancies. - */ - ARRAY_NORMAL = 1, - - /** [PackedFloat32Array] of vertex tangents. Each element in groups of 4 floats, first 3 floats determine the tangent, and the last the binormal direction as -1 or 1. */ - ARRAY_TANGENT = 2, - - /** [PackedColorArray] of vertex colors. */ - ARRAY_COLOR = 3, - - /** [PackedVector2Array] for UV coordinates. */ - ARRAY_TEX_UV = 4, - - /** [PackedVector2Array] for second UV coordinates. */ - ARRAY_TEX_UV2 = 5, - - /** Contains custom color channel 0. [PackedByteArray] if `(format >> Mesh.ARRAY_FORMAT_CUSTOM0_SHIFT) & Mesh.ARRAY_FORMAT_CUSTOM_MASK` is [constant ARRAY_CUSTOM_RGBA8_UNORM], [constant ARRAY_CUSTOM_RGBA8_SNORM], [constant ARRAY_CUSTOM_RG_HALF], or [constant ARRAY_CUSTOM_RGBA_HALF]. [PackedFloat32Array] otherwise. */ - ARRAY_CUSTOM0 = 6, - - /** Contains custom color channel 1. [PackedByteArray] if `(format >> Mesh.ARRAY_FORMAT_CUSTOM1_SHIFT) & Mesh.ARRAY_FORMAT_CUSTOM_MASK` is [constant ARRAY_CUSTOM_RGBA8_UNORM], [constant ARRAY_CUSTOM_RGBA8_SNORM], [constant ARRAY_CUSTOM_RG_HALF], or [constant ARRAY_CUSTOM_RGBA_HALF]. [PackedFloat32Array] otherwise. */ - ARRAY_CUSTOM1 = 7, - - /** Contains custom color channel 2. [PackedByteArray] if `(format >> Mesh.ARRAY_FORMAT_CUSTOM2_SHIFT) & Mesh.ARRAY_FORMAT_CUSTOM_MASK` is [constant ARRAY_CUSTOM_RGBA8_UNORM], [constant ARRAY_CUSTOM_RGBA8_SNORM], [constant ARRAY_CUSTOM_RG_HALF], or [constant ARRAY_CUSTOM_RGBA_HALF]. [PackedFloat32Array] otherwise. */ - ARRAY_CUSTOM2 = 8, - - /** Contains custom color channel 3. [PackedByteArray] if `(format >> Mesh.ARRAY_FORMAT_CUSTOM3_SHIFT) & Mesh.ARRAY_FORMAT_CUSTOM_MASK` is [constant ARRAY_CUSTOM_RGBA8_UNORM], [constant ARRAY_CUSTOM_RGBA8_SNORM], [constant ARRAY_CUSTOM_RG_HALF], or [constant ARRAY_CUSTOM_RGBA_HALF]. [PackedFloat32Array] otherwise. */ - ARRAY_CUSTOM3 = 9, - - /** [PackedFloat32Array] or [PackedInt32Array] of bone indices. Contains either 4 or 8 numbers per vertex depending on the presence of the [constant ARRAY_FLAG_USE_8_BONE_WEIGHTS] flag. */ - ARRAY_BONES = 10, - - /** [PackedFloat32Array] or [PackedFloat64Array] of bone weights in the range `0.0` to `1.0` (inclusive). Contains either 4 or 8 numbers per vertex depending on the presence of the [constant ARRAY_FLAG_USE_8_BONE_WEIGHTS] flag. */ - ARRAY_WEIGHTS = 11, - - /** [PackedInt32Array] of integers used as indices referencing vertices, colors, normals, tangents, and textures. All of those arrays must have the same number of elements as the vertex array. No index can be beyond the vertex array size. When this index array is present, it puts the function into "index mode," where the index selects the *i* 'th vertex, normal, tangent, color, UV, etc. This means if you want to have different normals or colors along an edge, you have to duplicate the vertices. - * For triangles, the index array is interpreted as triples, referring to the vertices of each triangle. For lines, the index array is in pairs indicating the start and end of each line. - */ - ARRAY_INDEX = 12, - - /** Represents the size of the [enum ArrayType] enum. */ - ARRAY_MAX = 13, - } - enum ArrayCustomFormat { - /** Indicates this custom channel contains unsigned normalized byte colors from 0 to 1, encoded as [PackedByteArray]. */ - ARRAY_CUSTOM_RGBA8_UNORM = 0, - - /** Indicates this custom channel contains signed normalized byte colors from -1 to 1, encoded as [PackedByteArray]. */ - ARRAY_CUSTOM_RGBA8_SNORM = 1, - - /** Indicates this custom channel contains half precision float colors, encoded as [PackedByteArray]. Only red and green channels are used. */ - ARRAY_CUSTOM_RG_HALF = 2, - - /** Indicates this custom channel contains half precision float colors, encoded as [PackedByteArray]. */ - ARRAY_CUSTOM_RGBA_HALF = 3, - - /** Indicates this custom channel contains full float colors, in a [PackedFloat32Array]. Only the red channel is used. */ - ARRAY_CUSTOM_R_FLOAT = 4, - - /** Indicates this custom channel contains full float colors, in a [PackedFloat32Array]. Only red and green channels are used. */ - ARRAY_CUSTOM_RG_FLOAT = 5, - - /** Indicates this custom channel contains full float colors, in a [PackedFloat32Array]. Only red, green and blue channels are used. */ - ARRAY_CUSTOM_RGB_FLOAT = 6, - - /** Indicates this custom channel contains full float colors, in a [PackedFloat32Array]. */ - ARRAY_CUSTOM_RGBA_FLOAT = 7, - - /** Represents the size of the [enum ArrayCustomFormat] enum. */ - ARRAY_CUSTOM_MAX = 8, - } - enum ArrayFormat { - /** Mesh array contains vertices. All meshes require a vertex array so this should always be present. */ - ARRAY_FORMAT_VERTEX = 1, - - /** Mesh array contains normals. */ - ARRAY_FORMAT_NORMAL = 2, - - /** Mesh array contains tangents. */ - ARRAY_FORMAT_TANGENT = 4, - - /** Mesh array contains colors. */ - ARRAY_FORMAT_COLOR = 8, - - /** Mesh array contains UVs. */ - ARRAY_FORMAT_TEX_UV = 16, - - /** Mesh array contains second UV. */ - ARRAY_FORMAT_TEX_UV2 = 32, - - /** Mesh array contains custom channel index 0. */ - ARRAY_FORMAT_CUSTOM0 = 64, - - /** Mesh array contains custom channel index 1. */ - ARRAY_FORMAT_CUSTOM1 = 128, - - /** Mesh array contains custom channel index 2. */ - ARRAY_FORMAT_CUSTOM2 = 256, - - /** Mesh array contains custom channel index 3. */ - ARRAY_FORMAT_CUSTOM3 = 512, - - /** Mesh array contains bones. */ - ARRAY_FORMAT_BONES = 1024, - - /** Mesh array contains bone weights. */ - ARRAY_FORMAT_WEIGHTS = 2048, - - /** Mesh array uses indices. */ - ARRAY_FORMAT_INDEX = 4096, - - /** Mask of mesh channels permitted in blend shapes. */ - ARRAY_FORMAT_BLEND_SHAPE_MASK = 7, - - /** Shift of first custom channel. */ - ARRAY_FORMAT_CUSTOM_BASE = 13, - - /** Number of format bits per custom channel. See [enum ArrayCustomFormat]. */ - ARRAY_FORMAT_CUSTOM_BITS = 3, - - /** Amount to shift [enum ArrayCustomFormat] for custom channel index 0. */ - ARRAY_FORMAT_CUSTOM0_SHIFT = 13, - - /** Amount to shift [enum ArrayCustomFormat] for custom channel index 1. */ - ARRAY_FORMAT_CUSTOM1_SHIFT = 16, - - /** Amount to shift [enum ArrayCustomFormat] for custom channel index 2. */ - ARRAY_FORMAT_CUSTOM2_SHIFT = 19, - - /** Amount to shift [enum ArrayCustomFormat] for custom channel index 3. */ - ARRAY_FORMAT_CUSTOM3_SHIFT = 22, - - /** Mask of custom format bits per custom channel. Must be shifted by one of the SHIFT constants. See [enum ArrayCustomFormat]. */ - ARRAY_FORMAT_CUSTOM_MASK = 7, - - /** Shift of first compress flag. Compress flags should be passed to [method ArrayMesh.add_surface_from_arrays] and [method SurfaceTool.commit]. */ - ARRAY_COMPRESS_FLAGS_BASE = 25, - - /** Flag used to mark that the array contains 2D vertices. */ - ARRAY_FLAG_USE_2D_VERTICES = 33554432, - - /** Flag indices that the mesh data will use `GL_DYNAMIC_DRAW` on GLES. Unused on Vulkan. */ - ARRAY_FLAG_USE_DYNAMIC_UPDATE = 67108864, - - /** Flag used to mark that the mesh contains up to 8 bone influences per vertex. This flag indicates that [constant ARRAY_BONES] and [constant ARRAY_WEIGHTS] elements will have double length. */ - ARRAY_FLAG_USE_8_BONE_WEIGHTS = 134217728, - - /** Flag used to mark that the mesh intentionally contains no vertex array. */ - ARRAY_FLAG_USES_EMPTY_VERTEX_ARRAY = 268435456, - - /** Flag used to mark that a mesh is using compressed attributes (vertices, normals, tangents, UVs). When this form of compression is enabled, vertex positions will be packed into an RGBA16UNORM attribute and scaled in the vertex shader. The normal and tangent will be packed into an RG16UNORM representing an axis, and a 16-bit float stored in the A-channel of the vertex. UVs will use 16-bit normalized floats instead of full 32-bit signed floats. When using this compression mode you must use either vertices, normals, and tangents or only vertices. You cannot use normals without tangents. Importers will automatically enable this compression if they can. */ - ARRAY_FLAG_COMPRESS_ATTRIBUTES = 536870912, - } - enum BlendShapeMode { - /** Blend shapes are normalized. */ - BLEND_SHAPE_MODE_NORMALIZED = 0, - - /** Blend shapes are relative to base weight. */ - BLEND_SHAPE_MODE_RELATIVE = 1, - } - } - /** A [Resource] that contains vertex array-based geometry. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_mesh.html - */ - class Mesh extends Resource { - constructor(identifier?: any) - /** Virtual method to override the surface count for a custom class extending [Mesh]. */ - /* gdvirtual */ _get_surface_count(): int64 - - /** Virtual method to override the surface array length for a custom class extending [Mesh]. */ - /* gdvirtual */ _surface_get_array_len(index: int64): int64 - - /** Virtual method to override the surface array index length for a custom class extending [Mesh]. */ - /* gdvirtual */ _surface_get_array_index_len(index: int64): int64 - - /** Virtual method to override the surface arrays for a custom class extending [Mesh]. */ - /* gdvirtual */ _surface_get_arrays(index: int64): GArray - - /** Virtual method to override the blend shape arrays for a custom class extending [Mesh]. */ - /* gdvirtual */ _surface_get_blend_shape_arrays(index: int64): GArray - - /** Virtual method to override the surface LODs for a custom class extending [Mesh]. */ - /* gdvirtual */ _surface_get_lods(index: int64): GDictionary - - /** Virtual method to override the surface format for a custom class extending [Mesh]. */ - /* gdvirtual */ _surface_get_format(index: int64): int64 - - /** Virtual method to override the surface primitive type for a custom class extending [Mesh]. */ - /* gdvirtual */ _surface_get_primitive_type(index: int64): int64 - - /** Virtual method to override the setting of a [param material] at the given [param index] for a custom class extending [Mesh]. */ - /* gdvirtual */ _surface_set_material(index: int64, material: Material): void - - /** Virtual method to override the surface material for a custom class extending [Mesh]. */ - /* gdvirtual */ _surface_get_material(index: int64): Material - - /** Virtual method to override the number of blend shapes for a custom class extending [Mesh]. */ - /* gdvirtual */ _get_blend_shape_count(): int64 - - /** Virtual method to override the retrieval of blend shape names for a custom class extending [Mesh]. */ - /* gdvirtual */ _get_blend_shape_name(index: int64): StringName - - /** Virtual method to override the names of blend shapes for a custom class extending [Mesh]. */ - /* gdvirtual */ _set_blend_shape_name(index: int64, name: StringName): void - - /** Virtual method to override the [AABB] for a custom class extending [Mesh]. */ - /* gdvirtual */ _get_aabb(): AABB - - /** Returns the smallest [AABB] enclosing this mesh in local space. Not affected by `custom_aabb`. - * - * **Note:** This is only implemented for [ArrayMesh] and [PrimitiveMesh]. - */ - get_aabb(): AABB - - /** Returns all the vertices that make up the faces of the mesh. Each three vertices represent one triangle. */ - get_faces(): PackedVector3Array - - /** Returns the number of surfaces that the [Mesh] holds. This is equivalent to [method MeshInstance3D.get_surface_override_material_count]. */ - get_surface_count(): int64 - - /** Returns the arrays for the vertices, normals, UVs, etc. that make up the requested surface (see [method ArrayMesh.add_surface_from_arrays]). */ - surface_get_arrays(surf_idx: int64): GArray - - /** Returns the blend shape arrays for the requested surface. */ - surface_get_blend_shape_arrays(surf_idx: int64): GArray - - /** Sets a [Material] for a given surface. Surface will be rendered using this material. - * - * **Note:** This assigns the material within the [Mesh] resource, not the [Material] associated to the [MeshInstance3D]'s Surface Material Override properties. To set the [Material] associated to the [MeshInstance3D]'s Surface Material Override properties, use [method MeshInstance3D.set_surface_override_material] instead. - */ - surface_set_material(surf_idx: int64, material: Material): void - - /** Returns a [Material] in a given surface. Surface is rendered using this material. - * - * **Note:** This returns the material within the [Mesh] resource, not the [Material] associated to the [MeshInstance3D]'s Surface Material Override properties. To get the [Material] associated to the [MeshInstance3D]'s Surface Material Override properties, use [method MeshInstance3D.get_surface_override_material] instead. - */ - surface_get_material(surf_idx: int64): Material - - /** Creates a placeholder version of this resource ([PlaceholderMesh]). */ - create_placeholder(): Resource - - /** Calculate a [ConcavePolygonShape3D] from the mesh. */ - create_trimesh_shape(): ConcavePolygonShape3D - - /** Calculate a [ConvexPolygonShape3D] from the mesh. - * If [param clean] is `true` (default), duplicate and interior vertices are removed automatically. You can set it to `false` to make the process faster if not needed. - * If [param simplify] is `true`, the geometry can be further simplified to reduce the number of vertices. Disabled by default. - */ - create_convex_shape(clean: boolean = true, simplify: boolean = false): ConvexPolygonShape3D - - /** Calculate an outline mesh at a defined offset (margin) from the original mesh. - * - * **Note:** This method typically returns the vertices in reverse order (e.g. clockwise to counterclockwise). - */ - create_outline(margin: float64): Mesh - - /** Generate a [TriangleMesh] from the mesh. Considers only surfaces using one of these primitive types: [constant PRIMITIVE_TRIANGLES], [constant PRIMITIVE_TRIANGLE_STRIP]. */ - generate_triangle_mesh(): TriangleMesh - - /** Sets a hint to be used for lightmap resolution. */ - get lightmap_size_hint(): Vector2i - set lightmap_size_hint(value: Vector2i) - } - namespace MeshConvexDecompositionSettings { - enum Mode { - /** Constant for voxel-based approximate convex decomposition. */ - CONVEX_DECOMPOSITION_MODE_VOXEL = 0, - - /** Constant for tetrahedron-based approximate convex decomposition. */ - CONVEX_DECOMPOSITION_MODE_TETRAHEDRON = 1, - } - } - /** Parameters to be used with a [Mesh] convex decomposition operation. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_meshconvexdecompositionsettings.html - */ - class MeshConvexDecompositionSettings extends RefCounted { - constructor(identifier?: any) - /** Maximum concavity. Ranges from `0.0` to `1.0`. */ - get max_concavity(): float64 - set max_concavity(value: float64) - - /** Controls the bias toward clipping along symmetry planes. Ranges from `0.0` to `1.0`. */ - get symmetry_planes_clipping_bias(): float64 - set symmetry_planes_clipping_bias(value: float64) - - /** Controls the bias toward clipping along revolution axes. Ranges from `0.0` to `1.0`. */ - get revolution_axes_clipping_bias(): float64 - set revolution_axes_clipping_bias(value: float64) - - /** Controls the adaptive sampling of the generated convex-hulls. Ranges from `0.0` to `0.01`. */ - get min_volume_per_convex_hull(): float64 - set min_volume_per_convex_hull(value: float64) - - /** Maximum number of voxels generated during the voxelization stage. */ - get resolution(): int64 - set resolution(value: int64) - - /** Controls the maximum number of triangles per convex-hull. Ranges from `4` to `1024`. */ - get max_num_vertices_per_convex_hull(): int64 - set max_num_vertices_per_convex_hull(value: int64) - - /** Controls the granularity of the search for the "best" clipping plane. Ranges from `1` to `16`. */ - get plane_downsampling(): int64 - set plane_downsampling(value: int64) - - /** Controls the precision of the convex-hull generation process during the clipping plane selection stage. Ranges from `1` to `16`. */ - get convex_hull_downsampling(): int64 - set convex_hull_downsampling(value: int64) - - /** If `true`, normalizes the mesh before applying the convex decomposition. */ - get normalize_mesh(): boolean - set normalize_mesh(value: boolean) - - /** Mode for the approximate convex decomposition. */ - get mode(): int64 - set mode(value: int64) - - /** If `true`, uses approximation for computing convex hulls. */ - get convex_hull_approximation(): boolean - set convex_hull_approximation(value: boolean) - - /** The maximum number of convex hulls to produce from the merge operation. */ - get max_convex_hulls(): int64 - set max_convex_hulls(value: int64) - - /** If `true`, projects output convex hull vertices onto the original source mesh to increase floating-point accuracy of the results. */ - get project_hull_vertices(): boolean - set project_hull_vertices(value: boolean) - } - /** Helper tool to access and edit [Mesh] data. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_meshdatatool.html - */ - class MeshDataTool extends RefCounted { - constructor(identifier?: any) - /** Clears all data currently in MeshDataTool. */ - clear(): void - - /** Uses specified surface of given [Mesh] to populate data for MeshDataTool. - * Requires [Mesh] with primitive type [constant Mesh.PRIMITIVE_TRIANGLES]. - */ - create_from_surface(mesh: ArrayMesh, surface: int64): GError - - /** Adds a new surface to specified [Mesh] with edited data. */ - commit_to_surface(mesh: ArrayMesh, compression_flags: int64 = 0): GError - - /** Returns the [Mesh]'s format as a combination of the [enum Mesh.ArrayFormat] flags. For example, a mesh containing both vertices and normals would return a format of `3` because [constant Mesh.ARRAY_FORMAT_VERTEX] is `1` and [constant Mesh.ARRAY_FORMAT_NORMAL] is `2`. */ - get_format(): int64 - - /** Returns the total number of vertices in [Mesh]. */ - get_vertex_count(): int64 - - /** Returns the number of edges in this [Mesh]. */ - get_edge_count(): int64 - - /** Returns the number of faces in this [Mesh]. */ - get_face_count(): int64 - - /** Sets the position of the given vertex. */ - set_vertex(idx: int64, vertex: Vector3): void - - /** Returns the position of the given vertex. */ - get_vertex(idx: int64): Vector3 - - /** Sets the normal of the given vertex. */ - set_vertex_normal(idx: int64, normal: Vector3): void - - /** Returns the normal of the given vertex. */ - get_vertex_normal(idx: int64): Vector3 - - /** Sets the tangent of the given vertex. */ - set_vertex_tangent(idx: int64, tangent: Plane): void - - /** Returns the tangent of the given vertex. */ - get_vertex_tangent(idx: int64): Plane - - /** Sets the UV of the given vertex. */ - set_vertex_uv(idx: int64, uv: Vector2): void - - /** Returns the UV of the given vertex. */ - get_vertex_uv(idx: int64): Vector2 - - /** Sets the UV2 of the given vertex. */ - set_vertex_uv2(idx: int64, uv2: Vector2): void - - /** Returns the UV2 of the given vertex. */ - get_vertex_uv2(idx: int64): Vector2 - - /** Sets the color of the given vertex. */ - set_vertex_color(idx: int64, color: Color): void - - /** Returns the color of the given vertex. */ - get_vertex_color(idx: int64): Color - - /** Sets the bones of the given vertex. */ - set_vertex_bones(idx: int64, bones: PackedInt32Array | int32[]): void - - /** Returns the bones of the given vertex. */ - get_vertex_bones(idx: int64): PackedInt32Array - - /** Sets the bone weights of the given vertex. */ - set_vertex_weights(idx: int64, weights: PackedFloat32Array | float32[]): void - - /** Returns bone weights of the given vertex. */ - get_vertex_weights(idx: int64): PackedFloat32Array - - /** Sets the metadata associated with the given vertex. */ - set_vertex_meta(idx: int64, meta: any): void - - /** Returns the metadata associated with the given vertex. */ - get_vertex_meta(idx: int64): any - - /** Returns an array of edges that share the given vertex. */ - get_vertex_edges(idx: int64): PackedInt32Array - - /** Returns an array of faces that share the given vertex. */ - get_vertex_faces(idx: int64): PackedInt32Array - - /** Returns index of specified vertex connected to given edge. - * Vertex argument can only be 0 or 1 because edges are comprised of two vertices. - */ - get_edge_vertex(idx: int64, vertex: int64): int64 - - /** Returns array of faces that touch given edge. */ - get_edge_faces(idx: int64): PackedInt32Array - - /** Sets the metadata of the given edge. */ - set_edge_meta(idx: int64, meta: any): void - - /** Returns meta information assigned to given edge. */ - get_edge_meta(idx: int64): any - - /** Returns the specified vertex index of the given face. - * Vertex argument must be either 0, 1, or 2 because faces contain three vertices. - * **Example:** - * - */ - get_face_vertex(idx: int64, vertex: int64): int64 - - /** Returns specified edge associated with given face. - * Edge argument must be either 0, 1, or 2 because a face only has three edges. - */ - get_face_edge(idx: int64, edge: int64): int64 - - /** Sets the metadata of the given face. */ - set_face_meta(idx: int64, meta: any): void - - /** Returns the metadata associated with the given face. */ - get_face_meta(idx: int64): any - - /** Calculates and returns the face normal of the given face. */ - get_face_normal(idx: int64): Vector3 - - /** Sets the material to be used by newly-constructed [Mesh]. */ - set_material(material: Material): void - - /** Returns the material assigned to the [Mesh]. */ - get_material(): Material - } - class MeshEditorPlugin extends EditorPlugin { - constructor(identifier?: any) - } - /** Node used for displaying a [Mesh] in 2D. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_meshinstance2d.html - */ - class MeshInstance2D extends Node2D { - constructor(identifier?: any) - /** The [Mesh] that will be drawn by the [MeshInstance2D]. */ - get mesh(): Mesh - set mesh(value: Mesh) - - /** The [Texture2D] that will be used if using the default [CanvasItemMaterial]. Can be accessed as `TEXTURE` in CanvasItem shader. */ - get texture(): Texture2D - set texture(value: Texture2D) - - /** Emitted when the [member texture] is changed. */ - readonly texture_changed: Signal0 - } - /** Node that instances meshes into a scenario. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_meshinstance3d.html - */ - class MeshInstance3D extends GeometryInstance3D { - constructor(identifier?: any) - /** Returns the internal [SkinReference] containing the skeleton's [RID] attached to this RID. See also [method Resource.get_rid], [method SkinReference.get_skeleton], and [method RenderingServer.instance_attach_skeleton]. */ - get_skin_reference(): SkinReference - - /** Returns the number of surface override materials. This is equivalent to [method Mesh.get_surface_count]. See also [method get_surface_override_material]. */ - get_surface_override_material_count(): int64 - - /** Sets the override [param material] for the specified [param surface] of the [Mesh] resource. This material is associated with this [MeshInstance3D] rather than with [member mesh]. - * - * **Note:** This assigns the [Material] associated to the [MeshInstance3D]'s Surface Material Override properties, not the material within the [Mesh] resource. To set the material within the [Mesh] resource, use [method Mesh.surface_get_material] instead. - */ - set_surface_override_material(surface: int64, material: Material): void - - /** Returns the override [Material] for the specified [param surface] of the [Mesh] resource. See also [method get_surface_override_material_count]. - * - * **Note:** This returns the [Material] associated to the [MeshInstance3D]'s Surface Material Override properties, not the material within the [Mesh] resource. To get the material within the [Mesh] resource, use [method Mesh.surface_get_material] instead. - */ - get_surface_override_material(surface: int64): Material - - /** Returns the [Material] that will be used by the [Mesh] when drawing. This can return the [member GeometryInstance3D.material_override], the surface override [Material] defined in this [MeshInstance3D], or the surface [Material] defined in the [member mesh]. For example, if [member GeometryInstance3D.material_override] is used, all surfaces will return the override material. - * Returns `null` if no material is active, including when [member mesh] is `null`. - */ - get_active_material(surface: int64): Material - - /** This helper creates a [StaticBody3D] child node with a [ConcavePolygonShape3D] collision shape calculated from the mesh geometry. It's mainly used for testing. */ - create_trimesh_collision(): void - - /** This helper creates a [StaticBody3D] child node with a [ConvexPolygonShape3D] collision shape calculated from the mesh geometry. It's mainly used for testing. - * If [param clean] is `true` (default), duplicate and interior vertices are removed automatically. You can set it to `false` to make the process faster if not needed. - * If [param simplify] is `true`, the geometry can be further simplified to reduce the number of vertices. Disabled by default. - */ - create_convex_collision(clean: boolean = true, simplify: boolean = false): void - - /** This helper creates a [StaticBody3D] child node with multiple [ConvexPolygonShape3D] collision shapes calculated from the mesh geometry via convex decomposition. The convex decomposition operation can be controlled with parameters from the optional [param settings]. */ - create_multiple_convex_collisions(settings: MeshConvexDecompositionSettings = undefined): void - - /** Returns the number of blend shapes available. Produces an error if [member mesh] is `null`. */ - get_blend_shape_count(): int64 - - /** Returns the index of the blend shape with the given [param name]. Returns `-1` if no blend shape with this name exists, including when [member mesh] is `null`. */ - find_blend_shape_by_name(name: StringName): int64 - - /** Returns the value of the blend shape at the given [param blend_shape_idx]. Returns `0.0` and produces an error if [member mesh] is `null` or doesn't have a blend shape at that index. */ - get_blend_shape_value(blend_shape_idx: int64): float64 - - /** Sets the value of the blend shape at [param blend_shape_idx] to [param value]. Produces an error if [member mesh] is `null` or doesn't have a blend shape at that index. */ - set_blend_shape_value(blend_shape_idx: int64, value: float64): void - - /** This helper creates a [MeshInstance3D] child node with gizmos at every vertex calculated from the mesh geometry. It's mainly used for testing. */ - create_debug_tangents(): void - - /** Takes a snapshot from the current [ArrayMesh] with all blend shapes applied according to their current weights and bakes it to the provided [param existing] mesh. If no [param existing] mesh is provided a new [ArrayMesh] is created, baked and returned. Mesh surface materials are not copied. - * **Performance:** [Mesh] data needs to be received from the GPU, stalling the [RenderingServer] in the process. - */ - bake_mesh_from_current_blend_shape_mix(existing: ArrayMesh = undefined): ArrayMesh - - /** The [Mesh] resource for the instance. */ - get mesh(): Mesh - set mesh(value: Mesh) - - /** The [Skin] to be used by this instance. */ - get skin(): Skin - set skin(value: Skin) - - /** [NodePath] to the [Skeleton3D] associated with the instance. */ - get skeleton(): NodePath - set skeleton(value: NodePath | string) - } - class MeshInstance3DEditor extends Control { - constructor(identifier?: any) - } - class MeshInstance3DEditorPlugin extends EditorPlugin { - constructor(identifier?: any) - } - class MeshInstance3DGizmoPlugin extends EditorNode3DGizmoPlugin { - constructor(identifier?: any) - } - /** Library of meshes. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_meshlibrary.html - */ - class MeshLibrary extends Resource { - constructor(identifier?: any) - /** Creates a new item in the library with the given ID. - * You can get an unused ID from [method get_last_unused_item_id]. - */ - create_item(id: int64): void - - /** Sets the item's name. - * This name is shown in the editor. It can also be used to look up the item later using [method find_item_by_name]. - */ - set_item_name(id: int64, name: string): void - - /** Sets the item's mesh. */ - set_item_mesh(id: int64, mesh: Mesh): void - - /** Sets the transform to apply to the item's mesh. */ - set_item_mesh_transform(id: int64, mesh_transform: Transform3D): void - - /** Sets the item's navigation mesh. */ - set_item_navigation_mesh(id: int64, navigation_mesh: NavigationMesh): void - - /** Sets the transform to apply to the item's navigation mesh. */ - set_item_navigation_mesh_transform(id: int64, navigation_mesh: Transform3D): void - - /** Sets the item's navigation layers bitmask. */ - set_item_navigation_layers(id: int64, navigation_layers: int64): void - - /** Sets an item's collision shapes. - * The array should consist of [Shape3D] objects, each followed by a [Transform3D] that will be applied to it. For shapes that should not have a transform, use [constant Transform3D.IDENTITY]. - */ - set_item_shapes(id: int64, shapes: GArray): void - - /** Sets a texture to use as the item's preview icon in the editor. */ - set_item_preview(id: int64, texture: Texture2D): void - - /** Returns the item's name. */ - get_item_name(id: int64): string - - /** Returns the item's mesh. */ - get_item_mesh(id: int64): Mesh - - /** Returns the transform applied to the item's mesh. */ - get_item_mesh_transform(id: int64): Transform3D - - /** Returns the item's navigation mesh. */ - get_item_navigation_mesh(id: int64): NavigationMesh - - /** Returns the transform applied to the item's navigation mesh. */ - get_item_navigation_mesh_transform(id: int64): Transform3D - - /** Returns the item's navigation layers bitmask. */ - get_item_navigation_layers(id: int64): int64 - - /** Returns an item's collision shapes. - * The array consists of each [Shape3D] followed by its [Transform3D]. - */ - get_item_shapes(id: int64): GArray - - /** When running in the editor, returns a generated item preview (a 3D rendering in isometric perspective). When used in a running project, returns the manually-defined item preview which can be set using [method set_item_preview]. Returns an empty [Texture2D] if no preview was manually set in a running project. */ - get_item_preview(id: int64): Texture2D - - /** Removes the item. */ - remove_item(id: int64): void - - /** Returns the first item with the given name, or `-1` if no item is found. */ - find_item_by_name(name: string): int64 - - /** Clears the library. */ - clear(): void - - /** Returns the list of item IDs in use. */ - get_item_list(): PackedInt32Array - - /** Gets an unused ID for a new item. */ - get_last_unused_item_id(): int64 - } - class MeshLibraryEditor extends Control { - constructor(identifier?: any) - } - class MeshLibraryEditorPlugin extends EditorPlugin { - constructor(identifier?: any) - } - /** Simple texture that uses a mesh to draw itself. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_meshtexture.html - */ - class MeshTexture extends Texture2D { - constructor(identifier?: any) - /** Sets the mesh used to draw. It must be a mesh using 2D vertices. */ - get mesh(): Mesh - set mesh(value: Mesh) - - /** Sets the base texture that the Mesh will use to draw. */ - get base_texture(): Texture2D - set base_texture(value: Texture2D) - - /** Sets the size of the image, needed for reference. */ - get image_size(): Vector2 - set image_size(value: Vector2) - } - /** Interpolates an abstract value and supplies it to a method called over time. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_methodtweener.html - */ - class MethodTweener extends Tweener { - constructor(identifier?: any) - /** Sets the time in seconds after which the [MethodTweener] will start interpolating. By default there's no delay. */ - set_delay(delay: float64): MethodTweener - - /** Sets the type of used transition from [enum Tween.TransitionType]. If not set, the default transition is used from the [Tween] that contains this Tweener. */ - set_trans(trans: Tween.TransitionType): MethodTweener - - /** Sets the type of used easing from [enum Tween.EaseType]. If not set, the default easing is used from the [Tween] that contains this Tweener. */ - set_ease(ease: Tween.EaseType): MethodTweener - } - /** An internal editor class intended for keeping the data of unrecognized nodes. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_missingnode.html - */ - class MissingNode extends Node { - constructor(identifier?: any) - /** The name of the class this node was supposed to be (see [method Object.get_class]). */ - get original_class(): string - set original_class(value: string) - - /** Returns the path of the scene this node was instance of originally. */ - get original_scene(): string - set original_scene(value: string) - - /** If `true`, allows new properties to be set along with existing ones. If `false`, only existing properties' values can be set, and new properties cannot be added. */ - get recording_properties(): boolean - set recording_properties(value: boolean) - } - /** An internal editor class intended for keeping the data of unrecognized resources. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_missingresource.html - */ - class MissingResource extends Resource { - constructor(identifier?: any) - /** The name of the class this resource was supposed to be (see [method Object.get_class]). */ - get original_class(): string - set original_class(value: string) - - /** If set to `true`, allows new properties to be added on top of the existing ones with [method Object.set]. */ - get recording_properties(): boolean - set recording_properties(value: boolean) - } - /** Generic mobile VR implementation. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_mobilevrinterface.html - */ - class MobileVRInterface extends XRInterface { - constructor(identifier?: any) - /** The height at which the camera is placed in relation to the ground (i.e. [XROrigin3D] node). */ - get eye_height(): float64 - set eye_height(value: float64) - - /** The interocular distance, also known as the interpupillary distance. The distance between the pupils of the left and right eye. */ - get iod(): float64 - set iod(value: float64) - - /** The width of the display in centimeters. */ - get display_width(): float64 - set display_width(value: float64) - - /** The distance between the display and the lenses inside of the device in centimeters. */ - get display_to_lens(): float64 - set display_to_lens(value: float64) - - /** Set the offset rect relative to the area being rendered. A length of 1 represents the whole rendering area on that axis. */ - get offset_rect(): Rect2 - set offset_rect(value: Rect2) - - /** The oversample setting. Because of the lens distortion we have to render our buffers at a higher resolution then the screen can natively handle. A value between 1.5 and 2.0 often provides good results but at the cost of performance. */ - get oversample(): float64 - set oversample(value: float64) - - /** The k1 lens factor is one of the two constants that define the strength of the lens used and directly influences the lens distortion effect. */ - get k1(): float64 - set k1(value: float64) - - /** The k2 lens factor, see k1. */ - get k2(): float64 - set k2(value: float64) - - /** The minimum radius around the focal point where full quality is guaranteed if VRS is used as a percentage of screen size. - * - * **Note:** Mobile and Forward+ renderers only. Requires [member Viewport.vrs_mode] to be set to [constant Viewport.VRS_XR]. - */ - get vrs_min_radius(): float64 - set vrs_min_radius(value: float64) - - /** The strength used to calculate the VRS density map. The greater this value, the more noticeable VRS is. This improves performance at the cost of quality. - * - * **Note:** Mobile and Forward+ renderers only. Requires [member Viewport.vrs_mode] to be set to [constant Viewport.VRS_XR]. - */ - get vrs_strength(): float64 - set vrs_strength(value: float64) - } - /** Abstract class for non-real-time video recording encoders. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_moviewriter.html - */ - class MovieWriter extends Object { - constructor(identifier?: any) - /** Called when the audio sample rate used for recording the audio is requested by the engine. The value returned must be specified in Hz. Defaults to 48000 Hz if [method _get_audio_mix_rate] is not overridden. */ - /* gdvirtual */ _get_audio_mix_rate(): int64 - - /** Called when the audio speaker mode used for recording the audio is requested by the engine. This can affect the number of output channels in the resulting audio file/stream. Defaults to [constant AudioServer.SPEAKER_MODE_STEREO] if [method _get_audio_speaker_mode] is not overridden. */ - /* gdvirtual */ _get_audio_speaker_mode(): AudioServer.SpeakerMode - - /** Called when the engine determines whether this [MovieWriter] is able to handle the file at [param path]. Must return `true` if this [MovieWriter] is able to handle the given file path, `false` otherwise. Typically, [method _handles_file] is overridden as follows to allow the user to record a file at any path with a given file extension: - * - */ - /* gdvirtual */ _handles_file(path: string): boolean - - /** Called once before the engine starts writing video and audio data. [param movie_size] is the width and height of the video to save. [param fps] is the number of frames per second specified in the project settings or using the `--fixed-fps ` [url=https://docs.godotengine.org/en/4.3/tutorials/editor/command_line_tutorial.html]command line argument[/url]. */ - /* gdvirtual */ _write_begin(movie_size: Vector2i, fps: int64, base_path: string): GError - - /** Called at the end of every rendered frame. The [param frame_image] and [param audio_frame_block] function arguments should be written to. */ - /* gdvirtual */ _write_frame(frame_image: Image, audio_frame_block: int64): GError - - /** Called when the engine finishes writing. This occurs when the engine quits by pressing the window manager's close button, or when [method SceneTree.quit] is called. - * - * **Note:** Pressing [kbd]Ctrl + C[/kbd] on the terminal running the editor/project does *not* result in [method _write_end] being called. - */ - /* gdvirtual */ _write_end(): void - - /** Adds a writer to be usable by the engine. The supported file extensions can be set by overriding [method _handles_file]. - * - * **Note:** [method add_writer] must be called early enough in the engine initialization to work, as movie writing is designed to start at the same time as the rest of the engine. - */ - static add_writer(writer: MovieWriter): void - } - class MovieWriterMJPEG extends MovieWriter { - constructor(identifier?: any) - } - class MovieWriterPNGWAV extends MovieWriter { - constructor(identifier?: any) - } - namespace MultiMesh { - enum TransformFormat { - /** Use this when using 2D transforms. */ - TRANSFORM_2D = 0, - - /** Use this when using 3D transforms. */ - TRANSFORM_3D = 1, - } - } - /** Provides high-performance drawing of a mesh multiple times using GPU instancing. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_multimesh.html - */ - class MultiMesh extends Resource { - constructor(identifier?: any) - /** Sets the [Transform3D] for a specific instance. */ - set_instance_transform(instance: int64, transform: Transform3D): void - - /** Sets the [Transform2D] for a specific instance. */ - set_instance_transform_2d(instance: int64, transform: Transform2D): void - - /** Returns the [Transform3D] of a specific instance. */ - get_instance_transform(instance: int64): Transform3D - - /** Returns the [Transform2D] of a specific instance. */ - get_instance_transform_2d(instance: int64): Transform2D - - /** Sets the color of a specific instance by *multiplying* the mesh's existing vertex colors. This allows for different color tinting per instance. - * - * **Note:** Each component is stored in 32 bits in the Forward+ and Mobile rendering methods, but is packed into 16 bits in the Compatibility rendering method. - * For the color to take effect, ensure that [member use_colors] is `true` on the [MultiMesh] and [member BaseMaterial3D.vertex_color_use_as_albedo] is `true` on the material. If you intend to set an absolute color instead of tinting, make sure the material's albedo color is set to pure white (`Color(1, 1, 1)`). - */ - set_instance_color(instance: int64, color: Color): void - - /** Gets a specific instance's color multiplier. */ - get_instance_color(instance: int64): Color - - /** Sets custom data for a specific instance. [param custom_data] is a [Color] type only to contain 4 floating-point numbers. - * - * **Note:** Each number is stored in 32 bits in the Forward+ and Mobile rendering methods, but is packed into 16 bits in the Compatibility rendering method. - * For the custom data to be used, ensure that [member use_custom_data] is `true`. - * This custom instance data has to be manually accessed in your custom shader using `INSTANCE_CUSTOM`. - */ - set_instance_custom_data(instance: int64, custom_data: Color): void - - /** Returns the custom data that has been set for a specific instance. */ - get_instance_custom_data(instance: int64): Color - - /** Returns the visibility axis-aligned bounding box in local space. */ - get_aabb(): AABB - - /** Format of transform used to transform mesh, either 2D or 3D. */ - get transform_format(): int64 - set transform_format(value: int64) - - /** If `true`, the [MultiMesh] will use color data (see [method set_instance_color]). Can only be set when [member instance_count] is `0` or less. This means that you need to call this method before setting the instance count, or temporarily reset it to `0`. */ - get use_colors(): boolean - set use_colors(value: boolean) - - /** If `true`, the [MultiMesh] will use custom data (see [method set_instance_custom_data]). Can only be set when [member instance_count] is `0` or less. This means that you need to call this method before setting the instance count, or temporarily reset it to `0`. */ - get use_custom_data(): boolean - set use_custom_data(value: boolean) - - /** Custom AABB for this MultiMesh resource. Setting this manually prevents costly runtime AABB recalculations. */ - get custom_aabb(): AABB - set custom_aabb(value: AABB) - - /** Number of instances that will get drawn. This clears and (re)sizes the buffers. Setting data format or flags afterwards will have no effect. - * By default, all instances are drawn but you can limit this with [member visible_instance_count]. - */ - get instance_count(): int64 - set instance_count(value: int64) - - /** Limits the number of instances drawn, -1 draws all instances. Changing this does not change the sizes of the buffers. */ - get visible_instance_count(): int64 - set visible_instance_count(value: int64) - - /** [Mesh] resource to be instanced. - * The looks of the individual instances can be modified using [method set_instance_color] and [method set_instance_custom_data]. - */ - get mesh(): Mesh - set mesh(value: Mesh) - get buffer(): PackedFloat32Array - set buffer(value: PackedFloat32Array | float32[]) - - /** Array containing each [Transform3D] value used by all instances of this mesh, as a [PackedVector3Array]. Each transform is divided into 4 [Vector3] values corresponding to the transforms' `x`, `y`, `z`, and `origin`. */ - get transform_array(): PackedVector3Array - set transform_array(value: PackedVector3Array | Vector3[]) - - /** Array containing each [Transform2D] value used by all instances of this mesh, as a [PackedVector2Array]. Each transform is divided into 3 [Vector2] values corresponding to the transforms' `x`, `y`, and `origin`. */ - get transform_2d_array(): PackedVector2Array - set transform_2d_array(value: PackedVector2Array | Vector2[]) - - /** Array containing each [Color] used by all instances of this mesh. */ - get color_array(): PackedColorArray - set color_array(value: PackedColorArray | Color[]) - - /** Array containing each custom data value used by all instances of this mesh, as a [PackedColorArray]. */ - get custom_data_array(): PackedColorArray - set custom_data_array(value: PackedColorArray | Color[]) - } - class MultiMeshEditor extends Control { - constructor(identifier?: any) - } - class MultiMeshEditorPlugin extends EditorPlugin { - constructor(identifier?: any) - } - /** Node that instances a [MultiMesh] in 2D. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_multimeshinstance2d.html - */ - class MultiMeshInstance2D extends Node2D { - constructor(identifier?: any) - /** The [MultiMesh] that will be drawn by the [MultiMeshInstance2D]. */ - get multimesh(): MultiMesh - set multimesh(value: MultiMesh) - - /** The [Texture2D] that will be used if using the default [CanvasItemMaterial]. Can be accessed as `TEXTURE` in CanvasItem shader. */ - get texture(): Texture2D - set texture(value: Texture2D) - - /** Emitted when the [member texture] is changed. */ - readonly texture_changed: Signal0 - } - /** Node that instances a [MultiMesh]. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_multimeshinstance3d.html - */ - class MultiMeshInstance3D extends GeometryInstance3D { - constructor(identifier?: any) - /** The [MultiMesh] resource that will be used and shared among all instances of the [MultiMeshInstance3D]. */ - get multimesh(): MultiMesh - set multimesh(value: MultiMesh) - } - namespace MultiplayerAPI { - enum RPCMode { - /** Used with [method Node.rpc_config] to disable a method or property for all RPC calls, making it unavailable. Default for all methods. */ - RPC_MODE_DISABLED = 0, - - /** Used with [method Node.rpc_config] to set a method to be callable remotely by any peer. Analogous to the `@rpc("any_peer")` annotation. Calls are accepted from all remote peers, no matter if they are node's authority or not. */ - RPC_MODE_ANY_PEER = 1, - - /** Used with [method 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("authority")` annotation. See [method Node.set_multiplayer_authority]. */ - RPC_MODE_AUTHORITY = 2, - } - } - /** High-level multiplayer API interface. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_multiplayerapi.html - */ - class MultiplayerAPI extends RefCounted { - constructor(identifier?: any) - /** Returns `true` if there is a [member multiplayer_peer] set. */ - has_multiplayer_peer(): boolean - - /** Returns the unique peer ID of this MultiplayerAPI's [member multiplayer_peer]. */ - get_unique_id(): int64 - - /** Returns `true` if this MultiplayerAPI's [member multiplayer_peer] is valid and in server mode (listening for connections). */ - is_server(): boolean - - /** Returns the sender's peer ID for the RPC currently being executed. - * - * **Note:** This method returns `0` when called outside of an RPC. As such, the original peer ID may be lost when code execution is delayed (such as with GDScript's `await` keyword). - */ - get_remote_sender_id(): int64 - - /** Method used for polling the MultiplayerAPI. You only need to worry about this if you set [member SceneTree.multiplayer_poll] to `false`. By default, [SceneTree] will poll its MultiplayerAPI(s) for you. - * - * **Note:** This method results in RPCs being called, so they will be executed in the same context of this function (e.g. `_process`, `physics`, [Thread]). - */ - poll(): GError - - /** Sends an RPC to the target [param peer]. The given [param method] will be called on the remote [param object] with the provided [param arguments]. The RPC may also be called locally depending on the implementation and RPC configuration. See [method Node.rpc] and [method Node.rpc_config]. - * - * **Note:** Prefer using [method Node.rpc], [method Node.rpc_id], or `my_method.rpc(peer, arg1, arg2, ...)` (in GDScript), since they are faster. This method is mostly useful in conjunction with [MultiplayerAPIExtension] when augmenting or replacing the multiplayer capabilities. - */ - rpc(peer: int64, object: Object, method: StringName, arguments_: GArray = []): GError - - /** Notifies the MultiplayerAPI of a new [param configuration] for the given [param object]. This method is used internally by [SceneTree] to configure the root path for this MultiplayerAPI (passing `null` and a valid [NodePath] as [param configuration]). This method can be further used by MultiplayerAPI implementations to provide additional features, refer to specific implementation (e.g. [SceneMultiplayer]) for details on how they use it. - * - * **Note:** This method is mostly relevant when extending or overriding the MultiplayerAPI behavior via [MultiplayerAPIExtension]. - */ - object_configuration_add(object: Object, configuration: any): GError - - /** Notifies the MultiplayerAPI to remove a [param configuration] for the given [param object]. This method is used internally by [SceneTree] to configure the root path for this MultiplayerAPI (passing `null` and an empty [NodePath] as [param configuration]). This method can be further used by MultiplayerAPI implementations to provide additional features, refer to specific implementation (e.g. [SceneMultiplayer]) for details on how they use it. - * - * **Note:** This method is mostly relevant when extending or overriding the MultiplayerAPI behavior via [MultiplayerAPIExtension]. - */ - object_configuration_remove(object: Object, configuration: any): GError - - /** Returns the peer IDs of all connected peers of this MultiplayerAPI's [member multiplayer_peer]. */ - get_peers(): PackedInt32Array - - /** Sets the default MultiplayerAPI implementation class. This method can be used by modules and extensions to configure which implementation will be used by [SceneTree] when the engine starts. */ - static set_default_interface(interface_name: StringName): void - - /** Returns the default MultiplayerAPI implementation class name. This is usually `"SceneMultiplayer"` when [SceneMultiplayer] is available. See [method set_default_interface]. */ - static get_default_interface(): StringName - - /** Returns a new instance of the default MultiplayerAPI. */ - static create_default_interface(): MultiplayerAPI - - /** The peer object to handle the RPC system (effectively enabling networking when set). Depending on the peer itself, the MultiplayerAPI will become a network server (check with [method is_server]) and will set root node's network mode to authority, or it will become a regular client peer. All child nodes are set to inherit the network mode by default. Handling of networking-related events (connection, disconnection, new clients) is done by connecting to MultiplayerAPI's signals. */ - get multiplayer_peer(): MultiplayerPeer - set multiplayer_peer(value: MultiplayerPeer) - - /** Emitted when this MultiplayerAPI's [member multiplayer_peer] connects with a new peer. ID is the peer ID of the new peer. Clients get notified when other clients connect to the same server. Upon connecting to a server, a client also receives this signal for the server (with ID being 1). */ - readonly peer_connected: Signal1 - - /** Emitted when this MultiplayerAPI's [member multiplayer_peer] disconnects from a peer. Clients get notified when other clients disconnect from the same server. */ - readonly peer_disconnected: Signal1 - - /** Emitted when this MultiplayerAPI's [member multiplayer_peer] successfully connected to a server. Only emitted on clients. */ - readonly connected_to_server: Signal0 - - /** Emitted when this MultiplayerAPI's [member multiplayer_peer] fails to establish a connection to a server. Only emitted on clients. */ - readonly connection_failed: Signal0 - - /** Emitted when this MultiplayerAPI's [member multiplayer_peer] disconnects from server. Only emitted on clients. */ - readonly server_disconnected: Signal0 - } - /** Base class used for extending the [MultiplayerAPI]. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_multiplayerapiextension.html - */ - class MultiplayerAPIExtension extends MultiplayerAPI { - constructor(identifier?: any) - /** Callback for [method MultiplayerAPI.poll]. */ - /* gdvirtual */ _poll(): GError - - /** Called when the [member MultiplayerAPI.multiplayer_peer] is set. */ - /* gdvirtual */ _set_multiplayer_peer(multiplayer_peer: MultiplayerPeer): void - - /** Called when the [member MultiplayerAPI.multiplayer_peer] is retrieved. */ - /* gdvirtual */ _get_multiplayer_peer(): MultiplayerPeer - - /** Callback for [method MultiplayerAPI.get_unique_id]. */ - /* gdvirtual */ _get_unique_id(): int64 - - /** Callback for [method MultiplayerAPI.get_peers]. */ - /* gdvirtual */ _get_peer_ids(): PackedInt32Array - - /** Callback for [method MultiplayerAPI.rpc]. */ - /* gdvirtual */ _rpc(peer: int64, object: Object, method: StringName, args: GArray): GError - - /** Callback for [method MultiplayerAPI.get_remote_sender_id]. */ - /* gdvirtual */ _get_remote_sender_id(): int64 - - /** Callback for [method MultiplayerAPI.object_configuration_add]. */ - /* gdvirtual */ _object_configuration_add(object: Object, configuration: any): GError - - /** Callback for [method MultiplayerAPI.object_configuration_remove]. */ - /* gdvirtual */ _object_configuration_remove(object: Object, configuration: any): GError - } - class MultiplayerEditorDebugger extends EditorDebuggerPlugin { - constructor(identifier?: any) - readonly open_request: Signal1 - } - class MultiplayerEditorPlugin extends EditorPlugin { - constructor(identifier?: any) - } - namespace MultiplayerPeer { - enum ConnectionStatus { - /** The MultiplayerPeer is disconnected. */ - CONNECTION_DISCONNECTED = 0, - - /** The MultiplayerPeer is currently connecting to a server. */ - CONNECTION_CONNECTING = 1, - - /** This MultiplayerPeer is connected. */ - CONNECTION_CONNECTED = 2, - } - enum TransferMode { - /** Packets are not acknowledged, no resend attempts are made for lost packets. Packets may arrive in any order. Potentially faster than [constant TRANSFER_MODE_UNRELIABLE_ORDERED]. Use for non-critical data, and always consider whether the order matters. */ - TRANSFER_MODE_UNRELIABLE = 0, - - /** 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 [constant 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_UNRELIABLE_ORDERED = 1, - - /** 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. */ - TRANSFER_MODE_RELIABLE = 2, - } - } - /** Abstract class for specialized [PacketPeer]s used by the [MultiplayerAPI]. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_multiplayerpeer.html - */ - class MultiplayerPeer extends PacketPeer { - /** Packets are sent to all connected peers. */ - static readonly TARGET_PEER_BROADCAST = 0 - - /** Packets are sent to the remote peer acting as server. */ - static readonly TARGET_PEER_SERVER = 1 - constructor(identifier?: any) - - /** Sets the peer to which packets will be sent. - * The [param id] can be one of: [constant TARGET_PEER_BROADCAST] to send to all connected peers, [constant TARGET_PEER_SERVER] to send to the peer acting as server, a valid peer ID to send to that specific peer, a negative peer ID to send to all peers except that one. By default, the target peer is [constant TARGET_PEER_BROADCAST]. - */ - set_target_peer(id: int64): void - - /** Returns the ID of the [MultiplayerPeer] who sent the next available packet. See [method PacketPeer.get_available_packet_count]. */ - get_packet_peer(): int64 - - /** Returns the channel over which the next available packet was received. See [method PacketPeer.get_available_packet_count]. */ - get_packet_channel(): int64 - - /** Returns the transfer mode the remote peer used to send the next available packet. See [method PacketPeer.get_available_packet_count]. */ - get_packet_mode(): MultiplayerPeer.TransferMode - - /** Waits up to 1 second to receive a new network event. */ - poll(): void - - /** Immediately close the multiplayer peer returning to the state [constant CONNECTION_DISCONNECTED]. Connected peers will be dropped without emitting [signal peer_disconnected]. */ - close(): void - - /** Disconnects the given [param peer] from this host. If [param force] is `true` the [signal peer_disconnected] signal will not be emitted for this peer. */ - disconnect_peer(peer: int64, force: boolean = false): void - - /** Returns the current state of the connection. See [enum ConnectionStatus]. */ - get_connection_status(): MultiplayerPeer.ConnectionStatus - - /** Returns the ID of this [MultiplayerPeer]. */ - get_unique_id(): int64 - - /** Returns a randomly generated integer that can be used as a network unique ID. */ - generate_unique_id(): int64 - - /** Returns true if the server can act as a relay in the current configuration (i.e. if the higher level [MultiplayerAPI] should notify connected clients of other peers, and implement a relay protocol to allow communication between them). */ - is_server_relay_supported(): boolean - - /** If `true`, this [MultiplayerPeer] refuses new connections. */ - get refuse_new_connections(): boolean - set refuse_new_connections(value: boolean) - - /** The manner in which to send packets to the target peer. See [enum TransferMode], and the [method set_target_peer] method. */ - get transfer_mode(): int64 - set transfer_mode(value: int64) - - /** The channel to use to send packets. Many network APIs such as ENet and WebRTC allow the creation of multiple independent channels which behaves, in a way, like separate connections. This means that reliable data will only block delivery of other packets on that channel, and ordering will only be in respect to the channel the packet is being sent on. Using different channels to send **different and independent** state updates is a common way to optimize network usage and decrease latency in fast-paced games. - * - * **Note:** The default channel (`0`) actually works as 3 separate channels (one for each [enum TransferMode]) so that [constant TRANSFER_MODE_RELIABLE] and [constant TRANSFER_MODE_UNRELIABLE_ORDERED] does not interact with each other by default. Refer to the specific network API documentation (e.g. ENet or WebRTC) to learn how to set up channels correctly. - */ - get transfer_channel(): int64 - set transfer_channel(value: int64) - - /** Emitted when a remote peer connects. */ - readonly peer_connected: Signal1 - - /** Emitted when a remote peer has disconnected. */ - readonly peer_disconnected: Signal1 - } - /** Class that can be inherited to implement custom multiplayer API networking layers via GDExtension. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_multiplayerpeerextension.html - */ - class MultiplayerPeerExtension extends MultiplayerPeer { - constructor(identifier?: any) - /** Called when a packet needs to be received by the [MultiplayerAPI], with [param r_buffer_size] being the size of the binary [param r_buffer] in bytes. */ - /* gdvirtual */ _get_packet(r_buffer: int64, r_buffer_size: int64): GError - - /** Called when a packet needs to be sent by the [MultiplayerAPI], with [param p_buffer_size] being the size of the binary [param p_buffer] in bytes. */ - /* gdvirtual */ _put_packet(p_buffer: int64, p_buffer_size: int64): GError - - /** Called when the available packet count is internally requested by the [MultiplayerAPI]. */ - /* gdvirtual */ _get_available_packet_count(): int64 - - /** Called when the maximum allowed packet size (in bytes) is requested by the [MultiplayerAPI]. */ - /* gdvirtual */ _get_max_packet_size(): int64 - - /** Called when a packet needs to be received by the [MultiplayerAPI], if [method _get_packet] isn't implemented. Use this when extending this class via GDScript. */ - /* gdvirtual */ _get_packet_script(): PackedByteArray - - /** Called when a packet needs to be sent by the [MultiplayerAPI], if [method _put_packet] isn't implemented. Use this when extending this class via GDScript. */ - /* gdvirtual */ _put_packet_script(p_buffer: PackedByteArray | byte[] | ArrayBuffer): GError - - /** Called to get the channel over which the next available packet was received. See [method MultiplayerPeer.get_packet_channel]. */ - /* gdvirtual */ _get_packet_channel(): int64 - - /** Called to get the transfer mode the remote peer used to send the next available packet. See [method MultiplayerPeer.get_packet_mode]. */ - /* gdvirtual */ _get_packet_mode(): MultiplayerPeer.TransferMode - - /** Called when the channel to use is set for this [MultiplayerPeer] (see [member MultiplayerPeer.transfer_channel]). */ - /* gdvirtual */ _set_transfer_channel(p_channel: int64): void - - /** Called when the transfer channel to use is read on this [MultiplayerPeer] (see [member MultiplayerPeer.transfer_channel]). */ - /* gdvirtual */ _get_transfer_channel(): int64 - - /** Called when the transfer mode is set on this [MultiplayerPeer] (see [member MultiplayerPeer.transfer_mode]). */ - /* gdvirtual */ _set_transfer_mode(p_mode: MultiplayerPeer.TransferMode): void - - /** Called when the transfer mode to use is read on this [MultiplayerPeer] (see [member MultiplayerPeer.transfer_mode]). */ - /* gdvirtual */ _get_transfer_mode(): MultiplayerPeer.TransferMode - - /** Called when the target peer to use is set for this [MultiplayerPeer] (see [method MultiplayerPeer.set_target_peer]). */ - /* gdvirtual */ _set_target_peer(p_peer: int64): void - - /** Called when the ID of the [MultiplayerPeer] who sent the most recent packet is requested (see [method MultiplayerPeer.get_packet_peer]). */ - /* gdvirtual */ _get_packet_peer(): int64 - - /** Called when the "is server" status is requested on the [MultiplayerAPI]. See [method MultiplayerAPI.is_server]. */ - /* gdvirtual */ _is_server(): boolean - - /** Called when the [MultiplayerAPI] is polled. See [method MultiplayerAPI.poll]. */ - /* gdvirtual */ _poll(): void - - /** Called when the multiplayer peer should be immediately closed (see [method MultiplayerPeer.close]). */ - /* gdvirtual */ _close(): void - - /** Called when the connected [param p_peer] should be forcibly disconnected (see [method MultiplayerPeer.disconnect_peer]). */ - /* gdvirtual */ _disconnect_peer(p_peer: int64, p_force: boolean): void - - /** Called when the unique ID of this [MultiplayerPeer] is requested (see [method MultiplayerPeer.get_unique_id]). The value must be between `1` and `2147483647`. */ - /* gdvirtual */ _get_unique_id(): int64 - - /** Called when the "refuse new connections" status is set on this [MultiplayerPeer] (see [member MultiplayerPeer.refuse_new_connections]). */ - /* gdvirtual */ _set_refuse_new_connections(p_enable: boolean): void - - /** Called when the "refuse new connections" status is requested on this [MultiplayerPeer] (see [member MultiplayerPeer.refuse_new_connections]). */ - /* gdvirtual */ _is_refusing_new_connections(): boolean - - /** Called to check if the server can act as a relay in the current configuration. See [method MultiplayerPeer.is_server_relay_supported]. */ - /* gdvirtual */ _is_server_relay_supported(): boolean - - /** Called when the connection status is requested on the [MultiplayerPeer] (see [method MultiplayerPeer.get_connection_status]). */ - /* gdvirtual */ _get_connection_status(): MultiplayerPeer.ConnectionStatus - } - /** Automatically replicates spawnable nodes from the authority to other multiplayer peers. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_multiplayerspawner.html - */ - class MultiplayerSpawner extends Node { - constructor(identifier?: any) - /** Adds a scene path to spawnable scenes, making it automatically replicated from the multiplayer authority to other peers when added as children of the node pointed by [member spawn_path]. */ - add_spawnable_scene(path: string): void - - /** Returns the count of spawnable scene paths. */ - get_spawnable_scene_count(): int64 - - /** Returns the spawnable scene path by index. */ - get_spawnable_scene(index: int64): string - - /** Clears all spawnable scenes. Does not despawn existing instances on remote peers. */ - clear_spawnable_scenes(): void - - /** Requests a custom spawn, with [param data] passed to [member spawn_function] on all peers. Returns the locally spawned node instance already inside the scene tree, and added as a child of the node pointed by [member spawn_path]. - * - * **Note:** Spawnable scenes are spawned automatically. [method spawn] is only needed for custom spawns. - */ - spawn(data: any = {}): Node - get _spawnable_scenes(): PackedStringArray - set _spawnable_scenes(value: PackedStringArray | string[]) - - /** Path to the spawn root. Spawnable scenes that are added as direct children are replicated to other peers. */ - get spawn_path(): NodePath - set spawn_path(value: NodePath | string) - - /** Maximum number of nodes allowed to be spawned by this spawner. Includes both spawnable scenes and custom spawns. - * When set to `0` (the default), there is no limit. - */ - get spawn_limit(): int64 - set spawn_limit(value: int64) - - /** Method called on all peers when a custom [method spawn] is requested by the authority. Will receive the `data` parameter, and should return a [Node] that is not in the scene tree. - * - * **Note:** The returned node should **not** be added to the scene with [method Node.add_child]. This is done automatically. - */ - get spawn_function(): Callable - set spawn_function(value: Callable) - - /** Emitted when a spawnable scene or custom spawn was despawned by the multiplayer authority. Only called on puppets. */ - readonly despawned: Signal1 - - /** Emitted when a spawnable scene or custom spawn was spawned by the multiplayer authority. Only called on puppets. */ - readonly spawned: Signal1 - } - namespace MultiplayerSynchronizer { - enum VisibilityUpdateMode { - /** Visibility filters are updated during process frames (see [constant Node.NOTIFICATION_INTERNAL_PROCESS]). */ - VISIBILITY_PROCESS_IDLE = 0, - - /** Visibility filters are updated during physics frames (see [constant Node.NOTIFICATION_INTERNAL_PHYSICS_PROCESS]). */ - VISIBILITY_PROCESS_PHYSICS = 1, - - /** Visibility filters are not updated automatically, and must be updated manually by calling [method update_visibility]. */ - VISIBILITY_PROCESS_NONE = 2, - } - } - /** Synchronizes properties from the multiplayer authority to the remote peers. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_multiplayersynchronizer.html - */ - class MultiplayerSynchronizer extends Node { - constructor(identifier?: any) - /** Updates the visibility of [param for_peer] according to visibility filters. If [param for_peer] is `0` (the default), all peers' visibilties are updated. */ - update_visibility(for_peer: int64 = 0): void - - /** Adds a peer visibility filter for this synchronizer. - * [param filter] should take a peer ID [int] and return a [bool]. - */ - add_visibility_filter(filter: Callable): void - - /** Removes a peer visibility filter from this synchronizer. */ - remove_visibility_filter(filter: Callable): void - - /** Sets the visibility of [param peer] to [param visible]. If [param peer] is `0`, the value of [member public_visibility] will be updated instead. */ - set_visibility_for(peer: int64, visible: boolean): void - - /** Queries the current visibility for peer [param peer]. */ - get_visibility_for(peer: int64): boolean - - /** Node path that replicated properties are relative to. - * If [member root_path] was spawned by a [MultiplayerSpawner], the node will be also be spawned and despawned based on this synchronizer visibility options. - */ - get root_path(): NodePath - set root_path(value: NodePath | string) - - /** Time interval between synchronizations. When set to `0.0` (the default), synchronizations happen every network process frame. */ - get replication_interval(): float64 - set replication_interval(value: float64) - - /** Time interval between delta synchronizations. When set to `0.0` (the default), delta synchronizations happen every network process frame. */ - get delta_interval(): float64 - set delta_interval(value: float64) - - /** Resource containing which properties to synchronize. */ - get replication_config(): SceneReplicationConfig - set replication_config(value: SceneReplicationConfig) - - /** Specifies when visibility filters are updated (see [enum VisibilityUpdateMode] for options). */ - get visibility_update_mode(): int64 - set visibility_update_mode(value: int64) - - /** Whether synchronization should be visible to all peers by default. See [method set_visibility_for] and [method add_visibility_filter] for ways of configuring fine-grained visibility options. */ - get public_visibility(): boolean - set public_visibility(value: boolean) - - /** Emitted when a new synchronization state is received by this synchronizer after the properties have been updated. */ - readonly synchronized: Signal0 - - /** Emitted when a new delta synchronization state is received by this synchronizer after the properties have been updated. */ - readonly delta_synchronized: Signal0 - - /** Emitted when visibility of [param for_peer] is updated. See [method update_visibility]. */ - readonly visibility_changed: Signal1 - } - /** A binary [Semaphore] for synchronization of multiple [Thread]s. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_mutex.html - */ - class Mutex extends RefCounted { - constructor(identifier?: any) - /** Locks this [Mutex], blocks until it is unlocked by the current owner. - * - * **Note:** This function returns without blocking if the thread already has ownership of the mutex. - */ - lock(): void - - /** Tries locking this [Mutex], but does not block. Returns `true` on success, `false` otherwise. - * - * **Note:** This function returns `true` if the thread already has ownership of the mutex. - */ - try_lock(): boolean - - /** Unlocks this [Mutex], leaving it to other threads. - * - * **Note:** If a thread called [method lock] or [method try_lock] multiple times while already having ownership of the mutex, it must also call [method unlock] the same number of times in order to unlock it correctly. - * **Warning:** Calling [method unlock] more times that [method lock] on a given thread, thus ending up trying to unlock a non-locked mutex, is wrong and may causes crashes or deadlocks. - */ - unlock(): void - } - /** A 2D agent used to pathfind to a position while avoiding obstacles. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_navigationagent2d.html - */ - class NavigationAgent2D extends Node { - constructor(identifier?: any) - /** Returns the [RID] of this agent on the [NavigationServer2D]. */ - get_rid(): RID - - /** Based on [param value], enables or disables the specified layer in the [member navigation_layers] bitmask, given a [param layer_number] between 1 and 32. */ - set_navigation_layer_value(layer_number: int64, value: boolean): void - - /** Returns whether or not the specified layer of the [member navigation_layers] bitmask is enabled, given a [param layer_number] between 1 and 32. */ - get_navigation_layer_value(layer_number: int64): boolean - - /** Sets the [RID] of the navigation map this NavigationAgent node should use and also updates the `agent` on the NavigationServer. */ - set_navigation_map(navigation_map: RID): void - - /** Returns the [RID] of the navigation map for this NavigationAgent node. This function returns always the map set on the NavigationAgent node and not the map of the abstract agent on the NavigationServer. If the agent map is changed directly with the NavigationServer API the NavigationAgent node will not be aware of the map change. Use [method set_navigation_map] to change the navigation map for the NavigationAgent and also update the agent on the NavigationServer. */ - get_navigation_map(): RID - - /** Returns the next position in global coordinates that can be moved to, making sure that there are no static objects in the way. If the agent does not have a navigation path, it will return the position of the agent's parent. The use of this function once every physics frame is required to update the internal path logic of the NavigationAgent. */ - get_next_path_position(): Vector2 - - /** Replaces the internal velocity in the collision avoidance simulation with [param velocity]. When an agent is teleported to a new position this function should be used in the same frame. If called frequently this function can get agents stuck. */ - set_velocity_forced(velocity: Vector2): void - - /** Returns the distance to the target position, using the agent's global position. The user must set [member target_position] in order for this to be accurate. */ - distance_to_target(): float64 - - /** Returns the path query result for the path the agent is currently following. */ - get_current_navigation_result(): NavigationPathQueryResult2D - - /** Returns this agent's current path from start to finish in global coordinates. The path only updates when the target position is changed or the agent requires a repath. The path array is not intended to be used in direct path movement as the agent has its own internal path logic that would get corrupted by changing the path array manually. Use the intended [method get_next_path_position] once every physics frame to receive the next path point for the agents movement as this function also updates the internal path logic. */ - get_current_navigation_path(): PackedVector2Array - - /** Returns which index the agent is currently on in the navigation path's [PackedVector2Array]. */ - get_current_navigation_path_index(): int64 - - /** Returns `true` if the agent reached the target, i.e. the agent moved within [member target_desired_distance] of the [member target_position]. It may not always be possible to reach the target but it should always be possible to reach the final position. See [method get_final_position]. */ - is_target_reached(): boolean - - /** Returns `true` if [method get_final_position] is within [member target_desired_distance] of the [member target_position]. */ - is_target_reachable(): boolean - - /** Returns `true` if the agent's navigation has finished. If the target is reachable, navigation ends when the target is reached. If the target is unreachable, navigation ends when the last waypoint of the path is reached. - * - * **Note:** While `true` prefer to stop calling update functions like [method get_next_path_position]. This avoids jittering the standing agent due to calling repeated path updates. - */ - is_navigation_finished(): boolean - - /** Returns the reachable final position of the current navigation path in global coordinates. This position can change if the agent needs to update the navigation path which makes the agent emit the [signal path_changed] signal. */ - get_final_position(): Vector2 - _avoidance_done(new_velocity: Vector3): void - - /** Based on [param value], enables or disables the specified layer in the [member avoidance_layers] bitmask, given a [param layer_number] between 1 and 32. */ - set_avoidance_layer_value(layer_number: int64, value: boolean): void - - /** Returns whether or not the specified layer of the [member avoidance_layers] bitmask is enabled, given a [param layer_number] between 1 and 32. */ - get_avoidance_layer_value(layer_number: int64): boolean - - /** Based on [param value], enables or disables the specified mask in the [member avoidance_mask] bitmask, given a [param mask_number] between 1 and 32. */ - set_avoidance_mask_value(mask_number: int64, value: boolean): void - - /** Returns whether or not the specified mask of the [member avoidance_mask] bitmask is enabled, given a [param mask_number] between 1 and 32. */ - get_avoidance_mask_value(mask_number: int64): boolean - - /** If set, a new navigation path from the current agent position to the [member target_position] is requested from the NavigationServer. */ - get target_position(): Vector2 - set target_position(value: Vector2) - - /** The distance threshold before a path point is considered to be reached. This allows agents to not have to hit a path point on the path exactly, but only to reach its general area. If this value is set too high, the NavigationAgent will skip points on the path, which can lead to it leaving the navigation mesh. If this value is set too low, the NavigationAgent will be stuck in a repath loop because it will constantly overshoot the distance to the next point on each physics frame update. */ - get path_desired_distance(): float64 - set path_desired_distance(value: float64) - - /** The distance threshold before the target is considered to be reached. On reaching the target, [signal target_reached] is emitted and navigation ends (see [method is_navigation_finished] and [signal navigation_finished]). - * You can make navigation end early by setting this property to a value greater than [member path_desired_distance] (navigation will end before reaching the last waypoint). - * You can also make navigation end closer to the target than each individual path position by setting this property to a value lower than [member path_desired_distance] (navigation won't immediately end when reaching the last waypoint). However, if the value set is too low, the agent will be stuck in a repath loop because it will constantly overshoot the distance to the target on each physics frame update. - */ - get target_desired_distance(): float64 - set target_desired_distance(value: float64) - - /** The maximum distance the agent is allowed away from the ideal path to the final position. This can happen due to trying to avoid collisions. When the maximum distance is exceeded, it recalculates the ideal path. */ - get path_max_distance(): float64 - set path_max_distance(value: float64) - - /** A bitfield determining which navigation layers of navigation regions this agent will use to calculate a path. Changing it during runtime will clear the current navigation path and generate a new one, according to the new navigation layers. */ - get navigation_layers(): int64 - set navigation_layers(value: int64) - - /** The pathfinding algorithm used in the path query. */ - get pathfinding_algorithm(): int64 - set pathfinding_algorithm(value: int64) - - /** The path postprocessing applied to the raw path corridor found by the [member pathfinding_algorithm]. */ - get path_postprocessing(): int64 - set path_postprocessing(value: int64) - - /** Additional information to return with the navigation path. */ - get path_metadata_flags(): int64 - set path_metadata_flags(value: int64) - - /** If `true` a simplified version of the path will be returned with less critical path points removed. The simplification amount is controlled by [member simplify_epsilon]. The simplification uses a variant of Ramer-Douglas-Peucker algorithm for curve point decimation. - * Path simplification can be helpful to mitigate various path following issues that can arise with certain agent types and script behaviors. E.g. "steering" agents or avoidance in "open fields". - */ - get simplify_path(): boolean - set simplify_path(value: boolean) - - /** The path simplification amount in worlds units. */ - get simplify_epsilon(): float64 - set simplify_epsilon(value: float64) - - /** If `true` the agent is registered for an RVO avoidance callback on the [NavigationServer2D]. When [member velocity] is used and the processing is completed a `safe_velocity` Vector2 is received with a signal connection to [signal velocity_computed]. Avoidance processing with many registered agents has a significant performance cost and should only be enabled on agents that currently require it. */ - get avoidance_enabled(): boolean - set avoidance_enabled(value: boolean) - - /** Sets the new wanted velocity for the agent. The avoidance simulation will try to fulfill this velocity if possible but will modify it to avoid collision with other agents and obstacles. When an agent is teleported to a new position, use [method set_velocity_forced] as well to reset the internal simulation velocity. */ - get velocity(): Vector2 - set velocity(value: Vector2) - - /** The radius of the avoidance agent. This is the "body" of the avoidance agent and not the avoidance maneuver starting radius (which is controlled by [member neighbor_distance]). - * Does not affect normal pathfinding. To change an actor's pathfinding radius bake [NavigationMesh] resources with a different [member NavigationMesh.agent_radius] property and use different navigation maps for each actor size. - */ - get radius(): float64 - set radius(value: float64) - - /** The distance to search for other agents. */ - get neighbor_distance(): float64 - set neighbor_distance(value: float64) - - /** The maximum number of neighbors for the agent to consider. */ - get max_neighbors(): int64 - set max_neighbors(value: int64) - - /** The minimal amount of time for which this agent's velocities, that are computed with the collision avoidance algorithm, are safe with respect to other agents. The larger the number, the sooner the agent will respond to other agents, but less freedom in choosing its velocities. A too high value will slow down agents movement considerably. Must be positive. */ - get time_horizon_agents(): float64 - set time_horizon_agents(value: float64) - - /** The minimal amount of time for which this agent's velocities, that are computed with the collision avoidance algorithm, are safe with respect to static avoidance obstacles. The larger the number, the sooner the agent will respond to static avoidance obstacles, but less freedom in choosing its velocities. A too high value will slow down agents movement considerably. Must be positive. */ - get time_horizon_obstacles(): float64 - set time_horizon_obstacles(value: float64) - - /** The maximum speed that an agent can move. */ - get max_speed(): float64 - set max_speed(value: float64) - - /** A bitfield determining the avoidance layers for this NavigationAgent. Other agents with a matching bit on the [member avoidance_mask] will avoid this agent. */ - get avoidance_layers(): int64 - set avoidance_layers(value: int64) - - /** A bitfield determining what other avoidance agents and obstacles this NavigationAgent will avoid when a bit matches at least one of their [member avoidance_layers]. */ - get avoidance_mask(): int64 - set avoidance_mask(value: int64) - - /** The agent does not adjust the velocity for other agents that would match the [member avoidance_mask] but have a lower [member avoidance_priority]. This in turn makes the other agents with lower priority adjust their velocities even more to avoid collision with this agent. */ - get avoidance_priority(): float64 - set avoidance_priority(value: float64) - - /** If `true` shows debug visuals for this agent. */ - get debug_enabled(): boolean - set debug_enabled(value: boolean) - - /** If `true` uses the defined [member debug_path_custom_color] for this agent instead of global color. */ - get debug_use_custom(): boolean - set debug_use_custom(value: boolean) - - /** If [member debug_use_custom] is `true` uses this color for this agent instead of global color. */ - get debug_path_custom_color(): Color - set debug_path_custom_color(value: Color) - - /** If [member debug_use_custom] is `true` uses this rasterized point size for rendering path points for this agent instead of global point size. */ - get debug_path_custom_point_size(): float64 - set debug_path_custom_point_size(value: float64) - - /** If [member debug_use_custom] is `true` uses this line width for rendering paths for this agent instead of global line width. */ - get debug_path_custom_line_width(): float64 - set debug_path_custom_line_width(value: float64) - - /** Emitted when the agent had to update the loaded path: - * - because path was previously empty. - * - because navigation map has changed. - * - because agent pushed further away from the current path segment than the [member path_max_distance]. - */ - readonly path_changed: Signal0 - - /** Signals that the agent reached the target, i.e. the agent moved within [member target_desired_distance] of the [member target_position]. This signal is emitted only once per loaded path. - * This signal will be emitted just before [signal navigation_finished] when the target is reachable. - * It may not always be possible to reach the target but it should always be possible to reach the final position. See [method get_final_position]. - */ - readonly target_reached: Signal0 - - /** Signals that the agent reached a waypoint. Emitted when the agent moves within [member path_desired_distance] of the next position of the path. - * The details dictionary may contain the following keys depending on the value of [member path_metadata_flags]: - * - `position`: The position of the waypoint that was reached. - * - `type`: The type of navigation primitive (region or link) that contains this waypoint. - * - `rid`: The [RID] of the containing navigation primitive (region or link). - * - `owner`: The object which manages the containing navigation primitive (region or link). - */ - readonly waypoint_reached: Signal1 - - /** Signals that the agent reached a navigation link. Emitted when the agent moves within [member path_desired_distance] of the next position of the path when that position is a navigation link. - * The details dictionary may contain the following keys depending on the value of [member path_metadata_flags]: - * - `position`: The start position of the link that was reached. - * - `type`: Always [constant NavigationPathQueryResult2D.PATH_SEGMENT_TYPE_LINK]. - * - `rid`: The [RID] of the link. - * - `owner`: The object which manages the link (usually [NavigationLink2D]). - * - `link_entry_position`: If `owner` is available and the owner is a [NavigationLink2D], it will contain the global position of the link's point the agent is entering. - * - `link_exit_position`: If `owner` is available and the owner is a [NavigationLink2D], it will contain the global position of the link's point which the agent is exiting. - */ - readonly link_reached: Signal1 - - /** Signals that the agent's navigation has finished. If the target is reachable, navigation ends when the target is reached. If the target is unreachable, navigation ends when the last waypoint of the path is reached. This signal is emitted only once per loaded path. - * This signal will be emitted just after [signal target_reached] when the target is reachable. - */ - readonly navigation_finished: Signal0 - - /** Notifies when the collision avoidance velocity is calculated. Emitted every update as long as [member avoidance_enabled] is `true` and the agent has a navigation map. */ - readonly velocity_computed: Signal1 - } - /** A 3D agent used to pathfind to a position while avoiding obstacles. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_navigationagent3d.html - */ - class NavigationAgent3D extends Node { - constructor(identifier?: any) - /** Returns the [RID] of this agent on the [NavigationServer3D]. */ - get_rid(): RID - - /** Based on [param value], enables or disables the specified layer in the [member navigation_layers] bitmask, given a [param layer_number] between 1 and 32. */ - set_navigation_layer_value(layer_number: int64, value: boolean): void - - /** Returns whether or not the specified layer of the [member navigation_layers] bitmask is enabled, given a [param layer_number] between 1 and 32. */ - get_navigation_layer_value(layer_number: int64): boolean - - /** Sets the [RID] of the navigation map this NavigationAgent node should use and also updates the `agent` on the NavigationServer. */ - set_navigation_map(navigation_map: RID): void - - /** Returns the [RID] of the navigation map for this NavigationAgent node. This function returns always the map set on the NavigationAgent node and not the map of the abstract agent on the NavigationServer. If the agent map is changed directly with the NavigationServer API the NavigationAgent node will not be aware of the map change. Use [method set_navigation_map] to change the navigation map for the NavigationAgent and also update the agent on the NavigationServer. */ - get_navigation_map(): RID - - /** Returns the next position in global coordinates that can be moved to, making sure that there are no static objects in the way. If the agent does not have a navigation path, it will return the position of the agent's parent. The use of this function once every physics frame is required to update the internal path logic of the NavigationAgent. */ - get_next_path_position(): Vector3 - - /** Replaces the internal velocity in the collision avoidance simulation with [param velocity]. When an agent is teleported to a new position this function should be used in the same frame. If called frequently this function can get agents stuck. */ - set_velocity_forced(velocity: Vector3): void - - /** Returns the distance to the target position, using the agent's global position. The user must set [member target_position] in order for this to be accurate. */ - distance_to_target(): float64 - - /** Returns the path query result for the path the agent is currently following. */ - get_current_navigation_result(): NavigationPathQueryResult3D - - /** Returns this agent's current path from start to finish in global coordinates. The path only updates when the target position is changed or the agent requires a repath. The path array is not intended to be used in direct path movement as the agent has its own internal path logic that would get corrupted by changing the path array manually. Use the intended [method get_next_path_position] once every physics frame to receive the next path point for the agents movement as this function also updates the internal path logic. */ - get_current_navigation_path(): PackedVector3Array - - /** Returns which index the agent is currently on in the navigation path's [PackedVector3Array]. */ - get_current_navigation_path_index(): int64 - - /** Returns `true` if the agent reached the target, i.e. the agent moved within [member target_desired_distance] of the [member target_position]. It may not always be possible to reach the target but it should always be possible to reach the final position. See [method get_final_position]. */ - is_target_reached(): boolean - - /** Returns `true` if [method get_final_position] is within [member target_desired_distance] of the [member target_position]. */ - is_target_reachable(): boolean - - /** Returns `true` if the agent's navigation has finished. If the target is reachable, navigation ends when the target is reached. If the target is unreachable, navigation ends when the last waypoint of the path is reached. - * - * **Note:** While `true` prefer to stop calling update functions like [method get_next_path_position]. This avoids jittering the standing agent due to calling repeated path updates. - */ - is_navigation_finished(): boolean - - /** Returns the reachable final position of the current navigation path in global coordinates. This position can change if the agent needs to update the navigation path which makes the agent emit the [signal path_changed] signal. */ - get_final_position(): Vector3 - _avoidance_done(new_velocity: Vector3): void - - /** Based on [param value], enables or disables the specified layer in the [member avoidance_layers] bitmask, given a [param layer_number] between 1 and 32. */ - set_avoidance_layer_value(layer_number: int64, value: boolean): void - - /** Returns whether or not the specified layer of the [member avoidance_layers] bitmask is enabled, given a [param layer_number] between 1 and 32. */ - get_avoidance_layer_value(layer_number: int64): boolean - - /** Based on [param value], enables or disables the specified mask in the [member avoidance_mask] bitmask, given a [param mask_number] between 1 and 32. */ - set_avoidance_mask_value(mask_number: int64, value: boolean): void - - /** Returns whether or not the specified mask of the [member avoidance_mask] bitmask is enabled, given a [param mask_number] between 1 and 32. */ - get_avoidance_mask_value(mask_number: int64): boolean - - /** If set, a new navigation path from the current agent position to the [member target_position] is requested from the NavigationServer. */ - get target_position(): Vector3 - set target_position(value: Vector3) - - /** The distance threshold before a path point is considered to be reached. This allows agents to not have to hit a path point on the path exactly, but only to reach its general area. If this value is set too high, the NavigationAgent will skip points on the path, which can lead to it leaving the navigation mesh. If this value is set too low, the NavigationAgent will be stuck in a repath loop because it will constantly overshoot the distance to the next point on each physics frame update. */ - get path_desired_distance(): float64 - set path_desired_distance(value: float64) - - /** The distance threshold before the target is considered to be reached. On reaching the target, [signal target_reached] is emitted and navigation ends (see [method is_navigation_finished] and [signal navigation_finished]). - * You can make navigation end early by setting this property to a value greater than [member path_desired_distance] (navigation will end before reaching the last waypoint). - * You can also make navigation end closer to the target than each individual path position by setting this property to a value lower than [member path_desired_distance] (navigation won't immediately end when reaching the last waypoint). However, if the value set is too low, the agent will be stuck in a repath loop because it will constantly overshoot the distance to the target on each physics frame update. - */ - get target_desired_distance(): float64 - set target_desired_distance(value: float64) - - /** The height offset is subtracted from the y-axis value of any vector path position for this NavigationAgent. The NavigationAgent height offset does not change or influence the navigation mesh or pathfinding query result. Additional navigation maps that use regions with navigation meshes that the developer baked with appropriate agent radius or height values are required to support different-sized agents. */ - get path_height_offset(): float64 - set path_height_offset(value: float64) - - /** The maximum distance the agent is allowed away from the ideal path to the final position. This can happen due to trying to avoid collisions. When the maximum distance is exceeded, it recalculates the ideal path. */ - get path_max_distance(): float64 - set path_max_distance(value: float64) - - /** A bitfield determining which navigation layers of navigation regions this agent will use to calculate a path. Changing it during runtime will clear the current navigation path and generate a new one, according to the new navigation layers. */ - get navigation_layers(): int64 - set navigation_layers(value: int64) - - /** The pathfinding algorithm used in the path query. */ - get pathfinding_algorithm(): int64 - set pathfinding_algorithm(value: int64) - - /** The path postprocessing applied to the raw path corridor found by the [member pathfinding_algorithm]. */ - get path_postprocessing(): int64 - set path_postprocessing(value: int64) - - /** Additional information to return with the navigation path. */ - get path_metadata_flags(): int64 - set path_metadata_flags(value: int64) - - /** If `true` a simplified version of the path will be returned with less critical path points removed. The simplification amount is controlled by [member simplify_epsilon]. The simplification uses a variant of Ramer-Douglas-Peucker algorithm for curve point decimation. - * Path simplification can be helpful to mitigate various path following issues that can arise with certain agent types and script behaviors. E.g. "steering" agents or avoidance in "open fields". - */ - get simplify_path(): boolean - set simplify_path(value: boolean) - - /** The path simplification amount in worlds units. */ - get simplify_epsilon(): float64 - set simplify_epsilon(value: float64) - - /** If `true` the agent is registered for an RVO avoidance callback on the [NavigationServer3D]. When [member velocity] is set and the processing is completed a `safe_velocity` Vector3 is received with a signal connection to [signal velocity_computed]. Avoidance processing with many registered agents has a significant performance cost and should only be enabled on agents that currently require it. */ - get avoidance_enabled(): boolean - set avoidance_enabled(value: boolean) - - /** Sets the new wanted velocity for the agent. The avoidance simulation will try to fulfill this velocity if possible but will modify it to avoid collision with other agents and obstacles. When an agent is teleported to a new position, use [method set_velocity_forced] as well to reset the internal simulation velocity. */ - get velocity(): Vector3 - set velocity(value: Vector3) - - /** The height of the avoidance agent. Agents will ignore other agents or obstacles that are above or below their current position + height in 2D avoidance. Does nothing in 3D avoidance which uses radius spheres alone. */ - get height(): float64 - set height(value: float64) - - /** The radius of the avoidance agent. This is the "body" of the avoidance agent and not the avoidance maneuver starting radius (which is controlled by [member neighbor_distance]). - * Does not affect normal pathfinding. To change an actor's pathfinding radius bake [NavigationMesh] resources with a different [member NavigationMesh.agent_radius] property and use different navigation maps for each actor size. - */ - get radius(): float64 - set radius(value: float64) - - /** The distance to search for other agents. */ - get neighbor_distance(): float64 - set neighbor_distance(value: float64) - - /** The maximum number of neighbors for the agent to consider. */ - get max_neighbors(): int64 - set max_neighbors(value: int64) - - /** The minimal amount of time for which this agent's velocities, that are computed with the collision avoidance algorithm, are safe with respect to other agents. The larger the number, the sooner the agent will respond to other agents, but less freedom in choosing its velocities. A too high value will slow down agents movement considerably. Must be positive. */ - get time_horizon_agents(): float64 - set time_horizon_agents(value: float64) - - /** The minimal amount of time for which this agent's velocities, that are computed with the collision avoidance algorithm, are safe with respect to static avoidance obstacles. The larger the number, the sooner the agent will respond to static avoidance obstacles, but less freedom in choosing its velocities. A too high value will slow down agents movement considerably. Must be positive. */ - get time_horizon_obstacles(): float64 - set time_horizon_obstacles(value: float64) - - /** The maximum speed that an agent can move. */ - get max_speed(): float64 - set max_speed(value: float64) - - /** If `true`, the agent calculates avoidance velocities in 3D omnidirectionally, e.g. for games that take place in air, underwater or space. Agents using 3D avoidance only avoid other agents using 3D avoidance, and react to radius-based avoidance obstacles. They ignore any vertex-based obstacles. - * If `false`, the agent calculates avoidance velocities in 2D along the x and z-axes, ignoring the y-axis. Agents using 2D avoidance only avoid other agents using 2D avoidance, and react to radius-based avoidance obstacles or vertex-based avoidance obstacles. Other agents using 2D avoidance that are below or above their current position including [member height] are ignored. - */ - get use_3d_avoidance(): boolean - set use_3d_avoidance(value: boolean) - - /** If `true`, and the agent uses 2D avoidance, it will remember the set y-axis velocity and reapply it after the avoidance step. While 2D avoidance has no y-axis and simulates on a flat plane this setting can help to soften the most obvious clipping on uneven 3D geometry. */ - get keep_y_velocity(): boolean - set keep_y_velocity(value: boolean) - - /** A bitfield determining the avoidance layers for this NavigationAgent. Other agents with a matching bit on the [member avoidance_mask] will avoid this agent. */ - get avoidance_layers(): int64 - set avoidance_layers(value: int64) - - /** A bitfield determining what other avoidance agents and obstacles this NavigationAgent will avoid when a bit matches at least one of their [member avoidance_layers]. */ - get avoidance_mask(): int64 - set avoidance_mask(value: int64) - - /** The agent does not adjust the velocity for other agents that would match the [member avoidance_mask] but have a lower [member avoidance_priority]. This in turn makes the other agents with lower priority adjust their velocities even more to avoid collision with this agent. */ - get avoidance_priority(): float64 - set avoidance_priority(value: float64) - - /** If `true` shows debug visuals for this agent. */ - get debug_enabled(): boolean - set debug_enabled(value: boolean) - - /** If `true` uses the defined [member debug_path_custom_color] for this agent instead of global color. */ - get debug_use_custom(): boolean - set debug_use_custom(value: boolean) - - /** If [member debug_use_custom] is `true` uses this color for this agent instead of global color. */ - get debug_path_custom_color(): Color - set debug_path_custom_color(value: Color) - - /** If [member debug_use_custom] is `true` uses this rasterized point size for rendering path points for this agent instead of global point size. */ - get debug_path_custom_point_size(): float64 - set debug_path_custom_point_size(value: float64) - - /** Emitted when the agent had to update the loaded path: - * - because path was previously empty. - * - because navigation map has changed. - * - because agent pushed further away from the current path segment than the [member path_max_distance]. - */ - readonly path_changed: Signal0 - - /** Signals that the agent reached the target, i.e. the agent moved within [member target_desired_distance] of the [member target_position]. This signal is emitted only once per loaded path. - * This signal will be emitted just before [signal navigation_finished] when the target is reachable. - * It may not always be possible to reach the target but it should always be possible to reach the final position. See [method get_final_position]. - */ - readonly target_reached: Signal0 - - /** Signals that the agent reached a waypoint. Emitted when the agent moves within [member path_desired_distance] of the next position of the path. - * The details dictionary may contain the following keys depending on the value of [member path_metadata_flags]: - * - `position`: The position of the waypoint that was reached. - * - `type`: The type of navigation primitive (region or link) that contains this waypoint. - * - `rid`: The [RID] of the containing navigation primitive (region or link). - * - `owner`: The object which manages the containing navigation primitive (region or link). - */ - readonly waypoint_reached: Signal1 - - /** Signals that the agent reached a navigation link. Emitted when the agent moves within [member path_desired_distance] of the next position of the path when that position is a navigation link. - * The details dictionary may contain the following keys depending on the value of [member path_metadata_flags]: - * - `position`: The start position of the link that was reached. - * - `type`: Always [constant NavigationPathQueryResult3D.PATH_SEGMENT_TYPE_LINK]. - * - `rid`: The [RID] of the link. - * - `owner`: The object which manages the link (usually [NavigationLink3D]). - * - `link_entry_position`: If `owner` is available and the owner is a [NavigationLink3D], it will contain the global position of the link's point the agent is entering. - * - `link_exit_position`: If `owner` is available and the owner is a [NavigationLink3D], it will contain the global position of the link's point which the agent is exiting. - */ - readonly link_reached: Signal1 - - /** Signals that the agent's navigation has finished. If the target is reachable, navigation ends when the target is reached. If the target is unreachable, navigation ends when the last waypoint of the path is reached. This signal is emitted only once per loaded path. - * This signal will be emitted just after [signal target_reached] when the target is reachable. - */ - readonly navigation_finished: Signal0 - - /** Notifies when the collision avoidance velocity is calculated. Emitted every update as long as [member avoidance_enabled] is `true` and the agent has a navigation map. */ - readonly velocity_computed: Signal1 - } - /** A link between two positions on [NavigationRegion2D]s that agents can be routed through. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_navigationlink2d.html - */ - class NavigationLink2D extends Node2D { - constructor(identifier?: any) - /** Returns the [RID] of this link on the [NavigationServer2D]. */ - get_rid(): RID - - /** Sets the [RID] of the navigation map this link should use. By default the link will automatically join the [World2D] default navigation map so this function is only required to override the default map. */ - set_navigation_map(navigation_map: RID): void - - /** Returns the current navigation map [RID] used by this link. */ - get_navigation_map(): RID - - /** Based on [param value], enables or disables the specified layer in the [member navigation_layers] bitmask, given a [param layer_number] between 1 and 32. */ - set_navigation_layer_value(layer_number: int64, value: boolean): void - - /** Returns whether or not the specified layer of the [member navigation_layers] bitmask is enabled, given a [param layer_number] between 1 and 32. */ - get_navigation_layer_value(layer_number: int64): boolean - - /** Sets the [member start_position] that is relative to the link from a global [param position]. */ - set_global_start_position(position: Vector2): void - - /** Returns the [member start_position] that is relative to the link as a global position. */ - get_global_start_position(): Vector2 - - /** Sets the [member end_position] that is relative to the link from a global [param position]. */ - set_global_end_position(position: Vector2): void - - /** Returns the [member end_position] that is relative to the link as a global position. */ - get_global_end_position(): Vector2 - - /** Whether this link is currently active. If `false`, [method NavigationServer2D.map_get_path] will ignore this link. */ - get enabled(): boolean - set enabled(value: boolean) - - /** Whether this link can be traveled in both directions or only from [member start_position] to [member end_position]. */ - get bidirectional(): boolean - set bidirectional(value: boolean) - - /** A bitfield determining all navigation layers the link belongs to. These navigation layers will be checked when requesting a path with [method NavigationServer2D.map_get_path]. */ - get navigation_layers(): int64 - set navigation_layers(value: int64) - - /** Starting position of the link. - * This position will search out the nearest polygon in the navigation mesh to attach to. - * The distance the link will search is controlled by [method NavigationServer2D.map_set_link_connection_radius]. - */ - get start_position(): Vector2 - set start_position(value: Vector2) - - /** Ending position of the link. - * This position will search out the nearest polygon in the navigation mesh to attach to. - * The distance the link will search is controlled by [method NavigationServer2D.map_set_link_connection_radius]. - */ - get end_position(): Vector2 - set end_position(value: Vector2) - - /** When pathfinding enters this link from another regions navigation mesh the [member enter_cost] value is added to the path distance for determining the shortest path. */ - get enter_cost(): float64 - set enter_cost(value: float64) - - /** When pathfinding moves along the link the traveled distance is multiplied with [member travel_cost] for determining the shortest path. */ - get travel_cost(): float64 - set travel_cost(value: float64) - } - class NavigationLink2DEditor extends Control { - constructor(identifier?: any) - } - class NavigationLink2DEditorPlugin extends EditorPlugin { - constructor(identifier?: any) - } - /** A link between two positions on [NavigationRegion3D]s that agents can be routed through. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_navigationlink3d.html - */ - class NavigationLink3D extends Node3D { - constructor(identifier?: any) - /** Returns the [RID] of this link on the [NavigationServer3D]. */ - get_rid(): RID - - /** Sets the [RID] of the navigation map this link should use. By default the link will automatically join the [World3D] default navigation map so this function is only required to override the default map. */ - set_navigation_map(navigation_map: RID): void - - /** Returns the current navigation map [RID] used by this link. */ - get_navigation_map(): RID - - /** Based on [param value], enables or disables the specified layer in the [member navigation_layers] bitmask, given a [param layer_number] between 1 and 32. */ - set_navigation_layer_value(layer_number: int64, value: boolean): void - - /** Returns whether or not the specified layer of the [member navigation_layers] bitmask is enabled, given a [param layer_number] between 1 and 32. */ - get_navigation_layer_value(layer_number: int64): boolean - - /** Sets the [member start_position] that is relative to the link from a global [param position]. */ - set_global_start_position(position: Vector3): void - - /** Returns the [member start_position] that is relative to the link as a global position. */ - get_global_start_position(): Vector3 - - /** Sets the [member end_position] that is relative to the link from a global [param position]. */ - set_global_end_position(position: Vector3): void - - /** Returns the [member end_position] that is relative to the link as a global position. */ - get_global_end_position(): Vector3 - - /** Whether this link is currently active. If `false`, [method NavigationServer3D.map_get_path] will ignore this link. */ - get enabled(): boolean - set enabled(value: boolean) - - /** Whether this link can be traveled in both directions or only from [member start_position] to [member end_position]. */ - get bidirectional(): boolean - set bidirectional(value: boolean) - - /** A bitfield determining all navigation layers the link belongs to. These navigation layers will be checked when requesting a path with [method NavigationServer3D.map_get_path]. */ - get navigation_layers(): int64 - set navigation_layers(value: int64) - - /** Starting position of the link. - * This position will search out the nearest polygon in the navigation mesh to attach to. - * The distance the link will search is controlled by [method NavigationServer3D.map_set_link_connection_radius]. - */ - get start_position(): Vector3 - set start_position(value: Vector3) - - /** Ending position of the link. - * This position will search out the nearest polygon in the navigation mesh to attach to. - * The distance the link will search is controlled by [method NavigationServer3D.map_set_link_connection_radius]. - */ - get end_position(): Vector3 - set end_position(value: Vector3) - - /** When pathfinding enters this link from another regions navigation mesh the [member enter_cost] value is added to the path distance for determining the shortest path. */ - get enter_cost(): float64 - set enter_cost(value: float64) - - /** When pathfinding moves along the link the traveled distance is multiplied with [member travel_cost] for determining the shortest path. */ - get travel_cost(): float64 - set travel_cost(value: float64) - } - class NavigationLink3DGizmoPlugin extends EditorNode3DGizmoPlugin { - constructor(identifier?: any) - } - namespace NavigationMesh { - enum SamplePartitionType { - /** Watershed partitioning. Generally the best choice if you precompute the navigation mesh, use this if you have large open areas. */ - SAMPLE_PARTITION_WATERSHED = 0, - - /** Monotone partitioning. Use this if you want fast navigation mesh generation. */ - SAMPLE_PARTITION_MONOTONE = 1, - - /** Layer partitioning. Good choice to use for tiled navigation mesh with medium and small sized tiles. */ - SAMPLE_PARTITION_LAYERS = 2, - - /** Represents the size of the [enum SamplePartitionType] enum. */ - SAMPLE_PARTITION_MAX = 3, - } - enum ParsedGeometryType { - /** Parses mesh instances as geometry. This includes [MeshInstance3D], [CSGShape3D], and [GridMap] nodes. */ - PARSED_GEOMETRY_MESH_INSTANCES = 0, - - /** Parses [StaticBody3D] colliders as geometry. The collider should be in any of the layers specified by [member geometry_collision_mask]. */ - PARSED_GEOMETRY_STATIC_COLLIDERS = 1, - - /** Both [constant PARSED_GEOMETRY_MESH_INSTANCES] and [constant PARSED_GEOMETRY_STATIC_COLLIDERS]. */ - PARSED_GEOMETRY_BOTH = 2, - - /** Represents the size of the [enum ParsedGeometryType] enum. */ - PARSED_GEOMETRY_MAX = 3, - } - enum SourceGeometryMode { - /** Scans the child nodes of the root node recursively for geometry. */ - SOURCE_GEOMETRY_ROOT_NODE_CHILDREN = 0, - - /** Scans nodes in a group and their child nodes recursively for geometry. The group is specified by [member geometry_source_group_name]. */ - SOURCE_GEOMETRY_GROUPS_WITH_CHILDREN = 1, - - /** Uses nodes in a group for geometry. The group is specified by [member geometry_source_group_name]. */ - SOURCE_GEOMETRY_GROUPS_EXPLICIT = 2, - - /** Represents the size of the [enum SourceGeometryMode] enum. */ - SOURCE_GEOMETRY_MAX = 3, - } - } - /** A navigation mesh that defines traversable areas and obstacles. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_navigationmesh.html - */ - class NavigationMesh extends Resource { - constructor(identifier?: any) - /** Based on [param value], enables or disables the specified layer in the [member geometry_collision_mask], given a [param layer_number] between 1 and 32. */ - set_collision_mask_value(layer_number: int64, value: boolean): void - - /** Returns whether or not the specified layer of the [member geometry_collision_mask] is enabled, given a [param layer_number] between 1 and 32. */ - get_collision_mask_value(layer_number: int64): boolean - - /** Adds a polygon using the indices of the vertices you get when calling [method get_vertices]. */ - add_polygon(polygon: PackedInt32Array | int32[]): void - - /** Returns the number of polygons in the navigation mesh. */ - get_polygon_count(): int64 - - /** Returns a [PackedInt32Array] containing the indices of the vertices of a created polygon. */ - get_polygon(idx: int64): PackedInt32Array - - /** Clears the array of polygons, but it doesn't clear the array of vertices. */ - clear_polygons(): void - - /** Initializes the navigation mesh by setting the vertices and indices according to a [Mesh]. - * - * **Note:** The given [param mesh] must be of type [constant Mesh.PRIMITIVE_TRIANGLES] and have an index array. - */ - create_from_mesh(mesh: Mesh): void - - /** Clears the internal arrays for vertices and polygon indices. */ - clear(): void - get vertices(): PackedVector3Array - set vertices(value: PackedVector3Array | Vector3[]) - get polygons(): GArray - set polygons(value: GArray) - - /** Partitioning algorithm for creating the navigation mesh polys. See [enum SamplePartitionType] for possible values. */ - get sample_partition_type(): int64 - set sample_partition_type(value: int64) - - /** Determines which type of nodes will be parsed as geometry. See [enum ParsedGeometryType] for possible values. */ - get geometry_parsed_geometry_type(): int64 - set geometry_parsed_geometry_type(value: int64) - - /** The physics layers to scan for static colliders. - * Only used when [member geometry_parsed_geometry_type] is [constant PARSED_GEOMETRY_STATIC_COLLIDERS] or [constant PARSED_GEOMETRY_BOTH]. - */ - get geometry_collision_mask(): int64 - set geometry_collision_mask(value: int64) - - /** The source of the geometry used when baking. See [enum SourceGeometryMode] for possible values. */ - get geometry_source_geometry_mode(): int64 - set geometry_source_geometry_mode(value: int64) - - /** The name of the group to scan for geometry. - * Only used when [member geometry_source_geometry_mode] is [constant SOURCE_GEOMETRY_GROUPS_WITH_CHILDREN] or [constant SOURCE_GEOMETRY_GROUPS_EXPLICIT]. - */ - get geometry_source_group_name(): string - set geometry_source_group_name(value: string) - - /** The cell size used to rasterize the navigation mesh vertices on the XZ plane. Must match with the cell size on the navigation map. */ - get cell_size(): float64 - set cell_size(value: float64) - - /** The cell height used to rasterize the navigation mesh vertices on the Y axis. Must match with the cell height on the navigation map. */ - get cell_height(): float64 - set cell_height(value: float64) - - /** The size of the non-navigable border around the bake bounding area. - * In conjunction with the [member filter_baking_aabb] and a [member edge_max_error] value at `1.0` or below the border size can be used to bake tile aligned navigation meshes without the tile edges being shrunk by [member agent_radius]. - * - * **Note:** While baking and not zero, this value will be rounded up to the nearest multiple of [member cell_size]. - */ - get border_size(): float64 - set border_size(value: float64) - - /** The minimum floor to ceiling height that will still allow the floor area to be considered walkable. - * - * **Note:** While baking, this value will be rounded up to the nearest multiple of [member cell_height]. - */ - get agent_height(): float64 - set agent_height(value: float64) - - /** The distance to erode/shrink the walkable area of the heightfield away from obstructions. - * - * **Note:** While baking, this value will be rounded up to the nearest multiple of [member cell_size]. - */ - get agent_radius(): float64 - set agent_radius(value: float64) - - /** The minimum ledge height that is considered to still be traversable. - * - * **Note:** While baking, this value will be rounded down to the nearest multiple of [member cell_height]. - */ - get agent_max_climb(): float64 - set agent_max_climb(value: float64) - - /** The maximum slope that is considered walkable, in degrees. */ - get agent_max_slope(): float64 - set agent_max_slope(value: float64) - - /** The minimum size of a region for it to be created. - * - * **Note:** This value will be squared to calculate the minimum number of cells allowed to form isolated island areas. For example, a value of 8 will set the number of cells to 64. - */ - get region_min_size(): float64 - set region_min_size(value: float64) - - /** Any regions with a size smaller than this will be merged with larger regions if possible. - * - * **Note:** This value will be squared to calculate the number of cells. For example, a value of 20 will set the number of cells to 400. - */ - get region_merge_size(): float64 - set region_merge_size(value: float64) - - /** The maximum allowed length for contour edges along the border of the mesh. A value of `0.0` disables this feature. - * - * **Note:** While baking, this value will be rounded up to the nearest multiple of [member cell_size]. - */ - get edge_max_length(): float64 - set edge_max_length(value: float64) - - /** The maximum distance a simplified contour's border edges should deviate the original raw contour. */ - get edge_max_error(): float64 - set edge_max_error(value: float64) - - /** The maximum number of vertices allowed for polygons generated during the contour to polygon conversion process. */ - get vertices_per_polygon(): float64 - set vertices_per_polygon(value: float64) - - /** The sampling distance to use when generating the detail mesh, in cell unit. */ - get detail_sample_distance(): float64 - set detail_sample_distance(value: float64) - - /** The maximum distance the detail mesh surface should deviate from heightfield, in cell unit. */ - get detail_sample_max_error(): float64 - set detail_sample_max_error(value: float64) - - /** If `true`, marks non-walkable spans as walkable if their maximum is within [member agent_max_climb] of a walkable neighbor. */ - get filter_low_hanging_obstacles(): boolean - set filter_low_hanging_obstacles(value: boolean) - - /** If `true`, marks spans that are ledges as non-walkable. */ - get filter_ledge_spans(): boolean - set filter_ledge_spans(value: boolean) - - /** If `true`, marks walkable spans as not walkable if the clearance above the span is less than [member agent_height]. */ - get filter_walkable_low_height_spans(): boolean - set filter_walkable_low_height_spans(value: boolean) - - /** If the baking [AABB] has a volume the navigation mesh baking will be restricted to its enclosing area. */ - get filter_baking_aabb(): AABB - set filter_baking_aabb(value: AABB) - - /** The position offset applied to the [member filter_baking_aabb] [AABB]. */ - get filter_baking_aabb_offset(): Vector3 - set filter_baking_aabb_offset(value: Vector3) - } - class NavigationMeshEditor extends Control { - constructor(identifier?: any) - } - class NavigationMeshEditorPlugin extends EditorPlugin { - constructor(identifier?: any) - } - /** Container for parsed source geometry data used in navigation mesh baking. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_navigationmeshsourcegeometrydata2d.html - */ - class NavigationMeshSourceGeometryData2D extends Resource { - constructor(identifier?: any) - /** Clears the internal data. */ - clear(): void - - /** Returns `true` when parsed source geometry data exists. */ - has_data(): boolean - - /** Appends another array of [param traversable_outlines] at the end of the existing traversable outlines array. */ - append_traversable_outlines(traversable_outlines: GArray): void - - /** Appends another array of [param obstruction_outlines] at the end of the existing obstruction outlines array. */ - append_obstruction_outlines(obstruction_outlines: GArray): void - - /** Adds the outline points of a shape as traversable area. */ - add_traversable_outline(shape_outline: PackedVector2Array | Vector2[]): void - - /** Adds the outline points of a shape as obstructed area. */ - add_obstruction_outline(shape_outline: PackedVector2Array | Vector2[]): void - - /** Adds the geometry data of another [NavigationMeshSourceGeometryData2D] to the navigation mesh baking data. */ - merge(other_geometry: NavigationMeshSourceGeometryData2D): void - - /** Adds a projected obstruction shape to the source geometry. If [param carve] is `true` the carved shape will not be affected by additional offsets (e.g. agent radius) of the navigation mesh baking process. */ - add_projected_obstruction(vertices: PackedVector2Array | Vector2[], carve: boolean): void - - /** Clears all projected obstructions. */ - clear_projected_obstructions(): void - get traversable_outlines(): GArray - set traversable_outlines(value: GArray) - get obstruction_outlines(): GArray - set obstruction_outlines(value: GArray) - get projected_obstructions(): GArray - set projected_obstructions(value: GArray) - } - /** Container for parsed source geometry data used in navigation mesh baking. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_navigationmeshsourcegeometrydata3d.html - */ - class NavigationMeshSourceGeometryData3D extends Resource { - constructor(identifier?: any) - /** Appends arrays of [param vertices] and [param indices] at the end of the existing arrays. Adds the existing index as an offset to the appended indices. */ - append_arrays(vertices: PackedFloat32Array | float32[], indices: PackedInt32Array | int32[]): void - - /** Clears the internal data. */ - clear(): void - - /** Returns `true` when parsed source geometry data exists. */ - has_data(): boolean - - /** Adds the geometry data of a [Mesh] resource to the navigation mesh baking data. The mesh must have valid triangulated mesh data to be considered. Since [NavigationMesh] resources have no transform, all vertex positions need to be offset by the node's transform using [param xform]. */ - add_mesh(mesh: Mesh, xform: Transform3D): void - - /** Adds an [Array] the size of [constant Mesh.ARRAY_MAX] and with vertices at index [constant Mesh.ARRAY_VERTEX] and indices at index [constant Mesh.ARRAY_INDEX] to the navigation mesh baking data. The array must have valid triangulated mesh data to be considered. Since [NavigationMesh] resources have no transform, all vertex positions need to be offset by the node's transform using [param xform]. */ - add_mesh_array(mesh_array: GArray, xform: Transform3D): void - - /** Adds an array of vertex positions to the geometry data for navigation mesh baking to form triangulated faces. For each face the array must have three vertex positions in clockwise winding order. Since [NavigationMesh] resources have no transform, all vertex positions need to be offset by the node's transform using [param xform]. */ - add_faces(faces: PackedVector3Array | Vector3[], xform: Transform3D): void - - /** Adds the geometry data of another [NavigationMeshSourceGeometryData3D] to the navigation mesh baking data. */ - merge(other_geometry: NavigationMeshSourceGeometryData3D): void - - /** Adds a projected obstruction shape to the source geometry. The [param vertices] are considered projected on a xz-axes plane, placed at the global y-axis [param elevation] and extruded by [param height]. If [param carve] is `true` the carved shape will not be affected by additional offsets (e.g. agent radius) of the navigation mesh baking process. */ - add_projected_obstruction(vertices: PackedVector3Array | Vector3[], elevation: float64, height: float64, carve: boolean): void - - /** Clears all projected obstructions. */ - clear_projected_obstructions(): void - get vertices(): PackedVector3Array - set vertices(value: PackedVector3Array | Vector3[]) - get indices(): PackedInt32Array - set indices(value: PackedInt32Array | int32[]) - get projected_obstructions(): GArray - set projected_obstructions(value: GArray) - } - /** 2D obstacle used to affect navigation mesh baking or constrain velocities of avoidance controlled agents. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_navigationobstacle2d.html - */ - class NavigationObstacle2D extends Node2D { - constructor(identifier?: any) - /** Returns the [RID] of this obstacle on the [NavigationServer2D]. */ - get_rid(): RID - - /** Sets the [RID] of the navigation map this NavigationObstacle node should use and also updates the `obstacle` on the NavigationServer. */ - set_navigation_map(navigation_map: RID): void - - /** Returns the [RID] of the navigation map for this NavigationObstacle node. This function returns always the map set on the NavigationObstacle node and not the map of the abstract obstacle on the NavigationServer. If the obstacle map is changed directly with the NavigationServer API the NavigationObstacle node will not be aware of the map change. Use [method set_navigation_map] to change the navigation map for the NavigationObstacle and also update the obstacle on the NavigationServer. */ - get_navigation_map(): RID - - /** Based on [param value], enables or disables the specified layer in the [member avoidance_layers] bitmask, given a [param layer_number] between 1 and 32. */ - set_avoidance_layer_value(layer_number: int64, value: boolean): void - - /** Returns whether or not the specified layer of the [member avoidance_layers] bitmask is enabled, given a [param layer_number] between 1 and 32. */ - get_avoidance_layer_value(layer_number: int64): boolean - - /** Sets the avoidance radius for the obstacle. */ - get radius(): float64 - set radius(value: float64) - - /** The outline vertices of the obstacle. If the vertices are winded in clockwise order agents will be pushed in by the obstacle, else they will be pushed out. Outlines can not be crossed or overlap. Should the vertices using obstacle be warped to a new position agent's can not predict this movement and may get trapped inside the obstacle. */ - get vertices(): PackedVector2Array - set vertices(value: PackedVector2Array | Vector2[]) - - /** If enabled and parsed in a navigation mesh baking process the obstacle will discard source geometry inside its [member vertices] defined shape. */ - get affect_navigation_mesh(): boolean - set affect_navigation_mesh(value: boolean) - - /** If enabled the obstacle vertices will carve into the baked navigation mesh with the shape unaffected by additional offsets (e.g. agent radius). - * It will still be affected by further postprocessing of the baking process, like edge and polygon simplification. - * Requires [member affect_navigation_mesh] to be enabled. - */ - get carve_navigation_mesh(): boolean - set carve_navigation_mesh(value: boolean) - - /** If `true` the obstacle affects avoidance using agents. */ - get avoidance_enabled(): boolean - set avoidance_enabled(value: boolean) - - /** Sets the wanted velocity for the obstacle so other agent's can better predict the obstacle if it is moved with a velocity regularly (every frame) instead of warped to a new position. Does only affect avoidance for the obstacles [member radius]. Does nothing for the obstacles static vertices. */ - get velocity(): Vector2 - set velocity(value: Vector2) - - /** A bitfield determining the avoidance layers for this obstacle. Agents with a matching bit on the their avoidance mask will avoid this obstacle. */ - get avoidance_layers(): int64 - set avoidance_layers(value: int64) - } - class NavigationObstacle2DEditor extends AbstractPolygon2DEditor { - constructor(identifier?: any) - } - class NavigationObstacle2DEditorPlugin extends AbstractPolygon2DEditorPlugin { - constructor(identifier?: any) - } - /** 3D obstacle used to affect navigation mesh baking or constrain velocities of avoidance controlled agents. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_navigationobstacle3d.html - */ - class NavigationObstacle3D extends Node3D { - constructor(identifier?: any) - /** Returns the [RID] of this obstacle on the [NavigationServer3D]. */ - get_rid(): RID - - /** Sets the [RID] of the navigation map this NavigationObstacle node should use and also updates the `obstacle` on the NavigationServer. */ - set_navigation_map(navigation_map: RID): void - - /** Returns the [RID] of the navigation map for this NavigationObstacle node. This function returns always the map set on the NavigationObstacle node and not the map of the abstract obstacle on the NavigationServer. If the obstacle map is changed directly with the NavigationServer API the NavigationObstacle node will not be aware of the map change. Use [method set_navigation_map] to change the navigation map for the NavigationObstacle and also update the obstacle on the NavigationServer. */ - get_navigation_map(): RID - - /** Based on [param value], enables or disables the specified layer in the [member avoidance_layers] bitmask, given a [param layer_number] between 1 and 32. */ - set_avoidance_layer_value(layer_number: int64, value: boolean): void - - /** Returns whether or not the specified layer of the [member avoidance_layers] bitmask is enabled, given a [param layer_number] between 1 and 32. */ - get_avoidance_layer_value(layer_number: int64): boolean - - /** Sets the avoidance radius for the obstacle. */ - get radius(): float64 - set radius(value: float64) - - /** Sets the obstacle height used in 2D avoidance. 2D avoidance using agent's ignore obstacles that are below or above them. */ - get height(): float64 - set height(value: float64) - - /** The outline vertices of the obstacle. If the vertices are winded in clockwise order agents will be pushed in by the obstacle, else they will be pushed out. Outlines can not be crossed or overlap. Should the vertices using obstacle be warped to a new position agent's can not predict this movement and may get trapped inside the obstacle. */ - get vertices(): PackedVector3Array - set vertices(value: PackedVector3Array | Vector3[]) - - /** If enabled and parsed in a navigation mesh baking process the obstacle will discard source geometry inside its [member vertices] and [member height] defined shape. */ - get affect_navigation_mesh(): boolean - set affect_navigation_mesh(value: boolean) - - /** If enabled the obstacle vertices will carve into the baked navigation mesh with the shape unaffected by additional offsets (e.g. agent radius). - * It will still be affected by further postprocessing of the baking process, like edge and polygon simplification. - * Requires [member affect_navigation_mesh] to be enabled. - */ - get carve_navigation_mesh(): boolean - set carve_navigation_mesh(value: boolean) - - /** If `true` the obstacle affects avoidance using agents. */ - get avoidance_enabled(): boolean - set avoidance_enabled(value: boolean) - - /** Sets the wanted velocity for the obstacle so other agent's can better predict the obstacle if it is moved with a velocity regularly (every frame) instead of warped to a new position. Does only affect avoidance for the obstacles [member radius]. Does nothing for the obstacles static vertices. */ - get velocity(): Vector3 - set velocity(value: Vector3) - - /** A bitfield determining the avoidance layers for this obstacle. Agents with a matching bit on the their avoidance mask will avoid this obstacle. */ - get avoidance_layers(): int64 - set avoidance_layers(value: int64) - - /** If `true` the obstacle affects 3D avoidance using agent's with obstacle [member radius]. - * If `false` the obstacle affects 2D avoidance using agent's with both obstacle [member vertices] as well as obstacle [member radius]. - */ - get use_3d_avoidance(): boolean - set use_3d_avoidance(value: boolean) - } - class NavigationObstacle3DEditor extends HBoxContainer { - constructor(identifier?: any) - _polygon_draw(): void - } - class NavigationObstacle3DEditorPlugin extends EditorPlugin { - constructor(identifier?: any) - } - namespace NavigationPathQueryParameters2D { - enum PathfindingAlgorithm { - /** The path query uses the default A* pathfinding algorithm. */ - PATHFINDING_ALGORITHM_ASTAR = 0, - } - enum PathPostProcessing { - /** Applies a funnel algorithm to the raw path corridor found by the pathfinding algorithm. This will result in the shortest path possible inside the path corridor. This postprocessing very much depends on the navigation mesh polygon layout and the created corridor. Especially tile- or gridbased layouts can face artificial corners with diagonal movement due to a jagged path corridor imposed by the cell shapes. */ - PATH_POSTPROCESSING_CORRIDORFUNNEL = 0, - - /** Centers every path position in the middle of the traveled navigation mesh polygon edge. This creates better paths for tile- or gridbased layouts that restrict the movement to the cells center. */ - PATH_POSTPROCESSING_EDGECENTERED = 1, - } - enum PathMetadataFlags { - /** Don't include any additional metadata about the returned path. */ - PATH_METADATA_INCLUDE_NONE = 0, - - /** Include the type of navigation primitive (region or link) that each point of the path goes through. */ - PATH_METADATA_INCLUDE_TYPES = 1, - - /** Include the [RID]s of the regions and links that each point of the path goes through. */ - PATH_METADATA_INCLUDE_RIDS = 2, - - /** Include the `ObjectID`s of the [Object]s which manage the regions and links each point of the path goes through. */ - PATH_METADATA_INCLUDE_OWNERS = 4, - - /** Include all available metadata about the returned path. */ - PATH_METADATA_INCLUDE_ALL = 7, - } - } - /** Provides parameters for 2D navigation path queries. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_navigationpathqueryparameters2d.html - */ - class NavigationPathQueryParameters2D extends RefCounted { - constructor(identifier?: any) - /** The navigation map [RID] used in the path query. */ - get map(): RID - set map(value: RID) - - /** The pathfinding start position in global coordinates. */ - get start_position(): Vector2 - set start_position(value: Vector2) - - /** The pathfinding target position in global coordinates. */ - get target_position(): Vector2 - set target_position(value: Vector2) - - /** The navigation layers the query will use (as a bitmask). */ - get navigation_layers(): int64 - set navigation_layers(value: int64) - - /** The pathfinding algorithm used in the path query. */ - get pathfinding_algorithm(): int64 - set pathfinding_algorithm(value: int64) - - /** The path postprocessing applied to the raw path corridor found by the [member pathfinding_algorithm]. */ - get path_postprocessing(): int64 - set path_postprocessing(value: int64) - - /** Additional information to include with the navigation path. */ - get metadata_flags(): int64 - set metadata_flags(value: int64) - - /** If `true` a simplified version of the path will be returned with less critical path points removed. The simplification amount is controlled by [member simplify_epsilon]. The simplification uses a variant of Ramer-Douglas-Peucker algorithm for curve point decimation. - * Path simplification can be helpful to mitigate various path following issues that can arise with certain agent types and script behaviors. E.g. "steering" agents or avoidance in "open fields". - */ - get simplify_path(): boolean - set simplify_path(value: boolean) - - /** The path simplification amount in worlds units. */ - get simplify_epsilon(): float64 - set simplify_epsilon(value: float64) - } - namespace NavigationPathQueryParameters3D { - enum PathfindingAlgorithm { - /** The path query uses the default A* pathfinding algorithm. */ - PATHFINDING_ALGORITHM_ASTAR = 0, - } - enum PathPostProcessing { - /** Applies a funnel algorithm to the raw path corridor found by the pathfinding algorithm. This will result in the shortest path possible inside the path corridor. This postprocessing very much depends on the navigation mesh polygon layout and the created corridor. Especially tile- or gridbased layouts can face artificial corners with diagonal movement due to a jagged path corridor imposed by the cell shapes. */ - PATH_POSTPROCESSING_CORRIDORFUNNEL = 0, - - /** Centers every path position in the middle of the traveled navigation mesh polygon edge. This creates better paths for tile- or gridbased layouts that restrict the movement to the cells center. */ - PATH_POSTPROCESSING_EDGECENTERED = 1, - } - enum PathMetadataFlags { - /** Don't include any additional metadata about the returned path. */ - PATH_METADATA_INCLUDE_NONE = 0, - - /** Include the type of navigation primitive (region or link) that each point of the path goes through. */ - PATH_METADATA_INCLUDE_TYPES = 1, - - /** Include the [RID]s of the regions and links that each point of the path goes through. */ - PATH_METADATA_INCLUDE_RIDS = 2, - - /** Include the `ObjectID`s of the [Object]s which manage the regions and links each point of the path goes through. */ - PATH_METADATA_INCLUDE_OWNERS = 4, - - /** Include all available metadata about the returned path. */ - PATH_METADATA_INCLUDE_ALL = 7, - } - } - /** Provides parameters for 3D navigation path queries. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_navigationpathqueryparameters3d.html - */ - class NavigationPathQueryParameters3D extends RefCounted { - constructor(identifier?: any) - /** The navigation map [RID] used in the path query. */ - get map(): RID - set map(value: RID) - - /** The pathfinding start position in global coordinates. */ - get start_position(): Vector3 - set start_position(value: Vector3) - - /** The pathfinding target position in global coordinates. */ - get target_position(): Vector3 - set target_position(value: Vector3) - - /** The navigation layers the query will use (as a bitmask). */ - get navigation_layers(): int64 - set navigation_layers(value: int64) - - /** The pathfinding algorithm used in the path query. */ - get pathfinding_algorithm(): int64 - set pathfinding_algorithm(value: int64) - - /** The path postprocessing applied to the raw path corridor found by the [member pathfinding_algorithm]. */ - get path_postprocessing(): int64 - set path_postprocessing(value: int64) - - /** Additional information to include with the navigation path. */ - get metadata_flags(): int64 - set metadata_flags(value: int64) - - /** If `true` a simplified version of the path will be returned with less critical path points removed. The simplification amount is controlled by [member simplify_epsilon]. The simplification uses a variant of Ramer-Douglas-Peucker algorithm for curve point decimation. - * Path simplification can be helpful to mitigate various path following issues that can arise with certain agent types and script behaviors. E.g. "steering" agents or avoidance in "open fields". - */ - get simplify_path(): boolean - set simplify_path(value: boolean) - - /** The path simplification amount in worlds units. */ - get simplify_epsilon(): float64 - set simplify_epsilon(value: float64) - } - namespace NavigationPathQueryResult2D { - enum PathSegmentType { - /** This segment of the path goes through a region. */ - PATH_SEGMENT_TYPE_REGION = 0, - - /** This segment of the path goes through a link. */ - PATH_SEGMENT_TYPE_LINK = 1, - } - } - /** Represents the result of a 2D pathfinding query. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_navigationpathqueryresult2d.html - */ - class NavigationPathQueryResult2D extends RefCounted { - constructor(identifier?: any) - /** Reset the result object to its initial state. This is useful to reuse the object across multiple queries. */ - reset(): void - - /** The resulting path array from the navigation query. All path array positions are in global coordinates. Without customized query parameters this is the same path as returned by [method NavigationServer2D.map_get_path]. */ - get path(): PackedVector2Array - set path(value: PackedVector2Array | Vector2[]) - - /** The type of navigation primitive (region or link) that each point of the path goes through. */ - get path_types(): PackedInt32Array - set path_types(value: PackedInt32Array | int32[]) - - /** The [RID]s of the regions and links that each point of the path goes through. */ - get path_rids(): GArray - set path_rids(value: GArray) - - /** The `ObjectID`s of the [Object]s which manage the regions and links each point of the path goes through. */ - get path_owner_ids(): PackedInt64Array - set path_owner_ids(value: PackedInt64Array | int64[]) - } - namespace NavigationPathQueryResult3D { - enum PathSegmentType { - /** This segment of the path goes through a region. */ - PATH_SEGMENT_TYPE_REGION = 0, - - /** This segment of the path goes through a link. */ - PATH_SEGMENT_TYPE_LINK = 1, - } - } - /** Represents the result of a 3D pathfinding query. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_navigationpathqueryresult3d.html - */ - class NavigationPathQueryResult3D extends RefCounted { - constructor(identifier?: any) - /** Reset the result object to its initial state. This is useful to reuse the object across multiple queries. */ - reset(): void - - /** The resulting path array from the navigation query. All path array positions are in global coordinates. Without customized query parameters this is the same path as returned by [method NavigationServer3D.map_get_path]. */ - get path(): PackedVector3Array - set path(value: PackedVector3Array | Vector3[]) - - /** The type of navigation primitive (region or link) that each point of the path goes through. */ - get path_types(): PackedInt32Array - set path_types(value: PackedInt32Array | int32[]) - - /** The [RID]s of the regions and links that each point of the path goes through. */ - get path_rids(): GArray - set path_rids(value: GArray) - - /** The `ObjectID`s of the [Object]s which manage the regions and links each point of the path goes through. */ - get path_owner_ids(): PackedInt64Array - set path_owner_ids(value: PackedInt64Array | int64[]) - } - namespace NavigationPolygon { - enum ParsedGeometryType { - /** Parses mesh instances as obstruction geometry. This includes [Polygon2D], [MeshInstance2D], [MultiMeshInstance2D], and [TileMap] nodes. - * Meshes are only parsed when they use a 2D vertices surface format. - */ - PARSED_GEOMETRY_MESH_INSTANCES = 0, - - /** Parses [StaticBody2D] and [TileMap] colliders as obstruction geometry. The collider should be in any of the layers specified by [member parsed_collision_mask]. */ - PARSED_GEOMETRY_STATIC_COLLIDERS = 1, - - /** Both [constant PARSED_GEOMETRY_MESH_INSTANCES] and [constant PARSED_GEOMETRY_STATIC_COLLIDERS]. */ - PARSED_GEOMETRY_BOTH = 2, - - /** Represents the size of the [enum ParsedGeometryType] enum. */ - PARSED_GEOMETRY_MAX = 3, - } - enum SourceGeometryMode { - /** Scans the child nodes of the root node recursively for geometry. */ - SOURCE_GEOMETRY_ROOT_NODE_CHILDREN = 0, - - /** Scans nodes in a group and their child nodes recursively for geometry. The group is specified by [member source_geometry_group_name]. */ - SOURCE_GEOMETRY_GROUPS_WITH_CHILDREN = 1, - - /** Uses nodes in a group for geometry. The group is specified by [member source_geometry_group_name]. */ - SOURCE_GEOMETRY_GROUPS_EXPLICIT = 2, - - /** Represents the size of the [enum SourceGeometryMode] enum. */ - SOURCE_GEOMETRY_MAX = 3, - } - } - /** A 2D navigation mesh that describes a traversable surface for pathfinding. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_navigationpolygon.html - */ - class NavigationPolygon extends Resource { - constructor(identifier?: any) - /** Adds a polygon using the indices of the vertices you get when calling [method get_vertices]. */ - add_polygon(polygon: PackedInt32Array | int32[]): void - - /** Returns the count of all polygons. */ - get_polygon_count(): int64 - - /** Returns a [PackedInt32Array] containing the indices of the vertices of a created polygon. */ - get_polygon(idx: int64): PackedInt32Array - - /** Clears the array of polygons, but it doesn't clear the array of outlines and vertices. */ - clear_polygons(): void - - /** Returns the [NavigationMesh] resulting from this navigation polygon. This navigation mesh can be used to update the navigation mesh of a region with the [method NavigationServer3D.region_set_navigation_mesh] API directly (as 2D uses the 3D server behind the scene). */ - get_navigation_mesh(): NavigationMesh - - /** Appends a [PackedVector2Array] that contains the vertices of an outline to the internal array that contains all the outlines. */ - add_outline(outline: PackedVector2Array | Vector2[]): void - - /** Adds a [PackedVector2Array] that contains the vertices of an outline to the internal array that contains all the outlines at a fixed position. */ - add_outline_at_index(outline: PackedVector2Array | Vector2[], index: int64): void - - /** Returns the number of outlines that were created in the editor or by script. */ - get_outline_count(): int64 - - /** Changes an outline created in the editor or by script. You have to call [method make_polygons_from_outlines] for the polygons to update. */ - set_outline(idx: int64, outline: PackedVector2Array | Vector2[]): void - - /** Returns a [PackedVector2Array] containing the vertices of an outline that was created in the editor or by script. */ - get_outline(idx: int64): PackedVector2Array - - /** Removes an outline created in the editor or by script. You have to call [method make_polygons_from_outlines] for the polygons to update. */ - remove_outline(idx: int64): void - - /** Clears the array of the outlines, but it doesn't clear the vertices and the polygons that were created by them. */ - clear_outlines(): void - - /** Creates polygons from the outlines added in the editor or by script. */ - make_polygons_from_outlines(): void - - /** Based on [param value], enables or disables the specified layer in the [member parsed_collision_mask], given a [param layer_number] between 1 and 32. */ - set_parsed_collision_mask_value(layer_number: int64, value: boolean): void - - /** Returns whether or not the specified layer of the [member parsed_collision_mask] is enabled, given a [param layer_number] between 1 and 32. */ - get_parsed_collision_mask_value(layer_number: int64): boolean - - /** Clears the internal arrays for vertices and polygon indices. */ - clear(): void - get vertices(): PackedVector2Array - set vertices(value: PackedVector2Array | Vector2[]) - get polygons(): GArray - set polygons(value: GArray) - get outlines(): GArray - set outlines(value: GArray) - - /** Determines which type of nodes will be parsed as geometry. See [enum ParsedGeometryType] for possible values. */ - get parsed_geometry_type(): int64 - set parsed_geometry_type(value: int64) - - /** The physics layers to scan for static colliders. - * Only used when [member parsed_geometry_type] is [constant PARSED_GEOMETRY_STATIC_COLLIDERS] or [constant PARSED_GEOMETRY_BOTH]. - */ - get parsed_collision_mask(): int64 - set parsed_collision_mask(value: int64) - - /** The source of the geometry used when baking. See [enum SourceGeometryMode] for possible values. */ - get source_geometry_mode(): int64 - set source_geometry_mode(value: int64) - - /** The group name of nodes that should be parsed for baking source geometry. - * Only used when [member source_geometry_mode] is [constant SOURCE_GEOMETRY_GROUPS_WITH_CHILDREN] or [constant SOURCE_GEOMETRY_GROUPS_EXPLICIT]. - */ - get source_geometry_group_name(): string - set source_geometry_group_name(value: string) - - /** The cell size used to rasterize the navigation mesh vertices. Must match with the cell size on the navigation map. */ - get cell_size(): float64 - set cell_size(value: float64) - - /** The size of the non-navigable border around the bake bounding area defined by the [member baking_rect] [Rect2]. - * In conjunction with the [member baking_rect] the border size can be used to bake tile aligned navigation meshes without the tile edges being shrunk by [member agent_radius]. - */ - get border_size(): float64 - set border_size(value: float64) - - /** The distance to erode/shrink the walkable surface when baking the navigation mesh. */ - get agent_radius(): float64 - set agent_radius(value: float64) - - /** If the baking [Rect2] has an area the navigation mesh baking will be restricted to its enclosing area. */ - get baking_rect(): Rect2 - set baking_rect(value: Rect2) - - /** The position offset applied to the [member baking_rect] [Rect2]. */ - get baking_rect_offset(): Vector2 - set baking_rect_offset(value: Vector2) - } - class NavigationPolygonEditor extends AbstractPolygon2DEditor { - constructor(identifier?: any) - } - class NavigationPolygonEditorPlugin extends AbstractPolygon2DEditorPlugin { - constructor(identifier?: any) - } - /** A traversable 2D region that [NavigationAgent2D]s can use for pathfinding. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_navigationregion2d.html - */ - class NavigationRegion2D extends Node2D { - constructor(identifier?: any) - /** Returns the [RID] of this region on the [NavigationServer2D]. Combined with [method NavigationServer2D.map_get_closest_point_owner] can be used to identify the [NavigationRegion2D] closest to a point on the merged navigation map. */ - get_rid(): RID - - /** Sets the [RID] of the navigation map this region should use. By default the region will automatically join the [World2D] default navigation map so this function is only required to override the default map. */ - set_navigation_map(navigation_map: RID): void - - /** Returns the current navigation map [RID] used by this region. */ - get_navigation_map(): RID - - /** Based on [param value], enables or disables the specified layer in the [member navigation_layers] bitmask, given a [param layer_number] between 1 and 32. */ - set_navigation_layer_value(layer_number: int64, value: boolean): void - - /** Returns whether or not the specified layer of the [member navigation_layers] bitmask is enabled, given a [param layer_number] between 1 and 32. */ - get_navigation_layer_value(layer_number: int64): boolean - - /** Returns the [RID] of this region on the [NavigationServer2D]. */ - get_region_rid(): RID - - /** Bakes the [NavigationPolygon]. If [param on_thread] is set to `true` (default), the baking is done on a separate thread. */ - bake_navigation_polygon(on_thread: boolean = true): void - - /** Returns `true` when the [NavigationPolygon] is being baked on a background thread. */ - is_baking(): boolean - _navigation_polygon_changed(): void - - /** The [NavigationPolygon] resource to use. */ - get navigation_polygon(): NavigationPolygon - set navigation_polygon(value: NavigationPolygon) - - /** Determines if the [NavigationRegion2D] is enabled or disabled. */ - get enabled(): boolean - set enabled(value: boolean) - - /** If enabled the navigation region will use edge connections to connect with other navigation regions within proximity of the navigation map edge connection margin. */ - get use_edge_connections(): boolean - set use_edge_connections(value: boolean) - - /** A bitfield determining all navigation layers the region belongs to. These navigation layers can be checked upon when requesting a path with [method NavigationServer2D.map_get_path]. */ - get navigation_layers(): int64 - set navigation_layers(value: int64) - - /** When pathfinding enters this region's navigation mesh from another regions navigation mesh the [member enter_cost] value is added to the path distance for determining the shortest path. */ - get enter_cost(): float64 - set enter_cost(value: float64) - - /** When pathfinding moves inside this region's navigation mesh the traveled distances are multiplied with [member travel_cost] for determining the shortest path. */ - get travel_cost(): float64 - set travel_cost(value: float64) - - /** Emitted when the used navigation polygon is replaced or changes to the internals of the current navigation polygon are committed. */ - readonly navigation_polygon_changed: Signal0 - - /** Emitted when a navigation polygon bake operation is completed. */ - readonly bake_finished: Signal0 - } - /** A traversable 3D region that [NavigationAgent3D]s can use for pathfinding. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_navigationregion3d.html - */ - class NavigationRegion3D extends Node3D { - constructor(identifier?: any) - /** Returns the [RID] of this region on the [NavigationServer3D]. Combined with [method NavigationServer3D.map_get_closest_point_owner] can be used to identify the [NavigationRegion3D] closest to a point on the merged navigation map. */ - get_rid(): RID - - /** Sets the [RID] of the navigation map this region should use. By default the region will automatically join the [World3D] default navigation map so this function is only required to override the default map. */ - set_navigation_map(navigation_map: RID): void - - /** Returns the current navigation map [RID] used by this region. */ - get_navigation_map(): RID - - /** Based on [param value], enables or disables the specified layer in the [member navigation_layers] bitmask, given a [param layer_number] between 1 and 32. */ - set_navigation_layer_value(layer_number: int64, value: boolean): void - - /** Returns whether or not the specified layer of the [member navigation_layers] bitmask is enabled, given a [param layer_number] between 1 and 32. */ - get_navigation_layer_value(layer_number: int64): boolean - - /** Returns the [RID] of this region on the [NavigationServer3D]. */ - get_region_rid(): RID - - /** Bakes the [NavigationMesh]. If [param on_thread] is set to `true` (default), the baking is done on a separate thread. Baking on separate thread is useful because navigation baking is not a cheap operation. When it is completed, it automatically sets the new [NavigationMesh]. Please note that baking on separate thread may be very slow if geometry is parsed from meshes as async access to each mesh involves heavy synchronization. Also, please note that baking on a separate thread is automatically disabled on operating systems that cannot use threads (such as Web with threads disabled). */ - bake_navigation_mesh(on_thread: boolean = true): void - - /** Returns `true` when the [NavigationMesh] is being baked on a background thread. */ - is_baking(): boolean - - /** The [NavigationMesh] resource to use. */ - get navigation_mesh(): NavigationMesh - set navigation_mesh(value: NavigationMesh) - - /** Determines if the [NavigationRegion3D] is enabled or disabled. */ - get enabled(): boolean - set enabled(value: boolean) - - /** If enabled the navigation region will use edge connections to connect with other navigation regions within proximity of the navigation map edge connection margin. */ - get use_edge_connections(): boolean - set use_edge_connections(value: boolean) - - /** A bitfield determining all navigation layers the region belongs to. These navigation layers can be checked upon when requesting a path with [method NavigationServer3D.map_get_path]. */ - get navigation_layers(): int64 - set navigation_layers(value: int64) - - /** When pathfinding enters this region's navigation mesh from another regions navigation mesh the [member enter_cost] value is added to the path distance for determining the shortest path. */ - get enter_cost(): float64 - set enter_cost(value: float64) - - /** When pathfinding moves inside this region's navigation mesh the traveled distances are multiplied with [member travel_cost] for determining the shortest path. */ - get travel_cost(): float64 - set travel_cost(value: float64) - - /** Notifies when the [NavigationMesh] has changed. */ - readonly navigation_mesh_changed: Signal0 - - /** Notifies when the navigation mesh bake operation is completed. */ - readonly bake_finished: Signal0 - } - class NavigationRegion3DGizmoPlugin extends EditorNode3DGizmoPlugin { - constructor(identifier?: any) - } - namespace NinePatchRect { - enum AxisStretchMode { - /** Stretches the center texture across the NinePatchRect. This may cause the texture to be distorted. */ - AXIS_STRETCH_MODE_STRETCH = 0, - - /** Repeats the center texture across the NinePatchRect. This won't cause any visible distortion. The texture must be seamless for this to work without displaying artifacts between edges. */ - AXIS_STRETCH_MODE_TILE = 1, - - /** Repeats the center texture across the NinePatchRect, but will also stretch the texture to make sure each tile is visible in full. This may cause the texture to be distorted, but less than [constant AXIS_STRETCH_MODE_STRETCH]. The texture must be seamless for this to work without displaying artifacts between edges. */ - AXIS_STRETCH_MODE_TILE_FIT = 2, - } - } - /** A control that displays a texture by keeping its corners intact, but tiling its edges and center. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_ninepatchrect.html - */ - class NinePatchRect extends Control { - constructor(identifier?: any) - /** Sets the size of the margin on the specified [enum Side] to [param value] pixels. */ - set_patch_margin(margin: Side, value: int64): void - - /** Returns the size of the margin on the specified [enum Side]. */ - get_patch_margin(margin: Side): int64 - - /** The node's texture resource. */ - get texture(): Texture2D - set texture(value: Texture2D) - - /** If `true`, draw the panel's center. Else, only draw the 9-slice's borders. */ - get draw_center(): boolean - set draw_center(value: boolean) - - /** Rectangular region of the texture to sample from. If you're working with an atlas, use this property to define the area the 9-slice should use. All other properties are relative to this one. If the rect is empty, NinePatchRect will use the whole texture. */ - get region_rect(): Rect2 - set region_rect(value: Rect2) - - /** The width of the 9-slice's left column. A margin of 16 means the 9-slice's left corners and side will have a width of 16 pixels. You can set all 4 margin values individually to create panels with non-uniform borders. */ - get patch_margin_left(): int64 - set patch_margin_left(value: int64) - - /** The height of the 9-slice's top row. A margin of 16 means the 9-slice's top corners and side will have a height of 16 pixels. You can set all 4 margin values individually to create panels with non-uniform borders. */ - get patch_margin_top(): int64 - set patch_margin_top(value: int64) - - /** The width of the 9-slice's right column. A margin of 16 means the 9-slice's right corners and side will have a width of 16 pixels. You can set all 4 margin values individually to create panels with non-uniform borders. */ - get patch_margin_right(): int64 - set patch_margin_right(value: int64) - - /** The height of the 9-slice's bottom row. A margin of 16 means the 9-slice's bottom corners and side will have a height of 16 pixels. You can set all 4 margin values individually to create panels with non-uniform borders. */ - get patch_margin_bottom(): int64 - set patch_margin_bottom(value: int64) - - /** The stretch mode to use for horizontal stretching/tiling. See [enum NinePatchRect.AxisStretchMode] for possible values. */ - get axis_stretch_horizontal(): int64 - set axis_stretch_horizontal(value: int64) - - /** The stretch mode to use for vertical stretching/tiling. See [enum NinePatchRect.AxisStretchMode] for possible values. */ - get axis_stretch_vertical(): int64 - set axis_stretch_vertical(value: int64) - - /** Emitted when the node's texture changes. */ - readonly texture_changed: Signal0 - } - namespace Node { - enum ProcessMode { - /** Inherits [member process_mode] from the node's parent. This is the default for any newly created node. */ - PROCESS_MODE_INHERIT = 0, - - /** Stops processing when [member SceneTree.paused] is `true`. This is the inverse of [constant PROCESS_MODE_WHEN_PAUSED], and the default for the root node. */ - PROCESS_MODE_PAUSABLE = 1, - - /** Process **only** when [member SceneTree.paused] is `true`. This is the inverse of [constant PROCESS_MODE_PAUSABLE]. */ - PROCESS_MODE_WHEN_PAUSED = 2, - - /** Always process. Keeps processing, ignoring [member SceneTree.paused]. This is the inverse of [constant PROCESS_MODE_DISABLED]. */ - PROCESS_MODE_ALWAYS = 3, - - /** Never process. Completely disables processing, ignoring [member SceneTree.paused]. This is the inverse of [constant PROCESS_MODE_ALWAYS]. */ - PROCESS_MODE_DISABLED = 4, - } - enum ProcessThreadGroup { - /** Process this node based on the thread group mode of the first parent (or grandparent) node that has a thread group mode that is not inherit. See [member process_thread_group] for more information. */ - PROCESS_THREAD_GROUP_INHERIT = 0, - - /** Process this node (and child nodes set to inherit) on the main thread. See [member process_thread_group] for more information. */ - PROCESS_THREAD_GROUP_MAIN_THREAD = 1, - - /** Process this node (and child nodes set to inherit) on a sub-thread. See [member process_thread_group] for more information. */ - PROCESS_THREAD_GROUP_SUB_THREAD = 2, - } - enum ProcessThreadMessages { - /** Allows this node to process threaded messages created with [method call_deferred_thread_group] right before [method _process] is called. */ - FLAG_PROCESS_THREAD_MESSAGES = 1, - - /** Allows this node to process threaded messages created with [method call_deferred_thread_group] right before [method _physics_process] is called. */ - FLAG_PROCESS_THREAD_MESSAGES_PHYSICS = 2, - - /** Allows this node to process threaded messages created with [method call_deferred_thread_group] right before either [method _process] or [method _physics_process] are called. */ - FLAG_PROCESS_THREAD_MESSAGES_ALL = 3, - } - enum PhysicsInterpolationMode { - /** Inherits [member physics_interpolation_mode] from the node's parent. This is the default for any newly created node. */ - PHYSICS_INTERPOLATION_MODE_INHERIT = 0, - - /** Enables physics interpolation for this node and for children set to [constant PHYSICS_INTERPOLATION_MODE_INHERIT]. This is the default for the root node. */ - PHYSICS_INTERPOLATION_MODE_ON = 1, - - /** Disables physics interpolation for this node and for children set to [constant PHYSICS_INTERPOLATION_MODE_INHERIT]. */ - PHYSICS_INTERPOLATION_MODE_OFF = 2, - } - enum DuplicateFlags { - /** Duplicate the node's signal connections. */ - DUPLICATE_SIGNALS = 1, - - /** Duplicate the node's groups. */ - DUPLICATE_GROUPS = 2, - - /** Duplicate the node's script (also overriding the duplicated children's scripts, if combined with [constant DUPLICATE_USE_INSTANTIATION]). */ - DUPLICATE_SCRIPTS = 4, - - /** Duplicate using [method PackedScene.instantiate]. If the node comes from a scene saved on disk, re-uses [method PackedScene.instantiate] as the base for the duplicated node and its children. */ - DUPLICATE_USE_INSTANTIATION = 8, - } - enum InternalMode { - /** The node will not be internal. */ - INTERNAL_MODE_DISABLED = 0, - - /** The node will be placed at the beginning of the parent's children, before any non-internal sibling. */ - INTERNAL_MODE_FRONT = 1, - - /** The node will be placed at the end of the parent's children, after any non-internal sibling. */ - INTERNAL_MODE_BACK = 2, - } - enum AutoTranslateMode { - /** Inherits [member auto_translate_mode] from the node's parent. This is the default for any newly created node. */ - AUTO_TRANSLATE_MODE_INHERIT = 0, - - /** Always automatically translate. This is the inverse of [constant AUTO_TRANSLATE_MODE_DISABLED], and the default for the root node. */ - AUTO_TRANSLATE_MODE_ALWAYS = 1, - - /** Never automatically translate. This is the inverse of [constant AUTO_TRANSLATE_MODE_ALWAYS]. - * String parsing for POT generation will be skipped for this node and children that are set to [constant AUTO_TRANSLATE_MODE_INHERIT]. - */ - AUTO_TRANSLATE_MODE_DISABLED = 2, - } - } - /** Base class for all scene objects. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_node.html - */ - class Node extends Object { - /** Notification received when the node enters a [SceneTree]. See [method _enter_tree]. - * This notification is received *before* the related [signal tree_entered] signal. - */ - static readonly NOTIFICATION_ENTER_TREE = 10 - - /** Notification received when the node is about to exit a [SceneTree]. See [method _exit_tree]. - * This notification is received *after* the related [signal tree_exiting] signal. - */ - static readonly NOTIFICATION_EXIT_TREE = 11 - static readonly NOTIFICATION_MOVED_IN_PARENT = 12 - - /** Notification received when the node is ready. See [method _ready]. */ - static readonly NOTIFICATION_READY = 13 - - /** Notification received when the node is paused. See [member process_mode]. */ - static readonly NOTIFICATION_PAUSED = 14 - - /** Notification received when the node is unpaused. See [member process_mode]. */ - static readonly NOTIFICATION_UNPAUSED = 15 - - /** Notification received from the tree every physics frame when [method is_physics_processing] returns `true`. See [method _physics_process]. */ - static readonly NOTIFICATION_PHYSICS_PROCESS = 16 - - /** Notification received from the tree every rendered frame when [method is_processing] returns `true`. See [method _process]. */ - static readonly NOTIFICATION_PROCESS = 17 - - /** Notification received when the node is set as a child of another node (see [method add_child] and [method add_sibling]). - * - * **Note:** This does *not* mean that the node entered the [SceneTree]. - */ - static readonly NOTIFICATION_PARENTED = 18 - - /** Notification received when the parent node calls [method remove_child] on this node. - * - * **Note:** This does *not* mean that the node exited the [SceneTree]. - */ - static readonly NOTIFICATION_UNPARENTED = 19 - - /** Notification received *only* by the newly instantiated scene root node, when [method PackedScene.instantiate] is completed. */ - static readonly NOTIFICATION_SCENE_INSTANTIATED = 20 - - /** Notification received when a drag operation begins. All nodes receive this notification, not only the dragged one. - * Can be triggered either by dragging a [Control] that provides drag data (see [method Control._get_drag_data]) or using [method Control.force_drag]. - * Use [method Viewport.gui_get_drag_data] to get the dragged data. - */ - static readonly NOTIFICATION_DRAG_BEGIN = 21 - - /** Notification received when a drag operation ends. - * Use [method Viewport.gui_is_drag_successful] to check if the drag succeeded. - */ - static readonly NOTIFICATION_DRAG_END = 22 - - /** Notification received when the node's [member name] or one of its ancestors' [member name] is changed. This notification is *not* received when the node is removed from the [SceneTree]. */ - static readonly NOTIFICATION_PATH_RENAMED = 23 - - /** Notification received when the list of children is changed. This happens when child nodes are added, moved or removed. */ - static readonly NOTIFICATION_CHILD_ORDER_CHANGED = 24 - - /** Notification received from the tree every rendered frame when [method is_processing_internal] returns `true`. */ - static readonly NOTIFICATION_INTERNAL_PROCESS = 25 - - /** Notification received from the tree every physics frame when [method is_physics_processing_internal] returns `true`. */ - static readonly NOTIFICATION_INTERNAL_PHYSICS_PROCESS = 26 - - /** Notification received when the node enters the tree, just before [constant NOTIFICATION_READY] may be received. Unlike the latter, it is sent every time the node enters tree, not just once. */ - static readonly NOTIFICATION_POST_ENTER_TREE = 27 - - /** Notification received when the node is disabled. See [constant PROCESS_MODE_DISABLED]. */ - static readonly NOTIFICATION_DISABLED = 28 - - /** Notification received when the node is enabled again after being disabled. See [constant PROCESS_MODE_DISABLED]. */ - static readonly NOTIFICATION_ENABLED = 29 - - /** Notification received when [method reset_physics_interpolation] is called on the node or its ancestors. */ - static readonly NOTIFICATION_RESET_PHYSICS_INTERPOLATION = 2001 - - /** Notification received right before the scene with the node is saved in the editor. This notification is only sent in the Godot editor and will not occur in exported projects. */ - static readonly NOTIFICATION_EDITOR_PRE_SAVE = 9001 - - /** Notification received right after the scene with the node is saved in the editor. This notification is only sent in the Godot editor and will not occur in exported projects. */ - static readonly NOTIFICATION_EDITOR_POST_SAVE = 9002 - - /** Notification received when the mouse enters the window. - * Implemented for embedded windows and on desktop and web platforms. - */ - static readonly NOTIFICATION_WM_MOUSE_ENTER = 1002 - - /** Notification received when the mouse leaves the window. - * Implemented for embedded windows and on desktop and web platforms. - */ - static readonly NOTIFICATION_WM_MOUSE_EXIT = 1003 - - /** Notification received from the OS when the node's [Window] ancestor is focused. This may be a change of focus between two windows of the same engine instance, or from the OS desktop or a third-party application to a window of the game (in which case [constant NOTIFICATION_APPLICATION_FOCUS_IN] is also received). - * A [Window] node receives this notification when it is focused. - */ - static readonly NOTIFICATION_WM_WINDOW_FOCUS_IN = 1004 - - /** Notification received from the OS when the node's [Window] ancestor is defocused. This may be a change of focus between two windows of the same engine instance, or from a window of the game to the OS desktop or a third-party application (in which case [constant NOTIFICATION_APPLICATION_FOCUS_OUT] is also received). - * A [Window] node receives this notification when it is defocused. - */ - static readonly NOTIFICATION_WM_WINDOW_FOCUS_OUT = 1005 - - /** Notification received from the OS when a close request is sent (e.g. closing the window with a "Close" button or [kbd]Alt + F4[/kbd]). - * Implemented on desktop platforms. - */ - static readonly NOTIFICATION_WM_CLOSE_REQUEST = 1006 - - /** Notification received from the OS when a go back request is sent (e.g. pressing the "Back" button on Android). - * Implemented only on Android. - */ - static readonly NOTIFICATION_WM_GO_BACK_REQUEST = 1007 - - /** Notification received when the window is resized. - * - * **Note:** Only the resized [Window] node receives this notification, and it's not propagated to the child nodes. - */ - static readonly NOTIFICATION_WM_SIZE_CHANGED = 1008 - - /** Notification received from the OS when the screen's dots per inch (DPI) scale is changed. Only implemented on macOS. */ - static readonly NOTIFICATION_WM_DPI_CHANGE = 1009 - - /** Notification received when the mouse cursor enters the [Viewport]'s visible area, that is not occluded behind other [Control]s or [Window]s, provided its [member Viewport.gui_disable_input] is `false` and regardless if it's currently focused or not. */ - static readonly NOTIFICATION_VP_MOUSE_ENTER = 1010 - - /** Notification received when the mouse cursor leaves the [Viewport]'s visible area, that is not occluded behind other [Control]s or [Window]s, provided its [member Viewport.gui_disable_input] is `false` and regardless if it's currently focused or not. */ - static readonly NOTIFICATION_VP_MOUSE_EXIT = 1011 - - /** Notification received from the OS when the application is exceeding its allocated memory. - * Implemented only on iOS. - */ - static readonly NOTIFICATION_OS_MEMORY_WARNING = 2009 - - /** Notification received when translations may have changed. Can be triggered by the user changing the locale, changing [member auto_translate_mode] or when the node enters the scene tree. Can be used to respond to language changes, for example to change the UI strings on the fly. Useful when working with the built-in translation support, like [method Object.tr]. - * - * **Note:** This notification is received alongside [constant NOTIFICATION_ENTER_TREE], so if you are instantiating a scene, the child nodes will not be initialized yet. You can use it to setup translations for this node, child nodes created from script, or if you want to access child nodes added in the editor, make sure the node is ready using [method is_node_ready]. - * - */ - static readonly NOTIFICATION_TRANSLATION_CHANGED = 2010 - - /** Notification received from the OS when a request for "About" information is sent. - * Implemented only on macOS. - */ - static readonly NOTIFICATION_WM_ABOUT = 2011 - - /** Notification received from Godot's crash handler when the engine is about to crash. - * Implemented on desktop platforms, if the crash handler is enabled. - */ - static readonly NOTIFICATION_CRASH = 2012 - - /** Notification received from the OS when an update of the Input Method Engine occurs (e.g. change of IME cursor position or composition string). - * Implemented only on macOS. - */ - static readonly NOTIFICATION_OS_IME_UPDATE = 2013 - - /** Notification received from the OS when the application is resumed. - * Specific to the Android and iOS platforms. - */ - static readonly NOTIFICATION_APPLICATION_RESUMED = 2014 - - /** Notification received from the OS when the application is paused. - * Specific to the Android and iOS platforms. - * - * **Note:** On iOS, you only have approximately 5 seconds to finish a task started by this signal. If you go over this allotment, iOS will kill the app instead of pausing it. - */ - static readonly NOTIFICATION_APPLICATION_PAUSED = 2015 - - /** Notification received from the OS when the application is focused, i.e. when changing the focus from the OS desktop or a thirdparty application to any open window of the Godot instance. - * Implemented on desktop and mobile platforms. - */ - static readonly NOTIFICATION_APPLICATION_FOCUS_IN = 2016 - - /** Notification received from the OS when the application is defocused, i.e. when changing the focus from any open window of the Godot instance to the OS desktop or a thirdparty application. - * Implemented on desktop and mobile platforms. - */ - static readonly NOTIFICATION_APPLICATION_FOCUS_OUT = 2017 - - /** Notification received when the [TextServer] is changed. */ - static readonly NOTIFICATION_TEXT_SERVER_CHANGED = 2018 - constructor(identifier?: any) - - /** Called during the processing step of the main loop. Processing happens at every frame and as fast as possible, so the [param delta] time since the previous frame is not constant. [param delta] is in seconds. - * It is only called if processing is enabled, which is done automatically if this method is overridden, and can be toggled with [method set_process]. - * Corresponds to the [constant NOTIFICATION_PROCESS] notification in [method Object._notification]. - * - * **Note:** This method is only called if the node is present in the scene tree (i.e. if it's not an orphan). - */ - /* gdvirtual */ _process(delta: float64): void - - /** Called during the physics processing step of the main loop. Physics processing means that the frame rate is synced to the physics, i.e. the [param delta] variable should be constant. [param delta] is in seconds. - * It is only called if physics processing is enabled, which is done automatically if this method is overridden, and can be toggled with [method set_physics_process]. - * Corresponds to the [constant NOTIFICATION_PHYSICS_PROCESS] notification in [method Object._notification]. - * - * **Note:** This method is only called if the node is present in the scene tree (i.e. if it's not an orphan). - */ - /* gdvirtual */ _physics_process(delta: float64): void - - /** Called when the node enters the [SceneTree] (e.g. upon instantiating, scene changing, or after calling [method add_child] in a script). If the node has children, its [method _enter_tree] callback will be called first, and then that of the children. - * Corresponds to the [constant NOTIFICATION_ENTER_TREE] notification in [method Object._notification]. - */ - /* gdvirtual */ _enter_tree(): void - - /** Called when the node is about to leave the [SceneTree] (e.g. upon freeing, scene changing, or after calling [method remove_child] in a script). If the node has children, its [method _exit_tree] callback will be called last, after all its children have left the tree. - * Corresponds to the [constant NOTIFICATION_EXIT_TREE] notification in [method Object._notification] and signal [signal tree_exiting]. To get notified when the node has already left the active tree, connect to the [signal tree_exited]. - */ - /* gdvirtual */ _exit_tree(): void - - /** Called when the node is "ready", i.e. when both the node and its children have entered the scene tree. If the node has children, their [method _ready] callbacks get triggered first, and the parent node will receive the ready notification afterwards. - * Corresponds to the [constant NOTIFICATION_READY] notification in [method Object._notification]. See also the `@onready` annotation for variables. - * Usually used for initialization. For even earlier initialization, [method Object._init] may be used. See also [method _enter_tree]. - * - * **Note:** This method may be called only once for each node. After removing a node from the scene tree and adding it again, [method _ready] will **not** be called a second time. This can be bypassed by requesting another call with [method request_ready], which may be called anywhere before adding the node again. - */ - /* gdvirtual */ _ready(): void - - /** The elements in the array returned from this method are displayed as warnings in the Scene dock if the script that overrides it is a `tool` script. - * Returning an empty array produces no warnings. - * Call [method update_configuration_warnings] when the warnings need to be updated for this node. - * - */ - /* gdvirtual */ _get_configuration_warnings(): PackedStringArray - - /** Called when there is an input event. The input event propagates up through the node tree until a node consumes it. - * It is only called if input processing is enabled, which is done automatically if this method is overridden, and can be toggled with [method set_process_input]. - * To consume the input event and stop it propagating further to other nodes, [method Viewport.set_input_as_handled] can be called. - * For gameplay input, [method _unhandled_input] and [method _unhandled_key_input] are usually a better fit as they allow the GUI to intercept the events first. - * - * **Note:** This method is only called if the node is present in the scene tree (i.e. if it's not an orphan). - */ - /* gdvirtual */ _input(event: InputEvent): void - - /** Called when an [InputEventKey], [InputEventShortcut], or [InputEventJoypadButton] hasn't been consumed by [method _input] or any GUI [Control] item. It is called before [method _unhandled_key_input] and [method _unhandled_input]. The input event propagates up through the node tree until a node consumes it. - * It is only called if shortcut processing is enabled, which is done automatically if this method is overridden, and can be toggled with [method set_process_shortcut_input]. - * To consume the input event and stop it propagating further to other nodes, [method Viewport.set_input_as_handled] can be called. - * This method can be used to handle shortcuts. For generic GUI events, use [method _input] instead. Gameplay events should usually be handled with either [method _unhandled_input] or [method _unhandled_key_input]. - * - * **Note:** This method is only called if the node is present in the scene tree (i.e. if it's not orphan). - */ - /* gdvirtual */ _shortcut_input(event: InputEvent): void - - /** Called when an [InputEvent] hasn't been consumed by [method _input] or any GUI [Control] item. It is called after [method _shortcut_input] and after [method _unhandled_key_input]. The input event propagates up through the node tree until a node consumes it. - * It is only called if unhandled input processing is enabled, which is done automatically if this method is overridden, and can be toggled with [method set_process_unhandled_input]. - * To consume the input event and stop it propagating further to other nodes, [method Viewport.set_input_as_handled] can be called. - * For gameplay input, this method is usually a better fit than [method _input], as GUI events need a higher priority. For keyboard shortcuts, consider using [method _shortcut_input] instead, as it is called before this method. Finally, to handle keyboard events, consider using [method _unhandled_key_input] for performance reasons. - * - * **Note:** This method is only called if the node is present in the scene tree (i.e. if it's not an orphan). - */ - /* gdvirtual */ _unhandled_input(event: InputEvent): void - - /** Called when an [InputEventKey] hasn't been consumed by [method _input] or any GUI [Control] item. It is called after [method _shortcut_input] but before [method _unhandled_input]. The input event propagates up through the node tree until a node consumes it. - * It is only called if unhandled key input processing is enabled, which is done automatically if this method is overridden, and can be toggled with [method set_process_unhandled_key_input]. - * To consume the input event and stop it propagating further to other nodes, [method Viewport.set_input_as_handled] can be called. - * This method can be used to handle Unicode character input with [kbd]Alt[/kbd], [kbd]Alt + Ctrl[/kbd], and [kbd]Alt + Shift[/kbd] modifiers, after shortcuts were handled. - * For gameplay input, this and [method _unhandled_input] are usually a better fit than [method _input], as GUI events should be handled first. This method also performs better than [method _unhandled_input], since unrelated events such as [InputEventMouseMotion] are automatically filtered. For shortcuts, consider using [method _shortcut_input] instead. - * - * **Note:** This method is only called if the node is present in the scene tree (i.e. if it's not an orphan). - */ - /* gdvirtual */ _unhandled_key_input(event: InputEvent): void - - /** Prints all orphan nodes (nodes outside the [SceneTree]). Useful for debugging. - * - * **Note:** This method only works in debug builds. Does nothing in a project exported in release mode. - */ - static print_orphan_nodes(): void - - /** Adds a [param sibling] node to this node's parent, and moves the added sibling right below this node. - * If [param force_readable_name] is `true`, improves the readability of the added [param sibling]. If not named, the [param sibling] is renamed to its type, and if it shares [member name] with a sibling, a number is suffixed more appropriately. This operation is very slow. As such, it is recommended leaving this to `false`, which assigns a dummy name featuring `@` in both situations. - * Use [method add_child] instead of this method if you don't need the child node to be added below a specific node in the list of children. - * - * **Note:** If this node is internal, the added sibling will be internal too (see [method add_child]'s `internal` parameter). - */ - add_sibling(sibling: Node, force_readable_name: boolean = false): void - set_name(name: string): void - get_name(): StringName - - /** Adds a child [param node]. Nodes can have any number of children, but every child must have a unique name. Child nodes are automatically deleted when the parent node is deleted, so an entire scene can be removed by deleting its topmost node. - * If [param force_readable_name] is `true`, improves the readability of the added [param node]. If not named, the [param node] is renamed to its type, and if it shares [member name] with a sibling, a number is suffixed more appropriately. This operation is very slow. As such, it is recommended leaving this to `false`, which assigns a dummy name featuring `@` in both situations. - * If [param internal] is different than [constant INTERNAL_MODE_DISABLED], the child will be added as internal node. These nodes are ignored by methods like [method get_children], unless their parameter `include_internal` is `true`. The intended usage is to hide the internal nodes from the user, so the user won't accidentally delete or modify them. Used by some GUI nodes, e.g. [ColorPicker]. See [enum InternalMode] for available modes. - * - * **Note:** If [param node] already has a parent, this method will fail. Use [method remove_child] first to remove [param node] from its current parent. For example: - * - * If you need the child node to be added below a specific node in the list of children, use [method add_sibling] instead of this method. - * - * **Note:** If you want a child to be persisted to a [PackedScene], you must set [member owner] in addition to calling [method add_child]. This is typically relevant for [url=https://docs.godotengine.org/en/4.3/tutorials/plugins/running_code_in_the_editor.html]tool scripts[/url] and [url=https://docs.godotengine.org/en/4.3/tutorials/plugins/editor/index.html]editor plugins[/url]. If [method add_child] is called without setting [member owner], the newly added [Node] will not be visible in the scene tree, though it will be visible in the 2D/3D view. - */ - add_child(node: Node, force_readable_name: boolean = false, internal: Node.InternalMode = 0): void - - /** Removes a child [param node]. The [param node], along with its children, are **not** deleted. To delete a node, see [method queue_free]. - * - * **Note:** When this node is inside the tree, this method sets the [member owner] of the removed [param node] (or its descendants) to `null`, if their [member owner] is no longer an ancestor (see [method is_ancestor_of]). - */ - remove_child(node: Node): void - - /** Changes the parent of this [Node] to the [param new_parent]. The node needs to already have a parent. The node's [member owner] is preserved if its owner is still reachable from the new location (i.e., the node is still a descendant of the new parent after the operation). - * If [param keep_global_transform] is `true`, the node's global transform will be preserved if supported. [Node2D], [Node3D] and [Control] support this argument (but [Control] keeps only position). - */ - reparent(new_parent: Node, keep_global_transform: boolean = true): void - - /** Returns the number of children of this node. - * If [param include_internal] is `false`, internal children are not counted (see [method add_child]'s `internal` parameter). - */ - get_child_count(include_internal: boolean = false): int64 - - /** Returns all children of this node inside an [Array]. - * If [param include_internal] is `false`, excludes internal children from the returned array (see [method add_child]'s `internal` parameter). - */ - get_children(include_internal: boolean = false): GArray - - /** Fetches a child node by its index. Each child node has an index relative its siblings (see [method get_index]). The first child is at index 0. Negative values can also be used to start from the end of the list. This method can be used in combination with [method get_child_count] to iterate over this node's children. If no child exists at the given index, this method returns `null` and an error is generated. - * If [param include_internal] is `false`, internal children are ignored (see [method add_child]'s `internal` parameter). - * - * - * **Note:** To fetch a node by [NodePath], use [method get_node]. - */ - get_child(idx: int64, include_internal: boolean = false): Node - - /** Returns `true` if the [param path] points to a valid node. See also [method get_node]. */ - has_node(path: NodePath | string): boolean - - /** Fetches a node. The [NodePath] can either be a relative path (from this node), or an absolute path (from the [member SceneTree.root]) to a node. If [param path] does not point to a valid node, generates an error and returns `null`. Attempts to access methods on the return value will result in an *"Attempt to call on a null instance."* error. - * - * **Note:** Fetching by absolute path only works when the node is inside the scene tree (see [method is_inside_tree]). - * **Example:** Assume this method is called from the Character node, inside the following tree: - * [codeblock lang=text] - * ┖╴root - * ┠╴Character (you are here!) - * ┃ ┠╴Sword - * ┃ ┖╴Backpack - * ┃ ┖╴Dagger - * ┠╴MyGame - * ┖╴Swamp - * ┠╴Alligator - * ┠╴Mosquito - * ┖╴Goblin - * [/codeblock] - * The following calls will return a valid node: - * - */ - get_node(path: NodePath | string): Node - - /** Fetches a node by [NodePath]. Similar to [method get_node], but does not generate an error if [param path] does not point to a valid node. */ - get_node_or_null(path: NodePath | string): Node - - /** Returns this node's parent node, or `null` if the node doesn't have a parent. */ - get_parent(): Node - - /** Finds the first descendant of this node whose [member name] matches [param pattern], returning `null` if no match is found. The matching is done against node names, *not* their paths, through [method String.match]. As such, it is case-sensitive, `"*"` matches zero or more characters, and `"?"` matches any single character. - * If [param recursive] is `false`, only this node's direct children are checked. Nodes are checked in tree order, so this node's first direct child is checked first, then its own direct children, etc., before moving to the second direct child, and so on. Internal children are also included in the search (see `internal` parameter in [method add_child]). - * If [param owned] is `true`, only descendants with a valid [member owner] node are checked. - * - * **Note:** This method can be very slow. Consider storing a reference to the found node in a variable. Alternatively, use [method get_node] with unique names (see [member unique_name_in_owner]). - * - * **Note:** To find all descendant nodes matching a pattern or a class type, see [method find_children]. - */ - find_child(pattern: string, recursive: boolean = true, owned: boolean = true): Node - - /** Finds all descendants of this node whose names match [param pattern], returning an empty [Array] if no match is found. The matching is done against node names, *not* their paths, through [method String.match]. As such, it is case-sensitive, `"*"` matches zero or more characters, and `"?"` matches any single character. - * If [param type] is not empty, only ancestors inheriting from [param type] are included (see [method Object.is_class]). - * If [param recursive] is `false`, only this node's direct children are checked. Nodes are checked in tree order, so this node's first direct child is checked first, then its own direct children, etc., before moving to the second direct child, and so on. Internal children are also included in the search (see `internal` parameter in [method add_child]). - * If [param owned] is `true`, only descendants with a valid [member owner] node are checked. - * - * **Note:** This method can be very slow. Consider storing references to the found nodes in a variable. - * - * **Note:** To find a single descendant node matching a pattern, see [method find_child]. - */ - find_children(pattern: string, type: string = '', recursive: boolean = true, owned: boolean = true): GArray - - /** Finds the first ancestor of this node whose [member name] matches [param pattern], returning `null` if no match is found. The matching is done through [method String.match]. As such, it is case-sensitive, `"*"` matches zero or more characters, and `"?"` matches any single character. See also [method find_child] and [method find_children]. - * - * **Note:** As this method walks upwards in the scene tree, it can be slow in large, deeply nested nodes. Consider storing a reference to the found node in a variable. Alternatively, use [method get_node] with unique names (see [member unique_name_in_owner]). - */ - find_parent(pattern: string): Node - - /** Returns `true` if [param path] points to a valid node and its subnames point to a valid [Resource], e.g. `Area2D/CollisionShape2D:shape`. Properties that are not [Resource] types (such as nodes or other [Variant] types) are not considered. See also [method get_node_and_resource]. */ - has_node_and_resource(path: NodePath | string): boolean - - /** Fetches a node and its most nested resource as specified by the [NodePath]'s subname. Returns an [Array] of size `3` where: - * - Element `0` is the [Node], or `null` if not found; - * - Element `1` is the subname's last nested [Resource], or `null` if not found; - * - Element `2` is the remaining [NodePath], referring to an existing, non-[Resource] property (see [method Object.get_indexed]). - * **Example:** Assume that the child's [member Sprite2D.texture] has been assigned a [AtlasTexture]: - * - */ - get_node_and_resource(path: NodePath | string): GArray - - /** Returns `true` if this node is currently inside a [SceneTree]. See also [method get_tree]. */ - is_inside_tree(): boolean - - /** Returns `true` if the node is part of the scene currently opened in the editor. */ - is_part_of_edited_scene(): boolean - - /** Returns `true` if the given [param node] is a direct or indirect child of this node. */ - is_ancestor_of(node: Node): boolean - - /** Returns `true` if the given [param node] occurs later in the scene hierarchy than this node. A node occurring later is usually processed last. */ - is_greater_than(node: Node): boolean - - /** Returns the node's absolute path, relative to the [member SceneTree.root]. If the node is not inside the scene tree, this method fails and returns an empty [NodePath]. */ - get_path(): NodePath - - /** Returns the relative [NodePath] from this node to the specified [param node]. Both nodes must be in the same [SceneTree] or scene hierarchy, otherwise this method fails and returns an empty [NodePath]. - * If [param use_unique_path] is `true`, returns the shortest path accounting for this node's unique name (see [member unique_name_in_owner]). - * - * **Note:** If you get a relative path which starts from a unique node, the path may be longer than a normal relative path, due to the addition of the unique node's name. - */ - get_path_to(node: Node, use_unique_path: boolean = false): NodePath - - /** Adds the node to the [param group]. Groups can be helpful to organize a subset of nodes, for example `"enemies"` or `"collectables"`. See notes in the description, and the group methods in [SceneTree]. - * If [param persistent] is `true`, the group will be stored when saved inside a [PackedScene]. All groups created and displayed in the Node dock are persistent. - * - * **Note:** To improve performance, the order of group names is *not* guaranteed and may vary between project runs. Therefore, do not rely on the group order. - * - * **Note:** [SceneTree]'s group methods will *not* work on this node if not inside the tree (see [method is_inside_tree]). - */ - add_to_group(group: StringName, persistent: boolean = false): void - - /** Removes the node from the given [param group]. Does nothing if the node is not in the [param group]. See also notes in the description, and the [SceneTree]'s group methods. */ - remove_from_group(group: StringName): void - - /** Returns `true` if this node has been added to the given [param group]. See [method add_to_group] and [method remove_from_group]. See also notes in the description, and the [SceneTree]'s group methods. */ - is_in_group(group: StringName): boolean - - /** Moves [param child_node] to the given index. A node's index is the order among its siblings. If [param to_index] is negative, the index is counted from the end of the list. See also [method get_child] and [method get_index]. - * - * **Note:** The processing order of several engine callbacks ([method _ready], [method _process], etc.) and notifications sent through [method propagate_notification] is affected by tree order. [CanvasItem] nodes are also rendered in tree order. See also [member process_priority]. - */ - move_child(child_node: Node, to_index: int64): void - - /** Returns an [Array] of group names that the node has been added to. - * - * **Note:** To improve performance, the order of group names is *not* guaranteed and may vary between project runs. Therefore, do not rely on the group order. - * - * **Note:** This method may also return some group names starting with an underscore (`_`). These are internally used by the engine. To avoid conflicts, do not use custom groups starting with underscores. To exclude internal groups, see the following code snippet: - * - */ - get_groups(): GArray - - /** Returns this node's order among its siblings. The first node's index is `0`. See also [method get_child]. - * If [param include_internal] is `false`, returns the index ignoring internal children. The first, non-internal child will have an index of `0` (see [method add_child]'s `internal` parameter). - */ - get_index(include_internal: boolean = false): int64 - - /** Prints the node and its children to the console, recursively. The node does not have to be inside the tree. This method outputs [NodePath]s relative to this node, and is good for copy/pasting into [method get_node]. See also [method print_tree_pretty]. - * May print, for example: - * [codeblock lang=text] - * . - * Menu - * Menu/Label - * Menu/Camera2D - * SplashScreen - * SplashScreen/Camera2D - * [/codeblock] - */ - print_tree(): void - - /** Prints the node and its children to the console, recursively. The node does not have to be inside the tree. Similar to [method print_tree], but the graphical representation looks like what is displayed in the editor's Scene dock. It is useful for inspecting larger trees. - * May print, for example: - * [codeblock lang=text] - * ┖╴TheGame - * ┠╴Menu - * ┃ ┠╴Label - * ┃ ┖╴Camera2D - * ┖╴SplashScreen - * ┖╴Camera2D - * [/codeblock] - */ - print_tree_pretty(): void - - /** Returns the tree as a [String]. Used mainly for debugging purposes. This version displays the path relative to the current node, and is good for copy/pasting into the [method get_node] function. It also can be used in game UI/UX. - * May print, for example: - * [codeblock lang=text] - * TheGame - * TheGame/Menu - * TheGame/Menu/Label - * TheGame/Menu/Camera2D - * TheGame/SplashScreen - * TheGame/SplashScreen/Camera2D - * [/codeblock] - */ - get_tree_string(): string - - /** Similar to [method get_tree_string], this returns the tree as a [String]. This version displays a more graphical representation similar to what is displayed in the Scene Dock. It is useful for inspecting larger trees. - * May print, for example: - * [codeblock lang=text] - * ┖╴TheGame - * ┠╴Menu - * ┃ ┠╴Label - * ┃ ┖╴Camera2D - * ┖╴SplashScreen - * ┖╴Camera2D - * [/codeblock] - */ - get_tree_string_pretty(): string - - /** Calls [method Object.notification] with [param what] on this node and all of its children, recursively. */ - propagate_notification(what: int64): void - - /** Calls the given [param method] name, passing [param args] as arguments, on this node and all of its children, recursively. - * If [param parent_first] is `true`, the method is called on this node first, then on all of its children. If `false`, the children's methods are called first. - */ - propagate_call(method: StringName, args: GArray = [], parent_first: boolean = false): void - - /** If set to `true`, enables physics (fixed framerate) processing. When a node is being processed, it will receive a [constant NOTIFICATION_PHYSICS_PROCESS] at a fixed (usually 60 FPS, see [member Engine.physics_ticks_per_second] to change) interval (and the [method _physics_process] callback will be called if it exists). - * - * **Note:** If [method _physics_process] is overridden, this will be automatically enabled before [method _ready] is called. - */ - set_physics_process(enable: boolean): void - - /** Returns the time elapsed (in seconds) since the last physics callback. This value is identical to [method _physics_process]'s `delta` parameter, and is often consistent at run-time, unless [member Engine.physics_ticks_per_second] is changed. See also [constant NOTIFICATION_PHYSICS_PROCESS]. */ - get_physics_process_delta_time(): float64 - - /** Returns `true` if physics processing is enabled (see [method set_physics_process]). */ - is_physics_processing(): boolean - - /** Returns the time elapsed (in seconds) since the last process callback. This value is identical to [method _process]'s `delta` parameter, and may vary from frame to frame. See also [constant NOTIFICATION_PROCESS]. */ - get_process_delta_time(): float64 - - /** If set to `true`, enables processing. When a node is being processed, it will receive a [constant NOTIFICATION_PROCESS] on every drawn frame (and the [method _process] callback will be called if it exists). - * - * **Note:** If [method _process] is overridden, this will be automatically enabled before [method _ready] is called. - * - * **Note:** This method only affects the [method _process] callback, i.e. it has no effect on other callbacks like [method _physics_process]. If you want to disable all processing for the node, set [member process_mode] to [constant PROCESS_MODE_DISABLED]. - */ - set_process(enable: boolean): void - - /** Returns `true` if processing is enabled (see [method set_process]). */ - is_processing(): boolean - - /** If set to `true`, enables input processing. - * - * **Note:** If [method _input] is overridden, this will be automatically enabled before [method _ready] is called. Input processing is also already enabled for GUI controls, such as [Button] and [TextEdit]. - */ - set_process_input(enable: boolean): void - - /** Returns `true` if the node is processing input (see [method set_process_input]). */ - is_processing_input(): boolean - - /** If set to `true`, enables shortcut processing for this node. - * - * **Note:** If [method _shortcut_input] is overridden, this will be automatically enabled before [method _ready] is called. - */ - set_process_shortcut_input(enable: boolean): void - - /** Returns `true` if the node is processing shortcuts (see [method set_process_shortcut_input]). */ - is_processing_shortcut_input(): boolean - - /** If set to `true`, enables unhandled input processing. It enables the node to receive all input that was not previously handled (usually by a [Control]). - * - * **Note:** If [method _unhandled_input] is overridden, this will be automatically enabled before [method _ready] is called. Unhandled input processing is also already enabled for GUI controls, such as [Button] and [TextEdit]. - */ - set_process_unhandled_input(enable: boolean): void - - /** Returns `true` if the node is processing unhandled input (see [method set_process_unhandled_input]). */ - is_processing_unhandled_input(): boolean - - /** If set to `true`, enables unhandled key input processing. - * - * **Note:** If [method _unhandled_key_input] is overridden, this will be automatically enabled before [method _ready] is called. - */ - set_process_unhandled_key_input(enable: boolean): void - - /** Returns `true` if the node is processing unhandled key input (see [method set_process_unhandled_key_input]). */ - is_processing_unhandled_key_input(): boolean - - /** Returns `true` if the node can receive processing notifications and input callbacks ([constant NOTIFICATION_PROCESS], [method _input], etc.) from the [SceneTree] and [Viewport]. The returned value depends on [member process_mode]: - * - If set to [constant PROCESS_MODE_PAUSABLE], returns `true` when the game is processing, i.e. [member SceneTree.paused] is `false`; - * - If set to [constant PROCESS_MODE_WHEN_PAUSED], returns `true` when the game is paused, i.e. [member SceneTree.paused] is `true`; - * - If set to [constant PROCESS_MODE_ALWAYS], always returns `true`; - * - If set to [constant PROCESS_MODE_DISABLED], always returns `false`; - * - If set to [constant PROCESS_MODE_INHERIT], use the parent node's [member process_mode] to determine the result. - * If the node is not inside the tree, returns `false` no matter the value of [member process_mode]. - */ - can_process(): boolean - - /** If set to `true`, the node appears folded in the Scene dock. As a result, all of its children are hidden. This method is intended to be used in editor plugins and tools, but it also works in release builds. See also [method is_displayed_folded]. */ - set_display_folded(fold: boolean): void - - /** Returns `true` if the node is folded (collapsed) in the Scene dock. This method is intended to be used in editor plugins and tools. See also [method set_display_folded]. */ - is_displayed_folded(): boolean - - /** If set to `true`, enables internal processing for this node. Internal processing happens in isolation from the normal [method _process] calls and is used by some nodes internally to guarantee proper functioning even if the node is paused or processing is disabled for scripting ([method set_process]). - * **Warning:** Built-in nodes rely on internal processing for their internal logic. Disabling it is unsafe and may lead to unexpected behavior. Use this method if you know what you are doing. - */ - set_process_internal(enable: boolean): void - - /** Returns `true` if internal processing is enabled (see [method set_process_internal]). */ - is_processing_internal(): boolean - - /** If set to `true`, enables internal physics for this node. Internal physics processing happens in isolation from the normal [method _physics_process] calls and is used by some nodes internally to guarantee proper functioning even if the node is paused or physics processing is disabled for scripting ([method set_physics_process]). - * **Warning:** Built-in nodes rely on internal processing for their internal logic. Disabling it is unsafe and may lead to unexpected behavior. Use this method if you know what you are doing. - */ - set_physics_process_internal(enable: boolean): void - - /** Returns `true` if internal physics processing is enabled (see [method set_physics_process_internal]). */ - is_physics_processing_internal(): boolean - - /** Returns `true` if physics interpolation is enabled for this node (see [member physics_interpolation_mode]). - * - * **Note:** Interpolation will only be active if both the flag is set **and** physics interpolation is enabled within the [SceneTree]. This can be tested using [method is_physics_interpolated_and_enabled]. - */ - is_physics_interpolated(): boolean - - /** Returns `true` if physics interpolation is enabled (see [member physics_interpolation_mode]) **and** enabled in the [SceneTree]. - * This is a convenience version of [method is_physics_interpolated] that also checks whether physics interpolation is enabled globally. - * See [member SceneTree.physics_interpolation] and [member ProjectSettings.physics/common/physics_interpolation]. - */ - is_physics_interpolated_and_enabled(): boolean - - /** When physics interpolation is active, moving a node to a radically different transform (such as placement within a level) can result in a visible glitch as the object is rendered moving from the old to new position over the physics tick. - * That glitch can be prevented by calling this method, which temporarily disables interpolation until the physics tick is complete. - * The notification [constant NOTIFICATION_RESET_PHYSICS_INTERPOLATION] will be received by the node and all children recursively. - * - * **Note:** This function should be called **after** moving the node, rather than before. - */ - reset_physics_interpolation(): void - - /** Returns the [Window] that contains this node. If the node is in the main window, this is equivalent to getting the root node (`get_tree().get_root()`). */ - get_window(): Window - - /** Returns the [Window] that contains this node, or the last exclusive child in a chain of windows starting with the one that contains this node. */ - get_last_exclusive_window(): Window - - /** Returns the [SceneTree] that contains this node. If this node is not inside the tree, generates an error and returns `null`. See also [method is_inside_tree]. */ - get_tree(): SceneTree - - /** Creates a new [Tween] and binds it to this node. - * This is the equivalent of doing: - * - * The Tween will start automatically on the next process frame or physics frame (depending on [enum Tween.TweenProcessMode]). See [method Tween.bind_node] for more info on Tweens bound to nodes. - * - * **Note:** The method can still be used when the node is not inside [SceneTree]. It can fail in an unlikely case of using a custom [MainLoop]. - */ - create_tween(): Tween - - /** Duplicates the node, returning a new node with all of its properties, signals and groups copied from the original. The behavior can be tweaked through the [param flags] (see [enum DuplicateFlags]). - * - * **Note:** For nodes with a [Script] attached, if [method Object._init] has been defined with required parameters, the duplicated node will not have a [Script]. - */ - duplicate(flags: int64 = 15): Node - - /** Replaces this node by the given [param node]. All children of this node are moved to [param node]. - * If [param keep_groups] is `true`, the [param node] is added to the same groups that the replaced node is in (see [method add_to_group]). - * **Warning:** The replaced node is removed from the tree, but it is **not** deleted. To prevent memory leaks, store a reference to the node in a variable, or use [method Object.free]. - */ - replace_by(node: Node, keep_groups: boolean = false): void - - /** If set to `true`, the node becomes a [InstancePlaceholder] when packed and instantiated from a [PackedScene]. See also [method get_scene_instance_load_placeholder]. */ - set_scene_instance_load_placeholder(load_placeholder: boolean): void - - /** Returns `true` if this node is an instance load placeholder. See [InstancePlaceholder] and [method set_scene_instance_load_placeholder]. */ - get_scene_instance_load_placeholder(): boolean - - /** Set to `true` to allow all nodes owned by [param node] to be available, and editable, in the Scene dock, even if their [member owner] is not the scene root. This method is intended to be used in editor plugins and tools, but it also works in release builds. See also [method is_editable_instance]. */ - set_editable_instance(node: Node, is_editable: boolean): void - - /** Returns `true` if [param node] has editable children enabled relative to this node. This method is intended to be used in editor plugins and tools. See also [method set_editable_instance]. */ - is_editable_instance(node: Node): boolean - - /** Returns the node's closest [Viewport] ancestor, if the node is inside the tree. Otherwise, returns `null`. */ - get_viewport(): Viewport - - /** Queues this node to be deleted at the end of the current frame. When deleted, all of its children are deleted as well, and all references to the node and its children become invalid. - * Unlike with [method Object.free], the node is not deleted instantly, and it can still be accessed before deletion. It is also safe to call [method queue_free] multiple times. Use [method Object.is_queued_for_deletion] to check if the node will be deleted at the end of the frame. - * - * **Note:** The node will only be freed after all other deferred calls are finished. Using this method is not always the same as calling [method Object.free] through [method Object.call_deferred]. - */ - queue_free(): void - - /** Requests [method _ready] to be called again the next time the node enters the tree. Does **not** immediately call [method _ready]. - * - * **Note:** This method only affects the current node. If the node's children also need to request ready, this method needs to be called for each one of them. When the node and its children enter the tree again, the order of [method _ready] callbacks will be the same as normal. - */ - request_ready(): void - - /** Returns `true` if the node is ready, i.e. it's inside scene tree and all its children are initialized. - * [method request_ready] resets it back to `false`. - */ - is_node_ready(): boolean - - /** Sets the node's multiplayer authority to the peer with the given peer [param id]. The multiplayer authority is the peer that has authority over the node on the network. Defaults to peer ID 1 (the server). Useful in conjunction with [method rpc_config] and the [MultiplayerAPI]. - * If [param recursive] is `true`, the given peer is recursively set as the authority for all children of this node. - * **Warning:** This does **not** automatically replicate the new authority to other peers. It is the developer's responsibility to do so. You may replicate the new authority's information using [member MultiplayerSpawner.spawn_function], an RPC, or a [MultiplayerSynchronizer]. Furthermore, the parent's authority does **not** propagate to newly added children. - */ - set_multiplayer_authority(id: int64, recursive: boolean = true): void - - /** Returns the peer ID of the multiplayer authority for this node. See [method set_multiplayer_authority]. */ - get_multiplayer_authority(): int64 - - /** Returns `true` if the local system is the multiplayer authority of this node. */ - is_multiplayer_authority(): boolean - - /** Changes the RPC configuration for the given [param method]. [param config] should either be `null` to disable the feature (as by default), or a [Dictionary] containing the following entries: - * - `rpc_mode`: see [enum MultiplayerAPI.RPCMode]; - * - `transfer_mode`: see [enum MultiplayerPeer.TransferMode]; - * - `call_local`: if `true`, the method will also be called locally; - * - `channel`: an [int] representing the channel to send the RPC on. - * - * **Note:** In GDScript, this method corresponds to the [annotation @GDScript.@rpc] annotation, with various parameters passed (`@rpc(any)`, `@rpc(authority)`...). See also the [url=https://docs.godotengine.org/en/4.3/tutorials/networking/high_level_multiplayer.html]high-level multiplayer[/url] tutorial. - */ - rpc_config(method: StringName, config: any): void - - /** Translates a [param message], using the translation catalogs configured in the Project Settings. Further [param context] can be specified to help with the translation. Note that most [Control] nodes automatically translate their strings, so this method is mostly useful for formatted strings or custom drawn text. - * This method works the same as [method Object.tr], with the addition of respecting the [member auto_translate_mode] state. - * If [method Object.can_translate_messages] is `false`, or no translation is available, this method returns the [param message] without changes. See [method Object.set_message_translation]. - * For detailed examples, see [url=https://docs.godotengine.org/en/4.3/tutorials/i18n/internationalizing_games.html]Internationalizing games[/url]. - */ - atr(message: string, context: StringName = ''): string - - /** Translates a [param message] or [param plural_message], using the translation catalogs configured in the Project Settings. Further [param context] can be specified to help with the translation. - * This method works the same as [method Object.tr_n], with the addition of respecting the [member auto_translate_mode] state. - * If [method Object.can_translate_messages] is `false`, or no translation is available, this method returns [param message] or [param plural_message], without changes. See [method Object.set_message_translation]. - * The [param n] is the number, or amount, of the message's subject. It is used by the translation system to fetch the correct plural form for the current language. - * For detailed examples, see [url=https://docs.godotengine.org/en/4.3/tutorials/i18n/localization_using_gettext.html]Localization using gettext[/url]. - * - * **Note:** Negative and [float] numbers may not properly apply to some countable subjects. It's recommended to handle these cases with [method atr]. - */ - atr_n(message: string, plural_message: StringName, n: int64, context: StringName = ''): string - _set_property_pinned(property: string, pinned: boolean): void - - /** Sends a remote procedure call request for the given [param method] to peers on the network (and locally), sending additional arguments to the method called by the RPC. The call request will only be received by nodes with the same [NodePath], including the exact same [member name]. Behavior depends on the RPC configuration for the given [param method] (see [method rpc_config] and [annotation @GDScript.@rpc]). By default, methods are not exposed to RPCs. - * May return [constant OK] if the call is successful, [constant ERR_INVALID_PARAMETER] if the arguments passed in the [param method] do not match, [constant ERR_UNCONFIGURED] if the node's [member multiplayer] cannot be fetched (such as when the node is not inside the tree), [constant ERR_CONNECTION_ERROR] if [member multiplayer]'s connection is not available. - * - * **Note:** You can only safely use RPCs on clients after you received the [signal MultiplayerAPI.connected_to_server] signal from the [MultiplayerAPI]. You also need to keep track of the connection state, either by the [MultiplayerAPI] signals like [signal MultiplayerAPI.server_disconnected] or by checking (`get_multiplayer().peer.get_connection_status() == CONNECTION_CONNECTED`). - */ - rpc(method: StringName, ...vargargs: any[]): GError - - /** Sends a [method rpc] to a specific peer identified by [param peer_id] (see [method MultiplayerPeer.set_target_peer]). - * May return [constant OK] if the call is successful, [constant ERR_INVALID_PARAMETER] if the arguments passed in the [param method] do not match, [constant ERR_UNCONFIGURED] if the node's [member multiplayer] cannot be fetched (such as when the node is not inside the tree), [constant ERR_CONNECTION_ERROR] if [member multiplayer]'s connection is not available. - */ - rpc_id(peer_id: int64, method: StringName, ...vargargs: any[]): GError - - /** Refreshes the warnings displayed for this node in the Scene dock. Use [method _get_configuration_warnings] to customize the warning messages to display. */ - update_configuration_warnings(): void - - /** This function is similar to [method Object.call_deferred] except that the call will take place when the node thread group is processed. If the node thread group processes in sub-threads, then the call will be done on that thread, right before [constant NOTIFICATION_PROCESS] or [constant NOTIFICATION_PHYSICS_PROCESS], the [method _process] or [method _physics_process] or their internal versions are called. */ - call_deferred_thread_group(method: StringName, ...vargargs: any[]): any - - /** Similar to [method call_deferred_thread_group], but for setting properties. */ - set_deferred_thread_group(property: StringName, value: any): void - - /** Similar to [method call_deferred_thread_group], but for notifications. */ - notify_deferred_thread_group(what: int64): void - - /** This function ensures that the calling of this function will succeed, no matter whether it's being done from a thread or not. If called from a thread that is not allowed to call the function, the call will become deferred. Otherwise, the call will go through directly. */ - call_thread_safe(method: StringName, ...vargargs: any[]): any - - /** Similar to [method call_thread_safe], but for setting properties. */ - set_thread_safe(property: StringName, value: any): void - - /** Similar to [method call_thread_safe], but for notifications. */ - notify_thread_safe(what: int64): void - get _import_path(): NodePath - set _import_path(value: NodePath | string) - - /** If `true`, the node can be accessed from any node sharing the same [member owner] or from the [member owner] itself, with special `%Name` syntax in [method get_node]. - * - * **Note:** If another node with the same [member owner] shares the same [member name] as this node, the other node will no longer be accessible as unique. - */ - get unique_name_in_owner(): boolean - set unique_name_in_owner(value: boolean) - - /** The original scene's file path, if the node has been instantiated from a [PackedScene] file. Only scene root nodes contains this. */ - get scene_file_path(): string - set scene_file_path(value: string) - - /** The owner of this node. The owner must be an ancestor of this node. When packing the owner node in a [PackedScene], all the nodes it owns are also saved with it. - * - * **Note:** In the editor, nodes not owned by the scene root are usually not displayed in the Scene dock, and will **not** be saved. To prevent this, remember to set the owner after calling [method add_child]. See also (see [member unique_name_in_owner]) - */ - get owner(): Node - set owner(value: Node) - - /** The [MultiplayerAPI] instance associated with this node. See [method SceneTree.get_multiplayer]. - * - * **Note:** Renaming the node, or moving it in the tree, will not move the [MultiplayerAPI] to the new path, you will have to update this manually. - */ - get multiplayer(): MultiplayerAPI - - /** The node's processing behavior (see [enum ProcessMode]). To check if the node can process in its current mode, use [method can_process]. */ - get process_mode(): int64 - set process_mode(value: int64) - - /** The node's execution order of the process callbacks ([method _process], [method _physics_process], and internal processing). Nodes whose priority value is *lower* call their process callbacks first, regardless of tree order. */ - get process_priority(): int64 - set process_priority(value: int64) - - /** Similar to [member process_priority] but for [constant NOTIFICATION_PHYSICS_PROCESS], [method _physics_process] or the internal version. */ - get process_physics_priority(): int64 - set process_physics_priority(value: int64) - - /** Set the process thread group for this node (basically, whether it receives [constant NOTIFICATION_PROCESS], [constant NOTIFICATION_PHYSICS_PROCESS], [method _process] or [method _physics_process] (and the internal versions) on the main thread or in a sub-thread. - * By default, the thread group is [constant PROCESS_THREAD_GROUP_INHERIT], which means that this node belongs to the same thread group as the parent node. The thread groups means that nodes in a specific thread group will process together, separate to other thread groups (depending on [member process_thread_group_order]). If the value is set is [constant PROCESS_THREAD_GROUP_SUB_THREAD], this thread group will occur on a sub thread (not the main thread), otherwise if set to [constant PROCESS_THREAD_GROUP_MAIN_THREAD] it will process on the main thread. If there is not a parent or grandparent node set to something other than inherit, the node will belong to the *default thread group* . This default group will process on the main thread and its group order is 0. - * During processing in a sub-thread, accessing most functions in nodes outside the thread group is forbidden (and it will result in an error in debug mode). Use [method Object.call_deferred], [method call_thread_safe], [method call_deferred_thread_group] and the likes in order to communicate from the thread groups to the main thread (or to other thread groups). - * To better understand process thread groups, the idea is that any node set to any other value than [constant PROCESS_THREAD_GROUP_INHERIT] will include any child (and grandchild) nodes set to inherit into its process thread group. This means that the processing of all the nodes in the group will happen together, at the same time as the node including them. - */ - get process_thread_group(): int64 - set process_thread_group(value: int64) - - /** Change the process thread group order. Groups with a lesser order will process before groups with a greater order. This is useful when a large amount of nodes process in sub thread and, afterwards, another group wants to collect their result in the main thread, as an example. */ - get process_thread_group_order(): int64 - set process_thread_group_order(value: int64) - - /** Set whether the current thread group will process messages (calls to [method call_deferred_thread_group] on threads), and whether it wants to receive them during regular process or physics process callbacks. */ - get process_thread_messages(): int64 - set process_thread_messages(value: int64) - - /** Allows enabling or disabling physics interpolation per node, offering a finer grain of control than turning physics interpolation on and off globally. See [member ProjectSettings.physics/common/physics_interpolation] and [member SceneTree.physics_interpolation] for the global setting. - * - * **Note:** When teleporting a node to a distant position you should temporarily disable interpolation with [method Node.reset_physics_interpolation]. - */ - get physics_interpolation_mode(): int64 - set physics_interpolation_mode(value: int64) - - /** Defines if any text should automatically change to its translated version depending on the current locale (for nodes such as [Label], [RichTextLabel], [Window], etc.). Also decides if the node's strings should be parsed for POT generation. - * - * **Note:** For the root node, auto translate mode can also be set via [member ProjectSettings.internationalization/rendering/root_node_auto_translate]. - */ - get auto_translate_mode(): int64 - set auto_translate_mode(value: int64) - - /** An optional description to the node. It will be displayed as a tooltip when hovering over the node in the editor's Scene dock. */ - get editor_description(): string - set editor_description(value: string) - - /** Emitted when the node is considered ready, after [method _ready] is called. */ - readonly ready: Signal0 - - /** Emitted when the node's [member name] is changed, if the node is inside the tree. */ - readonly renamed: Signal0 - - /** Emitted when the node enters the tree. - * This signal is emitted *after* the related [constant NOTIFICATION_ENTER_TREE] notification. - */ - readonly tree_entered: Signal0 - - /** Emitted when the node is just about to exit the tree. The node is still valid. As such, this is the right place for de-initialization (or a "destructor", if you will). - * This signal is emitted *after* the node's [method _exit_tree], and *before* the related [constant NOTIFICATION_EXIT_TREE]. - */ - readonly tree_exiting: Signal0 - - /** Emitted after the node exits the tree and is no longer active. - * This signal is emitted *after* the related [constant NOTIFICATION_EXIT_TREE] notification. - */ - readonly tree_exited: Signal0 - - /** Emitted when the child [param node] enters the [SceneTree], usually because this node entered the tree (see [signal tree_entered]), or [method add_child] has been called. - * This signal is emitted *after* the child node's own [constant NOTIFICATION_ENTER_TREE] and [signal tree_entered]. - */ - readonly child_entered_tree: Signal1 - - /** Emitted when the child [param node] is about to exit the [SceneTree], usually because this node is exiting the tree (see [signal tree_exiting]), or because the child [param node] is being removed or freed. - * When this signal is received, the child [param node] is still accessible inside the tree. This signal is emitted *after* the child node's own [signal tree_exiting] and [constant NOTIFICATION_EXIT_TREE]. - */ - readonly child_exiting_tree: Signal1 - - /** Emitted when the list of children is changed. This happens when child nodes are added, moved or removed. */ - readonly child_order_changed: Signal0 - - /** Emitted when this node is being replaced by the [param node], see [method replace_by]. - * This signal is emitted *after* [param node] has been added as a child of the original parent node, but *before* all original child nodes have been reparented to [param node]. - */ - readonly replacing_by: Signal1 - - /** Emitted when the node's editor description field changed. */ - readonly editor_description_changed: Signal1 - } } diff --git a/typings/godot4.gen.d.ts b/typings/godot4.gen.d.ts index 447fc0f..dc249fd 100644 --- a/typings/godot4.gen.d.ts +++ b/typings/godot4.gen.d.ts @@ -1,11 +1,7029 @@ // AUTO-GENERATED /// declare module "godot" { - /** A 2D game object, inherited by all 2D-related nodes. Has a position, rotation, scale, and Z index. + /** Represents a gamepad button being pressed or released. * - * @link https://docs.godotengine.org/en/4.3/classes/class_node2d.html + * @link https://docs.godotengine.org/en/4.4/classes/class_inputeventjoypadbutton.html */ - class Node2D extends CanvasItem { + class InputEventJoypadButton extends InputEvent { + constructor(identifier?: any) + /** Button identifier. One of the [enum JoyButton] button constants. */ + get button_index(): int64 + set button_index(value: int64) + get pressure(): float64 + set pressure(value: float64) + + /** If `true`, the button's state is pressed. If `false`, the button's state is released. */ + get pressed(): boolean + set pressed(value: boolean) + } + /** Represents axis motions (such as joystick or analog triggers) from a gamepad. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_inputeventjoypadmotion.html + */ + class InputEventJoypadMotion extends InputEvent { + constructor(identifier?: any) + /** Axis identifier. Use one of the [enum JoyAxis] axis constants. */ + get axis(): int64 + set axis(value: int64) + + /** Current position of the joystick on the given axis. The value ranges from `-1.0` to `1.0`. A value of `0` means the axis is in its resting position. */ + get axis_value(): float64 + set axis_value(value: float64) + } + /** Represents a key on a keyboard being pressed or released. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_inputeventkey.html + */ + class InputEventKey extends InputEventWithModifiers { + constructor(identifier?: any) + /** Returns the Latin keycode combined with modifier keys such as [kbd]Shift[/kbd] or [kbd]Alt[/kbd]. See also [InputEventWithModifiers]. + * To get a human-readable representation of the [InputEventKey] with modifiers, use `OS.get_keycode_string(event.get_keycode_with_modifiers())` where `event` is the [InputEventKey]. + */ + get_keycode_with_modifiers(): Key + + /** Returns the physical keycode combined with modifier keys such as [kbd]Shift[/kbd] or [kbd]Alt[/kbd]. See also [InputEventWithModifiers]. + * To get a human-readable representation of the [InputEventKey] with modifiers, use `OS.get_keycode_string(event.get_physical_keycode_with_modifiers())` where `event` is the [InputEventKey]. + */ + get_physical_keycode_with_modifiers(): Key + + /** Returns the localized key label combined with modifier keys such as [kbd]Shift[/kbd] or [kbd]Alt[/kbd]. See also [InputEventWithModifiers]. + * To get a human-readable representation of the [InputEventKey] with modifiers, use `OS.get_keycode_string(event.get_key_label_with_modifiers())` where `event` is the [InputEventKey]. + */ + get_key_label_with_modifiers(): Key + + /** Returns a [String] representation of the event's [member keycode] and modifiers. */ + as_text_keycode(): string + + /** Returns a [String] representation of the event's [member physical_keycode] and modifiers. */ + as_text_physical_keycode(): string + + /** Returns a [String] representation of the event's [member key_label] and modifiers. */ + as_text_key_label(): string + + /** Returns a [String] representation of the event's [member location]. This will be a blank string if the event is not specific to a location. */ + as_text_location(): string + + /** If `true`, the key's state is pressed. If `false`, the key's state is released. */ + get pressed(): boolean + set pressed(value: boolean) + + /** Latin label printed on the key in the current keyboard layout, which corresponds to one of the [enum Key] constants. + * To get a human-readable representation of the [InputEventKey], use `OS.get_keycode_string(event.keycode)` where `event` is the [InputEventKey]. + * [codeblock lang=text] + * +-----+ +-----+ + * | Q | | Q | - "Q" - keycode + * | Й | | ض | - "Й" and "ض" - key_label + * +-----+ +-----+ + * [/codeblock] + */ + get keycode(): int64 + set keycode(value: int64) + + /** Represents the physical location of a key on the 101/102-key US QWERTY keyboard, which corresponds to one of the [enum Key] constants. + * To get a human-readable representation of the [InputEventKey], use [method OS.get_keycode_string] in combination with [method DisplayServer.keyboard_get_keycode_from_physical]: + * + */ + get physical_keycode(): int64 + set physical_keycode(value: int64) + + /** Represents the localized label printed on the key in the current keyboard layout, which corresponds to one of the [enum Key] constants or any valid Unicode character. + * For keyboard layouts with a single label on the key, it is equivalent to [member keycode]. + * To get a human-readable representation of the [InputEventKey], use `OS.get_keycode_string(event.key_label)` where `event` is the [InputEventKey]. + * [codeblock lang=text] + * +-----+ +-----+ + * | Q | | Q | - "Q" - keycode + * | Й | | ض | - "Й" and "ض" - key_label + * +-----+ +-----+ + * [/codeblock] + */ + get key_label(): int64 + set key_label(value: int64) + + /** The key Unicode character code (when relevant), shifted by modifier keys. Unicode character codes for composite characters and complex scripts may not be available unless IME input mode is active. See [method Window.set_ime_active] for more information. */ + get unicode(): int64 + set unicode(value: int64) + + /** Represents the location of a key which has both left and right versions, such as [kbd]Shift[/kbd] or [kbd]Alt[/kbd]. */ + get location(): int64 + set location(value: int64) + + /** If `true`, the key was already pressed before this event. An echo event is a repeated key event sent when the user is holding down the key. + * + * **Note:** The rate at which echo events are sent is typically around 20 events per second (after holding down the key for roughly half a second). However, the key repeat delay/speed can be changed by the user or disabled entirely in the operating system settings. To ensure your project works correctly on all configurations, do not assume the user has a specific key repeat configuration in your project's behavior. + */ + get echo(): boolean + set echo(value: boolean) + } + /** Represents a MIDI message from a MIDI device, such as a musical keyboard. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_inputeventmidi.html + */ + class InputEventMIDI extends InputEvent { + constructor(identifier?: any) + /** The MIDI channel of this message, ranging from `0` to `15`. MIDI channel `9` is reserved for percussion instruments. */ + get channel(): int64 + set channel(value: int64) + + /** Represents the type of MIDI message (see the [enum MIDIMessage] enum). + * For more information, see the [url=https://www.midi.org/specifications-old/item/table-2-expanded-messages-list-status-bytes]MIDI message status byte list chart[/url]. + */ + get message(): int64 + set message(value: int64) + + /** The pitch index number of this MIDI message. This value ranges from `0` to `127`. + * On a piano, the **middle C** is `60`, followed by a **C-sharp** (`61`), then a **D** (`62`), and so on. Each octave is split in offsets of 12. See the "MIDI note number" column of the [url=https://en.wikipedia.org/wiki/Piano_key_frequencies]piano key frequency chart[/url] a full list. + */ + get pitch(): int64 + set pitch(value: int64) + + /** The velocity of the MIDI message. This value ranges from `0` to `127`. For a musical keyboard, this corresponds to how quickly the key was pressed, and is rarely above `110` in practice. + * + * **Note:** Some MIDI devices may send a [constant MIDI_MESSAGE_NOTE_ON] message with `0` velocity and expect it to be treated the same as a [constant MIDI_MESSAGE_NOTE_OFF] message. If necessary, this can be handled with a few lines of code: + * + */ + get velocity(): int64 + set velocity(value: int64) + + /** The instrument (also called *program* or *preset* ) used on this MIDI message. This value ranges from `0` to `127`. + * To see what each value means, refer to the [url=https://en.wikipedia.org/wiki/General_MIDI#Program_change_events]General MIDI's instrument list[/url]. Keep in mind that the list is off by 1 because it does not begin from 0. A value of `0` corresponds to the acoustic grand piano. + */ + get instrument(): int64 + set instrument(value: int64) + + /** The strength of the key being pressed. This value ranges from `0` to `127`. + * + * **Note:** For many devices, this value is always `0`. Other devices such as musical keyboards may simulate pressure by changing the [member velocity], instead. + */ + get pressure(): int64 + set pressure(value: int64) + + /** The unique number of the controller, if [member message] is [constant MIDI_MESSAGE_CONTROL_CHANGE], otherwise this is `0`. This value can be used to identify sliders for volume, balance, and panning, as well as switches and pedals on the MIDI device. See the [url=https://en.wikipedia.org/wiki/General_MIDI#Controller_events]General MIDI specification[/url] for a small list. */ + get controller_number(): int64 + set controller_number(value: int64) + + /** The value applied to the controller. If [member message] is [constant MIDI_MESSAGE_CONTROL_CHANGE], this value ranges from `0` to `127`, otherwise it is `0`. See also [member controller_value]. */ + get controller_value(): int64 + set controller_value(value: int64) + } + /** Represents a magnifying touch gesture. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_inputeventmagnifygesture.html + */ + class InputEventMagnifyGesture extends InputEventGesture { + constructor(identifier?: any) + /** The amount (or delta) of the event. This value is closer to `1.0` the slower the gesture is performed. */ + get factor(): float64 + set factor(value: float64) + } + /** Base input event type for mouse events. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_inputeventmouse.html + */ + class InputEventMouse extends InputEventWithModifiers { + constructor(identifier?: any) + /** The mouse button mask identifier, one of or a bitwise combination of the [enum MouseButton] button masks. */ + get button_mask(): int64 + set button_mask(value: int64) + + /** When received in [method Node._input] or [method Node._unhandled_input], returns the mouse's position in the [Viewport] this [Node] is in using the coordinate system of this [Viewport]. + * When received in [method Control._gui_input], returns the mouse's position in the [Control] using the local coordinate system of the [Control]. + */ + get position(): Vector2 + set position(value: Vector2) + + /** When received in [method Node._input] or [method Node._unhandled_input], returns the mouse's position in the root [Viewport] using the coordinate system of the root [Viewport]. + * When received in [method Control._gui_input], returns the mouse's position in the [CanvasLayer] that the [Control] is in using the coordinate system of the [CanvasLayer]. + */ + get global_position(): Vector2 + set global_position(value: Vector2) + } + /** Represents a mouse button being pressed or released. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_inputeventmousebutton.html + */ + class InputEventMouseButton extends InputEventMouse { + constructor(identifier?: any) + /** The amount (or delta) of the event. When used for high-precision scroll events, this indicates the scroll amount (vertical or horizontal). This is only supported on some platforms; the reported sensitivity varies depending on the platform. May be `0` if not supported. */ + get factor(): float64 + set factor(value: float64) + + /** The mouse button identifier, one of the [enum MouseButton] button or button wheel constants. */ + get button_index(): int64 + set button_index(value: int64) + + /** If `true`, the mouse button event has been canceled. */ + get canceled(): boolean + set canceled(value: boolean) + + /** If `true`, the mouse button's state is pressed. If `false`, the mouse button's state is released. */ + get pressed(): boolean + set pressed(value: boolean) + + /** If `true`, the mouse button's state is a double-click. */ + get double_click(): boolean + set double_click(value: boolean) + } + /** Represents a mouse or a pen movement. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_inputeventmousemotion.html + */ + class InputEventMouseMotion extends InputEventMouse { + constructor(identifier?: any) + /** Represents the angles of tilt of the pen. Positive X-coordinate value indicates a tilt to the right. Positive Y-coordinate value indicates a tilt toward the user. Ranges from `-1.0` to `1.0` for both axes. */ + get tilt(): Vector2 + set tilt(value: Vector2) + + /** Represents the pressure the user puts on the pen. Ranges from `0.0` to `1.0`. */ + get pressure(): float64 + set pressure(value: float64) + + /** Returns `true` when using the eraser end of a stylus pen. + * + * **Note:** This property is implemented on Linux, macOS and Windows. + */ + get pen_inverted(): boolean + set pen_inverted(value: boolean) + + /** The mouse position relative to the previous position (position at the last frame). + * + * **Note:** Since [InputEventMouseMotion] may only be emitted when the mouse moves, it is not possible to reliably detect when the mouse has stopped moving by checking this property. A separate, short timer may be necessary. + * + * **Note:** [member relative] is automatically scaled according to the content scale factor, which is defined by the project's stretch mode settings. This means mouse sensitivity will appear different depending on resolution when using [member relative] in a script that handles mouse aiming with the [constant Input.MOUSE_MODE_CAPTURED] mouse mode. To avoid this, use [member screen_relative] instead. + */ + get relative(): Vector2 + set relative(value: Vector2) + + /** The unscaled mouse position relative to the previous position in the coordinate system of the screen (position at the last frame). + * + * **Note:** Since [InputEventMouseMotion] may only be emitted when the mouse moves, it is not possible to reliably detect when the mouse has stopped moving by checking this property. A separate, short timer may be necessary. + * + * **Note:** This coordinate is *not* scaled according to the content scale factor or calls to [method InputEvent.xformed_by]. This should be preferred over [member relative] for mouse aiming when using the [constant Input.MOUSE_MODE_CAPTURED] mouse mode, regardless of the project's stretch mode. + */ + get screen_relative(): Vector2 + set screen_relative(value: Vector2) + + /** The mouse velocity in pixels per second. + * + * **Note:** [member velocity] is automatically scaled according to the content scale factor, which is defined by the project's stretch mode settings. This means mouse sensitivity will appear different depending on resolution when using [member velocity] in a script that handles mouse aiming with the [constant Input.MOUSE_MODE_CAPTURED] mouse mode. To avoid this, use [member screen_velocity] instead. + */ + get velocity(): Vector2 + set velocity(value: Vector2) + + /** The unscaled mouse velocity in pixels per second in screen coordinates. This velocity is *not* scaled according to the content scale factor or calls to [method InputEvent.xformed_by]. This should be preferred over [member velocity] for mouse aiming when using the [constant Input.MOUSE_MODE_CAPTURED] mouse mode, regardless of the project's stretch mode. */ + get screen_velocity(): Vector2 + set screen_velocity(value: Vector2) + } + /** Represents a panning touch gesture. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_inputeventpangesture.html + */ + class InputEventPanGesture extends InputEventGesture { + constructor(identifier?: any) + /** Panning amount since last pan event. */ + get delta(): Vector2 + set delta(value: Vector2) + } + /** Represents a screen drag event. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_inputeventscreendrag.html + */ + class InputEventScreenDrag extends InputEventFromWindow { + constructor(identifier?: any) + /** The drag event index in the case of a multi-drag event. */ + get index(): int64 + set index(value: int64) + + /** Represents the angles of tilt of the pen. Positive X-coordinate value indicates a tilt to the right. Positive Y-coordinate value indicates a tilt toward the user. Ranges from `-1.0` to `1.0` for both axes. */ + get tilt(): Vector2 + set tilt(value: Vector2) + + /** Represents the pressure the user puts on the pen. Ranges from `0.0` to `1.0`. */ + get pressure(): float64 + set pressure(value: float64) + + /** Returns `true` when using the eraser end of a stylus pen. */ + get pen_inverted(): boolean + set pen_inverted(value: boolean) + + /** The drag position in the viewport the node is in, using the coordinate system of this viewport. */ + get position(): Vector2 + set position(value: Vector2) + + /** The drag position relative to the previous position (position at the last frame). + * + * **Note:** [member relative] is automatically scaled according to the content scale factor, which is defined by the project's stretch mode settings. This means touch sensitivity will appear different depending on resolution when using [member relative] in a script that handles touch aiming. To avoid this, use [member screen_relative] instead. + */ + get relative(): Vector2 + set relative(value: Vector2) + + /** The unscaled drag position relative to the previous position in screen coordinates (position at the last frame). This position is *not* scaled according to the content scale factor or calls to [method InputEvent.xformed_by]. This should be preferred over [member relative] for touch aiming regardless of the project's stretch mode. */ + get screen_relative(): Vector2 + set screen_relative(value: Vector2) + + /** The drag velocity. + * + * **Note:** [member velocity] is automatically scaled according to the content scale factor, which is defined by the project's stretch mode settings. This means touch sensitivity will appear different depending on resolution when using [member velocity] in a script that handles touch aiming. To avoid this, use [member screen_velocity] instead. + */ + get velocity(): Vector2 + set velocity(value: Vector2) + + /** The unscaled drag velocity in pixels per second in screen coordinates. This velocity is *not* scaled according to the content scale factor or calls to [method InputEvent.xformed_by]. This should be preferred over [member velocity] for touch aiming regardless of the project's stretch mode. */ + get screen_velocity(): Vector2 + set screen_velocity(value: Vector2) + } + /** Represents a screen touch event. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_inputeventscreentouch.html + */ + class InputEventScreenTouch extends InputEventFromWindow { + constructor(identifier?: any) + /** The touch index in the case of a multi-touch event. One index = one finger. */ + get index(): int64 + set index(value: int64) + + /** The touch position in the viewport the node is in, using the coordinate system of this viewport. */ + get position(): Vector2 + set position(value: Vector2) + + /** If `true`, the touch event has been canceled. */ + get canceled(): boolean + set canceled(value: boolean) + + /** If `true`, the touch's state is pressed. If `false`, the touch's state is released. */ + get pressed(): boolean + set pressed(value: boolean) + + /** If `true`, the touch's state is a double tap. */ + get double_tap(): boolean + set double_tap(value: boolean) + } + /** Represents a triggered keyboard [Shortcut]. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_inputeventshortcut.html + */ + class InputEventShortcut extends InputEvent { + constructor(identifier?: any) + /** The [Shortcut] represented by this event. Its [method Shortcut.matches_event] method will always return `true` for this event. */ + get shortcut(): Shortcut + set shortcut(value: Shortcut) + } + /** Abstract base class for input events affected by modifier keys like [kbd]Shift[/kbd] and [kbd]Alt[/kbd]. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_inputeventwithmodifiers.html + */ + class InputEventWithModifiers extends InputEventFromWindow { + constructor(identifier?: any) + /** On macOS, returns `true` if [kbd]Meta[/kbd] ([kbd]Cmd[/kbd]) is pressed. + * On other platforms, returns `true` if [kbd]Ctrl[/kbd] is pressed. + */ + is_command_or_control_pressed(): boolean + + /** Returns the keycode combination of modifier keys. */ + get_modifiers_mask(): KeyModifierMask + + /** Automatically use [kbd]Meta[/kbd] ([kbd]Cmd[/kbd]) on macOS and [kbd]Ctrl[/kbd] on other platforms. If `true`, [member ctrl_pressed] and [member meta_pressed] cannot be set. */ + get command_or_control_autoremap(): boolean + set command_or_control_autoremap(value: boolean) + + /** State of the [kbd]Alt[/kbd] modifier. */ + get alt_pressed(): boolean + set alt_pressed(value: boolean) + + /** State of the [kbd]Shift[/kbd] modifier. */ + get shift_pressed(): boolean + set shift_pressed(value: boolean) + + /** State of the [kbd]Ctrl[/kbd] modifier. */ + get ctrl_pressed(): boolean + set ctrl_pressed(value: boolean) + + /** State of the [kbd]Meta[/kbd] modifier. On Windows and Linux, this represents the Windows key (sometimes called "meta" or "super" on Linux). On macOS, this represents the Command key. */ + get meta_pressed(): boolean + set meta_pressed(value: boolean) + } + class InspectorDock = Record> extends VBoxContainer { + constructor(identifier?: any) + store_script_properties(_unnamed_arg0: Object): void + apply_script_properties(_unnamed_arg0: Object): void + readonly request_help: Signal0 + } + class InstallGodotJSPresetConfirmationDialog = Record> extends ConfirmationDialog { + constructor(identifier?: any) + } + /** Placeholder for the root [Node] of a [PackedScene]. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_instanceplaceholder.html + */ + class InstancePlaceholder = Record> extends Node { + constructor(identifier?: any) + /** Returns the list of properties that will be applied to the node when [method create_instance] is called. + * If [param with_order] is `true`, a key named `.order` (note the leading period) is added to the dictionary. This `.order` key is an [Array] of [String] property names specifying the order in which properties will be applied (with index 0 being the first). + */ + get_stored_values(with_order: boolean = false): GDictionary + + /** Call this method to actually load in the node. The created node will be placed as a sibling *above* the [InstancePlaceholder] in the scene tree. The [Node]'s reference is also returned for convenience. + * + * **Note:** [method create_instance] is not thread-safe. Use [method Object.call_deferred] if calling from a thread. + */ + create_instance(replace: boolean = false, custom_scene: PackedScene = undefined): Node + + /** Gets the path to the [PackedScene] resource file that is loaded by default when calling [method create_instance]. Not thread-safe. Use [method Object.call_deferred] if calling from a thread. */ + get_instance_path(): string + } + /** Creates an idle interval in a [Tween] animation. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_intervaltweener.html + */ + class IntervalTweener extends Tweener { + constructor(identifier?: any) + } + namespace ItemList { + enum IconMode { + /** Icon is drawn above the text. */ + ICON_MODE_TOP = 0, + + /** Icon is drawn to the left of the text. */ + ICON_MODE_LEFT = 1, + } + enum SelectMode { + /** Only allow selecting a single item. */ + SELECT_SINGLE = 0, + + /** Allows selecting multiple items by holding [kbd]Ctrl[/kbd] or [kbd]Shift[/kbd]. */ + SELECT_MULTI = 1, + + /** Allows selecting multiple items by toggling them on and off. */ + SELECT_TOGGLE = 2, + } + } + /** A vertical list of selectable items with one or multiple columns. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_itemlist.html + */ + class ItemList = Record> extends Control { + constructor(identifier?: any) + /** Adds an item to the item list with specified text. Returns the index of an added item. + * Specify an [param icon], or use `null` as the [param icon] for a list item with no icon. + * If [param selectable] is `true`, the list item will be selectable. + */ + add_item(text: string, icon: Texture2D = undefined, selectable: boolean = true): int64 + + /** Adds an item to the item list with no text, only an icon. Returns the index of an added item. */ + add_icon_item(icon: Texture2D, selectable: boolean = true): int64 + + /** Sets text of the item associated with the specified index. */ + set_item_text(idx: int64, text: string): void + + /** Returns the text associated with the specified index. */ + get_item_text(idx: int64): string + + /** Sets (or replaces) the icon's [Texture2D] associated with the specified index. */ + set_item_icon(idx: int64, icon: Texture2D): void + + /** Returns the icon associated with the specified index. */ + get_item_icon(idx: int64): Texture2D + + /** Sets item's text base writing direction. */ + set_item_text_direction(idx: int64, direction: Control.TextDirection): void + + /** Returns item's text base writing direction. */ + get_item_text_direction(idx: int64): Control.TextDirection + + /** Sets language code of item's text used for line-breaking and text shaping algorithms, if left empty current locale is used instead. */ + set_item_language(idx: int64, language: string): void + + /** Returns item's text language code. */ + get_item_language(idx: int64): string + + /** Sets the auto translate mode of the item associated with the specified index. + * Items use [constant Node.AUTO_TRANSLATE_MODE_INHERIT] by default, which uses the same auto translate mode as the [ItemList] itself. + */ + set_item_auto_translate_mode(idx: int64, mode: Node.AutoTranslateMode): void + + /** Returns item's auto translate mode. */ + get_item_auto_translate_mode(idx: int64): Node.AutoTranslateMode + + /** Sets whether the item icon will be drawn transposed. */ + set_item_icon_transposed(idx: int64, transposed: boolean): void + + /** Returns `true` if the item icon will be drawn transposed, i.e. the X and Y axes are swapped. */ + is_item_icon_transposed(idx: int64): boolean + + /** Sets the region of item's icon used. The whole icon will be used if the region has no area. */ + set_item_icon_region(idx: int64, rect: Rect2): void + + /** Returns the region of item's icon used. The whole icon will be used if the region has no area. */ + get_item_icon_region(idx: int64): Rect2 + + /** Sets a modulating [Color] of the item associated with the specified index. */ + set_item_icon_modulate(idx: int64, modulate: Color): void + + /** Returns a [Color] modulating item's icon at the specified index. */ + get_item_icon_modulate(idx: int64): Color + + /** Allows or disallows selection of the item associated with the specified index. */ + set_item_selectable(idx: int64, selectable: boolean): void + + /** Returns `true` if the item at the specified index is selectable. */ + is_item_selectable(idx: int64): boolean + + /** Disables (or enables) the item at the specified index. + * Disabled items cannot be selected and do not trigger activation signals (when double-clicking or pressing [kbd]Enter[/kbd]). + */ + set_item_disabled(idx: int64, disabled: boolean): void + + /** Returns `true` if the item at the specified index is disabled. */ + is_item_disabled(idx: int64): boolean + + /** Sets a value (of any type) to be stored with the item associated with the specified index. */ + set_item_metadata(idx: int64, metadata: any): void + + /** Returns the metadata value of the specified index. */ + get_item_metadata(idx: int64): any + + /** Sets the background color of the item specified by [param idx] index to the specified [Color]. */ + set_item_custom_bg_color(idx: int64, custom_bg_color: Color): void + + /** Returns the custom background color of the item specified by [param idx] index. */ + get_item_custom_bg_color(idx: int64): Color + + /** Sets the foreground color of the item specified by [param idx] index to the specified [Color]. */ + set_item_custom_fg_color(idx: int64, custom_fg_color: Color): void + + /** Returns the custom foreground color of the item specified by [param idx] index. */ + get_item_custom_fg_color(idx: int64): Color + + /** Returns the position and size of the item with the specified index, in the coordinate system of the [ItemList] node. If [param expand] is `true` the last column expands to fill the rest of the row. + * + * **Note:** The returned value is unreliable if called right after modifying the [ItemList], before it redraws in the next frame. + */ + get_item_rect(idx: int64, expand: boolean = true): Rect2 + + /** Sets whether the tooltip hint is enabled for specified item index. */ + set_item_tooltip_enabled(idx: int64, enable: boolean): void + + /** Returns `true` if the tooltip is enabled for specified item index. */ + is_item_tooltip_enabled(idx: int64): boolean + + /** Sets the tooltip hint for the item associated with the specified index. */ + set_item_tooltip(idx: int64, tooltip: string): void + + /** Returns the tooltip hint associated with the specified index. */ + get_item_tooltip(idx: int64): string + + /** Select the item at the specified index. + * + * **Note:** This method does not trigger the item selection signal. + */ + select(idx: int64, single: boolean = true): void + + /** Ensures the item associated with the specified index is not selected. */ + deselect(idx: int64): void + + /** Ensures there are no items selected. */ + deselect_all(): void + + /** Returns `true` if the item at the specified index is currently selected. */ + is_selected(idx: int64): boolean + + /** Returns an array with the indexes of the selected items. */ + get_selected_items(): PackedInt32Array + + /** Moves item from index [param from_idx] to [param to_idx]. */ + move_item(from_idx: int64, to_idx: int64): void + + /** Removes the item specified by [param idx] index from the list. */ + remove_item(idx: int64): void + + /** Removes all items from the list. */ + clear(): void + + /** Sorts items in the list by their text. */ + sort_items_by_text(): void + + /** Returns `true` if one or more items are selected. */ + is_anything_selected(): boolean + + /** Returns the item index at the given [param position]. + * When there is no item at that point, -1 will be returned if [param exact] is `true`, and the closest item index will be returned otherwise. + * + * **Note:** The returned value is unreliable if called right after modifying the [ItemList], before it redraws in the next frame. + */ + get_item_at_position(position: Vector2, exact: boolean = false): int64 + + /** Ensure current selection is visible, adjusting the scroll position as necessary. */ + ensure_current_is_visible(): void + + /** Returns the vertical scrollbar. + * **Warning:** This is a required internal node, removing and freeing it may cause a crash. If you wish to hide it or any of its children, use their [member CanvasItem.visible] property. + */ + get_v_scroll_bar(): VScrollBar + + /** Returns the horizontal scrollbar. + * **Warning:** This is a required internal node, removing and freeing it may cause a crash. If you wish to hide it or any of its children, use their [member CanvasItem.visible] property. + */ + get_h_scroll_bar(): HScrollBar + + /** Forces an update to the list size based on its items. This happens automatically whenever size of the items, or other relevant settings like [member auto_height], change. The method can be used to trigger the update ahead of next drawing pass. */ + force_update_list_size(): void + + /** Allows single or multiple item selection. See the [enum SelectMode] constants. */ + get select_mode(): int64 + set select_mode(value: int64) + + /** If `true`, the currently selected item can be selected again. */ + get allow_reselect(): boolean + set allow_reselect(value: boolean) + + /** If `true`, right mouse button click can select items. */ + get allow_rmb_select(): boolean + set allow_rmb_select(value: boolean) + + /** If `true`, allows navigating the [ItemList] with letter keys through incremental search. */ + get allow_search(): boolean + set allow_search(value: boolean) + + /** Maximum lines of text allowed in each item. Space will be reserved even when there is not enough lines of text to display. + * + * **Note:** This property takes effect only when [member icon_mode] is [constant ICON_MODE_TOP]. To make the text wrap, [member fixed_column_width] should be greater than zero. + */ + get max_text_lines(): int64 + set max_text_lines(value: int64) + + /** If `true`, the control will automatically resize the width to fit its content. */ + get auto_width(): boolean + set auto_width(value: boolean) + + /** If `true`, the control will automatically resize the height to fit its content. */ + get auto_height(): boolean + set auto_height(value: boolean) + + /** Sets the clipping behavior when the text exceeds an item's bounding rectangle. See [enum TextServer.OverrunBehavior] for a description of all modes. */ + get text_overrun_behavior(): int64 + set text_overrun_behavior(value: int64) + + /** If `true`, the control will automatically move items into a new row to fit its content. See also [HFlowContainer] for this behavior. + * If `false`, the control will add a horizontal scrollbar to make all items visible. + */ + get wraparound_items(): boolean + set wraparound_items(value: boolean) + + /** The number of items currently in the list. */ + get item_count(): any /*Items,item_*/ + set item_count(value: any /*Items,item_*/) + + /** Maximum columns the list will have. + * If greater than zero, the content will be split among the specified columns. + * A value of zero means unlimited columns, i.e. all items will be put in the same row. + */ + get max_columns(): int64 + set max_columns(value: int64) + + /** Whether all columns will have the same width. + * If `true`, the width is equal to the largest column width of all columns. + */ + get same_column_width(): boolean + set same_column_width(value: boolean) + + /** The width all columns will be adjusted to. + * A value of zero disables the adjustment, each item will have a width equal to the width of its content and the columns will have an uneven width. + */ + get fixed_column_width(): int64 + set fixed_column_width(value: int64) + + /** The icon position, whether above or to the left of the text. See the [enum IconMode] constants. */ + get icon_mode(): int64 + set icon_mode(value: int64) + + /** The scale of icon applied after [member fixed_icon_size] and transposing takes effect. */ + get icon_scale(): float64 + set icon_scale(value: float64) + + /** The size all icons will be adjusted to. + * If either X or Y component is not greater than zero, icon size won't be affected. + */ + get fixed_icon_size(): Vector2i + set fixed_icon_size(value: Vector2i) + + /** Emitted when specified item has been selected. Only applicable in single selection mode. + * [member allow_reselect] must be enabled to reselect an item. + */ + readonly item_selected: Signal1 + + /** Emitted when any mouse click is issued within the rect of the list but on empty space. + * [param at_position] is the click position in this control's local coordinate system. + */ + readonly empty_clicked: Signal2 + + /** Emitted when specified list item has been clicked with any mouse button. + * [param at_position] is the click position in this control's local coordinate system. + */ + readonly item_clicked: Signal3 + + /** Emitted when a multiple selection is altered on a list allowing multiple selection. */ + readonly multi_selected: Signal2 + + /** Emitted when specified list item is activated via double-clicking or by pressing [kbd]Enter[/kbd]. */ + readonly item_activated: Signal1 + } + /** Singleton that connects the engine with Android plugins to interface with native Android code. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_jnisingleton.html + */ + class JNISingleton extends Object { + constructor(identifier?: any) + } + /** Helper class for creating and parsing JSON data. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_json.html + */ + class JSON extends Resource { + constructor(identifier?: any) + /** Converts a [Variant] var to JSON text and returns the result. Useful for serializing data to store or send over the network. + * + * **Note:** The JSON specification does not define integer or float types, but only a *number* type. Therefore, converting a Variant to JSON text will convert all numerical values to [float] types. + * + * **Note:** If [param full_precision] is `true`, when stringifying floats, the unreliable digits are stringified in addition to the reliable digits to guarantee exact decoding. + * The [param indent] parameter controls if and how something is indented; its contents will be used where there should be an indent in the output. Even spaces like `" "` will work. `\t` and `\n` can also be used for a tab indent, or to make a newline for each indent respectively. + * **Example output:** + * + */ + static stringify(data: any, indent: string = '', sort_keys: boolean = true, full_precision: boolean = false): string + + /** Attempts to parse the [param json_string] provided and returns the parsed data. Returns `null` if parse failed. */ + static parse_string(json_string: string): any + + /** Attempts to parse the [param json_text] provided. + * Returns an [enum Error]. If the parse was successful, it returns [constant OK] and the result can be retrieved using [member data]. If unsuccessful, use [method get_error_line] and [method get_error_message] to identify the source of the failure. + * Non-static variant of [method parse_string], if you want custom error handling. + * The optional [param keep_text] argument instructs the parser to keep a copy of the original text. This text can be obtained later by using the [method get_parsed_text] function and is used when saving the resource (instead of generating new text from [member data]). + */ + parse(json_text: string, keep_text: boolean = false): GError + + /** Return the text parsed by [method parse] (requires passing `keep_text` to [method parse]). */ + get_parsed_text(): string + + /** Returns `0` if the last call to [method parse] was successful, or the line number where the parse failed. */ + get_error_line(): int64 + + /** Returns an empty string if the last call to [method parse] was successful, or the error message if it failed. */ + get_error_message(): string + + /** Converts a native engine type to a JSON-compliant value. + * By default, objects are ignored for security reasons, unless [param full_objects] is `true`. + * You can convert a native value to a JSON string like this: + * + */ + static from_native(variant: any, full_objects: boolean = false): any + + /** Converts a JSON-compliant value that was created with [method from_native] back to native engine types. + * By default, objects are ignored for security reasons, unless [param allow_objects] is `true`. + * You can convert a JSON string back to a native value like this: + * + */ + static to_native(json: any, allow_objects: boolean = false): any + + /** Contains the parsed JSON data in [Variant] form. */ + get data(): any + set data(value: any) + } + namespace JSONRPC { + enum ErrorCode { + /** The request could not be parsed as it was not valid by JSON standard ([method JSON.parse] failed). */ + PARSE_ERROR = -32700, + + /** A method call was requested but the request's format is not valid. */ + INVALID_REQUEST = -32600, + + /** A method call was requested but no function of that name existed in the JSONRPC subclass. */ + METHOD_NOT_FOUND = -32601, + + /** A method call was requested but the given method parameters are not valid. Not used by the built-in JSONRPC. */ + INVALID_PARAMS = -32602, + + /** An internal error occurred while processing the request. Not used by the built-in JSONRPC. */ + INTERNAL_ERROR = -32603, + } + } + /** A helper to handle dictionaries which look like JSONRPC documents. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_jsonrpc.html + */ + class JSONRPC extends Object { + constructor(identifier?: any) + set_scope(scope: string, target: Object): void + + /** Given a Dictionary which takes the form of a JSON-RPC request: unpack the request and run it. Methods are resolved by looking at the field called "method" and looking for an equivalently named function in the JSONRPC object. If one is found that method is called. + * To add new supported methods extend the JSONRPC class and call [method process_action] on your subclass. + * [param action]: The action to be run, as a Dictionary in the form of a JSON-RPC request or notification. + */ + process_action(action: any, recurse: boolean = false): any + process_string(action: string): string + + /** Returns a dictionary in the form of a JSON-RPC request. Requests are sent to a server with the expectation of a response. The ID field is used for the server to specify which exact request it is responding to. + * - [param method]: Name of the method being called. + * - [param params]: An array or dictionary of parameters being passed to the method. + * - [param id]: Uniquely identifies this request. The server is expected to send a response with the same ID. + */ + make_request(method: string, params: any, id: any): GDictionary + + /** When a server has received and processed a request, it is expected to send a response. If you did not want a response then you need to have sent a Notification instead. + * - [param result]: The return value of the function which was called. + * - [param id]: The ID of the request this response is targeted to. + */ + make_response(result: any, id: any): GDictionary + + /** Returns a dictionary in the form of a JSON-RPC notification. Notifications are one-shot messages which do not expect a response. + * - [param method]: Name of the method being called. + * - [param params]: An array or dictionary of parameters being passed to the method. + */ + make_notification(method: string, params: any): GDictionary + + /** Creates a response which indicates a previous reply has failed in some way. + * - [param code]: The error code corresponding to what kind of error this is. See the [enum ErrorCode] constants. + * - [param message]: A custom message about this error. + * - [param id]: The request this error is a response to. + */ + make_response_error(code: int64, message: string, id: any = {}): GDictionary + } + /** Represents a class from the Java Native Interface. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_javaclass.html + */ + class JavaClass extends RefCounted { + constructor(identifier?: any) + /** Returns the Java class name. */ + get_java_class_name(): string + + /** Returns the object's Java methods and their signatures as an [Array] of dictionaries, in the same format as [method Object.get_method_list]. */ + get_java_method_list(): GArray + + /** Returns a [JavaClass] representing the Java parent class of this class. */ + get_java_parent_class(): JavaClass + } + /** Represents an object from the Java Native Interface. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_javaobject.html + */ + class JavaObject extends RefCounted { + constructor(identifier?: any) + /** Returns the [JavaClass] that this object is an instance of. */ + get_java_class(): JavaClass + } + /** A wrapper class for web native JavaScript objects. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_javascriptobject.html + */ + class JavaScriptObject extends RefCounted { + constructor(identifier?: any) + } + /** Abstract base class for all 2D physics joints. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_joint2d.html + */ + class Joint2D = Record> extends Node2D { + constructor(identifier?: any) + /** Returns the joint's internal [RID] from the [PhysicsServer2D]. */ + get_rid(): RID + + /** Path to the first body (A) attached to the joint. The node must inherit [PhysicsBody2D]. */ + get node_a(): NodePath + set node_a(value: NodePath | string) + + /** Path to the second body (B) attached to the joint. The node must inherit [PhysicsBody2D]. */ + get node_b(): NodePath + set node_b(value: NodePath | string) + + /** When [member node_a] and [member node_b] move in different directions the [member bias] controls how fast the joint pulls them back to their original position. The lower the [member bias] the more the two bodies can pull on the joint. + * When set to `0`, the default value from [member ProjectSettings.physics/2d/solver/default_constraint_bias] is used. + */ + get bias(): float64 + set bias(value: float64) + + /** If `true`, the two bodies bound together do not collide with each other. */ + get disable_collision(): boolean + set disable_collision(value: boolean) + } + /** Abstract base class for all 3D physics joints. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_joint3d.html + */ + class Joint3D = Record> extends Node3D { + constructor(identifier?: any) + /** Returns the joint's internal [RID] from the [PhysicsServer3D]. */ + get_rid(): RID + + /** Path to the first node (A) attached to the joint. The node must inherit [PhysicsBody3D]. + * If left empty and [member node_b] is set, the body is attached to a fixed [StaticBody3D] without collision shapes. + */ + get node_a(): NodePath + set node_a(value: NodePath | string) + + /** Path to the second node (B) attached to the joint. The node must inherit [PhysicsBody3D]. + * If left empty and [member node_a] is set, the body is attached to a fixed [StaticBody3D] without collision shapes. + */ + get node_b(): NodePath + set node_b(value: NodePath | string) + + /** The priority used to define which solver is executed first for multiple joints. The lower the value, the higher the priority. */ + get solver_priority(): int64 + set solver_priority(value: int64) + + /** If `true`, the two bodies bound together do not collide with each other. */ + get exclude_nodes_from_collision(): boolean + set exclude_nodes_from_collision(value: boolean) + } + class Joint3DGizmoPlugin extends EditorNode3DGizmoPlugin { + constructor(identifier?: any) + } + /** Holds collision data from the movement of a [PhysicsBody2D]. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_kinematiccollision2d.html + */ + class KinematicCollision2D extends RefCounted { + constructor(identifier?: any) + /** Returns the point of collision in global coordinates. */ + get_position(): Vector2 + + /** Returns the colliding body's shape's normal at the point of collision. */ + get_normal(): Vector2 + + /** Returns the moving object's travel before collision. */ + get_travel(): Vector2 + + /** Returns the moving object's remaining movement vector. */ + get_remainder(): Vector2 + + /** Returns the collision angle according to [param up_direction], which is [constant Vector2.UP] by default. This value is always positive. */ + get_angle(up_direction: Vector2 = new Vector2(0, -1)): float64 + + /** Returns the colliding body's length of overlap along the collision normal. */ + get_depth(): float64 + + /** Returns the moving object's colliding shape. */ + get_local_shape(): Object + + /** Returns the colliding body's attached [Object]. */ + get_collider(): Object + + /** Returns the unique instance ID of the colliding body's attached [Object]. See [method Object.get_instance_id]. */ + get_collider_id(): int64 + + /** Returns the colliding body's [RID] used by the [PhysicsServer2D]. */ + get_collider_rid(): RID + + /** Returns the colliding body's shape. */ + get_collider_shape(): Object + + /** Returns the colliding body's shape index. See [CollisionObject2D]. */ + get_collider_shape_index(): int64 + + /** Returns the colliding body's velocity. */ + get_collider_velocity(): Vector2 + } + /** Holds collision data from the movement of a [PhysicsBody3D]. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_kinematiccollision3d.html + */ + class KinematicCollision3D extends RefCounted { + constructor(identifier?: any) + /** Returns the moving object's travel before collision. */ + get_travel(): Vector3 + + /** Returns the moving object's remaining movement vector. */ + get_remainder(): Vector3 + + /** Returns the colliding body's length of overlap along the collision normal. */ + get_depth(): float64 + + /** Returns the number of detected collisions. */ + get_collision_count(): int64 + + /** Returns the point of collision in global coordinates given a collision index (the deepest collision by default). */ + get_position(collision_index: int64 = 0): Vector3 + + /** Returns the colliding body's shape's normal at the point of collision given a collision index (the deepest collision by default). */ + get_normal(collision_index: int64 = 0): Vector3 + + /** Returns the collision angle according to [param up_direction], which is [constant Vector3.UP] by default. This value is always positive. */ + get_angle(collision_index: int64 = 0, up_direction: Vector3 = Vector3.ZERO): float64 + + /** Returns the moving object's colliding shape given a collision index (the deepest collision by default). */ + get_local_shape(collision_index: int64 = 0): Object + + /** Returns the colliding body's attached [Object] given a collision index (the deepest collision by default). */ + get_collider(collision_index: int64 = 0): Object + + /** Returns the unique instance ID of the colliding body's attached [Object] given a collision index (the deepest collision by default). See [method Object.get_instance_id]. */ + get_collider_id(collision_index: int64 = 0): int64 + + /** Returns the colliding body's [RID] used by the [PhysicsServer3D] given a collision index (the deepest collision by default). */ + get_collider_rid(collision_index: int64 = 0): RID + + /** Returns the colliding body's shape given a collision index (the deepest collision by default). */ + get_collider_shape(collision_index: int64 = 0): Object + + /** Returns the colliding body's shape index given a collision index (the deepest collision by default). See [CollisionObject3D]. */ + get_collider_shape_index(collision_index: int64 = 0): int64 + + /** Returns the colliding body's velocity given a collision index (the deepest collision by default). */ + get_collider_velocity(collision_index: int64 = 0): Vector3 + } + /** A control for displaying plain text. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_label.html + */ + class Label = Record> extends Control { + constructor(identifier?: any) + /** Returns the height of the line [param line]. + * If [param line] is set to `-1`, returns the biggest line height. + * If there are no lines, returns font size in pixels. + */ + get_line_height(line: int64 = -1): int64 + + /** Returns the number of lines of text the Label has. */ + get_line_count(): int64 + + /** Returns the number of lines shown. Useful if the [Label]'s height cannot currently display all lines. */ + get_visible_line_count(): int64 + + /** Returns the total number of printable characters in the text (excluding spaces and newlines). */ + get_total_character_count(): int64 + + /** Returns the bounding rectangle of the character at position [param pos] in the label's local coordinate system. If the character is a non-visual character or [param pos] is outside the valid range, an empty [Rect2] is returned. If the character is a part of a composite grapheme, the bounding rectangle of the whole grapheme is returned. */ + get_character_bounds(pos: int64): Rect2 + + /** The text to display on screen. */ + get text(): string + set text(value: string) + + /** A [LabelSettings] resource that can be shared between multiple [Label] nodes. Takes priority over theme properties. */ + get label_settings(): LabelSettings + set label_settings(value: LabelSettings) + + /** Controls the text's horizontal alignment. Supports left, center, right, and fill, or justify. Set it to one of the [enum HorizontalAlignment] constants. */ + get horizontal_alignment(): int64 + set horizontal_alignment(value: int64) + + /** Controls the text's vertical alignment. Supports top, center, bottom, and fill. Set it to one of the [enum VerticalAlignment] constants. */ + get vertical_alignment(): int64 + set vertical_alignment(value: int64) + + /** If set to something other than [constant TextServer.AUTOWRAP_OFF], the text gets wrapped inside the node's bounding rectangle. If you resize the node, it will change its height automatically to show all the text. To see how each mode behaves, see [enum TextServer.AutowrapMode]. */ + get autowrap_mode(): int64 + set autowrap_mode(value: int64) + + /** Line fill alignment rules. See [enum TextServer.JustificationFlag] for more information. */ + get justification_flags(): int64 + set justification_flags(value: int64) + + /** String used as a paragraph separator. Each paragraph is processed independently, in its own BiDi context. */ + get paragraph_separator(): string + set paragraph_separator(value: string) + + /** If `true`, the Label only shows the text that fits inside its bounding rectangle and will clip text horizontally. */ + get clip_text(): boolean + set clip_text(value: boolean) + + /** Sets the clipping behavior when the text exceeds the node's bounding rectangle. See [enum TextServer.OverrunBehavior] for a description of all modes. */ + get text_overrun_behavior(): int64 + set text_overrun_behavior(value: int64) + + /** Ellipsis character used for text clipping. */ + get ellipsis_char(): string + set ellipsis_char(value: string) + + /** If `true`, all the text displays as UPPERCASE. */ + get uppercase(): boolean + set uppercase(value: boolean) + + /** Aligns text to the given tab-stops. */ + get tab_stops(): PackedFloat32Array + set tab_stops(value: PackedFloat32Array | float32[]) + + /** The number of the lines ignored and not displayed from the start of the [member text] value. */ + get lines_skipped(): int64 + set lines_skipped(value: int64) + + /** Limits the lines of text the node shows on screen. */ + get max_lines_visible(): int64 + set max_lines_visible(value: int64) + + /** The number of characters to display. If set to `-1`, all characters are displayed. This can be useful when animating the text appearing in a dialog box. + * + * **Note:** Setting this property updates [member visible_ratio] accordingly. + */ + get visible_characters(): int64 + set visible_characters(value: int64) + + /** Sets the clipping behavior when [member visible_characters] or [member visible_ratio] is set. See [enum TextServer.VisibleCharactersBehavior] for more info. */ + get visible_characters_behavior(): int64 + set visible_characters_behavior(value: int64) + + /** The fraction of characters to display, relative to the total number of characters (see [method get_total_character_count]). If set to `1.0`, all characters are displayed. If set to `0.5`, only half of the characters will be displayed. This can be useful when animating the text appearing in a dialog box. + * + * **Note:** Setting this property updates [member visible_characters] accordingly. + */ + get visible_ratio(): float64 + set visible_ratio(value: float64) + + /** Base text writing direction. */ + get text_direction(): int64 + set text_direction(value: int64) + + /** Language code used for line-breaking and text shaping algorithms, if left empty current locale is used instead. */ + get language(): string + set language(value: string) + + /** Set BiDi algorithm override for the structured text. */ + get structured_text_bidi_override(): int64 + set structured_text_bidi_override(value: int64) + + /** Set additional options for BiDi override. */ + get structured_text_bidi_override_options(): GArray + set structured_text_bidi_override_options(value: GArray) + } + namespace Label3D { + enum DrawFlags { + /** If set, lights in the environment affect the label. */ + FLAG_SHADED = 0, + + /** If set, text can be seen from the back as well. If not, the text is invisible when looking at it from behind. */ + FLAG_DOUBLE_SIDED = 1, + + /** Disables the depth test, so this object is drawn on top of all others. However, objects drawn after it in the draw order may cover it. */ + FLAG_DISABLE_DEPTH_TEST = 2, + + /** Label is scaled by depth so that it always appears the same size on screen. */ + FLAG_FIXED_SIZE = 3, + + /** Represents the size of the [enum DrawFlags] enum. */ + FLAG_MAX = 4, + } + enum AlphaCutMode { + /** This mode performs standard alpha blending. It can display translucent areas, but transparency sorting issues may be visible when multiple transparent materials are overlapping. [member GeometryInstance3D.cast_shadow] has no effect when this transparency mode is used; the [Label3D] will never cast shadows. */ + ALPHA_CUT_DISABLED = 0, + + /** This mode only allows fully transparent or fully opaque pixels. Harsh edges will be visible unless some form of screen-space antialiasing is enabled (see [member ProjectSettings.rendering/anti_aliasing/quality/screen_space_aa]). This mode is also known as *alpha testing* or *1-bit transparency* . + * + * **Note:** This mode might have issues with anti-aliased fonts and outlines, try adjusting [member alpha_scissor_threshold] or using MSDF font. + * + * **Note:** When using text with overlapping glyphs (e.g., cursive scripts), this mode might have transparency sorting issues between the main text and the outline. + */ + ALPHA_CUT_DISCARD = 1, + + /** This mode draws fully opaque pixels in the depth prepass. This is slower than [constant ALPHA_CUT_DISABLED] or [constant ALPHA_CUT_DISCARD], but it allows displaying translucent areas and smooth edges while using proper sorting. + * + * **Note:** When using text with overlapping glyphs (e.g., cursive scripts), this mode might have transparency sorting issues between the main text and the outline. + */ + ALPHA_CUT_OPAQUE_PREPASS = 2, + + /** This mode draws cuts off all values below a spatially-deterministic threshold, the rest will remain opaque. */ + ALPHA_CUT_HASH = 3, + } + } + /** A node for displaying plain text in 3D space. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_label3d.html + */ + class Label3D = Record> extends GeometryInstance3D { + constructor(identifier?: any) + /** If `true`, the specified flag will be enabled. See [enum Label3D.DrawFlags] for a list of flags. */ + set_draw_flag(flag: Label3D.DrawFlags, enabled: boolean): void + + /** Returns the value of the specified flag. */ + get_draw_flag(flag: Label3D.DrawFlags): boolean + + /** Returns a [TriangleMesh] with the label's vertices following its current configuration (such as its [member pixel_size]). */ + generate_triangle_mesh(): TriangleMesh + + /** The size of one pixel's width on the label to scale it in 3D. To make the font look more detailed when up close, increase [member font_size] while decreasing [member pixel_size] at the same time. */ + get pixel_size(): float64 + set pixel_size(value: float64) + + /** The text drawing offset (in pixels). */ + get offset(): Vector2 + set offset(value: Vector2) + + /** The billboard mode to use for the label. See [enum BaseMaterial3D.BillboardMode] for possible values. */ + get billboard(): int64 + set billboard(value: int64) + + /** If `true`, the [Light3D] in the [Environment] has effects on the label. */ + get shaded(): boolean + set shaded(value: boolean) + + /** If `true`, text can be seen from the back as well, if `false`, it is invisible when looking at it from behind. */ + get double_sided(): boolean + set double_sided(value: boolean) + + /** If `true`, depth testing is disabled and the object will be drawn in render order. */ + get no_depth_test(): boolean + set no_depth_test(value: boolean) + + /** If `true`, the label is rendered at the same size regardless of distance. */ + get fixed_size(): boolean + set fixed_size(value: boolean) + + /** The alpha cutting mode to use for the sprite. See [enum AlphaCutMode] for possible values. */ + get alpha_cut(): int64 + set alpha_cut(value: int64) + + /** Threshold at which the alpha scissor will discard values. */ + get alpha_scissor_threshold(): float64 + set alpha_scissor_threshold(value: float64) + + /** The hashing scale for Alpha Hash. Recommended values between `0` and `2`. */ + get alpha_hash_scale(): float64 + set alpha_hash_scale(value: float64) + + /** The type of alpha antialiasing to apply. See [enum BaseMaterial3D.AlphaAntiAliasing]. */ + get alpha_antialiasing_mode(): int64 + set alpha_antialiasing_mode(value: int64) + + /** Threshold at which antialiasing will be applied on the alpha channel. */ + get alpha_antialiasing_edge(): float64 + set alpha_antialiasing_edge(value: float64) + + /** Filter flags for the texture. See [enum BaseMaterial3D.TextureFilter] for options. */ + get texture_filter(): int64 + set texture_filter(value: int64) + + /** Sets the render priority for the text. Higher priority objects will be sorted in front of lower priority objects. + * + * **Note:** This only applies if [member alpha_cut] is set to [constant ALPHA_CUT_DISABLED] (default value). + * + * **Note:** This only applies to sorting of transparent objects. This will not impact how transparent objects are sorted relative to opaque objects. This is because opaque objects are not sorted, while transparent objects are sorted from back to front (subject to priority). + */ + get render_priority(): int64 + set render_priority(value: int64) + + /** Sets the render priority for the text outline. Higher priority objects will be sorted in front of lower priority objects. + * + * **Note:** This only applies if [member alpha_cut] is set to [constant ALPHA_CUT_DISABLED] (default value). + * + * **Note:** This only applies to sorting of transparent objects. This will not impact how transparent objects are sorted relative to opaque objects. This is because opaque objects are not sorted, while transparent objects are sorted from back to front (subject to priority). + */ + get outline_render_priority(): int64 + set outline_render_priority(value: int64) + + /** Text [Color] of the [Label3D]. */ + get modulate(): Color + set modulate(value: Color) + + /** The tint of text outline. */ + get outline_modulate(): Color + set outline_modulate(value: Color) + + /** The text to display on screen. */ + get text(): string + set text(value: string) + + /** Font configuration used to display text. */ + get font(): Font + set font(value: Font) + + /** Font size of the [Label3D]'s text. To make the font look more detailed when up close, increase [member font_size] while decreasing [member pixel_size] at the same time. + * Higher font sizes require more time to render new characters, which can cause stuttering during gameplay. + */ + get font_size(): int64 + set font_size(value: int64) + + /** Text outline size. */ + get outline_size(): int64 + set outline_size(value: int64) + + /** Controls the text's horizontal alignment. Supports left, center, right, and fill, or justify. Set it to one of the [enum HorizontalAlignment] constants. */ + get horizontal_alignment(): int64 + set horizontal_alignment(value: int64) + + /** Controls the text's vertical alignment. Supports top, center, bottom. Set it to one of the [enum VerticalAlignment] constants. */ + get vertical_alignment(): int64 + set vertical_alignment(value: int64) + + /** If `true`, all the text displays as UPPERCASE. */ + get uppercase(): boolean + set uppercase(value: boolean) + + /** Additional vertical spacing between lines (in pixels), spacing is added to line descent. This value can be negative. */ + get line_spacing(): float64 + set line_spacing(value: float64) + + /** If set to something other than [constant TextServer.AUTOWRAP_OFF], the text gets wrapped inside the node's bounding rectangle. If you resize the node, it will change its height automatically to show all the text. To see how each mode behaves, see [enum TextServer.AutowrapMode]. */ + get autowrap_mode(): int64 + set autowrap_mode(value: int64) + + /** Line fill alignment rules. See [enum TextServer.JustificationFlag] for more information. */ + get justification_flags(): int64 + set justification_flags(value: int64) + + /** Text width (in pixels), used for autowrap and fill alignment. */ + get width(): float64 + set width(value: float64) + + /** Base text writing direction. */ + get text_direction(): int64 + set text_direction(value: int64) + + /** Language code used for line-breaking and text shaping algorithms, if left empty current locale is used instead. */ + get language(): string + set language(value: string) + + /** Set BiDi algorithm override for the structured text. */ + get structured_text_bidi_override(): int64 + set structured_text_bidi_override(value: int64) + + /** Set additional options for BiDi override. */ + get structured_text_bidi_override_options(): GArray + set structured_text_bidi_override_options(value: GArray) + } + class Label3DGizmoPlugin extends EditorNode3DGizmoPlugin { + constructor(identifier?: any) + } + /** Provides common settings to customize the text in a [Label]. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_labelsettings.html + */ + class LabelSettings extends Resource { + constructor(identifier?: any) + /** Additional vertical spacing between lines (in pixels), spacing is added to line descent. This value can be negative. */ + get line_spacing(): float64 + set line_spacing(value: float64) + + /** Vertical space between paragraphs. Added on top of [member line_spacing]. */ + get paragraph_spacing(): float64 + set paragraph_spacing(value: float64) + + /** [Font] used for the text. */ + get font(): Font + set font(value: Font) + + /** Size of the text. */ + get font_size(): int64 + set font_size(value: int64) + + /** Color of the text. */ + get font_color(): Color + set font_color(value: Color) + + /** Text outline size. */ + get outline_size(): int64 + set outline_size(value: int64) + + /** The color of the outline. */ + get outline_color(): Color + set outline_color(value: Color) + + /** Size of the shadow effect. */ + get shadow_size(): int64 + set shadow_size(value: int64) + + /** Color of the shadow effect. If alpha is `0`, no shadow will be drawn. */ + get shadow_color(): Color + set shadow_color(value: Color) + + /** Offset of the shadow effect, in pixels. */ + get shadow_offset(): Vector2 + set shadow_offset(value: Vector2) + } + namespace Light2D { + enum ShadowFilter { + /** No filter applies to the shadow map. This provides hard shadow edges and is the fastest to render. See [member shadow_filter]. */ + SHADOW_FILTER_NONE = 0, + + /** Percentage closer filtering (5 samples) applies to the shadow map. This is slower compared to hard shadow rendering. See [member shadow_filter]. */ + SHADOW_FILTER_PCF5 = 1, + + /** Percentage closer filtering (13 samples) applies to the shadow map. This is the slowest shadow filtering mode, and should be used sparingly. See [member shadow_filter]. */ + SHADOW_FILTER_PCF13 = 2, + } + enum BlendMode { + /** Adds the value of pixels corresponding to the Light2D to the values of pixels under it. This is the common behavior of a light. */ + BLEND_MODE_ADD = 0, + + /** Subtracts the value of pixels corresponding to the Light2D to the values of pixels under it, resulting in inversed light effect. */ + BLEND_MODE_SUB = 1, + + /** Mix the value of pixels corresponding to the Light2D to the values of pixels under it by linear interpolation. */ + BLEND_MODE_MIX = 2, + } + } + /** Casts light in a 2D environment. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_light2d.html + */ + class Light2D = Record> extends Node2D { + constructor(identifier?: any) + /** Sets the light's height, which is used in 2D normal mapping. See [member PointLight2D.height] and [member DirectionalLight2D.height]. */ + set_height(height: float64): void + + /** Returns the light's height, which is used in 2D normal mapping. See [member PointLight2D.height] and [member DirectionalLight2D.height]. */ + get_height(): float64 + + /** If `true`, Light2D will emit light. */ + get enabled(): boolean + set enabled(value: boolean) + + /** If `true`, Light2D will only appear when editing the scene. */ + get editor_only(): boolean + set editor_only(value: boolean) + + /** The Light2D's [Color]. */ + get color(): Color + set color(value: Color) + + /** The Light2D's energy value. The larger the value, the stronger the light. */ + get energy(): float64 + set energy(value: float64) + + /** The Light2D's blend mode. See [enum BlendMode] constants for values. */ + get blend_mode(): int64 + set blend_mode(value: int64) + + /** Minimum `z` value of objects that are affected by the Light2D. */ + get range_z_min(): int64 + set range_z_min(value: int64) + + /** Maximum `z` value of objects that are affected by the Light2D. */ + get range_z_max(): int64 + set range_z_max(value: int64) + + /** Minimum layer value of objects that are affected by the Light2D. */ + get range_layer_min(): int64 + set range_layer_min(value: int64) + + /** Maximum layer value of objects that are affected by the Light2D. */ + get range_layer_max(): int64 + set range_layer_max(value: int64) + + /** The layer mask. Only objects with a matching [member CanvasItem.light_mask] will be affected by the Light2D. See also [member shadow_item_cull_mask], which affects which objects can cast shadows. + * + * **Note:** [member range_item_cull_mask] is ignored by [DirectionalLight2D], which will always light a 2D node regardless of the 2D node's [member CanvasItem.light_mask]. + */ + get range_item_cull_mask(): int64 + set range_item_cull_mask(value: int64) + + /** If `true`, the Light2D will cast shadows. */ + get shadow_enabled(): boolean + set shadow_enabled(value: boolean) + + /** [Color] of shadows cast by the Light2D. */ + get shadow_color(): Color + set shadow_color(value: Color) + + /** Shadow filter type. See [enum ShadowFilter] for possible values. */ + get shadow_filter(): int64 + set shadow_filter(value: int64) + + /** Smoothing value for shadows. Higher values will result in softer shadows, at the cost of visible streaks that can appear in shadow rendering. [member shadow_filter_smooth] only has an effect if [member shadow_filter] is [constant SHADOW_FILTER_PCF5] or [constant SHADOW_FILTER_PCF13]. */ + get shadow_filter_smooth(): float64 + set shadow_filter_smooth(value: float64) + + /** The shadow mask. Used with [LightOccluder2D] to cast shadows. Only occluders with a matching [member CanvasItem.light_mask] will cast shadows. See also [member range_item_cull_mask], which affects which objects can *receive* the light. */ + get shadow_item_cull_mask(): int64 + set shadow_item_cull_mask(value: int64) + } + namespace Light3D { + enum Param { + /** Constant for accessing [member light_energy]. */ + PARAM_ENERGY = 0, + + /** Constant for accessing [member light_indirect_energy]. */ + PARAM_INDIRECT_ENERGY = 1, + + /** Constant for accessing [member light_volumetric_fog_energy]. */ + PARAM_VOLUMETRIC_FOG_ENERGY = 2, + + /** Constant for accessing [member light_specular]. */ + PARAM_SPECULAR = 3, + + /** Constant for accessing [member OmniLight3D.omni_range] or [member SpotLight3D.spot_range]. */ + PARAM_RANGE = 4, + + /** Constant for accessing [member light_size]. */ + PARAM_SIZE = 5, + + /** Constant for accessing [member OmniLight3D.omni_attenuation] or [member SpotLight3D.spot_attenuation]. */ + PARAM_ATTENUATION = 6, + + /** Constant for accessing [member SpotLight3D.spot_angle]. */ + PARAM_SPOT_ANGLE = 7, + + /** Constant for accessing [member SpotLight3D.spot_angle_attenuation]. */ + PARAM_SPOT_ATTENUATION = 8, + + /** Constant for accessing [member DirectionalLight3D.directional_shadow_max_distance]. */ + PARAM_SHADOW_MAX_DISTANCE = 9, + + /** Constant for accessing [member DirectionalLight3D.directional_shadow_split_1]. */ + PARAM_SHADOW_SPLIT_1_OFFSET = 10, + + /** Constant for accessing [member DirectionalLight3D.directional_shadow_split_2]. */ + PARAM_SHADOW_SPLIT_2_OFFSET = 11, + + /** Constant for accessing [member DirectionalLight3D.directional_shadow_split_3]. */ + PARAM_SHADOW_SPLIT_3_OFFSET = 12, + + /** Constant for accessing [member DirectionalLight3D.directional_shadow_fade_start]. */ + PARAM_SHADOW_FADE_START = 13, + + /** Constant for accessing [member shadow_normal_bias]. */ + PARAM_SHADOW_NORMAL_BIAS = 14, + + /** Constant for accessing [member shadow_bias]. */ + PARAM_SHADOW_BIAS = 15, + + /** Constant for accessing [member DirectionalLight3D.directional_shadow_pancake_size]. */ + PARAM_SHADOW_PANCAKE_SIZE = 16, + + /** Constant for accessing [member shadow_opacity]. */ + PARAM_SHADOW_OPACITY = 17, + + /** Constant for accessing [member shadow_blur]. */ + PARAM_SHADOW_BLUR = 18, + + /** Constant for accessing [member shadow_transmittance_bias]. */ + PARAM_TRANSMITTANCE_BIAS = 19, + + /** Constant for accessing [member light_intensity_lumens] and [member light_intensity_lux]. Only used when [member ProjectSettings.rendering/lights_and_shadows/use_physical_light_units] is `true`. */ + PARAM_INTENSITY = 20, + + /** Represents the size of the [enum Param] enum. */ + PARAM_MAX = 21, + } + enum BakeMode { + /** Light is ignored when baking. This is the fastest mode, but the light will be taken into account when baking global illumination. This mode should generally be used for dynamic lights that change quickly, as the effect of global illumination is less noticeable on those lights. + * + * **Note:** Hiding a light does *not* affect baking [LightmapGI]. Hiding a light will still affect baking [VoxelGI] and SDFGI (see [member Environment.sdfgi_enabled]). + */ + BAKE_DISABLED = 0, + + /** Light is taken into account in static baking ([VoxelGI], [LightmapGI], SDFGI ([member Environment.sdfgi_enabled])). The light can be moved around or modified, but its global illumination will not update in real-time. This is suitable for subtle changes (such as flickering torches), but generally not large changes such as toggling a light on and off. + * + * **Note:** The light is not baked in [LightmapGI] if [member editor_only] is `true`. + */ + BAKE_STATIC = 1, + + /** Light is taken into account in dynamic baking ([VoxelGI] and SDFGI ([member Environment.sdfgi_enabled]) only). The light can be moved around or modified with global illumination updating in real-time. The light's global illumination appearance will be slightly different compared to [constant BAKE_STATIC]. This has a greater performance cost compared to [constant BAKE_STATIC]. When using SDFGI, the update speed of dynamic lights is affected by [member ProjectSettings.rendering/global_illumination/sdfgi/frames_to_update_lights]. */ + BAKE_DYNAMIC = 2, + } + } + /** Provides a base class for different kinds of light nodes. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_light3d.html + */ + class Light3D = Record> extends VisualInstance3D { + constructor(identifier?: any) + /** Sets the value of the specified [enum Light3D.Param] parameter. */ + set_param(param: Light3D.Param, value: float64): void + + /** Returns the value of the specified [enum Light3D.Param] parameter. */ + get_param(param: Light3D.Param): float64 + + /** Returns the [Color] of an idealized blackbody at the given [member light_temperature]. This value is calculated internally based on the [member light_temperature]. This [Color] is multiplied by [member light_color] before being sent to the [RenderingServer]. */ + get_correlated_color(): Color + + /** Used by positional lights ([OmniLight3D] and [SpotLight3D]) when [member ProjectSettings.rendering/lights_and_shadows/use_physical_light_units] is `true`. Sets the intensity of the light source measured in Lumens. Lumens are a measure of luminous flux, which is the total amount of visible light emitted by a light source per unit of time. + * For [SpotLight3D]s, we assume that the area outside the visible cone is surrounded by a perfect light absorbing material. Accordingly, the apparent brightness of the cone area does not change as the cone increases and decreases in size. + * A typical household lightbulb can range from around 600 lumens to 1,200 lumens, a candle is about 13 lumens, while a streetlight can be approximately 60,000 lumens. + */ + get light_intensity_lumens(): float64 + set light_intensity_lumens(value: float64) + + /** Used by [DirectionalLight3D]s when [member ProjectSettings.rendering/lights_and_shadows/use_physical_light_units] is `true`. Sets the intensity of the light source measured in Lux. Lux is a measure of luminous flux per unit area, it is equal to one lumen per square meter. Lux is the measure of how much light hits a surface at a given time. + * On a clear sunny day a surface in direct sunlight may be approximately 100,000 lux, a typical room in a home may be approximately 50 lux, while the moonlit ground may be approximately 0.1 lux. + */ + get light_intensity_lux(): float64 + set light_intensity_lux(value: float64) + + /** Sets the color temperature of the light source, measured in Kelvin. This is used to calculate a correlated color temperature which tints the [member light_color]. + * The sun on a cloudy day is approximately 6500 Kelvin, on a clear day it is between 5500 to 6000 Kelvin, and on a clear day at sunrise or sunset it ranges to around 1850 Kelvin. + */ + get light_temperature(): float64 + set light_temperature(value: float64) + + /** The light's color. An *overbright* color can be used to achieve a result equivalent to increasing the light's [member light_energy]. */ + get light_color(): Color + set light_color(value: Color) + + /** The light's strength multiplier (this is not a physical unit). For [OmniLight3D] and [SpotLight3D], changing this value will only change the light color's intensity, not the light's radius. */ + get light_energy(): float64 + set light_energy(value: float64) + + /** Secondary multiplier used with indirect light (light bounces). Used with [VoxelGI] and SDFGI (see [member Environment.sdfgi_enabled]). + * + * **Note:** This property is ignored if [member light_energy] is equal to `0.0`, as the light won't be present at all in the GI shader. + */ + get light_indirect_energy(): float64 + set light_indirect_energy(value: float64) + + /** Secondary multiplier multiplied with [member light_energy] then used with the [Environment]'s volumetric fog (if enabled). If set to `0.0`, computing volumetric fog will be skipped for this light, which can improve performance for large amounts of lights when volumetric fog is enabled. + * + * **Note:** To prevent short-lived dynamic light effects from poorly interacting with volumetric fog, lights used in those effects should have [member light_volumetric_fog_energy] set to `0.0` unless [member Environment.volumetric_fog_temporal_reprojection_enabled] is disabled (or unless the reprojection amount is significantly lowered). + */ + get light_volumetric_fog_energy(): float64 + set light_volumetric_fog_energy(value: float64) + + /** [Texture2D] projected by light. [member shadow_enabled] must be on for the projector to work. Light projectors make the light appear as if it is shining through a colored but transparent object, almost like light shining through stained-glass. + * + * **Note:** Unlike [BaseMaterial3D] whose filter mode can be adjusted on a per-material basis, the filter mode for light projector textures is set globally with [member ProjectSettings.rendering/textures/light_projectors/filter]. + * + * **Note:** Light projector textures are only supported in the Forward+ and Mobile rendering methods, not Compatibility. + */ + get light_projector(): Texture2D | any /*-AnimatedTexture*/ | any /*-AtlasTexture*/ | any /*-CameraTexture*/ | any /*-CanvasTexture*/ | any /*-MeshTexture*/ | any /*-Texture2DRD*/ | any /*-ViewportTexture*/ + set light_projector(value: Texture2D | any /*-AnimatedTexture*/ | any /*-AtlasTexture*/ | any /*-CameraTexture*/ | any /*-CanvasTexture*/ | any /*-MeshTexture*/ | any /*-Texture2DRD*/ | any /*-ViewportTexture*/) + + /** The size of the light in Godot units. Only available for [OmniLight3D]s and [SpotLight3D]s. Increasing this value will make the light fade out slower and shadows appear blurrier (also called percentage-closer soft shadows, or PCSS). This can be used to simulate area lights to an extent. Increasing this value above `0.0` for lights with shadows enabled will have a noticeable performance cost due to PCSS. + * + * **Note:** [member light_size] is not affected by [member Node3D.scale] (the light's scale or its parent's scale). + * + * **Note:** PCSS for positional lights is only supported in the Forward+ and Mobile rendering methods, not Compatibility. + */ + get light_size(): float64 + set light_size(value: float64) + + /** The light's angular size in degrees. Increasing this will make shadows softer at greater distances (also called percentage-closer soft shadows, or PCSS). Only available for [DirectionalLight3D]s. For reference, the Sun from the Earth is approximately `0.5`. Increasing this value above `0.0` for lights with shadows enabled will have a noticeable performance cost due to PCSS. + * + * **Note:** [member light_angular_distance] is not affected by [member Node3D.scale] (the light's scale or its parent's scale). + * + * **Note:** PCSS for directional lights is only supported in the Forward+ rendering method, not Mobile or Compatibility. + */ + get light_angular_distance(): float64 + set light_angular_distance(value: float64) + + /** If `true`, the light's effect is reversed, darkening areas and casting bright shadows. */ + get light_negative(): boolean + set light_negative(value: boolean) + + /** The intensity of the specular blob in objects affected by the light. At `0`, the light becomes a pure diffuse light. When not baking emission, this can be used to avoid unrealistic reflections when placing lights above an emissive surface. */ + get light_specular(): float64 + set light_specular(value: float64) + + /** The light's bake mode. This will affect the global illumination techniques that have an effect on the light's rendering. See [enum BakeMode]. + * + * **Note:** Meshes' global illumination mode will also affect the global illumination rendering. See [member GeometryInstance3D.gi_mode]. + */ + get light_bake_mode(): int64 + set light_bake_mode(value: int64) + + /** The light will affect objects in the selected layers. */ + get light_cull_mask(): int64 + set light_cull_mask(value: int64) + + /** If `true`, the light will cast real-time shadows. This has a significant performance cost. Only enable shadow rendering when it makes a noticeable difference in the scene's appearance, and consider using [member distance_fade_enabled] to hide the light when far away from the [Camera3D]. */ + get shadow_enabled(): boolean + set shadow_enabled(value: boolean) + + /** Used to adjust shadow appearance. Too small a value results in self-shadowing ("shadow acne"), while too large a value causes shadows to separate from casters ("peter-panning"). Adjust as needed. */ + get shadow_bias(): float64 + set shadow_bias(value: float64) + + /** Offsets the lookup into the shadow map by the object's normal. This can be used to reduce self-shadowing artifacts without using [member shadow_bias]. In practice, this value should be tweaked along with [member shadow_bias] to reduce artifacts as much as possible. */ + get shadow_normal_bias(): float64 + set shadow_normal_bias(value: float64) + + /** If `true`, reverses the backface culling of the mesh. This can be useful when you have a flat mesh that has a light behind it. If you need to cast a shadow on both sides of the mesh, set the mesh to use double-sided shadows with [constant GeometryInstance3D.SHADOW_CASTING_SETTING_DOUBLE_SIDED]. */ + get shadow_reverse_cull_face(): boolean + set shadow_reverse_cull_face(value: boolean) + get shadow_transmittance_bias(): float64 + set shadow_transmittance_bias(value: float64) + + /** The opacity to use when rendering the light's shadow map. Values lower than `1.0` make the light appear through shadows. This can be used to fake global illumination at a low performance cost. */ + get shadow_opacity(): float64 + set shadow_opacity(value: float64) + + /** Blurs the edges of the shadow. Can be used to hide pixel artifacts in low-resolution shadow maps. A high value can impact performance, make shadows appear grainy and can cause other unwanted artifacts. Try to keep as near default as possible. */ + get shadow_blur(): float64 + set shadow_blur(value: float64) + + /** The light will only cast shadows using objects in the selected layers. */ + get shadow_caster_mask(): int64 + set shadow_caster_mask(value: int64) + + /** If `true`, the light will smoothly fade away when far from the active [Camera3D] starting at [member distance_fade_begin]. This acts as a form of level of detail (LOD). The light will fade out over [member distance_fade_begin] + [member distance_fade_length], after which it will be culled and not sent to the shader at all. Use this to reduce the number of active lights in a scene and thus improve performance. + * + * **Note:** Only effective for [OmniLight3D] and [SpotLight3D]. + */ + get distance_fade_enabled(): boolean + set distance_fade_enabled(value: boolean) + + /** The distance from the camera at which the light begins to fade away (in 3D units). + * + * **Note:** Only effective for [OmniLight3D] and [SpotLight3D]. + */ + get distance_fade_begin(): float64 + set distance_fade_begin(value: float64) + + /** The distance from the camera at which the light's shadow cuts off (in 3D units). Set this to a value lower than [member distance_fade_begin] + [member distance_fade_length] to further improve performance, as shadow rendering is often more expensive than light rendering itself. + * + * **Note:** Only effective for [OmniLight3D] and [SpotLight3D], and only when [member shadow_enabled] is `true`. + */ + get distance_fade_shadow(): float64 + set distance_fade_shadow(value: float64) + + /** Distance over which the light and its shadow fades. The light's energy and shadow's opacity is progressively reduced over this distance and is completely invisible at the end. + * + * **Note:** Only effective for [OmniLight3D] and [SpotLight3D]. + */ + get distance_fade_length(): float64 + set distance_fade_length(value: float64) + + /** If `true`, the light only appears in the editor and will not be visible at runtime. If `true`, the light will never be baked in [LightmapGI] regardless of its [member light_bake_mode]. */ + get editor_only(): boolean + set editor_only(value: boolean) + } + class Light3DGizmoPlugin extends EditorNode3DGizmoPlugin { + constructor(identifier?: any) + } + /** Occludes light cast by a Light2D, casting shadows. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_lightoccluder2d.html + */ + class LightOccluder2D = Record> extends Node2D { + constructor(identifier?: any) + /** The [OccluderPolygon2D] used to compute the shadow. */ + get occluder(): OccluderPolygon2D + set occluder(value: OccluderPolygon2D) + + /** If enabled, the occluder will be part of a real-time generated signed distance field that can be used in custom shaders. */ + get sdf_collision(): boolean + set sdf_collision(value: boolean) + + /** The LightOccluder2D's occluder light mask. The LightOccluder2D will cast shadows only from Light2D(s) that have the same light mask(s). */ + get occluder_light_mask(): int64 + set occluder_light_mask(value: int64) + } + class LightOccluder2DEditor = Record> extends AbstractPolygon2DEditor { + constructor(identifier?: any) + } + class LightOccluder2DEditorPlugin = Record> extends AbstractPolygon2DEditorPlugin { + constructor(identifier?: any) + } + namespace LightmapGI { + enum BakeQuality { + /** Low bake quality (fastest bake times). The quality of this preset can be adjusted by changing [member ProjectSettings.rendering/lightmapping/bake_quality/low_quality_ray_count] and [member ProjectSettings.rendering/lightmapping/bake_quality/low_quality_probe_ray_count]. */ + BAKE_QUALITY_LOW = 0, + + /** Medium bake quality (fast bake times). The quality of this preset can be adjusted by changing [member ProjectSettings.rendering/lightmapping/bake_quality/medium_quality_ray_count] and [member ProjectSettings.rendering/lightmapping/bake_quality/medium_quality_probe_ray_count]. */ + BAKE_QUALITY_MEDIUM = 1, + + /** High bake quality (slow bake times). The quality of this preset can be adjusted by changing [member ProjectSettings.rendering/lightmapping/bake_quality/high_quality_ray_count] and [member ProjectSettings.rendering/lightmapping/bake_quality/high_quality_probe_ray_count]. */ + BAKE_QUALITY_HIGH = 2, + + /** Highest bake quality (slowest bake times). The quality of this preset can be adjusted by changing [member ProjectSettings.rendering/lightmapping/bake_quality/ultra_quality_ray_count] and [member ProjectSettings.rendering/lightmapping/bake_quality/ultra_quality_probe_ray_count]. */ + BAKE_QUALITY_ULTRA = 3, + } + enum GenerateProbes { + /** Don't generate lightmap probes for lighting dynamic objects. */ + GENERATE_PROBES_DISABLED = 0, + + /** Lowest level of subdivision (fastest bake times, smallest file sizes). */ + GENERATE_PROBES_SUBDIV_4 = 1, + + /** Low level of subdivision (fast bake times, small file sizes). */ + GENERATE_PROBES_SUBDIV_8 = 2, + + /** High level of subdivision (slow bake times, large file sizes). */ + GENERATE_PROBES_SUBDIV_16 = 3, + + /** Highest level of subdivision (slowest bake times, largest file sizes). */ + GENERATE_PROBES_SUBDIV_32 = 4, + } + enum BakeError { + /** Lightmap baking was successful. */ + BAKE_ERROR_OK = 0, + + /** Lightmap baking failed because the root node for the edited scene could not be accessed. */ + BAKE_ERROR_NO_SCENE_ROOT = 1, + + /** Lightmap baking failed as the lightmap data resource is embedded in a foreign resource. */ + BAKE_ERROR_FOREIGN_DATA = 2, + + /** Lightmap baking failed as there is no lightmapper available in this Godot build. */ + BAKE_ERROR_NO_LIGHTMAPPER = 3, + + /** Lightmap baking failed as the [LightmapGIData] save path isn't configured in the resource. */ + BAKE_ERROR_NO_SAVE_PATH = 4, + + /** Lightmap baking failed as there are no meshes whose [member GeometryInstance3D.gi_mode] is [constant GeometryInstance3D.GI_MODE_STATIC] and with valid UV2 mapping in the current scene. You may need to select 3D scenes in the Import dock and change their global illumination mode accordingly. */ + BAKE_ERROR_NO_MESHES = 5, + + /** Lightmap baking failed as the lightmapper failed to analyze some of the meshes marked as static for baking. */ + BAKE_ERROR_MESHES_INVALID = 6, + + /** Lightmap baking failed as the resulting image couldn't be saved or imported by Godot after it was saved. */ + BAKE_ERROR_CANT_CREATE_IMAGE = 7, + + /** The user aborted the lightmap baking operation (typically by clicking the **Cancel** button in the progress dialog). */ + BAKE_ERROR_USER_ABORTED = 8, + + /** Lightmap baking failed as the maximum texture size is too small to fit some of the meshes marked for baking. */ + BAKE_ERROR_TEXTURE_SIZE_TOO_SMALL = 9, + + /** Lightmap baking failed as the lightmap is too small. */ + BAKE_ERROR_LIGHTMAP_TOO_SMALL = 10, + + /** Lightmap baking failed as the lightmap was unable to fit into an atlas. */ + BAKE_ERROR_ATLAS_TOO_SMALL = 11, + } + enum EnvironmentMode { + /** Ignore environment lighting when baking lightmaps. */ + ENVIRONMENT_MODE_DISABLED = 0, + + /** Use the scene's environment lighting when baking lightmaps. + * + * **Note:** If baking lightmaps in a scene with no [WorldEnvironment] node, this will act like [constant ENVIRONMENT_MODE_DISABLED]. The editor's preview sky and sun is *not* taken into account by [LightmapGI] when baking lightmaps. + */ + ENVIRONMENT_MODE_SCENE = 1, + + /** Use [member environment_custom_sky] as a source of environment lighting when baking lightmaps. */ + ENVIRONMENT_MODE_CUSTOM_SKY = 2, + + /** Use [member environment_custom_color] multiplied by [member environment_custom_energy] as a constant source of environment lighting when baking lightmaps. */ + ENVIRONMENT_MODE_CUSTOM_COLOR = 3, + } + } + /** Computes and stores baked lightmaps for fast global illumination. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_lightmapgi.html + */ + class LightmapGI = Record> extends VisualInstance3D { + constructor(identifier?: any) + /** The quality preset to use when baking lightmaps. This affects bake times, but output file sizes remain mostly identical across quality levels. + * To further speed up bake times, decrease [member bounces], disable [member use_denoiser] and/or decrease [member texel_scale]. + * To further increase quality, enable [member supersampling] and/or increase [member texel_scale]. + */ + get quality(): int64 + set quality(value: int64) + + /** If `true`, lightmaps are baked with the texel scale multiplied with [member supersampling_factor] and downsampled before saving the lightmap (so the effective texel density is identical to having supersampling disabled). + * Supersampling provides increased lightmap quality with less noise, smoother shadows and better shadowing of small-scale features in objects. However, it may result in significantly increased bake times and memory usage while baking lightmaps. Padding is automatically adjusted to avoid increasing light leaking. + */ + get supersampling(): boolean + set supersampling(value: boolean) + + /** The factor by which the texel density is multiplied for supersampling. For best results, use an integer value. While fractional values are allowed, they can result in increased light leaking and a blurry lightmap. + * Higher values may result in better quality, but also increase bake times and memory usage while baking. + * See [member supersampling] for more information. + */ + get supersampling_factor(): float64 + set supersampling_factor(value: float64) + + /** Number of light bounces that are taken into account during baking. Higher values result in brighter, more realistic lighting, at the cost of longer bake times. If set to `0`, only environment lighting, direct light and emissive lighting is baked. */ + get bounces(): int64 + set bounces(value: int64) + + /** The energy multiplier for each bounce. Higher values will make indirect lighting brighter. A value of `1.0` represents physically accurate behavior, but higher values can be used to make indirect lighting propagate more visibly when using a low number of bounces. This can be used to speed up bake times by lowering the number of [member bounces] then increasing [member bounce_indirect_energy]. + * + * **Note:** [member bounce_indirect_energy] only has an effect if [member bounces] is set to a value greater than or equal to `1`. + */ + get bounce_indirect_energy(): float64 + set bounce_indirect_energy(value: float64) + + /** If `true`, bakes lightmaps to contain directional information as spherical harmonics. This results in more realistic lighting appearance, especially with normal mapped materials and for lights that have their direct light baked ([member Light3D.light_bake_mode] set to [constant Light3D.BAKE_STATIC] and with [member Light3D.editor_only] set to `false`). The directional information is also used to provide rough reflections for static and dynamic objects. This has a small run-time performance cost as the shader has to perform more work to interpret the direction information from the lightmap. Directional lightmaps also take longer to bake and result in larger file sizes. + * + * **Note:** The property's name has no relationship with [DirectionalLight3D]. [member directional] works with all light types. + */ + get directional(): boolean + set directional(value: boolean) + + /** The shadowmasking policy to use for directional shadows on static objects that are baked with this [LightmapGI] instance. + * Shadowmasking allows [DirectionalLight3D] nodes to cast shadows even outside the range defined by their [member DirectionalLight3D.directional_shadow_max_distance] property. This is done by baking a texture that contains a shadowmap for the directional light, then using this texture according to the current shadowmask mode. + * + * **Note:** The shadowmask texture is only created if [member shadowmask_mode] is not [constant LightmapGIData.SHADOWMASK_MODE_NONE]. To see a difference, you need to bake lightmaps again after switching from [constant LightmapGIData.SHADOWMASK_MODE_NONE] to any other mode. + */ + get shadowmask_mode(): int64 + set shadowmask_mode(value: int64) + + /** If `true`, a texture with the lighting information will be generated to speed up the generation of indirect lighting at the cost of some accuracy. The geometry might exhibit extra light leak artifacts when using low resolution lightmaps or UVs that stretch the lightmap significantly across surfaces. Leave [member use_texture_for_bounces] at its default value of `true` if unsure. + * + * **Note:** [member use_texture_for_bounces] only has an effect if [member bounces] is set to a value greater than or equal to `1`. + */ + get use_texture_for_bounces(): boolean + set use_texture_for_bounces(value: boolean) + + /** If `true`, ignore environment lighting when baking lightmaps. */ + get interior(): boolean + set interior(value: boolean) + + /** If `true`, uses a GPU-based denoising algorithm on the generated lightmap. This eliminates most noise within the generated lightmap at the cost of longer bake times. File sizes are generally not impacted significantly by the use of a denoiser, although lossless compression may do a better job at compressing a denoised image. */ + get use_denoiser(): boolean + set use_denoiser(value: boolean) + + /** The strength of denoising step applied to the generated lightmaps. Only effective if [member use_denoiser] is `true` and [member ProjectSettings.rendering/lightmapping/denoising/denoiser] is set to JNLM. */ + get denoiser_strength(): float64 + set denoiser_strength(value: float64) + + /** The distance in pixels from which the denoiser samples. Lower values preserve more details, but may give blotchy results if the lightmap quality is not high enough. Only effective if [member use_denoiser] is `true` and [member ProjectSettings.rendering/lightmapping/denoising/denoiser] is set to JNLM. */ + get denoiser_range(): int64 + set denoiser_range(value: int64) + + /** The bias to use when computing shadows. Increasing [member bias] can fix shadow acne on the resulting baked lightmap, but can introduce peter-panning (shadows not connecting to their casters). Real-time [Light3D] shadows are not affected by this [member bias] property. */ + get bias(): float64 + set bias(value: float64) + + /** Scales the lightmap texel density of all meshes for the current bake. This is a multiplier that builds upon the existing lightmap texel size defined in each imported 3D scene, along with the per-mesh density multiplier (which is designed to be used when the same mesh is used at different scales). Lower values will result in faster bake times. + * For example, doubling [member texel_scale] doubles the lightmap texture resolution for all objects *on each axis* , so it will *quadruple* the texel count. + */ + get texel_scale(): float64 + set texel_scale(value: float64) + + /** The maximum texture size for the generated texture atlas. Higher values will result in fewer slices being generated, but may not work on all hardware as a result of hardware limitations on texture sizes. Leave [member max_texture_size] at its default value of `16384` if unsure. */ + get max_texture_size(): int64 + set max_texture_size(value: int64) + + /** The environment mode to use when baking lightmaps. */ + get environment_mode(): int64 + set environment_mode(value: int64) + + /** The sky to use as a source of environment lighting. Only effective if [member environment_mode] is [constant ENVIRONMENT_MODE_CUSTOM_SKY]. */ + get environment_custom_sky(): Sky + set environment_custom_sky(value: Sky) + + /** The color to use for environment lighting. Only effective if [member environment_mode] is [constant ENVIRONMENT_MODE_CUSTOM_COLOR]. */ + get environment_custom_color(): Color + set environment_custom_color(value: Color) + + /** The color multiplier to use for environment lighting. Only effective if [member environment_mode] is [constant ENVIRONMENT_MODE_CUSTOM_COLOR]. */ + get environment_custom_energy(): float64 + set environment_custom_energy(value: float64) + + /** The [CameraAttributes] resource that specifies exposure levels to bake at. Auto-exposure and non exposure properties will be ignored. Exposure settings should be used to reduce the dynamic range present when baking. If exposure is too high, the [LightmapGI] will have banding artifacts or may have over-exposure artifacts. */ + get camera_attributes(): CameraAttributesPractical | CameraAttributesPhysical + set camera_attributes(value: CameraAttributesPractical | CameraAttributesPhysical) + + /** The level of subdivision to use when automatically generating [LightmapProbe]s for dynamic object lighting. Higher values result in more accurate indirect lighting on dynamic objects, at the cost of longer bake times and larger file sizes. + * + * **Note:** Automatically generated [LightmapProbe]s are not visible as nodes in the Scene tree dock, and cannot be modified this way after they are generated. + * + * **Note:** Regardless of [member generate_probes_subdiv], direct lighting on dynamic objects is always applied using [Light3D] nodes in real-time. + */ + get generate_probes_subdiv(): int64 + set generate_probes_subdiv(value: int64) + + /** The [LightmapGIData] associated to this [LightmapGI] node. This resource is automatically created after baking, and is not meant to be created manually. */ + get light_data(): LightmapGIData + set light_data(value: LightmapGIData) + } + namespace LightmapGIData { + enum ShadowmaskMode { + /** Shadowmasking is disabled. No shadowmask texture will be created when baking lightmaps. Existing shadowmask textures will be removed during baking. */ + SHADOWMASK_MODE_NONE = 0, + + /** Shadowmasking is enabled. Directional shadows that are outside the [member DirectionalLight3D.directional_shadow_max_distance] will be rendered using the shadowmask texture. Shadows that are inside the range will be rendered using real-time shadows exclusively. This mode allows for more precise real-time shadows up close, without the potential "smearing" effect that can occur when using lightmaps with a high texel size. The downside is that when the camera moves fast, the transition between the real-time light and shadowmask can be obvious. Also, objects that only have shadows baked in the shadowmask (and no real-time shadows) won't display any shadows up close. */ + SHADOWMASK_MODE_REPLACE = 1, + + /** Shadowmasking is enabled. Directional shadows will be rendered with real-time shadows overlaid on top of the shadowmask texture. This mode makes for smoother shadow transitions when the camera moves fast, at the cost of a potential smearing effect for directional shadows that are up close (due to the real-time shadow being mixed with a low-resolution shadowmask). Objects that only have shadows baked in the shadowmask (and no real-time shadows) will keep their shadows up close. */ + SHADOWMASK_MODE_OVERLAY = 2, + } + } + /** Contains baked lightmap and dynamic object probe data for [LightmapGI]. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_lightmapgidata.html + */ + class LightmapGIData extends Resource { + constructor(identifier?: any) + /** Adds an object that is considered baked within this [LightmapGIData]. */ + add_user(path: NodePath | string, uv_scale: Rect2, slice_index: int64, sub_instance: int64): void + + /** Returns the number of objects that are considered baked within this [LightmapGIData]. */ + get_user_count(): int64 + + /** Returns the [NodePath] of the baked object at index [param user_idx]. */ + get_user_path(user_idx: int64): NodePath + + /** Clear all objects that are considered baked within this [LightmapGIData]. */ + clear_users(): void + + /** The lightmap atlas textures generated by the lightmapper. */ + get lightmap_textures(): GArray + set lightmap_textures(value: GArray) + + /** The shadowmask atlas textures generated by the lightmapper. */ + get shadowmask_textures(): GArray + set shadowmask_textures(value: GArray) + get uses_spherical_harmonics(): boolean + set uses_spherical_harmonics(value: boolean) + get user_data(): GArray + set user_data(value: GArray) + get probe_data(): GDictionary + set probe_data(value: GDictionary) + get _uses_packed_directional(): boolean + set _uses_packed_directional(value: boolean) + + /** The lightmap atlas texture generated by the lightmapper. */ + get light_texture(): TextureLayered + set light_texture(value: TextureLayered) + get light_textures(): GArray + set light_textures(value: GArray) + } + class LightmapGIEditorPlugin = Record> extends EditorPlugin { + constructor(identifier?: any) + _bake(): void + } + class LightmapGIGizmoPlugin extends EditorNode3DGizmoPlugin { + constructor(identifier?: any) + } + /** Represents a single manually placed probe for dynamic object lighting with [LightmapGI]. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_lightmapprobe.html + */ + class LightmapProbe = Record> extends Node3D { + constructor(identifier?: any) + } + class LightmapProbeGizmoPlugin extends EditorNode3DGizmoPlugin { + constructor(identifier?: any) + } + /** Abstract class extended by lightmappers, for use in [LightmapGI]. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_lightmapper.html + */ + class Lightmapper extends RefCounted { + constructor(identifier?: any) + } + /** The built-in GPU-based lightmapper for use with [LightmapGI]. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_lightmapperrd.html + */ + class LightmapperRD extends Lightmapper { + constructor(identifier?: any) + } + namespace Line2D { + enum LineJointMode { + /** Makes the polyline's joints pointy, connecting the sides of the two segments by extending them until they intersect. If the rotation of a joint is too big (based on [member sharp_limit]), the joint falls back to [constant LINE_JOINT_BEVEL] to prevent very long miters. */ + LINE_JOINT_SHARP = 0, + + /** Makes the polyline's joints bevelled/chamfered, connecting the sides of the two segments with a simple line. */ + LINE_JOINT_BEVEL = 1, + + /** Makes the polyline's joints rounded, connecting the sides of the two segments with an arc. The detail of this arc depends on [member round_precision]. */ + LINE_JOINT_ROUND = 2, + } + enum LineCapMode { + /** Draws no line cap. */ + LINE_CAP_NONE = 0, + + /** Draws the line cap as a box, slightly extending the first/last segment. */ + LINE_CAP_BOX = 1, + + /** Draws the line cap as a semicircle attached to the first/last segment. */ + LINE_CAP_ROUND = 2, + } + enum LineTextureMode { + /** Takes the left pixels of the texture and renders them over the whole polyline. */ + LINE_TEXTURE_NONE = 0, + + /** Tiles the texture over the polyline. [member CanvasItem.texture_repeat] of the [Line2D] node must be [constant CanvasItem.TEXTURE_REPEAT_ENABLED] or [constant CanvasItem.TEXTURE_REPEAT_MIRROR] for it to work properly. */ + LINE_TEXTURE_TILE = 1, + + /** Stretches the texture across the polyline. [member CanvasItem.texture_repeat] of the [Line2D] node must be [constant CanvasItem.TEXTURE_REPEAT_DISABLED] for best results. */ + LINE_TEXTURE_STRETCH = 2, + } + } + /** A 2D polyline that can optionally be textured. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_line2d.html + */ + class Line2D = Record> extends Node2D { + constructor(identifier?: any) + /** Overwrites the position of the point at the given [param index] with the supplied [param position]. */ + set_point_position(index: int64, position: Vector2): void + + /** Returns the position of the point at index [param index]. */ + get_point_position(index: int64): Vector2 + + /** Returns the number of points in the polyline. */ + get_point_count(): int64 + + /** Adds a point with the specified [param position] relative to the polyline's own position. If no [param index] is provided, the new point will be added to the end of the points array. + * If [param index] is given, the new point is inserted before the existing point identified by index [param index]. The indices of the points after the new point get increased by 1. The provided [param index] must not exceed the number of existing points in the polyline. See [method get_point_count]. + */ + add_point(position: Vector2, index: int64 = -1): void + + /** Removes the point at index [param index] from the polyline. */ + remove_point(index: int64): void + + /** Removes all points from the polyline, making it empty. */ + clear_points(): void + + /** The points of the polyline, interpreted in local 2D coordinates. Segments are drawn between the adjacent points in this array. */ + get points(): PackedVector2Array + set points(value: PackedVector2Array | Vector2[]) + + /** If `true` and the polyline has more than 2 points, the last point and the first one will be connected by a segment. + * + * **Note:** The shape of the closing segment is not guaranteed to be seamless if a [member width_curve] is provided. + * + * **Note:** The joint between the closing segment and the first segment is drawn first and it samples the [member gradient] and the [member width_curve] at the beginning. This is an implementation detail that might change in a future version. + */ + get closed(): boolean + set closed(value: boolean) + + /** The polyline's width. */ + get width(): float64 + set width(value: float64) + + /** The polyline's width curve. The width of the polyline over its length will be equivalent to the value of the width curve over its domain. The width curve should be a unit [Curve]. */ + get width_curve(): Curve + set width_curve(value: Curve) + + /** The color of the polyline. Will not be used if a gradient is set. */ + get default_color(): Color + set default_color(value: Color) + + /** The gradient is drawn through the whole line from start to finish. The [member default_color] will not be used if this property is set. */ + get gradient(): Gradient + set gradient(value: Gradient) + + /** The texture used for the polyline. Uses [member texture_mode] for drawing style. */ + get texture(): Texture2D + set texture(value: Texture2D) + + /** The style to render the [member texture] of the polyline. Use [enum LineTextureMode] constants. */ + get texture_mode(): int64 + set texture_mode(value: int64) + + /** The style of the connections between segments of the polyline. Use [enum LineJointMode] constants. */ + get joint_mode(): int64 + set joint_mode(value: int64) + + /** The style of the beginning of the polyline, if [member closed] is `false`. Use [enum LineCapMode] constants. */ + get begin_cap_mode(): int64 + set begin_cap_mode(value: int64) + + /** The style of the end of the polyline, if [member closed] is `false`. Use [enum LineCapMode] constants. */ + get end_cap_mode(): int64 + set end_cap_mode(value: int64) + + /** Determines the miter limit of the polyline. Normally, when [member joint_mode] is set to [constant LINE_JOINT_SHARP], sharp angles fall back to using the logic of [constant LINE_JOINT_BEVEL] joints to prevent very long miters. Higher values of this property mean that the fallback to a bevel joint will happen at sharper angles. */ + get sharp_limit(): float64 + set sharp_limit(value: float64) + + /** The smoothness used for rounded joints and caps. Higher values result in smoother corners, but are more demanding to render and update. */ + get round_precision(): int64 + set round_precision(value: int64) + + /** If `true`, the polyline's border will be anti-aliased. + * + * **Note:** [Line2D] is not accelerated by batching when being anti-aliased. + */ + get antialiased(): boolean + set antialiased(value: boolean) + } + class Line2DEditor = Record> extends AbstractPolygon2DEditor { + constructor(identifier?: any) + } + class Line2DEditorPlugin = Record> extends AbstractPolygon2DEditorPlugin { + constructor(identifier?: any) + } + namespace LineEdit { + enum MenuItems { + /** Cuts (copies and clears) the selected text. */ + MENU_CUT = 0, + + /** Copies the selected text. */ + MENU_COPY = 1, + + /** Pastes the clipboard text over the selected text (or at the caret's position). + * Non-printable escape characters are automatically stripped from the OS clipboard via [method String.strip_escapes]. + */ + MENU_PASTE = 2, + + /** Erases the whole [LineEdit] text. */ + MENU_CLEAR = 3, + + /** Selects the whole [LineEdit] text. */ + MENU_SELECT_ALL = 4, + + /** Undoes the previous action. */ + MENU_UNDO = 5, + + /** Reverse the last undo action. */ + MENU_REDO = 6, + + /** ID of "Text Writing Direction" submenu. */ + MENU_SUBMENU_TEXT_DIR = 7, + + /** Sets text direction to inherited. */ + MENU_DIR_INHERITED = 8, + + /** Sets text direction to automatic. */ + MENU_DIR_AUTO = 9, + + /** Sets text direction to left-to-right. */ + MENU_DIR_LTR = 10, + + /** Sets text direction to right-to-left. */ + MENU_DIR_RTL = 11, + + /** Toggles control character display. */ + MENU_DISPLAY_UCC = 12, + + /** ID of "Insert Control Character" submenu. */ + MENU_SUBMENU_INSERT_UCC = 13, + + /** Inserts left-to-right mark (LRM) character. */ + MENU_INSERT_LRM = 14, + + /** Inserts right-to-left mark (RLM) character. */ + MENU_INSERT_RLM = 15, + + /** Inserts start of left-to-right embedding (LRE) character. */ + MENU_INSERT_LRE = 16, + + /** Inserts start of right-to-left embedding (RLE) character. */ + MENU_INSERT_RLE = 17, + + /** Inserts start of left-to-right override (LRO) character. */ + MENU_INSERT_LRO = 18, + + /** Inserts start of right-to-left override (RLO) character. */ + MENU_INSERT_RLO = 19, + + /** Inserts pop direction formatting (PDF) character. */ + MENU_INSERT_PDF = 20, + + /** Inserts Arabic letter mark (ALM) character. */ + MENU_INSERT_ALM = 21, + + /** Inserts left-to-right isolate (LRI) character. */ + MENU_INSERT_LRI = 22, + + /** Inserts right-to-left isolate (RLI) character. */ + MENU_INSERT_RLI = 23, + + /** Inserts first strong isolate (FSI) character. */ + MENU_INSERT_FSI = 24, + + /** Inserts pop direction isolate (PDI) character. */ + MENU_INSERT_PDI = 25, + + /** Inserts zero width joiner (ZWJ) character. */ + MENU_INSERT_ZWJ = 26, + + /** Inserts zero width non-joiner (ZWNJ) character. */ + MENU_INSERT_ZWNJ = 27, + + /** Inserts word joiner (WJ) character. */ + MENU_INSERT_WJ = 28, + + /** Inserts soft hyphen (SHY) character. */ + MENU_INSERT_SHY = 29, + + /** Opens system emoji and symbol picker. */ + MENU_EMOJI_AND_SYMBOL = 30, + + /** Represents the size of the [enum MenuItems] enum. */ + MENU_MAX = 31, + } + enum VirtualKeyboardType { + /** Default text virtual keyboard. */ + KEYBOARD_TYPE_DEFAULT = 0, + + /** Multiline virtual keyboard. */ + KEYBOARD_TYPE_MULTILINE = 1, + + /** Virtual number keypad, useful for PIN entry. */ + KEYBOARD_TYPE_NUMBER = 2, + + /** Virtual number keypad, useful for entering fractional numbers. */ + KEYBOARD_TYPE_NUMBER_DECIMAL = 3, + + /** Virtual phone number keypad. */ + KEYBOARD_TYPE_PHONE = 4, + + /** Virtual keyboard with additional keys to assist with typing email addresses. */ + KEYBOARD_TYPE_EMAIL_ADDRESS = 5, + + /** Virtual keyboard for entering a password. On most platforms, this should disable autocomplete and autocapitalization. + * + * **Note:** This is not supported on Web. Instead, this behaves identically to [constant KEYBOARD_TYPE_DEFAULT]. + */ + KEYBOARD_TYPE_PASSWORD = 6, + + /** Virtual keyboard with additional keys to assist with typing URLs. */ + KEYBOARD_TYPE_URL = 7, + } + } + /** An input field for single-line text. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_lineedit.html + */ + class LineEdit = Record> extends Control { + constructor(identifier?: any) + /** Returns `true` if the user has text in the [url=https://en.wikipedia.org/wiki/Input_method]Input Method Editor[/url] (IME). */ + has_ime_text(): boolean + + /** Closes the [url=https://en.wikipedia.org/wiki/Input_method]Input Method Editor[/url] (IME) if it is open. Any text in the IME will be lost. */ + cancel_ime(): void + + /** Applies text from the [url=https://en.wikipedia.org/wiki/Input_method]Input Method Editor[/url] (IME) and closes the IME if it is open. */ + apply_ime(): void + + /** Allows entering edit mode whether the [LineEdit] is focused or not. + * See also [member keep_editing_on_text_submit]. + */ + edit(): void + + /** Allows exiting edit mode while preserving focus. */ + unedit(): void + + /** Returns whether the [LineEdit] is being edited. */ + is_editing(): boolean + + /** Erases the [LineEdit]'s [member text]. */ + clear(): void + + /** Selects characters inside [LineEdit] between [param from] and [param to]. By default, [param from] is at the beginning and [param to] at the end. + * + */ + select(from: int64 = 0, to: int64 = -1): void + + /** Selects the whole [String]. */ + select_all(): void + + /** Clears the current selection. */ + deselect(): void + + /** Returns `true` if an "undo" action is available. */ + has_undo(): boolean + + /** Returns `true` if a "redo" action is available. */ + has_redo(): boolean + + /** Returns `true` if the user has selected text. */ + has_selection(): boolean + + /** Returns the text inside the selection. */ + get_selected_text(): string + + /** Returns the selection begin column. */ + get_selection_from_column(): int64 + + /** Returns the selection end column. */ + get_selection_to_column(): int64 + + /** Returns the scroll offset due to [member caret_column], as a number of characters. */ + get_scroll_offset(): float64 + + /** Inserts [param text] at the caret. If the resulting value is longer than [member max_length], nothing happens. */ + insert_text_at_caret(text: string): void + + /** Deletes one character at the caret's current position (equivalent to pressing [kbd]Delete[/kbd]). */ + delete_char_at_caret(): void + + /** Deletes a section of the [member text] going from position [param from_column] to [param to_column]. Both parameters should be within the text's length. */ + delete_text(from_column: int64, to_column: int64): void + + /** Executes a given action as defined in the [enum MenuItems] enum. */ + menu_option(option: int64): void + + /** Returns the [PopupMenu] of this [LineEdit]. By default, this menu is displayed when right-clicking on the [LineEdit]. + * You can add custom menu items or remove standard ones. Make sure your IDs don't conflict with the standard ones (see [enum MenuItems]). For example: + * + * **Warning:** This is a required internal node, removing and freeing it may cause a crash. If you wish to hide it or any of its children, use their [member Window.visible] property. + */ + get_menu(): PopupMenu + + /** Returns whether the menu is visible. Use this instead of `get_menu().visible` to improve performance (so the creation of the menu is avoided). */ + is_menu_visible(): boolean + + /** String value of the [LineEdit]. + * + * **Note:** Changing text using this property won't emit the [signal text_changed] signal. + */ + get text(): string + set text(value: string) + + /** Text shown when the [LineEdit] is empty. It is **not** the [LineEdit]'s default value (see [member text]). */ + get placeholder_text(): string + set placeholder_text(value: string) + + /** Text alignment as defined in the [enum HorizontalAlignment] enum. */ + get alignment(): int64 + set alignment(value: int64) + + /** Maximum number of characters that can be entered inside the [LineEdit]. If `0`, there is no limit. + * When a limit is defined, characters that would exceed [member max_length] are truncated. This happens both for existing [member text] contents when setting the max length, or for new text inserted in the [LineEdit], including pasting. + * If any input text is truncated, the [signal text_change_rejected] signal is emitted with the truncated substring as parameter: + * + */ + get max_length(): int64 + set max_length(value: int64) + + /** If `false`, existing text cannot be modified and new text cannot be added. */ + get editable(): boolean + set editable(value: boolean) + + /** If `true`, the [LineEdit] will not exit edit mode when text is submitted by pressing `ui_text_submit` action (by default: [kbd]Enter[/kbd] or [kbd]Kp Enter[/kbd]). */ + get keep_editing_on_text_submit(): boolean + set keep_editing_on_text_submit(value: boolean) + + /** If `true`, the [LineEdit] width will increase to stay longer than the [member text]. It will **not** compress if the [member text] is shortened. */ + get expand_to_text_length(): boolean + set expand_to_text_length(value: boolean) + + /** If `true`, the context menu will appear when right-clicked. */ + get context_menu_enabled(): boolean + set context_menu_enabled(value: boolean) + + /** If `true`, "Emoji and Symbols" menu is enabled. */ + get emoji_menu_enabled(): boolean + set emoji_menu_enabled(value: boolean) + + /** If `true`, the native virtual keyboard is shown when focused on platforms that support it. */ + get virtual_keyboard_enabled(): boolean + set virtual_keyboard_enabled(value: boolean) + + /** Specifies the type of virtual keyboard to show. */ + get virtual_keyboard_type(): int64 + set virtual_keyboard_type(value: int64) + + /** If `true`, the [LineEdit] will show a clear button if [member text] is not empty, which can be used to clear the text quickly. */ + get clear_button_enabled(): boolean + set clear_button_enabled(value: boolean) + + /** If `true`, shortcut keys for context menu items are enabled, even if the context menu is disabled. */ + get shortcut_keys_enabled(): boolean + set shortcut_keys_enabled(value: boolean) + + /** If `false`, using middle mouse button to paste clipboard will be disabled. + * + * **Note:** This method is only implemented on Linux. + */ + get middle_mouse_paste_enabled(): boolean + set middle_mouse_paste_enabled(value: boolean) + + /** If `false`, it's impossible to select the text using mouse nor keyboard. */ + get selecting_enabled(): boolean + set selecting_enabled(value: boolean) + + /** If `true`, the selected text will be deselected when focus is lost. */ + get deselect_on_focus_loss_enabled(): boolean + set deselect_on_focus_loss_enabled(value: boolean) + + /** If `true`, allow drag and drop of selected text. */ + get drag_and_drop_selection_enabled(): boolean + set drag_and_drop_selection_enabled(value: boolean) + + /** Sets the icon that will appear in the right end of the [LineEdit] if there's no [member text], or always, if [member clear_button_enabled] is set to `false`. */ + get right_icon(): Texture2D + set right_icon(value: Texture2D) + + /** If `true`, the [LineEdit] doesn't display decoration. */ + get flat(): boolean + set flat(value: boolean) + + /** If `true`, control characters are displayed. */ + get draw_control_chars(): boolean + set draw_control_chars(value: boolean) + + /** If `true`, the [LineEdit] will select the whole text when it gains focus. */ + get select_all_on_focus(): boolean + set select_all_on_focus(value: boolean) + + /** If `true`, makes the caret blink. */ + get caret_blink(): boolean + set caret_blink(value: boolean) + + /** The interval at which the caret blinks (in seconds). */ + get caret_blink_interval(): float64 + set caret_blink_interval(value: float64) + + /** The caret's column position inside the [LineEdit]. When set, the text may scroll to accommodate it. */ + get caret_column(): int64 + set caret_column(value: int64) + + /** If `true`, the [LineEdit] will always show the caret, even if not editing or focus is lost. */ + get caret_force_displayed(): boolean + set caret_force_displayed(value: boolean) + + /** Allow moving caret, selecting and removing the individual composite character components. + * + * **Note:** [kbd]Backspace[/kbd] is always removing individual composite character components. + */ + get caret_mid_grapheme(): boolean + set caret_mid_grapheme(value: boolean) + + /** If `true`, every character is replaced with the secret character (see [member secret_character]). */ + get secret(): boolean + set secret(value: boolean) + + /** The character to use to mask secret input. Only a single character can be used as the secret character. If it is longer than one character, only the first one will be used. If it is empty, a space will be used instead. */ + get secret_character(): string + set secret_character(value: string) + + /** Base text writing direction. */ + get text_direction(): int64 + set text_direction(value: int64) + + /** Language code used for line-breaking and text shaping algorithms. If left empty, current locale is used instead. */ + get language(): string + set language(value: string) + + /** Set BiDi algorithm override for the structured text. */ + get structured_text_bidi_override(): int64 + set structured_text_bidi_override(value: int64) + + /** Set additional options for BiDi override. */ + get structured_text_bidi_override_options(): GArray + set structured_text_bidi_override_options(value: GArray) + + /** Emitted when the text changes. */ + readonly text_changed: Signal1 + + /** Emitted when appending text that overflows the [member max_length]. The appended text is truncated to fit [member max_length], and the part that couldn't fit is passed as the [param rejected_substring] argument. */ + readonly text_change_rejected: Signal1 + + /** Emitted when the user presses the `ui_text_submit` action (by default: [kbd]Enter[/kbd] or [kbd]Kp Enter[/kbd]) while the [LineEdit] has focus. */ + readonly text_submitted: Signal1 + + /** Emitted when the [LineEdit] switches in or out of edit mode. */ + readonly editing_toggled: Signal1 + } + namespace LinkButton { + enum UnderlineMode { + /** The LinkButton will always show an underline at the bottom of its text. */ + UNDERLINE_MODE_ALWAYS = 0, + + /** The LinkButton will show an underline at the bottom of its text when the mouse cursor is over it. */ + UNDERLINE_MODE_ON_HOVER = 1, + + /** The LinkButton will never show an underline at the bottom of its text. */ + UNDERLINE_MODE_NEVER = 2, + } + } + /** A button that represents a link. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_linkbutton.html + */ + class LinkButton = Record> extends BaseButton { + constructor(identifier?: any) + /** The button's text that will be displayed inside the button's area. */ + get text(): string + set text(value: string) + + /** The underline mode to use for the text. See [enum LinkButton.UnderlineMode] for the available modes. */ + get underline(): int64 + set underline(value: int64) + + /** The [url=https://en.wikipedia.org/wiki/Uniform_Resource_Identifier]URI[/url] for this [LinkButton]. If set to a valid URI, pressing the button opens the URI using the operating system's default program for the protocol (via [method OS.shell_open]). HTTP and HTTPS URLs open the default web browser. + * + */ + get uri(): string + set uri(value: string) + + /** Base text writing direction. */ + get text_direction(): int64 + set text_direction(value: int64) + + /** Language code used for line-breaking and text shaping algorithms, if left empty current locale is used instead. */ + get language(): string + set language(value: string) + + /** Set BiDi algorithm override for the structured text. */ + get structured_text_bidi_override(): int64 + set structured_text_bidi_override(value: int64) + + /** Set additional options for BiDi override. */ + get structured_text_bidi_override_options(): GArray + set structured_text_bidi_override_options(value: GArray) + } + class LocalizationEditor = Record> extends VBoxContainer { + constructor(identifier?: any) + update_translations(): void + readonly localization_changed: Signal0 + } + namespace LookAtModifier3D { + enum OriginFrom { + /** The bone rest position of the bone specified in [member bone] is used as origin. */ + ORIGIN_FROM_SELF = 0, + + /** The bone global pose position of the bone specified in [member origin_bone] is used as origin. + * + * **Note:** It is recommended that you select only the parent bone unless you are familiar with the bone processing process. The specified bone pose at the time the [LookAtModifier3D] is processed is used as a reference. In other words, if you specify a child bone and the [LookAtModifier3D] causes the child bone to move, the rendered result and direction will not match. + */ + ORIGIN_FROM_SPECIFIC_BONE = 1, + + /** The global position of the [Node3D] specified in [member origin_external_node] is used as origin. + * + * **Note:** Same as [constant ORIGIN_FROM_SPECIFIC_BONE], when specifying a [BoneAttachment3D] with a child bone assigned, the rendered result and direction will not match. + */ + ORIGIN_FROM_EXTERNAL_NODE = 2, + } + } + /** The [LookAtModifier3D] rotates a bone to look at a target. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_lookatmodifier3d.html + */ + class LookAtModifier3D = Record> extends SkeletonModifier3D { + constructor(identifier?: any) + /** Returns the remaining seconds of the time-based interpolation. */ + get_interpolation_remaining(): float64 + + /** Returns whether the time-based interpolation is running or not. If `true`, it is equivalent to [method get_interpolation_remaining] being `0`. + * This is useful to determine whether a [LookAtModifier3D] can be removed safely. + */ + is_interpolating(): boolean + + /** Returns whether the target is within the angle limitations. It is useful for unsetting the [member target_node] when the target is outside of the angle limitations. + * + * **Note:** The value is updated after [method SkeletonModifier3D._process_modification]. To retrieve this value correctly, we recommend using the signal [signal SkeletonModifier3D.modification_processed]. + */ + is_target_within_limitation(): boolean + + /** The [NodePath] to the node that is the target for the look at modification. This node is what the modification will rotate the bone to. */ + get target_node(): NodePath + set target_node(value: NodePath | string) + + /** The bone name of the [Skeleton3D] that the modification will operate on. */ + get bone_name(): string + set bone_name(value: string) + + /** Index of the [member bone_name] in the parent [Skeleton3D]. */ + get bone(): int64 + set bone(value: int64) + + /** The forward axis of the bone. This [SkeletonModifier3D] modifies the bone so that this axis points toward the [member target_node]. */ + get forward_axis(): int64 + set forward_axis(value: int64) + + /** The axis of the first rotation. This [SkeletonModifier3D] works by compositing the rotation by Euler angles to prevent to rotate the [member forward_axis]. */ + get primary_rotation_axis(): int64 + set primary_rotation_axis(value: int64) + + /** If `true`, provides rotation by two axes. */ + get use_secondary_rotation(): boolean + set use_secondary_rotation(value: boolean) + + /** This value determines from what origin is retrieved for use in the calculation of the forward vector. */ + get origin_from(): int64 + set origin_from(value: int64) + + /** If [member origin_from] is [constant ORIGIN_FROM_SPECIFIC_BONE], the bone global pose position specified for this is used as origin. */ + get origin_bone_name(): string + set origin_bone_name(value: string) + + /** Index of the [member origin_bone_name] in the parent [Skeleton3D]. */ + get origin_bone(): int64 + set origin_bone(value: int64) + + /** If [member origin_from] is [constant ORIGIN_FROM_EXTERNAL_NODE], the global position of the [Node3D] specified for this is used as origin. */ + get origin_external_node(): NodePath + set origin_external_node(value: NodePath | string) + + /** The offset of the bone pose origin. Matching the origins by offset is useful for cases where multiple bones must always face the same direction, such as the eyes. + * + * **Note:** This value indicates the local position of the object set in [member origin_from]. + */ + get origin_offset(): Vector3 + set origin_offset(value: Vector3) + + /** If the target passes through too close to the origin than this value, time-based interpolation is used even if the target is within the angular limitations, to prevent the angular velocity from becoming too high. */ + get origin_safe_margin(): float64 + set origin_safe_margin(value: float64) + + /** The duration of the time-based interpolation. Interpolation is triggered at the following cases: + * - When the target node is changed + * - When an axis is flipped due to angle limitation + * + * **Note:** The flipping occurs when the target is outside the angle limitation and the internally computed secondary rotation axis of the forward vector is flipped. Visually, it occurs when the target is outside the angle limitation and crosses the plane of the [member forward_axis] and [member primary_rotation_axis]. + */ + get duration(): float64 + set duration(value: float64) + + /** The transition type of the time-based interpolation. See also [enum Tween.TransitionType]. */ + get transition_type(): int64 + set transition_type(value: int64) + + /** The ease type of the time-based interpolation. See also [enum Tween.EaseType]. */ + get ease_type(): int64 + set ease_type(value: int64) + + /** If `true`, limits the degree of rotation. This helps prevent the character's neck from rotating 360 degrees. + * + * **Note:** As with [AnimationTree] blending, interpolation is provided that favors [method Skeleton3D.get_bone_rest]. This means that interpolation does not select the shortest path in some cases. + * + * **Note:** Some [member transition_type] may exceed the limitations (e.g. `Back`, `Elastic`, and `Spring`). If interpolation occurs while overshooting the limitations, the result might possibly not respect the bone rest. + */ + get use_angle_limitation(): boolean + set use_angle_limitation(value: boolean) + + /** If `true`, the limitations are spread from the bone symmetrically. + * If `false`, the limitation can be specified separately for each side of the bone rest. + */ + get symmetry_limitation(): boolean + set symmetry_limitation(value: boolean) + + /** The limit angle of the primary rotation when [member symmetry_limitation] is `true`. */ + get primary_limit_angle(): float64 + set primary_limit_angle(value: float64) + + /** The threshold to start damping for [member primary_limit_angle]. It provides non-linear (b-spline) interpolation, let it feel more resistance the more it rotate to the edge limit. This is useful for simulating the limits of human motion. + * If `1.0`, no damping is performed. If `0.0`, damping is always performed. + */ + get primary_damp_threshold(): float64 + set primary_damp_threshold(value: float64) + + /** The limit angle of positive side of the primary rotation when [member symmetry_limitation] is `false`. */ + get primary_positive_limit_angle(): float64 + set primary_positive_limit_angle(value: float64) + + /** The threshold to start damping for [member primary_positive_limit_angle]. */ + get primary_positive_damp_threshold(): float64 + set primary_positive_damp_threshold(value: float64) + + /** The limit angle of negative side of the primary rotation when [member symmetry_limitation] is `false`. */ + get primary_negative_limit_angle(): float64 + set primary_negative_limit_angle(value: float64) + + /** The threshold to start damping for [member primary_negative_limit_angle]. */ + get primary_negative_damp_threshold(): float64 + set primary_negative_damp_threshold(value: float64) + + /** The limit angle of the secondary rotation when [member symmetry_limitation] is `true`. */ + get secondary_limit_angle(): float64 + set secondary_limit_angle(value: float64) + + /** The threshold to start damping for [member secondary_limit_angle]. */ + get secondary_damp_threshold(): float64 + set secondary_damp_threshold(value: float64) + + /** The limit angle of positive side of the secondary rotation when [member symmetry_limitation] is `false`. */ + get secondary_positive_limit_angle(): float64 + set secondary_positive_limit_angle(value: float64) + + /** The threshold to start damping for [member secondary_positive_limit_angle]. */ + get secondary_positive_damp_threshold(): float64 + set secondary_positive_damp_threshold(value: float64) + + /** The limit angle of negative side of the secondary rotation when [member symmetry_limitation] is `false`. */ + get secondary_negative_limit_angle(): float64 + set secondary_negative_limit_angle(value: float64) + + /** The threshold to start damping for [member secondary_negative_limit_angle]. */ + get secondary_negative_damp_threshold(): float64 + set secondary_negative_damp_threshold(value: float64) + } + /** Abstract base class for the game's main loop. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_mainloop.html + */ + class MainLoop extends Object { + /** Notification received from the OS when the application is exceeding its allocated memory. + * Specific to the iOS platform. + */ + static readonly NOTIFICATION_OS_MEMORY_WARNING = 2009 + + /** Notification received when translations may have changed. Can be triggered by the user changing the locale. Can be used to respond to language changes, for example to change the UI strings on the fly. Useful when working with the built-in translation support, like [method Object.tr]. */ + static readonly NOTIFICATION_TRANSLATION_CHANGED = 2010 + + /** Notification received from the OS when a request for "About" information is sent. + * Specific to the macOS platform. + */ + static readonly NOTIFICATION_WM_ABOUT = 2011 + + /** Notification received from Godot's crash handler when the engine is about to crash. + * Implemented on desktop platforms if the crash handler is enabled. + */ + static readonly NOTIFICATION_CRASH = 2012 + + /** Notification received from the OS when an update of the Input Method Engine occurs (e.g. change of IME cursor position or composition string). + * Specific to the macOS platform. + */ + static readonly NOTIFICATION_OS_IME_UPDATE = 2013 + + /** Notification received from the OS when the application is resumed. + * Specific to the Android and iOS platforms. + */ + static readonly NOTIFICATION_APPLICATION_RESUMED = 2014 + + /** Notification received from the OS when the application is paused. + * Specific to the Android and iOS platforms. + * + * **Note:** On iOS, you only have approximately 5 seconds to finish a task started by this signal. If you go over this allotment, iOS will kill the app instead of pausing it. + */ + static readonly NOTIFICATION_APPLICATION_PAUSED = 2015 + + /** Notification received from the OS when the application is focused, i.e. when changing the focus from the OS desktop or a thirdparty application to any open window of the Godot instance. + * Implemented on desktop and mobile platforms. + */ + static readonly NOTIFICATION_APPLICATION_FOCUS_IN = 2016 + + /** Notification received from the OS when the application is defocused, i.e. when changing the focus from any open window of the Godot instance to the OS desktop or a thirdparty application. + * Implemented on desktop and mobile platforms. + */ + static readonly NOTIFICATION_APPLICATION_FOCUS_OUT = 2017 + + /** Notification received when text server is changed. */ + static readonly NOTIFICATION_TEXT_SERVER_CHANGED = 2018 + constructor(identifier?: any) + + /** Called once during initialization. */ + /* gdvirtual */ _initialize(): void + + /** Called each physics frame with the time since the last physics frame as argument ([param delta], in seconds). Equivalent to [method Node._physics_process]. + * If implemented, the method must return a boolean value. `true` ends the main loop, while `false` lets it proceed to the next frame. + * + * **Note:** [param delta] will be larger than expected if running at a framerate lower than [member Engine.physics_ticks_per_second] / [member Engine.max_physics_steps_per_frame] FPS. This is done to avoid "spiral of death" scenarios where performance would plummet due to an ever-increasing number of physics steps per frame. This behavior affects both [method _process] and [method _physics_process]. As a result, avoid using [param delta] for time measurements in real-world seconds. Use the [Time] singleton's methods for this purpose instead, such as [method Time.get_ticks_usec]. + */ + /* gdvirtual */ _physics_process(delta: float64): boolean + + /** Called each process (idle) frame with the time since the last process frame as argument (in seconds). Equivalent to [method Node._process]. + * If implemented, the method must return a boolean value. `true` ends the main loop, while `false` lets it proceed to the next frame. + * + * **Note:** [param delta] will be larger than expected if running at a framerate lower than [member Engine.physics_ticks_per_second] / [member Engine.max_physics_steps_per_frame] FPS. This is done to avoid "spiral of death" scenarios where performance would plummet due to an ever-increasing number of physics steps per frame. This behavior affects both [method _process] and [method _physics_process]. As a result, avoid using [param delta] for time measurements in real-world seconds. Use the [Time] singleton's methods for this purpose instead, such as [method Time.get_ticks_usec]. + */ + /* gdvirtual */ _process(delta: float64): boolean + + /** Called before the program exits. */ + /* gdvirtual */ _finalize(): void + + /** Emitted when a user responds to a permission request. */ + readonly on_request_permissions_result: Signal2 + } + /** A container that keeps a margin around its child controls. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_margincontainer.html + */ + class MarginContainer = Record> extends Container { + constructor(identifier?: any) + } + /** Generic 2D position hint for editing. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_marker2d.html + */ + class Marker2D = Record> extends Node2D { + constructor(identifier?: any) + /** Size of the gizmo cross that appears in the editor. */ + get gizmo_extents(): float64 + set gizmo_extents(value: float64) + } + /** Generic 3D position hint for editing. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_marker3d.html + */ + class Marker3D = Record> extends Node3D { + constructor(identifier?: any) + /** Size of the gizmo cross that appears in the editor. */ + get gizmo_extents(): float64 + set gizmo_extents(value: float64) + } + class Marker3DGizmoPlugin extends EditorNode3DGizmoPlugin { + constructor(identifier?: any) + } + /** Virtual base class for applying visual properties to an object, such as color and roughness. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_material.html + */ + class Material extends Resource { + /** Maximum value for the [member render_priority] parameter. */ + static readonly RENDER_PRIORITY_MAX = 127 + + /** Minimum value for the [member render_priority] parameter. */ + static readonly RENDER_PRIORITY_MIN = -128 + constructor(identifier?: any) + + /** Only exposed for the purpose of overriding. You cannot call this function directly. Used internally by various editor tools. Used to access the RID of the [Material]'s [Shader]. */ + /* gdvirtual */ _get_shader_rid(): RID + + /** Only exposed for the purpose of overriding. You cannot call this function directly. Used internally by various editor tools. */ + /* gdvirtual */ _get_shader_mode(): Shader.Mode + + /** Only exposed for the purpose of overriding. You cannot call this function directly. Used internally to determine if [member next_pass] should be shown in the editor or not. */ + /* gdvirtual */ _can_do_next_pass(): boolean + + /** Only exposed for the purpose of overriding. You cannot call this function directly. Used internally to determine if [member render_priority] should be shown in the editor or not. */ + /* gdvirtual */ _can_use_render_priority(): boolean + + /** Only available when running in the editor. Opens a popup that visualizes the generated shader code, including all variants and internal shader code. See also [method Shader.inspect_native_shader_code]. */ + inspect_native_shader_code(): void + + /** Creates a placeholder version of this resource ([PlaceholderMaterial]). */ + create_placeholder(): Resource + + /** Sets the render priority for objects in 3D scenes. Higher priority objects will be sorted in front of lower priority objects. In other words, all objects with [member render_priority] `1` will render before all objects with [member render_priority] `0`. + * + * **Note:** This only applies to [StandardMaterial3D]s and [ShaderMaterial]s with type "Spatial". + * + * **Note:** This will not impact how transparent objects are sorted relative to opaque objects or how dynamic meshes will be sorted relative to other opaque meshes. This is because all transparent objects are drawn after all opaque objects and all dynamic opaque meshes are drawn before other opaque meshes. + */ + get render_priority(): int64 + set render_priority(value: int64) + + /** Sets the [Material] to be used for the next pass. This renders the object again using a different material. + * + * **Note:** [member next_pass] materials are not necessarily drawn immediately after the source [Material]. Draw order is determined by material properties, [member render_priority], and distance to camera. + * + * **Note:** This only applies to [StandardMaterial3D]s and [ShaderMaterial]s with type "Spatial". + */ + get next_pass(): Material + set next_pass(value: Material) + } + class MaterialEditorPlugin = Record> extends EditorPlugin { + constructor(identifier?: any) + } + /** A horizontal menu bar that creates a menu for each [PopupMenu] child. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_menubar.html + */ + class MenuBar = Record> extends Control { + constructor(identifier?: any) + /** If `true`, shortcuts are disabled and cannot be used to trigger the button. */ + set_disable_shortcuts(disabled: boolean): void + + /** Returns `true`, if system global menu is supported and used by this [MenuBar]. */ + is_native_menu(): boolean + + /** Returns number of menu items. */ + get_menu_count(): int64 + + /** Sets menu item title. */ + set_menu_title(menu: int64, title: string): void + + /** Returns menu item title. */ + get_menu_title(menu: int64): string + + /** Sets menu item tooltip. */ + set_menu_tooltip(menu: int64, tooltip: string): void + + /** Returns menu item tooltip. */ + get_menu_tooltip(menu: int64): string + + /** If `true`, menu item is disabled. */ + set_menu_disabled(menu: int64, disabled: boolean): void + + /** Returns `true`, if menu item is disabled. */ + is_menu_disabled(menu: int64): boolean + + /** If `true`, menu item is hidden. */ + set_menu_hidden(menu: int64, hidden: boolean): void + + /** Returns `true`, if menu item is hidden. */ + is_menu_hidden(menu: int64): boolean + + /** Returns [PopupMenu] associated with menu item. */ + get_menu_popup(menu: int64): PopupMenu + + /** Flat [MenuBar] don't display item decoration. */ + get flat(): boolean + set flat(value: boolean) + + /** Position order in the global menu to insert [MenuBar] items at. All menu items in the [MenuBar] are always inserted as a continuous range. Menus with lower [member start_index] are inserted first. Menus with [member start_index] equal to `-1` are inserted last. */ + get start_index(): int64 + set start_index(value: int64) + + /** If `true`, when the cursor hovers above menu item, it will close the current [PopupMenu] and open the other one. */ + get switch_on_hover(): boolean + set switch_on_hover(value: boolean) + + /** If `true`, [MenuBar] will use system global menu when supported. + * + * **Note:** If `true` and global menu is supported, this node is not displayed, has zero size, and all its child nodes except [PopupMenu]s are inaccessible. + * + * **Note:** This property overrides the value of the [member PopupMenu.prefer_native_menu] property of the child nodes. + */ + get prefer_global_menu(): boolean + set prefer_global_menu(value: boolean) + + /** Base text writing direction. */ + get text_direction(): int64 + set text_direction(value: int64) + + /** Language code used for line-breaking and text shaping algorithms, if left empty current locale is used instead. */ + get language(): string + set language(value: string) + } + /** A button that brings up a [PopupMenu] when clicked. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_menubutton.html + */ + class MenuButton = Record> extends Button { + constructor(identifier?: any) + /** Returns the [PopupMenu] contained in this button. + * **Warning:** This is a required internal node, removing and freeing it may cause a crash. If you wish to hide it or any of its children, use their [member Window.visible] property. + */ + get_popup(): PopupMenu + + /** Adjusts popup position and sizing for the [MenuButton], then shows the [PopupMenu]. Prefer this over using `get_popup().popup()`. */ + show_popup(): void + + /** If `true`, shortcuts are disabled and cannot be used to trigger the button. */ + set_disable_shortcuts(disabled: boolean): void + + /** If `true`, when the cursor hovers above another [MenuButton] within the same parent which also has [member switch_on_hover] enabled, it will close the current [MenuButton] and open the other one. */ + get switch_on_hover(): boolean + set switch_on_hover(value: boolean) + + /** The number of items currently in the list. */ + get item_count(): any /*Items,popup/item_*/ + set item_count(value: any /*Items,popup/item_*/) + + /** Emitted when the [PopupMenu] of this MenuButton is about to show. */ + readonly about_to_popup: Signal0 + } + namespace Mesh { + enum PrimitiveType { + /** Render array as points (one vertex equals one point). */ + PRIMITIVE_POINTS = 0, + + /** Render array as lines (every two vertices a line is created). */ + PRIMITIVE_LINES = 1, + + /** Render array as line strip. */ + PRIMITIVE_LINE_STRIP = 2, + + /** Render array as triangles (every three vertices a triangle is created). */ + PRIMITIVE_TRIANGLES = 3, + + /** Render array as triangle strips. */ + PRIMITIVE_TRIANGLE_STRIP = 4, + } + enum ArrayType { + /** [PackedVector3Array], [PackedVector2Array], or [Array] of vertex positions. */ + ARRAY_VERTEX = 0, + + /** [PackedVector3Array] of vertex normals. + * + * **Note:** The array has to consist of normal vectors, otherwise they will be normalized by the engine, potentially causing visual discrepancies. + */ + ARRAY_NORMAL = 1, + + /** [PackedFloat32Array] of vertex tangents. Each element in groups of 4 floats, first 3 floats determine the tangent, and the last the binormal direction as -1 or 1. */ + ARRAY_TANGENT = 2, + + /** [PackedColorArray] of vertex colors. */ + ARRAY_COLOR = 3, + + /** [PackedVector2Array] for UV coordinates. */ + ARRAY_TEX_UV = 4, + + /** [PackedVector2Array] for second UV coordinates. */ + ARRAY_TEX_UV2 = 5, + + /** Contains custom color channel 0. [PackedByteArray] if `(format >> Mesh.ARRAY_FORMAT_CUSTOM0_SHIFT) & Mesh.ARRAY_FORMAT_CUSTOM_MASK` is [constant ARRAY_CUSTOM_RGBA8_UNORM], [constant ARRAY_CUSTOM_RGBA8_SNORM], [constant ARRAY_CUSTOM_RG_HALF], or [constant ARRAY_CUSTOM_RGBA_HALF]. [PackedFloat32Array] otherwise. */ + ARRAY_CUSTOM0 = 6, + + /** Contains custom color channel 1. [PackedByteArray] if `(format >> Mesh.ARRAY_FORMAT_CUSTOM1_SHIFT) & Mesh.ARRAY_FORMAT_CUSTOM_MASK` is [constant ARRAY_CUSTOM_RGBA8_UNORM], [constant ARRAY_CUSTOM_RGBA8_SNORM], [constant ARRAY_CUSTOM_RG_HALF], or [constant ARRAY_CUSTOM_RGBA_HALF]. [PackedFloat32Array] otherwise. */ + ARRAY_CUSTOM1 = 7, + + /** Contains custom color channel 2. [PackedByteArray] if `(format >> Mesh.ARRAY_FORMAT_CUSTOM2_SHIFT) & Mesh.ARRAY_FORMAT_CUSTOM_MASK` is [constant ARRAY_CUSTOM_RGBA8_UNORM], [constant ARRAY_CUSTOM_RGBA8_SNORM], [constant ARRAY_CUSTOM_RG_HALF], or [constant ARRAY_CUSTOM_RGBA_HALF]. [PackedFloat32Array] otherwise. */ + ARRAY_CUSTOM2 = 8, + + /** Contains custom color channel 3. [PackedByteArray] if `(format >> Mesh.ARRAY_FORMAT_CUSTOM3_SHIFT) & Mesh.ARRAY_FORMAT_CUSTOM_MASK` is [constant ARRAY_CUSTOM_RGBA8_UNORM], [constant ARRAY_CUSTOM_RGBA8_SNORM], [constant ARRAY_CUSTOM_RG_HALF], or [constant ARRAY_CUSTOM_RGBA_HALF]. [PackedFloat32Array] otherwise. */ + ARRAY_CUSTOM3 = 9, + + /** [PackedFloat32Array] or [PackedInt32Array] of bone indices. Contains either 4 or 8 numbers per vertex depending on the presence of the [constant ARRAY_FLAG_USE_8_BONE_WEIGHTS] flag. */ + ARRAY_BONES = 10, + + /** [PackedFloat32Array] or [PackedFloat64Array] of bone weights in the range `0.0` to `1.0` (inclusive). Contains either 4 or 8 numbers per vertex depending on the presence of the [constant ARRAY_FLAG_USE_8_BONE_WEIGHTS] flag. */ + ARRAY_WEIGHTS = 11, + + /** [PackedInt32Array] of integers used as indices referencing vertices, colors, normals, tangents, and textures. All of those arrays must have the same number of elements as the vertex array. No index can be beyond the vertex array size. When this index array is present, it puts the function into "index mode," where the index selects the *i* 'th vertex, normal, tangent, color, UV, etc. This means if you want to have different normals or colors along an edge, you have to duplicate the vertices. + * For triangles, the index array is interpreted as triples, referring to the vertices of each triangle. For lines, the index array is in pairs indicating the start and end of each line. + */ + ARRAY_INDEX = 12, + + /** Represents the size of the [enum ArrayType] enum. */ + ARRAY_MAX = 13, + } + enum ArrayCustomFormat { + /** Indicates this custom channel contains unsigned normalized byte colors from 0 to 1, encoded as [PackedByteArray]. */ + ARRAY_CUSTOM_RGBA8_UNORM = 0, + + /** Indicates this custom channel contains signed normalized byte colors from -1 to 1, encoded as [PackedByteArray]. */ + ARRAY_CUSTOM_RGBA8_SNORM = 1, + + /** Indicates this custom channel contains half precision float colors, encoded as [PackedByteArray]. Only red and green channels are used. */ + ARRAY_CUSTOM_RG_HALF = 2, + + /** Indicates this custom channel contains half precision float colors, encoded as [PackedByteArray]. */ + ARRAY_CUSTOM_RGBA_HALF = 3, + + /** Indicates this custom channel contains full float colors, in a [PackedFloat32Array]. Only the red channel is used. */ + ARRAY_CUSTOM_R_FLOAT = 4, + + /** Indicates this custom channel contains full float colors, in a [PackedFloat32Array]. Only red and green channels are used. */ + ARRAY_CUSTOM_RG_FLOAT = 5, + + /** Indicates this custom channel contains full float colors, in a [PackedFloat32Array]. Only red, green and blue channels are used. */ + ARRAY_CUSTOM_RGB_FLOAT = 6, + + /** Indicates this custom channel contains full float colors, in a [PackedFloat32Array]. */ + ARRAY_CUSTOM_RGBA_FLOAT = 7, + + /** Represents the size of the [enum ArrayCustomFormat] enum. */ + ARRAY_CUSTOM_MAX = 8, + } + enum ArrayFormat { + /** Mesh array contains vertices. All meshes require a vertex array so this should always be present. */ + ARRAY_FORMAT_VERTEX = 1, + + /** Mesh array contains normals. */ + ARRAY_FORMAT_NORMAL = 2, + + /** Mesh array contains tangents. */ + ARRAY_FORMAT_TANGENT = 4, + + /** Mesh array contains colors. */ + ARRAY_FORMAT_COLOR = 8, + + /** Mesh array contains UVs. */ + ARRAY_FORMAT_TEX_UV = 16, + + /** Mesh array contains second UV. */ + ARRAY_FORMAT_TEX_UV2 = 32, + + /** Mesh array contains custom channel index 0. */ + ARRAY_FORMAT_CUSTOM0 = 64, + + /** Mesh array contains custom channel index 1. */ + ARRAY_FORMAT_CUSTOM1 = 128, + + /** Mesh array contains custom channel index 2. */ + ARRAY_FORMAT_CUSTOM2 = 256, + + /** Mesh array contains custom channel index 3. */ + ARRAY_FORMAT_CUSTOM3 = 512, + + /** Mesh array contains bones. */ + ARRAY_FORMAT_BONES = 1024, + + /** Mesh array contains bone weights. */ + ARRAY_FORMAT_WEIGHTS = 2048, + + /** Mesh array uses indices. */ + ARRAY_FORMAT_INDEX = 4096, + + /** Mask of mesh channels permitted in blend shapes. */ + ARRAY_FORMAT_BLEND_SHAPE_MASK = 7, + + /** Shift of first custom channel. */ + ARRAY_FORMAT_CUSTOM_BASE = 13, + + /** Number of format bits per custom channel. See [enum ArrayCustomFormat]. */ + ARRAY_FORMAT_CUSTOM_BITS = 3, + + /** Amount to shift [enum ArrayCustomFormat] for custom channel index 0. */ + ARRAY_FORMAT_CUSTOM0_SHIFT = 13, + + /** Amount to shift [enum ArrayCustomFormat] for custom channel index 1. */ + ARRAY_FORMAT_CUSTOM1_SHIFT = 16, + + /** Amount to shift [enum ArrayCustomFormat] for custom channel index 2. */ + ARRAY_FORMAT_CUSTOM2_SHIFT = 19, + + /** Amount to shift [enum ArrayCustomFormat] for custom channel index 3. */ + ARRAY_FORMAT_CUSTOM3_SHIFT = 22, + + /** Mask of custom format bits per custom channel. Must be shifted by one of the SHIFT constants. See [enum ArrayCustomFormat]. */ + ARRAY_FORMAT_CUSTOM_MASK = 7, + + /** Shift of first compress flag. Compress flags should be passed to [method ArrayMesh.add_surface_from_arrays] and [method SurfaceTool.commit]. */ + ARRAY_COMPRESS_FLAGS_BASE = 25, + + /** Flag used to mark that the array contains 2D vertices. */ + ARRAY_FLAG_USE_2D_VERTICES = 33554432, + + /** Flag indices that the mesh data will use `GL_DYNAMIC_DRAW` on GLES. Unused on Vulkan. */ + ARRAY_FLAG_USE_DYNAMIC_UPDATE = 67108864, + + /** Flag used to mark that the mesh contains up to 8 bone influences per vertex. This flag indicates that [constant ARRAY_BONES] and [constant ARRAY_WEIGHTS] elements will have double length. */ + ARRAY_FLAG_USE_8_BONE_WEIGHTS = 134217728, + + /** Flag used to mark that the mesh intentionally contains no vertex array. */ + ARRAY_FLAG_USES_EMPTY_VERTEX_ARRAY = 268435456, + + /** Flag used to mark that a mesh is using compressed attributes (vertices, normals, tangents, UVs). When this form of compression is enabled, vertex positions will be packed into an RGBA16UNORM attribute and scaled in the vertex shader. The normal and tangent will be packed into an RG16UNORM representing an axis, and a 16-bit float stored in the A-channel of the vertex. UVs will use 16-bit normalized floats instead of full 32-bit signed floats. When using this compression mode you must use either vertices, normals, and tangents or only vertices. You cannot use normals without tangents. Importers will automatically enable this compression if they can. */ + ARRAY_FLAG_COMPRESS_ATTRIBUTES = 536870912, + } + enum BlendShapeMode { + /** Blend shapes are normalized. */ + BLEND_SHAPE_MODE_NORMALIZED = 0, + + /** Blend shapes are relative to base weight. */ + BLEND_SHAPE_MODE_RELATIVE = 1, + } + } + /** A [Resource] that contains vertex array-based geometry. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_mesh.html + */ + class Mesh extends Resource { + constructor(identifier?: any) + /** Virtual method to override the surface count for a custom class extending [Mesh]. */ + /* gdvirtual */ _get_surface_count(): int64 + + /** Virtual method to override the surface array length for a custom class extending [Mesh]. */ + /* gdvirtual */ _surface_get_array_len(index: int64): int64 + + /** Virtual method to override the surface array index length for a custom class extending [Mesh]. */ + /* gdvirtual */ _surface_get_array_index_len(index: int64): int64 + + /** Virtual method to override the surface arrays for a custom class extending [Mesh]. */ + /* gdvirtual */ _surface_get_arrays(index: int64): GArray + + /** Virtual method to override the blend shape arrays for a custom class extending [Mesh]. */ + /* gdvirtual */ _surface_get_blend_shape_arrays(index: int64): GArray + + /** Virtual method to override the surface LODs for a custom class extending [Mesh]. */ + /* gdvirtual */ _surface_get_lods(index: int64): GDictionary + + /** Virtual method to override the surface format for a custom class extending [Mesh]. */ + /* gdvirtual */ _surface_get_format(index: int64): int64 + + /** Virtual method to override the surface primitive type for a custom class extending [Mesh]. */ + /* gdvirtual */ _surface_get_primitive_type(index: int64): int64 + + /** Virtual method to override the setting of a [param material] at the given [param index] for a custom class extending [Mesh]. */ + /* gdvirtual */ _surface_set_material(index: int64, material: Material): void + + /** Virtual method to override the surface material for a custom class extending [Mesh]. */ + /* gdvirtual */ _surface_get_material(index: int64): Material + + /** Virtual method to override the number of blend shapes for a custom class extending [Mesh]. */ + /* gdvirtual */ _get_blend_shape_count(): int64 + + /** Virtual method to override the retrieval of blend shape names for a custom class extending [Mesh]. */ + /* gdvirtual */ _get_blend_shape_name(index: int64): StringName + + /** Virtual method to override the names of blend shapes for a custom class extending [Mesh]. */ + /* gdvirtual */ _set_blend_shape_name(index: int64, name: StringName): void + + /** Virtual method to override the [AABB] for a custom class extending [Mesh]. */ + /* gdvirtual */ _get_aabb(): AABB + + /** Returns the smallest [AABB] enclosing this mesh in local space. Not affected by `custom_aabb`. + * + * **Note:** This is only implemented for [ArrayMesh] and [PrimitiveMesh]. + */ + get_aabb(): AABB + + /** Returns all the vertices that make up the faces of the mesh. Each three vertices represent one triangle. */ + get_faces(): PackedVector3Array + + /** Returns the number of surfaces that the [Mesh] holds. This is equivalent to [method MeshInstance3D.get_surface_override_material_count]. */ + get_surface_count(): int64 + + /** Returns the arrays for the vertices, normals, UVs, etc. that make up the requested surface (see [method ArrayMesh.add_surface_from_arrays]). */ + surface_get_arrays(surf_idx: int64): GArray + + /** Returns the blend shape arrays for the requested surface. */ + surface_get_blend_shape_arrays(surf_idx: int64): GArray + + /** Sets a [Material] for a given surface. Surface will be rendered using this material. + * + * **Note:** This assigns the material within the [Mesh] resource, not the [Material] associated to the [MeshInstance3D]'s Surface Material Override properties. To set the [Material] associated to the [MeshInstance3D]'s Surface Material Override properties, use [method MeshInstance3D.set_surface_override_material] instead. + */ + surface_set_material(surf_idx: int64, material: Material): void + + /** Returns a [Material] in a given surface. Surface is rendered using this material. + * + * **Note:** This returns the material within the [Mesh] resource, not the [Material] associated to the [MeshInstance3D]'s Surface Material Override properties. To get the [Material] associated to the [MeshInstance3D]'s Surface Material Override properties, use [method MeshInstance3D.get_surface_override_material] instead. + */ + surface_get_material(surf_idx: int64): Material + + /** Creates a placeholder version of this resource ([PlaceholderMesh]). */ + create_placeholder(): Resource + + /** Calculate a [ConcavePolygonShape3D] from the mesh. */ + create_trimesh_shape(): ConcavePolygonShape3D + + /** Calculate a [ConvexPolygonShape3D] from the mesh. + * If [param clean] is `true` (default), duplicate and interior vertices are removed automatically. You can set it to `false` to make the process faster if not needed. + * If [param simplify] is `true`, the geometry can be further simplified to reduce the number of vertices. Disabled by default. + */ + create_convex_shape(clean: boolean = true, simplify: boolean = false): ConvexPolygonShape3D + + /** Calculate an outline mesh at a defined offset (margin) from the original mesh. + * + * **Note:** This method typically returns the vertices in reverse order (e.g. clockwise to counterclockwise). + */ + create_outline(margin: float64): Mesh + + /** Generate a [TriangleMesh] from the mesh. Considers only surfaces using one of these primitive types: [constant PRIMITIVE_TRIANGLES], [constant PRIMITIVE_TRIANGLE_STRIP]. */ + generate_triangle_mesh(): TriangleMesh + + /** Sets a hint to be used for lightmap resolution. */ + get lightmap_size_hint(): Vector2i + set lightmap_size_hint(value: Vector2i) + } + namespace MeshConvexDecompositionSettings { + enum Mode { + /** Constant for voxel-based approximate convex decomposition. */ + CONVEX_DECOMPOSITION_MODE_VOXEL = 0, + + /** Constant for tetrahedron-based approximate convex decomposition. */ + CONVEX_DECOMPOSITION_MODE_TETRAHEDRON = 1, + } + } + /** Parameters to be used with a [Mesh] convex decomposition operation. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_meshconvexdecompositionsettings.html + */ + class MeshConvexDecompositionSettings extends RefCounted { + constructor(identifier?: any) + /** Maximum concavity. Ranges from `0.0` to `1.0`. */ + get max_concavity(): float64 + set max_concavity(value: float64) + + /** Controls the bias toward clipping along symmetry planes. Ranges from `0.0` to `1.0`. */ + get symmetry_planes_clipping_bias(): float64 + set symmetry_planes_clipping_bias(value: float64) + + /** Controls the bias toward clipping along revolution axes. Ranges from `0.0` to `1.0`. */ + get revolution_axes_clipping_bias(): float64 + set revolution_axes_clipping_bias(value: float64) + + /** Controls the adaptive sampling of the generated convex-hulls. Ranges from `0.0` to `0.01`. */ + get min_volume_per_convex_hull(): float64 + set min_volume_per_convex_hull(value: float64) + + /** Maximum number of voxels generated during the voxelization stage. */ + get resolution(): int64 + set resolution(value: int64) + + /** Controls the maximum number of triangles per convex-hull. Ranges from `4` to `1024`. */ + get max_num_vertices_per_convex_hull(): int64 + set max_num_vertices_per_convex_hull(value: int64) + + /** Controls the granularity of the search for the "best" clipping plane. Ranges from `1` to `16`. */ + get plane_downsampling(): int64 + set plane_downsampling(value: int64) + + /** Controls the precision of the convex-hull generation process during the clipping plane selection stage. Ranges from `1` to `16`. */ + get convex_hull_downsampling(): int64 + set convex_hull_downsampling(value: int64) + + /** If `true`, normalizes the mesh before applying the convex decomposition. */ + get normalize_mesh(): boolean + set normalize_mesh(value: boolean) + + /** Mode for the approximate convex decomposition. */ + get mode(): int64 + set mode(value: int64) + + /** If `true`, uses approximation for computing convex hulls. */ + get convex_hull_approximation(): boolean + set convex_hull_approximation(value: boolean) + + /** The maximum number of convex hulls to produce from the merge operation. */ + get max_convex_hulls(): int64 + set max_convex_hulls(value: int64) + + /** If `true`, projects output convex hull vertices onto the original source mesh to increase floating-point accuracy of the results. */ + get project_hull_vertices(): boolean + set project_hull_vertices(value: boolean) + } + /** Helper tool to access and edit [Mesh] data. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_meshdatatool.html + */ + class MeshDataTool extends RefCounted { + constructor(identifier?: any) + /** Clears all data currently in MeshDataTool. */ + clear(): void + + /** Uses specified surface of given [Mesh] to populate data for MeshDataTool. + * Requires [Mesh] with primitive type [constant Mesh.PRIMITIVE_TRIANGLES]. + */ + create_from_surface(mesh: ArrayMesh, surface: int64): GError + + /** Adds a new surface to specified [Mesh] with edited data. */ + commit_to_surface(mesh: ArrayMesh, compression_flags: int64 = 0): GError + + /** Returns the [Mesh]'s format as a combination of the [enum Mesh.ArrayFormat] flags. For example, a mesh containing both vertices and normals would return a format of `3` because [constant Mesh.ARRAY_FORMAT_VERTEX] is `1` and [constant Mesh.ARRAY_FORMAT_NORMAL] is `2`. */ + get_format(): int64 + + /** Returns the total number of vertices in [Mesh]. */ + get_vertex_count(): int64 + + /** Returns the number of edges in this [Mesh]. */ + get_edge_count(): int64 + + /** Returns the number of faces in this [Mesh]. */ + get_face_count(): int64 + + /** Sets the position of the given vertex. */ + set_vertex(idx: int64, vertex: Vector3): void + + /** Returns the position of the given vertex. */ + get_vertex(idx: int64): Vector3 + + /** Sets the normal of the given vertex. */ + set_vertex_normal(idx: int64, normal: Vector3): void + + /** Returns the normal of the given vertex. */ + get_vertex_normal(idx: int64): Vector3 + + /** Sets the tangent of the given vertex. */ + set_vertex_tangent(idx: int64, tangent: Plane): void + + /** Returns the tangent of the given vertex. */ + get_vertex_tangent(idx: int64): Plane + + /** Sets the UV of the given vertex. */ + set_vertex_uv(idx: int64, uv: Vector2): void + + /** Returns the UV of the given vertex. */ + get_vertex_uv(idx: int64): Vector2 + + /** Sets the UV2 of the given vertex. */ + set_vertex_uv2(idx: int64, uv2: Vector2): void + + /** Returns the UV2 of the given vertex. */ + get_vertex_uv2(idx: int64): Vector2 + + /** Sets the color of the given vertex. */ + set_vertex_color(idx: int64, color: Color): void + + /** Returns the color of the given vertex. */ + get_vertex_color(idx: int64): Color + + /** Sets the bones of the given vertex. */ + set_vertex_bones(idx: int64, bones: PackedInt32Array | int32[]): void + + /** Returns the bones of the given vertex. */ + get_vertex_bones(idx: int64): PackedInt32Array + + /** Sets the bone weights of the given vertex. */ + set_vertex_weights(idx: int64, weights: PackedFloat32Array | float32[]): void + + /** Returns bone weights of the given vertex. */ + get_vertex_weights(idx: int64): PackedFloat32Array + + /** Sets the metadata associated with the given vertex. */ + set_vertex_meta(idx: int64, meta: any): void + + /** Returns the metadata associated with the given vertex. */ + get_vertex_meta(idx: int64): any + + /** Returns an array of edges that share the given vertex. */ + get_vertex_edges(idx: int64): PackedInt32Array + + /** Returns an array of faces that share the given vertex. */ + get_vertex_faces(idx: int64): PackedInt32Array + + /** Returns index of specified vertex connected to given edge. + * Vertex argument can only be 0 or 1 because edges are comprised of two vertices. + */ + get_edge_vertex(idx: int64, vertex: int64): int64 + + /** Returns array of faces that touch given edge. */ + get_edge_faces(idx: int64): PackedInt32Array + + /** Sets the metadata of the given edge. */ + set_edge_meta(idx: int64, meta: any): void + + /** Returns meta information assigned to given edge. */ + get_edge_meta(idx: int64): any + + /** Returns the specified vertex index of the given face. + * [param vertex] must be either `0`, `1`, or `2` because faces contain three vertices. + * + */ + get_face_vertex(idx: int64, vertex: int64): int64 + + /** Returns specified edge associated with given face. + * Edge argument must be either 0, 1, or 2 because a face only has three edges. + */ + get_face_edge(idx: int64, edge: int64): int64 + + /** Sets the metadata of the given face. */ + set_face_meta(idx: int64, meta: any): void + + /** Returns the metadata associated with the given face. */ + get_face_meta(idx: int64): any + + /** Calculates and returns the face normal of the given face. */ + get_face_normal(idx: int64): Vector3 + + /** Sets the material to be used by newly-constructed [Mesh]. */ + set_material(material: Material): void + + /** Returns the material assigned to the [Mesh]. */ + get_material(): Material + } + class MeshEditorPlugin = Record> extends EditorPlugin { + constructor(identifier?: any) + } + /** Node used for displaying a [Mesh] in 2D. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_meshinstance2d.html + */ + class MeshInstance2D = Record> extends Node2D { + constructor(identifier?: any) + /** The [Mesh] that will be drawn by the [MeshInstance2D]. */ + get mesh(): Mesh + set mesh(value: Mesh) + + /** The [Texture2D] that will be used if using the default [CanvasItemMaterial]. Can be accessed as `TEXTURE` in CanvasItem shader. */ + get texture(): Texture2D + set texture(value: Texture2D) + + /** Emitted when the [member texture] is changed. */ + readonly texture_changed: Signal0 + } + /** Node that instances meshes into a scenario. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_meshinstance3d.html + */ + class MeshInstance3D = Record> extends GeometryInstance3D { + constructor(identifier?: any) + /** Returns the internal [SkinReference] containing the skeleton's [RID] attached to this RID. See also [method Resource.get_rid], [method SkinReference.get_skeleton], and [method RenderingServer.instance_attach_skeleton]. */ + get_skin_reference(): SkinReference + + /** Returns the number of surface override materials. This is equivalent to [method Mesh.get_surface_count]. See also [method get_surface_override_material]. */ + get_surface_override_material_count(): int64 + + /** Sets the override [param material] for the specified [param surface] of the [Mesh] resource. This material is associated with this [MeshInstance3D] rather than with [member mesh]. + * + * **Note:** This assigns the [Material] associated to the [MeshInstance3D]'s Surface Material Override properties, not the material within the [Mesh] resource. To set the material within the [Mesh] resource, use [method Mesh.surface_set_material] instead. + */ + set_surface_override_material(surface: int64, material: Material): void + + /** Returns the override [Material] for the specified [param surface] of the [Mesh] resource. See also [method get_surface_override_material_count]. + * + * **Note:** This returns the [Material] associated to the [MeshInstance3D]'s Surface Material Override properties, not the material within the [Mesh] resource. To get the material within the [Mesh] resource, use [method Mesh.surface_get_material] instead. + */ + get_surface_override_material(surface: int64): Material + + /** Returns the [Material] that will be used by the [Mesh] when drawing. This can return the [member GeometryInstance3D.material_override], the surface override [Material] defined in this [MeshInstance3D], or the surface [Material] defined in the [member mesh]. For example, if [member GeometryInstance3D.material_override] is used, all surfaces will return the override material. + * Returns `null` if no material is active, including when [member mesh] is `null`. + */ + get_active_material(surface: int64): Material + + /** This helper creates a [StaticBody3D] child node with a [ConcavePolygonShape3D] collision shape calculated from the mesh geometry. It's mainly used for testing. */ + create_trimesh_collision(): void + + /** This helper creates a [StaticBody3D] child node with a [ConvexPolygonShape3D] collision shape calculated from the mesh geometry. It's mainly used for testing. + * If [param clean] is `true` (default), duplicate and interior vertices are removed automatically. You can set it to `false` to make the process faster if not needed. + * If [param simplify] is `true`, the geometry can be further simplified to reduce the number of vertices. Disabled by default. + */ + create_convex_collision(clean: boolean = true, simplify: boolean = false): void + + /** This helper creates a [StaticBody3D] child node with multiple [ConvexPolygonShape3D] collision shapes calculated from the mesh geometry via convex decomposition. The convex decomposition operation can be controlled with parameters from the optional [param settings]. */ + create_multiple_convex_collisions(settings: MeshConvexDecompositionSettings = undefined): void + + /** Returns the number of blend shapes available. Produces an error if [member mesh] is `null`. */ + get_blend_shape_count(): int64 + + /** Returns the index of the blend shape with the given [param name]. Returns `-1` if no blend shape with this name exists, including when [member mesh] is `null`. */ + find_blend_shape_by_name(name: StringName): int64 + + /** Returns the value of the blend shape at the given [param blend_shape_idx]. Returns `0.0` and produces an error if [member mesh] is `null` or doesn't have a blend shape at that index. */ + get_blend_shape_value(blend_shape_idx: int64): float64 + + /** Sets the value of the blend shape at [param blend_shape_idx] to [param value]. Produces an error if [member mesh] is `null` or doesn't have a blend shape at that index. */ + set_blend_shape_value(blend_shape_idx: int64, value: float64): void + + /** This helper creates a [MeshInstance3D] child node with gizmos at every vertex calculated from the mesh geometry. It's mainly used for testing. */ + create_debug_tangents(): void + + /** Takes a snapshot from the current [ArrayMesh] with all blend shapes applied according to their current weights and bakes it to the provided [param existing] mesh. If no [param existing] mesh is provided a new [ArrayMesh] is created, baked and returned. Mesh surface materials are not copied. + * **Performance:** [Mesh] data needs to be received from the GPU, stalling the [RenderingServer] in the process. + */ + bake_mesh_from_current_blend_shape_mix(existing: ArrayMesh = undefined): ArrayMesh + + /** Takes a snapshot of the current animated skeleton pose of the skinned mesh and bakes it to the provided [param existing] mesh. If no [param existing] mesh is provided a new [ArrayMesh] is created, baked, and returned. Requires a skeleton with a registered skin to work. Blendshapes are ignored. Mesh surface materials are not copied. + * **Performance:** [Mesh] data needs to be retrieved from the GPU, stalling the [RenderingServer] in the process. + */ + bake_mesh_from_current_skeleton_pose(existing: ArrayMesh = undefined): ArrayMesh + + /** The [Mesh] resource for the instance. */ + get mesh(): Mesh + set mesh(value: Mesh) + + /** The [Skin] to be used by this instance. */ + get skin(): Skin + set skin(value: Skin) + + /** [NodePath] to the [Skeleton3D] associated with the instance. */ + get skeleton(): NodePath + set skeleton(value: NodePath | string) + } + class MeshInstance3DEditor = Record> extends Control { + constructor(identifier?: any) + } + class MeshInstance3DEditorPlugin = Record> extends EditorPlugin { + constructor(identifier?: any) + } + class MeshInstance3DGizmoPlugin extends EditorNode3DGizmoPlugin { + constructor(identifier?: any) + } + /** Library of meshes. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_meshlibrary.html + */ + class MeshLibrary extends Resource { + constructor(identifier?: any) + /** Creates a new item in the library with the given ID. + * You can get an unused ID from [method get_last_unused_item_id]. + */ + create_item(id: int64): void + + /** Sets the item's name. + * This name is shown in the editor. It can also be used to look up the item later using [method find_item_by_name]. + */ + set_item_name(id: int64, name: string): void + + /** Sets the item's mesh. */ + set_item_mesh(id: int64, mesh: Mesh): void + + /** Sets the transform to apply to the item's mesh. */ + set_item_mesh_transform(id: int64, mesh_transform: Transform3D): void + + /** Sets the item's shadow casting mode. See [enum RenderingServer.ShadowCastingSetting] for possible values. */ + set_item_mesh_cast_shadow(id: int64, shadow_casting_setting: RenderingServer.ShadowCastingSetting): void + + /** Sets the item's navigation mesh. */ + set_item_navigation_mesh(id: int64, navigation_mesh: NavigationMesh): void + + /** Sets the transform to apply to the item's navigation mesh. */ + set_item_navigation_mesh_transform(id: int64, navigation_mesh: Transform3D): void + + /** Sets the item's navigation layers bitmask. */ + set_item_navigation_layers(id: int64, navigation_layers: int64): void + + /** Sets an item's collision shapes. + * The array should consist of [Shape3D] objects, each followed by a [Transform3D] that will be applied to it. For shapes that should not have a transform, use [constant Transform3D.IDENTITY]. + */ + set_item_shapes(id: int64, shapes: GArray): void + + /** Sets a texture to use as the item's preview icon in the editor. */ + set_item_preview(id: int64, texture: Texture2D): void + + /** Returns the item's name. */ + get_item_name(id: int64): string + + /** Returns the item's mesh. */ + get_item_mesh(id: int64): Mesh + + /** Returns the transform applied to the item's mesh. */ + get_item_mesh_transform(id: int64): Transform3D + + /** Returns the item's shadow casting mode. See [enum RenderingServer.ShadowCastingSetting] for possible values. */ + get_item_mesh_cast_shadow(id: int64): RenderingServer.ShadowCastingSetting + + /** Returns the item's navigation mesh. */ + get_item_navigation_mesh(id: int64): NavigationMesh + + /** Returns the transform applied to the item's navigation mesh. */ + get_item_navigation_mesh_transform(id: int64): Transform3D + + /** Returns the item's navigation layers bitmask. */ + get_item_navigation_layers(id: int64): int64 + + /** Returns an item's collision shapes. + * The array consists of each [Shape3D] followed by its [Transform3D]. + */ + get_item_shapes(id: int64): GArray + + /** When running in the editor, returns a generated item preview (a 3D rendering in isometric perspective). When used in a running project, returns the manually-defined item preview which can be set using [method set_item_preview]. Returns an empty [Texture2D] if no preview was manually set in a running project. */ + get_item_preview(id: int64): Texture2D + + /** Removes the item. */ + remove_item(id: int64): void + + /** Returns the first item with the given name, or `-1` if no item is found. */ + find_item_by_name(name: string): int64 + + /** Clears the library. */ + clear(): void + + /** Returns the list of item IDs in use. */ + get_item_list(): PackedInt32Array + + /** Gets an unused ID for a new item. */ + get_last_unused_item_id(): int64 + } + class MeshLibraryEditor = Record> extends Control { + constructor(identifier?: any) + } + class MeshLibraryEditorPlugin = Record> extends EditorPlugin { + constructor(identifier?: any) + } + /** Simple texture that uses a mesh to draw itself. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_meshtexture.html + */ + class MeshTexture extends Texture2D { + constructor(identifier?: any) + /** Sets the mesh used to draw. It must be a mesh using 2D vertices. */ + get mesh(): Mesh + set mesh(value: Mesh) + + /** Sets the base texture that the Mesh will use to draw. */ + get base_texture(): Texture2D + set base_texture(value: Texture2D) + + /** Sets the size of the image, needed for reference. */ + get image_size(): Vector2 + set image_size(value: Vector2) + } + /** Interpolates an abstract value and supplies it to a method called over time. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_methodtweener.html + */ + class MethodTweener extends Tweener { + constructor(identifier?: any) + /** Sets the time in seconds after which the [MethodTweener] will start interpolating. By default there's no delay. */ + set_delay(delay: float64): MethodTweener + + /** Sets the type of used transition from [enum Tween.TransitionType]. If not set, the default transition is used from the [Tween] that contains this Tweener. */ + set_trans(trans: Tween.TransitionType): MethodTweener + + /** Sets the type of used easing from [enum Tween.EaseType]. If not set, the default easing is used from the [Tween] that contains this Tweener. */ + set_ease(ease: Tween.EaseType): MethodTweener + } + /** An internal editor class intended for keeping the data of unrecognized nodes. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_missingnode.html + */ + class MissingNode = Record> extends Node { + constructor(identifier?: any) + /** The name of the class this node was supposed to be (see [method Object.get_class]). */ + get original_class(): string + set original_class(value: string) + + /** Returns the path of the scene this node was instance of originally. */ + get original_scene(): string + set original_scene(value: string) + + /** If `true`, allows new properties to be set along with existing ones. If `false`, only existing properties' values can be set, and new properties cannot be added. */ + get recording_properties(): boolean + set recording_properties(value: boolean) + } + /** An internal editor class intended for keeping the data of unrecognized resources. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_missingresource.html + */ + class MissingResource extends Resource { + constructor(identifier?: any) + /** The name of the class this resource was supposed to be (see [method Object.get_class]). */ + get original_class(): string + set original_class(value: string) + + /** If set to `true`, allows new properties to be added on top of the existing ones with [method Object.set]. */ + get recording_properties(): boolean + set recording_properties(value: boolean) + } + /** Generic mobile VR implementation. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_mobilevrinterface.html + */ + class MobileVRInterface extends XRInterface { + constructor(identifier?: any) + /** The height at which the camera is placed in relation to the ground (i.e. [XROrigin3D] node). */ + get eye_height(): float64 + set eye_height(value: float64) + + /** The interocular distance, also known as the interpupillary distance. The distance between the pupils of the left and right eye. */ + get iod(): float64 + set iod(value: float64) + + /** The width of the display in centimeters. */ + get display_width(): float64 + set display_width(value: float64) + + /** The distance between the display and the lenses inside of the device in centimeters. */ + get display_to_lens(): float64 + set display_to_lens(value: float64) + + /** Set the offset rect relative to the area being rendered. A length of 1 represents the whole rendering area on that axis. */ + get offset_rect(): Rect2 + set offset_rect(value: Rect2) + + /** The oversample setting. Because of the lens distortion we have to render our buffers at a higher resolution then the screen can natively handle. A value between 1.5 and 2.0 often provides good results but at the cost of performance. */ + get oversample(): float64 + set oversample(value: float64) + + /** The k1 lens factor is one of the two constants that define the strength of the lens used and directly influences the lens distortion effect. */ + get k1(): float64 + set k1(value: float64) + + /** The k2 lens factor, see k1. */ + get k2(): float64 + set k2(value: float64) + + /** The minimum radius around the focal point where full quality is guaranteed if VRS is used as a percentage of screen size. + * + * **Note:** Mobile and Forward+ renderers only. Requires [member Viewport.vrs_mode] to be set to [constant Viewport.VRS_XR]. + */ + get vrs_min_radius(): float64 + set vrs_min_radius(value: float64) + + /** The strength used to calculate the VRS density map. The greater this value, the more noticeable VRS is. This improves performance at the cost of quality. + * + * **Note:** Mobile and Forward+ renderers only. Requires [member Viewport.vrs_mode] to be set to [constant Viewport.VRS_XR]. + */ + get vrs_strength(): float64 + set vrs_strength(value: float64) + } + /** Abstract class for non-real-time video recording encoders. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_moviewriter.html + */ + class MovieWriter extends Object { + constructor(identifier?: any) + /** Called when the audio sample rate used for recording the audio is requested by the engine. The value returned must be specified in Hz. Defaults to 48000 Hz if [method _get_audio_mix_rate] is not overridden. */ + /* gdvirtual */ _get_audio_mix_rate(): int64 + + /** Called when the audio speaker mode used for recording the audio is requested by the engine. This can affect the number of output channels in the resulting audio file/stream. Defaults to [constant AudioServer.SPEAKER_MODE_STEREO] if [method _get_audio_speaker_mode] is not overridden. */ + /* gdvirtual */ _get_audio_speaker_mode(): AudioServer.SpeakerMode + + /** Called when the engine determines whether this [MovieWriter] is able to handle the file at [param path]. Must return `true` if this [MovieWriter] is able to handle the given file path, `false` otherwise. Typically, [method _handles_file] is overridden as follows to allow the user to record a file at any path with a given file extension: + * + */ + /* gdvirtual */ _handles_file(path: string): boolean + + /** Called once before the engine starts writing video and audio data. [param movie_size] is the width and height of the video to save. [param fps] is the number of frames per second specified in the project settings or using the `--fixed-fps ` [url=https://docs.godotengine.org/en/4.4/tutorials/editor/command_line_tutorial.html]command line argument[/url]. */ + /* gdvirtual */ _write_begin(movie_size: Vector2i, fps: int64, base_path: string): GError + + /** Called at the end of every rendered frame. The [param frame_image] and [param audio_frame_block] function arguments should be written to. */ + /* gdvirtual */ _write_frame(frame_image: Image, audio_frame_block: int64): GError + + /** Called when the engine finishes writing. This occurs when the engine quits by pressing the window manager's close button, or when [method SceneTree.quit] is called. + * + * **Note:** Pressing [kbd]Ctrl + C[/kbd] on the terminal running the editor/project does *not* result in [method _write_end] being called. + */ + /* gdvirtual */ _write_end(): void + + /** Adds a writer to be usable by the engine. The supported file extensions can be set by overriding [method _handles_file]. + * + * **Note:** [method add_writer] must be called early enough in the engine initialization to work, as movie writing is designed to start at the same time as the rest of the engine. + */ + static add_writer(writer: MovieWriter): void + } + class MovieWriterMJPEG extends MovieWriter { + constructor(identifier?: any) + } + class MovieWriterPNGWAV extends MovieWriter { + constructor(identifier?: any) + } + namespace MultiMesh { + enum TransformFormat { + /** Use this when using 2D transforms. */ + TRANSFORM_2D = 0, + + /** Use this when using 3D transforms. */ + TRANSFORM_3D = 1, + } + enum PhysicsInterpolationQuality { + /** Always interpolate using Basis lerping, which can produce warping artifacts in some situations. */ + INTERP_QUALITY_FAST = 0, + + /** Attempt to interpolate using Basis slerping (spherical linear interpolation) where possible, otherwise fall back to lerping. */ + INTERP_QUALITY_HIGH = 1, + } + } + /** Provides high-performance drawing of a mesh multiple times using GPU instancing. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_multimesh.html + */ + class MultiMesh extends Resource { + constructor(identifier?: any) + /** Sets the [Transform3D] for a specific instance. */ + set_instance_transform(instance: int64, transform: Transform3D): void + + /** Sets the [Transform2D] for a specific instance. */ + set_instance_transform_2d(instance: int64, transform: Transform2D): void + + /** Returns the [Transform3D] of a specific instance. */ + get_instance_transform(instance: int64): Transform3D + + /** Returns the [Transform2D] of a specific instance. */ + get_instance_transform_2d(instance: int64): Transform2D + + /** Sets the color of a specific instance by *multiplying* the mesh's existing vertex colors. This allows for different color tinting per instance. + * + * **Note:** Each component is stored in 32 bits in the Forward+ and Mobile rendering methods, but is packed into 16 bits in the Compatibility rendering method. + * For the color to take effect, ensure that [member use_colors] is `true` on the [MultiMesh] and [member BaseMaterial3D.vertex_color_use_as_albedo] is `true` on the material. If you intend to set an absolute color instead of tinting, make sure the material's albedo color is set to pure white (`Color(1, 1, 1)`). + */ + set_instance_color(instance: int64, color: Color): void + + /** Gets a specific instance's color multiplier. */ + get_instance_color(instance: int64): Color + + /** Sets custom data for a specific instance. [param custom_data] is a [Color] type only to contain 4 floating-point numbers. + * + * **Note:** Each number is stored in 32 bits in the Forward+ and Mobile rendering methods, but is packed into 16 bits in the Compatibility rendering method. + * For the custom data to be used, ensure that [member use_custom_data] is `true`. + * This custom instance data has to be manually accessed in your custom shader using `INSTANCE_CUSTOM`. + */ + set_instance_custom_data(instance: int64, custom_data: Color): void + + /** Returns the custom data that has been set for a specific instance. */ + get_instance_custom_data(instance: int64): Color + + /** When using *physics interpolation* , this function allows you to prevent interpolation on an instance in the current physics tick. + * This allows you to move instances instantaneously, and should usually be used when initially placing an instance such as a bullet to prevent graphical glitches. + */ + reset_instance_physics_interpolation(instance: int64): void + + /** Returns the visibility axis-aligned bounding box in local space. */ + get_aabb(): AABB + + /** An alternative to setting the [member buffer] property, which can be used with *physics interpolation* . This method takes two arrays, and can set the data for the current and previous tick in one go. The renderer will automatically interpolate the data at each frame. + * This is useful for situations where the order of instances may change from physics tick to tick, such as particle systems. + * When the order of instances is coherent, the simpler alternative of setting [member buffer] can still be used with interpolation. + */ + set_buffer_interpolated(buffer_curr: PackedFloat32Array | float32[], buffer_prev: PackedFloat32Array | float32[]): void + + /** Format of transform used to transform mesh, either 2D or 3D. */ + get transform_format(): int64 + set transform_format(value: int64) + + /** If `true`, the [MultiMesh] will use color data (see [method set_instance_color]). Can only be set when [member instance_count] is `0` or less. This means that you need to call this method before setting the instance count, or temporarily reset it to `0`. */ + get use_colors(): boolean + set use_colors(value: boolean) + + /** If `true`, the [MultiMesh] will use custom data (see [method set_instance_custom_data]). Can only be set when [member instance_count] is `0` or less. This means that you need to call this method before setting the instance count, or temporarily reset it to `0`. */ + get use_custom_data(): boolean + set use_custom_data(value: boolean) + + /** Custom AABB for this MultiMesh resource. Setting this manually prevents costly runtime AABB recalculations. */ + get custom_aabb(): AABB + set custom_aabb(value: AABB) + + /** Number of instances that will get drawn. This clears and (re)sizes the buffers. Setting data format or flags afterwards will have no effect. + * By default, all instances are drawn but you can limit this with [member visible_instance_count]. + */ + get instance_count(): int64 + set instance_count(value: int64) + + /** Limits the number of instances drawn, -1 draws all instances. Changing this does not change the sizes of the buffers. */ + get visible_instance_count(): int64 + set visible_instance_count(value: int64) + + /** [Mesh] resource to be instanced. + * The looks of the individual instances can be modified using [method set_instance_color] and [method set_instance_custom_data]. + */ + get mesh(): Mesh + set mesh(value: Mesh) + get buffer(): PackedFloat32Array + set buffer(value: PackedFloat32Array | float32[]) + + /** Array containing each [Transform3D] value used by all instances of this mesh, as a [PackedVector3Array]. Each transform is divided into 4 [Vector3] values corresponding to the transforms' `x`, `y`, `z`, and `origin`. */ + get transform_array(): PackedVector3Array + set transform_array(value: PackedVector3Array | Vector3[]) + + /** Array containing each [Transform2D] value used by all instances of this mesh, as a [PackedVector2Array]. Each transform is divided into 3 [Vector2] values corresponding to the transforms' `x`, `y`, and `origin`. */ + get transform_2d_array(): PackedVector2Array + set transform_2d_array(value: PackedVector2Array | Vector2[]) + + /** Array containing each [Color] used by all instances of this mesh. */ + get color_array(): PackedColorArray + set color_array(value: PackedColorArray | Color[]) + + /** Array containing each custom data value used by all instances of this mesh, as a [PackedColorArray]. */ + get custom_data_array(): PackedColorArray + set custom_data_array(value: PackedColorArray | Color[]) + + /** Choose whether to use an interpolation method that favors speed or quality. + * When using low physics tick rates (typically below 20) or high rates of object rotation, you may get better results from the high quality setting. + * + * **Note:** Fast quality does not equate to low quality. Except in the special cases mentioned above, the quality should be comparable to high quality. + */ + get physics_interpolation_quality(): int64 + set physics_interpolation_quality(value: int64) + } + class MultiMeshEditor = Record> extends Control { + constructor(identifier?: any) + } + class MultiMeshEditorPlugin = Record> extends EditorPlugin { + constructor(identifier?: any) + } + /** Node that instances a [MultiMesh] in 2D. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_multimeshinstance2d.html + */ + class MultiMeshInstance2D = Record> extends Node2D { + constructor(identifier?: any) + /** The [MultiMesh] that will be drawn by the [MultiMeshInstance2D]. */ + get multimesh(): MultiMesh + set multimesh(value: MultiMesh) + + /** The [Texture2D] that will be used if using the default [CanvasItemMaterial]. Can be accessed as `TEXTURE` in CanvasItem shader. */ + get texture(): Texture2D + set texture(value: Texture2D) + + /** Emitted when the [member texture] is changed. */ + readonly texture_changed: Signal0 + } + /** Node that instances a [MultiMesh]. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_multimeshinstance3d.html + */ + class MultiMeshInstance3D = Record> extends GeometryInstance3D { + constructor(identifier?: any) + /** The [MultiMesh] resource that will be used and shared among all instances of the [MultiMeshInstance3D]. */ + get multimesh(): MultiMesh + set multimesh(value: MultiMesh) + } + namespace MultiplayerAPI { + enum RPCMode { + /** Used with [method Node.rpc_config] to disable a method or property for all RPC calls, making it unavailable. Default for all methods. */ + RPC_MODE_DISABLED = 0, + + /** Used with [method Node.rpc_config] to set a method to be callable remotely by any peer. Analogous to the `@rpc("any_peer")` annotation. Calls are accepted from all remote peers, no matter if they are node's authority or not. */ + RPC_MODE_ANY_PEER = 1, + + /** Used with [method 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("authority")` annotation. See [method Node.set_multiplayer_authority]. */ + RPC_MODE_AUTHORITY = 2, + } + } + /** High-level multiplayer API interface. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_multiplayerapi.html + */ + class MultiplayerAPI extends RefCounted { + constructor(identifier?: any) + /** Returns `true` if there is a [member multiplayer_peer] set. */ + has_multiplayer_peer(): boolean + + /** Returns the unique peer ID of this MultiplayerAPI's [member multiplayer_peer]. */ + get_unique_id(): int64 + + /** Returns `true` if this MultiplayerAPI's [member multiplayer_peer] is valid and in server mode (listening for connections). */ + is_server(): boolean + + /** Returns the sender's peer ID for the RPC currently being executed. + * + * **Note:** This method returns `0` when called outside of an RPC. As such, the original peer ID may be lost when code execution is delayed (such as with GDScript's `await` keyword). + */ + get_remote_sender_id(): int64 + + /** Method used for polling the MultiplayerAPI. You only need to worry about this if you set [member SceneTree.multiplayer_poll] to `false`. By default, [SceneTree] will poll its MultiplayerAPI(s) for you. + * + * **Note:** This method results in RPCs being called, so they will be executed in the same context of this function (e.g. `_process`, `physics`, [Thread]). + */ + poll(): GError + + /** Sends an RPC to the target [param peer]. The given [param method] will be called on the remote [param object] with the provided [param arguments]. The RPC may also be called locally depending on the implementation and RPC configuration. See [method Node.rpc] and [method Node.rpc_config]. + * + * **Note:** Prefer using [method Node.rpc], [method Node.rpc_id], or `my_method.rpc(peer, arg1, arg2, ...)` (in GDScript), since they are faster. This method is mostly useful in conjunction with [MultiplayerAPIExtension] when extending or replacing the multiplayer capabilities. + */ + rpc(peer: int64, object: Object, method: StringName, arguments_: GArray = []): GError + + /** Notifies the MultiplayerAPI of a new [param configuration] for the given [param object]. This method is used internally by [SceneTree] to configure the root path for this MultiplayerAPI (passing `null` and a valid [NodePath] as [param configuration]). This method can be further used by MultiplayerAPI implementations to provide additional features, refer to specific implementation (e.g. [SceneMultiplayer]) for details on how they use it. + * + * **Note:** This method is mostly relevant when extending or overriding the MultiplayerAPI behavior via [MultiplayerAPIExtension]. + */ + object_configuration_add(object: Object, configuration: any): GError + + /** Notifies the MultiplayerAPI to remove a [param configuration] for the given [param object]. This method is used internally by [SceneTree] to configure the root path for this MultiplayerAPI (passing `null` and an empty [NodePath] as [param configuration]). This method can be further used by MultiplayerAPI implementations to provide additional features, refer to specific implementation (e.g. [SceneMultiplayer]) for details on how they use it. + * + * **Note:** This method is mostly relevant when extending or overriding the MultiplayerAPI behavior via [MultiplayerAPIExtension]. + */ + object_configuration_remove(object: Object, configuration: any): GError + + /** Returns the peer IDs of all connected peers of this MultiplayerAPI's [member multiplayer_peer]. */ + get_peers(): PackedInt32Array + + /** Sets the default MultiplayerAPI implementation class. This method can be used by modules and extensions to configure which implementation will be used by [SceneTree] when the engine starts. */ + static set_default_interface(interface_name: StringName): void + + /** Returns the default MultiplayerAPI implementation class name. This is usually `"SceneMultiplayer"` when [SceneMultiplayer] is available. See [method set_default_interface]. */ + static get_default_interface(): StringName + + /** Returns a new instance of the default MultiplayerAPI. */ + static create_default_interface(): MultiplayerAPI + + /** The peer object to handle the RPC system (effectively enabling networking when set). Depending on the peer itself, the MultiplayerAPI will become a network server (check with [method is_server]) and will set root node's network mode to authority, or it will become a regular client peer. All child nodes are set to inherit the network mode by default. Handling of networking-related events (connection, disconnection, new clients) is done by connecting to MultiplayerAPI's signals. */ + get multiplayer_peer(): MultiplayerPeer + set multiplayer_peer(value: MultiplayerPeer) + + /** Emitted when this MultiplayerAPI's [member multiplayer_peer] connects with a new peer. ID is the peer ID of the new peer. Clients get notified when other clients connect to the same server. Upon connecting to a server, a client also receives this signal for the server (with ID being 1). */ + readonly peer_connected: Signal1 + + /** Emitted when this MultiplayerAPI's [member multiplayer_peer] disconnects from a peer. Clients get notified when other clients disconnect from the same server. */ + readonly peer_disconnected: Signal1 + + /** Emitted when this MultiplayerAPI's [member multiplayer_peer] successfully connected to a server. Only emitted on clients. */ + readonly connected_to_server: Signal0 + + /** Emitted when this MultiplayerAPI's [member multiplayer_peer] fails to establish a connection to a server. Only emitted on clients. */ + readonly connection_failed: Signal0 + + /** Emitted when this MultiplayerAPI's [member multiplayer_peer] disconnects from server. Only emitted on clients. */ + readonly server_disconnected: Signal0 + } + /** Base class used for extending the [MultiplayerAPI]. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_multiplayerapiextension.html + */ + class MultiplayerAPIExtension extends MultiplayerAPI { + constructor(identifier?: any) + /** Callback for [method MultiplayerAPI.poll]. */ + /* gdvirtual */ _poll(): GError + + /** Called when the [member MultiplayerAPI.multiplayer_peer] is set. */ + /* gdvirtual */ _set_multiplayer_peer(multiplayer_peer: MultiplayerPeer): void + + /** Called when the [member MultiplayerAPI.multiplayer_peer] is retrieved. */ + /* gdvirtual */ _get_multiplayer_peer(): MultiplayerPeer + + /** Callback for [method MultiplayerAPI.get_unique_id]. */ + /* gdvirtual */ _get_unique_id(): int64 + + /** Callback for [method MultiplayerAPI.get_peers]. */ + /* gdvirtual */ _get_peer_ids(): PackedInt32Array + + /** Callback for [method MultiplayerAPI.rpc]. */ + /* gdvirtual */ _rpc(peer: int64, object: Object, method: StringName, args: GArray): GError + + /** Callback for [method MultiplayerAPI.get_remote_sender_id]. */ + /* gdvirtual */ _get_remote_sender_id(): int64 + + /** Callback for [method MultiplayerAPI.object_configuration_add]. */ + /* gdvirtual */ _object_configuration_add(object: Object, configuration: any): GError + + /** Callback for [method MultiplayerAPI.object_configuration_remove]. */ + /* gdvirtual */ _object_configuration_remove(object: Object, configuration: any): GError + } + class MultiplayerEditorDebugger extends EditorDebuggerPlugin { + constructor(identifier?: any) + readonly open_request: Signal1 + } + class MultiplayerEditorPlugin = Record> extends EditorPlugin { + constructor(identifier?: any) + } + namespace MultiplayerPeer { + enum ConnectionStatus { + /** The MultiplayerPeer is disconnected. */ + CONNECTION_DISCONNECTED = 0, + + /** The MultiplayerPeer is currently connecting to a server. */ + CONNECTION_CONNECTING = 1, + + /** This MultiplayerPeer is connected. */ + CONNECTION_CONNECTED = 2, + } + enum TransferMode { + /** Packets are not acknowledged, no resend attempts are made for lost packets. Packets may arrive in any order. Potentially faster than [constant TRANSFER_MODE_UNRELIABLE_ORDERED]. Use for non-critical data, and always consider whether the order matters. */ + TRANSFER_MODE_UNRELIABLE = 0, + + /** 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 [constant 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_UNRELIABLE_ORDERED = 1, + + /** 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. */ + TRANSFER_MODE_RELIABLE = 2, + } + } + /** Abstract class for specialized [PacketPeer]s used by the [MultiplayerAPI]. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_multiplayerpeer.html + */ + class MultiplayerPeer extends PacketPeer { + /** Packets are sent to all connected peers. */ + static readonly TARGET_PEER_BROADCAST = 0 + + /** Packets are sent to the remote peer acting as server. */ + static readonly TARGET_PEER_SERVER = 1 + constructor(identifier?: any) + + /** Sets the peer to which packets will be sent. + * The [param id] can be one of: [constant TARGET_PEER_BROADCAST] to send to all connected peers, [constant TARGET_PEER_SERVER] to send to the peer acting as server, a valid peer ID to send to that specific peer, a negative peer ID to send to all peers except that one. By default, the target peer is [constant TARGET_PEER_BROADCAST]. + */ + set_target_peer(id: int64): void + + /** Returns the ID of the [MultiplayerPeer] who sent the next available packet. See [method PacketPeer.get_available_packet_count]. */ + get_packet_peer(): int64 + + /** Returns the channel over which the next available packet was received. See [method PacketPeer.get_available_packet_count]. */ + get_packet_channel(): int64 + + /** Returns the transfer mode the remote peer used to send the next available packet. See [method PacketPeer.get_available_packet_count]. */ + get_packet_mode(): MultiplayerPeer.TransferMode + + /** Waits up to 1 second to receive a new network event. */ + poll(): void + + /** Immediately close the multiplayer peer returning to the state [constant CONNECTION_DISCONNECTED]. Connected peers will be dropped without emitting [signal peer_disconnected]. */ + close(): void + + /** Disconnects the given [param peer] from this host. If [param force] is `true` the [signal peer_disconnected] signal will not be emitted for this peer. */ + disconnect_peer(peer: int64, force: boolean = false): void + + /** Returns the current state of the connection. See [enum ConnectionStatus]. */ + get_connection_status(): MultiplayerPeer.ConnectionStatus + + /** Returns the ID of this [MultiplayerPeer]. */ + get_unique_id(): int64 + + /** Returns a randomly generated integer that can be used as a network unique ID. */ + generate_unique_id(): int64 + + /** Returns `true` if the server can act as a relay in the current configuration. That is, if the higher level [MultiplayerAPI] should notify connected clients of other peers, and implement a relay protocol to allow communication between them. */ + is_server_relay_supported(): boolean + + /** If `true`, this [MultiplayerPeer] refuses new connections. */ + get refuse_new_connections(): boolean + set refuse_new_connections(value: boolean) + + /** The manner in which to send packets to the target peer. See [enum TransferMode], and the [method set_target_peer] method. */ + get transfer_mode(): int64 + set transfer_mode(value: int64) + + /** The channel to use to send packets. Many network APIs such as ENet and WebRTC allow the creation of multiple independent channels which behaves, in a way, like separate connections. This means that reliable data will only block delivery of other packets on that channel, and ordering will only be in respect to the channel the packet is being sent on. Using different channels to send **different and independent** state updates is a common way to optimize network usage and decrease latency in fast-paced games. + * + * **Note:** The default channel (`0`) actually works as 3 separate channels (one for each [enum TransferMode]) so that [constant TRANSFER_MODE_RELIABLE] and [constant TRANSFER_MODE_UNRELIABLE_ORDERED] does not interact with each other by default. Refer to the specific network API documentation (e.g. ENet or WebRTC) to learn how to set up channels correctly. + */ + get transfer_channel(): int64 + set transfer_channel(value: int64) + + /** Emitted when a remote peer connects. */ + readonly peer_connected: Signal1 + + /** Emitted when a remote peer has disconnected. */ + readonly peer_disconnected: Signal1 + } + /** Class that can be inherited to implement custom multiplayer API networking layers via GDExtension. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_multiplayerpeerextension.html + */ + class MultiplayerPeerExtension extends MultiplayerPeer { + constructor(identifier?: any) + /** Called when a packet needs to be received by the [MultiplayerAPI], with [param r_buffer_size] being the size of the binary [param r_buffer] in bytes. */ + /* gdvirtual */ _get_packet(r_buffer: int64, r_buffer_size: int64): GError + + /** Called when a packet needs to be sent by the [MultiplayerAPI], with [param p_buffer_size] being the size of the binary [param p_buffer] in bytes. */ + /* gdvirtual */ _put_packet(p_buffer: int64, p_buffer_size: int64): GError + + /** Called when the available packet count is internally requested by the [MultiplayerAPI]. */ + /* gdvirtual */ _get_available_packet_count(): int64 + + /** Called when the maximum allowed packet size (in bytes) is requested by the [MultiplayerAPI]. */ + /* gdvirtual */ _get_max_packet_size(): int64 + + /** Called when a packet needs to be received by the [MultiplayerAPI], if [method _get_packet] isn't implemented. Use this when extending this class via GDScript. */ + /* gdvirtual */ _get_packet_script(): PackedByteArray + + /** Called when a packet needs to be sent by the [MultiplayerAPI], if [method _put_packet] isn't implemented. Use this when extending this class via GDScript. */ + /* gdvirtual */ _put_packet_script(p_buffer: PackedByteArray | byte[] | ArrayBuffer): GError + + /** Called to get the channel over which the next available packet was received. See [method MultiplayerPeer.get_packet_channel]. */ + /* gdvirtual */ _get_packet_channel(): int64 + + /** Called to get the transfer mode the remote peer used to send the next available packet. See [method MultiplayerPeer.get_packet_mode]. */ + /* gdvirtual */ _get_packet_mode(): MultiplayerPeer.TransferMode + + /** Called when the channel to use is set for this [MultiplayerPeer] (see [member MultiplayerPeer.transfer_channel]). */ + /* gdvirtual */ _set_transfer_channel(p_channel: int64): void + + /** Called when the transfer channel to use is read on this [MultiplayerPeer] (see [member MultiplayerPeer.transfer_channel]). */ + /* gdvirtual */ _get_transfer_channel(): int64 + + /** Called when the transfer mode is set on this [MultiplayerPeer] (see [member MultiplayerPeer.transfer_mode]). */ + /* gdvirtual */ _set_transfer_mode(p_mode: MultiplayerPeer.TransferMode): void + + /** Called when the transfer mode to use is read on this [MultiplayerPeer] (see [member MultiplayerPeer.transfer_mode]). */ + /* gdvirtual */ _get_transfer_mode(): MultiplayerPeer.TransferMode + + /** Called when the target peer to use is set for this [MultiplayerPeer] (see [method MultiplayerPeer.set_target_peer]). */ + /* gdvirtual */ _set_target_peer(p_peer: int64): void + + /** Called when the ID of the [MultiplayerPeer] who sent the most recent packet is requested (see [method MultiplayerPeer.get_packet_peer]). */ + /* gdvirtual */ _get_packet_peer(): int64 + + /** Called when the "is server" status is requested on the [MultiplayerAPI]. See [method MultiplayerAPI.is_server]. */ + /* gdvirtual */ _is_server(): boolean + + /** Called when the [MultiplayerAPI] is polled. See [method MultiplayerAPI.poll]. */ + /* gdvirtual */ _poll(): void + + /** Called when the multiplayer peer should be immediately closed (see [method MultiplayerPeer.close]). */ + /* gdvirtual */ _close(): void + + /** Called when the connected [param p_peer] should be forcibly disconnected (see [method MultiplayerPeer.disconnect_peer]). */ + /* gdvirtual */ _disconnect_peer(p_peer: int64, p_force: boolean): void + + /** Called when the unique ID of this [MultiplayerPeer] is requested (see [method MultiplayerPeer.get_unique_id]). The value must be between `1` and `2147483647`. */ + /* gdvirtual */ _get_unique_id(): int64 + + /** Called when the "refuse new connections" status is set on this [MultiplayerPeer] (see [member MultiplayerPeer.refuse_new_connections]). */ + /* gdvirtual */ _set_refuse_new_connections(p_enable: boolean): void + + /** Called when the "refuse new connections" status is requested on this [MultiplayerPeer] (see [member MultiplayerPeer.refuse_new_connections]). */ + /* gdvirtual */ _is_refusing_new_connections(): boolean + + /** Called to check if the server can act as a relay in the current configuration. See [method MultiplayerPeer.is_server_relay_supported]. */ + /* gdvirtual */ _is_server_relay_supported(): boolean + + /** Called when the connection status is requested on the [MultiplayerPeer] (see [method MultiplayerPeer.get_connection_status]). */ + /* gdvirtual */ _get_connection_status(): MultiplayerPeer.ConnectionStatus + } + /** Automatically replicates spawnable nodes from the authority to other multiplayer peers. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_multiplayerspawner.html + */ + class MultiplayerSpawner = Record> extends Node { + constructor(identifier?: any) + /** Adds a scene path to spawnable scenes, making it automatically replicated from the multiplayer authority to other peers when added as children of the node pointed by [member spawn_path]. */ + add_spawnable_scene(path: string): void + + /** Returns the count of spawnable scene paths. */ + get_spawnable_scene_count(): int64 + + /** Returns the spawnable scene path by index. */ + get_spawnable_scene(index: int64): string + + /** Clears all spawnable scenes. Does not despawn existing instances on remote peers. */ + clear_spawnable_scenes(): void + + /** Requests a custom spawn, with [param data] passed to [member spawn_function] on all peers. Returns the locally spawned node instance already inside the scene tree, and added as a child of the node pointed by [member spawn_path]. + * + * **Note:** Spawnable scenes are spawned automatically. [method spawn] is only needed for custom spawns. + */ + spawn(data: any = {}): Node + get _spawnable_scenes(): PackedStringArray + set _spawnable_scenes(value: PackedStringArray | string[]) + + /** Path to the spawn root. Spawnable scenes that are added as direct children are replicated to other peers. */ + get spawn_path(): NodePath + set spawn_path(value: NodePath | string) + + /** Maximum number of nodes allowed to be spawned by this spawner. Includes both spawnable scenes and custom spawns. + * When set to `0` (the default), there is no limit. + */ + get spawn_limit(): int64 + set spawn_limit(value: int64) + + /** Method called on all peers when a custom [method spawn] is requested by the authority. Will receive the `data` parameter, and should return a [Node] that is not in the scene tree. + * + * **Note:** The returned node should **not** be added to the scene with [method Node.add_child]. This is done automatically. + */ + get spawn_function(): Callable + set spawn_function(value: Callable) + + /** Emitted when a spawnable scene or custom spawn was despawned by the multiplayer authority. Only called on remote peers. */ + readonly despawned: Signal1 + + /** Emitted when a spawnable scene or custom spawn was spawned by the multiplayer authority. Only called on remote peers. */ + readonly spawned: Signal1 + } + namespace MultiplayerSynchronizer { + enum VisibilityUpdateMode { + /** Visibility filters are updated during process frames (see [constant Node.NOTIFICATION_INTERNAL_PROCESS]). */ + VISIBILITY_PROCESS_IDLE = 0, + + /** Visibility filters are updated during physics frames (see [constant Node.NOTIFICATION_INTERNAL_PHYSICS_PROCESS]). */ + VISIBILITY_PROCESS_PHYSICS = 1, + + /** Visibility filters are not updated automatically, and must be updated manually by calling [method update_visibility]. */ + VISIBILITY_PROCESS_NONE = 2, + } + } + /** Synchronizes properties from the multiplayer authority to the remote peers. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_multiplayersynchronizer.html + */ + class MultiplayerSynchronizer = Record> extends Node { + constructor(identifier?: any) + /** Updates the visibility of [param for_peer] according to visibility filters. If [param for_peer] is `0` (the default), all peers' visibilties are updated. */ + update_visibility(for_peer: int64 = 0): void + + /** Adds a peer visibility filter for this synchronizer. + * [param filter] should take a peer ID [int] and return a [bool]. + */ + add_visibility_filter(filter: Callable): void + + /** Removes a peer visibility filter from this synchronizer. */ + remove_visibility_filter(filter: Callable): void + + /** Sets the visibility of [param peer] to [param visible]. If [param peer] is `0`, the value of [member public_visibility] will be updated instead. */ + set_visibility_for(peer: int64, visible: boolean): void + + /** Queries the current visibility for peer [param peer]. */ + get_visibility_for(peer: int64): boolean + + /** Node path that replicated properties are relative to. + * If [member root_path] was spawned by a [MultiplayerSpawner], the node will be also be spawned and despawned based on this synchronizer visibility options. + */ + get root_path(): NodePath + set root_path(value: NodePath | string) + + /** Time interval between synchronizations. Used when the replication is set to [constant SceneReplicationConfig.REPLICATION_MODE_ALWAYS]. If set to `0.0` (the default), synchronizations happen every network process frame. */ + get replication_interval(): float64 + set replication_interval(value: float64) + + /** Time interval between delta synchronizations. Used when the replication is set to [constant SceneReplicationConfig.REPLICATION_MODE_ON_CHANGE]. If set to `0.0` (the default), delta synchronizations happen every network process frame. */ + get delta_interval(): float64 + set delta_interval(value: float64) + + /** Resource containing which properties to synchronize. */ + get replication_config(): SceneReplicationConfig + set replication_config(value: SceneReplicationConfig) + + /** Specifies when visibility filters are updated (see [enum VisibilityUpdateMode] for options). */ + get visibility_update_mode(): int64 + set visibility_update_mode(value: int64) + + /** Whether synchronization should be visible to all peers by default. See [method set_visibility_for] and [method add_visibility_filter] for ways of configuring fine-grained visibility options. */ + get public_visibility(): boolean + set public_visibility(value: boolean) + + /** Emitted when a new synchronization state is received by this synchronizer after the properties have been updated. */ + readonly synchronized: Signal0 + + /** Emitted when a new delta synchronization state is received by this synchronizer after the properties have been updated. */ + readonly delta_synchronized: Signal0 + + /** Emitted when visibility of [param for_peer] is updated. See [method update_visibility]. */ + readonly visibility_changed: Signal1 + } + /** A binary [Semaphore] for synchronization of multiple [Thread]s. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_mutex.html + */ + class Mutex extends RefCounted { + constructor(identifier?: any) + /** Locks this [Mutex], blocks until it is unlocked by the current owner. + * + * **Note:** This function returns without blocking if the thread already has ownership of the mutex. + */ + lock(): void + + /** Tries locking this [Mutex], but does not block. Returns `true` on success, `false` otherwise. + * + * **Note:** This function returns `true` if the thread already has ownership of the mutex. + */ + try_lock(): boolean + + /** Unlocks this [Mutex], leaving it to other threads. + * + * **Note:** If a thread called [method lock] or [method try_lock] multiple times while already having ownership of the mutex, it must also call [method unlock] the same number of times in order to unlock it correctly. + * **Warning:** Calling [method unlock] more times that [method lock] on a given thread, thus ending up trying to unlock a non-locked mutex, is wrong and may causes crashes or deadlocks. + */ + unlock(): void + } + /** A 2D agent used to pathfind to a position while avoiding obstacles. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_navigationagent2d.html + */ + class NavigationAgent2D = Record> extends Node { + constructor(identifier?: any) + /** Returns the [RID] of this agent on the [NavigationServer2D]. */ + get_rid(): RID + + /** Based on [param value], enables or disables the specified layer in the [member navigation_layers] bitmask, given a [param layer_number] between 1 and 32. */ + set_navigation_layer_value(layer_number: int64, value: boolean): void + + /** Returns whether or not the specified layer of the [member navigation_layers] bitmask is enabled, given a [param layer_number] between 1 and 32. */ + get_navigation_layer_value(layer_number: int64): boolean + + /** Sets the [RID] of the navigation map this NavigationAgent node should use and also updates the `agent` on the NavigationServer. */ + set_navigation_map(navigation_map: RID): void + + /** Returns the [RID] of the navigation map for this NavigationAgent node. This function returns always the map set on the NavigationAgent node and not the map of the abstract agent on the NavigationServer. If the agent map is changed directly with the NavigationServer API the NavigationAgent node will not be aware of the map change. Use [method set_navigation_map] to change the navigation map for the NavigationAgent and also update the agent on the NavigationServer. */ + get_navigation_map(): RID + + /** Returns the next position in global coordinates that can be moved to, making sure that there are no static objects in the way. If the agent does not have a navigation path, it will return the position of the agent's parent. The use of this function once every physics frame is required to update the internal path logic of the NavigationAgent. */ + get_next_path_position(): Vector2 + + /** Replaces the internal velocity in the collision avoidance simulation with [param velocity]. When an agent is teleported to a new position this function should be used in the same frame. If called frequently this function can get agents stuck. */ + set_velocity_forced(velocity: Vector2): void + + /** Returns the distance to the target position, using the agent's global position. The user must set [member target_position] in order for this to be accurate. */ + distance_to_target(): float64 + + /** Returns the path query result for the path the agent is currently following. */ + get_current_navigation_result(): NavigationPathQueryResult2D + + /** Returns this agent's current path from start to finish in global coordinates. The path only updates when the target position is changed or the agent requires a repath. The path array is not intended to be used in direct path movement as the agent has its own internal path logic that would get corrupted by changing the path array manually. Use the intended [method get_next_path_position] once every physics frame to receive the next path point for the agents movement as this function also updates the internal path logic. */ + get_current_navigation_path(): PackedVector2Array + + /** Returns which index the agent is currently on in the navigation path's [PackedVector2Array]. */ + get_current_navigation_path_index(): int64 + + /** Returns `true` if the agent reached the target, i.e. the agent moved within [member target_desired_distance] of the [member target_position]. It may not always be possible to reach the target but it should always be possible to reach the final position. See [method get_final_position]. */ + is_target_reached(): boolean + + /** Returns `true` if [method get_final_position] is within [member target_desired_distance] of the [member target_position]. */ + is_target_reachable(): boolean + + /** Returns `true` if the agent's navigation has finished. If the target is reachable, navigation ends when the target is reached. If the target is unreachable, navigation ends when the last waypoint of the path is reached. + * + * **Note:** While `true` prefer to stop calling update functions like [method get_next_path_position]. This avoids jittering the standing agent due to calling repeated path updates. + */ + is_navigation_finished(): boolean + + /** Returns the reachable final position of the current navigation path in global coordinates. This position can change if the agent needs to update the navigation path which makes the agent emit the [signal path_changed] signal. */ + get_final_position(): Vector2 + _avoidance_done(new_velocity: Vector3): void + + /** Based on [param value], enables or disables the specified layer in the [member avoidance_layers] bitmask, given a [param layer_number] between 1 and 32. */ + set_avoidance_layer_value(layer_number: int64, value: boolean): void + + /** Returns whether or not the specified layer of the [member avoidance_layers] bitmask is enabled, given a [param layer_number] between 1 and 32. */ + get_avoidance_layer_value(layer_number: int64): boolean + + /** Based on [param value], enables or disables the specified mask in the [member avoidance_mask] bitmask, given a [param mask_number] between 1 and 32. */ + set_avoidance_mask_value(mask_number: int64, value: boolean): void + + /** Returns whether or not the specified mask of the [member avoidance_mask] bitmask is enabled, given a [param mask_number] between 1 and 32. */ + get_avoidance_mask_value(mask_number: int64): boolean + + /** If set, a new navigation path from the current agent position to the [member target_position] is requested from the NavigationServer. */ + get target_position(): Vector2 + set target_position(value: Vector2) + + /** The distance threshold before a path point is considered to be reached. This allows agents to not have to hit a path point on the path exactly, but only to reach its general area. If this value is set too high, the NavigationAgent will skip points on the path, which can lead to it leaving the navigation mesh. If this value is set too low, the NavigationAgent will be stuck in a repath loop because it will constantly overshoot the distance to the next point on each physics frame update. */ + get path_desired_distance(): float64 + set path_desired_distance(value: float64) + + /** The distance threshold before the target is considered to be reached. On reaching the target, [signal target_reached] is emitted and navigation ends (see [method is_navigation_finished] and [signal navigation_finished]). + * You can make navigation end early by setting this property to a value greater than [member path_desired_distance] (navigation will end before reaching the last waypoint). + * You can also make navigation end closer to the target than each individual path position by setting this property to a value lower than [member path_desired_distance] (navigation won't immediately end when reaching the last waypoint). However, if the value set is too low, the agent will be stuck in a repath loop because it will constantly overshoot the distance to the target on each physics frame update. + */ + get target_desired_distance(): float64 + set target_desired_distance(value: float64) + + /** The maximum distance the agent is allowed away from the ideal path to the final position. This can happen due to trying to avoid collisions. When the maximum distance is exceeded, it recalculates the ideal path. */ + get path_max_distance(): float64 + set path_max_distance(value: float64) + + /** A bitfield determining which navigation layers of navigation regions this agent will use to calculate a path. Changing it during runtime will clear the current navigation path and generate a new one, according to the new navigation layers. */ + get navigation_layers(): int64 + set navigation_layers(value: int64) + + /** The pathfinding algorithm used in the path query. */ + get pathfinding_algorithm(): int64 + set pathfinding_algorithm(value: int64) + + /** The path postprocessing applied to the raw path corridor found by the [member pathfinding_algorithm]. */ + get path_postprocessing(): int64 + set path_postprocessing(value: int64) + + /** Additional information to return with the navigation path. */ + get path_metadata_flags(): int64 + set path_metadata_flags(value: int64) + + /** If `true` a simplified version of the path will be returned with less critical path points removed. The simplification amount is controlled by [member simplify_epsilon]. The simplification uses a variant of Ramer-Douglas-Peucker algorithm for curve point decimation. + * Path simplification can be helpful to mitigate various path following issues that can arise with certain agent types and script behaviors. E.g. "steering" agents or avoidance in "open fields". + */ + get simplify_path(): boolean + set simplify_path(value: boolean) + + /** The path simplification amount in worlds units. */ + get simplify_epsilon(): float64 + set simplify_epsilon(value: float64) + + /** If `true` the agent is registered for an RVO avoidance callback on the [NavigationServer2D]. When [member velocity] is used and the processing is completed a `safe_velocity` Vector2 is received with a signal connection to [signal velocity_computed]. Avoidance processing with many registered agents has a significant performance cost and should only be enabled on agents that currently require it. */ + get avoidance_enabled(): boolean + set avoidance_enabled(value: boolean) + + /** Sets the new wanted velocity for the agent. The avoidance simulation will try to fulfill this velocity if possible but will modify it to avoid collision with other agents and obstacles. When an agent is teleported to a new position, use [method set_velocity_forced] as well to reset the internal simulation velocity. */ + get velocity(): Vector2 + set velocity(value: Vector2) + + /** The radius of the avoidance agent. This is the "body" of the avoidance agent and not the avoidance maneuver starting radius (which is controlled by [member neighbor_distance]). + * Does not affect normal pathfinding. To change an actor's pathfinding radius bake [NavigationMesh] resources with a different [member NavigationMesh.agent_radius] property and use different navigation maps for each actor size. + */ + get radius(): float64 + set radius(value: float64) + + /** The distance to search for other agents. */ + get neighbor_distance(): float64 + set neighbor_distance(value: float64) + + /** The maximum number of neighbors for the agent to consider. */ + get max_neighbors(): int64 + set max_neighbors(value: int64) + + /** The minimal amount of time for which this agent's velocities, that are computed with the collision avoidance algorithm, are safe with respect to other agents. The larger the number, the sooner the agent will respond to other agents, but less freedom in choosing its velocities. A too high value will slow down agents movement considerably. Must be positive. */ + get time_horizon_agents(): float64 + set time_horizon_agents(value: float64) + + /** The minimal amount of time for which this agent's velocities, that are computed with the collision avoidance algorithm, are safe with respect to static avoidance obstacles. The larger the number, the sooner the agent will respond to static avoidance obstacles, but less freedom in choosing its velocities. A too high value will slow down agents movement considerably. Must be positive. */ + get time_horizon_obstacles(): float64 + set time_horizon_obstacles(value: float64) + + /** The maximum speed that an agent can move. */ + get max_speed(): float64 + set max_speed(value: float64) + + /** A bitfield determining the avoidance layers for this NavigationAgent. Other agents with a matching bit on the [member avoidance_mask] will avoid this agent. */ + get avoidance_layers(): int64 + set avoidance_layers(value: int64) + + /** A bitfield determining what other avoidance agents and obstacles this NavigationAgent will avoid when a bit matches at least one of their [member avoidance_layers]. */ + get avoidance_mask(): int64 + set avoidance_mask(value: int64) + + /** The agent does not adjust the velocity for other agents that would match the [member avoidance_mask] but have a lower [member avoidance_priority]. This in turn makes the other agents with lower priority adjust their velocities even more to avoid collision with this agent. */ + get avoidance_priority(): float64 + set avoidance_priority(value: float64) + + /** If `true` shows debug visuals for this agent. */ + get debug_enabled(): boolean + set debug_enabled(value: boolean) + + /** If `true` uses the defined [member debug_path_custom_color] for this agent instead of global color. */ + get debug_use_custom(): boolean + set debug_use_custom(value: boolean) + + /** If [member debug_use_custom] is `true` uses this color for this agent instead of global color. */ + get debug_path_custom_color(): Color + set debug_path_custom_color(value: Color) + + /** If [member debug_use_custom] is `true` uses this rasterized point size for rendering path points for this agent instead of global point size. */ + get debug_path_custom_point_size(): float64 + set debug_path_custom_point_size(value: float64) + + /** If [member debug_use_custom] is `true` uses this line width for rendering paths for this agent instead of global line width. */ + get debug_path_custom_line_width(): float64 + set debug_path_custom_line_width(value: float64) + + /** Emitted when the agent had to update the loaded path: + * - because path was previously empty. + * - because navigation map has changed. + * - because agent pushed further away from the current path segment than the [member path_max_distance]. + */ + readonly path_changed: Signal0 + + /** Signals that the agent reached the target, i.e. the agent moved within [member target_desired_distance] of the [member target_position]. This signal is emitted only once per loaded path. + * This signal will be emitted just before [signal navigation_finished] when the target is reachable. + * It may not always be possible to reach the target but it should always be possible to reach the final position. See [method get_final_position]. + */ + readonly target_reached: Signal0 + + /** Signals that the agent reached a waypoint. Emitted when the agent moves within [member path_desired_distance] of the next position of the path. + * The details dictionary may contain the following keys depending on the value of [member path_metadata_flags]: + * - `position`: The position of the waypoint that was reached. + * - `type`: The type of navigation primitive (region or link) that contains this waypoint. + * - `rid`: The [RID] of the containing navigation primitive (region or link). + * - `owner`: The object which manages the containing navigation primitive (region or link). + */ + readonly waypoint_reached: Signal1 + + /** Signals that the agent reached a navigation link. Emitted when the agent moves within [member path_desired_distance] of the next position of the path when that position is a navigation link. + * The details dictionary may contain the following keys depending on the value of [member path_metadata_flags]: + * - `position`: The start position of the link that was reached. + * - `type`: Always [constant NavigationPathQueryResult2D.PATH_SEGMENT_TYPE_LINK]. + * - `rid`: The [RID] of the link. + * - `owner`: The object which manages the link (usually [NavigationLink2D]). + * - `link_entry_position`: If `owner` is available and the owner is a [NavigationLink2D], it will contain the global position of the link's point the agent is entering. + * - `link_exit_position`: If `owner` is available and the owner is a [NavigationLink2D], it will contain the global position of the link's point which the agent is exiting. + */ + readonly link_reached: Signal1 + + /** Signals that the agent's navigation has finished. If the target is reachable, navigation ends when the target is reached. If the target is unreachable, navigation ends when the last waypoint of the path is reached. This signal is emitted only once per loaded path. + * This signal will be emitted just after [signal target_reached] when the target is reachable. + */ + readonly navigation_finished: Signal0 + + /** Notifies when the collision avoidance velocity is calculated. Emitted every update as long as [member avoidance_enabled] is `true` and the agent has a navigation map. */ + readonly velocity_computed: Signal1 + } + /** A 3D agent used to pathfind to a position while avoiding obstacles. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_navigationagent3d.html + */ + class NavigationAgent3D = Record> extends Node { + constructor(identifier?: any) + /** Returns the [RID] of this agent on the [NavigationServer3D]. */ + get_rid(): RID + + /** Based on [param value], enables or disables the specified layer in the [member navigation_layers] bitmask, given a [param layer_number] between 1 and 32. */ + set_navigation_layer_value(layer_number: int64, value: boolean): void + + /** Returns whether or not the specified layer of the [member navigation_layers] bitmask is enabled, given a [param layer_number] between 1 and 32. */ + get_navigation_layer_value(layer_number: int64): boolean + + /** Sets the [RID] of the navigation map this NavigationAgent node should use and also updates the `agent` on the NavigationServer. */ + set_navigation_map(navigation_map: RID): void + + /** Returns the [RID] of the navigation map for this NavigationAgent node. This function returns always the map set on the NavigationAgent node and not the map of the abstract agent on the NavigationServer. If the agent map is changed directly with the NavigationServer API the NavigationAgent node will not be aware of the map change. Use [method set_navigation_map] to change the navigation map for the NavigationAgent and also update the agent on the NavigationServer. */ + get_navigation_map(): RID + + /** Returns the next position in global coordinates that can be moved to, making sure that there are no static objects in the way. If the agent does not have a navigation path, it will return the position of the agent's parent. The use of this function once every physics frame is required to update the internal path logic of the NavigationAgent. */ + get_next_path_position(): Vector3 + + /** Replaces the internal velocity in the collision avoidance simulation with [param velocity]. When an agent is teleported to a new position this function should be used in the same frame. If called frequently this function can get agents stuck. */ + set_velocity_forced(velocity: Vector3): void + + /** Returns the distance to the target position, using the agent's global position. The user must set [member target_position] in order for this to be accurate. */ + distance_to_target(): float64 + + /** Returns the path query result for the path the agent is currently following. */ + get_current_navigation_result(): NavigationPathQueryResult3D + + /** Returns this agent's current path from start to finish in global coordinates. The path only updates when the target position is changed or the agent requires a repath. The path array is not intended to be used in direct path movement as the agent has its own internal path logic that would get corrupted by changing the path array manually. Use the intended [method get_next_path_position] once every physics frame to receive the next path point for the agents movement as this function also updates the internal path logic. */ + get_current_navigation_path(): PackedVector3Array + + /** Returns which index the agent is currently on in the navigation path's [PackedVector3Array]. */ + get_current_navigation_path_index(): int64 + + /** Returns `true` if the agent reached the target, i.e. the agent moved within [member target_desired_distance] of the [member target_position]. It may not always be possible to reach the target but it should always be possible to reach the final position. See [method get_final_position]. */ + is_target_reached(): boolean + + /** Returns `true` if [method get_final_position] is within [member target_desired_distance] of the [member target_position]. */ + is_target_reachable(): boolean + + /** Returns `true` if the agent's navigation has finished. If the target is reachable, navigation ends when the target is reached. If the target is unreachable, navigation ends when the last waypoint of the path is reached. + * + * **Note:** While `true` prefer to stop calling update functions like [method get_next_path_position]. This avoids jittering the standing agent due to calling repeated path updates. + */ + is_navigation_finished(): boolean + + /** Returns the reachable final position of the current navigation path in global coordinates. This position can change if the agent needs to update the navigation path which makes the agent emit the [signal path_changed] signal. */ + get_final_position(): Vector3 + _avoidance_done(new_velocity: Vector3): void + + /** Based on [param value], enables or disables the specified layer in the [member avoidance_layers] bitmask, given a [param layer_number] between 1 and 32. */ + set_avoidance_layer_value(layer_number: int64, value: boolean): void + + /** Returns whether or not the specified layer of the [member avoidance_layers] bitmask is enabled, given a [param layer_number] between 1 and 32. */ + get_avoidance_layer_value(layer_number: int64): boolean + + /** Based on [param value], enables or disables the specified mask in the [member avoidance_mask] bitmask, given a [param mask_number] between 1 and 32. */ + set_avoidance_mask_value(mask_number: int64, value: boolean): void + + /** Returns whether or not the specified mask of the [member avoidance_mask] bitmask is enabled, given a [param mask_number] between 1 and 32. */ + get_avoidance_mask_value(mask_number: int64): boolean + + /** If set, a new navigation path from the current agent position to the [member target_position] is requested from the NavigationServer. */ + get target_position(): Vector3 + set target_position(value: Vector3) + + /** The distance threshold before a path point is considered to be reached. This allows agents to not have to hit a path point on the path exactly, but only to reach its general area. If this value is set too high, the NavigationAgent will skip points on the path, which can lead to it leaving the navigation mesh. If this value is set too low, the NavigationAgent will be stuck in a repath loop because it will constantly overshoot the distance to the next point on each physics frame update. */ + get path_desired_distance(): float64 + set path_desired_distance(value: float64) + + /** The distance threshold before the target is considered to be reached. On reaching the target, [signal target_reached] is emitted and navigation ends (see [method is_navigation_finished] and [signal navigation_finished]). + * You can make navigation end early by setting this property to a value greater than [member path_desired_distance] (navigation will end before reaching the last waypoint). + * You can also make navigation end closer to the target than each individual path position by setting this property to a value lower than [member path_desired_distance] (navigation won't immediately end when reaching the last waypoint). However, if the value set is too low, the agent will be stuck in a repath loop because it will constantly overshoot the distance to the target on each physics frame update. + */ + get target_desired_distance(): float64 + set target_desired_distance(value: float64) + + /** The height offset is subtracted from the y-axis value of any vector path position for this NavigationAgent. The NavigationAgent height offset does not change or influence the navigation mesh or pathfinding query result. Additional navigation maps that use regions with navigation meshes that the developer baked with appropriate agent radius or height values are required to support different-sized agents. */ + get path_height_offset(): float64 + set path_height_offset(value: float64) + + /** The maximum distance the agent is allowed away from the ideal path to the final position. This can happen due to trying to avoid collisions. When the maximum distance is exceeded, it recalculates the ideal path. */ + get path_max_distance(): float64 + set path_max_distance(value: float64) + + /** A bitfield determining which navigation layers of navigation regions this agent will use to calculate a path. Changing it during runtime will clear the current navigation path and generate a new one, according to the new navigation layers. */ + get navigation_layers(): int64 + set navigation_layers(value: int64) + + /** The pathfinding algorithm used in the path query. */ + get pathfinding_algorithm(): int64 + set pathfinding_algorithm(value: int64) + + /** The path postprocessing applied to the raw path corridor found by the [member pathfinding_algorithm]. */ + get path_postprocessing(): int64 + set path_postprocessing(value: int64) + + /** Additional information to return with the navigation path. */ + get path_metadata_flags(): int64 + set path_metadata_flags(value: int64) + + /** If `true` a simplified version of the path will be returned with less critical path points removed. The simplification amount is controlled by [member simplify_epsilon]. The simplification uses a variant of Ramer-Douglas-Peucker algorithm for curve point decimation. + * Path simplification can be helpful to mitigate various path following issues that can arise with certain agent types and script behaviors. E.g. "steering" agents or avoidance in "open fields". + */ + get simplify_path(): boolean + set simplify_path(value: boolean) + + /** The path simplification amount in worlds units. */ + get simplify_epsilon(): float64 + set simplify_epsilon(value: float64) + + /** If `true` the agent is registered for an RVO avoidance callback on the [NavigationServer3D]. When [member velocity] is set and the processing is completed a `safe_velocity` Vector3 is received with a signal connection to [signal velocity_computed]. Avoidance processing with many registered agents has a significant performance cost and should only be enabled on agents that currently require it. */ + get avoidance_enabled(): boolean + set avoidance_enabled(value: boolean) + + /** Sets the new wanted velocity for the agent. The avoidance simulation will try to fulfill this velocity if possible but will modify it to avoid collision with other agents and obstacles. When an agent is teleported to a new position, use [method set_velocity_forced] as well to reset the internal simulation velocity. */ + get velocity(): Vector3 + set velocity(value: Vector3) + + /** The height of the avoidance agent. Agents will ignore other agents or obstacles that are above or below their current position + height in 2D avoidance. Does nothing in 3D avoidance which uses radius spheres alone. */ + get height(): float64 + set height(value: float64) + + /** The radius of the avoidance agent. This is the "body" of the avoidance agent and not the avoidance maneuver starting radius (which is controlled by [member neighbor_distance]). + * Does not affect normal pathfinding. To change an actor's pathfinding radius bake [NavigationMesh] resources with a different [member NavigationMesh.agent_radius] property and use different navigation maps for each actor size. + */ + get radius(): float64 + set radius(value: float64) + + /** The distance to search for other agents. */ + get neighbor_distance(): float64 + set neighbor_distance(value: float64) + + /** The maximum number of neighbors for the agent to consider. */ + get max_neighbors(): int64 + set max_neighbors(value: int64) + + /** The minimal amount of time for which this agent's velocities, that are computed with the collision avoidance algorithm, are safe with respect to other agents. The larger the number, the sooner the agent will respond to other agents, but less freedom in choosing its velocities. A too high value will slow down agents movement considerably. Must be positive. */ + get time_horizon_agents(): float64 + set time_horizon_agents(value: float64) + + /** The minimal amount of time for which this agent's velocities, that are computed with the collision avoidance algorithm, are safe with respect to static avoidance obstacles. The larger the number, the sooner the agent will respond to static avoidance obstacles, but less freedom in choosing its velocities. A too high value will slow down agents movement considerably. Must be positive. */ + get time_horizon_obstacles(): float64 + set time_horizon_obstacles(value: float64) + + /** The maximum speed that an agent can move. */ + get max_speed(): float64 + set max_speed(value: float64) + + /** If `true`, the agent calculates avoidance velocities in 3D omnidirectionally, e.g. for games that take place in air, underwater or space. Agents using 3D avoidance only avoid other agents using 3D avoidance, and react to radius-based avoidance obstacles. They ignore any vertex-based obstacles. + * If `false`, the agent calculates avoidance velocities in 2D along the x and z-axes, ignoring the y-axis. Agents using 2D avoidance only avoid other agents using 2D avoidance, and react to radius-based avoidance obstacles or vertex-based avoidance obstacles. Other agents using 2D avoidance that are below or above their current position including [member height] are ignored. + */ + get use_3d_avoidance(): boolean + set use_3d_avoidance(value: boolean) + + /** If `true`, and the agent uses 2D avoidance, it will remember the set y-axis velocity and reapply it after the avoidance step. While 2D avoidance has no y-axis and simulates on a flat plane this setting can help to soften the most obvious clipping on uneven 3D geometry. */ + get keep_y_velocity(): boolean + set keep_y_velocity(value: boolean) + + /** A bitfield determining the avoidance layers for this NavigationAgent. Other agents with a matching bit on the [member avoidance_mask] will avoid this agent. */ + get avoidance_layers(): int64 + set avoidance_layers(value: int64) + + /** A bitfield determining what other avoidance agents and obstacles this NavigationAgent will avoid when a bit matches at least one of their [member avoidance_layers]. */ + get avoidance_mask(): int64 + set avoidance_mask(value: int64) + + /** The agent does not adjust the velocity for other agents that would match the [member avoidance_mask] but have a lower [member avoidance_priority]. This in turn makes the other agents with lower priority adjust their velocities even more to avoid collision with this agent. */ + get avoidance_priority(): float64 + set avoidance_priority(value: float64) + + /** If `true` shows debug visuals for this agent. */ + get debug_enabled(): boolean + set debug_enabled(value: boolean) + + /** If `true` uses the defined [member debug_path_custom_color] for this agent instead of global color. */ + get debug_use_custom(): boolean + set debug_use_custom(value: boolean) + + /** If [member debug_use_custom] is `true` uses this color for this agent instead of global color. */ + get debug_path_custom_color(): Color + set debug_path_custom_color(value: Color) + + /** If [member debug_use_custom] is `true` uses this rasterized point size for rendering path points for this agent instead of global point size. */ + get debug_path_custom_point_size(): float64 + set debug_path_custom_point_size(value: float64) + + /** Emitted when the agent had to update the loaded path: + * - because path was previously empty. + * - because navigation map has changed. + * - because agent pushed further away from the current path segment than the [member path_max_distance]. + */ + readonly path_changed: Signal0 + + /** Signals that the agent reached the target, i.e. the agent moved within [member target_desired_distance] of the [member target_position]. This signal is emitted only once per loaded path. + * This signal will be emitted just before [signal navigation_finished] when the target is reachable. + * It may not always be possible to reach the target but it should always be possible to reach the final position. See [method get_final_position]. + */ + readonly target_reached: Signal0 + + /** Signals that the agent reached a waypoint. Emitted when the agent moves within [member path_desired_distance] of the next position of the path. + * The details dictionary may contain the following keys depending on the value of [member path_metadata_flags]: + * - `position`: The position of the waypoint that was reached. + * - `type`: The type of navigation primitive (region or link) that contains this waypoint. + * - `rid`: The [RID] of the containing navigation primitive (region or link). + * - `owner`: The object which manages the containing navigation primitive (region or link). + */ + readonly waypoint_reached: Signal1 + + /** Signals that the agent reached a navigation link. Emitted when the agent moves within [member path_desired_distance] of the next position of the path when that position is a navigation link. + * The details dictionary may contain the following keys depending on the value of [member path_metadata_flags]: + * - `position`: The start position of the link that was reached. + * - `type`: Always [constant NavigationPathQueryResult3D.PATH_SEGMENT_TYPE_LINK]. + * - `rid`: The [RID] of the link. + * - `owner`: The object which manages the link (usually [NavigationLink3D]). + * - `link_entry_position`: If `owner` is available and the owner is a [NavigationLink3D], it will contain the global position of the link's point the agent is entering. + * - `link_exit_position`: If `owner` is available and the owner is a [NavigationLink3D], it will contain the global position of the link's point which the agent is exiting. + */ + readonly link_reached: Signal1 + + /** Signals that the agent's navigation has finished. If the target is reachable, navigation ends when the target is reached. If the target is unreachable, navigation ends when the last waypoint of the path is reached. This signal is emitted only once per loaded path. + * This signal will be emitted just after [signal target_reached] when the target is reachable. + */ + readonly navigation_finished: Signal0 + + /** Notifies when the collision avoidance velocity is calculated. Emitted every update as long as [member avoidance_enabled] is `true` and the agent has a navigation map. */ + readonly velocity_computed: Signal1 + } + /** A link between two positions on [NavigationRegion2D]s that agents can be routed through. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_navigationlink2d.html + */ + class NavigationLink2D = Record> extends Node2D { + constructor(identifier?: any) + /** Returns the [RID] of this link on the [NavigationServer2D]. */ + get_rid(): RID + + /** Sets the [RID] of the navigation map this link should use. By default the link will automatically join the [World2D] default navigation map so this function is only required to override the default map. */ + set_navigation_map(navigation_map: RID): void + + /** Returns the current navigation map [RID] used by this link. */ + get_navigation_map(): RID + + /** Based on [param value], enables or disables the specified layer in the [member navigation_layers] bitmask, given a [param layer_number] between 1 and 32. */ + set_navigation_layer_value(layer_number: int64, value: boolean): void + + /** Returns whether or not the specified layer of the [member navigation_layers] bitmask is enabled, given a [param layer_number] between 1 and 32. */ + get_navigation_layer_value(layer_number: int64): boolean + + /** Sets the [member start_position] that is relative to the link from a global [param position]. */ + set_global_start_position(position: Vector2): void + + /** Returns the [member start_position] that is relative to the link as a global position. */ + get_global_start_position(): Vector2 + + /** Sets the [member end_position] that is relative to the link from a global [param position]. */ + set_global_end_position(position: Vector2): void + + /** Returns the [member end_position] that is relative to the link as a global position. */ + get_global_end_position(): Vector2 + + /** Whether this link is currently active. If `false`, [method NavigationServer2D.map_get_path] will ignore this link. */ + get enabled(): boolean + set enabled(value: boolean) + + /** Whether this link can be traveled in both directions or only from [member start_position] to [member end_position]. */ + get bidirectional(): boolean + set bidirectional(value: boolean) + + /** A bitfield determining all navigation layers the link belongs to. These navigation layers will be checked when requesting a path with [method NavigationServer2D.map_get_path]. */ + get navigation_layers(): int64 + set navigation_layers(value: int64) + + /** Starting position of the link. + * This position will search out the nearest polygon in the navigation mesh to attach to. + * The distance the link will search is controlled by [method NavigationServer2D.map_set_link_connection_radius]. + */ + get start_position(): Vector2 + set start_position(value: Vector2) + + /** Ending position of the link. + * This position will search out the nearest polygon in the navigation mesh to attach to. + * The distance the link will search is controlled by [method NavigationServer2D.map_set_link_connection_radius]. + */ + get end_position(): Vector2 + set end_position(value: Vector2) + + /** When pathfinding enters this link from another regions navigation mesh the [member enter_cost] value is added to the path distance for determining the shortest path. */ + get enter_cost(): float64 + set enter_cost(value: float64) + + /** When pathfinding moves along the link the traveled distance is multiplied with [member travel_cost] for determining the shortest path. */ + get travel_cost(): float64 + set travel_cost(value: float64) + } + class NavigationLink2DEditor = Record> extends Control { + constructor(identifier?: any) + } + class NavigationLink2DEditorPlugin = Record> extends EditorPlugin { + constructor(identifier?: any) + } + /** A link between two positions on [NavigationRegion3D]s that agents can be routed through. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_navigationlink3d.html + */ + class NavigationLink3D = Record> extends Node3D { + constructor(identifier?: any) + /** Returns the [RID] of this link on the [NavigationServer3D]. */ + get_rid(): RID + + /** Sets the [RID] of the navigation map this link should use. By default the link will automatically join the [World3D] default navigation map so this function is only required to override the default map. */ + set_navigation_map(navigation_map: RID): void + + /** Returns the current navigation map [RID] used by this link. */ + get_navigation_map(): RID + + /** Based on [param value], enables or disables the specified layer in the [member navigation_layers] bitmask, given a [param layer_number] between 1 and 32. */ + set_navigation_layer_value(layer_number: int64, value: boolean): void + + /** Returns whether or not the specified layer of the [member navigation_layers] bitmask is enabled, given a [param layer_number] between 1 and 32. */ + get_navigation_layer_value(layer_number: int64): boolean + + /** Sets the [member start_position] that is relative to the link from a global [param position]. */ + set_global_start_position(position: Vector3): void + + /** Returns the [member start_position] that is relative to the link as a global position. */ + get_global_start_position(): Vector3 + + /** Sets the [member end_position] that is relative to the link from a global [param position]. */ + set_global_end_position(position: Vector3): void + + /** Returns the [member end_position] that is relative to the link as a global position. */ + get_global_end_position(): Vector3 + + /** Whether this link is currently active. If `false`, [method NavigationServer3D.map_get_path] will ignore this link. */ + get enabled(): boolean + set enabled(value: boolean) + + /** Whether this link can be traveled in both directions or only from [member start_position] to [member end_position]. */ + get bidirectional(): boolean + set bidirectional(value: boolean) + + /** A bitfield determining all navigation layers the link belongs to. These navigation layers will be checked when requesting a path with [method NavigationServer3D.map_get_path]. */ + get navigation_layers(): int64 + set navigation_layers(value: int64) + + /** Starting position of the link. + * This position will search out the nearest polygon in the navigation mesh to attach to. + * The distance the link will search is controlled by [method NavigationServer3D.map_set_link_connection_radius]. + */ + get start_position(): Vector3 + set start_position(value: Vector3) + + /** Ending position of the link. + * This position will search out the nearest polygon in the navigation mesh to attach to. + * The distance the link will search is controlled by [method NavigationServer3D.map_set_link_connection_radius]. + */ + get end_position(): Vector3 + set end_position(value: Vector3) + + /** When pathfinding enters this link from another regions navigation mesh the [member enter_cost] value is added to the path distance for determining the shortest path. */ + get enter_cost(): float64 + set enter_cost(value: float64) + + /** When pathfinding moves along the link the traveled distance is multiplied with [member travel_cost] for determining the shortest path. */ + get travel_cost(): float64 + set travel_cost(value: float64) + } + class NavigationLink3DGizmoPlugin extends EditorNode3DGizmoPlugin { + constructor(identifier?: any) + } + namespace NavigationMesh { + enum SamplePartitionType { + /** Watershed partitioning. Generally the best choice if you precompute the navigation mesh, use this if you have large open areas. */ + SAMPLE_PARTITION_WATERSHED = 0, + + /** Monotone partitioning. Use this if you want fast navigation mesh generation. */ + SAMPLE_PARTITION_MONOTONE = 1, + + /** Layer partitioning. Good choice to use for tiled navigation mesh with medium and small sized tiles. */ + SAMPLE_PARTITION_LAYERS = 2, + + /** Represents the size of the [enum SamplePartitionType] enum. */ + SAMPLE_PARTITION_MAX = 3, + } + enum ParsedGeometryType { + /** Parses mesh instances as geometry. This includes [MeshInstance3D], [CSGShape3D], and [GridMap] nodes. */ + PARSED_GEOMETRY_MESH_INSTANCES = 0, + + /** Parses [StaticBody3D] colliders as geometry. The collider should be in any of the layers specified by [member geometry_collision_mask]. */ + PARSED_GEOMETRY_STATIC_COLLIDERS = 1, + + /** Both [constant PARSED_GEOMETRY_MESH_INSTANCES] and [constant PARSED_GEOMETRY_STATIC_COLLIDERS]. */ + PARSED_GEOMETRY_BOTH = 2, + + /** Represents the size of the [enum ParsedGeometryType] enum. */ + PARSED_GEOMETRY_MAX = 3, + } + enum SourceGeometryMode { + /** Scans the child nodes of the root node recursively for geometry. */ + SOURCE_GEOMETRY_ROOT_NODE_CHILDREN = 0, + + /** Scans nodes in a group and their child nodes recursively for geometry. The group is specified by [member geometry_source_group_name]. */ + SOURCE_GEOMETRY_GROUPS_WITH_CHILDREN = 1, + + /** Uses nodes in a group for geometry. The group is specified by [member geometry_source_group_name]. */ + SOURCE_GEOMETRY_GROUPS_EXPLICIT = 2, + + /** Represents the size of the [enum SourceGeometryMode] enum. */ + SOURCE_GEOMETRY_MAX = 3, + } + } + /** A navigation mesh that defines traversable areas and obstacles. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_navigationmesh.html + */ + class NavigationMesh extends Resource { + constructor(identifier?: any) + /** Based on [param value], enables or disables the specified layer in the [member geometry_collision_mask], given a [param layer_number] between 1 and 32. */ + set_collision_mask_value(layer_number: int64, value: boolean): void + + /** Returns whether or not the specified layer of the [member geometry_collision_mask] is enabled, given a [param layer_number] between 1 and 32. */ + get_collision_mask_value(layer_number: int64): boolean + + /** Adds a polygon using the indices of the vertices you get when calling [method get_vertices]. */ + add_polygon(polygon: PackedInt32Array | int32[]): void + + /** Returns the number of polygons in the navigation mesh. */ + get_polygon_count(): int64 + + /** Returns a [PackedInt32Array] containing the indices of the vertices of a created polygon. */ + get_polygon(idx: int64): PackedInt32Array + + /** Clears the array of polygons, but it doesn't clear the array of vertices. */ + clear_polygons(): void + + /** Initializes the navigation mesh by setting the vertices and indices according to a [Mesh]. + * + * **Note:** The given [param mesh] must be of type [constant Mesh.PRIMITIVE_TRIANGLES] and have an index array. + */ + create_from_mesh(mesh: Mesh): void + + /** Clears the internal arrays for vertices and polygon indices. */ + clear(): void + get vertices(): PackedVector3Array + set vertices(value: PackedVector3Array | Vector3[]) + get polygons(): GArray + set polygons(value: GArray) + + /** Partitioning algorithm for creating the navigation mesh polys. See [enum SamplePartitionType] for possible values. */ + get sample_partition_type(): int64 + set sample_partition_type(value: int64) + + /** Determines which type of nodes will be parsed as geometry. See [enum ParsedGeometryType] for possible values. */ + get geometry_parsed_geometry_type(): int64 + set geometry_parsed_geometry_type(value: int64) + + /** The physics layers to scan for static colliders. + * Only used when [member geometry_parsed_geometry_type] is [constant PARSED_GEOMETRY_STATIC_COLLIDERS] or [constant PARSED_GEOMETRY_BOTH]. + */ + get geometry_collision_mask(): int64 + set geometry_collision_mask(value: int64) + + /** The source of the geometry used when baking. See [enum SourceGeometryMode] for possible values. */ + get geometry_source_geometry_mode(): int64 + set geometry_source_geometry_mode(value: int64) + + /** The name of the group to scan for geometry. + * Only used when [member geometry_source_geometry_mode] is [constant SOURCE_GEOMETRY_GROUPS_WITH_CHILDREN] or [constant SOURCE_GEOMETRY_GROUPS_EXPLICIT]. + */ + get geometry_source_group_name(): string + set geometry_source_group_name(value: string) + + /** The cell size used to rasterize the navigation mesh vertices on the XZ plane. Must match with the cell size on the navigation map. */ + get cell_size(): float64 + set cell_size(value: float64) + + /** The cell height used to rasterize the navigation mesh vertices on the Y axis. Must match with the cell height on the navigation map. */ + get cell_height(): float64 + set cell_height(value: float64) + + /** The size of the non-navigable border around the bake bounding area. + * In conjunction with the [member filter_baking_aabb] and a [member edge_max_error] value at `1.0` or below the border size can be used to bake tile aligned navigation meshes without the tile edges being shrunk by [member agent_radius]. + * + * **Note:** While baking and not zero, this value will be rounded up to the nearest multiple of [member cell_size]. + */ + get border_size(): float64 + set border_size(value: float64) + + /** The minimum floor to ceiling height that will still allow the floor area to be considered walkable. + * + * **Note:** While baking, this value will be rounded up to the nearest multiple of [member cell_height]. + */ + get agent_height(): float64 + set agent_height(value: float64) + + /** The distance to erode/shrink the walkable area of the heightfield away from obstructions. + * + * **Note:** While baking, this value will be rounded up to the nearest multiple of [member cell_size]. + */ + get agent_radius(): float64 + set agent_radius(value: float64) + + /** The minimum ledge height that is considered to still be traversable. + * + * **Note:** While baking, this value will be rounded down to the nearest multiple of [member cell_height]. + */ + get agent_max_climb(): float64 + set agent_max_climb(value: float64) + + /** The maximum slope that is considered walkable, in degrees. */ + get agent_max_slope(): float64 + set agent_max_slope(value: float64) + + /** The minimum size of a region for it to be created. + * + * **Note:** This value will be squared to calculate the minimum number of cells allowed to form isolated island areas. For example, a value of 8 will set the number of cells to 64. + */ + get region_min_size(): float64 + set region_min_size(value: float64) + + /** Any regions with a size smaller than this will be merged with larger regions if possible. + * + * **Note:** This value will be squared to calculate the number of cells. For example, a value of 20 will set the number of cells to 400. + */ + get region_merge_size(): float64 + set region_merge_size(value: float64) + + /** The maximum allowed length for contour edges along the border of the mesh. A value of `0.0` disables this feature. + * + * **Note:** While baking, this value will be rounded up to the nearest multiple of [member cell_size]. + */ + get edge_max_length(): float64 + set edge_max_length(value: float64) + + /** The maximum distance a simplified contour's border edges should deviate the original raw contour. */ + get edge_max_error(): float64 + set edge_max_error(value: float64) + + /** The maximum number of vertices allowed for polygons generated during the contour to polygon conversion process. */ + get vertices_per_polygon(): float64 + set vertices_per_polygon(value: float64) + + /** The sampling distance to use when generating the detail mesh, in cell unit. */ + get detail_sample_distance(): float64 + set detail_sample_distance(value: float64) + + /** The maximum distance the detail mesh surface should deviate from heightfield, in cell unit. */ + get detail_sample_max_error(): float64 + set detail_sample_max_error(value: float64) + + /** If `true`, marks non-walkable spans as walkable if their maximum is within [member agent_max_climb] of a walkable neighbor. */ + get filter_low_hanging_obstacles(): boolean + set filter_low_hanging_obstacles(value: boolean) + + /** If `true`, marks spans that are ledges as non-walkable. */ + get filter_ledge_spans(): boolean + set filter_ledge_spans(value: boolean) + + /** If `true`, marks walkable spans as not walkable if the clearance above the span is less than [member agent_height]. */ + get filter_walkable_low_height_spans(): boolean + set filter_walkable_low_height_spans(value: boolean) + + /** If the baking [AABB] has a volume the navigation mesh baking will be restricted to its enclosing area. */ + get filter_baking_aabb(): AABB + set filter_baking_aabb(value: AABB) + + /** The position offset applied to the [member filter_baking_aabb] [AABB]. */ + get filter_baking_aabb_offset(): Vector3 + set filter_baking_aabb_offset(value: Vector3) + } + class NavigationMeshEditor = Record> extends Control { + constructor(identifier?: any) + } + class NavigationMeshEditorPlugin = Record> extends EditorPlugin { + constructor(identifier?: any) + } + /** Container for parsed source geometry data used in navigation mesh baking. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_navigationmeshsourcegeometrydata2d.html + */ + class NavigationMeshSourceGeometryData2D extends Resource { + constructor(identifier?: any) + /** Clears the internal data. */ + clear(): void + + /** Returns `true` when parsed source geometry data exists. */ + has_data(): boolean + + /** Appends another array of [param traversable_outlines] at the end of the existing traversable outlines array. */ + append_traversable_outlines(traversable_outlines: GArray): void + + /** Appends another array of [param obstruction_outlines] at the end of the existing obstruction outlines array. */ + append_obstruction_outlines(obstruction_outlines: GArray): void + + /** Adds the outline points of a shape as traversable area. */ + add_traversable_outline(shape_outline: PackedVector2Array | Vector2[]): void + + /** Adds the outline points of a shape as obstructed area. */ + add_obstruction_outline(shape_outline: PackedVector2Array | Vector2[]): void + + /** Adds the geometry data of another [NavigationMeshSourceGeometryData2D] to the navigation mesh baking data. */ + merge(other_geometry: NavigationMeshSourceGeometryData2D): void + + /** Adds a projected obstruction shape to the source geometry. If [param carve] is `true` the carved shape will not be affected by additional offsets (e.g. agent radius) of the navigation mesh baking process. */ + add_projected_obstruction(vertices: PackedVector2Array | Vector2[], carve: boolean): void + + /** Clears all projected obstructions. */ + clear_projected_obstructions(): void + + /** Returns an axis-aligned bounding box that covers all the stored geometry data. The bounds are calculated when calling this function with the result cached until further geometry changes are made. */ + get_bounds(): Rect2 + get traversable_outlines(): GArray + set traversable_outlines(value: GArray) + get obstruction_outlines(): GArray + set obstruction_outlines(value: GArray) + get projected_obstructions(): GArray + set projected_obstructions(value: GArray) + } + /** Container for parsed source geometry data used in navigation mesh baking. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_navigationmeshsourcegeometrydata3d.html + */ + class NavigationMeshSourceGeometryData3D extends Resource { + constructor(identifier?: any) + /** Appends arrays of [param vertices] and [param indices] at the end of the existing arrays. Adds the existing index as an offset to the appended indices. */ + append_arrays(vertices: PackedFloat32Array | float32[], indices: PackedInt32Array | int32[]): void + + /** Clears the internal data. */ + clear(): void + + /** Returns `true` when parsed source geometry data exists. */ + has_data(): boolean + + /** Adds the geometry data of a [Mesh] resource to the navigation mesh baking data. The mesh must have valid triangulated mesh data to be considered. Since [NavigationMesh] resources have no transform, all vertex positions need to be offset by the node's transform using [param xform]. */ + add_mesh(mesh: Mesh, xform: Transform3D): void + + /** Adds an [Array] the size of [constant Mesh.ARRAY_MAX] and with vertices at index [constant Mesh.ARRAY_VERTEX] and indices at index [constant Mesh.ARRAY_INDEX] to the navigation mesh baking data. The array must have valid triangulated mesh data to be considered. Since [NavigationMesh] resources have no transform, all vertex positions need to be offset by the node's transform using [param xform]. */ + add_mesh_array(mesh_array: GArray, xform: Transform3D): void + + /** Adds an array of vertex positions to the geometry data for navigation mesh baking to form triangulated faces. For each face the array must have three vertex positions in clockwise winding order. Since [NavigationMesh] resources have no transform, all vertex positions need to be offset by the node's transform using [param xform]. */ + add_faces(faces: PackedVector3Array | Vector3[], xform: Transform3D): void + + /** Adds the geometry data of another [NavigationMeshSourceGeometryData3D] to the navigation mesh baking data. */ + merge(other_geometry: NavigationMeshSourceGeometryData3D): void + + /** Adds a projected obstruction shape to the source geometry. The [param vertices] are considered projected on a xz-axes plane, placed at the global y-axis [param elevation] and extruded by [param height]. If [param carve] is `true` the carved shape will not be affected by additional offsets (e.g. agent radius) of the navigation mesh baking process. */ + add_projected_obstruction(vertices: PackedVector3Array | Vector3[], elevation: float64, height: float64, carve: boolean): void + + /** Clears all projected obstructions. */ + clear_projected_obstructions(): void + + /** Returns an axis-aligned bounding box that covers all the stored geometry data. The bounds are calculated when calling this function with the result cached until further geometry changes are made. */ + get_bounds(): AABB + get vertices(): PackedVector3Array + set vertices(value: PackedVector3Array | Vector3[]) + get indices(): PackedInt32Array + set indices(value: PackedInt32Array | int32[]) + get projected_obstructions(): GArray + set projected_obstructions(value: GArray) + } + /** 2D obstacle used to affect navigation mesh baking or constrain velocities of avoidance controlled agents. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_navigationobstacle2d.html + */ + class NavigationObstacle2D = Record> extends Node2D { + constructor(identifier?: any) + /** Returns the [RID] of this obstacle on the [NavigationServer2D]. */ + get_rid(): RID + + /** Sets the [RID] of the navigation map this NavigationObstacle node should use and also updates the `obstacle` on the NavigationServer. */ + set_navigation_map(navigation_map: RID): void + + /** Returns the [RID] of the navigation map for this NavigationObstacle node. This function returns always the map set on the NavigationObstacle node and not the map of the abstract obstacle on the NavigationServer. If the obstacle map is changed directly with the NavigationServer API the NavigationObstacle node will not be aware of the map change. Use [method set_navigation_map] to change the navigation map for the NavigationObstacle and also update the obstacle on the NavigationServer. */ + get_navigation_map(): RID + + /** Based on [param value], enables or disables the specified layer in the [member avoidance_layers] bitmask, given a [param layer_number] between 1 and 32. */ + set_avoidance_layer_value(layer_number: int64, value: boolean): void + + /** Returns whether or not the specified layer of the [member avoidance_layers] bitmask is enabled, given a [param layer_number] between 1 and 32. */ + get_avoidance_layer_value(layer_number: int64): boolean + + /** Sets the avoidance radius for the obstacle. */ + get radius(): float64 + set radius(value: float64) + + /** The outline vertices of the obstacle. If the vertices are winded in clockwise order agents will be pushed in by the obstacle, else they will be pushed out. Outlines can not be crossed or overlap. Should the vertices using obstacle be warped to a new position agent's can not predict this movement and may get trapped inside the obstacle. */ + get vertices(): PackedVector2Array + set vertices(value: PackedVector2Array | Vector2[]) + + /** If enabled and parsed in a navigation mesh baking process the obstacle will discard source geometry inside its [member vertices] defined shape. */ + get affect_navigation_mesh(): boolean + set affect_navigation_mesh(value: boolean) + + /** If enabled the obstacle vertices will carve into the baked navigation mesh with the shape unaffected by additional offsets (e.g. agent radius). + * It will still be affected by further postprocessing of the baking process, like edge and polygon simplification. + * Requires [member affect_navigation_mesh] to be enabled. + */ + get carve_navigation_mesh(): boolean + set carve_navigation_mesh(value: boolean) + + /** If `true` the obstacle affects avoidance using agents. */ + get avoidance_enabled(): boolean + set avoidance_enabled(value: boolean) + + /** Sets the wanted velocity for the obstacle so other agent's can better predict the obstacle if it is moved with a velocity regularly (every frame) instead of warped to a new position. Does only affect avoidance for the obstacles [member radius]. Does nothing for the obstacles static vertices. */ + get velocity(): Vector2 + set velocity(value: Vector2) + + /** A bitfield determining the avoidance layers for this obstacle. Agents with a matching bit on the their avoidance mask will avoid this obstacle. */ + get avoidance_layers(): int64 + set avoidance_layers(value: int64) + } + class NavigationObstacle2DEditor = Record> extends AbstractPolygon2DEditor { + constructor(identifier?: any) + } + class NavigationObstacle2DEditorPlugin = Record> extends AbstractPolygon2DEditorPlugin { + constructor(identifier?: any) + } + /** 3D obstacle used to affect navigation mesh baking or constrain velocities of avoidance controlled agents. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_navigationobstacle3d.html + */ + class NavigationObstacle3D = Record> extends Node3D { + constructor(identifier?: any) + /** Returns the [RID] of this obstacle on the [NavigationServer3D]. */ + get_rid(): RID + + /** Sets the [RID] of the navigation map this NavigationObstacle node should use and also updates the `obstacle` on the NavigationServer. */ + set_navigation_map(navigation_map: RID): void + + /** Returns the [RID] of the navigation map for this NavigationObstacle node. This function returns always the map set on the NavigationObstacle node and not the map of the abstract obstacle on the NavigationServer. If the obstacle map is changed directly with the NavigationServer API the NavigationObstacle node will not be aware of the map change. Use [method set_navigation_map] to change the navigation map for the NavigationObstacle and also update the obstacle on the NavigationServer. */ + get_navigation_map(): RID + + /** Based on [param value], enables or disables the specified layer in the [member avoidance_layers] bitmask, given a [param layer_number] between 1 and 32. */ + set_avoidance_layer_value(layer_number: int64, value: boolean): void + + /** Returns whether or not the specified layer of the [member avoidance_layers] bitmask is enabled, given a [param layer_number] between 1 and 32. */ + get_avoidance_layer_value(layer_number: int64): boolean + + /** Sets the avoidance radius for the obstacle. */ + get radius(): float64 + set radius(value: float64) + + /** Sets the obstacle height used in 2D avoidance. 2D avoidance using agent's ignore obstacles that are below or above them. */ + get height(): float64 + set height(value: float64) + + /** The outline vertices of the obstacle. If the vertices are winded in clockwise order agents will be pushed in by the obstacle, else they will be pushed out. Outlines can not be crossed or overlap. Should the vertices using obstacle be warped to a new position agent's can not predict this movement and may get trapped inside the obstacle. */ + get vertices(): PackedVector3Array + set vertices(value: PackedVector3Array | Vector3[]) + + /** If enabled and parsed in a navigation mesh baking process the obstacle will discard source geometry inside its [member vertices] and [member height] defined shape. */ + get affect_navigation_mesh(): boolean + set affect_navigation_mesh(value: boolean) + + /** If enabled the obstacle vertices will carve into the baked navigation mesh with the shape unaffected by additional offsets (e.g. agent radius). + * It will still be affected by further postprocessing of the baking process, like edge and polygon simplification. + * Requires [member affect_navigation_mesh] to be enabled. + */ + get carve_navigation_mesh(): boolean + set carve_navigation_mesh(value: boolean) + + /** If `true` the obstacle affects avoidance using agents. */ + get avoidance_enabled(): boolean + set avoidance_enabled(value: boolean) + + /** Sets the wanted velocity for the obstacle so other agent's can better predict the obstacle if it is moved with a velocity regularly (every frame) instead of warped to a new position. Does only affect avoidance for the obstacles [member radius]. Does nothing for the obstacles static vertices. */ + get velocity(): Vector3 + set velocity(value: Vector3) + + /** A bitfield determining the avoidance layers for this obstacle. Agents with a matching bit on the their avoidance mask will avoid this obstacle. */ + get avoidance_layers(): int64 + set avoidance_layers(value: int64) + + /** If `true` the obstacle affects 3D avoidance using agent's with obstacle [member radius]. + * If `false` the obstacle affects 2D avoidance using agent's with both obstacle [member vertices] as well as obstacle [member radius]. + */ + get use_3d_avoidance(): boolean + set use_3d_avoidance(value: boolean) + } + class NavigationObstacle3DEditorPlugin = Record> extends EditorPlugin { + constructor(identifier?: any) + } + class NavigationObstacle3DGizmoPlugin extends EditorNode3DGizmoPlugin { + constructor(identifier?: any) + } + namespace NavigationPathQueryParameters2D { + enum PathfindingAlgorithm { + /** The path query uses the default A* pathfinding algorithm. */ + PATHFINDING_ALGORITHM_ASTAR = 0, + } + enum PathPostProcessing { + /** Applies a funnel algorithm to the raw path corridor found by the pathfinding algorithm. This will result in the shortest path possible inside the path corridor. This postprocessing very much depends on the navigation mesh polygon layout and the created corridor. Especially tile- or gridbased layouts can face artificial corners with diagonal movement due to a jagged path corridor imposed by the cell shapes. */ + PATH_POSTPROCESSING_CORRIDORFUNNEL = 0, + + /** Centers every path position in the middle of the traveled navigation mesh polygon edge. This creates better paths for tile- or gridbased layouts that restrict the movement to the cells center. */ + PATH_POSTPROCESSING_EDGECENTERED = 1, + + /** Applies no postprocessing and returns the raw path corridor as found by the pathfinding algorithm. */ + PATH_POSTPROCESSING_NONE = 2, + } + enum PathMetadataFlags { + /** Don't include any additional metadata about the returned path. */ + PATH_METADATA_INCLUDE_NONE = 0, + + /** Include the type of navigation primitive (region or link) that each point of the path goes through. */ + PATH_METADATA_INCLUDE_TYPES = 1, + + /** Include the [RID]s of the regions and links that each point of the path goes through. */ + PATH_METADATA_INCLUDE_RIDS = 2, + + /** Include the `ObjectID`s of the [Object]s which manage the regions and links each point of the path goes through. */ + PATH_METADATA_INCLUDE_OWNERS = 4, + + /** Include all available metadata about the returned path. */ + PATH_METADATA_INCLUDE_ALL = 7, + } + } + /** Provides parameters for 2D navigation path queries. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_navigationpathqueryparameters2d.html + */ + class NavigationPathQueryParameters2D extends RefCounted { + constructor(identifier?: any) + /** The navigation map [RID] used in the path query. */ + get map(): RID + set map(value: RID) + + /** The pathfinding start position in global coordinates. */ + get start_position(): Vector2 + set start_position(value: Vector2) + + /** The pathfinding target position in global coordinates. */ + get target_position(): Vector2 + set target_position(value: Vector2) + + /** The navigation layers the query will use (as a bitmask). */ + get navigation_layers(): int64 + set navigation_layers(value: int64) + + /** The pathfinding algorithm used in the path query. */ + get pathfinding_algorithm(): int64 + set pathfinding_algorithm(value: int64) + + /** The path postprocessing applied to the raw path corridor found by the [member pathfinding_algorithm]. */ + get path_postprocessing(): int64 + set path_postprocessing(value: int64) + + /** Additional information to include with the navigation path. */ + get metadata_flags(): int64 + set metadata_flags(value: int64) + + /** If `true` a simplified version of the path will be returned with less critical path points removed. The simplification amount is controlled by [member simplify_epsilon]. The simplification uses a variant of Ramer-Douglas-Peucker algorithm for curve point decimation. + * Path simplification can be helpful to mitigate various path following issues that can arise with certain agent types and script behaviors. E.g. "steering" agents or avoidance in "open fields". + */ + get simplify_path(): boolean + set simplify_path(value: boolean) + + /** The path simplification amount in worlds units. */ + get simplify_epsilon(): float64 + set simplify_epsilon(value: float64) + } + namespace NavigationPathQueryParameters3D { + enum PathfindingAlgorithm { + /** The path query uses the default A* pathfinding algorithm. */ + PATHFINDING_ALGORITHM_ASTAR = 0, + } + enum PathPostProcessing { + /** Applies a funnel algorithm to the raw path corridor found by the pathfinding algorithm. This will result in the shortest path possible inside the path corridor. This postprocessing very much depends on the navigation mesh polygon layout and the created corridor. Especially tile- or gridbased layouts can face artificial corners with diagonal movement due to a jagged path corridor imposed by the cell shapes. */ + PATH_POSTPROCESSING_CORRIDORFUNNEL = 0, + + /** Centers every path position in the middle of the traveled navigation mesh polygon edge. This creates better paths for tile- or gridbased layouts that restrict the movement to the cells center. */ + PATH_POSTPROCESSING_EDGECENTERED = 1, + + /** Applies no postprocessing and returns the raw path corridor as found by the pathfinding algorithm. */ + PATH_POSTPROCESSING_NONE = 2, + } + enum PathMetadataFlags { + /** Don't include any additional metadata about the returned path. */ + PATH_METADATA_INCLUDE_NONE = 0, + + /** Include the type of navigation primitive (region or link) that each point of the path goes through. */ + PATH_METADATA_INCLUDE_TYPES = 1, + + /** Include the [RID]s of the regions and links that each point of the path goes through. */ + PATH_METADATA_INCLUDE_RIDS = 2, + + /** Include the `ObjectID`s of the [Object]s which manage the regions and links each point of the path goes through. */ + PATH_METADATA_INCLUDE_OWNERS = 4, + + /** Include all available metadata about the returned path. */ + PATH_METADATA_INCLUDE_ALL = 7, + } + } + /** Provides parameters for 3D navigation path queries. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_navigationpathqueryparameters3d.html + */ + class NavigationPathQueryParameters3D extends RefCounted { + constructor(identifier?: any) + /** The navigation map [RID] used in the path query. */ + get map(): RID + set map(value: RID) + + /** The pathfinding start position in global coordinates. */ + get start_position(): Vector3 + set start_position(value: Vector3) + + /** The pathfinding target position in global coordinates. */ + get target_position(): Vector3 + set target_position(value: Vector3) + + /** The navigation layers the query will use (as a bitmask). */ + get navigation_layers(): int64 + set navigation_layers(value: int64) + + /** The pathfinding algorithm used in the path query. */ + get pathfinding_algorithm(): int64 + set pathfinding_algorithm(value: int64) + + /** The path postprocessing applied to the raw path corridor found by the [member pathfinding_algorithm]. */ + get path_postprocessing(): int64 + set path_postprocessing(value: int64) + + /** Additional information to include with the navigation path. */ + get metadata_flags(): int64 + set metadata_flags(value: int64) + + /** If `true` a simplified version of the path will be returned with less critical path points removed. The simplification amount is controlled by [member simplify_epsilon]. The simplification uses a variant of Ramer-Douglas-Peucker algorithm for curve point decimation. + * Path simplification can be helpful to mitigate various path following issues that can arise with certain agent types and script behaviors. E.g. "steering" agents or avoidance in "open fields". + */ + get simplify_path(): boolean + set simplify_path(value: boolean) + + /** The path simplification amount in worlds units. */ + get simplify_epsilon(): float64 + set simplify_epsilon(value: float64) + } + namespace NavigationPathQueryResult2D { + enum PathSegmentType { + /** This segment of the path goes through a region. */ + PATH_SEGMENT_TYPE_REGION = 0, + + /** This segment of the path goes through a link. */ + PATH_SEGMENT_TYPE_LINK = 1, + } + } + /** Represents the result of a 2D pathfinding query. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_navigationpathqueryresult2d.html + */ + class NavigationPathQueryResult2D extends RefCounted { + constructor(identifier?: any) + /** Reset the result object to its initial state. This is useful to reuse the object across multiple queries. */ + reset(): void + + /** The resulting path array from the navigation query. All path array positions are in global coordinates. Without customized query parameters this is the same path as returned by [method NavigationServer2D.map_get_path]. */ + get path(): PackedVector2Array + set path(value: PackedVector2Array | Vector2[]) + + /** The type of navigation primitive (region or link) that each point of the path goes through. */ + get path_types(): PackedInt32Array + set path_types(value: PackedInt32Array | int32[]) + + /** The [RID]s of the regions and links that each point of the path goes through. */ + get path_rids(): GArray + set path_rids(value: GArray) + + /** The `ObjectID`s of the [Object]s which manage the regions and links each point of the path goes through. */ + get path_owner_ids(): PackedInt64Array + set path_owner_ids(value: PackedInt64Array | int64[]) + } + namespace NavigationPathQueryResult3D { + enum PathSegmentType { + /** This segment of the path goes through a region. */ + PATH_SEGMENT_TYPE_REGION = 0, + + /** This segment of the path goes through a link. */ + PATH_SEGMENT_TYPE_LINK = 1, + } + } + /** Represents the result of a 3D pathfinding query. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_navigationpathqueryresult3d.html + */ + class NavigationPathQueryResult3D extends RefCounted { + constructor(identifier?: any) + /** Reset the result object to its initial state. This is useful to reuse the object across multiple queries. */ + reset(): void + + /** The resulting path array from the navigation query. All path array positions are in global coordinates. Without customized query parameters this is the same path as returned by [method NavigationServer3D.map_get_path]. */ + get path(): PackedVector3Array + set path(value: PackedVector3Array | Vector3[]) + + /** The type of navigation primitive (region or link) that each point of the path goes through. */ + get path_types(): PackedInt32Array + set path_types(value: PackedInt32Array | int32[]) + + /** The [RID]s of the regions and links that each point of the path goes through. */ + get path_rids(): GArray + set path_rids(value: GArray) + + /** The `ObjectID`s of the [Object]s which manage the regions and links each point of the path goes through. */ + get path_owner_ids(): PackedInt64Array + set path_owner_ids(value: PackedInt64Array | int64[]) + } + namespace NavigationPolygon { + enum SamplePartitionType { + /** Convex partitioning that yields navigation mesh with convex polygons. */ + SAMPLE_PARTITION_CONVEX_PARTITION = 0, + + /** Triangulation partitioning that yields navigation mesh with triangle polygons. */ + SAMPLE_PARTITION_TRIANGULATE = 1, + + /** Represents the size of the [enum SamplePartitionType] enum. */ + SAMPLE_PARTITION_MAX = 2, + } + enum ParsedGeometryType { + /** Parses mesh instances as obstruction geometry. This includes [Polygon2D], [MeshInstance2D], [MultiMeshInstance2D], and [TileMap] nodes. + * Meshes are only parsed when they use a 2D vertices surface format. + */ + PARSED_GEOMETRY_MESH_INSTANCES = 0, + + /** Parses [StaticBody2D] and [TileMap] colliders as obstruction geometry. The collider should be in any of the layers specified by [member parsed_collision_mask]. */ + PARSED_GEOMETRY_STATIC_COLLIDERS = 1, + + /** Both [constant PARSED_GEOMETRY_MESH_INSTANCES] and [constant PARSED_GEOMETRY_STATIC_COLLIDERS]. */ + PARSED_GEOMETRY_BOTH = 2, + + /** Represents the size of the [enum ParsedGeometryType] enum. */ + PARSED_GEOMETRY_MAX = 3, + } + enum SourceGeometryMode { + /** Scans the child nodes of the root node recursively for geometry. */ + SOURCE_GEOMETRY_ROOT_NODE_CHILDREN = 0, + + /** Scans nodes in a group and their child nodes recursively for geometry. The group is specified by [member source_geometry_group_name]. */ + SOURCE_GEOMETRY_GROUPS_WITH_CHILDREN = 1, + + /** Uses nodes in a group for geometry. The group is specified by [member source_geometry_group_name]. */ + SOURCE_GEOMETRY_GROUPS_EXPLICIT = 2, + + /** Represents the size of the [enum SourceGeometryMode] enum. */ + SOURCE_GEOMETRY_MAX = 3, + } + } + /** A 2D navigation mesh that describes a traversable surface for pathfinding. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_navigationpolygon.html + */ + class NavigationPolygon extends Resource { + constructor(identifier?: any) + /** Adds a polygon using the indices of the vertices you get when calling [method get_vertices]. */ + add_polygon(polygon: PackedInt32Array | int32[]): void + + /** Returns the count of all polygons. */ + get_polygon_count(): int64 + + /** Returns a [PackedInt32Array] containing the indices of the vertices of a created polygon. */ + get_polygon(idx: int64): PackedInt32Array + + /** Clears the array of polygons, but it doesn't clear the array of outlines and vertices. */ + clear_polygons(): void + + /** Returns the [NavigationMesh] resulting from this navigation polygon. This navigation mesh can be used to update the navigation mesh of a region with the [method NavigationServer3D.region_set_navigation_mesh] API directly (as 2D uses the 3D server behind the scene). */ + get_navigation_mesh(): NavigationMesh + + /** Appends a [PackedVector2Array] that contains the vertices of an outline to the internal array that contains all the outlines. */ + add_outline(outline: PackedVector2Array | Vector2[]): void + + /** Adds a [PackedVector2Array] that contains the vertices of an outline to the internal array that contains all the outlines at a fixed position. */ + add_outline_at_index(outline: PackedVector2Array | Vector2[], index: int64): void + + /** Returns the number of outlines that were created in the editor or by script. */ + get_outline_count(): int64 + + /** Changes an outline created in the editor or by script. You have to call [method make_polygons_from_outlines] for the polygons to update. */ + set_outline(idx: int64, outline: PackedVector2Array | Vector2[]): void + + /** Returns a [PackedVector2Array] containing the vertices of an outline that was created in the editor or by script. */ + get_outline(idx: int64): PackedVector2Array + + /** Removes an outline created in the editor or by script. You have to call [method make_polygons_from_outlines] for the polygons to update. */ + remove_outline(idx: int64): void + + /** Clears the array of the outlines, but it doesn't clear the vertices and the polygons that were created by them. */ + clear_outlines(): void + + /** Creates polygons from the outlines added in the editor or by script. */ + make_polygons_from_outlines(): void + + /** Based on [param value], enables or disables the specified layer in the [member parsed_collision_mask], given a [param layer_number] between 1 and 32. */ + set_parsed_collision_mask_value(layer_number: int64, value: boolean): void + + /** Returns whether or not the specified layer of the [member parsed_collision_mask] is enabled, given a [param layer_number] between 1 and 32. */ + get_parsed_collision_mask_value(layer_number: int64): boolean + + /** Clears the internal arrays for vertices and polygon indices. */ + clear(): void + get vertices(): PackedVector2Array + set vertices(value: PackedVector2Array | Vector2[]) + get polygons(): GArray + set polygons(value: GArray) + get outlines(): GArray + set outlines(value: GArray) + + /** Partitioning algorithm for creating the navigation mesh polys. See [enum SamplePartitionType] for possible values. */ + get sample_partition_type(): int64 + set sample_partition_type(value: int64) + + /** Determines which type of nodes will be parsed as geometry. See [enum ParsedGeometryType] for possible values. */ + get parsed_geometry_type(): int64 + set parsed_geometry_type(value: int64) + + /** The physics layers to scan for static colliders. + * Only used when [member parsed_geometry_type] is [constant PARSED_GEOMETRY_STATIC_COLLIDERS] or [constant PARSED_GEOMETRY_BOTH]. + */ + get parsed_collision_mask(): int64 + set parsed_collision_mask(value: int64) + + /** The source of the geometry used when baking. See [enum SourceGeometryMode] for possible values. */ + get source_geometry_mode(): int64 + set source_geometry_mode(value: int64) + + /** The group name of nodes that should be parsed for baking source geometry. + * Only used when [member source_geometry_mode] is [constant SOURCE_GEOMETRY_GROUPS_WITH_CHILDREN] or [constant SOURCE_GEOMETRY_GROUPS_EXPLICIT]. + */ + get source_geometry_group_name(): string + set source_geometry_group_name(value: string) + + /** The cell size used to rasterize the navigation mesh vertices. Must match with the cell size on the navigation map. */ + get cell_size(): float64 + set cell_size(value: float64) + + /** The size of the non-navigable border around the bake bounding area defined by the [member baking_rect] [Rect2]. + * In conjunction with the [member baking_rect] the border size can be used to bake tile aligned navigation meshes without the tile edges being shrunk by [member agent_radius]. + */ + get border_size(): float64 + set border_size(value: float64) + + /** The distance to erode/shrink the walkable surface when baking the navigation mesh. */ + get agent_radius(): float64 + set agent_radius(value: float64) + + /** If the baking [Rect2] has an area the navigation mesh baking will be restricted to its enclosing area. */ + get baking_rect(): Rect2 + set baking_rect(value: Rect2) + + /** The position offset applied to the [member baking_rect] [Rect2]. */ + get baking_rect_offset(): Vector2 + set baking_rect_offset(value: Vector2) + } + class NavigationPolygonEditor = Record> extends AbstractPolygon2DEditor { + constructor(identifier?: any) + } + class NavigationPolygonEditorPlugin = Record> extends AbstractPolygon2DEditorPlugin { + constructor(identifier?: any) + } + /** A traversable 2D region that [NavigationAgent2D]s can use for pathfinding. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_navigationregion2d.html + */ + class NavigationRegion2D = Record> extends Node2D { + constructor(identifier?: any) + /** Returns the [RID] of this region on the [NavigationServer2D]. Combined with [method NavigationServer2D.map_get_closest_point_owner] can be used to identify the [NavigationRegion2D] closest to a point on the merged navigation map. */ + get_rid(): RID + + /** Sets the [RID] of the navigation map this region should use. By default the region will automatically join the [World2D] default navigation map so this function is only required to override the default map. */ + set_navigation_map(navigation_map: RID): void + + /** Returns the current navigation map [RID] used by this region. */ + get_navigation_map(): RID + + /** Based on [param value], enables or disables the specified layer in the [member navigation_layers] bitmask, given a [param layer_number] between 1 and 32. */ + set_navigation_layer_value(layer_number: int64, value: boolean): void + + /** Returns whether or not the specified layer of the [member navigation_layers] bitmask is enabled, given a [param layer_number] between 1 and 32. */ + get_navigation_layer_value(layer_number: int64): boolean + + /** Returns the [RID] of this region on the [NavigationServer2D]. */ + get_region_rid(): RID + + /** Bakes the [NavigationPolygon]. If [param on_thread] is set to `true` (default), the baking is done on a separate thread. */ + bake_navigation_polygon(on_thread: boolean = true): void + + /** Returns `true` when the [NavigationPolygon] is being baked on a background thread. */ + is_baking(): boolean + _navigation_polygon_changed(): void + + /** Returns the axis-aligned rectangle for the region's transformed navigation mesh. */ + get_bounds(): Rect2 + + /** The [NavigationPolygon] resource to use. */ + get navigation_polygon(): NavigationPolygon + set navigation_polygon(value: NavigationPolygon) + + /** Determines if the [NavigationRegion2D] is enabled or disabled. */ + get enabled(): boolean + set enabled(value: boolean) + + /** If enabled the navigation region will use edge connections to connect with other navigation regions within proximity of the navigation map edge connection margin. */ + get use_edge_connections(): boolean + set use_edge_connections(value: boolean) + + /** A bitfield determining all navigation layers the region belongs to. These navigation layers can be checked upon when requesting a path with [method NavigationServer2D.map_get_path]. */ + get navigation_layers(): int64 + set navigation_layers(value: int64) + + /** When pathfinding enters this region's navigation mesh from another regions navigation mesh the [member enter_cost] value is added to the path distance for determining the shortest path. */ + get enter_cost(): float64 + set enter_cost(value: float64) + + /** When pathfinding moves inside this region's navigation mesh the traveled distances are multiplied with [member travel_cost] for determining the shortest path. */ + get travel_cost(): float64 + set travel_cost(value: float64) + + /** Emitted when the used navigation polygon is replaced or changes to the internals of the current navigation polygon are committed. */ + readonly navigation_polygon_changed: Signal0 + + /** Emitted when a navigation polygon bake operation is completed. */ + readonly bake_finished: Signal0 + } + /** A traversable 3D region that [NavigationAgent3D]s can use for pathfinding. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_navigationregion3d.html + */ + class NavigationRegion3D = Record> extends Node3D { + constructor(identifier?: any) + /** Returns the [RID] of this region on the [NavigationServer3D]. Combined with [method NavigationServer3D.map_get_closest_point_owner] can be used to identify the [NavigationRegion3D] closest to a point on the merged navigation map. */ + get_rid(): RID + + /** Sets the [RID] of the navigation map this region should use. By default the region will automatically join the [World3D] default navigation map so this function is only required to override the default map. */ + set_navigation_map(navigation_map: RID): void + + /** Returns the current navigation map [RID] used by this region. */ + get_navigation_map(): RID + + /** Based on [param value], enables or disables the specified layer in the [member navigation_layers] bitmask, given a [param layer_number] between 1 and 32. */ + set_navigation_layer_value(layer_number: int64, value: boolean): void + + /** Returns whether or not the specified layer of the [member navigation_layers] bitmask is enabled, given a [param layer_number] between 1 and 32. */ + get_navigation_layer_value(layer_number: int64): boolean + + /** Returns the [RID] of this region on the [NavigationServer3D]. */ + get_region_rid(): RID + + /** Bakes the [NavigationMesh]. If [param on_thread] is set to `true` (default), the baking is done on a separate thread. Baking on separate thread is useful because navigation baking is not a cheap operation. When it is completed, it automatically sets the new [NavigationMesh]. Please note that baking on separate thread may be very slow if geometry is parsed from meshes as async access to each mesh involves heavy synchronization. Also, please note that baking on a separate thread is automatically disabled on operating systems that cannot use threads (such as Web with threads disabled). */ + bake_navigation_mesh(on_thread: boolean = true): void + + /** Returns `true` when the [NavigationMesh] is being baked on a background thread. */ + is_baking(): boolean + + /** Returns the axis-aligned bounding box for the region's transformed navigation mesh. */ + get_bounds(): AABB + + /** The [NavigationMesh] resource to use. */ + get navigation_mesh(): NavigationMesh + set navigation_mesh(value: NavigationMesh) + + /** Determines if the [NavigationRegion3D] is enabled or disabled. */ + get enabled(): boolean + set enabled(value: boolean) + + /** If enabled the navigation region will use edge connections to connect with other navigation regions within proximity of the navigation map edge connection margin. */ + get use_edge_connections(): boolean + set use_edge_connections(value: boolean) + + /** A bitfield determining all navigation layers the region belongs to. These navigation layers can be checked upon when requesting a path with [method NavigationServer3D.map_get_path]. */ + get navigation_layers(): int64 + set navigation_layers(value: int64) + + /** When pathfinding enters this region's navigation mesh from another regions navigation mesh the [member enter_cost] value is added to the path distance for determining the shortest path. */ + get enter_cost(): float64 + set enter_cost(value: float64) + + /** When pathfinding moves inside this region's navigation mesh the traveled distances are multiplied with [member travel_cost] for determining the shortest path. */ + get travel_cost(): float64 + set travel_cost(value: float64) + + /** Notifies when the [NavigationMesh] has changed. */ + readonly navigation_mesh_changed: Signal0 + + /** Notifies when the navigation mesh bake operation is completed. */ + readonly bake_finished: Signal0 + } + class NavigationRegion3DGizmoPlugin extends EditorNode3DGizmoPlugin { + constructor(identifier?: any) + } + namespace NinePatchRect { + enum AxisStretchMode { + /** Stretches the center texture across the NinePatchRect. This may cause the texture to be distorted. */ + AXIS_STRETCH_MODE_STRETCH = 0, + + /** Repeats the center texture across the NinePatchRect. This won't cause any visible distortion. The texture must be seamless for this to work without displaying artifacts between edges. */ + AXIS_STRETCH_MODE_TILE = 1, + + /** Repeats the center texture across the NinePatchRect, but will also stretch the texture to make sure each tile is visible in full. This may cause the texture to be distorted, but less than [constant AXIS_STRETCH_MODE_STRETCH]. The texture must be seamless for this to work without displaying artifacts between edges. */ + AXIS_STRETCH_MODE_TILE_FIT = 2, + } + } + /** A control that displays a texture by keeping its corners intact, but tiling its edges and center. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_ninepatchrect.html + */ + class NinePatchRect = Record> extends Control { + constructor(identifier?: any) + /** Sets the size of the margin on the specified [enum Side] to [param value] pixels. */ + set_patch_margin(margin: Side, value: int64): void + + /** Returns the size of the margin on the specified [enum Side]. */ + get_patch_margin(margin: Side): int64 + + /** The node's texture resource. */ + get texture(): Texture2D + set texture(value: Texture2D) + + /** If `true`, draw the panel's center. Else, only draw the 9-slice's borders. */ + get draw_center(): boolean + set draw_center(value: boolean) + + /** Rectangular region of the texture to sample from. If you're working with an atlas, use this property to define the area the 9-slice should use. All other properties are relative to this one. If the rect is empty, NinePatchRect will use the whole texture. */ + get region_rect(): Rect2 + set region_rect(value: Rect2) + + /** The width of the 9-slice's left column. A margin of 16 means the 9-slice's left corners and side will have a width of 16 pixels. You can set all 4 margin values individually to create panels with non-uniform borders. */ + get patch_margin_left(): int64 + set patch_margin_left(value: int64) + + /** The height of the 9-slice's top row. A margin of 16 means the 9-slice's top corners and side will have a height of 16 pixels. You can set all 4 margin values individually to create panels with non-uniform borders. */ + get patch_margin_top(): int64 + set patch_margin_top(value: int64) + + /** The width of the 9-slice's right column. A margin of 16 means the 9-slice's right corners and side will have a width of 16 pixels. You can set all 4 margin values individually to create panels with non-uniform borders. */ + get patch_margin_right(): int64 + set patch_margin_right(value: int64) + + /** The height of the 9-slice's bottom row. A margin of 16 means the 9-slice's bottom corners and side will have a height of 16 pixels. You can set all 4 margin values individually to create panels with non-uniform borders. */ + get patch_margin_bottom(): int64 + set patch_margin_bottom(value: int64) + + /** The stretch mode to use for horizontal stretching/tiling. See [enum NinePatchRect.AxisStretchMode] for possible values. */ + get axis_stretch_horizontal(): int64 + set axis_stretch_horizontal(value: int64) + + /** The stretch mode to use for vertical stretching/tiling. See [enum NinePatchRect.AxisStretchMode] for possible values. */ + get axis_stretch_vertical(): int64 + set axis_stretch_vertical(value: int64) + + /** Emitted when the node's texture changes. */ + readonly texture_changed: Signal0 + } + namespace Node { + enum ProcessMode { + /** Inherits [member process_mode] from the node's parent. This is the default for any newly created node. */ + PROCESS_MODE_INHERIT = 0, + + /** Stops processing when [member SceneTree.paused] is `true`. This is the inverse of [constant PROCESS_MODE_WHEN_PAUSED], and the default for the root node. */ + PROCESS_MODE_PAUSABLE = 1, + + /** Process **only** when [member SceneTree.paused] is `true`. This is the inverse of [constant PROCESS_MODE_PAUSABLE]. */ + PROCESS_MODE_WHEN_PAUSED = 2, + + /** Always process. Keeps processing, ignoring [member SceneTree.paused]. This is the inverse of [constant PROCESS_MODE_DISABLED]. */ + PROCESS_MODE_ALWAYS = 3, + + /** Never process. Completely disables processing, ignoring [member SceneTree.paused]. This is the inverse of [constant PROCESS_MODE_ALWAYS]. */ + PROCESS_MODE_DISABLED = 4, + } + enum ProcessThreadGroup { + /** Process this node based on the thread group mode of the first parent (or grandparent) node that has a thread group mode that is not inherit. See [member process_thread_group] for more information. */ + PROCESS_THREAD_GROUP_INHERIT = 0, + + /** Process this node (and child nodes set to inherit) on the main thread. See [member process_thread_group] for more information. */ + PROCESS_THREAD_GROUP_MAIN_THREAD = 1, + + /** Process this node (and child nodes set to inherit) on a sub-thread. See [member process_thread_group] for more information. */ + PROCESS_THREAD_GROUP_SUB_THREAD = 2, + } + enum ProcessThreadMessages { + /** Allows this node to process threaded messages created with [method call_deferred_thread_group] right before [method _process] is called. */ + FLAG_PROCESS_THREAD_MESSAGES = 1, + + /** Allows this node to process threaded messages created with [method call_deferred_thread_group] right before [method _physics_process] is called. */ + FLAG_PROCESS_THREAD_MESSAGES_PHYSICS = 2, + + /** Allows this node to process threaded messages created with [method call_deferred_thread_group] right before either [method _process] or [method _physics_process] are called. */ + FLAG_PROCESS_THREAD_MESSAGES_ALL = 3, + } + enum PhysicsInterpolationMode { + /** Inherits [member physics_interpolation_mode] from the node's parent. This is the default for any newly created node. */ + PHYSICS_INTERPOLATION_MODE_INHERIT = 0, + + /** Enables physics interpolation for this node and for children set to [constant PHYSICS_INTERPOLATION_MODE_INHERIT]. This is the default for the root node. */ + PHYSICS_INTERPOLATION_MODE_ON = 1, + + /** Disables physics interpolation for this node and for children set to [constant PHYSICS_INTERPOLATION_MODE_INHERIT]. */ + PHYSICS_INTERPOLATION_MODE_OFF = 2, + } + enum DuplicateFlags { + /** Duplicate the node's signal connections. */ + DUPLICATE_SIGNALS = 1, + + /** Duplicate the node's groups. */ + DUPLICATE_GROUPS = 2, + + /** Duplicate the node's script (also overriding the duplicated children's scripts, if combined with [constant DUPLICATE_USE_INSTANTIATION]). */ + DUPLICATE_SCRIPTS = 4, + + /** Duplicate using [method PackedScene.instantiate]. If the node comes from a scene saved on disk, reuses [method PackedScene.instantiate] as the base for the duplicated node and its children. */ + DUPLICATE_USE_INSTANTIATION = 8, + } + enum InternalMode { + /** The node will not be internal. */ + INTERNAL_MODE_DISABLED = 0, + + /** The node will be placed at the beginning of the parent's children, before any non-internal sibling. */ + INTERNAL_MODE_FRONT = 1, + + /** The node will be placed at the end of the parent's children, after any non-internal sibling. */ + INTERNAL_MODE_BACK = 2, + } + enum AutoTranslateMode { + /** Inherits [member auto_translate_mode] from the node's parent. This is the default for any newly created node. */ + AUTO_TRANSLATE_MODE_INHERIT = 0, + + /** Always automatically translate. This is the inverse of [constant AUTO_TRANSLATE_MODE_DISABLED], and the default for the root node. */ + AUTO_TRANSLATE_MODE_ALWAYS = 1, + + /** Never automatically translate. This is the inverse of [constant AUTO_TRANSLATE_MODE_ALWAYS]. + * String parsing for POT generation will be skipped for this node and children that are set to [constant AUTO_TRANSLATE_MODE_INHERIT]. + */ + AUTO_TRANSLATE_MODE_DISABLED = 2, + } + } + /** Base class for all scene objects. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_node.html + */ + class Node = {}> extends Object { + // TypeScript's inference won't directly match against a generic parameter. The generic parameter has to + // appear somewhere in the type definition. Consequently, we insert a dummy direct usage of the parameter. + private __doesnotexist_NodeMap: Map + /** Notification received when the node enters a [SceneTree]. See [method _enter_tree]. + * This notification is received *before* the related [signal tree_entered] signal. + */ + static readonly NOTIFICATION_ENTER_TREE = 10 + + /** Notification received when the node is about to exit a [SceneTree]. See [method _exit_tree]. + * This notification is received *after* the related [signal tree_exiting] signal. + */ + static readonly NOTIFICATION_EXIT_TREE = 11 + static readonly NOTIFICATION_MOVED_IN_PARENT = 12 + + /** Notification received when the node is ready. See [method _ready]. */ + static readonly NOTIFICATION_READY = 13 + + /** Notification received when the node is paused. See [member process_mode]. */ + static readonly NOTIFICATION_PAUSED = 14 + + /** Notification received when the node is unpaused. See [member process_mode]. */ + static readonly NOTIFICATION_UNPAUSED = 15 + + /** Notification received from the tree every physics frame when [method is_physics_processing] returns `true`. See [method _physics_process]. */ + static readonly NOTIFICATION_PHYSICS_PROCESS = 16 + + /** Notification received from the tree every rendered frame when [method is_processing] returns `true`. See [method _process]. */ + static readonly NOTIFICATION_PROCESS = 17 + + /** Notification received when the node is set as a child of another node (see [method add_child] and [method add_sibling]). + * + * **Note:** This does *not* mean that the node entered the [SceneTree]. + */ + static readonly NOTIFICATION_PARENTED = 18 + + /** Notification received when the parent node calls [method remove_child] on this node. + * + * **Note:** This does *not* mean that the node exited the [SceneTree]. + */ + static readonly NOTIFICATION_UNPARENTED = 19 + + /** Notification received *only* by the newly instantiated scene root node, when [method PackedScene.instantiate] is completed. */ + static readonly NOTIFICATION_SCENE_INSTANTIATED = 20 + + /** Notification received when a drag operation begins. All nodes receive this notification, not only the dragged one. + * Can be triggered either by dragging a [Control] that provides drag data (see [method Control._get_drag_data]) or using [method Control.force_drag]. + * Use [method Viewport.gui_get_drag_data] to get the dragged data. + */ + static readonly NOTIFICATION_DRAG_BEGIN = 21 + + /** Notification received when a drag operation ends. + * Use [method Viewport.gui_is_drag_successful] to check if the drag succeeded. + */ + static readonly NOTIFICATION_DRAG_END = 22 + + /** Notification received when the node's [member name] or one of its ancestors' [member name] is changed. This notification is *not* received when the node is removed from the [SceneTree]. */ + static readonly NOTIFICATION_PATH_RENAMED = 23 + + /** Notification received when the list of children is changed. This happens when child nodes are added, moved or removed. */ + static readonly NOTIFICATION_CHILD_ORDER_CHANGED = 24 + + /** Notification received from the tree every rendered frame when [method is_processing_internal] returns `true`. */ + static readonly NOTIFICATION_INTERNAL_PROCESS = 25 + + /** Notification received from the tree every physics frame when [method is_physics_processing_internal] returns `true`. */ + static readonly NOTIFICATION_INTERNAL_PHYSICS_PROCESS = 26 + + /** Notification received when the node enters the tree, just before [constant NOTIFICATION_READY] may be received. Unlike the latter, it is sent every time the node enters tree, not just once. */ + static readonly NOTIFICATION_POST_ENTER_TREE = 27 + + /** Notification received when the node is disabled. See [constant PROCESS_MODE_DISABLED]. */ + static readonly NOTIFICATION_DISABLED = 28 + + /** Notification received when the node is enabled again after being disabled. See [constant PROCESS_MODE_DISABLED]. */ + static readonly NOTIFICATION_ENABLED = 29 + + /** Notification received when [method reset_physics_interpolation] is called on the node or its ancestors. */ + static readonly NOTIFICATION_RESET_PHYSICS_INTERPOLATION = 2001 + + /** Notification received right before the scene with the node is saved in the editor. This notification is only sent in the Godot editor and will not occur in exported projects. */ + static readonly NOTIFICATION_EDITOR_PRE_SAVE = 9001 + + /** Notification received right after the scene with the node is saved in the editor. This notification is only sent in the Godot editor and will not occur in exported projects. */ + static readonly NOTIFICATION_EDITOR_POST_SAVE = 9002 + + /** Notification received when the mouse enters the window. + * Implemented for embedded windows and on desktop and web platforms. + */ + static readonly NOTIFICATION_WM_MOUSE_ENTER = 1002 + + /** Notification received when the mouse leaves the window. + * Implemented for embedded windows and on desktop and web platforms. + */ + static readonly NOTIFICATION_WM_MOUSE_EXIT = 1003 + + /** Notification received from the OS when the node's [Window] ancestor is focused. This may be a change of focus between two windows of the same engine instance, or from the OS desktop or a third-party application to a window of the game (in which case [constant NOTIFICATION_APPLICATION_FOCUS_IN] is also received). + * A [Window] node receives this notification when it is focused. + */ + static readonly NOTIFICATION_WM_WINDOW_FOCUS_IN = 1004 + + /** Notification received from the OS when the node's [Window] ancestor is defocused. This may be a change of focus between two windows of the same engine instance, or from a window of the game to the OS desktop or a third-party application (in which case [constant NOTIFICATION_APPLICATION_FOCUS_OUT] is also received). + * A [Window] node receives this notification when it is defocused. + */ + static readonly NOTIFICATION_WM_WINDOW_FOCUS_OUT = 1005 + + /** Notification received from the OS when a close request is sent (e.g. closing the window with a "Close" button or [kbd]Alt + F4[/kbd]). + * Implemented on desktop platforms. + */ + static readonly NOTIFICATION_WM_CLOSE_REQUEST = 1006 + + /** Notification received from the OS when a go back request is sent (e.g. pressing the "Back" button on Android). + * Implemented only on Android. + */ + static readonly NOTIFICATION_WM_GO_BACK_REQUEST = 1007 + + /** Notification received when the window is resized. + * + * **Note:** Only the resized [Window] node receives this notification, and it's not propagated to the child nodes. + */ + static readonly NOTIFICATION_WM_SIZE_CHANGED = 1008 + + /** Notification received from the OS when the screen's dots per inch (DPI) scale is changed. Only implemented on macOS. */ + static readonly NOTIFICATION_WM_DPI_CHANGE = 1009 + + /** Notification received when the mouse cursor enters the [Viewport]'s visible area, that is not occluded behind other [Control]s or [Window]s, provided its [member Viewport.gui_disable_input] is `false` and regardless if it's currently focused or not. */ + static readonly NOTIFICATION_VP_MOUSE_ENTER = 1010 + + /** Notification received when the mouse cursor leaves the [Viewport]'s visible area, that is not occluded behind other [Control]s or [Window]s, provided its [member Viewport.gui_disable_input] is `false` and regardless if it's currently focused or not. */ + static readonly NOTIFICATION_VP_MOUSE_EXIT = 1011 + + /** Notification received when the window is moved. */ + static readonly NOTIFICATION_WM_POSITION_CHANGED = 1012 + + /** Notification received from the OS when the application is exceeding its allocated memory. + * Implemented only on iOS. + */ + static readonly NOTIFICATION_OS_MEMORY_WARNING = 2009 + + /** Notification received when translations may have changed. Can be triggered by the user changing the locale, changing [member auto_translate_mode] or when the node enters the scene tree. Can be used to respond to language changes, for example to change the UI strings on the fly. Useful when working with the built-in translation support, like [method Object.tr]. + * + * **Note:** This notification is received alongside [constant NOTIFICATION_ENTER_TREE], so if you are instantiating a scene, the child nodes will not be initialized yet. You can use it to setup translations for this node, child nodes created from script, or if you want to access child nodes added in the editor, make sure the node is ready using [method is_node_ready]. + * + */ + static readonly NOTIFICATION_TRANSLATION_CHANGED = 2010 + + /** Notification received from the OS when a request for "About" information is sent. + * Implemented only on macOS. + */ + static readonly NOTIFICATION_WM_ABOUT = 2011 + + /** Notification received from Godot's crash handler when the engine is about to crash. + * Implemented on desktop platforms, if the crash handler is enabled. + */ + static readonly NOTIFICATION_CRASH = 2012 + + /** Notification received from the OS when an update of the Input Method Engine occurs (e.g. change of IME cursor position or composition string). + * Implemented only on macOS. + */ + static readonly NOTIFICATION_OS_IME_UPDATE = 2013 + + /** Notification received from the OS when the application is resumed. + * Specific to the Android and iOS platforms. + */ + static readonly NOTIFICATION_APPLICATION_RESUMED = 2014 + + /** Notification received from the OS when the application is paused. + * Specific to the Android and iOS platforms. + * + * **Note:** On iOS, you only have approximately 5 seconds to finish a task started by this signal. If you go over this allotment, iOS will kill the app instead of pausing it. + */ + static readonly NOTIFICATION_APPLICATION_PAUSED = 2015 + + /** Notification received from the OS when the application is focused, i.e. when changing the focus from the OS desktop or a thirdparty application to any open window of the Godot instance. + * Implemented on desktop and mobile platforms. + */ + static readonly NOTIFICATION_APPLICATION_FOCUS_IN = 2016 + + /** Notification received from the OS when the application is defocused, i.e. when changing the focus from any open window of the Godot instance to the OS desktop or a thirdparty application. + * Implemented on desktop and mobile platforms. + */ + static readonly NOTIFICATION_APPLICATION_FOCUS_OUT = 2017 + + /** Notification received when the [TextServer] is changed. */ + static readonly NOTIFICATION_TEXT_SERVER_CHANGED = 2018 + constructor(identifier?: any) + + /** Called during the processing step of the main loop. Processing happens at every frame and as fast as possible, so the [param delta] time since the previous frame is not constant. [param delta] is in seconds. + * It is only called if processing is enabled, which is done automatically if this method is overridden, and can be toggled with [method set_process]. + * Processing happens in order of [member process_priority], lower priority values are called first. Nodes with the same priority are processed in tree order, or top to bottom as seen in the editor (also known as pre-order traversal). + * Corresponds to the [constant NOTIFICATION_PROCESS] notification in [method Object._notification]. + * + * **Note:** This method is only called if the node is present in the scene tree (i.e. if it's not an orphan). + * + * **Note:** [param delta] will be larger than expected if running at a framerate lower than [member Engine.physics_ticks_per_second] / [member Engine.max_physics_steps_per_frame] FPS. This is done to avoid "spiral of death" scenarios where performance would plummet due to an ever-increasing number of physics steps per frame. This behavior affects both [method _process] and [method _physics_process]. As a result, avoid using [param delta] for time measurements in real-world seconds. Use the [Time] singleton's methods for this purpose instead, such as [method Time.get_ticks_usec]. + */ + /* gdvirtual */ _process(delta: float64): void + + /** Called during the physics processing step of the main loop. Physics processing means that the frame rate is synced to the physics, i.e. the [param delta] parameter will *generally* be constant (see exceptions below). [param delta] is in seconds. + * It is only called if physics processing is enabled, which is done automatically if this method is overridden, and can be toggled with [method set_physics_process]. + * Processing happens in order of [member process_physics_priority], lower priority values are called first. Nodes with the same priority are processed in tree order, or top to bottom as seen in the editor (also known as pre-order traversal). + * Corresponds to the [constant NOTIFICATION_PHYSICS_PROCESS] notification in [method Object._notification]. + * + * **Note:** This method is only called if the node is present in the scene tree (i.e. if it's not an orphan). + * + * **Note:** [param delta] will be larger than expected if running at a framerate lower than [member Engine.physics_ticks_per_second] / [member Engine.max_physics_steps_per_frame] FPS. This is done to avoid "spiral of death" scenarios where performance would plummet due to an ever-increasing number of physics steps per frame. This behavior affects both [method _process] and [method _physics_process]. As a result, avoid using [param delta] for time measurements in real-world seconds. Use the [Time] singleton's methods for this purpose instead, such as [method Time.get_ticks_usec]. + */ + /* gdvirtual */ _physics_process(delta: float64): void + + /** Called when the node enters the [SceneTree] (e.g. upon instantiating, scene changing, or after calling [method add_child] in a script). If the node has children, its [method _enter_tree] callback will be called first, and then that of the children. + * Corresponds to the [constant NOTIFICATION_ENTER_TREE] notification in [method Object._notification]. + */ + /* gdvirtual */ _enter_tree(): void + + /** Called when the node is about to leave the [SceneTree] (e.g. upon freeing, scene changing, or after calling [method remove_child] in a script). If the node has children, its [method _exit_tree] callback will be called last, after all its children have left the tree. + * Corresponds to the [constant NOTIFICATION_EXIT_TREE] notification in [method Object._notification] and signal [signal tree_exiting]. To get notified when the node has already left the active tree, connect to the [signal tree_exited]. + */ + /* gdvirtual */ _exit_tree(): void + + /** Called when the node is "ready", i.e. when both the node and its children have entered the scene tree. If the node has children, their [method _ready] callbacks get triggered first, and the parent node will receive the ready notification afterwards. + * Corresponds to the [constant NOTIFICATION_READY] notification in [method Object._notification]. See also the `@onready` annotation for variables. + * Usually used for initialization. For even earlier initialization, [method Object._init] may be used. See also [method _enter_tree]. + * + * **Note:** This method may be called only once for each node. After removing a node from the scene tree and adding it again, [method _ready] will **not** be called a second time. This can be bypassed by requesting another call with [method request_ready], which may be called anywhere before adding the node again. + */ + /* gdvirtual */ _ready(): void + + /** The elements in the array returned from this method are displayed as warnings in the Scene dock if the script that overrides it is a `tool` script. + * Returning an empty array produces no warnings. + * Call [method update_configuration_warnings] when the warnings need to be updated for this node. + * + */ + /* gdvirtual */ _get_configuration_warnings(): PackedStringArray + + /** Called when there is an input event. The input event propagates up through the node tree until a node consumes it. + * It is only called if input processing is enabled, which is done automatically if this method is overridden, and can be toggled with [method set_process_input]. + * To consume the input event and stop it propagating further to other nodes, [method Viewport.set_input_as_handled] can be called. + * For gameplay input, [method _unhandled_input] and [method _unhandled_key_input] are usually a better fit as they allow the GUI to intercept the events first. + * + * **Note:** This method is only called if the node is present in the scene tree (i.e. if it's not an orphan). + */ + /* gdvirtual */ _input(event: InputEvent): void + + /** Called when an [InputEventKey], [InputEventShortcut], or [InputEventJoypadButton] hasn't been consumed by [method _input] or any GUI [Control] item. It is called before [method _unhandled_key_input] and [method _unhandled_input]. The input event propagates up through the node tree until a node consumes it. + * It is only called if shortcut processing is enabled, which is done automatically if this method is overridden, and can be toggled with [method set_process_shortcut_input]. + * To consume the input event and stop it propagating further to other nodes, [method Viewport.set_input_as_handled] can be called. + * This method can be used to handle shortcuts. For generic GUI events, use [method _input] instead. Gameplay events should usually be handled with either [method _unhandled_input] or [method _unhandled_key_input]. + * + * **Note:** This method is only called if the node is present in the scene tree (i.e. if it's not orphan). + */ + /* gdvirtual */ _shortcut_input(event: InputEvent): void + + /** Called when an [InputEvent] hasn't been consumed by [method _input] or any GUI [Control] item. It is called after [method _shortcut_input] and after [method _unhandled_key_input]. The input event propagates up through the node tree until a node consumes it. + * It is only called if unhandled input processing is enabled, which is done automatically if this method is overridden, and can be toggled with [method set_process_unhandled_input]. + * To consume the input event and stop it propagating further to other nodes, [method Viewport.set_input_as_handled] can be called. + * For gameplay input, this method is usually a better fit than [method _input], as GUI events need a higher priority. For keyboard shortcuts, consider using [method _shortcut_input] instead, as it is called before this method. Finally, to handle keyboard events, consider using [method _unhandled_key_input] for performance reasons. + * + * **Note:** This method is only called if the node is present in the scene tree (i.e. if it's not an orphan). + */ + /* gdvirtual */ _unhandled_input(event: InputEvent): void + + /** Called when an [InputEventKey] hasn't been consumed by [method _input] or any GUI [Control] item. It is called after [method _shortcut_input] but before [method _unhandled_input]. The input event propagates up through the node tree until a node consumes it. + * It is only called if unhandled key input processing is enabled, which is done automatically if this method is overridden, and can be toggled with [method set_process_unhandled_key_input]. + * To consume the input event and stop it propagating further to other nodes, [method Viewport.set_input_as_handled] can be called. + * This method can be used to handle Unicode character input with [kbd]Alt[/kbd], [kbd]Alt + Ctrl[/kbd], and [kbd]Alt + Shift[/kbd] modifiers, after shortcuts were handled. + * For gameplay input, this and [method _unhandled_input] are usually a better fit than [method _input], as GUI events should be handled first. This method also performs better than [method _unhandled_input], since unrelated events such as [InputEventMouseMotion] are automatically filtered. For shortcuts, consider using [method _shortcut_input] instead. + * + * **Note:** This method is only called if the node is present in the scene tree (i.e. if it's not an orphan). + */ + /* gdvirtual */ _unhandled_key_input(event: InputEvent): void + + /** Prints all orphan nodes (nodes outside the [SceneTree]). Useful for debugging. + * + * **Note:** This method only works in debug builds. Does nothing in a project exported in release mode. + */ + static print_orphan_nodes(): void + + /** Adds a [param sibling] node to this node's parent, and moves the added sibling right below this node. + * If [param force_readable_name] is `true`, improves the readability of the added [param sibling]. If not named, the [param sibling] is renamed to its type, and if it shares [member name] with a sibling, a number is suffixed more appropriately. This operation is very slow. As such, it is recommended leaving this to `false`, which assigns a dummy name featuring `@` in both situations. + * Use [method add_child] instead of this method if you don't need the child node to be added below a specific node in the list of children. + * + * **Note:** If this node is internal, the added sibling will be internal too (see [method add_child]'s `internal` parameter). + */ + add_sibling(sibling: Node, force_readable_name: boolean = false): void + set_name(name: string): void + get_name(): StringName + + /** Adds a child [param node]. Nodes can have any number of children, but every child must have a unique name. Child nodes are automatically deleted when the parent node is deleted, so an entire scene can be removed by deleting its topmost node. + * If [param force_readable_name] is `true`, improves the readability of the added [param node]. If not named, the [param node] is renamed to its type, and if it shares [member name] with a sibling, a number is suffixed more appropriately. This operation is very slow. As such, it is recommended leaving this to `false`, which assigns a dummy name featuring `@` in both situations. + * If [param internal] is different than [constant INTERNAL_MODE_DISABLED], the child will be added as internal node. These nodes are ignored by methods like [method get_children], unless their parameter `include_internal` is `true`. The intended usage is to hide the internal nodes from the user, so the user won't accidentally delete or modify them. Used by some GUI nodes, e.g. [ColorPicker]. See [enum InternalMode] for available modes. + * + * **Note:** If [param node] already has a parent, this method will fail. Use [method remove_child] first to remove [param node] from its current parent. For example: + * + * If you need the child node to be added below a specific node in the list of children, use [method add_sibling] instead of this method. + * + * **Note:** If you want a child to be persisted to a [PackedScene], you must set [member owner] in addition to calling [method add_child]. This is typically relevant for [url=https://docs.godotengine.org/en/4.4/tutorials/plugins/running_code_in_the_editor.html]tool scripts[/url] and [url=https://docs.godotengine.org/en/4.4/tutorials/plugins/editor/index.html]editor plugins[/url]. If [method add_child] is called without setting [member owner], the newly added [Node] will not be visible in the scene tree, though it will be visible in the 2D/3D view. + */ + add_child(node: Node, force_readable_name: boolean = false, internal: Node.InternalMode = 0): void + + /** Removes a child [param node]. The [param node], along with its children, are **not** deleted. To delete a node, see [method queue_free]. + * + * **Note:** When this node is inside the tree, this method sets the [member owner] of the removed [param node] (or its descendants) to `null`, if their [member owner] is no longer an ancestor (see [method is_ancestor_of]). + */ + remove_child(node: Node): void + + /** Changes the parent of this [Node] to the [param new_parent]. The node needs to already have a parent. The node's [member owner] is preserved if its owner is still reachable from the new location (i.e., the node is still a descendant of the new parent after the operation). + * If [param keep_global_transform] is `true`, the node's global transform will be preserved if supported. [Node2D], [Node3D] and [Control] support this argument (but [Control] keeps only position). + */ + reparent(new_parent: Node, keep_global_transform: boolean = true): void + + /** Returns the number of children of this node. + * If [param include_internal] is `false`, internal children are not counted (see [method add_child]'s `internal` parameter). + */ + get_child_count(include_internal: boolean = false): int64 + + /** Returns all children of this node inside an [Array]. + * If [param include_internal] is `false`, excludes internal children from the returned array (see [method add_child]'s `internal` parameter). + */ + get_children(include_internal: boolean = false): GArray + + /** Fetches a child node by its index. Each child node has an index relative its siblings (see [method get_index]). The first child is at index 0. Negative values can also be used to start from the end of the list. This method can be used in combination with [method get_child_count] to iterate over this node's children. If no child exists at the given index, this method returns `null` and an error is generated. + * If [param include_internal] is `false`, internal children are ignored (see [method add_child]'s `internal` parameter). + * + * + * **Note:** To fetch a node by [NodePath], use [method get_node]. + */ + get_child(idx: int64, include_internal: boolean = false): Node + + /** Returns `true` if the [param path] points to a valid node. See also [method get_node]. */ + has_node(path: NodePath | string): boolean + + /** Fetches a node. The [NodePath] can either be a relative path (from this node), or an absolute path (from the [member SceneTree.root]) to a node. If [param path] does not point to a valid node, generates an error and returns `null`. Attempts to access methods on the return value will result in an *"Attempt to call on a null instance."* error. + * + * **Note:** Fetching by absolute path only works when the node is inside the scene tree (see [method is_inside_tree]). + * **Example:** Assume this method is called from the Character node, inside the following tree: + * [codeblock lang=text] + * ┖╴root + * ┠╴Character (you are here!) + * ┃ ┠╴Sword + * ┃ ┖╴Backpack + * ┃ ┖╴Dagger + * ┠╴MyGame + * ┖╴Swamp + * ┠╴Alligator + * ┠╴Mosquito + * ┖╴Goblin + * [/codeblock] + * The following calls will return a valid node: + * + */ + get_node>(path: Path): ResolveNodePath + get_node(path: NodePath | string): Node + + /** Fetches a node by [NodePath]. Similar to [method get_node], but does not generate an error if [param path] does not point to a valid node. */ + get_node_or_null>(path: Path): null | ResolveNodePath + get_node_or_null(path: NodePath | string): null | Node + + /** Returns this node's parent node, or `null` if the node doesn't have a parent. */ + get_parent(): Node + + /** Finds the first descendant of this node whose [member name] matches [param pattern], returning `null` if no match is found. The matching is done against node names, *not* their paths, through [method String.match]. As such, it is case-sensitive, `"*"` matches zero or more characters, and `"?"` matches any single character. + * If [param recursive] is `false`, only this node's direct children are checked. Nodes are checked in tree order, so this node's first direct child is checked first, then its own direct children, etc., before moving to the second direct child, and so on. Internal children are also included in the search (see `internal` parameter in [method add_child]). + * If [param owned] is `true`, only descendants with a valid [member owner] node are checked. + * + * **Note:** This method can be very slow. Consider storing a reference to the found node in a variable. Alternatively, use [method get_node] with unique names (see [member unique_name_in_owner]). + * + * **Note:** To find all descendant nodes matching a pattern or a class type, see [method find_children]. + */ + find_child(pattern: string, recursive: boolean = true, owned: boolean = true): Node + + /** Finds all descendants of this node whose names match [param pattern], returning an empty [Array] if no match is found. The matching is done against node names, *not* their paths, through [method String.match]. As such, it is case-sensitive, `"*"` matches zero or more characters, and `"?"` matches any single character. + * If [param type] is not empty, only ancestors inheriting from [param type] are included (see [method Object.is_class]). + * If [param recursive] is `false`, only this node's direct children are checked. Nodes are checked in tree order, so this node's first direct child is checked first, then its own direct children, etc., before moving to the second direct child, and so on. Internal children are also included in the search (see `internal` parameter in [method add_child]). + * If [param owned] is `true`, only descendants with a valid [member owner] node are checked. + * + * **Note:** This method can be very slow. Consider storing references to the found nodes in a variable. + * + * **Note:** To find a single descendant node matching a pattern, see [method find_child]. + */ + find_children(pattern: string, type: string = '', recursive: boolean = true, owned: boolean = true): GArray + + /** Finds the first ancestor of this node whose [member name] matches [param pattern], returning `null` if no match is found. The matching is done through [method String.match]. As such, it is case-sensitive, `"*"` matches zero or more characters, and `"?"` matches any single character. See also [method find_child] and [method find_children]. + * + * **Note:** As this method walks upwards in the scene tree, it can be slow in large, deeply nested nodes. Consider storing a reference to the found node in a variable. Alternatively, use [method get_node] with unique names (see [member unique_name_in_owner]). + */ + find_parent(pattern: string): Node + + /** Returns `true` if [param path] points to a valid node and its subnames point to a valid [Resource], e.g. `Area2D/CollisionShape2D:shape`. Properties that are not [Resource] types (such as nodes or other [Variant] types) are not considered. See also [method get_node_and_resource]. */ + has_node_and_resource(path: NodePath | string): boolean + + /** Fetches a node and its most nested resource as specified by the [NodePath]'s subname. Returns an [Array] of size `3` where: + * - Element `0` is the [Node], or `null` if not found; + * - Element `1` is the subname's last nested [Resource], or `null` if not found; + * - Element `2` is the remaining [NodePath], referring to an existing, non-[Resource] property (see [method Object.get_indexed]). + * **Example:** Assume that the child's [member Sprite2D.texture] has been assigned a [AtlasTexture]: + * + */ + get_node_and_resource(path: NodePath | string): GArray + + /** Returns `true` if this node is currently inside a [SceneTree]. See also [method get_tree]. */ + is_inside_tree(): boolean + + /** Returns `true` if the node is part of the scene currently opened in the editor. */ + is_part_of_edited_scene(): boolean + + /** Returns `true` if the given [param node] is a direct or indirect child of this node. */ + is_ancestor_of(node: Node): boolean + + /** Returns `true` if the given [param node] occurs later in the scene hierarchy than this node. A node occurring later is usually processed last. */ + is_greater_than(node: Node): boolean + + /** Returns the node's absolute path, relative to the [member SceneTree.root]. If the node is not inside the scene tree, this method fails and returns an empty [NodePath]. */ + get_path(): NodePath + + /** Returns the relative [NodePath] from this node to the specified [param node]. Both nodes must be in the same [SceneTree] or scene hierarchy, otherwise this method fails and returns an empty [NodePath]. + * If [param use_unique_path] is `true`, returns the shortest path accounting for this node's unique name (see [member unique_name_in_owner]). + * + * **Note:** If you get a relative path which starts from a unique node, the path may be longer than a normal relative path, due to the addition of the unique node's name. + */ + get_path_to(node: Node, use_unique_path: boolean = false): NodePath + + /** Adds the node to the [param group]. Groups can be helpful to organize a subset of nodes, for example `"enemies"` or `"collectables"`. See notes in the description, and the group methods in [SceneTree]. + * If [param persistent] is `true`, the group will be stored when saved inside a [PackedScene]. All groups created and displayed in the Node dock are persistent. + * + * **Note:** To improve performance, the order of group names is *not* guaranteed and may vary between project runs. Therefore, do not rely on the group order. + * + * **Note:** [SceneTree]'s group methods will *not* work on this node if not inside the tree (see [method is_inside_tree]). + */ + add_to_group(group: StringName, persistent: boolean = false): void + + /** Removes the node from the given [param group]. Does nothing if the node is not in the [param group]. See also notes in the description, and the [SceneTree]'s group methods. */ + remove_from_group(group: StringName): void + + /** Returns `true` if this node has been added to the given [param group]. See [method add_to_group] and [method remove_from_group]. See also notes in the description, and the [SceneTree]'s group methods. */ + is_in_group(group: StringName): boolean + + /** Moves [param child_node] to the given index. A node's index is the order among its siblings. If [param to_index] is negative, the index is counted from the end of the list. See also [method get_child] and [method get_index]. + * + * **Note:** The processing order of several engine callbacks ([method _ready], [method _process], etc.) and notifications sent through [method propagate_notification] is affected by tree order. [CanvasItem] nodes are also rendered in tree order. See also [member process_priority]. + */ + move_child(child_node: Node, to_index: int64): void + + /** Returns an [Array] of group names that the node has been added to. + * + * **Note:** To improve performance, the order of group names is *not* guaranteed and may vary between project runs. Therefore, do not rely on the group order. + * + * **Note:** This method may also return some group names starting with an underscore (`_`). These are internally used by the engine. To avoid conflicts, do not use custom groups starting with underscores. To exclude internal groups, see the following code snippet: + * + */ + get_groups(): GArray + + /** Returns this node's order among its siblings. The first node's index is `0`. See also [method get_child]. + * If [param include_internal] is `false`, returns the index ignoring internal children. The first, non-internal child will have an index of `0` (see [method add_child]'s `internal` parameter). + */ + get_index(include_internal: boolean = false): int64 + + /** Prints the node and its children to the console, recursively. The node does not have to be inside the tree. This method outputs [NodePath]s relative to this node, and is good for copy/pasting into [method get_node]. See also [method print_tree_pretty]. + * May print, for example: + * [codeblock lang=text] + * . + * Menu + * Menu/Label + * Menu/Camera2D + * SplashScreen + * SplashScreen/Camera2D + * [/codeblock] + */ + print_tree(): void + + /** Prints the node and its children to the console, recursively. The node does not have to be inside the tree. Similar to [method print_tree], but the graphical representation looks like what is displayed in the editor's Scene dock. It is useful for inspecting larger trees. + * May print, for example: + * [codeblock lang=text] + * ┖╴TheGame + * ┠╴Menu + * ┃ ┠╴Label + * ┃ ┖╴Camera2D + * ┖╴SplashScreen + * ┖╴Camera2D + * [/codeblock] + */ + print_tree_pretty(): void + + /** Returns the tree as a [String]. Used mainly for debugging purposes. This version displays the path relative to the current node, and is good for copy/pasting into the [method get_node] function. It also can be used in game UI/UX. + * May print, for example: + * [codeblock lang=text] + * TheGame + * TheGame/Menu + * TheGame/Menu/Label + * TheGame/Menu/Camera2D + * TheGame/SplashScreen + * TheGame/SplashScreen/Camera2D + * [/codeblock] + */ + get_tree_string(): string + + /** Similar to [method get_tree_string], this returns the tree as a [String]. This version displays a more graphical representation similar to what is displayed in the Scene Dock. It is useful for inspecting larger trees. + * May print, for example: + * [codeblock lang=text] + * ┖╴TheGame + * ┠╴Menu + * ┃ ┠╴Label + * ┃ ┖╴Camera2D + * ┖╴SplashScreen + * ┖╴Camera2D + * [/codeblock] + */ + get_tree_string_pretty(): string + + /** Calls [method Object.notification] with [param what] on this node and all of its children, recursively. */ + propagate_notification(what: int64): void + + /** Calls the given [param method] name, passing [param args] as arguments, on this node and all of its children, recursively. + * If [param parent_first] is `true`, the method is called on this node first, then on all of its children. If `false`, the children's methods are called first. + */ + propagate_call(method: StringName, args: GArray = [], parent_first: boolean = false): void + + /** If set to `true`, enables physics (fixed framerate) processing. When a node is being processed, it will receive a [constant NOTIFICATION_PHYSICS_PROCESS] at a fixed (usually 60 FPS, see [member Engine.physics_ticks_per_second] to change) interval (and the [method _physics_process] callback will be called if it exists). + * + * **Note:** If [method _physics_process] is overridden, this will be automatically enabled before [method _ready] is called. + */ + set_physics_process(enable: boolean): void + + /** Returns the time elapsed (in seconds) since the last physics callback. This value is identical to [method _physics_process]'s `delta` parameter, and is often consistent at run-time, unless [member Engine.physics_ticks_per_second] is changed. See also [constant NOTIFICATION_PHYSICS_PROCESS]. + * + * **Note:** The returned value will be larger than expected if running at a framerate lower than [member Engine.physics_ticks_per_second] / [member Engine.max_physics_steps_per_frame] FPS. This is done to avoid "spiral of death" scenarios where performance would plummet due to an ever-increasing number of physics steps per frame. This behavior affects both [method _process] and [method _physics_process]. As a result, avoid using `delta` for time measurements in real-world seconds. Use the [Time] singleton's methods for this purpose instead, such as [method Time.get_ticks_usec]. + */ + get_physics_process_delta_time(): float64 + + /** Returns `true` if physics processing is enabled (see [method set_physics_process]). */ + is_physics_processing(): boolean + + /** Returns the time elapsed (in seconds) since the last process callback. This value is identical to [method _process]'s `delta` parameter, and may vary from frame to frame. See also [constant NOTIFICATION_PROCESS]. + * + * **Note:** The returned value will be larger than expected if running at a framerate lower than [member Engine.physics_ticks_per_second] / [member Engine.max_physics_steps_per_frame] FPS. This is done to avoid "spiral of death" scenarios where performance would plummet due to an ever-increasing number of physics steps per frame. This behavior affects both [method _process] and [method _physics_process]. As a result, avoid using `delta` for time measurements in real-world seconds. Use the [Time] singleton's methods for this purpose instead, such as [method Time.get_ticks_usec]. + */ + get_process_delta_time(): float64 + + /** If set to `true`, enables processing. When a node is being processed, it will receive a [constant NOTIFICATION_PROCESS] on every drawn frame (and the [method _process] callback will be called if it exists). + * + * **Note:** If [method _process] is overridden, this will be automatically enabled before [method _ready] is called. + * + * **Note:** This method only affects the [method _process] callback, i.e. it has no effect on other callbacks like [method _physics_process]. If you want to disable all processing for the node, set [member process_mode] to [constant PROCESS_MODE_DISABLED]. + */ + set_process(enable: boolean): void + + /** Returns `true` if processing is enabled (see [method set_process]). */ + is_processing(): boolean + + /** If set to `true`, enables input processing. + * + * **Note:** If [method _input] is overridden, this will be automatically enabled before [method _ready] is called. Input processing is also already enabled for GUI controls, such as [Button] and [TextEdit]. + */ + set_process_input(enable: boolean): void + + /** Returns `true` if the node is processing input (see [method set_process_input]). */ + is_processing_input(): boolean + + /** If set to `true`, enables shortcut processing for this node. + * + * **Note:** If [method _shortcut_input] is overridden, this will be automatically enabled before [method _ready] is called. + */ + set_process_shortcut_input(enable: boolean): void + + /** Returns `true` if the node is processing shortcuts (see [method set_process_shortcut_input]). */ + is_processing_shortcut_input(): boolean + + /** If set to `true`, enables unhandled input processing. It enables the node to receive all input that was not previously handled (usually by a [Control]). + * + * **Note:** If [method _unhandled_input] is overridden, this will be automatically enabled before [method _ready] is called. Unhandled input processing is also already enabled for GUI controls, such as [Button] and [TextEdit]. + */ + set_process_unhandled_input(enable: boolean): void + + /** Returns `true` if the node is processing unhandled input (see [method set_process_unhandled_input]). */ + is_processing_unhandled_input(): boolean + + /** If set to `true`, enables unhandled key input processing. + * + * **Note:** If [method _unhandled_key_input] is overridden, this will be automatically enabled before [method _ready] is called. + */ + set_process_unhandled_key_input(enable: boolean): void + + /** Returns `true` if the node is processing unhandled key input (see [method set_process_unhandled_key_input]). */ + is_processing_unhandled_key_input(): boolean + + /** Returns `true` if the node can receive processing notifications and input callbacks ([constant NOTIFICATION_PROCESS], [method _input], etc.) from the [SceneTree] and [Viewport]. The returned value depends on [member process_mode]: + * - If set to [constant PROCESS_MODE_PAUSABLE], returns `true` when the game is processing, i.e. [member SceneTree.paused] is `false`; + * - If set to [constant PROCESS_MODE_WHEN_PAUSED], returns `true` when the game is paused, i.e. [member SceneTree.paused] is `true`; + * - If set to [constant PROCESS_MODE_ALWAYS], always returns `true`; + * - If set to [constant PROCESS_MODE_DISABLED], always returns `false`; + * - If set to [constant PROCESS_MODE_INHERIT], use the parent node's [member process_mode] to determine the result. + * If the node is not inside the tree, returns `false` no matter the value of [member process_mode]. + */ + can_process(): boolean + + /** If set to `true`, the node appears folded in the Scene dock. As a result, all of its children are hidden. This method is intended to be used in editor plugins and tools, but it also works in release builds. See also [method is_displayed_folded]. */ + set_display_folded(fold: boolean): void + + /** Returns `true` if the node is folded (collapsed) in the Scene dock. This method is intended to be used in editor plugins and tools. See also [method set_display_folded]. */ + is_displayed_folded(): boolean + + /** If set to `true`, enables internal processing for this node. Internal processing happens in isolation from the normal [method _process] calls and is used by some nodes internally to guarantee proper functioning even if the node is paused or processing is disabled for scripting ([method set_process]). + * **Warning:** Built-in nodes rely on internal processing for their internal logic. Disabling it is unsafe and may lead to unexpected behavior. Use this method if you know what you are doing. + */ + set_process_internal(enable: boolean): void + + /** Returns `true` if internal processing is enabled (see [method set_process_internal]). */ + is_processing_internal(): boolean + + /** If set to `true`, enables internal physics for this node. Internal physics processing happens in isolation from the normal [method _physics_process] calls and is used by some nodes internally to guarantee proper functioning even if the node is paused or physics processing is disabled for scripting ([method set_physics_process]). + * **Warning:** Built-in nodes rely on internal processing for their internal logic. Disabling it is unsafe and may lead to unexpected behavior. Use this method if you know what you are doing. + */ + set_physics_process_internal(enable: boolean): void + + /** Returns `true` if internal physics processing is enabled (see [method set_physics_process_internal]). */ + is_physics_processing_internal(): boolean + + /** Returns `true` if physics interpolation is enabled for this node (see [member physics_interpolation_mode]). + * + * **Note:** Interpolation will only be active if both the flag is set **and** physics interpolation is enabled within the [SceneTree]. This can be tested using [method is_physics_interpolated_and_enabled]. + */ + is_physics_interpolated(): boolean + + /** Returns `true` if physics interpolation is enabled (see [member physics_interpolation_mode]) **and** enabled in the [SceneTree]. + * This is a convenience version of [method is_physics_interpolated] that also checks whether physics interpolation is enabled globally. + * See [member SceneTree.physics_interpolation] and [member ProjectSettings.physics/common/physics_interpolation]. + */ + is_physics_interpolated_and_enabled(): boolean + + /** When physics interpolation is active, moving a node to a radically different transform (such as placement within a level) can result in a visible glitch as the object is rendered moving from the old to new position over the physics tick. + * That glitch can be prevented by calling this method, which temporarily disables interpolation until the physics tick is complete. + * The notification [constant NOTIFICATION_RESET_PHYSICS_INTERPOLATION] will be received by the node and all children recursively. + * + * **Note:** This function should be called **after** moving the node, rather than before. + */ + reset_physics_interpolation(): void + + /** Makes this node inherit the translation domain from its parent node. If this node has no parent, the main translation domain will be used. + * This is the default behavior for all nodes. Calling [method Object.set_translation_domain] disables this behavior. + */ + set_translation_domain_inherited(): void + + /** Returns the [Window] that contains this node. If the node is in the main window, this is equivalent to getting the root node (`get_tree().get_root()`). */ + get_window(): Window + + /** Returns the [Window] that contains this node, or the last exclusive child in a chain of windows starting with the one that contains this node. */ + get_last_exclusive_window(): Window + + /** Returns the [SceneTree] that contains this node. If this node is not inside the tree, generates an error and returns `null`. See also [method is_inside_tree]. */ + get_tree(): SceneTree + + /** Creates a new [Tween] and binds it to this node. + * This is the equivalent of doing: + * + * The Tween will start automatically on the next process frame or physics frame (depending on [enum Tween.TweenProcessMode]). See [method Tween.bind_node] for more info on Tweens bound to nodes. + * + * **Note:** The method can still be used when the node is not inside [SceneTree]. It can fail in an unlikely case of using a custom [MainLoop]. + */ + create_tween(): Tween + + /** Duplicates the node, returning a new node with all of its properties, signals, groups, and children copied from the original. The behavior can be tweaked through the [param flags] (see [enum DuplicateFlags]). + * + * **Note:** For nodes with a [Script] attached, if [method Object._init] has been defined with required parameters, the duplicated node will not have a [Script]. + */ + duplicate(flags: int64 = 15): Node + + /** Replaces this node by the given [param node]. All children of this node are moved to [param node]. + * If [param keep_groups] is `true`, the [param node] is added to the same groups that the replaced node is in (see [method add_to_group]). + * **Warning:** The replaced node is removed from the tree, but it is **not** deleted. To prevent memory leaks, store a reference to the node in a variable, or use [method Object.free]. + */ + replace_by(node: Node, keep_groups: boolean = false): void + + /** If set to `true`, the node becomes a [InstancePlaceholder] when packed and instantiated from a [PackedScene]. See also [method get_scene_instance_load_placeholder]. */ + set_scene_instance_load_placeholder(load_placeholder: boolean): void + + /** Returns `true` if this node is an instance load placeholder. See [InstancePlaceholder] and [method set_scene_instance_load_placeholder]. */ + get_scene_instance_load_placeholder(): boolean + + /** Set to `true` to allow all nodes owned by [param node] to be available, and editable, in the Scene dock, even if their [member owner] is not the scene root. This method is intended to be used in editor plugins and tools, but it also works in release builds. See also [method is_editable_instance]. */ + set_editable_instance(node: Node, is_editable: boolean): void + + /** Returns `true` if [param node] has editable children enabled relative to this node. This method is intended to be used in editor plugins and tools. See also [method set_editable_instance]. */ + is_editable_instance(node: Node): boolean + + /** Returns the node's closest [Viewport] ancestor, if the node is inside the tree. Otherwise, returns `null`. */ + get_viewport(): Viewport + + /** Queues this node to be deleted at the end of the current frame. When deleted, all of its children are deleted as well, and all references to the node and its children become invalid. + * Unlike with [method Object.free], the node is not deleted instantly, and it can still be accessed before deletion. It is also safe to call [method queue_free] multiple times. Use [method Object.is_queued_for_deletion] to check if the node will be deleted at the end of the frame. + * + * **Note:** The node will only be freed after all other deferred calls are finished. Using this method is not always the same as calling [method Object.free] through [method Object.call_deferred]. + */ + queue_free(): void + + /** Requests [method _ready] to be called again the next time the node enters the tree. Does **not** immediately call [method _ready]. + * + * **Note:** This method only affects the current node. If the node's children also need to request ready, this method needs to be called for each one of them. When the node and its children enter the tree again, the order of [method _ready] callbacks will be the same as normal. + */ + request_ready(): void + + /** Returns `true` if the node is ready, i.e. it's inside scene tree and all its children are initialized. + * [method request_ready] resets it back to `false`. + */ + is_node_ready(): boolean + + /** Sets the node's multiplayer authority to the peer with the given peer [param id]. The multiplayer authority is the peer that has authority over the node on the network. Defaults to peer ID 1 (the server). Useful in conjunction with [method rpc_config] and the [MultiplayerAPI]. + * If [param recursive] is `true`, the given peer is recursively set as the authority for all children of this node. + * **Warning:** This does **not** automatically replicate the new authority to other peers. It is the developer's responsibility to do so. You may replicate the new authority's information using [member MultiplayerSpawner.spawn_function], an RPC, or a [MultiplayerSynchronizer]. Furthermore, the parent's authority does **not** propagate to newly added children. + */ + set_multiplayer_authority(id: int64, recursive: boolean = true): void + + /** Returns the peer ID of the multiplayer authority for this node. See [method set_multiplayer_authority]. */ + get_multiplayer_authority(): int64 + + /** Returns `true` if the local system is the multiplayer authority of this node. */ + is_multiplayer_authority(): boolean + + /** Changes the RPC configuration for the given [param method]. [param config] should either be `null` to disable the feature (as by default), or a [Dictionary] containing the following entries: + * - `rpc_mode`: see [enum MultiplayerAPI.RPCMode]; + * - `transfer_mode`: see [enum MultiplayerPeer.TransferMode]; + * - `call_local`: if `true`, the method will also be called locally; + * - `channel`: an [int] representing the channel to send the RPC on. + * + * **Note:** In GDScript, this method corresponds to the [annotation @GDScript.@rpc] annotation, with various parameters passed (`@rpc(any)`, `@rpc(authority)`...). See also the [url=https://docs.godotengine.org/en/4.4/tutorials/networking/high_level_multiplayer.html]high-level multiplayer[/url] tutorial. + */ + rpc_config(method: StringName, config: any): void + + /** Returns a [Dictionary] mapping method names to their RPC configuration defined for this node using [method rpc_config]. */ + get_rpc_config(): any + + /** Translates a [param message], using the translation catalogs configured in the Project Settings. Further [param context] can be specified to help with the translation. Note that most [Control] nodes automatically translate their strings, so this method is mostly useful for formatted strings or custom drawn text. + * This method works the same as [method Object.tr], with the addition of respecting the [member auto_translate_mode] state. + * If [method Object.can_translate_messages] is `false`, or no translation is available, this method returns the [param message] without changes. See [method Object.set_message_translation]. + * For detailed examples, see [url=https://docs.godotengine.org/en/4.4/tutorials/i18n/internationalizing_games.html]Internationalizing games[/url]. + */ + atr(message: string, context: StringName = ''): string + + /** Translates a [param message] or [param plural_message], using the translation catalogs configured in the Project Settings. Further [param context] can be specified to help with the translation. + * This method works the same as [method Object.tr_n], with the addition of respecting the [member auto_translate_mode] state. + * If [method Object.can_translate_messages] is `false`, or no translation is available, this method returns [param message] or [param plural_message], without changes. See [method Object.set_message_translation]. + * The [param n] is the number, or amount, of the message's subject. It is used by the translation system to fetch the correct plural form for the current language. + * For detailed examples, see [url=https://docs.godotengine.org/en/4.4/tutorials/i18n/localization_using_gettext.html]Localization using gettext[/url]. + * + * **Note:** Negative and [float] numbers may not properly apply to some countable subjects. It's recommended to handle these cases with [method atr]. + */ + atr_n(message: string, plural_message: StringName, n: int64, context: StringName = ''): string + _set_property_pinned(property: string, pinned: boolean): void + + /** Sends a remote procedure call request for the given [param method] to peers on the network (and locally), sending additional arguments to the method called by the RPC. The call request will only be received by nodes with the same [NodePath], including the exact same [member name]. Behavior depends on the RPC configuration for the given [param method] (see [method rpc_config] and [annotation @GDScript.@rpc]). By default, methods are not exposed to RPCs. + * May return [constant OK] if the call is successful, [constant ERR_INVALID_PARAMETER] if the arguments passed in the [param method] do not match, [constant ERR_UNCONFIGURED] if the node's [member multiplayer] cannot be fetched (such as when the node is not inside the tree), [constant ERR_CONNECTION_ERROR] if [member multiplayer]'s connection is not available. + * + * **Note:** You can only safely use RPCs on clients after you received the [signal MultiplayerAPI.connected_to_server] signal from the [MultiplayerAPI]. You also need to keep track of the connection state, either by the [MultiplayerAPI] signals like [signal MultiplayerAPI.server_disconnected] or by checking (`get_multiplayer().peer.get_connection_status() == CONNECTION_CONNECTED`). + */ + rpc(method: StringName, ...vargargs: any[]): GError + + /** Sends a [method rpc] to a specific peer identified by [param peer_id] (see [method MultiplayerPeer.set_target_peer]). + * May return [constant OK] if the call is successful, [constant ERR_INVALID_PARAMETER] if the arguments passed in the [param method] do not match, [constant ERR_UNCONFIGURED] if the node's [member multiplayer] cannot be fetched (such as when the node is not inside the tree), [constant ERR_CONNECTION_ERROR] if [member multiplayer]'s connection is not available. + */ + rpc_id(peer_id: int64, method: StringName, ...vargargs: any[]): GError + + /** Refreshes the warnings displayed for this node in the Scene dock. Use [method _get_configuration_warnings] to customize the warning messages to display. */ + update_configuration_warnings(): void + + /** This function is similar to [method Object.call_deferred] except that the call will take place when the node thread group is processed. If the node thread group processes in sub-threads, then the call will be done on that thread, right before [constant NOTIFICATION_PROCESS] or [constant NOTIFICATION_PHYSICS_PROCESS], the [method _process] or [method _physics_process] or their internal versions are called. */ + call_deferred_thread_group(method: StringName, ...vargargs: any[]): any + + /** Similar to [method call_deferred_thread_group], but for setting properties. */ + set_deferred_thread_group(property: StringName, value: any): void + + /** Similar to [method call_deferred_thread_group], but for notifications. */ + notify_deferred_thread_group(what: int64): void + + /** This function ensures that the calling of this function will succeed, no matter whether it's being done from a thread or not. If called from a thread that is not allowed to call the function, the call will become deferred. Otherwise, the call will go through directly. */ + call_thread_safe(method: StringName, ...vargargs: any[]): any + + /** Similar to [method call_thread_safe], but for setting properties. */ + set_thread_safe(property: StringName, value: any): void + + /** Similar to [method call_thread_safe], but for notifications. */ + notify_thread_safe(what: int64): void + get _import_path(): NodePath + set _import_path(value: NodePath | string) + + /** If `true`, the node can be accessed from any node sharing the same [member owner] or from the [member owner] itself, with special `%Name` syntax in [method get_node]. + * + * **Note:** If another node with the same [member owner] shares the same [member name] as this node, the other node will no longer be accessible as unique. + */ + get unique_name_in_owner(): boolean + set unique_name_in_owner(value: boolean) + + /** The original scene's file path, if the node has been instantiated from a [PackedScene] file. Only scene root nodes contains this. */ + get scene_file_path(): string + set scene_file_path(value: string) + + /** The owner of this node. The owner must be an ancestor of this node. When packing the owner node in a [PackedScene], all the nodes it owns are also saved with it. See also [member unique_name_in_owner]. + * + * **Note:** In the editor, nodes not owned by the scene root are usually not displayed in the Scene dock, and will **not** be saved. To prevent this, remember to set the owner after calling [method add_child]. + */ + get owner(): Node + set owner(value: Node) + + /** The [MultiplayerAPI] instance associated with this node. See [method SceneTree.get_multiplayer]. + * + * **Note:** Renaming the node, or moving it in the tree, will not move the [MultiplayerAPI] to the new path, you will have to update this manually. + */ + get multiplayer(): MultiplayerAPI + + /** The node's processing behavior (see [enum ProcessMode]). To check if the node can process in its current mode, use [method can_process]. */ + get process_mode(): int64 + set process_mode(value: int64) + + /** The node's execution order of the process callbacks ([method _process], [constant NOTIFICATION_PROCESS], and [constant NOTIFICATION_INTERNAL_PROCESS]). Nodes whose priority value is *lower* call their process callbacks first, regardless of tree order. */ + get process_priority(): int64 + set process_priority(value: int64) + + /** Similar to [member process_priority] but for [constant NOTIFICATION_PHYSICS_PROCESS], [method _physics_process], or [constant NOTIFICATION_INTERNAL_PHYSICS_PROCESS]. */ + get process_physics_priority(): int64 + set process_physics_priority(value: int64) + + /** Set the process thread group for this node (basically, whether it receives [constant NOTIFICATION_PROCESS], [constant NOTIFICATION_PHYSICS_PROCESS], [method _process] or [method _physics_process] (and the internal versions) on the main thread or in a sub-thread. + * By default, the thread group is [constant PROCESS_THREAD_GROUP_INHERIT], which means that this node belongs to the same thread group as the parent node. The thread groups means that nodes in a specific thread group will process together, separate to other thread groups (depending on [member process_thread_group_order]). If the value is set is [constant PROCESS_THREAD_GROUP_SUB_THREAD], this thread group will occur on a sub thread (not the main thread), otherwise if set to [constant PROCESS_THREAD_GROUP_MAIN_THREAD] it will process on the main thread. If there is not a parent or grandparent node set to something other than inherit, the node will belong to the *default thread group* . This default group will process on the main thread and its group order is 0. + * During processing in a sub-thread, accessing most functions in nodes outside the thread group is forbidden (and it will result in an error in debug mode). Use [method Object.call_deferred], [method call_thread_safe], [method call_deferred_thread_group] and the likes in order to communicate from the thread groups to the main thread (or to other thread groups). + * To better understand process thread groups, the idea is that any node set to any other value than [constant PROCESS_THREAD_GROUP_INHERIT] will include any child (and grandchild) nodes set to inherit into its process thread group. This means that the processing of all the nodes in the group will happen together, at the same time as the node including them. + */ + get process_thread_group(): int64 + set process_thread_group(value: int64) + + /** Change the process thread group order. Groups with a lesser order will process before groups with a greater order. This is useful when a large amount of nodes process in sub thread and, afterwards, another group wants to collect their result in the main thread, as an example. */ + get process_thread_group_order(): int64 + set process_thread_group_order(value: int64) + + /** Set whether the current thread group will process messages (calls to [method call_deferred_thread_group] on threads), and whether it wants to receive them during regular process or physics process callbacks. */ + get process_thread_messages(): int64 + set process_thread_messages(value: int64) + + /** Allows enabling or disabling physics interpolation per node, offering a finer grain of control than turning physics interpolation on and off globally. See [member ProjectSettings.physics/common/physics_interpolation] and [member SceneTree.physics_interpolation] for the global setting. + * + * **Note:** When teleporting a node to a distant position you should temporarily disable interpolation with [method Node.reset_physics_interpolation]. + */ + get physics_interpolation_mode(): int64 + set physics_interpolation_mode(value: int64) + + /** Defines if any text should automatically change to its translated version depending on the current locale (for nodes such as [Label], [RichTextLabel], [Window], etc.). Also decides if the node's strings should be parsed for POT generation. + * + * **Note:** For the root node, auto translate mode can also be set via [member ProjectSettings.internationalization/rendering/root_node_auto_translate]. + */ + get auto_translate_mode(): int64 + set auto_translate_mode(value: int64) + + /** An optional description to the node. It will be displayed as a tooltip when hovering over the node in the editor's Scene dock. */ + get editor_description(): string + set editor_description(value: string) + + /** Emitted when the node is considered ready, after [method _ready] is called. */ + readonly ready: Signal0 + + /** Emitted when the node's [member name] is changed, if the node is inside the tree. */ + readonly renamed: Signal0 + + /** Emitted when the node enters the tree. + * This signal is emitted *after* the related [constant NOTIFICATION_ENTER_TREE] notification. + */ + readonly tree_entered: Signal0 + + /** Emitted when the node is just about to exit the tree. The node is still valid. As such, this is the right place for de-initialization (or a "destructor", if you will). + * This signal is emitted *after* the node's [method _exit_tree], and *before* the related [constant NOTIFICATION_EXIT_TREE]. + */ + readonly tree_exiting: Signal0 + + /** Emitted after the node exits the tree and is no longer active. + * This signal is emitted *after* the related [constant NOTIFICATION_EXIT_TREE] notification. + */ + readonly tree_exited: Signal0 + + /** Emitted when the child [param node] enters the [SceneTree], usually because this node entered the tree (see [signal tree_entered]), or [method add_child] has been called. + * This signal is emitted *after* the child node's own [constant NOTIFICATION_ENTER_TREE] and [signal tree_entered]. + */ + readonly child_entered_tree: Signal1 + + /** Emitted when the child [param node] is about to exit the [SceneTree], usually because this node is exiting the tree (see [signal tree_exiting]), or because the child [param node] is being removed or freed. + * When this signal is received, the child [param node] is still accessible inside the tree. This signal is emitted *after* the child node's own [signal tree_exiting] and [constant NOTIFICATION_EXIT_TREE]. + */ + readonly child_exiting_tree: Signal1 + + /** Emitted when the list of children is changed. This happens when child nodes are added, moved or removed. */ + readonly child_order_changed: Signal0 + + /** Emitted when this node is being replaced by the [param node], see [method replace_by]. + * This signal is emitted *after* [param node] has been added as a child of the original parent node, but *before* all original child nodes have been reparented to [param node]. + */ + readonly replacing_by: Signal1 + + /** Emitted when the node's editor description field changed. */ + readonly editor_description_changed: Signal1 + + /** Emitted when an attribute of the node that is relevant to the editor is changed. Only emitted in the editor. */ + readonly editor_state_changed: Signal0 + } + /** A 2D game object, inherited by all 2D-related nodes. Has a position, rotation, scale, and skew. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_node2d.html + */ + class Node2D = Record> extends CanvasItem { constructor(identifier?: any) /** Applies a rotation to the node, in radians, starting from its current rotation. */ rotate(radians: float64): void @@ -44,60 +7062,62 @@ declare module "godot" { /** Returns the [Transform2D] relative to this node's parent. */ get_relative_transform_to_parent(parent: Node): Transform2D - /** Position, relative to the node's parent. */ + /** Position, relative to the node's parent. See also [member global_position]. */ get position(): Vector2 set position(value: Vector2) - /** Rotation in radians, relative to the node's parent. + /** Rotation in radians, relative to the node's parent. See also [member global_rotation]. * * **Note:** This property is edited in the inspector in degrees. If you want to use degrees in a script, use [member rotation_degrees]. */ get rotation(): float64 set rotation(value: float64) - /** Helper property to access [member rotation] in degrees instead of radians. */ + /** Helper property to access [member rotation] in degrees instead of radians. See also [member global_rotation_degrees]. */ get rotation_degrees(): float64 set rotation_degrees(value: float64) - /** The node's scale. Unscaled value: `(1, 1)`. + /** The node's scale, relative to the node's parent. Unscaled value: `(1, 1)`. See also [member global_scale]. * * **Note:** Negative X scales in 2D are not decomposable from the transformation matrix. Due to the way scale is represented with transformation matrices in Godot, negative scales on the X axis will be changed to negative scales on the Y axis and a rotation of 180 degrees when decomposed. */ get scale(): Vector2 set scale(value: Vector2) - /** Slants the node. + /** If set to a non-zero value, slants the node in one direction or another. This can be used for pseudo-3D effects. See also [member global_skew]. * - * **Note:** Skew is X axis only. + * **Note:** Skew is performed on the X axis only, and *between* rotation and scaling. + * + * **Note:** This property is edited in the inspector in degrees. If you want to use degrees in a script, use `skew = deg_to_rad(value_in_degrees)`. */ get skew(): float64 set skew(value: float64) - /** Local [Transform2D]. */ + /** The node's [Transform2D], relative to the node's parent. See also [member global_transform]. */ get transform(): Transform2D set transform(value: Transform2D) - /** Global position. */ + /** Global position. See also [member position]. */ get global_position(): Vector2 set global_position(value: Vector2) - /** Global rotation in radians. */ + /** Global rotation in radians. See also [member rotation]. */ get global_rotation(): float64 set global_rotation(value: float64) - /** Helper property to access [member global_rotation] in degrees instead of radians. */ + /** Helper property to access [member global_rotation] in degrees instead of radians. See also [member rotation_degrees]. */ get global_rotation_degrees(): float64 set global_rotation_degrees(value: float64) - /** Global scale. */ + /** Global scale. See also [member scale]. */ get global_scale(): Vector2 set global_scale(value: Vector2) - /** Global skew in radians. */ + /** Global skew in radians. See also [member skew]. */ get global_skew(): float64 set global_skew(value: float64) - /** Global [Transform2D]. */ + /** Global [Transform2D]. See also [member transform]. */ get global_transform(): Transform2D set global_transform(value: Transform2D) } @@ -115,9 +7135,9 @@ declare module "godot" { } /** Most basic 3D game object, parent of all 3D-related nodes. * - * @link https://docs.godotengine.org/en/4.3/classes/class_node3d.html + * @link https://docs.godotengine.org/en/4.4/classes/class_node3d.html */ - class Node3D extends Node { + class Node3D = Record> extends Node { /** [Node3D] nodes receive this notification when their global transform changes. This means that either the current or a parent node changed its transform. * In order for [constant NOTIFICATION_TRANSFORM_CHANGED] to work, users first need to ask for it, with [method set_notify_transform]. The notification is also sent if the node is in the editor context and it has at least one valid gizmo. */ @@ -138,6 +7158,13 @@ declare module "godot" { static readonly NOTIFICATION_LOCAL_TRANSFORM_CHANGED = 44 constructor(identifier?: any) + /** When using physics interpolation, there will be circumstances in which you want to know the interpolated (displayed) transform of a node rather than the standard transform (which may only be accurate to the most recent physics tick). + * This is particularly important for frame-based operations that take place in [method Node._process], rather than [method Node._physics_process]. Examples include [Camera3D]s focusing on a node, or finding where to fire lasers from on a frame rather than physics tick. + * + * **Note:** This function creates an interpolation pump on the [Node3D] the first time it is called, which can respond to physics interpolation resets. If you get problems with "streaking" when initially following a [Node3D], be sure to call [method get_global_transform_interpolated] at least once *before* resetting the [Node3D] physics interpolation. + */ + get_global_transform_interpolated(): Transform3D + /** Returns the parent [Node3D], or `null` if no parent exists, the parent is not of type [Node3D], or [member top_level] is `true`. * * **Note:** Calling this method is not equivalent to `get_parent() as Node3D`, which does not take [member top_level] into account. @@ -183,7 +7210,11 @@ declare module "godot" { /** Clears subgizmo selection for this node in the editor. Useful when subgizmo IDs become invalid after a property change. */ clear_subgizmo_selection(): void - /** Returns `true` if the node is present in the [SceneTree], its [member visible] property is `true` and all its ancestors are also visible. If any ancestor is hidden, this node will not be visible in the scene tree. */ + /** Returns `true` if the node is present in the [SceneTree], its [member visible] property is `true` and all its ancestors are also visible. If any ancestor is hidden, this node will not be visible in the scene tree. + * Visibility is checked only in parent nodes that inherit from [Node3D]. If the parent is of any other type (such as [Node], [AnimationPlayer], or [Node2D]), it is assumed to be visible. + * + * **Note:** This method does not take [member VisualInstance3D.layers] into account, so even if this method returns `true`, the node might end up not being rendered. + */ is_visible_in_tree(): boolean /** Enables rendering of this node. Changes [member visible] to `true`. */ @@ -247,7 +7278,8 @@ declare module "godot" { /** Rotates the node so that the local forward axis (-Z, [constant Vector3.FORWARD]) points toward the [param target] position. * The local up axis (+Y) points as close to the [param up] vector as possible while staying perpendicular to the local forward axis. The resulting transform is orthogonal, and the scale is preserved. Non-uniform scaling may not work correctly. - * The [param target] position cannot be the same as the node's position, the [param up] vector cannot be zero, and the direction from the node's position to the [param target] vector cannot be parallel to the [param up] vector. + * The [param target] position cannot be the same as the node's position, the [param up] vector cannot be zero. + * The [param target] and the [param up] cannot be [constant Vector3.ZERO], and shouldn't be colinear to avoid unintended rotation around local Z axis. * Operations take place in global space, which means that the node must be in the scene tree. * If [param use_model_front] is `true`, the +Z axis (asset front) is treated as forward (implies +X is left) and points toward the [param target] position. By default, the -Z axis (camera forward) is treated as forward (implies +X is right). */ @@ -346,7 +7378,7 @@ declare module "godot" { /** Emitted when node visibility changes. */ readonly visibility_changed: Signal0 } - class Node3DEditor extends VBoxContainer { + class Node3DEditor = Record> extends VBoxContainer { constructor(identifier?: any) _get_editor_data(_unnamed_arg0: Object): Object _request_gizmo(_unnamed_arg0: Object): void @@ -360,30 +7392,35 @@ declare module "godot" { readonly item_lock_status_changed: Signal0 readonly item_group_status_changed: Signal0 } - class Node3DEditorPlugin extends EditorPlugin { + class Node3DEditorPlugin = Record> extends EditorPlugin { constructor(identifier?: any) } - class Node3DEditorViewport extends Control { + class Node3DEditorSelectedItem extends Object { + constructor(identifier?: any) + } + class Node3DEditorViewport = Record> extends Control { constructor(identifier?: any) readonly toggle_maximize_view: Signal1 - readonly clicked: Signal1 + readonly clicked: Signal0 } - class Node3DEditorViewportContainer extends Container { + class Node3DEditorViewportContainer = Record> extends Container { constructor(identifier?: any) } /** Abstract class to expose editor gizmos for [Node3D]. * - * @link https://docs.godotengine.org/en/4.3/classes/class_node3dgizmo.html + * @link https://docs.godotengine.org/en/4.4/classes/class_node3dgizmo.html */ class Node3DGizmo extends RefCounted { constructor(identifier?: any) } - class NodeDock extends VBoxContainer { + class NodeDock = Record> extends VBoxContainer { constructor(identifier?: any) + _save_layout_to_config(_unnamed_arg0: ConfigFile, _unnamed_arg1: string): void + _load_layout_from_config(_unnamed_arg0: ConfigFile, _unnamed_arg1: string): void } /** Abstract base class for noise generators. * - * @link https://docs.godotengine.org/en/4.3/classes/class_noise.html + * @link https://docs.godotengine.org/en/4.4/classes/class_noise.html */ class Noise extends Resource { constructor(identifier?: any) @@ -429,12 +7466,12 @@ declare module "godot" { class NoiseEditorInspectorPlugin extends EditorInspectorPlugin { constructor(identifier?: any) } - class NoiseEditorPlugin extends EditorPlugin { + class NoiseEditorPlugin = Record> extends EditorPlugin { constructor(identifier?: any) } /** A 2D texture filled with noise generated by a [Noise] object. * - * @link https://docs.godotengine.org/en/4.3/classes/class_noisetexture2d.html + * @link https://docs.godotengine.org/en/4.4/classes/class_noisetexture2d.html */ class NoiseTexture2D extends Texture2D { constructor(identifier?: any) @@ -501,7 +7538,7 @@ declare module "godot" { } /** A 3D texture filled with noise generated by a [Noise] object. * - * @link https://docs.godotengine.org/en/4.3/classes/class_noisetexture3d.html + * @link https://docs.godotengine.org/en/4.4/classes/class_noisetexture3d.html */ class NoiseTexture3D extends Texture3D { constructor(identifier?: any) @@ -553,7 +7590,7 @@ declare module "godot" { } /** A PBR (Physically Based Rendering) material to be used on 3D objects. Uses an ORM texture. * - * @link https://docs.godotengine.org/en/4.3/classes/class_ormmaterial3d.html + * @link https://docs.godotengine.org/en/4.4/classes/class_ormmaterial3d.html */ class ORMMaterial3D extends BaseMaterial3D { constructor(identifier?: any) @@ -578,13 +7615,13 @@ declare module "godot" { } /** Base class for all other classes in the engine. * - * @link https://docs.godotengine.org/en/4.3/classes/class_object.html + * @link https://docs.godotengine.org/en/4.4/classes/class_object.html */ class Object { /** Notification received when the object is initialized, before its script is attached. Used internally. */ static readonly NOTIFICATION_POSTINITIALIZE = 0 - /** Notification received when the object is about to be deleted. Can act as the deconstructor of some programming languages. */ + /** Notification received when the object is about to be deleted. Can be used like destructors in object-oriented programming languages. */ static readonly NOTIFICATION_PREDELETE = 1 /** Notification received when the object finishes hot reloading. This notification is only sent for extensions classes and derived. */ @@ -594,6 +7631,17 @@ declare module "godot" { /** Deletes the object from memory. Pre-existing references to the object become invalid, and any attempt to access them will result in a run-time error. Checking the references with [method @GlobalScope.is_instance_valid] will return `false`. */ /* gdvirtual */ free(): void + /** Called when the object's script is instantiated, oftentimes after the object is initialized in memory (through `Object.new()` in GDScript, or `new GodotObject` in C#). It can be also defined to take in parameters. This method is similar to a constructor in most programming languages. + * + * **Note:** If [method _init] is defined with *required* parameters, the Object with script may only be created directly. If any other means (such as [method PackedScene.instantiate] or [method Node.duplicate]) are used, the script's initialization will fail. + */ + /* gdvirtual */ _init(): void + + /** Override this method to customize the return value of [method to_string], and therefore the object's representation as a [String]. + * + */ + /* gdvirtual */ _to_string(): string + /** Called when the object receives a notification, which can be identified in [param what] by comparing it with a constant. See also [method notification]. * * @@ -642,16 +7690,19 @@ declare module "godot" { */ /* gdvirtual */ _property_get_revert(property: StringName): any - /** Called when the object's script is instantiated, oftentimes after the object is initialized in memory (through `Object.new()` in GDScript, or `new GodotObject` in C#). It can be also defined to take in parameters. This method is similar to a constructor in most programming languages. - * - * **Note:** If [method _init] is defined with *required* parameters, the Object with script may only be created directly. If any other means (such as [method PackedScene.instantiate] or [method Node.duplicate]) are used, the script's initialization will fail. - */ - /* gdvirtual */ _init(): void - - /** Override this method to customize the return value of [method to_string], and therefore the object's representation as a [String]. + /** Initializes the iterator. [param iter] stores the iteration state. Since GDScript does not support passing arguments by reference, a single-element array is used as a wrapper. Returns `true` so long as the iterator has not reached the end. + * Example: * + * + * **Note:** Alternatively, you can ignore [param iter] and use the object's state instead, see [url=https://docs.godotengine.org/en/4.4/tutorials/scripting/gdscript/gdscript_advanced.html#custom-iterators]online docs[/url] for an example. Note that in this case you will not be able to reuse the same iterator instance in nested loops. Also, make sure you reset the iterator state in this method if you want to reuse the same instance multiple times. */ - /* gdvirtual */ _to_string(): string + /* gdvirtual */ _iter_init(iter: GArray): boolean + + /** Moves the iterator to the next iteration. [param iter] stores the iteration state. Since GDScript does not support passing arguments by reference, a single-element array is used as a wrapper. Returns `true` so long as the iterator has not reached the end. */ + /* gdvirtual */ _iter_next(iter: GArray): boolean + + /** Returns the current iterable value. [param iter] stores the iteration state, but unlike [method _iter_init] and [method _iter_next] the state is supposed to be read-only, so there is no [Array] wrapper. */ + /* gdvirtual */ _iter_get(iter: any): any /** Returns the object's built-in class name, as a [String]. See also [method is_class]. * @@ -789,10 +7840,10 @@ declare module "godot" { */ has_meta(name: StringName): boolean - /** Returns the object's metadata entry names as a [PackedStringArray]. */ + /** Returns the object's metadata entry names as an [Array] of [StringName]s. */ get_meta_list(): GArray - /** Adds a user-defined [param signal]. Optional arguments for the signal can be added as an [Array] of dictionaries, each defining a `name` [String] and a `type` [int] (see [enum Variant.Type]). See also [method has_user_signal] and [method remove_user_signal]. + /** Adds a user-defined signal named [param signal]. Optional arguments for the signal can be added as an [Array] of dictionaries, each defining a `name` [String] and a `type` [int] (see [enum Variant.Type]). See also [method has_user_signal] and [method remove_user_signal]. * */ add_user_signal(signal: string, arguments_: GArray = []): void @@ -818,7 +7869,7 @@ declare module "godot" { */ call(method: StringName, ...vargargs: any[]): any - /** Calls the [param method] on the object during idle time. Always returns null, **not** the method's result. + /** Calls the [param method] on the object during idle time. Always returns `null`, **not** the method's result. * Idle time happens mainly at the end of process and physics frames. In it, deferred calls will be run until there are none left, which means you can defer calls from other deferred calls and they'll still be run in the current idle time cycle. This means you should not call a method deferred from itself (or from a method called by it), as this causes infinite recursion the same way as if you had called the method directly. * This method supports a variable number of arguments, so parameters can be passed as a comma separated list. * @@ -859,7 +7910,7 @@ declare module "godot" { /** Returns `true` if the given [param signal] name exists in the object. * - * **Note:** In C#, [param signal] must be in snake_case when referring to built-in Godot methods. Prefer using the names exposed in the `SignalName` class to avoid allocating a new [StringName] on each call. + * **Note:** In C#, [param signal] must be in snake_case when referring to built-in Godot signals. Prefer using the names exposed in the `SignalName` class to avoid allocating a new [StringName] on each call. */ has_signal(signal: StringName): boolean @@ -905,10 +7956,16 @@ declare module "godot" { /** Returns `true` if a connection exists between the given [param signal] name and [param callable]. * - * **Note:** In C#, [param signal] must be in snake_case when referring to built-in Godot methods. Prefer using the names exposed in the `SignalName` class to avoid allocating a new [StringName] on each call. + * **Note:** In C#, [param signal] must be in snake_case when referring to built-in Godot signals. Prefer using the names exposed in the `SignalName` class to avoid allocating a new [StringName] on each call. */ is_connected(signal: StringName, callable: Callable): boolean + /** Returns `true` if any connection exists on the given [param signal] name. + * + * **Note:** In C#, [param signal] must be in snake_case when referring to built-in Godot methods. Prefer using the names exposed in the `SignalName` class to avoid allocating a new [StringName] on each call. + */ + has_connections(signal: StringName): boolean + /** If set to `true`, the object becomes unable to emit signals. As such, [method emit_signal] and signal connections will not work, until it is set to `false`. */ set_block_signals(enable: boolean): void @@ -926,7 +7983,7 @@ declare module "godot" { /** Translates a [param message], using the translation catalogs configured in the Project Settings. Further [param context] can be specified to help with the translation. Note that most [Control] nodes automatically translate their strings, so this method is mostly useful for formatted strings or custom drawn text. * If [method can_translate_messages] is `false`, or no translation is available, this method returns the [param message] without changes. See [method set_message_translation]. - * For detailed examples, see [url=https://docs.godotengine.org/en/4.3/tutorials/i18n/internationalizing_games.html]Internationalizing games[/url]. + * For detailed examples, see [url=https://docs.godotengine.org/en/4.4/tutorials/i18n/internationalizing_games.html]Internationalizing games[/url]. * * **Note:** This method can't be used without an [Object] instance, as it requires the [method can_translate_messages] method. To translate strings in a static context, use [method TranslationServer.translate]. */ @@ -935,7 +7992,7 @@ declare module "godot" { /** Translates a [param message] or [param plural_message], using the translation catalogs configured in the Project Settings. Further [param context] can be specified to help with the translation. * If [method can_translate_messages] is `false`, or no translation is available, this method returns [param message] or [param plural_message], without changes. See [method set_message_translation]. * The [param n] is the number, or amount, of the message's subject. It is used by the translation system to fetch the correct plural form for the current language. - * For detailed examples, see [url=https://docs.godotengine.org/en/4.3/tutorials/i18n/localization_using_gettext.html]Localization using gettext[/url]. + * For detailed examples, see [url=https://docs.godotengine.org/en/4.4/tutorials/i18n/localization_using_gettext.html]Localization using gettext[/url]. * * **Note:** Negative and [float] numbers may not properly apply to some countable subjects. It's recommended to handle these cases with [method tr]. * @@ -943,6 +8000,12 @@ declare module "godot" { */ tr_n(message: StringName, plural_message: StringName, n: int64, context: StringName = ''): string + /** Returns the name of the translation domain used by [method tr] and [method tr_n]. See also [TranslationServer]. */ + get_translation_domain(): StringName + + /** Sets the name of the translation domain used by [method tr] and [method tr_n]. See also [TranslationServer]. */ + set_translation_domain(domain: StringName): void + /** Returns `true` if the [method Node.queue_free] method was called for the object. */ is_queued_for_deletion(): boolean @@ -960,7 +8023,7 @@ declare module "godot" { } /** Occluder shape resource for use with occlusion culling in [OccluderInstance3D]. * - * @link https://docs.godotengine.org/en/4.3/classes/class_occluder3d.html + * @link https://docs.godotengine.org/en/4.4/classes/class_occluder3d.html */ class Occluder3D extends Resource { constructor(identifier?: any) @@ -972,9 +8035,9 @@ declare module "godot" { } /** Provides occlusion culling for 3D nodes, which improves performance in closed areas. * - * @link https://docs.godotengine.org/en/4.3/classes/class_occluderinstance3d.html + * @link https://docs.godotengine.org/en/4.4/classes/class_occluderinstance3d.html */ - class OccluderInstance3D extends VisualInstance3D { + class OccluderInstance3D = Record> extends VisualInstance3D { constructor(identifier?: any) /** Based on [param value], enables or disables the specified layer in the [member bake_mask], given a [param layer_number] between 1 and 32. */ set_bake_mask_value(layer_number: int64, value: boolean): void @@ -1006,7 +8069,7 @@ declare module "godot" { get bake_simplification_distance(): float64 set bake_simplification_distance(value: float64) } - class OccluderInstance3DEditorPlugin extends EditorPlugin { + class OccluderInstance3DEditorPlugin = Record> extends EditorPlugin { constructor(identifier?: any) _bake(): void } @@ -1027,7 +8090,7 @@ declare module "godot" { } /** Defines a 2D polygon for LightOccluder2D. * - * @link https://docs.godotengine.org/en/4.3/classes/class_occluderpolygon2d.html + * @link https://docs.godotengine.org/en/4.4/classes/class_occluderpolygon2d.html */ class OccluderPolygon2D extends Resource { constructor(identifier?: any) @@ -1045,14 +8108,14 @@ declare module "godot" { } /** A [MultiplayerPeer] which is always connected and acts as a server. * - * @link https://docs.godotengine.org/en/4.3/classes/class_offlinemultiplayerpeer.html + * @link https://docs.godotengine.org/en/4.4/classes/class_offlinemultiplayerpeer.html */ class OfflineMultiplayerPeer extends MultiplayerPeer { constructor(identifier?: any) } /** A sequence of Ogg packets. * - * @link https://docs.godotengine.org/en/4.3/classes/class_oggpacketsequence.html + * @link https://docs.godotengine.org/en/4.4/classes/class_oggpacketsequence.html */ class OggPacketSequence extends Resource { constructor(identifier?: any) @@ -1071,7 +8134,7 @@ declare module "godot" { get sampling_rate(): float64 set sampling_rate(value: float64) } - /** @link https://docs.godotengine.org/en/4.3/classes/class_oggpacketsequenceplayback.html */ + /** @link https://docs.godotengine.org/en/4.4/classes/class_oggpacketsequenceplayback.html */ class OggPacketSequencePlayback extends RefCounted { constructor(identifier?: any) } @@ -1086,9 +8149,9 @@ declare module "godot" { } /** Omnidirectional light, such as a light bulb or a candle. * - * @link https://docs.godotengine.org/en/4.3/classes/class_omnilight3d.html + * @link https://docs.godotengine.org/en/4.4/classes/class_omnilight3d.html */ - class OmniLight3D extends Light3D { + class OmniLight3D = Record> extends Light3D { constructor(identifier?: any) /** The light's radius. Note that the effectively lit area may appear to be smaller depending on the [member omni_attenuation] in use. No matter the [member omni_attenuation] in use, the light will never reach anything outside this radius. * @@ -1125,7 +8188,7 @@ declare module "godot" { } /** Makes the OpenXR API available for GDExtension. * - * @link https://docs.godotengine.org/en/4.3/classes/class_openxrapiextension.html + * @link https://docs.godotengine.org/en/4.4/classes/class_openxrapiextension.html */ class OpenXRAPIExtension extends RefCounted { constructor(identifier?: any) @@ -1159,6 +8222,18 @@ declare module "godot" { /** Returns the name of the specified swapchain format. */ get_swapchain_format_name(swapchain_format: int64): string + /** Set the object name of an OpenXR object, used for debug output. [param object_type] must be a valid OpenXR `XrObjectType` enum and [param object_handle] must be a valid OpenXR object handle. */ + set_object_name(object_type: int64, object_handle: int64, object_name: string): void + + /** Begins a new debug label region, this label will be reported in debug messages for any calls following this until [method end_debug_label_region] is called. Debug labels can be stacked. */ + begin_debug_label_region(label_name: string): void + + /** Marks the end of a debug label region. Removes the latest debug label region added by calling [method begin_debug_label_region]. */ + end_debug_label_region(): void + + /** Inserts a debug label, this label is reported in any debug message resulting from the OpenXR calls that follows, until any of [method begin_debug_label_region], [method end_debug_label_region], or [method insert_debug_label] is called. */ + insert_debug_label(label_name: string): void + /** Returns `true` if OpenXR is initialized. */ is_initialized(): boolean @@ -1177,6 +8252,12 @@ declare module "godot" { /** Returns `true` if OpenXR is initialized for rendering with an XR viewport. */ can_render(): boolean + /** Returns the [RID] corresponding to an `Action` of a matching name, optionally limited to a specified action set. */ + find_action(name: string, action_set: RID): RID + + /** Returns the corresponding `XrAction` OpenXR handle for the given action RID. */ + action_get_handle(action: RID): int64 + /** Returns the corresponding `XRHandTrackerEXT` handle for the given hand index value. */ get_hand_tracker(hand_index: int64): int64 @@ -1186,6 +8267,63 @@ declare module "godot" { /** Unregisters the given extension as a composition layer provider. */ unregister_composition_layer_provider(extension: OpenXRExtensionWrapperExtension): void + /** Registers the given extension as a provider of additional data structures to projections views. */ + register_projection_views_extension(extension: OpenXRExtensionWrapperExtension): void + + /** Unregisters the given extension as a provider of additional data structures to projections views. */ + unregister_projection_views_extension(extension: OpenXRExtensionWrapperExtension): void + + /** Returns the near boundary value of the camera frustum. + * + * **Note:** This is only accessible in the render thread. + */ + get_render_state_z_near(): float64 + + /** Returns the far boundary value of the camera frustum. + * + * **Note:** This is only accessible in the render thread. + */ + get_render_state_z_far(): float64 + + /** Sets the render target of the velocity texture. */ + set_velocity_texture(render_target: RID): void + + /** Sets the render target of the velocity depth texture. */ + set_velocity_depth_texture(render_target: RID): void + + /** Sets the target size of the velocity and velocity depth textures. */ + set_velocity_target_size(target_size: Vector2i): void + + /** Returns an array of supported swapchain formats. */ + get_supported_swapchain_formats(): PackedInt64Array + + /** Returns a pointer to a new swapchain created using the provided parameters. */ + openxr_swapchain_create(create_flags: int64, usage_flags: int64, swapchain_format: int64, width: int64, height: int64, sample_count: int64, array_size: int64): int64 + + /** Destroys the provided swapchain and frees it from memory. */ + openxr_swapchain_free(swapchain: int64): void + + /** Returns the `XrSwapchain` handle of the provided swapchain. */ + openxr_swapchain_get_swapchain(swapchain: int64): int64 + + /** Acquires the image of the provided swapchain. */ + openxr_swapchain_acquire(swapchain: int64): void + + /** Returns the RID of the provided swapchain's image. */ + openxr_swapchain_get_image(swapchain: int64): RID + + /** Releases the image of the provided swapchain. */ + openxr_swapchain_release(swapchain: int64): void + + /** Returns a pointer to the render state's `XrCompositionLayerProjection` struct. + * + * **Note:** This method should only be called from the rendering thread. + */ + get_projection_layer(): int64 + + /** Sets the render region to [param render_region], overriding the normal render target's rect. */ + set_render_region(render_region: Rect2i): void + /** If set to `true`, an OpenXR extension is loaded which is capable of emulating the [constant XRInterface.XR_ENV_BLEND_MODE_ALPHA_BLEND] blend mode. */ set_emulate_environment_blend_mode_alpha_blend(enabled: boolean): void @@ -1207,7 +8345,7 @@ declare module "godot" { } /** An OpenXR action. * - * @link https://docs.godotengine.org/en/4.3/classes/class_openxraction.html + * @link https://docs.godotengine.org/en/4.4/classes/class_openxraction.html */ class OpenXRAction extends Resource { constructor(identifier?: any) @@ -1223,9 +8361,16 @@ declare module "godot" { get toplevel_paths(): PackedStringArray set toplevel_paths(value: PackedStringArray | string[]) } + /** Binding modifier that applies on individual actions related to an interaction profile. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_openxractionbindingmodifier.html + */ + class OpenXRActionBindingModifier extends OpenXRBindingModifier { + constructor(identifier?: any) + } /** Collection of [OpenXRActionSet] and [OpenXRInteractionProfile] resources for the OpenXR module. * - * @link https://docs.godotengine.org/en/4.3/classes/class_openxractionmap.html + * @link https://docs.godotengine.org/en/4.4/classes/class_openxractionmap.html */ class OpenXRActionMap extends Resource { constructor(identifier?: any) @@ -1272,7 +8417,7 @@ declare module "godot" { } /** Collection of [OpenXRAction] resources that make up an action set. * - * @link https://docs.godotengine.org/en/4.3/classes/class_openxractionset.html + * @link https://docs.godotengine.org/en/4.4/classes/class_openxractionset.html */ class OpenXRActionSet extends Resource { constructor(identifier?: any) @@ -1297,13 +8442,71 @@ declare module "godot" { get actions(): OpenXRAction set actions(value: OpenXRAction) } + /** The analog threshold binding modifier can modify a float input to a boolean input with specified thresholds. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_openxranalogthresholdmodifier.html + */ + class OpenXRAnalogThresholdModifier extends OpenXRActionBindingModifier { + constructor(identifier?: any) + /** When our input value is equal or larger than this value, our output becomes true. It stays true until it falls under the [member off_threshold] value. */ + get on_threshold(): float64 + set on_threshold(value: float64) + + /** When our input value falls below this, our output becomes false. */ + get off_threshold(): float64 + set off_threshold(value: float64) + + /** Haptic pulse to emit when the user presses the input. */ + get on_haptic(): OpenXRHapticBase + set on_haptic(value: OpenXRHapticBase) + + /** Haptic pulse to emit when the user releases the input. */ + get off_haptic(): OpenXRHapticBase + set off_haptic(value: OpenXRHapticBase) + } + /** Binding modifier base class. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_openxrbindingmodifier.html + */ + class OpenXRBindingModifier extends Resource { + constructor(identifier?: any) + /** Return the description of this class that is used for the title bar of the binding modifier editor. */ + /* gdvirtual */ _get_description(): string + + /** Returns the data that is sent to OpenXR when submitting the suggested interacting bindings this modifier is a part of. + * + * **Note:** This must be data compatible with a `XrBindingModificationBaseHeaderKHR` structure. + */ + /* gdvirtual */ _get_ip_modification(): PackedByteArray + } + /** Binding modifier editor. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_openxrbindingmodifiereditor.html + */ + class OpenXRBindingModifierEditor = Record> extends PanelContainer { + constructor(identifier?: any) + /** Returns the [OpenXRBindingModifier] currently being edited. */ + get_binding_modifier(): OpenXRBindingModifier + + /** Setup this editor for the provided [param action_map] and [param binding_modifier]. */ + setup(action_map: OpenXRActionMap, binding_modifier: OpenXRBindingModifier): void + + /** Signal emitted when the user presses the delete binding modifier button for this modifier. */ + readonly binding_modifier_removed: Signal1 + } /** The parent class of all OpenXR composition layer nodes. * - * @link https://docs.godotengine.org/en/4.3/classes/class_openxrcompositionlayer.html + * @link https://docs.godotengine.org/en/4.4/classes/class_openxrcompositionlayer.html */ - class OpenXRCompositionLayer extends Node3D { + class OpenXRCompositionLayer = Record> extends Node3D { constructor(identifier?: any) - /** Returns true if the OpenXR runtime natively supports this composition layer type. + /** Returns a [JavaObject] representing an `android.view.Surface` if [member use_android_surface] is enabled and OpenXR has created the surface. Otherwise, this will return `null`. + * + * **Note:** The surface can only be created during an active OpenXR session. So, if [member use_android_surface] is enabled outside of an OpenXR session, it won't be created until a new session fully starts. + */ + get_android_surface(): JavaObject + + /** Returns `true` if the OpenXR runtime natively supports this composition layer type. * * **Note:** This will only return an accurate result after the OpenXR session has started. */ @@ -1318,6 +8521,18 @@ declare module "godot" { get layer_viewport(): Object set layer_viewport(value: Object) + /** If enabled, an Android surface will be created (with the dimensions from [member android_surface_size]) which will provide the 2D content for the composition layer, rather than using [member layer_viewport]. + * See [method get_android_surface] for information about how to get the surface so that your application can draw to it. + * + * **Note:** This will only work in Android builds. + */ + get use_android_surface(): boolean + set use_android_surface(value: boolean) + + /** The size of the Android surface to create if [member use_android_surface] is enabled. */ + get android_surface_size(): Vector2i + set android_surface_size(value: Vector2i) + /** The sort order for this composition layer. Higher numbers will be shown in front of lower numbers. * * **Note:** This will have no effect if a fallback mesh is being used. @@ -1339,9 +8554,9 @@ declare module "godot" { } /** An OpenXR composition layer that is rendered as an internal slice of a cylinder. * - * @link https://docs.godotengine.org/en/4.3/classes/class_openxrcompositionlayercylinder.html + * @link https://docs.godotengine.org/en/4.4/classes/class_openxrcompositionlayercylinder.html */ - class OpenXRCompositionLayerCylinder extends OpenXRCompositionLayer { + class OpenXRCompositionLayerCylinder = Record> extends OpenXRCompositionLayer { constructor(identifier?: any) /** The radius of the cylinder. */ get radius(): float64 @@ -1361,9 +8576,9 @@ declare module "godot" { } /** An OpenXR composition layer that is rendered as an internal slice of a sphere. * - * @link https://docs.godotengine.org/en/4.3/classes/class_openxrcompositionlayerequirect.html + * @link https://docs.godotengine.org/en/4.4/classes/class_openxrcompositionlayerequirect.html */ - class OpenXRCompositionLayerEquirect extends OpenXRCompositionLayer { + class OpenXRCompositionLayerEquirect = Record> extends OpenXRCompositionLayer { constructor(identifier?: any) /** The radius of the sphere. */ get radius(): float64 @@ -1387,17 +8602,61 @@ declare module "godot" { } /** An OpenXR composition layer that is rendered as a quad. * - * @link https://docs.godotengine.org/en/4.3/classes/class_openxrcompositionlayerquad.html + * @link https://docs.godotengine.org/en/4.4/classes/class_openxrcompositionlayerquad.html */ - class OpenXRCompositionLayerQuad extends OpenXRCompositionLayer { + class OpenXRCompositionLayerQuad = Record> extends OpenXRCompositionLayer { constructor(identifier?: any) /** The dimensions of the quad. */ get quad_size(): Vector2 set quad_size(value: Vector2) } + /** The DPad binding modifier converts an axis input to a dpad output. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_openxrdpadbindingmodifier.html + */ + class OpenXRDpadBindingModifier extends OpenXRIPBindingModifier { + constructor(identifier?: any) + /** Action set for which this dpad binding modifier is active. */ + get action_set(): OpenXRActionSet + set action_set(value: OpenXRActionSet) + + /** Input path for this dpad binding modifier. */ + get input_path(): string + set input_path(value: string) + + /** When our input value is equal or larger than this value, our dpad in that direction becomes true. It stays true until it falls under the [member threshold_released] value. */ + get threshold(): float64 + set threshold(value: float64) + + /** When our input value falls below this, our output becomes false. */ + get threshold_released(): float64 + set threshold_released(value: float64) + + /** Center region in which our center position of our dpad return `true`. */ + get center_region(): float64 + set center_region(value: float64) + + /** The angle of each wedge that identifies the 4 directions of the emulated dpad. */ + get wedge_angle(): float64 + set wedge_angle(value: float64) + + /** If `false`, when the joystick enters a new dpad zone this becomes true. + * If `true`, when the joystick remains in active dpad zone, this remains true even if we overlap with another zone. + */ + get is_sticky(): boolean + set is_sticky(value: boolean) + + /** Haptic pulse to emit when the user presses the input. */ + get on_haptic(): OpenXRHapticBase + set on_haptic(value: OpenXRHapticBase) + + /** Haptic pulse to emit when the user releases the input. */ + get off_haptic(): OpenXRHapticBase + set off_haptic(value: OpenXRHapticBase) + } /** Allows clients to implement OpenXR extensions with GDExtension. * - * @link https://docs.godotengine.org/en/4.3/classes/class_openxrextensionwrapperextension.html + * @link https://docs.godotengine.org/en/4.4/classes/class_openxrextensionwrapperextension.html */ class OpenXRExtensionWrapperExtension extends Object { constructor(identifier?: any) @@ -1407,7 +8666,7 @@ declare module "godot" { */ /* gdvirtual */ _get_requested_extensions(): GDictionary - /** Adds additional data structures when interogating OpenXR system abilities. */ + /** Adds additional data structures when querying OpenXR system abilities. */ /* gdvirtual */ _set_system_properties_and_get_next_pointer(next_pointer: int64): int64 /** Adds additional data structures when the OpenXR instance is created. */ @@ -1422,6 +8681,9 @@ declare module "godot" { /** Adds additional data structures when each hand tracker is created. */ /* gdvirtual */ _set_hand_joint_locations_and_get_next_pointer(hand_index: int64, next_pointer: int64): int64 + /** Adds additional data structures to the projection view of the given [param view_index]. */ + /* gdvirtual */ _set_projection_views_and_get_next_pointer(view_index: int64, next_pointer: int64): int64 + /** Returns the number of composition layers this extension wrapper provides via [method _get_composition_layer]. * This will only be called if the extension previously registered itself with [method OpenXRAPIExtension.register_composition_layer_provider]. */ @@ -1466,6 +8728,15 @@ declare module "godot" { /** Called right after the main swapchains are (re)created. */ /* gdvirtual */ _on_main_swapchains_created(): void + /** Called right before the given viewport is rendered. */ + /* gdvirtual */ _on_pre_draw_viewport(viewport: RID): void + + /** Called right after the given viewport is rendered. + * + * **Note:** The draw commands might only be queued at this point, not executed. + */ + /* gdvirtual */ _on_post_draw_viewport(viewport: RID): void + /** Called right before the OpenXR session is destroyed. */ /* gdvirtual */ _on_session_destroyed(): void @@ -1513,6 +8784,11 @@ declare module "godot" { */ /* gdvirtual */ _on_viewport_composition_layer_destroyed(layer: int64): void + /** Adds additional data structures to Android surface swapchains created by [OpenXRCompositionLayer]. + * [param property_values] contains the values of the properties returned by [method _get_viewport_composition_layer_extension_properties]. + */ + /* gdvirtual */ _set_android_surface_swapchain_create_info_and_get_next_pointer(property_values: GDictionary, next_pointer: int64): int64 + /** Returns the created [OpenXRAPIExtension], which can be used to access the OpenXR API. */ get_openxr_api(): OpenXRAPIExtension @@ -1563,9 +8839,9 @@ declare module "godot" { } /** Node supporting hand and finger tracking in OpenXR. * - * @link https://docs.godotengine.org/en/4.3/classes/class_openxrhand.html + * @link https://docs.godotengine.org/en/4.4/classes/class_openxrhand.html */ - class OpenXRHand extends Node3D { + class OpenXRHand = Record> extends Node3D { constructor(identifier?: any) /** Specifies whether this node tracks the left or right hand of the player. */ get hand(): int64 @@ -1587,12 +8863,43 @@ declare module "godot" { get bone_update(): int64 set bone_update(value: int64) } + /** OpenXR Haptic feedback base class. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_openxrhapticbase.html + */ + class OpenXRHapticBase extends Resource { + constructor(identifier?: any) + } + /** Vibration haptic feedback. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_openxrhapticvibration.html + */ + class OpenXRHapticVibration extends OpenXRHapticBase { + constructor(identifier?: any) + /** The duration of the pulse in nanoseconds. Use `-1` for a minimum duration pulse for the current XR runtime. */ + get duration(): int64 + set duration(value: int64) + + /** The frequency of the pulse in Hz. `0.0` will let the XR runtime chose an optimal frequency for the device used. */ + get frequency(): float64 + set frequency(value: float64) + + /** The amplitude of the pulse between `0.0` and `1.0`. */ + get amplitude(): float64 + set amplitude(value: float64) + } /** Defines a binding between an [OpenXRAction] and an XR input or output. * - * @link https://docs.godotengine.org/en/4.3/classes/class_openxripbinding.html + * @link https://docs.godotengine.org/en/4.4/classes/class_openxripbinding.html */ class OpenXRIPBinding extends Resource { constructor(identifier?: any) + /** Get the number of binding modifiers for this binding. */ + get_binding_modifier_count(): int64 + + /** Get the [OpenXRBindingModifier] at this index. */ + get_binding_modifier(index: int64): OpenXRActionBindingModifier + /** Get the number of input/output paths in this binding. */ get_path_count(): int64 @@ -1605,17 +8912,35 @@ declare module "godot" { /** Removes this input/output path from this binding. */ remove_path(path: string): void - /** [OpenXRAction] that is bound to these paths. */ + /** [OpenXRAction] that is bound to [member binding_path]. */ get action(): OpenXRAction set action(value: OpenXRAction) + /** Binding path that defines the input or output bound to [member action]. + * + * **Note:** Binding paths are suggestions, an XR runtime may choose to bind the action to a different input or output emulating this input or output. + */ + get binding_path(): string + set binding_path(value: string) + + /** Binding modifiers for this binding. */ + get binding_modifiers(): OpenXRActionBindingModifier + set binding_modifiers(value: OpenXRActionBindingModifier) + /** Paths that define the inputs or outputs bound on the device. */ get paths(): PackedStringArray set paths(value: PackedStringArray | string[]) } + /** Binding modifier that applies directly on an interaction profile. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_openxripbindingmodifier.html + */ + class OpenXRIPBindingModifier extends OpenXRBindingModifier { + constructor(identifier?: any) + } /** Suggested bindings object for OpenXR. * - * @link https://docs.godotengine.org/en/4.3/classes/class_openxrinteractionprofile.html + * @link https://docs.godotengine.org/en/4.4/classes/class_openxrinteractionprofile.html */ class OpenXRInteractionProfile extends Resource { constructor(identifier?: any) @@ -1625,6 +8950,12 @@ declare module "godot" { /** Retrieve the binding at this index. */ get_binding(index: int64): OpenXRIPBinding + /** Get the number of binding modifiers in this interaction profile. */ + get_binding_modifier_count(): int64 + + /** Get the [OpenXRBindingModifier] at this index. */ + get_binding_modifier(index: int64): OpenXRIPBindingModifier + /** The interaction profile path identifying the XR device. */ get interaction_profile_path(): string set interaction_profile_path(value: string) @@ -1632,10 +8963,32 @@ declare module "godot" { /** Action bindings for this interaction profile. */ get bindings(): OpenXRIPBinding set bindings(value: OpenXRIPBinding) + + /** Binding modifiers for this interaction profile. */ + get binding_modifiers(): OpenXRIPBindingModifier + set binding_modifiers(value: OpenXRIPBindingModifier) + } + /** Default OpenXR interaction profile editor. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_openxrinteractionprofileeditor.html + */ + class OpenXRInteractionProfileEditor = Record> extends OpenXRInteractionProfileEditorBase { + constructor(identifier?: any) + } + /** Base class for editing interaction profiles. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_openxrinteractionprofileeditorbase.html + */ + class OpenXRInteractionProfileEditorBase = Record> extends HBoxContainer { + constructor(identifier?: any) + /** Setup this editor for the provided [param action_map] and [param interaction_profile]. */ + setup(action_map: OpenXRActionMap, interaction_profile: OpenXRInteractionProfile): void + _add_binding(action: string, path: string): void + _remove_binding(action: string, path: string): void } /** Meta class registering supported devices in OpenXR. * - * @link https://docs.godotengine.org/en/4.3/classes/class_openxrinteractionprofilemetadata.html + * @link https://docs.godotengine.org/en/4.4/classes/class_openxrinteractionprofilemetadata.html */ class OpenXRInteractionProfileMetadata extends Object { constructor(identifier?: any) @@ -1797,7 +9150,7 @@ declare module "godot" { } /** Our OpenXR interface. * - * @link https://docs.godotengine.org/en/4.3/classes/class_openxrinterface.html + * @link https://docs.godotengine.org/en/4.4/classes/class_openxrinterface.html */ class OpenXRInterface extends XRInterface { constructor(identifier?: any) @@ -1927,7880 +9280,4 @@ declare module "godot" { */ readonly refresh_rate_changed: Signal1 } - /** An optimized translation, used by default for CSV Translations. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_optimizedtranslation.html - */ - class OptimizedTranslation extends Translation { - constructor(identifier?: any) - /** Generates and sets an optimized translation from the given [Translation] resource. */ - generate(from: Translation): void - } - /** A button that brings up a dropdown with selectable options when pressed. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_optionbutton.html - */ - class OptionButton extends Button { - constructor(identifier?: any) - /** Adds an item, with text [param label] and (optionally) [param id]. If no [param id] is passed, the item index will be used as the item's ID. New items are appended at the end. */ - add_item(label: string, id: int64 = -1): void - - /** Adds an item, with a [param texture] icon, text [param label] and (optionally) [param id]. If no [param id] is passed, the item index will be used as the item's ID. New items are appended at the end. */ - add_icon_item(texture: Texture2D, label: string, id: int64 = -1): void - - /** Sets the text of the item at index [param idx]. */ - set_item_text(idx: int64, text: string): void - - /** Sets the icon of the item at index [param idx]. */ - set_item_icon(idx: int64, texture: Texture2D): void - - /** Sets whether the item at index [param idx] is disabled. - * Disabled items are drawn differently in the dropdown and are not selectable by the user. If the current selected item is set as disabled, it will remain selected. - */ - set_item_disabled(idx: int64, disabled: boolean): void - - /** Sets the ID of the item at index [param idx]. */ - set_item_id(idx: int64, id: int64): void - - /** Sets the metadata of an item. Metadata may be of any type and can be used to store extra information about an item, such as an external string ID. */ - set_item_metadata(idx: int64, metadata: any): void - - /** Sets the tooltip of the item at index [param idx]. */ - set_item_tooltip(idx: int64, tooltip: string): void - - /** Returns the text of the item at index [param idx]. */ - get_item_text(idx: int64): string - - /** Returns the icon of the item at index [param idx]. */ - get_item_icon(idx: int64): Texture2D - - /** Returns the ID of the item at index [param idx]. */ - get_item_id(idx: int64): int64 - - /** Returns the index of the item with the given [param id]. */ - get_item_index(id: int64): int64 - - /** Retrieves the metadata of an item. Metadata may be any type and can be used to store extra information about an item, such as an external string ID. */ - get_item_metadata(idx: int64): any - - /** Returns the tooltip of the item at index [param idx]. */ - get_item_tooltip(idx: int64): string - - /** Returns `true` if the item at index [param idx] is disabled. */ - is_item_disabled(idx: int64): boolean - - /** Returns `true` if the item at index [param idx] is marked as a separator. */ - is_item_separator(idx: int64): boolean - - /** Adds a separator to the list of items. Separators help to group items, and can optionally be given a [param text] header. A separator also gets an index assigned, and is appended at the end of the item list. */ - add_separator(text: string = ''): void - - /** Clears all the items in the [OptionButton]. */ - clear(): void - - /** Selects an item by index and makes it the current item. This will work even if the item is disabled. - * Passing `-1` as the index deselects any currently selected item. - */ - select(idx: int64): void - - /** Returns the ID of the selected item, or `-1` if no item is selected. */ - get_selected_id(): int64 - - /** Gets the metadata of the selected item. Metadata for items can be set using [method set_item_metadata]. */ - get_selected_metadata(): any - - /** Removes the item at index [param idx]. */ - remove_item(idx: int64): void - - /** Returns the [PopupMenu] contained in this button. - * **Warning:** This is a required internal node, removing and freeing it may cause a crash. If you wish to hide it or any of its children, use their [member Window.visible] property. - */ - get_popup(): PopupMenu - - /** Adjusts popup position and sizing for the [OptionButton], then shows the [PopupMenu]. Prefer this over using `get_popup().popup()`. */ - show_popup(): void - - /** Returns `true` if this button contains at least one item which is not disabled, or marked as a separator. */ - has_selectable_items(): boolean - - /** Returns the index of the first item which is not disabled, or marked as a separator. If [param from_last] is `true`, the items will be searched in reverse order. - * Returns `-1` if no item is found. - */ - get_selectable_item(from_last: boolean = false): int64 - - /** If `true`, shortcuts are disabled and cannot be used to trigger the button. */ - set_disable_shortcuts(disabled: boolean): void - - /** The index of the currently selected item, or `-1` if no item is selected. */ - get selected(): int64 - set selected(value: int64) - - /** If `true`, minimum size will be determined by the longest item's text, instead of the currently selected one's. - * - * **Note:** For performance reasons, the minimum size doesn't update immediately when adding, removing or modifying items. - */ - get fit_to_longest_item(): boolean - set fit_to_longest_item(value: boolean) - - /** If `true`, the currently selected item can be selected again. */ - get allow_reselect(): boolean - set allow_reselect(value: boolean) - - /** The number of items to select from. */ - get item_count(): any /*Items,popup/item_*/ - set item_count(value: any /*Items,popup/item_*/) - - /** Emitted when the current item has been changed by the user. The index of the item selected is passed as argument. - * [member allow_reselect] must be enabled to reselect an item. - */ - readonly item_selected: Signal1 - - /** Emitted when the user navigates to an item using the [member ProjectSettings.input/ui_up] or [member ProjectSettings.input/ui_down] input actions. The index of the item selected is passed as argument. */ - readonly item_focused: Signal1 - } - class OrphanResourcesDialog extends ConfirmationDialog { - constructor(identifier?: any) - } - /** Creates packages that can be loaded into a running project. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_pckpacker.html - */ - class PCKPacker extends RefCounted { - constructor(identifier?: any) - /** Creates a new PCK file with the name [param pck_name]. The `.pck` file extension isn't added automatically, so it should be part of [param pck_name] (even though it's not required). */ - pck_start(pck_name: string, alignment: int64 = 32, key: string = '0000000000000000000000000000000000000000000000000000000000000000', encrypt_directory: boolean = false): GError - - /** Adds the [param source_path] file to the current PCK package at the [param pck_path] internal path (should start with `res://`). */ - add_file(pck_path: string, source_path: string, encrypt: boolean = false): GError - - /** Writes the files specified using all [method add_file] calls since the last flush. If [param verbose] is `true`, a list of files added will be printed to the console for easier debugging. */ - flush(verbose: boolean = false): GError - } - /** Efficiently packs and serializes [Array] or [Dictionary]. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_packeddatacontainer.html - */ - class PackedDataContainer extends Resource { - constructor(identifier?: any) - _iter_init(_unnamed_arg0: GArray): any - _iter_get(_unnamed_arg0: any): any - _iter_next(_unnamed_arg0: GArray): any - - /** Packs the given container into a binary representation. The [param value] must be either [Array] or [Dictionary], any other type will result in invalid data error. - * - * **Note:** Subsequent calls to this method will overwrite the existing data. - */ - pack(value: any): GError - - /** Returns the size of the packed container (see [method Array.size] and [method Dictionary.size]). */ - size(): int64 - get __data__(): PackedByteArray - set __data__(value: PackedByteArray | byte[] | ArrayBuffer) - } - /** An internal class used by [PackedDataContainer] to pack nested arrays and dictionaries. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_packeddatacontainerref.html - */ - class PackedDataContainerRef extends RefCounted { - constructor(identifier?: any) - /** Returns the size of the packed container (see [method Array.size] and [method Dictionary.size]). */ - size(): int64 - _iter_init(_unnamed_arg0: GArray): any - _iter_get(_unnamed_arg0: any): any - _iter_next(_unnamed_arg0: GArray): any - } - namespace PackedScene { - enum GenEditState { - /** If passed to [method instantiate], blocks edits to the scene state. */ - GEN_EDIT_STATE_DISABLED = 0, - - /** If passed to [method instantiate], provides local scene resources to the local scene. - * - * **Note:** Only available in editor builds. - */ - GEN_EDIT_STATE_INSTANCE = 1, - - /** If passed to [method instantiate], provides local scene resources to the local scene. Only the main scene should receive the main edit state. - * - * **Note:** Only available in editor builds. - */ - GEN_EDIT_STATE_MAIN = 2, - - /** It's similar to [constant GEN_EDIT_STATE_MAIN], but for the case where the scene is being instantiated to be the base of another one. - * - * **Note:** Only available in editor builds. - */ - GEN_EDIT_STATE_MAIN_INHERITED = 3, - } - } - /** An abstraction of a serialized scene. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_packedscene.html - */ - class PackedScene extends Resource { - constructor(identifier?: any) - /** Packs the [param path] node, and all owned sub-nodes, into this [PackedScene]. Any existing data will be cleared. See [member Node.owner]. */ - pack(path: Node): GError - - /** Instantiates the scene's node hierarchy. Triggers child scene instantiation(s). Triggers a [constant Node.NOTIFICATION_SCENE_INSTANTIATED] notification on the root node. */ - instantiate(edit_state: PackedScene.GenEditState = 0): Node - - /** Returns `true` if the scene file has nodes. */ - can_instantiate(): boolean - - /** Returns the [SceneState] representing the scene file contents. */ - get_state(): SceneState - - /** A dictionary representation of the scene contents. - * Available keys include "names" and "variants" for resources, "node_count", "nodes", "node_paths" for nodes, "editable_instances" for paths to overridden nodes, "conn_count" and "conns" for signal connections, and "version" for the format style of the PackedScene. - */ - get _bundled(): GDictionary - set _bundled(value: GDictionary) - } - class PackedSceneEditorPlugin extends EditorPlugin { - constructor(identifier?: any) - } - class PackedSceneEditorTranslationParserPlugin extends EditorTranslationParserPlugin { - constructor(identifier?: any) - } - /** Abstraction and base class for packet-based protocols. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_packetpeer.html - */ - class PacketPeer extends RefCounted { - constructor(identifier?: any) - /** Gets a Variant. If [param allow_objects] is `true`, decoding objects is allowed. - * Internally, this uses the same decoding mechanism as the [method @GlobalScope.bytes_to_var] method. - * **Warning:** Deserialized objects can contain code which gets executed. Do not use this option if the serialized object comes from untrusted sources to avoid potential security threats such as remote code execution. - */ - get_var(allow_objects: boolean = false): any - - /** Sends a [Variant] as a packet. If [param full_objects] is `true`, encoding objects is allowed (and can potentially include code). - * Internally, this uses the same encoding mechanism as the [method @GlobalScope.var_to_bytes] method. - */ - put_var(var_: any, full_objects: boolean = false): GError - - /** Gets a raw packet. */ - get_packet(): PackedByteArray - - /** Sends a raw packet. */ - put_packet(buffer: PackedByteArray | byte[] | ArrayBuffer): GError - - /** Returns the error state of the last packet received (via [method get_packet] and [method get_var]). */ - get_packet_error(): GError - - /** Returns the number of packets currently available in the ring-buffer. */ - get_available_packet_count(): int64 - - /** Maximum buffer size allowed when encoding [Variant]s. Raise this value to support heavier memory allocations. - * The [method put_var] method allocates memory on the stack, and the buffer used will grow automatically to the closest power of two to match the size of the [Variant]. If the [Variant] is bigger than [member encode_buffer_max_size], the method will error out with [constant ERR_OUT_OF_MEMORY]. - */ - get encode_buffer_max_size(): int64 - set encode_buffer_max_size(value: int64) - } - namespace PacketPeerDTLS { - enum Status { - /** A status representing a [PacketPeerDTLS] that is disconnected. */ - STATUS_DISCONNECTED = 0, - - /** A status representing a [PacketPeerDTLS] that is currently performing the handshake with a remote peer. */ - STATUS_HANDSHAKING = 1, - - /** A status representing a [PacketPeerDTLS] that is connected to a remote peer. */ - STATUS_CONNECTED = 2, - - /** A status representing a [PacketPeerDTLS] in a generic error state. */ - STATUS_ERROR = 3, - - /** An error status that shows a mismatch in the DTLS certificate domain presented by the host and the domain requested for validation. */ - STATUS_ERROR_HOSTNAME_MISMATCH = 4, - } - } - /** DTLS packet peer. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_packetpeerdtls.html - */ - class PacketPeerDTLS extends PacketPeer { - constructor(identifier?: any) - /** Poll the connection to check for incoming packets. Call this frequently to update the status and keep the connection working. */ - poll(): void - - /** Connects a [param packet_peer] beginning the DTLS handshake using the underlying [PacketPeerUDP] which must be connected (see [method PacketPeerUDP.connect_to_host]). You can optionally specify the [param client_options] to be used while verifying the TLS connections. See [method TLSOptions.client] and [method TLSOptions.client_unsafe]. */ - connect_to_peer(packet_peer: PacketPeerUDP, hostname: string, client_options: TLSOptions = undefined): GError - - /** Returns the status of the connection. See [enum Status] for values. */ - get_status(): PacketPeerDTLS.Status - - /** Disconnects this peer, terminating the DTLS session. */ - disconnect_from_peer(): void - } - /** @link https://docs.godotengine.org/en/4.3/classes/class_packetpeerextension.html */ - class PacketPeerExtension extends PacketPeer { - constructor(identifier?: any) - /* gdvirtual */ _get_packet(r_buffer: int64, r_buffer_size: int64): GError - /* gdvirtual */ _put_packet(p_buffer: int64, p_buffer_size: int64): GError - /* gdvirtual */ _get_available_packet_count(): int64 - /* gdvirtual */ _get_max_packet_size(): int64 - } - /** Wrapper to use a PacketPeer over a StreamPeer. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_packetpeerstream.html - */ - class PacketPeerStream extends PacketPeer { - constructor(identifier?: any) - get input_buffer_max_size(): int64 - set input_buffer_max_size(value: int64) - get output_buffer_max_size(): int64 - set output_buffer_max_size(value: int64) - - /** The wrapped [StreamPeer] object. */ - get stream_peer(): StreamPeer - set stream_peer(value: StreamPeer) - } - /** UDP packet peer. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_packetpeerudp.html - */ - class PacketPeerUDP extends PacketPeer { - constructor(identifier?: any) - /** Binds this [PacketPeerUDP] to the specified [param port] and [param bind_address] with a buffer size [param recv_buf_size], allowing it to receive incoming packets. - * If [param bind_address] is set to `"*"` (default), the peer will be bound on all available addresses (both IPv4 and IPv6). - * If [param bind_address] is set to `"0.0.0.0"` (for IPv4) or `"::"` (for IPv6), the peer will be bound to all available addresses matching that IP type. - * If [param bind_address] is set to any valid address (e.g. `"192.168.1.101"`, `"::1"`, etc.), the peer will only be bound to the interface with that address (or fail if no interface with the given address exists). - */ - bind(port: int64, bind_address: string = '*', recv_buf_size: int64 = 65536): GError - - /** Closes the [PacketPeerUDP]'s underlying UDP socket. */ - close(): void - - /** Waits for a packet to arrive on the bound address. See [method bind]. - * - * **Note:** [method wait] can't be interrupted once it has been called. This can be worked around by allowing the other party to send a specific "death pill" packet like this: - * - */ - wait(): GError - - /** Returns whether this [PacketPeerUDP] is bound to an address and can receive packets. */ - is_bound(): boolean - - /** Calling this method connects this UDP peer to the given [param host]/[param port] pair. UDP is in reality connectionless, so this option only means that incoming packets from different addresses are automatically discarded, and that outgoing packets are always sent to the connected address (future calls to [method set_dest_address] are not allowed). This method does not send any data to the remote peer, to do that, use [method PacketPeer.put_var] or [method PacketPeer.put_packet] as usual. See also [UDPServer]. - * - * **Note:** Connecting to the remote peer does not help to protect from malicious attacks like IP spoofing, etc. Think about using an encryption technique like TLS or DTLS if you feel like your application is transferring sensitive information. - */ - connect_to_host(host: string, port: int64): GError - - /** Returns `true` if the UDP socket is open and has been connected to a remote address. See [method connect_to_host]. */ - is_socket_connected(): boolean - - /** Returns the IP of the remote peer that sent the last packet(that was received with [method PacketPeer.get_packet] or [method PacketPeer.get_var]). */ - get_packet_ip(): string - - /** Returns the port of the remote peer that sent the last packet(that was received with [method PacketPeer.get_packet] or [method PacketPeer.get_var]). */ - get_packet_port(): int64 - - /** Returns the local port to which this peer is bound. */ - get_local_port(): int64 - - /** Sets the destination address and port for sending packets and variables. A hostname will be resolved using DNS if needed. - * - * **Note:** [method set_broadcast_enabled] must be enabled before sending packets to a broadcast address (e.g. `255.255.255.255`). - */ - set_dest_address(host: string, port: int64): GError - - /** Enable or disable sending of broadcast packets (e.g. `set_dest_address("255.255.255.255", 4343)`. This option is disabled by default. - * - * **Note:** Some Android devices might require the `CHANGE_WIFI_MULTICAST_STATE` permission and this option to be enabled to receive broadcast packets too. - */ - set_broadcast_enabled(enabled: boolean): void - - /** Joins the multicast group specified by [param multicast_address] using the interface identified by [param interface_name]. - * You can join the same multicast group with multiple interfaces. Use [method IP.get_local_interfaces] to know which are available. - * - * **Note:** Some Android devices might require the `CHANGE_WIFI_MULTICAST_STATE` permission for multicast to work. - */ - join_multicast_group(multicast_address: string, interface_name: string): GError - - /** Removes the interface identified by [param interface_name] from the multicast group specified by [param multicast_address]. */ - leave_multicast_group(multicast_address: string, interface_name: string): GError - } - /** A GUI control that displays a [StyleBox]. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_panel.html - */ - class Panel extends Control { - constructor(identifier?: any) - } - /** A container that keeps its child controls within the area of a [StyleBox]. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_panelcontainer.html - */ - class PanelContainer extends Container { - constructor(identifier?: any) - } - /** A material that provides a special texture to a [Sky], usually an HDR panorama. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_panoramaskymaterial.html - */ - class PanoramaSkyMaterial extends Material { - constructor(identifier?: any) - /** [Texture2D] to be applied to the [PanoramaSkyMaterial]. */ - get panorama(): Texture2D - set panorama(value: Texture2D) - - /** A boolean value to determine if the background texture should be filtered or not. */ - get filter(): boolean - set filter(value: boolean) - - /** The sky's overall brightness multiplier. Higher values result in a brighter sky. */ - get energy_multiplier(): float64 - set energy_multiplier(value: float64) - } - class PanoramaSkyMaterialConversionPlugin extends EditorResourceConversionPlugin { - constructor(identifier?: any) - } - /** A node used to create a parallax scrolling background. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_parallax2d.html - */ - class Parallax2D extends Node2D { - constructor(identifier?: any) - _camera_moved(transform: Transform2D, screen_offset: Vector2, adj_screen_offset: Vector2): void - - /** Multiplier to the final [Parallax2D]'s offset. Can be used to simulate distance from the camera. - * For example, a value of `1` scrolls at the same speed as the camera. A value greater than `1` scrolls faster, making objects appear closer. Less than `1` scrolls slower, making objects appear further, and a value of `0` stops the objects completely. - */ - get scroll_scale(): Vector2 - set scroll_scale(value: Vector2) - - /** The [Parallax2D]'s offset. Similar to [member screen_offset] and [member Node2D.position], but will not be overridden. - * - * **Note:** Values will loop if [member repeat_size] is set higher than `0`. - */ - get scroll_offset(): Vector2 - set scroll_offset(value: Vector2) - - /** Repeats the [Texture2D] of each of this node's children and offsets them by this value. When scrolling, the node's position loops, giving the illusion of an infinite scrolling background if the values are larger than the screen size. If an axis is set to `0`, the [Texture2D] will not be repeated. */ - get repeat_size(): Vector2 - set repeat_size(value: Vector2) - - /** Velocity at which the offset scrolls automatically, in pixels per second. */ - get autoscroll(): Vector2 - set autoscroll(value: Vector2) - - /** Overrides the amount of times the texture repeats. Each texture copy spreads evenly from the original by [member repeat_size]. Useful for when zooming out with a camera. */ - get repeat_times(): int64 - set repeat_times(value: int64) - - /** Top-left limits for scrolling to begin. If the camera is outside of this limit, the [Parallax2D] stops scrolling. Must be lower than [member limit_end] minus the viewport size to work. */ - get limit_begin(): Vector2 - set limit_begin(value: Vector2) - - /** Bottom-right limits for scrolling to end. If the camera is outside of this limit, the [Parallax2D] will stop scrolling. Must be higher than [member limit_begin] and the viewport size combined to work. */ - get limit_end(): Vector2 - set limit_end(value: Vector2) - - /** If `true`, this [Parallax2D] is offset by the current camera's position. If the [Parallax2D] is in a [CanvasLayer] separate from the current camera, it may be desired to match the value with [member CanvasLayer.follow_viewport_enabled]. */ - get follow_viewport(): boolean - set follow_viewport(value: boolean) - - /** If `true`, [Parallax2D]'s position is not affected by the position of the camera. */ - get ignore_camera_scroll(): boolean - set ignore_camera_scroll(value: boolean) - - /** Offset used to scroll this [Parallax2D]. This value is updated automatically unless [member ignore_camera_scroll] is `true`. */ - get screen_offset(): Vector2 - set screen_offset(value: Vector2) - } - /** A node used to create a parallax scrolling background. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_parallaxbackground.html - */ - class ParallaxBackground extends CanvasLayer { - constructor(identifier?: any) - _camera_moved(_unnamed_arg0: Transform2D, _unnamed_arg1: Vector2, _unnamed_arg2: Vector2): void - - /** The ParallaxBackground's scroll value. Calculated automatically when using a [Camera2D], but can be used to manually manage scrolling when no camera is present. */ - get scroll_offset(): Vector2 - set scroll_offset(value: Vector2) - - /** The base position offset for all [ParallaxLayer] children. */ - get scroll_base_offset(): Vector2 - set scroll_base_offset(value: Vector2) - - /** The base motion scale for all [ParallaxLayer] children. */ - get scroll_base_scale(): Vector2 - set scroll_base_scale(value: Vector2) - - /** Top-left limits for scrolling to begin. If the camera is outside of this limit, the background will stop scrolling. Must be lower than [member scroll_limit_end] to work. */ - get scroll_limit_begin(): Vector2 - set scroll_limit_begin(value: Vector2) - - /** Bottom-right limits for scrolling to end. If the camera is outside of this limit, the background will stop scrolling. Must be higher than [member scroll_limit_begin] to work. */ - get scroll_limit_end(): Vector2 - set scroll_limit_end(value: Vector2) - - /** If `true`, elements in [ParallaxLayer] child aren't affected by the zoom level of the camera. */ - get scroll_ignore_camera_zoom(): boolean - set scroll_ignore_camera_zoom(value: boolean) - } - class ParallaxBackgroundEditorPlugin extends EditorPlugin { - constructor(identifier?: any) - } - /** A parallax scrolling layer to be used with [ParallaxBackground]. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_parallaxlayer.html - */ - class ParallaxLayer extends Node2D { - constructor(identifier?: any) - /** Multiplies the ParallaxLayer's motion. If an axis is set to `0`, it will not scroll. */ - get motion_scale(): Vector2 - set motion_scale(value: Vector2) - - /** The ParallaxLayer's offset relative to the parent ParallaxBackground's [member ParallaxBackground.scroll_offset]. */ - get motion_offset(): Vector2 - set motion_offset(value: Vector2) - - /** The interval, in pixels, at which the [ParallaxLayer] is drawn repeatedly. Useful for creating an infinitely scrolling background. If an axis is set to `0`, the [ParallaxLayer] will be drawn only once along that direction. - * - * **Note:** If you want the repetition to pixel-perfect match a [Texture2D] displayed by a child node, you should account for any scale applied to the texture when defining this interval. For example, if you use a child [Sprite2D] scaled to `0.5` to display a 600x600 texture, and want this sprite to be repeated continuously horizontally, you should set the mirroring to `Vector2(300, 0)`. - * - * **Note:** If the length of the viewport axis is bigger than twice the repeated axis size, it will not repeat infinitely, as the parallax layer only draws 2 instances of the layer at any given time. The visibility window is calculated from the parent [ParallaxBackground]'s position, not the layer's own position. So, if you use mirroring, **do not** change the [ParallaxLayer] position relative to its parent. Instead, if you need to adjust the background's position, set the [member CanvasLayer.offset] property in the parent [ParallaxBackground]. - * - * **Note:** Despite the name, the layer will not be mirrored, it will only be repeated. - */ - get motion_mirroring(): Vector2 - set motion_mirroring(value: Vector2) - } - namespace ParticleProcessMaterial { - enum Parameter { - /** Use with [method set_param_min], [method set_param_max], and [method set_param_texture] to set initial velocity properties. */ - PARAM_INITIAL_LINEAR_VELOCITY = 0, - - /** Use with [method set_param_min], [method set_param_max], and [method set_param_texture] to set angular velocity properties. */ - PARAM_ANGULAR_VELOCITY = 1, - - /** Use with [method set_param_min], [method set_param_max], and [method set_param_texture] to set orbital velocity properties. */ - PARAM_ORBIT_VELOCITY = 2, - - /** Use with [method set_param_min], [method set_param_max], and [method set_param_texture] to set linear acceleration properties. */ - PARAM_LINEAR_ACCEL = 3, - - /** Use with [method set_param_min], [method set_param_max], and [method set_param_texture] to set radial acceleration properties. */ - PARAM_RADIAL_ACCEL = 4, - - /** Use with [method set_param_min], [method set_param_max], and [method set_param_texture] to set tangential acceleration properties. */ - PARAM_TANGENTIAL_ACCEL = 5, - - /** Use with [method set_param_min], [method set_param_max], and [method set_param_texture] to set damping properties. */ - PARAM_DAMPING = 6, - - /** Use with [method set_param_min], [method set_param_max], and [method set_param_texture] to set angle properties. */ - PARAM_ANGLE = 7, - - /** Use with [method set_param_min], [method set_param_max], and [method set_param_texture] to set scale properties. */ - PARAM_SCALE = 8, - - /** Use with [method set_param_min], [method set_param_max], and [method set_param_texture] to set hue variation properties. */ - PARAM_HUE_VARIATION = 9, - - /** Use with [method set_param_min], [method set_param_max], and [method set_param_texture] to set animation speed properties. */ - PARAM_ANIM_SPEED = 10, - - /** Use with [method set_param_min], [method set_param_max], and [method set_param_texture] to set animation offset properties. */ - PARAM_ANIM_OFFSET = 11, - - /** Use with [method set_param_min], [method set_param_max], and [method set_param_texture] to set radial velocity properties. */ - PARAM_RADIAL_VELOCITY = 15, - - /** Use with [method set_param_min], [method set_param_max], and [method set_param_texture] to set directional velocity properties. */ - PARAM_DIRECTIONAL_VELOCITY = 16, - - /** Use with [method set_param_min], [method set_param_max], and [method set_param_texture] to set scale over velocity properties. */ - PARAM_SCALE_OVER_VELOCITY = 17, - - /** Represents the size of the [enum Parameter] enum. */ - PARAM_MAX = 18, - - /** Use with [method set_param_min] and [method set_param_max] to set the turbulence minimum und maximum influence on each particles velocity. */ - PARAM_TURB_VEL_INFLUENCE = 13, - - /** Use with [method set_param_min] and [method set_param_max] to set the turbulence minimum and maximum displacement of the particles spawn position. */ - PARAM_TURB_INIT_DISPLACEMENT = 14, - - /** Use with [method set_param_texture] to set the turbulence influence over the particles life time. */ - PARAM_TURB_INFLUENCE_OVER_LIFE = 12, - } - enum ParticleFlags { - /** Use with [method set_particle_flag] to set [member particle_flag_align_y]. */ - PARTICLE_FLAG_ALIGN_Y_TO_VELOCITY = 0, - - /** Use with [method set_particle_flag] to set [member particle_flag_rotate_y]. */ - PARTICLE_FLAG_ROTATE_Y = 1, - - /** Use with [method set_particle_flag] to set [member particle_flag_disable_z]. */ - PARTICLE_FLAG_DISABLE_Z = 2, - PARTICLE_FLAG_DAMPING_AS_FRICTION = 3, - - /** Represents the size of the [enum ParticleFlags] enum. */ - PARTICLE_FLAG_MAX = 4, - } - enum EmissionShape { - /** All particles will be emitted from a single point. */ - EMISSION_SHAPE_POINT = 0, - - /** Particles will be emitted in the volume of a sphere. */ - EMISSION_SHAPE_SPHERE = 1, - - /** Particles will be emitted on the surface of a sphere. */ - EMISSION_SHAPE_SPHERE_SURFACE = 2, - - /** Particles will be emitted in the volume of a box. */ - EMISSION_SHAPE_BOX = 3, - - /** Particles will be emitted at a position determined by sampling a random point on the [member emission_point_texture]. Particle color will be modulated by [member emission_color_texture]. */ - EMISSION_SHAPE_POINTS = 4, - - /** Particles will be emitted at a position determined by sampling a random point on the [member emission_point_texture]. Particle velocity and rotation will be set based on [member emission_normal_texture]. Particle color will be modulated by [member emission_color_texture]. */ - EMISSION_SHAPE_DIRECTED_POINTS = 5, - - /** Particles will be emitted in a ring or cylinder. */ - EMISSION_SHAPE_RING = 6, - - /** Represents the size of the [enum EmissionShape] enum. */ - EMISSION_SHAPE_MAX = 7, - } - enum SubEmitterMode { - SUB_EMITTER_DISABLED = 0, - SUB_EMITTER_CONSTANT = 1, - SUB_EMITTER_AT_END = 2, - SUB_EMITTER_AT_COLLISION = 3, - - /** Represents the size of the [enum SubEmitterMode] enum. */ - SUB_EMITTER_MAX = 4, - } - enum CollisionMode { - /** No collision for particles. Particles will go through [GPUParticlesCollision3D] nodes. */ - COLLISION_DISABLED = 0, - - /** [RigidBody3D]-style collision for particles using [GPUParticlesCollision3D] nodes. */ - COLLISION_RIGID = 1, - - /** Hide particles instantly when colliding with a [GPUParticlesCollision3D] node. This can be combined with a subemitter that uses the [constant COLLISION_RIGID] collision mode to "replace" the parent particle with the subemitter on impact. */ - COLLISION_HIDE_ON_CONTACT = 2, - - /** Represents the size of the [enum CollisionMode] enum. */ - COLLISION_MAX = 3, - } - } - /** Holds a particle configuration for [GPUParticles2D] or [GPUParticles3D] nodes. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_particleprocessmaterial.html - */ - class ParticleProcessMaterial extends Material { - constructor(identifier?: any) - /** Sets the minimum and maximum values of the given [param param]. - * The `x` component of the argument vector corresponds to minimum and the `y` component corresponds to maximum. - */ - set_param(param: ParticleProcessMaterial.Parameter, value: Vector2): void - - /** Returns the minimum and maximum values of the given [param param] as a vector. - * The `x` component of the returned vector corresponds to minimum and the `y` component corresponds to maximum. - */ - get_param(param: ParticleProcessMaterial.Parameter): Vector2 - - /** Sets the minimum value range for the given parameter. */ - set_param_min(param: ParticleProcessMaterial.Parameter, value: float64): void - - /** Returns the minimum value range for the given parameter. */ - get_param_min(param: ParticleProcessMaterial.Parameter): float64 - - /** Sets the maximum value range for the given parameter. */ - set_param_max(param: ParticleProcessMaterial.Parameter, value: float64): void - - /** Returns the maximum value range for the given parameter. */ - get_param_max(param: ParticleProcessMaterial.Parameter): float64 - - /** Sets the [Texture2D] for the specified [enum Parameter]. */ - set_param_texture(param: ParticleProcessMaterial.Parameter, texture: Texture2D): void - - /** Returns the [Texture2D] used by the specified parameter. */ - get_param_texture(param: ParticleProcessMaterial.Parameter): Texture2D - - /** If `true`, enables the specified particle flag. See [enum ParticleFlags] for options. */ - set_particle_flag(particle_flag: ParticleProcessMaterial.ParticleFlags, enable: boolean): void - - /** Returns `true` if the specified particle flag is enabled. See [enum ParticleFlags] for options. */ - get_particle_flag(particle_flag: ParticleProcessMaterial.ParticleFlags): boolean - - /** Particle lifetime randomness ratio. The equation for the lifetime of a particle is `lifetime * (1.0 - randf() * lifetime_randomness)`. For example, a [member lifetime_randomness] of `0.4` scales the lifetime between `0.6` to `1.0` of its original value. */ - get lifetime_randomness(): float64 - set lifetime_randomness(value: float64) - - /** Align Y axis of particle with the direction of its velocity. */ - get particle_flag_align_y(): boolean - set particle_flag_align_y(value: boolean) - - /** If `true`, particles rotate around Y axis by [member angle_min]. */ - get particle_flag_rotate_y(): boolean - set particle_flag_rotate_y(value: boolean) - - /** If `true`, particles will not move on the z axis. */ - get particle_flag_disable_z(): boolean - set particle_flag_disable_z(value: boolean) - - /** Changes the behavior of the damping properties from a linear deceleration to a deceleration based on speed percentage. */ - get particle_flag_damping_as_friction(): boolean - set particle_flag_damping_as_friction(value: boolean) - - /** The offset for the [member emission_shape], in local space. */ - get emission_shape_offset(): Vector3 - set emission_shape_offset(value: Vector3) - - /** The scale of the [member emission_shape], in local space. */ - get emission_shape_scale(): Vector3 - set emission_shape_scale(value: Vector3) - - /** Particles will be emitted inside this region. Use [enum EmissionShape] constants for values. */ - get emission_shape(): int64 - set emission_shape(value: int64) - - /** The sphere's radius if [member emission_shape] is set to [constant EMISSION_SHAPE_SPHERE]. */ - get emission_sphere_radius(): float64 - set emission_sphere_radius(value: float64) - - /** The box's extents if [member emission_shape] is set to [constant EMISSION_SHAPE_BOX]. - * - * **Note:** [member emission_box_extents] starts from the center point and applies the X, Y, and Z values in both directions. The size is twice the area of the extents. - */ - get emission_box_extents(): Vector3 - set emission_box_extents(value: Vector3) - - /** Particles will be emitted at positions determined by sampling this texture at a random position. Used with [constant EMISSION_SHAPE_POINTS] and [constant EMISSION_SHAPE_DIRECTED_POINTS]. Can be created automatically from mesh or node by selecting "Create Emission Points from Mesh/Node" under the "Particles" tool in the toolbar. */ - get emission_point_texture(): Texture2D - set emission_point_texture(value: Texture2D) - - /** Particle velocity and rotation will be set by sampling this texture at the same point as the [member emission_point_texture]. Used only in [constant EMISSION_SHAPE_DIRECTED_POINTS]. Can be created automatically from mesh or node by selecting "Create Emission Points from Mesh/Node" under the "Particles" tool in the toolbar. */ - get emission_normal_texture(): Texture2D - set emission_normal_texture(value: Texture2D) - - /** Particle color will be modulated by color determined by sampling this texture at the same point as the [member emission_point_texture]. - * - * **Note:** [member emission_color_texture] multiplies the particle mesh's vertex colors. To have a visible effect on a [BaseMaterial3D], [member BaseMaterial3D.vertex_color_use_as_albedo] *must* be `true`. For a [ShaderMaterial], `ALBEDO *= COLOR.rgb;` must be inserted in the shader's `fragment()` function. Otherwise, [member emission_color_texture] will have no visible effect. - */ - get emission_color_texture(): Texture2D - set emission_color_texture(value: Texture2D) - - /** The number of emission points if [member emission_shape] is set to [constant EMISSION_SHAPE_POINTS] or [constant EMISSION_SHAPE_DIRECTED_POINTS]. */ - get emission_point_count(): int64 - set emission_point_count(value: int64) - - /** The axis of the ring when using the emitter [constant EMISSION_SHAPE_RING]. */ - get emission_ring_axis(): Vector3 - set emission_ring_axis(value: Vector3) - - /** The height of the ring when using the emitter [constant EMISSION_SHAPE_RING]. */ - get emission_ring_height(): float64 - set emission_ring_height(value: float64) - - /** The radius of the ring when using the emitter [constant EMISSION_SHAPE_RING]. */ - get emission_ring_radius(): float64 - set emission_ring_radius(value: float64) - - /** The inner radius of the ring when using the emitter [constant EMISSION_SHAPE_RING]. */ - get emission_ring_inner_radius(): float64 - set emission_ring_inner_radius(value: float64) - get angle(): Vector2 - set angle(value: Vector2) - - /** Minimum equivalent of [member angle_max]. */ - get angle_min(): float64 - set angle_min(value: float64) - - /** Maximum initial rotation applied to each particle, in degrees. - * Only applied when [member particle_flag_disable_z] or [member particle_flag_rotate_y] are `true` or the [BaseMaterial3D] being used to draw the particle is using [constant BaseMaterial3D.BILLBOARD_PARTICLES]. - */ - get angle_max(): float64 - set angle_max(value: float64) - - /** Each particle's rotation will be animated along this [CurveTexture]. */ - get angle_curve(): CurveTexture - set angle_curve(value: CurveTexture) - - /** Percentage of the velocity of the respective [GPUParticles2D] or [GPUParticles3D] inherited by each particle when spawning. */ - get inherit_velocity_ratio(): float64 - set inherit_velocity_ratio(value: float64) - - /** A pivot point used to calculate radial and orbital velocity of particles. */ - get velocity_pivot(): Vector3 - set velocity_pivot(value: Vector3) - - /** Unit vector specifying the particles' emission direction. */ - get direction(): Vector3 - set direction(value: Vector3) - - /** Each particle's initial direction range from `+spread` to `-spread` degrees. */ - get spread(): float64 - set spread(value: float64) - - /** Amount of [member spread] along the Y axis. */ - get flatness(): float64 - set flatness(value: float64) - get initial_velocity(): Vector2 - set initial_velocity(value: Vector2) - - /** Minimum equivalent of [member initial_velocity_max]. */ - get initial_velocity_min(): float64 - set initial_velocity_min(value: float64) - - /** Maximum initial velocity magnitude for each particle. Direction comes from [member direction] and [member spread]. */ - get initial_velocity_max(): float64 - set initial_velocity_max(value: float64) - get angular_velocity(): Vector2 - set angular_velocity(value: Vector2) - - /** Minimum equivalent of [member angular_velocity_max]. */ - get angular_velocity_min(): float64 - set angular_velocity_min(value: float64) - - /** Maximum initial angular velocity (rotation speed) applied to each particle in *degrees* per second. - * Only applied when [member particle_flag_disable_z] or [member particle_flag_rotate_y] are `true` or the [BaseMaterial3D] being used to draw the particle is using [constant BaseMaterial3D.BILLBOARD_PARTICLES]. - */ - get angular_velocity_max(): float64 - set angular_velocity_max(value: float64) - - /** Each particle's angular velocity (rotation speed) will vary along this [CurveTexture] over its lifetime. */ - get angular_velocity_curve(): CurveTexture - set angular_velocity_curve(value: CurveTexture) - get directional_velocity(): Vector2 - set directional_velocity(value: Vector2) - - /** Minimum directional velocity value, which is multiplied by [member directional_velocity_curve]. - * - * **Note:** Animated velocities will not be affected by damping, use [member velocity_limit_curve] instead. - */ - get directional_velocity_min(): float64 - set directional_velocity_min(value: float64) - - /** Maximum directional velocity value, which is multiplied by [member directional_velocity_curve]. - * - * **Note:** Animated velocities will not be affected by damping, use [member velocity_limit_curve] instead. - */ - get directional_velocity_max(): float64 - set directional_velocity_max(value: float64) - - /** A curve that specifies the velocity along each of the axes of the particle system along its lifetime. - * - * **Note:** Animated velocities will not be affected by damping, use [member velocity_limit_curve] instead. - */ - get directional_velocity_curve(): CurveXYZTexture - set directional_velocity_curve(value: CurveXYZTexture) - get orbit_velocity(): Vector2 - set orbit_velocity(value: Vector2) - - /** Minimum equivalent of [member orbit_velocity_max]. - * - * **Note:** Animated velocities will not be affected by damping, use [member velocity_limit_curve] instead. - */ - get orbit_velocity_min(): float64 - set orbit_velocity_min(value: float64) - - /** Maximum orbital velocity applied to each particle. Makes the particles circle around origin. Specified in number of full rotations around origin per second. - * - * **Note:** Animated velocities will not be affected by damping, use [member velocity_limit_curve] instead. - */ - get orbit_velocity_max(): float64 - set orbit_velocity_max(value: float64) - - /** Each particle's orbital velocity will vary along this [CurveTexture]. - * - * **Note:** For 3D orbital velocity, use a [CurveXYZTexture]. - * - * **Note:** Animated velocities will not be affected by damping, use [member velocity_limit_curve] instead. - */ - get orbit_velocity_curve(): CurveTexture | CurveXYZTexture - set orbit_velocity_curve(value: CurveTexture | CurveXYZTexture) - get radial_velocity(): Vector2 - set radial_velocity(value: Vector2) - - /** Minimum radial velocity applied to each particle. Makes particles move away from the [member velocity_pivot], or toward it if negative. - * - * **Note:** Animated velocities will not be affected by damping, use [member velocity_limit_curve] instead. - */ - get radial_velocity_min(): float64 - set radial_velocity_min(value: float64) - - /** Maximum radial velocity applied to each particle. Makes particles move away from the [member velocity_pivot], or toward it if negative. - * - * **Note:** Animated velocities will not be affected by damping, use [member velocity_limit_curve] instead. - */ - get radial_velocity_max(): float64 - set radial_velocity_max(value: float64) - - /** A [CurveTexture] that defines the velocity over the particle's lifetime away (or toward) the [member velocity_pivot]. - * - * **Note:** Animated velocities will not be affected by damping, use [member velocity_limit_curve] instead. - */ - get radial_velocity_curve(): CurveTexture - set radial_velocity_curve(value: CurveTexture) - - /** A [CurveTexture] that defines the maximum velocity of a particle during its lifetime. */ - get velocity_limit_curve(): CurveTexture - set velocity_limit_curve(value: CurveTexture) - - /** Gravity applied to every particle. */ - get gravity(): Vector3 - set gravity(value: Vector3) - get linear_accel(): Vector2 - set linear_accel(value: Vector2) - - /** Minimum equivalent of [member linear_accel_max]. */ - get linear_accel_min(): float64 - set linear_accel_min(value: float64) - - /** Maximum linear acceleration applied to each particle in the direction of motion. */ - get linear_accel_max(): float64 - set linear_accel_max(value: float64) - - /** Each particle's linear acceleration will vary along this [CurveTexture]. */ - get linear_accel_curve(): CurveTexture - set linear_accel_curve(value: CurveTexture) - get radial_accel(): Vector2 - set radial_accel(value: Vector2) - - /** Minimum equivalent of [member radial_accel_max]. */ - get radial_accel_min(): float64 - set radial_accel_min(value: float64) - - /** Maximum radial acceleration applied to each particle. Makes particle accelerate away from the origin or towards it if negative. */ - get radial_accel_max(): float64 - set radial_accel_max(value: float64) - - /** Each particle's radial acceleration will vary along this [CurveTexture]. */ - get radial_accel_curve(): CurveTexture - set radial_accel_curve(value: CurveTexture) - get tangential_accel(): Vector2 - set tangential_accel(value: Vector2) - - /** Minimum equivalent of [member tangential_accel_max]. */ - get tangential_accel_min(): float64 - set tangential_accel_min(value: float64) - - /** Maximum tangential acceleration applied to each particle. Tangential acceleration is perpendicular to the particle's velocity giving the particles a swirling motion. */ - get tangential_accel_max(): float64 - set tangential_accel_max(value: float64) - - /** Each particle's tangential acceleration will vary along this [CurveTexture]. */ - get tangential_accel_curve(): CurveTexture - set tangential_accel_curve(value: CurveTexture) - get damping(): Vector2 - set damping(value: Vector2) - - /** Minimum equivalent of [member damping_max]. */ - get damping_min(): float64 - set damping_min(value: float64) - - /** The maximum rate at which particles lose velocity. For example value of `100` means that the particle will go from `100` velocity to `0` in `1` second. */ - get damping_max(): float64 - set damping_max(value: float64) - - /** Damping will vary along this [CurveTexture]. */ - get damping_curve(): CurveTexture - set damping_curve(value: CurveTexture) - - /** If `true`, interaction with particle attractors is enabled. In 3D, attraction only occurs within the area defined by the [GPUParticles3D] node's [member GPUParticles3D.visibility_aabb]. */ - get attractor_interaction_enabled(): boolean - set attractor_interaction_enabled(value: boolean) - get scale(): Vector2 - set scale(value: Vector2) - - /** Minimum equivalent of [member scale_max]. */ - get scale_min(): float64 - set scale_min(value: float64) - - /** Maximum initial scale applied to each particle. */ - get scale_max(): float64 - set scale_max(value: float64) - - /** Each particle's scale will vary along this [CurveTexture] over its lifetime. If a [CurveXYZTexture] is supplied instead, the scale will be separated per-axis. */ - get scale_curve(): CurveTexture | CurveXYZTexture - set scale_curve(value: CurveTexture | CurveXYZTexture) - get scale_over_velocity(): Vector2 - set scale_over_velocity(value: Vector2) - - /** Minimum velocity value reference for [member scale_over_velocity_curve]. - * [member scale_over_velocity_curve] will be interpolated between [member scale_over_velocity_min] and [member scale_over_velocity_max]. - */ - get scale_over_velocity_min(): float64 - set scale_over_velocity_min(value: float64) - - /** Maximum velocity value reference for [member scale_over_velocity_curve]. - * [member scale_over_velocity_curve] will be interpolated between [member scale_over_velocity_min] and [member scale_over_velocity_max]. - */ - get scale_over_velocity_max(): float64 - set scale_over_velocity_max(value: float64) - - /** Either a [CurveTexture] or a [CurveXYZTexture] that scales each particle based on its velocity. */ - get scale_over_velocity_curve(): CurveTexture | CurveXYZTexture - set scale_over_velocity_curve(value: CurveTexture | CurveXYZTexture) - - /** Each particle's initial color. If the [GPUParticles2D]'s `texture` is defined, it will be multiplied by this color. - * - * **Note:** [member color] multiplies the particle mesh's vertex colors. To have a visible effect on a [BaseMaterial3D], [member BaseMaterial3D.vertex_color_use_as_albedo] *must* be `true`. For a [ShaderMaterial], `ALBEDO *= COLOR.rgb;` must be inserted in the shader's `fragment()` function. Otherwise, [member color] will have no visible effect. - */ - get color(): Color - set color(value: Color) - - /** Each particle's color will vary along this [GradientTexture1D] over its lifetime (multiplied with [member color]). - * - * **Note:** [member color_ramp] multiplies the particle mesh's vertex colors. To have a visible effect on a [BaseMaterial3D], [member BaseMaterial3D.vertex_color_use_as_albedo] *must* be `true`. For a [ShaderMaterial], `ALBEDO *= COLOR.rgb;` must be inserted in the shader's `fragment()` function. Otherwise, [member color_ramp] will have no visible effect. - */ - get color_ramp(): GradientTexture1D - set color_ramp(value: GradientTexture1D) - - /** Each particle's initial color will vary along this [GradientTexture1D] (multiplied with [member color]). - * - * **Note:** [member color_initial_ramp] multiplies the particle mesh's vertex colors. To have a visible effect on a [BaseMaterial3D], [member BaseMaterial3D.vertex_color_use_as_albedo] *must* be `true`. For a [ShaderMaterial], `ALBEDO *= COLOR.rgb;` must be inserted in the shader's `fragment()` function. Otherwise, [member color_initial_ramp] will have no visible effect. - */ - get color_initial_ramp(): GradientTexture1D - set color_initial_ramp(value: GradientTexture1D) - - /** The alpha value of each particle's color will be multiplied by this [CurveTexture] over its lifetime. */ - get alpha_curve(): CurveTexture - set alpha_curve(value: CurveTexture) - - /** Each particle's color will be multiplied by this [CurveTexture] over its lifetime. - * - * **Note:** This property won't have a visible effect unless the render material is marked as unshaded. - */ - get emission_curve(): CurveTexture - set emission_curve(value: CurveTexture) - get hue_variation(): Vector2 - set hue_variation(value: Vector2) - - /** Minimum equivalent of [member hue_variation_max]. */ - get hue_variation_min(): float64 - set hue_variation_min(value: float64) - - /** Maximum initial hue variation applied to each particle. It will shift the particle color's hue. */ - get hue_variation_max(): float64 - set hue_variation_max(value: float64) - - /** Each particle's hue will vary along this [CurveTexture]. */ - get hue_variation_curve(): CurveTexture - set hue_variation_curve(value: CurveTexture) - get anim_speed(): Vector2 - set anim_speed(value: Vector2) - - /** Minimum equivalent of [member anim_speed_max]. */ - get anim_speed_min(): float64 - set anim_speed_min(value: float64) - - /** Maximum particle animation speed. Animation speed of `1` means that the particles will make full `0` to `1` offset cycle during lifetime, `2` means `2` cycles etc. - * With animation speed greater than `1`, remember to enable [member CanvasItemMaterial.particles_anim_loop] property if you want the animation to repeat. - */ - get anim_speed_max(): float64 - set anim_speed_max(value: float64) - - /** Each particle's animation speed will vary along this [CurveTexture]. */ - get anim_speed_curve(): CurveTexture - set anim_speed_curve(value: CurveTexture) - get anim_offset(): Vector2 - set anim_offset(value: Vector2) - - /** Minimum equivalent of [member anim_offset_max]. */ - get anim_offset_min(): float64 - set anim_offset_min(value: float64) - - /** Maximum animation offset that corresponds to frame index in the texture. `0` is the first frame, `1` is the last one. See [member CanvasItemMaterial.particles_animation]. */ - get anim_offset_max(): float64 - set anim_offset_max(value: float64) - - /** Each particle's animation offset will vary along this [CurveTexture]. */ - get anim_offset_curve(): CurveTexture - set anim_offset_curve(value: CurveTexture) - - /** If `true`, enables turbulence for the particle system. Turbulence can be used to vary particle movement according to its position (based on a 3D noise pattern). In 3D, [GPUParticlesAttractorVectorField3D] with [NoiseTexture3D] can be used as an alternative to turbulence that works in world space and with multiple particle systems reacting in the same way. - * - * **Note:** Enabling turbulence has a high performance cost on the GPU. Only enable turbulence on a few particle systems at once at most, and consider disabling it when targeting mobile/web platforms. - */ - get turbulence_enabled(): boolean - set turbulence_enabled(value: boolean) - - /** The turbulence noise strength. Increasing this will result in a stronger, more contrasting, flow pattern. */ - get turbulence_noise_strength(): float64 - set turbulence_noise_strength(value: float64) - - /** This value controls the overall scale/frequency of the turbulence noise pattern. - * A small scale will result in smaller features with more detail while a high scale will result in smoother noise with larger features. - */ - get turbulence_noise_scale(): float64 - set turbulence_noise_scale(value: float64) - - /** A scrolling velocity for the turbulence field. This sets a directional trend for the pattern to move in over time. - * The default value of `Vector3(0, 0, 0)` turns off the scrolling. - */ - get turbulence_noise_speed(): Vector3 - set turbulence_noise_speed(value: Vector3) - - /** The in-place rate of change of the turbulence field. This defines how quickly the noise pattern varies over time. - * A value of 0.0 will result in a fixed pattern. - */ - get turbulence_noise_speed_random(): float64 - set turbulence_noise_speed_random(value: float64) - get turbulence_influence(): Vector2 - set turbulence_influence(value: Vector2) - - /** Minimum turbulence influence on each particle. - * The actual amount of turbulence influence on each particle is calculated as a random value between [member turbulence_influence_min] and [member turbulence_influence_max] and multiplied by the amount of turbulence influence from [member turbulence_influence_over_life]. - */ - get turbulence_influence_min(): float64 - set turbulence_influence_min(value: float64) - - /** Maximum turbulence influence on each particle. - * The actual amount of turbulence influence on each particle is calculated as a random value between [member turbulence_influence_min] and [member turbulence_influence_max] and multiplied by the amount of turbulence influence from [member turbulence_influence_over_life]. - */ - get turbulence_influence_max(): float64 - set turbulence_influence_max(value: float64) - get turbulence_initial_displacement(): Vector2 - set turbulence_initial_displacement(value: Vector2) - - /** Minimum displacement of each particle's spawn position by the turbulence. - * The actual amount of displacement will be a factor of the underlying turbulence multiplied by a random value between [member turbulence_initial_displacement_min] and [member turbulence_initial_displacement_max]. - */ - get turbulence_initial_displacement_min(): float64 - set turbulence_initial_displacement_min(value: float64) - - /** Maximum displacement of each particle's spawn position by the turbulence. - * The actual amount of displacement will be a factor of the underlying turbulence multiplied by a random value between [member turbulence_initial_displacement_min] and [member turbulence_initial_displacement_max]. - */ - get turbulence_initial_displacement_max(): float64 - set turbulence_initial_displacement_max(value: float64) - - /** Each particle's amount of turbulence will be influenced along this [CurveTexture] over its life time. */ - get turbulence_influence_over_life(): CurveTexture - set turbulence_influence_over_life(value: CurveTexture) - - /** The particles' collision mode. - * - * **Note:** 3D Particles can only collide with [GPUParticlesCollision3D] nodes, not [PhysicsBody3D] nodes. To make particles collide with various objects, you can add [GPUParticlesCollision3D] nodes as children of [PhysicsBody3D] nodes. In 3D, collisions only occur within the area defined by the [GPUParticles3D] node's [member GPUParticles3D.visibility_aabb]. - * - * **Note:** 2D Particles can only collide with [LightOccluder2D] nodes, not [PhysicsBody2D] nodes. - */ - get collision_mode(): int64 - set collision_mode(value: int64) - - /** The particles' friction. Values range from `0` (frictionless) to `1` (maximum friction). Only effective if [member collision_mode] is [constant COLLISION_RIGID]. */ - get collision_friction(): float64 - set collision_friction(value: float64) - - /** The particles' bounciness. Values range from `0` (no bounce) to `1` (full bounciness). Only effective if [member collision_mode] is [constant COLLISION_RIGID]. */ - get collision_bounce(): float64 - set collision_bounce(value: float64) - - /** If `true`, [member GPUParticles3D.collision_base_size] is multiplied by the particle's effective scale (see [member scale_min], [member scale_max], [member scale_curve], and [member scale_over_velocity_curve]). */ - get collision_use_scale(): boolean - set collision_use_scale(value: boolean) - - /** The particle subemitter mode (see [member GPUParticles2D.sub_emitter] and [member GPUParticles3D.sub_emitter]). */ - get sub_emitter_mode(): int64 - set sub_emitter_mode(value: int64) - - /** The frequency at which particles should be emitted from the subemitter node. One particle will be spawned every [member sub_emitter_frequency] seconds. - * - * **Note:** This value shouldn't exceed [member GPUParticles2D.amount] or [member GPUParticles3D.amount] defined on the *subemitter node* (not the main node), relative to the subemitter's particle lifetime. If the number of particles is exceeded, no new particles will spawn from the subemitter until enough particles have expired. - */ - get sub_emitter_frequency(): float64 - set sub_emitter_frequency(value: float64) - - /** The amount of particles to spawn from the subemitter node when the particle expires. - * - * **Note:** This value shouldn't exceed [member GPUParticles2D.amount] or [member GPUParticles3D.amount] defined on the *subemitter node* (not the main node), relative to the subemitter's particle lifetime. If the number of particles is exceeded, no new particles will spawn from the subemitter until enough particles have expired. - */ - get sub_emitter_amount_at_end(): int64 - set sub_emitter_amount_at_end(value: int64) - - /** The amount of particles to spawn from the subemitter node when a collision occurs. When combined with [constant COLLISION_HIDE_ON_CONTACT] on the main particles material, this can be used to achieve effects such as raindrops hitting the ground. - * - * **Note:** This value shouldn't exceed [member GPUParticles2D.amount] or [member GPUParticles3D.amount] defined on the *subemitter node* (not the main node), relative to the subemitter's particle lifetime. If the number of particles is exceeded, no new particles will spawn from the subemitter until enough particles have expired. - */ - get sub_emitter_amount_at_collision(): int64 - set sub_emitter_amount_at_collision(value: int64) - - /** If `true`, the subemitter inherits the parent particle's velocity when it spawns. */ - get sub_emitter_keep_velocity(): boolean - set sub_emitter_keep_velocity(value: boolean) - } - class ParticleProcessMaterialConversionPlugin extends EditorResourceConversionPlugin { - constructor(identifier?: any) - } - /** Contains a [Curve2D] path for [PathFollow2D] nodes to follow. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_path2d.html - */ - class Path2D extends Node2D { - constructor(identifier?: any) - /** A [Curve2D] describing the path. */ - get curve(): Curve2D - set curve(value: Curve2D) - } - class Path2DEditor extends HBoxContainer { - constructor(identifier?: any) - _clear_curve_points(_unnamed_arg0: Path2D): void - _restore_curve_points(_unnamed_arg0: Path2D, _unnamed_arg1: PackedVector2Array | Vector2[]): void - } - class Path2DEditorPlugin extends EditorPlugin { - constructor(identifier?: any) - } - /** Contains a [Curve3D] path for [PathFollow3D] nodes to follow. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_path3d.html - */ - class Path3D extends Node3D { - constructor(identifier?: any) - /** A [Curve3D] describing the path. */ - get curve(): Curve3D - set curve(value: Curve3D) - - /** Emitted when the [member curve] changes. */ - readonly curve_changed: Signal0 - } - class Path3DEditorPlugin extends EditorPlugin { - constructor(identifier?: any) - _clear_curve_points(): void - _restore_curve_points(_unnamed_arg0: PackedVector3Array | Vector3[]): void - } - class Path3DGizmoPlugin extends EditorNode3DGizmoPlugin { - constructor(identifier?: any) - } - /** Point sampler for a [Path2D]. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_pathfollow2d.html - */ - class PathFollow2D extends Node2D { - constructor(identifier?: any) - /** The distance along the path, in pixels. Changing this value sets this node's position to a point within the path. */ - get progress(): float64 - set progress(value: float64) - - /** The distance along the path as a number in the range 0.0 (for the first vertex) to 1.0 (for the last). This is just another way of expressing the progress within the path, as the offset supplied is multiplied internally by the path's length. */ - get progress_ratio(): float64 - set progress_ratio(value: float64) - - /** The node's offset along the curve. */ - get h_offset(): float64 - set h_offset(value: float64) - - /** The node's offset perpendicular to the curve. */ - get v_offset(): float64 - set v_offset(value: float64) - - /** If `true`, this node rotates to follow the path, with the +X direction facing forward on the path. */ - get rotates(): boolean - set rotates(value: boolean) - - /** If `true`, the position between two cached points is interpolated cubically, and linearly otherwise. - * The points along the [Curve2D] of the [Path2D] are precomputed before use, for faster calculations. The point at the requested offset is then calculated interpolating between two adjacent cached points. This may present a problem if the curve makes sharp turns, as the cached points may not follow the curve closely enough. - * There are two answers to this problem: either increase the number of cached points and increase memory consumption, or make a cubic interpolation between two points at the cost of (slightly) slower calculations. - */ - get cubic_interp(): boolean - set cubic_interp(value: boolean) - - /** If `true`, any offset outside the path's length will wrap around, instead of stopping at the ends. Use it for cyclic paths. */ - get loop(): boolean - set loop(value: boolean) - } - namespace PathFollow3D { - enum RotationMode { - /** Forbids the PathFollow3D to rotate. */ - ROTATION_NONE = 0, - - /** Allows the PathFollow3D to rotate in the Y axis only. */ - ROTATION_Y = 1, - - /** Allows the PathFollow3D to rotate in both the X, and Y axes. */ - ROTATION_XY = 2, - - /** Allows the PathFollow3D to rotate in any axis. */ - ROTATION_XYZ = 3, - - /** Uses the up vector information in a [Curve3D] to enforce orientation. This rotation mode requires the [Path3D]'s [member Curve3D.up_vector_enabled] property to be set to `true`. */ - ROTATION_ORIENTED = 4, - } - } - /** Point sampler for a [Path3D]. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_pathfollow3d.html - */ - class PathFollow3D extends Node3D { - constructor(identifier?: any) - /** Correct the [param transform]. [param rotation_mode] implicitly specifies how posture (forward, up and sideway direction) is calculated. */ - static correct_posture(transform: Transform3D, rotation_mode: PathFollow3D.RotationMode): Transform3D - - /** The distance from the first vertex, measured in 3D units along the path. Changing this value sets this node's position to a point within the path. */ - get progress(): float64 - set progress(value: float64) - - /** The distance from the first vertex, considering 0.0 as the first vertex and 1.0 as the last. This is just another way of expressing the progress within the path, as the progress supplied is multiplied internally by the path's length. */ - get progress_ratio(): float64 - set progress_ratio(value: float64) - - /** The node's offset along the curve. */ - get h_offset(): float64 - set h_offset(value: float64) - - /** The node's offset perpendicular to the curve. */ - get v_offset(): float64 - set v_offset(value: float64) - - /** Allows or forbids rotation on one or more axes, depending on the [enum RotationMode] constants being used. */ - get rotation_mode(): int64 - set rotation_mode(value: int64) - - /** If `true`, the node moves on the travel path with orienting the +Z axis as forward. See also [constant Vector3.FORWARD] and [constant Vector3.MODEL_FRONT]. */ - get use_model_front(): boolean - set use_model_front(value: boolean) - - /** If `true`, the position between two cached points is interpolated cubically, and linearly otherwise. - * The points along the [Curve3D] of the [Path3D] are precomputed before use, for faster calculations. The point at the requested offset is then calculated interpolating between two adjacent cached points. This may present a problem if the curve makes sharp turns, as the cached points may not follow the curve closely enough. - * There are two answers to this problem: either increase the number of cached points and increase memory consumption, or make a cubic interpolation between two points at the cost of (slightly) slower calculations. - */ - get cubic_interp(): boolean - set cubic_interp(value: boolean) - - /** If `true`, any offset outside the path's length will wrap around, instead of stopping at the ends. Use it for cyclic paths. */ - get loop(): boolean - set loop(value: boolean) - - /** If `true`, the tilt property of [Curve3D] takes effect. */ - get tilt_enabled(): boolean - set tilt_enabled(value: boolean) - } - /** A [RigidBody2D]-derived node used to make [Bone2D]s in a [Skeleton2D] react to physics. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_physicalbone2d.html - */ - class PhysicalBone2D extends RigidBody2D { - constructor(identifier?: any) - /** Returns the first [Joint2D] child node, if one exists. This is mainly a helper function to make it easier to get the [Joint2D] that the [PhysicalBone2D] is autoconfiguring. */ - get_joint(): Joint2D - - /** Returns a boolean that indicates whether the [PhysicalBone2D] is running and simulating using the Godot 2D physics engine. When `true`, the PhysicalBone2D node is using physics. */ - is_simulating_physics(): boolean - - /** The [NodePath] to the [Bone2D] that this [PhysicalBone2D] should simulate. */ - get bone2d_nodepath(): NodePath - set bone2d_nodepath(value: NodePath | string) - - /** The index of the [Bone2D] that this [PhysicalBone2D] should simulate. */ - get bone2d_index(): int64 - set bone2d_index(value: int64) - - /** If `true`, the [PhysicalBone2D] will automatically configure the first [Joint2D] child node. The automatic configuration is limited to setting up the node properties and positioning the [Joint2D]. */ - get auto_configure_joint(): boolean - set auto_configure_joint(value: boolean) - - /** If `true`, the [PhysicalBone2D] will start simulating using physics. If `false`, the [PhysicalBone2D] will follow the transform of the [Bone2D] node. - * - * **Note:** To have the [Bone2D]s visually follow the [PhysicalBone2D], use a [SkeletonModification2DPhysicalBones] modification on the [Skeleton2D] node with the [Bone2D] nodes. - */ - get simulate_physics(): boolean - set simulate_physics(value: boolean) - - /** If `true`, the [PhysicalBone2D] will keep the transform of the bone it is bound to when simulating physics. */ - get follow_bone_when_simulating(): boolean - set follow_bone_when_simulating(value: boolean) - } - namespace PhysicalBone3D { - enum DampMode { - /** In this mode, the body's damping value is added to any value set in areas or the default value. */ - DAMP_MODE_COMBINE = 0, - - /** In this mode, the body's damping value replaces any value set in areas or the default value. */ - DAMP_MODE_REPLACE = 1, - } - enum JointType { - JOINT_TYPE_NONE = 0, - JOINT_TYPE_PIN = 1, - JOINT_TYPE_CONE = 2, - JOINT_TYPE_HINGE = 3, - JOINT_TYPE_SLIDER = 4, - JOINT_TYPE_6DOF = 5, - } - } - /** A physics body used to make bones in a [Skeleton3D] react to physics. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_physicalbone3d.html - */ - class PhysicalBone3D extends PhysicsBody3D { - constructor(identifier?: any) - /** Called during physics processing, allowing you to read and safely modify the simulation state for the object. By default, it is called before the standard force integration, but the [member custom_integrator] property allows you to disable the standard force integration and do fully custom force integration for a body. */ - /* gdvirtual */ _integrate_forces(state: PhysicsDirectBodyState3D): void - apply_central_impulse(impulse: Vector3): void - apply_impulse(impulse: Vector3, position: Vector3 = new Vector3(0, 0, 0)): void - get_simulate_physics(): boolean - is_simulating_physics(): boolean - get_bone_id(): int64 - - /** Sets the joint type. See [enum JointType] for possible values. */ - get joint_type(): int64 - set joint_type(value: int64) - - /** Sets the joint's transform. */ - get joint_offset(): Transform3D - set joint_offset(value: Transform3D) - - /** Sets the joint's rotation in radians. */ - get joint_rotation(): Vector3 - set joint_rotation(value: Vector3) - - /** Sets the body's transform. */ - get body_offset(): Transform3D - set body_offset(value: Transform3D) - - /** The body's mass. */ - get mass(): float64 - set mass(value: float64) - - /** The body's friction, from `0` (frictionless) to `1` (max friction). */ - get friction(): float64 - set friction(value: float64) - - /** The body's bounciness. Values range from `0` (no bounce) to `1` (full bounciness). - * - * **Note:** Even with [member bounce] set to `1.0`, some energy will be lost over time due to linear and angular damping. To have a [PhysicalBone3D] that preserves all its energy over time, set [member bounce] to `1.0`, [member linear_damp_mode] to [constant DAMP_MODE_REPLACE], [member linear_damp] to `0.0`, [member angular_damp_mode] to [constant DAMP_MODE_REPLACE], and [member angular_damp] to `0.0`. - */ - get bounce(): float64 - set bounce(value: float64) - - /** This is multiplied by the global 3D gravity setting found in **Project > Project Settings > Physics > 3d** to produce the body's gravity. For example, a value of 1 will be normal gravity, 2 will apply double gravity, and 0.5 will apply half gravity to this object. */ - get gravity_scale(): float64 - set gravity_scale(value: float64) - - /** If `true`, the standard force integration (like gravity or damping) will be disabled for this body. Other than collision response, the body will only move as determined by the [method _integrate_forces] method, if that virtual method is overridden. - * Setting this property will call the method [method PhysicsServer3D.body_set_omit_force_integration] internally. - */ - get custom_integrator(): boolean - set custom_integrator(value: boolean) - - /** Defines how [member linear_damp] is applied. See [enum DampMode] for possible values. */ - get linear_damp_mode(): int64 - set linear_damp_mode(value: int64) - - /** Damps the body's movement. By default, the body will use the **Default Linear Damp** in **Project > Project Settings > Physics > 3d** or any value override set by an [Area3D] the body is in. Depending on [member linear_damp_mode], you can set [member linear_damp] to be added to or to replace the body's damping value. - * See [member ProjectSettings.physics/3d/default_linear_damp] for more details about damping. - */ - get linear_damp(): float64 - set linear_damp(value: float64) - - /** Defines how [member angular_damp] is applied. See [enum DampMode] for possible values. */ - get angular_damp_mode(): int64 - set angular_damp_mode(value: int64) - - /** Damps the body's rotation. By default, the body will use the **Default Angular Damp** in **Project > Project Settings > Physics > 3d** or any value override set by an [Area3D] the body is in. Depending on [member angular_damp_mode], you can set [member angular_damp] to be added to or to replace the body's damping value. - * See [member ProjectSettings.physics/3d/default_angular_damp] for more details about damping. - */ - get angular_damp(): float64 - set angular_damp(value: float64) - - /** The body's linear velocity in units per second. Can be used sporadically, but **don't set this every frame**, because physics may run in another thread and runs at a different granularity. Use [method _integrate_forces] as your process loop for precise control of the body state. */ - get linear_velocity(): Vector3 - set linear_velocity(value: Vector3) - - /** The PhysicalBone3D's rotational velocity in *radians* per second. */ - get angular_velocity(): Vector3 - set angular_velocity(value: Vector3) - - /** If `true`, the body is deactivated when there is no movement, so it will not take part in the simulation until it is awakened by an external force. */ - get can_sleep(): boolean - set can_sleep(value: boolean) - } - class PhysicalBone3DEditorPlugin extends EditorPlugin { - constructor(identifier?: any) - } - class PhysicalBone3DGizmoPlugin extends EditorNode3DGizmoPlugin { - constructor(identifier?: any) - } - /** Node that can be the parent of [PhysicalBone3D] and can apply the simulation results to [Skeleton3D]. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_physicalbonesimulator3d.html - */ - class PhysicalBoneSimulator3D extends SkeletonModifier3D { - constructor(identifier?: any) - /** Returns a boolean that indicates whether the [PhysicalBoneSimulator3D] is running and simulating. */ - is_simulating_physics(): boolean - - /** Tells the [PhysicalBone3D] nodes in the Skeleton to stop simulating. */ - physical_bones_stop_simulation(): void - - /** Tells the [PhysicalBone3D] nodes in the Skeleton to start simulating and reacting to the physics world. - * Optionally, a list of bone names can be passed-in, allowing only the passed-in bones to be simulated. - */ - physical_bones_start_simulation(bones: GArray = []): void - - /** Adds a collision exception to the physical bone. - * Works just like the [RigidBody3D] node. - */ - physical_bones_add_collision_exception(exception: RID): void - - /** Removes a collision exception to the physical bone. - * Works just like the [RigidBody3D] node. - */ - physical_bones_remove_collision_exception(exception: RID): void - } - /** A material that defines a sky for a [Sky] resource by a set of physical properties. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_physicalskymaterial.html - */ - class PhysicalSkyMaterial extends Material { - constructor(identifier?: any) - /** Controls the strength of the [url=https://en.wikipedia.org/wiki/Rayleigh_scattering]Rayleigh scattering[/url]. Rayleigh scattering results from light colliding with small particles. It is responsible for the blue color of the sky. */ - get rayleigh_coefficient(): float64 - set rayleigh_coefficient(value: float64) - - /** Controls the [Color] of the [url=https://en.wikipedia.org/wiki/Rayleigh_scattering]Rayleigh scattering[/url]. While not physically accurate, this allows for the creation of alien-looking planets. For example, setting this to a red [Color] results in a Mars-looking atmosphere with a corresponding blue sunset. */ - get rayleigh_color(): Color - set rayleigh_color(value: Color) - - /** Controls the strength of [url=https://en.wikipedia.org/wiki/Mie_scattering]Mie scattering[/url] for the sky. Mie scattering results from light colliding with larger particles (like water). On earth, Mie scattering results in a whitish color around the sun and horizon. */ - get mie_coefficient(): float64 - set mie_coefficient(value: float64) - - /** Controls the direction of the [url=https://en.wikipedia.org/wiki/Mie_scattering]Mie scattering[/url]. A value of `1` means that when light hits a particle it's passing through straight forward. A value of `-1` means that all light is scatter backwards. */ - get mie_eccentricity(): float64 - set mie_eccentricity(value: float64) - - /** Controls the [Color] of the [url=https://en.wikipedia.org/wiki/Mie_scattering]Mie scattering[/url] effect. While not physically accurate, this allows for the creation of alien-looking planets. */ - get mie_color(): Color - set mie_color(value: Color) - - /** Sets the thickness of the atmosphere. High turbidity creates a foggy-looking atmosphere, while a low turbidity results in a clearer atmosphere. */ - get turbidity(): float64 - set turbidity(value: float64) - - /** Sets the size of the sun disk. Default value is based on Sol's perceived size from Earth. */ - get sun_disk_scale(): float64 - set sun_disk_scale(value: float64) - - /** Modulates the [Color] on the bottom half of the sky to represent the ground. */ - get ground_color(): Color - set ground_color(value: Color) - - /** The sky's overall brightness multiplier. Higher values result in a brighter sky. */ - get energy_multiplier(): float64 - set energy_multiplier(value: float64) - - /** If `true`, enables debanding. Debanding adds a small amount of noise which helps reduce banding that appears from the smooth changes in color in the sky. */ - get use_debanding(): boolean - set use_debanding(value: boolean) - - /** [Texture2D] for the night sky. This is added to the sky, so if it is bright enough, it may be visible during the day. */ - get night_sky(): Texture2D - set night_sky(value: Texture2D) - } - class PhysicalSkyMaterialConversionPlugin extends EditorResourceConversionPlugin { - constructor(identifier?: any) - } - /** Abstract base class for 2D game objects affected by physics. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_physicsbody2d.html - */ - class PhysicsBody2D extends CollisionObject2D { - constructor(identifier?: any) - /** Moves the body along the vector [param motion]. In order to be frame rate independent in [method Node._physics_process] or [method Node._process], [param motion] should be computed using `delta`. - * Returns a [KinematicCollision2D], which contains information about the collision when stopped, or when touching another body along the motion. - * If [param test_only] is `true`, the body does not move but the would-be collision information is given. - * [param safe_margin] is the extra margin used for collision recovery (see [member CharacterBody2D.safe_margin] for more details). - * If [param recovery_as_collision] is `true`, any depenetration from the recovery phase is also reported as a collision; this is used e.g. by [CharacterBody2D] for improving floor detection during floor snapping. - */ - move_and_collide(motion: Vector2, test_only: boolean = false, safe_margin: float64 = 0.08, recovery_as_collision: boolean = false): KinematicCollision2D - - /** Checks for collisions without moving the body. In order to be frame rate independent in [method Node._physics_process] or [method Node._process], [param motion] should be computed using `delta`. - * Virtually sets the node's position, scale and rotation to that of the given [Transform2D], then tries to move the body along the vector [param motion]. Returns `true` if a collision would stop the body from moving along the whole path. - * [param collision] is an optional object of type [KinematicCollision2D], which contains additional information about the collision when stopped, or when touching another body along the motion. - * [param safe_margin] is the extra margin used for collision recovery (see [member CharacterBody2D.safe_margin] for more details). - * If [param recovery_as_collision] is `true`, any depenetration from the recovery phase is also reported as a collision; this is useful for checking whether the body would *touch* any other bodies. - */ - test_move(from: Transform2D, motion: Vector2, collision: KinematicCollision2D = undefined, safe_margin: float64 = 0.08, recovery_as_collision: boolean = false): boolean - - /** Returns the gravity vector computed from all sources that can affect the body, including all gravity overrides from [Area2D] nodes and the global world gravity. */ - get_gravity(): Vector2 - - /** Returns an array of nodes that were added as collision exceptions for this body. */ - get_collision_exceptions(): GArray - - /** Adds a body to the list of bodies that this body can't collide with. */ - add_collision_exception_with(body: Node): void - - /** Removes a body from the list of bodies that this body can't collide with. */ - remove_collision_exception_with(body: Node): void - } - /** Abstract base class for 3D game objects affected by physics. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_physicsbody3d.html - */ - class PhysicsBody3D extends CollisionObject3D { - constructor(identifier?: any) - /** Moves the body along the vector [param motion]. In order to be frame rate independent in [method Node._physics_process] or [method Node._process], [param motion] should be computed using `delta`. - * The body will stop if it collides. Returns a [KinematicCollision3D], which contains information about the collision when stopped, or when touching another body along the motion. - * If [param test_only] is `true`, the body does not move but the would-be collision information is given. - * [param safe_margin] is the extra margin used for collision recovery (see [member CharacterBody3D.safe_margin] for more details). - * If [param recovery_as_collision] is `true`, any depenetration from the recovery phase is also reported as a collision; this is used e.g. by [CharacterBody3D] for improving floor detection during floor snapping. - * [param max_collisions] allows to retrieve more than one collision result. - */ - move_and_collide(motion: Vector3, test_only: boolean = false, safe_margin: float64 = 0.001, recovery_as_collision: boolean = false, max_collisions: int64 = 1): KinematicCollision3D - - /** Checks for collisions without moving the body. In order to be frame rate independent in [method Node._physics_process] or [method Node._process], [param motion] should be computed using `delta`. - * Virtually sets the node's position, scale and rotation to that of the given [Transform3D], then tries to move the body along the vector [param motion]. Returns `true` if a collision would stop the body from moving along the whole path. - * [param collision] is an optional object of type [KinematicCollision3D], which contains additional information about the collision when stopped, or when touching another body along the motion. - * [param safe_margin] is the extra margin used for collision recovery (see [member CharacterBody3D.safe_margin] for more details). - * If [param recovery_as_collision] is `true`, any depenetration from the recovery phase is also reported as a collision; this is useful for checking whether the body would *touch* any other bodies. - * [param max_collisions] allows to retrieve more than one collision result. - */ - test_move(from: Transform3D, motion: Vector3, collision: KinematicCollision3D = undefined, safe_margin: float64 = 0.001, recovery_as_collision: boolean = false, max_collisions: int64 = 1): boolean - - /** Returns the gravity vector computed from all sources that can affect the body, including all gravity overrides from [Area3D] nodes and the global world gravity. */ - get_gravity(): Vector3 - - /** Locks or unlocks the specified linear or rotational [param axis] depending on the value of [param lock]. */ - set_axis_lock(axis: PhysicsServer3D.BodyAxis, lock: boolean): void - - /** Returns `true` if the specified linear or rotational [param axis] is locked. */ - get_axis_lock(axis: PhysicsServer3D.BodyAxis): boolean - - /** Returns an array of nodes that were added as collision exceptions for this body. */ - get_collision_exceptions(): GArray - - /** Adds a body to the list of bodies that this body can't collide with. */ - add_collision_exception_with(body: Node): void - - /** Removes a body from the list of bodies that this body can't collide with. */ - remove_collision_exception_with(body: Node): void - - /** Lock the body's linear movement in the X axis. */ - get axis_lock_linear_x(): boolean - set axis_lock_linear_x(value: boolean) - - /** Lock the body's linear movement in the Y axis. */ - get axis_lock_linear_y(): boolean - set axis_lock_linear_y(value: boolean) - - /** Lock the body's linear movement in the Z axis. */ - get axis_lock_linear_z(): boolean - set axis_lock_linear_z(value: boolean) - - /** Lock the body's rotation in the X axis. */ - get axis_lock_angular_x(): boolean - set axis_lock_angular_x(value: boolean) - - /** Lock the body's rotation in the Y axis. */ - get axis_lock_angular_y(): boolean - set axis_lock_angular_y(value: boolean) - - /** Lock the body's rotation in the Z axis. */ - get axis_lock_angular_z(): boolean - set axis_lock_angular_z(value: boolean) - } - /** Provides direct access to a physics body in the [PhysicsServer2D]. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_physicsdirectbodystate2d.html - */ - class PhysicsDirectBodyState2D extends Object { - constructor(identifier?: any) - /** Returns the body's velocity at the given relative position, including both translation and rotation. */ - get_velocity_at_local_position(local_position: Vector2): Vector2 - - /** Applies a directional impulse without affecting rotation. - * An impulse is time-independent! Applying an impulse every frame would result in a framerate-dependent force. For this reason, it should only be used when simulating one-time impacts (use the "_force" functions otherwise). - * This is equivalent to using [method apply_impulse] at the body's center of mass. - */ - apply_central_impulse(impulse: Vector2): void - - /** Applies a rotational impulse to the body without affecting the position. - * An impulse is time-independent! Applying an impulse every frame would result in a framerate-dependent force. For this reason, it should only be used when simulating one-time impacts (use the "_force" functions otherwise). - * - * **Note:** [member inverse_inertia] is required for this to work. To have [member inverse_inertia], an active [CollisionShape2D] must be a child of the node, or you can manually set [member inverse_inertia]. - */ - apply_torque_impulse(impulse: float64): void - - /** Applies a positioned impulse to the body. - * An impulse is time-independent! Applying an impulse every frame would result in a framerate-dependent force. For this reason, it should only be used when simulating one-time impacts (use the "_force" functions otherwise). - * [param position] is the offset from the body origin in global coordinates. - */ - apply_impulse(impulse: Vector2, position: Vector2 = Vector2.ZERO): void - - /** Applies a directional force without affecting rotation. A force is time dependent and meant to be applied every physics update. - * This is equivalent to using [method apply_force] at the body's center of mass. - */ - apply_central_force(force: Vector2 = Vector2.ZERO): void - - /** Applies a positioned force to the body. A force is time dependent and meant to be applied every physics update. - * [param position] is the offset from the body origin in global coordinates. - */ - apply_force(force: Vector2, position: Vector2 = Vector2.ZERO): void - - /** Applies a rotational force without affecting position. A force is time dependent and meant to be applied every physics update. - * - * **Note:** [member inverse_inertia] is required for this to work. To have [member inverse_inertia], an active [CollisionShape2D] must be a child of the node, or you can manually set [member inverse_inertia]. - */ - apply_torque(torque: float64): void - - /** Adds a constant directional force without affecting rotation that keeps being applied over time until cleared with `constant_force = Vector2(0, 0)`. - * This is equivalent to using [method add_constant_force] at the body's center of mass. - */ - add_constant_central_force(force: Vector2 = Vector2.ZERO): void - - /** Adds a constant positioned force to the body that keeps being applied over time until cleared with `constant_force = Vector2(0, 0)`. - * [param position] is the offset from the body origin in global coordinates. - */ - add_constant_force(force: Vector2, position: Vector2 = Vector2.ZERO): void - - /** Adds a constant rotational force without affecting position that keeps being applied over time until cleared with `constant_torque = 0`. */ - add_constant_torque(torque: float64): void - - /** Sets the body's total constant positional forces applied during each physics update. - * See [method add_constant_force] and [method add_constant_central_force]. - */ - set_constant_force(force: Vector2): void - - /** Returns the body's total constant positional forces applied during each physics update. - * See [method add_constant_force] and [method add_constant_central_force]. - */ - get_constant_force(): Vector2 - - /** Sets the body's total constant rotational forces applied during each physics update. - * See [method add_constant_torque]. - */ - set_constant_torque(torque: float64): void - - /** Returns the body's total constant rotational forces applied during each physics update. - * See [method add_constant_torque]. - */ - get_constant_torque(): float64 - - /** Returns the number of contacts this body has with other bodies. - * - * **Note:** By default, this returns 0 unless bodies are configured to monitor contacts. See [member RigidBody2D.contact_monitor]. - */ - get_contact_count(): int64 - - /** Returns the position of the contact point on the body in the global coordinate system. */ - get_contact_local_position(contact_idx: int64): Vector2 - - /** Returns the local normal at the contact point. */ - get_contact_local_normal(contact_idx: int64): Vector2 - - /** Returns the local shape index of the collision. */ - get_contact_local_shape(contact_idx: int64): int64 - - /** Returns the velocity vector at the body's contact point. */ - get_contact_local_velocity_at_position(contact_idx: int64): Vector2 - - /** Returns the collider's [RID]. */ - get_contact_collider(contact_idx: int64): RID - - /** Returns the position of the contact point on the collider in the global coordinate system. */ - get_contact_collider_position(contact_idx: int64): Vector2 - - /** Returns the collider's object id. */ - get_contact_collider_id(contact_idx: int64): int64 - - /** Returns the collider object. This depends on how it was created (will return a scene node if such was used to create it). */ - get_contact_collider_object(contact_idx: int64): Object - - /** Returns the collider's shape index. */ - get_contact_collider_shape(contact_idx: int64): int64 - - /** Returns the velocity vector at the collider's contact point. */ - get_contact_collider_velocity_at_position(contact_idx: int64): Vector2 - - /** Returns the impulse created by the contact. */ - get_contact_impulse(contact_idx: int64): Vector2 - - /** Updates the body's linear and angular velocity by applying gravity and damping for the equivalent of one physics tick. */ - integrate_forces(): void - - /** Returns the current state of the space, useful for queries. */ - get_space_state(): PhysicsDirectSpaceState2D - - /** The timestep (delta) used for the simulation. */ - get step(): float64 - - /** The inverse of the mass of the body. */ - get inverse_mass(): float64 - - /** The inverse of the inertia of the body. */ - get inverse_inertia(): float64 - - /** The rate at which the body stops rotating, if there are not any other forces moving it. */ - get total_angular_damp(): float64 - - /** The rate at which the body stops moving, if there are not any other forces moving it. */ - get total_linear_damp(): float64 - - /** The total gravity vector being currently applied to this body. */ - get total_gravity(): Vector2 - - /** The body's center of mass position relative to the body's center in the global coordinate system. */ - get center_of_mass(): Vector2 - - /** The body's center of mass position in the body's local coordinate system. */ - get center_of_mass_local(): Vector2 - - /** The body's rotational velocity in *radians* per second. */ - get angular_velocity(): float64 - set angular_velocity(value: float64) - - /** The body's linear velocity in pixels per second. */ - get linear_velocity(): Vector2 - set linear_velocity(value: Vector2) - - /** If `true`, this body is currently sleeping (not active). */ - get sleeping(): boolean - set sleeping(value: boolean) - - /** The body's transformation matrix. */ - get transform(): Transform2D - set transform(value: Transform2D) - } - /** Provides virtual methods that can be overridden to create custom [PhysicsDirectBodyState2D] implementations. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_physicsdirectbodystate2dextension.html - */ - class PhysicsDirectBodyState2DExtension extends PhysicsDirectBodyState2D { - constructor(identifier?: any) - /** Implement to override the behavior of [member PhysicsDirectBodyState2D.total_gravity] and its respective getter. */ - /* gdvirtual */ _get_total_gravity(): Vector2 - - /** Implement to override the behavior of [member PhysicsDirectBodyState2D.total_linear_damp] and its respective getter. */ - /* gdvirtual */ _get_total_linear_damp(): float64 - - /** Implement to override the behavior of [member PhysicsDirectBodyState2D.total_angular_damp] and its respective getter. */ - /* gdvirtual */ _get_total_angular_damp(): float64 - - /** Implement to override the behavior of [member PhysicsDirectBodyState2D.center_of_mass] and its respective getter. */ - /* gdvirtual */ _get_center_of_mass(): Vector2 - - /** Implement to override the behavior of [member PhysicsDirectBodyState2D.center_of_mass_local] and its respective getter. */ - /* gdvirtual */ _get_center_of_mass_local(): Vector2 - - /** Implement to override the behavior of [member PhysicsDirectBodyState2D.inverse_mass] and its respective getter. */ - /* gdvirtual */ _get_inverse_mass(): float64 - - /** Implement to override the behavior of [member PhysicsDirectBodyState2D.inverse_inertia] and its respective getter. */ - /* gdvirtual */ _get_inverse_inertia(): float64 - - /** Implement to override the behavior of [member PhysicsDirectBodyState2D.linear_velocity] and its respective setter. */ - /* gdvirtual */ _set_linear_velocity(velocity: Vector2): void - - /** Implement to override the behavior of [member PhysicsDirectBodyState2D.linear_velocity] and its respective getter. */ - /* gdvirtual */ _get_linear_velocity(): Vector2 - - /** Implement to override the behavior of [member PhysicsDirectBodyState2D.angular_velocity] and its respective setter. */ - /* gdvirtual */ _set_angular_velocity(velocity: float64): void - - /** Implement to override the behavior of [member PhysicsDirectBodyState2D.angular_velocity] and its respective getter. */ - /* gdvirtual */ _get_angular_velocity(): float64 - - /** Implement to override the behavior of [member PhysicsDirectBodyState2D.transform] and its respective setter. */ - /* gdvirtual */ _set_transform(transform: Transform2D): void - - /** Implement to override the behavior of [member PhysicsDirectBodyState2D.transform] and its respective getter. */ - /* gdvirtual */ _get_transform(): Transform2D - - /** Overridable version of [method PhysicsDirectBodyState2D.get_velocity_at_local_position]. */ - /* gdvirtual */ _get_velocity_at_local_position(local_position: Vector2): Vector2 - - /** Overridable version of [method PhysicsDirectBodyState2D.apply_central_impulse]. */ - /* gdvirtual */ _apply_central_impulse(impulse: Vector2): void - - /** Overridable version of [method PhysicsDirectBodyState2D.apply_impulse]. */ - /* gdvirtual */ _apply_impulse(impulse: Vector2, position: Vector2): void - - /** Overridable version of [method PhysicsDirectBodyState2D.apply_torque_impulse]. */ - /* gdvirtual */ _apply_torque_impulse(impulse: float64): void - - /** Overridable version of [method PhysicsDirectBodyState2D.apply_central_force]. */ - /* gdvirtual */ _apply_central_force(force: Vector2): void - - /** Overridable version of [method PhysicsDirectBodyState2D.apply_force]. */ - /* gdvirtual */ _apply_force(force: Vector2, position: Vector2): void - - /** Overridable version of [method PhysicsDirectBodyState2D.apply_torque]. */ - /* gdvirtual */ _apply_torque(torque: float64): void - - /** Overridable version of [method PhysicsDirectBodyState2D.add_constant_central_force]. */ - /* gdvirtual */ _add_constant_central_force(force: Vector2): void - - /** Overridable version of [method PhysicsDirectBodyState2D.add_constant_force]. */ - /* gdvirtual */ _add_constant_force(force: Vector2, position: Vector2): void - - /** Overridable version of [method PhysicsDirectBodyState2D.add_constant_torque]. */ - /* gdvirtual */ _add_constant_torque(torque: float64): void - - /** Overridable version of [method PhysicsDirectBodyState2D.set_constant_force]. */ - /* gdvirtual */ _set_constant_force(force: Vector2): void - - /** Overridable version of [method PhysicsDirectBodyState2D.get_constant_force]. */ - /* gdvirtual */ _get_constant_force(): Vector2 - - /** Overridable version of [method PhysicsDirectBodyState2D.set_constant_torque]. */ - /* gdvirtual */ _set_constant_torque(torque: float64): void - - /** Overridable version of [method PhysicsDirectBodyState2D.get_constant_torque]. */ - /* gdvirtual */ _get_constant_torque(): float64 - - /** Implement to override the behavior of [member PhysicsDirectBodyState2D.sleeping] and its respective setter. */ - /* gdvirtual */ _set_sleep_state(enabled: boolean): void - - /** Implement to override the behavior of [member PhysicsDirectBodyState2D.sleeping] and its respective getter. */ - /* gdvirtual */ _is_sleeping(): boolean - - /** Overridable version of [method PhysicsDirectBodyState2D.get_contact_count]. */ - /* gdvirtual */ _get_contact_count(): int64 - - /** Overridable version of [method PhysicsDirectBodyState2D.get_contact_local_position]. */ - /* gdvirtual */ _get_contact_local_position(contact_idx: int64): Vector2 - - /** Overridable version of [method PhysicsDirectBodyState2D.get_contact_local_normal]. */ - /* gdvirtual */ _get_contact_local_normal(contact_idx: int64): Vector2 - - /** Overridable version of [method PhysicsDirectBodyState2D.get_contact_local_shape]. */ - /* gdvirtual */ _get_contact_local_shape(contact_idx: int64): int64 - - /** Overridable version of [method PhysicsDirectBodyState2D.get_contact_local_velocity_at_position]. */ - /* gdvirtual */ _get_contact_local_velocity_at_position(contact_idx: int64): Vector2 - - /** Overridable version of [method PhysicsDirectBodyState2D.get_contact_collider]. */ - /* gdvirtual */ _get_contact_collider(contact_idx: int64): RID - - /** Overridable version of [method PhysicsDirectBodyState2D.get_contact_collider_position]. */ - /* gdvirtual */ _get_contact_collider_position(contact_idx: int64): Vector2 - - /** Overridable version of [method PhysicsDirectBodyState2D.get_contact_collider_id]. */ - /* gdvirtual */ _get_contact_collider_id(contact_idx: int64): int64 - - /** Overridable version of [method PhysicsDirectBodyState2D.get_contact_collider_object]. */ - /* gdvirtual */ _get_contact_collider_object(contact_idx: int64): Object - - /** Overridable version of [method PhysicsDirectBodyState2D.get_contact_collider_shape]. */ - /* gdvirtual */ _get_contact_collider_shape(contact_idx: int64): int64 - - /** Overridable version of [method PhysicsDirectBodyState2D.get_contact_collider_velocity_at_position]. */ - /* gdvirtual */ _get_contact_collider_velocity_at_position(contact_idx: int64): Vector2 - - /** Overridable version of [method PhysicsDirectBodyState2D.get_contact_impulse]. */ - /* gdvirtual */ _get_contact_impulse(contact_idx: int64): Vector2 - - /** Implement to override the behavior of [member PhysicsDirectBodyState2D.step] and its respective getter. */ - /* gdvirtual */ _get_step(): float64 - - /** Overridable version of [method PhysicsDirectBodyState2D.integrate_forces]. */ - /* gdvirtual */ _integrate_forces(): void - - /** Overridable version of [method PhysicsDirectBodyState2D.get_space_state]. */ - /* gdvirtual */ _get_space_state(): PhysicsDirectSpaceState2D - } - /** Provides direct access to a physics body in the [PhysicsServer3D]. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_physicsdirectbodystate3d.html - */ - class PhysicsDirectBodyState3D extends Object { - constructor(identifier?: any) - /** Returns the body's velocity at the given relative position, including both translation and rotation. */ - get_velocity_at_local_position(local_position: Vector3): Vector3 - - /** Applies a directional impulse without affecting rotation. - * An impulse is time-independent! Applying an impulse every frame would result in a framerate-dependent force. For this reason, it should only be used when simulating one-time impacts (use the "_force" functions otherwise). - * This is equivalent to using [method apply_impulse] at the body's center of mass. - */ - apply_central_impulse(impulse: Vector3 = new Vector3(0, 0, 0)): void - - /** Applies a positioned impulse to the body. - * An impulse is time-independent! Applying an impulse every frame would result in a framerate-dependent force. For this reason, it should only be used when simulating one-time impacts (use the "_force" functions otherwise). - * [param position] is the offset from the body origin in global coordinates. - */ - apply_impulse(impulse: Vector3, position: Vector3 = new Vector3(0, 0, 0)): void - - /** Applies a rotational impulse to the body without affecting the position. - * An impulse is time-independent! Applying an impulse every frame would result in a framerate-dependent force. For this reason, it should only be used when simulating one-time impacts (use the "_force" functions otherwise). - * - * **Note:** [member inverse_inertia] is required for this to work. To have [member inverse_inertia], an active [CollisionShape3D] must be a child of the node, or you can manually set [member inverse_inertia]. - */ - apply_torque_impulse(impulse: Vector3): void - - /** Applies a directional force without affecting rotation. A force is time dependent and meant to be applied every physics update. - * This is equivalent to using [method apply_force] at the body's center of mass. - */ - apply_central_force(force: Vector3 = new Vector3(0, 0, 0)): void - - /** Applies a positioned force to the body. A force is time dependent and meant to be applied every physics update. - * [param position] is the offset from the body origin in global coordinates. - */ - apply_force(force: Vector3, position: Vector3 = new Vector3(0, 0, 0)): void - - /** Applies a rotational force without affecting position. A force is time dependent and meant to be applied every physics update. - * - * **Note:** [member inverse_inertia] is required for this to work. To have [member inverse_inertia], an active [CollisionShape3D] must be a child of the node, or you can manually set [member inverse_inertia]. - */ - apply_torque(torque: Vector3): void - - /** Adds a constant directional force without affecting rotation that keeps being applied over time until cleared with `constant_force = Vector3(0, 0, 0)`. - * This is equivalent to using [method add_constant_force] at the body's center of mass. - */ - add_constant_central_force(force: Vector3 = new Vector3(0, 0, 0)): void - - /** Adds a constant positioned force to the body that keeps being applied over time until cleared with `constant_force = Vector3(0, 0, 0)`. - * [param position] is the offset from the body origin in global coordinates. - */ - add_constant_force(force: Vector3, position: Vector3 = new Vector3(0, 0, 0)): void - - /** Adds a constant rotational force without affecting position that keeps being applied over time until cleared with `constant_torque = Vector3(0, 0, 0)`. */ - add_constant_torque(torque: Vector3): void - - /** Sets the body's total constant positional forces applied during each physics update. - * See [method add_constant_force] and [method add_constant_central_force]. - */ - set_constant_force(force: Vector3): void - - /** Returns the body's total constant positional forces applied during each physics update. - * See [method add_constant_force] and [method add_constant_central_force]. - */ - get_constant_force(): Vector3 - - /** Sets the body's total constant rotational forces applied during each physics update. - * See [method add_constant_torque]. - */ - set_constant_torque(torque: Vector3): void - - /** Returns the body's total constant rotational forces applied during each physics update. - * See [method add_constant_torque]. - */ - get_constant_torque(): Vector3 - - /** Returns the number of contacts this body has with other bodies. - * - * **Note:** By default, this returns 0 unless bodies are configured to monitor contacts. See [member RigidBody3D.contact_monitor]. - */ - get_contact_count(): int64 - - /** Returns the position of the contact point on the body in the global coordinate system. */ - get_contact_local_position(contact_idx: int64): Vector3 - - /** Returns the local normal at the contact point. */ - get_contact_local_normal(contact_idx: int64): Vector3 - - /** Impulse created by the contact. */ - get_contact_impulse(contact_idx: int64): Vector3 - - /** Returns the local shape index of the collision. */ - get_contact_local_shape(contact_idx: int64): int64 - - /** Returns the linear velocity vector at the body's contact point. */ - get_contact_local_velocity_at_position(contact_idx: int64): Vector3 - - /** Returns the collider's [RID]. */ - get_contact_collider(contact_idx: int64): RID - - /** Returns the position of the contact point on the collider in the global coordinate system. */ - get_contact_collider_position(contact_idx: int64): Vector3 - - /** Returns the collider's object id. */ - get_contact_collider_id(contact_idx: int64): int64 - - /** Returns the collider object. */ - get_contact_collider_object(contact_idx: int64): Object - - /** Returns the collider's shape index. */ - get_contact_collider_shape(contact_idx: int64): int64 - - /** Returns the linear velocity vector at the collider's contact point. */ - get_contact_collider_velocity_at_position(contact_idx: int64): Vector3 - - /** Updates the body's linear and angular velocity by applying gravity and damping for the equivalent of one physics tick. */ - integrate_forces(): void - - /** Returns the current state of the space, useful for queries. */ - get_space_state(): PhysicsDirectSpaceState3D - - /** The timestep (delta) used for the simulation. */ - get step(): float64 - - /** The inverse of the mass of the body. */ - get inverse_mass(): float64 - - /** The rate at which the body stops rotating, if there are not any other forces moving it. */ - get total_angular_damp(): float64 - - /** The rate at which the body stops moving, if there are not any other forces moving it. */ - get total_linear_damp(): float64 - - /** The inverse of the inertia of the body. */ - get inverse_inertia(): Vector3 - - /** The inverse of the inertia tensor of the body. */ - get inverse_inertia_tensor(): Basis - - /** The total gravity vector being currently applied to this body. */ - get total_gravity(): Vector3 - - /** The body's center of mass position relative to the body's center in the global coordinate system. */ - get center_of_mass(): Vector3 - - /** The body's center of mass position in the body's local coordinate system. */ - get center_of_mass_local(): Vector3 - get principal_inertia_axes(): Basis - - /** The body's rotational velocity in *radians* per second. */ - get angular_velocity(): Vector3 - set angular_velocity(value: Vector3) - - /** The body's linear velocity in units per second. */ - get linear_velocity(): Vector3 - set linear_velocity(value: Vector3) - - /** If `true`, this body is currently sleeping (not active). */ - get sleeping(): boolean - set sleeping(value: boolean) - - /** The body's transformation matrix. */ - get transform(): Transform3D - set transform(value: Transform3D) - } - /** Provides virtual methods that can be overridden to create custom [PhysicsDirectBodyState3D] implementations. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_physicsdirectbodystate3dextension.html - */ - class PhysicsDirectBodyState3DExtension extends PhysicsDirectBodyState3D { - constructor(identifier?: any) - /* gdvirtual */ _get_total_gravity(): Vector3 - /* gdvirtual */ _get_total_linear_damp(): float64 - /* gdvirtual */ _get_total_angular_damp(): float64 - /* gdvirtual */ _get_center_of_mass(): Vector3 - /* gdvirtual */ _get_center_of_mass_local(): Vector3 - /* gdvirtual */ _get_principal_inertia_axes(): Basis - /* gdvirtual */ _get_inverse_mass(): float64 - /* gdvirtual */ _get_inverse_inertia(): Vector3 - /* gdvirtual */ _get_inverse_inertia_tensor(): Basis - /* gdvirtual */ _set_linear_velocity(velocity: Vector3): void - /* gdvirtual */ _get_linear_velocity(): Vector3 - /* gdvirtual */ _set_angular_velocity(velocity: Vector3): void - /* gdvirtual */ _get_angular_velocity(): Vector3 - /* gdvirtual */ _set_transform(transform: Transform3D): void - /* gdvirtual */ _get_transform(): Transform3D - /* gdvirtual */ _get_velocity_at_local_position(local_position: Vector3): Vector3 - /* gdvirtual */ _apply_central_impulse(impulse: Vector3): void - /* gdvirtual */ _apply_impulse(impulse: Vector3, position: Vector3): void - /* gdvirtual */ _apply_torque_impulse(impulse: Vector3): void - /* gdvirtual */ _apply_central_force(force: Vector3): void - /* gdvirtual */ _apply_force(force: Vector3, position: Vector3): void - /* gdvirtual */ _apply_torque(torque: Vector3): void - /* gdvirtual */ _add_constant_central_force(force: Vector3): void - /* gdvirtual */ _add_constant_force(force: Vector3, position: Vector3): void - /* gdvirtual */ _add_constant_torque(torque: Vector3): void - /* gdvirtual */ _set_constant_force(force: Vector3): void - /* gdvirtual */ _get_constant_force(): Vector3 - /* gdvirtual */ _set_constant_torque(torque: Vector3): void - /* gdvirtual */ _get_constant_torque(): Vector3 - /* gdvirtual */ _set_sleep_state(enabled: boolean): void - /* gdvirtual */ _is_sleeping(): boolean - /* gdvirtual */ _get_contact_count(): int64 - /* gdvirtual */ _get_contact_local_position(contact_idx: int64): Vector3 - /* gdvirtual */ _get_contact_local_normal(contact_idx: int64): Vector3 - /* gdvirtual */ _get_contact_impulse(contact_idx: int64): Vector3 - /* gdvirtual */ _get_contact_local_shape(contact_idx: int64): int64 - /* gdvirtual */ _get_contact_local_velocity_at_position(contact_idx: int64): Vector3 - /* gdvirtual */ _get_contact_collider(contact_idx: int64): RID - /* gdvirtual */ _get_contact_collider_position(contact_idx: int64): Vector3 - /* gdvirtual */ _get_contact_collider_id(contact_idx: int64): int64 - /* gdvirtual */ _get_contact_collider_object(contact_idx: int64): Object - /* gdvirtual */ _get_contact_collider_shape(contact_idx: int64): int64 - /* gdvirtual */ _get_contact_collider_velocity_at_position(contact_idx: int64): Vector3 - /* gdvirtual */ _get_step(): float64 - /* gdvirtual */ _integrate_forces(): void - /* gdvirtual */ _get_space_state(): PhysicsDirectSpaceState3D - } - /** Provides direct access to a physics space in the [PhysicsServer2D]. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_physicsdirectspacestate2d.html - */ - class PhysicsDirectSpaceState2D extends Object { - constructor(identifier?: any) - /** Checks whether a point is inside any solid shape. Position and other parameters are defined through [PhysicsPointQueryParameters2D]. The shapes the point is inside of are returned in an array containing dictionaries with the following fields: - * `collider`: The colliding object. - * `collider_id`: The colliding object's ID. - * `rid`: The intersecting object's [RID]. - * `shape`: The shape index of the colliding shape. - * The number of intersections can be limited with the [param max_results] parameter, to reduce the processing time. - * - * **Note:** [ConcavePolygonShape2D]s and [CollisionPolygon2D]s in `Segments` build mode are not solid shapes. Therefore, they will not be detected. - */ - intersect_point(parameters: PhysicsPointQueryParameters2D, max_results: int64 = 32): GArray - - /** Intersects a ray in a given space. Ray position and other parameters are defined through [PhysicsRayQueryParameters2D]. The returned object is a dictionary with the following fields: - * `collider`: The colliding object. - * `collider_id`: The colliding object's ID. - * `normal`: The object's surface normal at the intersection point, or `Vector2(0, 0)` if the ray starts inside the shape and [member PhysicsRayQueryParameters2D.hit_from_inside] is `true`. - * `position`: The intersection point. - * `rid`: The intersecting object's [RID]. - * `shape`: The shape index of the colliding shape. - * If the ray did not intersect anything, then an empty dictionary is returned instead. - */ - intersect_ray(parameters: PhysicsRayQueryParameters2D): GDictionary - - /** Checks the intersections of a shape, given through a [PhysicsShapeQueryParameters2D] object, against the space. The intersected shapes are returned in an array containing dictionaries with the following fields: - * `collider`: The colliding object. - * `collider_id`: The colliding object's ID. - * `rid`: The intersecting object's [RID]. - * `shape`: The shape index of the colliding shape. - * The number of intersections can be limited with the [param max_results] parameter, to reduce the processing time. - */ - intersect_shape(parameters: PhysicsShapeQueryParameters2D, max_results: int64 = 32): GArray - - /** Checks how far a [Shape2D] can move without colliding. All the parameters for the query, including the shape and the motion, are supplied through a [PhysicsShapeQueryParameters2D] object. - * Returns an array with the safe and unsafe proportions (between 0 and 1) of the motion. The safe proportion is the maximum fraction of the motion that can be made without a collision. The unsafe proportion is the minimum fraction of the distance that must be moved for a collision. If no collision is detected a result of `[1.0, 1.0]` will be returned. - * - * **Note:** Any [Shape2D]s that the shape is already colliding with e.g. inside of, will be ignored. Use [method collide_shape] to determine the [Shape2D]s that the shape is already colliding with. - */ - cast_motion(parameters: PhysicsShapeQueryParameters2D): PackedFloat32Array - - /** Checks the intersections of a shape, given through a [PhysicsShapeQueryParameters2D] object, against the space. The resulting array contains a list of points where the shape intersects another. Like with [method intersect_shape], the number of returned results can be limited to save processing time. - * Returned points are a list of pairs of contact points. For each pair the first one is in the shape passed in [PhysicsShapeQueryParameters2D] object, second one is in the collided shape from the physics space. - */ - collide_shape(parameters: PhysicsShapeQueryParameters2D, max_results: int64 = 32): GArray - - /** Checks the intersections of a shape, given through a [PhysicsShapeQueryParameters2D] object, against the space. If it collides with more than one shape, the nearest one is selected. If the shape did not intersect anything, then an empty dictionary is returned instead. - * - * **Note:** This method does not take into account the `motion` property of the object. The returned object is a dictionary containing the following fields: - * `collider_id`: The colliding object's ID. - * `linear_velocity`: The colliding object's velocity [Vector2]. If the object is an [Area2D], the result is `(0, 0)`. - * `normal`: The object's surface normal at the intersection point. - * `point`: The intersection point. - * `rid`: The intersecting object's [RID]. - * `shape`: The shape index of the colliding shape. - */ - get_rest_info(parameters: PhysicsShapeQueryParameters2D): GDictionary - } - /** Provides virtual methods that can be overridden to create custom [PhysicsDirectSpaceState2D] implementations. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_physicsdirectspacestate2dextension.html - */ - class PhysicsDirectSpaceState2DExtension extends PhysicsDirectSpaceState2D { - constructor(identifier?: any) - /* gdvirtual */ _intersect_ray(from: Vector2, to: Vector2, collision_mask: int64, collide_with_bodies: boolean, collide_with_areas: boolean, hit_from_inside: boolean, result: int64): boolean - /* gdvirtual */ _intersect_point(position: Vector2, canvas_instance_id: int64, collision_mask: int64, collide_with_bodies: boolean, collide_with_areas: boolean, results: int64, max_results: int64): int64 - /* gdvirtual */ _intersect_shape(shape_rid: RID, transform: Transform2D, motion: Vector2, margin: float64, collision_mask: int64, collide_with_bodies: boolean, collide_with_areas: boolean, result: int64, max_results: int64): int64 - /* gdvirtual */ _cast_motion(shape_rid: RID, transform: Transform2D, motion: Vector2, margin: float64, collision_mask: int64, collide_with_bodies: boolean, collide_with_areas: boolean, closest_safe: int64, closest_unsafe: int64): boolean - /* gdvirtual */ _collide_shape(shape_rid: RID, transform: Transform2D, motion: Vector2, margin: float64, collision_mask: int64, collide_with_bodies: boolean, collide_with_areas: boolean, results: int64, max_results: int64, result_count: int64): boolean - /* gdvirtual */ _rest_info(shape_rid: RID, transform: Transform2D, motion: Vector2, margin: float64, collision_mask: int64, collide_with_bodies: boolean, collide_with_areas: boolean, rest_info: int64): boolean - is_body_excluded_from_query(body: RID): boolean - } - /** Provides direct access to a physics space in the [PhysicsServer3D]. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_physicsdirectspacestate3d.html - */ - class PhysicsDirectSpaceState3D extends Object { - constructor(identifier?: any) - /** Checks whether a point is inside any solid shape. Position and other parameters are defined through [PhysicsPointQueryParameters3D]. The shapes the point is inside of are returned in an array containing dictionaries with the following fields: - * `collider`: The colliding object. - * `collider_id`: The colliding object's ID. - * `rid`: The intersecting object's [RID]. - * `shape`: The shape index of the colliding shape. - * The number of intersections can be limited with the [param max_results] parameter, to reduce the processing time. - */ - intersect_point(parameters: PhysicsPointQueryParameters3D, max_results: int64 = 32): GArray - - /** Intersects a ray in a given space. Ray position and other parameters are defined through [PhysicsRayQueryParameters3D]. The returned object is a dictionary with the following fields: - * `collider`: The colliding object. - * `collider_id`: The colliding object's ID. - * `normal`: The object's surface normal at the intersection point, or `Vector3(0, 0, 0)` if the ray starts inside the shape and [member PhysicsRayQueryParameters3D.hit_from_inside] is `true`. - * `position`: The intersection point. - * `face_index`: The face index at the intersection point. - * - * **Note:** Returns a valid number only if the intersected shape is a [ConcavePolygonShape3D]. Otherwise, `-1` is returned. - * `rid`: The intersecting object's [RID]. - * `shape`: The shape index of the colliding shape. - * If the ray did not intersect anything, then an empty dictionary is returned instead. - */ - intersect_ray(parameters: PhysicsRayQueryParameters3D): GDictionary - - /** Checks the intersections of a shape, given through a [PhysicsShapeQueryParameters3D] object, against the space. The intersected shapes are returned in an array containing dictionaries with the following fields: - * `collider`: The colliding object. - * `collider_id`: The colliding object's ID. - * `rid`: The intersecting object's [RID]. - * `shape`: The shape index of the colliding shape. - * The number of intersections can be limited with the [param max_results] parameter, to reduce the processing time. - * - * **Note:** This method does not take into account the `motion` property of the object. - */ - intersect_shape(parameters: PhysicsShapeQueryParameters3D, max_results: int64 = 32): GArray - - /** Checks how far a [Shape3D] can move without colliding. All the parameters for the query, including the shape, are supplied through a [PhysicsShapeQueryParameters3D] object. - * Returns an array with the safe and unsafe proportions (between 0 and 1) of the motion. The safe proportion is the maximum fraction of the motion that can be made without a collision. The unsafe proportion is the minimum fraction of the distance that must be moved for a collision. If no collision is detected a result of `[1.0, 1.0]` will be returned. - * - * **Note:** Any [Shape3D]s that the shape is already colliding with e.g. inside of, will be ignored. Use [method collide_shape] to determine the [Shape3D]s that the shape is already colliding with. - */ - cast_motion(parameters: PhysicsShapeQueryParameters3D): PackedFloat32Array - - /** Checks the intersections of a shape, given through a [PhysicsShapeQueryParameters3D] object, against the space. The resulting array contains a list of points where the shape intersects another. Like with [method intersect_shape], the number of returned results can be limited to save processing time. - * Returned points are a list of pairs of contact points. For each pair the first one is in the shape passed in [PhysicsShapeQueryParameters3D] object, second one is in the collided shape from the physics space. - * - * **Note:** This method does not take into account the `motion` property of the object. - */ - collide_shape(parameters: PhysicsShapeQueryParameters3D, max_results: int64 = 32): GArray - - /** Checks the intersections of a shape, given through a [PhysicsShapeQueryParameters3D] object, against the space. If it collides with more than one shape, the nearest one is selected. The returned object is a dictionary containing the following fields: - * `collider_id`: The colliding object's ID. - * `linear_velocity`: The colliding object's velocity [Vector3]. If the object is an [Area3D], the result is `(0, 0, 0)`. - * `normal`: The object's surface normal at the intersection point. - * `point`: The intersection point. - * `rid`: The intersecting object's [RID]. - * `shape`: The shape index of the colliding shape. - * If the shape did not intersect anything, then an empty dictionary is returned instead. - * - * **Note:** This method does not take into account the `motion` property of the object. - */ - get_rest_info(parameters: PhysicsShapeQueryParameters3D): GDictionary - } - /** Provides virtual methods that can be overridden to create custom [PhysicsDirectSpaceState3D] implementations. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_physicsdirectspacestate3dextension.html - */ - class PhysicsDirectSpaceState3DExtension extends PhysicsDirectSpaceState3D { - constructor(identifier?: any) - /* gdvirtual */ _intersect_ray(from: Vector3, to: Vector3, collision_mask: int64, collide_with_bodies: boolean, collide_with_areas: boolean, hit_from_inside: boolean, hit_back_faces: boolean, pick_ray: boolean, result: int64): boolean - /* gdvirtual */ _intersect_point(position: Vector3, collision_mask: int64, collide_with_bodies: boolean, collide_with_areas: boolean, results: int64, max_results: int64): int64 - /* gdvirtual */ _intersect_shape(shape_rid: RID, transform: Transform3D, motion: Vector3, margin: float64, collision_mask: int64, collide_with_bodies: boolean, collide_with_areas: boolean, result_count: int64, max_results: int64): int64 - /* gdvirtual */ _cast_motion(shape_rid: RID, transform: Transform3D, motion: Vector3, margin: float64, collision_mask: int64, collide_with_bodies: boolean, collide_with_areas: boolean, closest_safe: int64, closest_unsafe: int64, info: int64): boolean - /* gdvirtual */ _collide_shape(shape_rid: RID, transform: Transform3D, motion: Vector3, margin: float64, collision_mask: int64, collide_with_bodies: boolean, collide_with_areas: boolean, results: int64, max_results: int64, result_count: int64): boolean - /* gdvirtual */ _rest_info(shape_rid: RID, transform: Transform3D, motion: Vector3, margin: float64, collision_mask: int64, collide_with_bodies: boolean, collide_with_areas: boolean, rest_info: int64): boolean - /* gdvirtual */ _get_closest_point_to_object_volume(object: RID, point: Vector3): Vector3 - is_body_excluded_from_query(body: RID): boolean - } - /** Holds physics-related properties of a surface, namely its roughness and bounciness. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_physicsmaterial.html - */ - class PhysicsMaterial extends Resource { - constructor(identifier?: any) - /** The body's friction. Values range from `0` (frictionless) to `1` (maximum friction). */ - get friction(): float64 - set friction(value: float64) - - /** If `true`, the physics engine will use the friction of the object marked as "rough" when two objects collide. If `false`, the physics engine will use the lowest friction of all colliding objects instead. If `true` for both colliding objects, the physics engine will use the highest friction. */ - get rough(): boolean - set rough(value: boolean) - - /** The body's bounciness. Values range from `0` (no bounce) to `1` (full bounciness). - * - * **Note:** Even with [member bounce] set to `1.0`, some energy will be lost over time due to linear and angular damping. To have a physics body that preserves all its energy over time, set [member bounce] to `1.0`, the body's linear damp mode to **Replace** (if applicable), its linear damp to `0.0`, its angular damp mode to **Replace** (if applicable), and its angular damp to `0.0`. - */ - get bounce(): float64 - set bounce(value: float64) - - /** If `true`, subtracts the bounciness from the colliding object's bounciness instead of adding it. */ - get absorbent(): boolean - set absorbent(value: boolean) - } - /** Provides parameters for [method PhysicsDirectSpaceState2D.intersect_point]. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_physicspointqueryparameters2d.html - */ - class PhysicsPointQueryParameters2D extends RefCounted { - constructor(identifier?: any) - /** The position being queried for, in global coordinates. */ - get position(): Vector2 - set position(value: Vector2) - - /** If different from `0`, restricts the query to a specific canvas layer specified by its instance ID. See [method Object.get_instance_id]. - * If `0`, restricts the query to the Viewport's default canvas layer. - */ - get canvas_instance_id(): int64 - set canvas_instance_id(value: int64) - - /** The physics layers the query will detect (as a bitmask). By default, all collision layers are detected. See [url=https://docs.godotengine.org/en/4.3/tutorials/physics/physics_introduction.html#collision-layers-and-masks]Collision layers and masks[/url] in the documentation for more information. */ - get collision_mask(): int64 - set collision_mask(value: int64) - - /** The list of object [RID]s that will be excluded from collisions. Use [method CollisionObject2D.get_rid] to get the [RID] associated with a [CollisionObject2D]-derived node. - * - * **Note:** The returned array is copied and any changes to it will not update the original property value. To update the value you need to modify the returned array, and then assign it to the property again. - */ - get exclude(): GArray - set exclude(value: GArray) - - /** If `true`, the query will take [PhysicsBody2D]s into account. */ - get collide_with_bodies(): boolean - set collide_with_bodies(value: boolean) - - /** If `true`, the query will take [Area2D]s into account. */ - get collide_with_areas(): boolean - set collide_with_areas(value: boolean) - } - /** Provides parameters for [method PhysicsDirectSpaceState3D.intersect_point]. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_physicspointqueryparameters3d.html - */ - class PhysicsPointQueryParameters3D extends RefCounted { - constructor(identifier?: any) - /** The position being queried for, in global coordinates. */ - get position(): Vector3 - set position(value: Vector3) - - /** The physics layers the query will detect (as a bitmask). By default, all collision layers are detected. See [url=https://docs.godotengine.org/en/4.3/tutorials/physics/physics_introduction.html#collision-layers-and-masks]Collision layers and masks[/url] in the documentation for more information. */ - get collision_mask(): int64 - set collision_mask(value: int64) - - /** The list of object [RID]s that will be excluded from collisions. Use [method CollisionObject3D.get_rid] to get the [RID] associated with a [CollisionObject3D]-derived node. - * - * **Note:** The returned array is copied and any changes to it will not update the original property value. To update the value you need to modify the returned array, and then assign it to the property again. - */ - get exclude(): GArray - set exclude(value: GArray) - - /** If `true`, the query will take [PhysicsBody3D]s into account. */ - get collide_with_bodies(): boolean - set collide_with_bodies(value: boolean) - - /** If `true`, the query will take [Area3D]s into account. */ - get collide_with_areas(): boolean - set collide_with_areas(value: boolean) - } - /** Provides parameters for [method PhysicsDirectSpaceState2D.intersect_ray]. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_physicsrayqueryparameters2d.html - */ - class PhysicsRayQueryParameters2D extends RefCounted { - constructor(identifier?: any) - /** Returns a new, pre-configured [PhysicsRayQueryParameters2D] object. Use it to quickly create query parameters using the most common options. - * - */ - static create(from: Vector2, to: Vector2, collision_mask: int64 = 4294967295, exclude: GArray = []): PhysicsRayQueryParameters2D - - /** The starting point of the ray being queried for, in global coordinates. */ - get from(): Vector2 - set from(value: Vector2) - - /** The ending point of the ray being queried for, in global coordinates. */ - get to(): Vector2 - set to(value: Vector2) - - /** The physics layers the query will detect (as a bitmask). By default, all collision layers are detected. See [url=https://docs.godotengine.org/en/4.3/tutorials/physics/physics_introduction.html#collision-layers-and-masks]Collision layers and masks[/url] in the documentation for more information. */ - get collision_mask(): int64 - set collision_mask(value: int64) - - /** The list of object [RID]s that will be excluded from collisions. Use [method CollisionObject2D.get_rid] to get the [RID] associated with a [CollisionObject2D]-derived node. - * - * **Note:** The returned array is copied and any changes to it will not update the original property value. To update the value you need to modify the returned array, and then assign it to the property again. - */ - get exclude(): GArray - set exclude(value: GArray) - - /** If `true`, the query will take [PhysicsBody2D]s into account. */ - get collide_with_bodies(): boolean - set collide_with_bodies(value: boolean) - - /** If `true`, the query will take [Area2D]s into account. */ - get collide_with_areas(): boolean - set collide_with_areas(value: boolean) - - /** If `true`, the query will detect a hit when starting inside shapes. In this case the collision normal will be `Vector2(0, 0)`. Does not affect concave polygon shapes. */ - get hit_from_inside(): boolean - set hit_from_inside(value: boolean) - } - /** Provides parameters for [method PhysicsDirectSpaceState3D.intersect_ray]. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_physicsrayqueryparameters3d.html - */ - class PhysicsRayQueryParameters3D extends RefCounted { - constructor(identifier?: any) - /** Returns a new, pre-configured [PhysicsRayQueryParameters3D] object. Use it to quickly create query parameters using the most common options. - * - */ - static create(from: Vector3, to: Vector3, collision_mask: int64 = 4294967295, exclude: GArray = []): PhysicsRayQueryParameters3D - - /** The starting point of the ray being queried for, in global coordinates. */ - get from(): Vector3 - set from(value: Vector3) - - /** The ending point of the ray being queried for, in global coordinates. */ - get to(): Vector3 - set to(value: Vector3) - - /** The physics layers the query will detect (as a bitmask). By default, all collision layers are detected. See [url=https://docs.godotengine.org/en/4.3/tutorials/physics/physics_introduction.html#collision-layers-and-masks]Collision layers and masks[/url] in the documentation for more information. */ - get collision_mask(): int64 - set collision_mask(value: int64) - - /** The list of object [RID]s that will be excluded from collisions. Use [method CollisionObject3D.get_rid] to get the [RID] associated with a [CollisionObject3D]-derived node. - * - * **Note:** The returned array is copied and any changes to it will not update the original property value. To update the value you need to modify the returned array, and then assign it to the property again. - */ - get exclude(): GArray - set exclude(value: GArray) - - /** If `true`, the query will take [PhysicsBody3D]s into account. */ - get collide_with_bodies(): boolean - set collide_with_bodies(value: boolean) - - /** If `true`, the query will take [Area3D]s into account. */ - get collide_with_areas(): boolean - set collide_with_areas(value: boolean) - - /** If `true`, the query will detect a hit when starting inside shapes. In this case the collision normal will be `Vector3(0, 0, 0)`. Does not affect concave polygon shapes or heightmap shapes. */ - get hit_from_inside(): boolean - set hit_from_inside(value: boolean) - - /** If `true`, the query will hit back faces with concave polygon shapes with back face enabled or heightmap shapes. */ - get hit_back_faces(): boolean - set hit_back_faces(value: boolean) - } - /** Provides virtual methods that can be overridden to create custom [PhysicsServer2D] implementations. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_physicsserver2dextension.html - */ - class PhysicsServer2DExtension extends PhysicsServer2D { - constructor(identifier?: any) - /** Overridable version of [method PhysicsServer2D.world_boundary_shape_create]. */ - /* gdvirtual */ _world_boundary_shape_create(): RID - - /** Overridable version of [method PhysicsServer2D.separation_ray_shape_create]. */ - /* gdvirtual */ _separation_ray_shape_create(): RID - - /** Overridable version of [method PhysicsServer2D.segment_shape_create]. */ - /* gdvirtual */ _segment_shape_create(): RID - - /** Overridable version of [method PhysicsServer2D.circle_shape_create]. */ - /* gdvirtual */ _circle_shape_create(): RID - - /** Overridable version of [method PhysicsServer2D.rectangle_shape_create]. */ - /* gdvirtual */ _rectangle_shape_create(): RID - - /** Overridable version of [method PhysicsServer2D.capsule_shape_create]. */ - /* gdvirtual */ _capsule_shape_create(): RID - - /** Overridable version of [method PhysicsServer2D.convex_polygon_shape_create]. */ - /* gdvirtual */ _convex_polygon_shape_create(): RID - - /** Overridable version of [method PhysicsServer2D.concave_polygon_shape_create]. */ - /* gdvirtual */ _concave_polygon_shape_create(): RID - - /** Overridable version of [method PhysicsServer2D.shape_set_data]. */ - /* gdvirtual */ _shape_set_data(shape: RID, data: any): void - - /** Should set the custom solver bias for the given [param shape]. It defines how much bodies are forced to separate on contact. - * Overridable version of [PhysicsServer2D]'s internal `shape_get_custom_solver_bias` method. Corresponds to [member Shape2D.custom_solver_bias]. - */ - /* gdvirtual */ _shape_set_custom_solver_bias(shape: RID, bias: float64): void - - /** Overridable version of [method PhysicsServer2D.shape_get_type]. */ - /* gdvirtual */ _shape_get_type(shape: RID): PhysicsServer2D.ShapeType - - /** Overridable version of [method PhysicsServer2D.shape_get_data]. */ - /* gdvirtual */ _shape_get_data(shape: RID): any - - /** Should return the custom solver bias of the given [param shape], which defines how much bodies are forced to separate on contact when this shape is involved. - * Overridable version of [PhysicsServer2D]'s internal `shape_get_custom_solver_bias` method. Corresponds to [member Shape2D.custom_solver_bias]. - */ - /* gdvirtual */ _shape_get_custom_solver_bias(shape: RID): float64 - - /** Given two shapes and their parameters, should return `true` if a collision between the two would occur, with additional details passed in [param results]. - * Overridable version of [PhysicsServer2D]'s internal `shape_collide` method. Corresponds to [method PhysicsDirectSpaceState2D.collide_shape]. - */ - /* gdvirtual */ _shape_collide(shape_A: RID, xform_A: Transform2D, motion_A: Vector2, shape_B: RID, xform_B: Transform2D, motion_B: Vector2, results: int64, result_max: int64, result_count: int64): boolean - - /** Overridable version of [method PhysicsServer2D.space_create]. */ - /* gdvirtual */ _space_create(): RID - - /** Overridable version of [method PhysicsServer2D.space_set_active]. */ - /* gdvirtual */ _space_set_active(space: RID, active: boolean): void - - /** Overridable version of [method PhysicsServer2D.space_is_active]. */ - /* gdvirtual */ _space_is_active(space: RID): boolean - - /** Overridable version of [method PhysicsServer2D.space_set_param]. */ - /* gdvirtual */ _space_set_param(space: RID, param: PhysicsServer2D.SpaceParameter, value: float64): void - - /** Overridable version of [method PhysicsServer2D.space_get_param]. */ - /* gdvirtual */ _space_get_param(space: RID, param: PhysicsServer2D.SpaceParameter): float64 - - /** Overridable version of [method PhysicsServer2D.space_get_direct_state]. */ - /* gdvirtual */ _space_get_direct_state(space: RID): PhysicsDirectSpaceState2D - - /** Used internally to allow the given [param space] to store contact points, up to [param max_contacts]. This is automatically set for the main [World2D]'s space when [member SceneTree.debug_collisions_hint] is `true`, or by checking "Visible Collision Shapes" in the editor. Only works in debug builds. - * Overridable version of [PhysicsServer2D]'s internal `space_set_debug_contacts` method. - */ - /* gdvirtual */ _space_set_debug_contacts(space: RID, max_contacts: int64): void - - /** Should return the positions of all contacts that have occurred during the last physics step in the given [param space]. See also [method _space_get_contact_count] and [method _space_set_debug_contacts]. - * Overridable version of [PhysicsServer2D]'s internal `space_get_contacts` method. - */ - /* gdvirtual */ _space_get_contacts(space: RID): PackedVector2Array - - /** Should return how many contacts have occurred during the last physics step in the given [param space]. See also [method _space_get_contacts] and [method _space_set_debug_contacts]. - * Overridable version of [PhysicsServer2D]'s internal `space_get_contact_count` method. - */ - /* gdvirtual */ _space_get_contact_count(space: RID): int64 - - /** Overridable version of [method PhysicsServer2D.area_create]. */ - /* gdvirtual */ _area_create(): RID - - /** Overridable version of [method PhysicsServer2D.area_set_space]. */ - /* gdvirtual */ _area_set_space(area: RID, space: RID): void - - /** Overridable version of [method PhysicsServer2D.area_get_space]. */ - /* gdvirtual */ _area_get_space(area: RID): RID - - /** Overridable version of [method PhysicsServer2D.area_add_shape]. */ - /* gdvirtual */ _area_add_shape(area: RID, shape: RID, transform: Transform2D, disabled: boolean): void - - /** Overridable version of [method PhysicsServer2D.area_set_shape]. */ - /* gdvirtual */ _area_set_shape(area: RID, shape_idx: int64, shape: RID): void - - /** Overridable version of [method PhysicsServer2D.area_set_shape_transform]. */ - /* gdvirtual */ _area_set_shape_transform(area: RID, shape_idx: int64, transform: Transform2D): void - - /** Overridable version of [method PhysicsServer2D.area_set_shape_disabled]. */ - /* gdvirtual */ _area_set_shape_disabled(area: RID, shape_idx: int64, disabled: boolean): void - - /** Overridable version of [method PhysicsServer2D.area_get_shape_count]. */ - /* gdvirtual */ _area_get_shape_count(area: RID): int64 - - /** Overridable version of [method PhysicsServer2D.area_get_shape]. */ - /* gdvirtual */ _area_get_shape(area: RID, shape_idx: int64): RID - - /** Overridable version of [method PhysicsServer2D.area_get_shape_transform]. */ - /* gdvirtual */ _area_get_shape_transform(area: RID, shape_idx: int64): Transform2D - - /** Overridable version of [method PhysicsServer2D.area_remove_shape]. */ - /* gdvirtual */ _area_remove_shape(area: RID, shape_idx: int64): void - - /** Overridable version of [method PhysicsServer2D.area_clear_shapes]. */ - /* gdvirtual */ _area_clear_shapes(area: RID): void - - /** Overridable version of [method PhysicsServer2D.area_attach_object_instance_id]. */ - /* gdvirtual */ _area_attach_object_instance_id(area: RID, id: int64): void - - /** Overridable version of [method PhysicsServer2D.area_get_object_instance_id]. */ - /* gdvirtual */ _area_get_object_instance_id(area: RID): int64 - - /** Overridable version of [method PhysicsServer2D.area_attach_canvas_instance_id]. */ - /* gdvirtual */ _area_attach_canvas_instance_id(area: RID, id: int64): void - - /** Overridable version of [method PhysicsServer2D.area_get_canvas_instance_id]. */ - /* gdvirtual */ _area_get_canvas_instance_id(area: RID): int64 - - /** Overridable version of [method PhysicsServer2D.area_set_param]. */ - /* gdvirtual */ _area_set_param(area: RID, param: PhysicsServer2D.AreaParameter, value: any): void - - /** Overridable version of [method PhysicsServer2D.area_set_transform]. */ - /* gdvirtual */ _area_set_transform(area: RID, transform: Transform2D): void - - /** Overridable version of [method PhysicsServer2D.area_get_param]. */ - /* gdvirtual */ _area_get_param(area: RID, param: PhysicsServer2D.AreaParameter): any - - /** Overridable version of [method PhysicsServer2D.area_get_transform]. */ - /* gdvirtual */ _area_get_transform(area: RID): Transform2D - - /** Overridable version of [method PhysicsServer2D.area_set_collision_layer]. */ - /* gdvirtual */ _area_set_collision_layer(area: RID, layer: int64): void - - /** Overridable version of [method PhysicsServer2D.area_get_collision_layer]. */ - /* gdvirtual */ _area_get_collision_layer(area: RID): int64 - - /** Overridable version of [method PhysicsServer2D.area_set_collision_mask]. */ - /* gdvirtual */ _area_set_collision_mask(area: RID, mask: int64): void - - /** Overridable version of [method PhysicsServer2D.area_get_collision_mask]. */ - /* gdvirtual */ _area_get_collision_mask(area: RID): int64 - - /** Overridable version of [method PhysicsServer2D.area_set_monitorable]. */ - /* gdvirtual */ _area_set_monitorable(area: RID, monitorable: boolean): void - - /** If set to `true`, allows the area with the given [RID] to detect mouse inputs when the mouse cursor is hovering on it. - * Overridable version of [PhysicsServer2D]'s internal `area_set_pickable` method. Corresponds to [member CollisionObject2D.input_pickable]. - */ - /* gdvirtual */ _area_set_pickable(area: RID, pickable: boolean): void - - /** Overridable version of [method PhysicsServer2D.area_set_monitor_callback]. */ - /* gdvirtual */ _area_set_monitor_callback(area: RID, callback: Callable): void - - /** Overridable version of [method PhysicsServer2D.area_set_area_monitor_callback]. */ - /* gdvirtual */ _area_set_area_monitor_callback(area: RID, callback: Callable): void - - /** Overridable version of [method PhysicsServer2D.body_create]. */ - /* gdvirtual */ _body_create(): RID - - /** Overridable version of [method PhysicsServer2D.body_set_space]. */ - /* gdvirtual */ _body_set_space(body: RID, space: RID): void - - /** Overridable version of [method PhysicsServer2D.body_get_space]. */ - /* gdvirtual */ _body_get_space(body: RID): RID - - /** Overridable version of [method PhysicsServer2D.body_set_mode]. */ - /* gdvirtual */ _body_set_mode(body: RID, mode: PhysicsServer2D.BodyMode): void - - /** Overridable version of [method PhysicsServer2D.body_get_mode]. */ - /* gdvirtual */ _body_get_mode(body: RID): PhysicsServer2D.BodyMode - - /** Overridable version of [method PhysicsServer2D.body_add_shape]. */ - /* gdvirtual */ _body_add_shape(body: RID, shape: RID, transform: Transform2D, disabled: boolean): void - - /** Overridable version of [method PhysicsServer2D.body_set_shape]. */ - /* gdvirtual */ _body_set_shape(body: RID, shape_idx: int64, shape: RID): void - - /** Overridable version of [method PhysicsServer2D.body_set_shape_transform]. */ - /* gdvirtual */ _body_set_shape_transform(body: RID, shape_idx: int64, transform: Transform2D): void - - /** Overridable version of [method PhysicsServer2D.body_get_shape_count]. */ - /* gdvirtual */ _body_get_shape_count(body: RID): int64 - - /** Overridable version of [method PhysicsServer2D.body_get_shape]. */ - /* gdvirtual */ _body_get_shape(body: RID, shape_idx: int64): RID - - /** Overridable version of [method PhysicsServer2D.body_get_shape_transform]. */ - /* gdvirtual */ _body_get_shape_transform(body: RID, shape_idx: int64): Transform2D - - /** Overridable version of [method PhysicsServer2D.body_set_shape_disabled]. */ - /* gdvirtual */ _body_set_shape_disabled(body: RID, shape_idx: int64, disabled: boolean): void - - /** Overridable version of [method PhysicsServer2D.body_set_shape_as_one_way_collision]. */ - /* gdvirtual */ _body_set_shape_as_one_way_collision(body: RID, shape_idx: int64, enable: boolean, margin: float64): void - - /** Overridable version of [method PhysicsServer2D.body_remove_shape]. */ - /* gdvirtual */ _body_remove_shape(body: RID, shape_idx: int64): void - - /** Overridable version of [method PhysicsServer2D.body_clear_shapes]. */ - /* gdvirtual */ _body_clear_shapes(body: RID): void - - /** Overridable version of [method PhysicsServer2D.body_attach_object_instance_id]. */ - /* gdvirtual */ _body_attach_object_instance_id(body: RID, id: int64): void - - /** Overridable version of [method PhysicsServer2D.body_get_object_instance_id]. */ - /* gdvirtual */ _body_get_object_instance_id(body: RID): int64 - - /** Overridable version of [method PhysicsServer2D.body_attach_canvas_instance_id]. */ - /* gdvirtual */ _body_attach_canvas_instance_id(body: RID, id: int64): void - - /** Overridable version of [method PhysicsServer2D.body_get_canvas_instance_id]. */ - /* gdvirtual */ _body_get_canvas_instance_id(body: RID): int64 - - /** Overridable version of [method PhysicsServer2D.body_set_continuous_collision_detection_mode]. */ - /* gdvirtual */ _body_set_continuous_collision_detection_mode(body: RID, mode: PhysicsServer2D.CCDMode): void - - /** Overridable version of [method PhysicsServer2D.body_get_continuous_collision_detection_mode]. */ - /* gdvirtual */ _body_get_continuous_collision_detection_mode(body: RID): PhysicsServer2D.CCDMode - - /** Overridable version of [method PhysicsServer2D.body_set_collision_layer]. */ - /* gdvirtual */ _body_set_collision_layer(body: RID, layer: int64): void - - /** Overridable version of [method PhysicsServer2D.body_get_collision_layer]. */ - /* gdvirtual */ _body_get_collision_layer(body: RID): int64 - - /** Overridable version of [method PhysicsServer2D.body_set_collision_mask]. */ - /* gdvirtual */ _body_set_collision_mask(body: RID, mask: int64): void - - /** Overridable version of [method PhysicsServer2D.body_get_collision_mask]. */ - /* gdvirtual */ _body_get_collision_mask(body: RID): int64 - - /** Overridable version of [method PhysicsServer2D.body_set_collision_priority]. */ - /* gdvirtual */ _body_set_collision_priority(body: RID, priority: float64): void - - /** Overridable version of [method PhysicsServer2D.body_get_collision_priority]. */ - /* gdvirtual */ _body_get_collision_priority(body: RID): float64 - - /** Overridable version of [method PhysicsServer2D.body_set_param]. */ - /* gdvirtual */ _body_set_param(body: RID, param: PhysicsServer2D.BodyParameter, value: any): void - - /** Overridable version of [method PhysicsServer2D.body_get_param]. */ - /* gdvirtual */ _body_get_param(body: RID, param: PhysicsServer2D.BodyParameter): any - - /** Overridable version of [method PhysicsServer2D.body_reset_mass_properties]. */ - /* gdvirtual */ _body_reset_mass_properties(body: RID): void - - /** Overridable version of [method PhysicsServer2D.body_set_state]. */ - /* gdvirtual */ _body_set_state(body: RID, state: PhysicsServer2D.BodyState, value: any): void - - /** Overridable version of [method PhysicsServer2D.body_get_state]. */ - /* gdvirtual */ _body_get_state(body: RID, state: PhysicsServer2D.BodyState): any - - /** Overridable version of [method PhysicsServer2D.body_apply_central_impulse]. */ - /* gdvirtual */ _body_apply_central_impulse(body: RID, impulse: Vector2): void - - /** Overridable version of [method PhysicsServer2D.body_apply_torque_impulse]. */ - /* gdvirtual */ _body_apply_torque_impulse(body: RID, impulse: float64): void - - /** Overridable version of [method PhysicsServer2D.body_apply_impulse]. */ - /* gdvirtual */ _body_apply_impulse(body: RID, impulse: Vector2, position: Vector2): void - - /** Overridable version of [method PhysicsServer2D.body_apply_central_force]. */ - /* gdvirtual */ _body_apply_central_force(body: RID, force: Vector2): void - - /** Overridable version of [method PhysicsServer2D.body_apply_force]. */ - /* gdvirtual */ _body_apply_force(body: RID, force: Vector2, position: Vector2): void - - /** Overridable version of [method PhysicsServer2D.body_apply_torque]. */ - /* gdvirtual */ _body_apply_torque(body: RID, torque: float64): void - - /** Overridable version of [method PhysicsServer2D.body_add_constant_central_force]. */ - /* gdvirtual */ _body_add_constant_central_force(body: RID, force: Vector2): void - - /** Overridable version of [method PhysicsServer2D.body_add_constant_force]. */ - /* gdvirtual */ _body_add_constant_force(body: RID, force: Vector2, position: Vector2): void - - /** Overridable version of [method PhysicsServer2D.body_add_constant_torque]. */ - /* gdvirtual */ _body_add_constant_torque(body: RID, torque: float64): void - - /** Overridable version of [method PhysicsServer2D.body_set_constant_force]. */ - /* gdvirtual */ _body_set_constant_force(body: RID, force: Vector2): void - - /** Overridable version of [method PhysicsServer2D.body_get_constant_force]. */ - /* gdvirtual */ _body_get_constant_force(body: RID): Vector2 - - /** Overridable version of [method PhysicsServer2D.body_set_constant_torque]. */ - /* gdvirtual */ _body_set_constant_torque(body: RID, torque: float64): void - - /** Overridable version of [method PhysicsServer2D.body_get_constant_torque]. */ - /* gdvirtual */ _body_get_constant_torque(body: RID): float64 - - /** Overridable version of [method PhysicsServer2D.body_set_axis_velocity]. */ - /* gdvirtual */ _body_set_axis_velocity(body: RID, axis_velocity: Vector2): void - - /** Overridable version of [method PhysicsServer2D.body_add_collision_exception]. */ - /* gdvirtual */ _body_add_collision_exception(body: RID, excepted_body: RID): void - - /** Overridable version of [method PhysicsServer2D.body_remove_collision_exception]. */ - /* gdvirtual */ _body_remove_collision_exception(body: RID, excepted_body: RID): void - - /** Returns the [RID]s of all bodies added as collision exceptions for the given [param body]. See also [method _body_add_collision_exception] and [method _body_remove_collision_exception]. - * Overridable version of [PhysicsServer2D]'s internal `body_get_collision_exceptions` method. Corresponds to [method PhysicsBody2D.get_collision_exceptions]. - */ - /* gdvirtual */ _body_get_collision_exceptions(body: RID): GArray - - /** Overridable version of [method PhysicsServer2D.body_set_max_contacts_reported]. */ - /* gdvirtual */ _body_set_max_contacts_reported(body: RID, amount: int64): void - - /** Overridable version of [method PhysicsServer2D.body_get_max_contacts_reported]. */ - /* gdvirtual */ _body_get_max_contacts_reported(body: RID): int64 - - /** Overridable version of [PhysicsServer2D]'s internal `body_set_contacts_reported_depth_threshold` method. - * - * **Note:** This method is currently unused by Godot's default physics implementation. - */ - /* gdvirtual */ _body_set_contacts_reported_depth_threshold(body: RID, threshold: float64): void - - /** Overridable version of [PhysicsServer2D]'s internal `body_get_contacts_reported_depth_threshold` method. - * - * **Note:** This method is currently unused by Godot's default physics implementation. - */ - /* gdvirtual */ _body_get_contacts_reported_depth_threshold(body: RID): float64 - - /** Overridable version of [method PhysicsServer2D.body_set_omit_force_integration]. */ - /* gdvirtual */ _body_set_omit_force_integration(body: RID, enable: boolean): void - - /** Overridable version of [method PhysicsServer2D.body_is_omitting_force_integration]. */ - /* gdvirtual */ _body_is_omitting_force_integration(body: RID): boolean - - /** Assigns the [param body] to call the given [param callable] during the synchronization phase of the loop, before [method _step] is called. See also [method _sync]. - * Overridable version of [method PhysicsServer2D.body_set_state_sync_callback]. - */ - /* gdvirtual */ _body_set_state_sync_callback(body: RID, callable: Callable): void - - /** Overridable version of [method PhysicsServer2D.body_set_force_integration_callback]. */ - /* gdvirtual */ _body_set_force_integration_callback(body: RID, callable: Callable, userdata: any): void - - /** Given a [param body], a [param shape], and their respective parameters, this method should return `true` if a collision between the two would occur, with additional details passed in [param results]. - * Overridable version of [PhysicsServer2D]'s internal `shape_collide` method. Corresponds to [method PhysicsDirectSpaceState2D.collide_shape]. - */ - /* gdvirtual */ _body_collide_shape(body: RID, body_shape: int64, shape: RID, shape_xform: Transform2D, motion: Vector2, results: int64, result_max: int64, result_count: int64): boolean - - /** If set to `true`, allows the body with the given [RID] to detect mouse inputs when the mouse cursor is hovering on it. - * Overridable version of [PhysicsServer2D]'s internal `body_set_pickable` method. Corresponds to [member CollisionObject2D.input_pickable]. - */ - /* gdvirtual */ _body_set_pickable(body: RID, pickable: boolean): void - - /** Overridable version of [method PhysicsServer2D.body_get_direct_state]. */ - /* gdvirtual */ _body_get_direct_state(body: RID): PhysicsDirectBodyState2D - - /** Overridable version of [method PhysicsServer2D.body_test_motion]. Unlike the exposed implementation, this method does not receive all of the arguments inside a [PhysicsTestMotionParameters2D]. */ - /* gdvirtual */ _body_test_motion(body: RID, from: Transform2D, motion: Vector2, margin: float64, collide_separation_ray: boolean, recovery_as_collision: boolean, result: int64): boolean - - /** Overridable version of [method PhysicsServer2D.joint_create]. */ - /* gdvirtual */ _joint_create(): RID - - /** Overridable version of [method PhysicsServer2D.joint_clear]. */ - /* gdvirtual */ _joint_clear(joint: RID): void - - /** Overridable version of [method PhysicsServer2D.joint_set_param]. */ - /* gdvirtual */ _joint_set_param(joint: RID, param: PhysicsServer2D.JointParam, value: float64): void - - /** Overridable version of [method PhysicsServer2D.joint_get_param]. */ - /* gdvirtual */ _joint_get_param(joint: RID, param: PhysicsServer2D.JointParam): float64 - - /** Overridable version of [method PhysicsServer2D.joint_disable_collisions_between_bodies]. */ - /* gdvirtual */ _joint_disable_collisions_between_bodies(joint: RID, disable: boolean): void - - /** Overridable version of [method PhysicsServer2D.joint_is_disabled_collisions_between_bodies]. */ - /* gdvirtual */ _joint_is_disabled_collisions_between_bodies(joint: RID): boolean - - /** Overridable version of [method PhysicsServer2D.joint_make_pin]. */ - /* gdvirtual */ _joint_make_pin(joint: RID, anchor: Vector2, body_a: RID, body_b: RID): void - - /** Overridable version of [method PhysicsServer2D.joint_make_groove]. */ - /* gdvirtual */ _joint_make_groove(joint: RID, a_groove1: Vector2, a_groove2: Vector2, b_anchor: Vector2, body_a: RID, body_b: RID): void - - /** Overridable version of [method PhysicsServer2D.joint_make_damped_spring]. */ - /* gdvirtual */ _joint_make_damped_spring(joint: RID, anchor_a: Vector2, anchor_b: Vector2, body_a: RID, body_b: RID): void - - /** Overridable version of [method PhysicsServer2D.pin_joint_set_flag]. */ - /* gdvirtual */ _pin_joint_set_flag(joint: RID, flag: PhysicsServer2D.PinJointFlag, enabled: boolean): void - - /** Overridable version of [method PhysicsServer2D.pin_joint_get_flag]. */ - /* gdvirtual */ _pin_joint_get_flag(joint: RID, flag: PhysicsServer2D.PinJointFlag): boolean - - /** Overridable version of [method PhysicsServer2D.pin_joint_set_param]. */ - /* gdvirtual */ _pin_joint_set_param(joint: RID, param: PhysicsServer2D.PinJointParam, value: float64): void - - /** Overridable version of [method PhysicsServer2D.pin_joint_get_param]. */ - /* gdvirtual */ _pin_joint_get_param(joint: RID, param: PhysicsServer2D.PinJointParam): float64 - - /** Overridable version of [method PhysicsServer2D.damped_spring_joint_set_param]. */ - /* gdvirtual */ _damped_spring_joint_set_param(joint: RID, param: PhysicsServer2D.DampedSpringParam, value: float64): void - - /** Overridable version of [method PhysicsServer2D.damped_spring_joint_get_param]. */ - /* gdvirtual */ _damped_spring_joint_get_param(joint: RID, param: PhysicsServer2D.DampedSpringParam): float64 - - /** Overridable version of [method PhysicsServer2D.joint_get_type]. */ - /* gdvirtual */ _joint_get_type(joint: RID): PhysicsServer2D.JointType - - /** Overridable version of [method PhysicsServer2D.free_rid]. */ - /* gdvirtual */ _free_rid(rid: RID): void - - /** Overridable version of [method PhysicsServer2D.set_active]. */ - /* gdvirtual */ _set_active(active: boolean): void - - /** Called when the main loop is initialized and creates a new instance of this physics server. See also [method MainLoop._initialize] and [method _finish]. - * Overridable version of [PhysicsServer2D]'s internal `init` method. - */ - /* gdvirtual */ _init(): void - - /** Called every physics step to process the physics simulation. [param step] is the time elapsed since the last physics step, in seconds. It is usually the same as [method Node.get_physics_process_delta_time]. - * Overridable version of [PhysicsServer2D]'s internal [code skip-lint]step` method. - */ - /* gdvirtual */ _step(step: float64): void - - /** Called to indicate that the physics server is synchronizing and cannot access physics states if running on a separate thread. See also [method _end_sync]. - * Overridable version of [PhysicsServer2D]'s internal `sync` method. - */ - /* gdvirtual */ _sync(): void - - /** Called every physics step before [method _step] to process all remaining queries. - * Overridable version of [PhysicsServer2D]'s internal `flush_queries` method. - */ - /* gdvirtual */ _flush_queries(): void - - /** Called to indicate that the physics server has stopped synchronizing. It is in the loop's iteration/physics phase, and can access physics objects even if running on a separate thread. See also [method _sync]. - * Overridable version of [PhysicsServer2D]'s internal `end_sync` method. - */ - /* gdvirtual */ _end_sync(): void - - /** Called when the main loop finalizes to shut down the physics server. See also [method MainLoop._finalize] and [method _init]. - * Overridable version of [PhysicsServer2D]'s internal `finish` method. - */ - /* gdvirtual */ _finish(): void - - /** Overridable method that should return `true` when the physics server is processing queries. See also [method _flush_queries]. - * Overridable version of [PhysicsServer2D]'s internal `is_flushing_queries` method. - */ - /* gdvirtual */ _is_flushing_queries(): boolean - - /** Overridable version of [method PhysicsServer2D.get_process_info]. */ - /* gdvirtual */ _get_process_info(process_info: PhysicsServer2D.ProcessInfo): int64 - - /** Returns `true` if the body with the given [RID] is being excluded from [method _body_test_motion]. See also [method Object.get_instance_id]. */ - body_test_motion_is_excluding_body(body: RID): boolean - - /** Returns `true` if the object with the given instance ID is being excluded from [method _body_test_motion]. See also [method Object.get_instance_id]. */ - body_test_motion_is_excluding_object(object: int64): boolean - } - /** Provides virtual methods that can be overridden to create custom [PhysicsServer3D] implementations. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_physicsserver3dextension.html - */ - class PhysicsServer3DExtension extends PhysicsServer3D { - constructor(identifier?: any) - /* gdvirtual */ _world_boundary_shape_create(): RID - /* gdvirtual */ _separation_ray_shape_create(): RID - /* gdvirtual */ _sphere_shape_create(): RID - /* gdvirtual */ _box_shape_create(): RID - /* gdvirtual */ _capsule_shape_create(): RID - /* gdvirtual */ _cylinder_shape_create(): RID - /* gdvirtual */ _convex_polygon_shape_create(): RID - /* gdvirtual */ _concave_polygon_shape_create(): RID - /* gdvirtual */ _heightmap_shape_create(): RID - /* gdvirtual */ _custom_shape_create(): RID - /* gdvirtual */ _shape_set_data(shape: RID, data: any): void - /* gdvirtual */ _shape_set_custom_solver_bias(shape: RID, bias: float64): void - /* gdvirtual */ _shape_set_margin(shape: RID, margin: float64): void - /* gdvirtual */ _shape_get_margin(shape: RID): float64 - /* gdvirtual */ _shape_get_type(shape: RID): PhysicsServer3D.ShapeType - /* gdvirtual */ _shape_get_data(shape: RID): any - /* gdvirtual */ _shape_get_custom_solver_bias(shape: RID): float64 - /* gdvirtual */ _space_create(): RID - /* gdvirtual */ _space_set_active(space: RID, active: boolean): void - /* gdvirtual */ _space_is_active(space: RID): boolean - /* gdvirtual */ _space_set_param(space: RID, param: PhysicsServer3D.SpaceParameter, value: float64): void - /* gdvirtual */ _space_get_param(space: RID, param: PhysicsServer3D.SpaceParameter): float64 - /* gdvirtual */ _space_get_direct_state(space: RID): PhysicsDirectSpaceState3D - /* gdvirtual */ _space_set_debug_contacts(space: RID, max_contacts: int64): void - /* gdvirtual */ _space_get_contacts(space: RID): PackedVector3Array - /* gdvirtual */ _space_get_contact_count(space: RID): int64 - /* gdvirtual */ _area_create(): RID - /* gdvirtual */ _area_set_space(area: RID, space: RID): void - /* gdvirtual */ _area_get_space(area: RID): RID - /* gdvirtual */ _area_add_shape(area: RID, shape: RID, transform: Transform3D, disabled: boolean): void - /* gdvirtual */ _area_set_shape(area: RID, shape_idx: int64, shape: RID): void - /* gdvirtual */ _area_set_shape_transform(area: RID, shape_idx: int64, transform: Transform3D): void - /* gdvirtual */ _area_set_shape_disabled(area: RID, shape_idx: int64, disabled: boolean): void - /* gdvirtual */ _area_get_shape_count(area: RID): int64 - /* gdvirtual */ _area_get_shape(area: RID, shape_idx: int64): RID - /* gdvirtual */ _area_get_shape_transform(area: RID, shape_idx: int64): Transform3D - /* gdvirtual */ _area_remove_shape(area: RID, shape_idx: int64): void - /* gdvirtual */ _area_clear_shapes(area: RID): void - /* gdvirtual */ _area_attach_object_instance_id(area: RID, id: int64): void - /* gdvirtual */ _area_get_object_instance_id(area: RID): int64 - /* gdvirtual */ _area_set_param(area: RID, param: PhysicsServer3D.AreaParameter, value: any): void - /* gdvirtual */ _area_set_transform(area: RID, transform: Transform3D): void - /* gdvirtual */ _area_get_param(area: RID, param: PhysicsServer3D.AreaParameter): any - /* gdvirtual */ _area_get_transform(area: RID): Transform3D - /* gdvirtual */ _area_set_collision_layer(area: RID, layer: int64): void - /* gdvirtual */ _area_get_collision_layer(area: RID): int64 - /* gdvirtual */ _area_set_collision_mask(area: RID, mask: int64): void - /* gdvirtual */ _area_get_collision_mask(area: RID): int64 - /* gdvirtual */ _area_set_monitorable(area: RID, monitorable: boolean): void - /* gdvirtual */ _area_set_ray_pickable(area: RID, enable: boolean): void - /* gdvirtual */ _area_set_monitor_callback(area: RID, callback: Callable): void - /* gdvirtual */ _area_set_area_monitor_callback(area: RID, callback: Callable): void - /* gdvirtual */ _body_create(): RID - /* gdvirtual */ _body_set_space(body: RID, space: RID): void - /* gdvirtual */ _body_get_space(body: RID): RID - /* gdvirtual */ _body_set_mode(body: RID, mode: PhysicsServer3D.BodyMode): void - /* gdvirtual */ _body_get_mode(body: RID): PhysicsServer3D.BodyMode - /* gdvirtual */ _body_add_shape(body: RID, shape: RID, transform: Transform3D, disabled: boolean): void - /* gdvirtual */ _body_set_shape(body: RID, shape_idx: int64, shape: RID): void - /* gdvirtual */ _body_set_shape_transform(body: RID, shape_idx: int64, transform: Transform3D): void - /* gdvirtual */ _body_set_shape_disabled(body: RID, shape_idx: int64, disabled: boolean): void - /* gdvirtual */ _body_get_shape_count(body: RID): int64 - /* gdvirtual */ _body_get_shape(body: RID, shape_idx: int64): RID - /* gdvirtual */ _body_get_shape_transform(body: RID, shape_idx: int64): Transform3D - /* gdvirtual */ _body_remove_shape(body: RID, shape_idx: int64): void - /* gdvirtual */ _body_clear_shapes(body: RID): void - /* gdvirtual */ _body_attach_object_instance_id(body: RID, id: int64): void - /* gdvirtual */ _body_get_object_instance_id(body: RID): int64 - /* gdvirtual */ _body_set_enable_continuous_collision_detection(body: RID, enable: boolean): void - /* gdvirtual */ _body_is_continuous_collision_detection_enabled(body: RID): boolean - /* gdvirtual */ _body_set_collision_layer(body: RID, layer: int64): void - /* gdvirtual */ _body_get_collision_layer(body: RID): int64 - /* gdvirtual */ _body_set_collision_mask(body: RID, mask: int64): void - /* gdvirtual */ _body_get_collision_mask(body: RID): int64 - /* gdvirtual */ _body_set_collision_priority(body: RID, priority: float64): void - /* gdvirtual */ _body_get_collision_priority(body: RID): float64 - /* gdvirtual */ _body_set_user_flags(body: RID, flags: int64): void - /* gdvirtual */ _body_get_user_flags(body: RID): int64 - /* gdvirtual */ _body_set_param(body: RID, param: PhysicsServer3D.BodyParameter, value: any): void - /* gdvirtual */ _body_get_param(body: RID, param: PhysicsServer3D.BodyParameter): any - /* gdvirtual */ _body_reset_mass_properties(body: RID): void - /* gdvirtual */ _body_set_state(body: RID, state: PhysicsServer3D.BodyState, value: any): void - /* gdvirtual */ _body_get_state(body: RID, state: PhysicsServer3D.BodyState): any - /* gdvirtual */ _body_apply_central_impulse(body: RID, impulse: Vector3): void - /* gdvirtual */ _body_apply_impulse(body: RID, impulse: Vector3, position: Vector3): void - /* gdvirtual */ _body_apply_torque_impulse(body: RID, impulse: Vector3): void - /* gdvirtual */ _body_apply_central_force(body: RID, force: Vector3): void - /* gdvirtual */ _body_apply_force(body: RID, force: Vector3, position: Vector3): void - /* gdvirtual */ _body_apply_torque(body: RID, torque: Vector3): void - /* gdvirtual */ _body_add_constant_central_force(body: RID, force: Vector3): void - /* gdvirtual */ _body_add_constant_force(body: RID, force: Vector3, position: Vector3): void - /* gdvirtual */ _body_add_constant_torque(body: RID, torque: Vector3): void - /* gdvirtual */ _body_set_constant_force(body: RID, force: Vector3): void - /* gdvirtual */ _body_get_constant_force(body: RID): Vector3 - /* gdvirtual */ _body_set_constant_torque(body: RID, torque: Vector3): void - /* gdvirtual */ _body_get_constant_torque(body: RID): Vector3 - /* gdvirtual */ _body_set_axis_velocity(body: RID, axis_velocity: Vector3): void - /* gdvirtual */ _body_set_axis_lock(body: RID, axis: PhysicsServer3D.BodyAxis, lock: boolean): void - /* gdvirtual */ _body_is_axis_locked(body: RID, axis: PhysicsServer3D.BodyAxis): boolean - /* gdvirtual */ _body_add_collision_exception(body: RID, excepted_body: RID): void - /* gdvirtual */ _body_remove_collision_exception(body: RID, excepted_body: RID): void - /* gdvirtual */ _body_get_collision_exceptions(body: RID): GArray - /* gdvirtual */ _body_set_max_contacts_reported(body: RID, amount: int64): void - /* gdvirtual */ _body_get_max_contacts_reported(body: RID): int64 - /* gdvirtual */ _body_set_contacts_reported_depth_threshold(body: RID, threshold: float64): void - /* gdvirtual */ _body_get_contacts_reported_depth_threshold(body: RID): float64 - /* gdvirtual */ _body_set_omit_force_integration(body: RID, enable: boolean): void - /* gdvirtual */ _body_is_omitting_force_integration(body: RID): boolean - /* gdvirtual */ _body_set_state_sync_callback(body: RID, callable: Callable): void - /* gdvirtual */ _body_set_force_integration_callback(body: RID, callable: Callable, userdata: any): void - /* gdvirtual */ _body_set_ray_pickable(body: RID, enable: boolean): void - /* gdvirtual */ _body_test_motion(body: RID, from: Transform3D, motion: Vector3, margin: float64, max_collisions: int64, collide_separation_ray: boolean, recovery_as_collision: boolean, result: int64): boolean - /* gdvirtual */ _body_get_direct_state(body: RID): PhysicsDirectBodyState3D - /* gdvirtual */ _soft_body_create(): RID - /* gdvirtual */ _soft_body_update_rendering_server(body: RID, rendering_server_handler: PhysicsServer3DRenderingServerHandler): void - /* gdvirtual */ _soft_body_set_space(body: RID, space: RID): void - /* gdvirtual */ _soft_body_get_space(body: RID): RID - /* gdvirtual */ _soft_body_set_ray_pickable(body: RID, enable: boolean): void - /* gdvirtual */ _soft_body_set_collision_layer(body: RID, layer: int64): void - /* gdvirtual */ _soft_body_get_collision_layer(body: RID): int64 - /* gdvirtual */ _soft_body_set_collision_mask(body: RID, mask: int64): void - /* gdvirtual */ _soft_body_get_collision_mask(body: RID): int64 - /* gdvirtual */ _soft_body_add_collision_exception(body: RID, body_b: RID): void - /* gdvirtual */ _soft_body_remove_collision_exception(body: RID, body_b: RID): void - /* gdvirtual */ _soft_body_get_collision_exceptions(body: RID): GArray - /* gdvirtual */ _soft_body_set_state(body: RID, state: PhysicsServer3D.BodyState, variant: any): void - /* gdvirtual */ _soft_body_get_state(body: RID, state: PhysicsServer3D.BodyState): any - /* gdvirtual */ _soft_body_set_transform(body: RID, transform: Transform3D): void - /* gdvirtual */ _soft_body_set_simulation_precision(body: RID, simulation_precision: int64): void - /* gdvirtual */ _soft_body_get_simulation_precision(body: RID): int64 - /* gdvirtual */ _soft_body_set_total_mass(body: RID, total_mass: float64): void - /* gdvirtual */ _soft_body_get_total_mass(body: RID): float64 - /* gdvirtual */ _soft_body_set_linear_stiffness(body: RID, linear_stiffness: float64): void - /* gdvirtual */ _soft_body_get_linear_stiffness(body: RID): float64 - /* gdvirtual */ _soft_body_set_pressure_coefficient(body: RID, pressure_coefficient: float64): void - /* gdvirtual */ _soft_body_get_pressure_coefficient(body: RID): float64 - /* gdvirtual */ _soft_body_set_damping_coefficient(body: RID, damping_coefficient: float64): void - /* gdvirtual */ _soft_body_get_damping_coefficient(body: RID): float64 - /* gdvirtual */ _soft_body_set_drag_coefficient(body: RID, drag_coefficient: float64): void - /* gdvirtual */ _soft_body_get_drag_coefficient(body: RID): float64 - /* gdvirtual */ _soft_body_set_mesh(body: RID, mesh: RID): void - /* gdvirtual */ _soft_body_get_bounds(body: RID): AABB - /* gdvirtual */ _soft_body_move_point(body: RID, point_index: int64, global_position: Vector3): void - /* gdvirtual */ _soft_body_get_point_global_position(body: RID, point_index: int64): Vector3 - /* gdvirtual */ _soft_body_remove_all_pinned_points(body: RID): void - /* gdvirtual */ _soft_body_pin_point(body: RID, point_index: int64, pin: boolean): void - /* gdvirtual */ _soft_body_is_point_pinned(body: RID, point_index: int64): boolean - /* gdvirtual */ _joint_create(): RID - /* gdvirtual */ _joint_clear(joint: RID): void - /* gdvirtual */ _joint_make_pin(joint: RID, body_A: RID, local_A: Vector3, body_B: RID, local_B: Vector3): void - /* gdvirtual */ _pin_joint_set_param(joint: RID, param: PhysicsServer3D.PinJointParam, value: float64): void - /* gdvirtual */ _pin_joint_get_param(joint: RID, param: PhysicsServer3D.PinJointParam): float64 - /* gdvirtual */ _pin_joint_set_local_a(joint: RID, local_A: Vector3): void - /* gdvirtual */ _pin_joint_get_local_a(joint: RID): Vector3 - /* gdvirtual */ _pin_joint_set_local_b(joint: RID, local_B: Vector3): void - /* gdvirtual */ _pin_joint_get_local_b(joint: RID): Vector3 - /* gdvirtual */ _joint_make_hinge(joint: RID, body_A: RID, hinge_A: Transform3D, body_B: RID, hinge_B: Transform3D): void - /* gdvirtual */ _joint_make_hinge_simple(joint: RID, body_A: RID, pivot_A: Vector3, axis_A: Vector3, body_B: RID, pivot_B: Vector3, axis_B: Vector3): void - /* gdvirtual */ _hinge_joint_set_param(joint: RID, param: PhysicsServer3D.HingeJointParam, value: float64): void - /* gdvirtual */ _hinge_joint_get_param(joint: RID, param: PhysicsServer3D.HingeJointParam): float64 - /* gdvirtual */ _hinge_joint_set_flag(joint: RID, flag: PhysicsServer3D.HingeJointFlag, enabled: boolean): void - /* gdvirtual */ _hinge_joint_get_flag(joint: RID, flag: PhysicsServer3D.HingeJointFlag): boolean - /* gdvirtual */ _joint_make_slider(joint: RID, body_A: RID, local_ref_A: Transform3D, body_B: RID, local_ref_B: Transform3D): void - /* gdvirtual */ _slider_joint_set_param(joint: RID, param: PhysicsServer3D.SliderJointParam, value: float64): void - /* gdvirtual */ _slider_joint_get_param(joint: RID, param: PhysicsServer3D.SliderJointParam): float64 - /* gdvirtual */ _joint_make_cone_twist(joint: RID, body_A: RID, local_ref_A: Transform3D, body_B: RID, local_ref_B: Transform3D): void - /* gdvirtual */ _cone_twist_joint_set_param(joint: RID, param: PhysicsServer3D.ConeTwistJointParam, value: float64): void - /* gdvirtual */ _cone_twist_joint_get_param(joint: RID, param: PhysicsServer3D.ConeTwistJointParam): float64 - /* gdvirtual */ _joint_make_generic_6dof(joint: RID, body_A: RID, local_ref_A: Transform3D, body_B: RID, local_ref_B: Transform3D): void - /* gdvirtual */ _generic_6dof_joint_set_param(joint: RID, axis: Vector3.Axis, param: PhysicsServer3D.G6DOFJointAxisParam, value: float64): void - /* gdvirtual */ _generic_6dof_joint_get_param(joint: RID, axis: Vector3.Axis, param: PhysicsServer3D.G6DOFJointAxisParam): float64 - /* gdvirtual */ _generic_6dof_joint_set_flag(joint: RID, axis: Vector3.Axis, flag: PhysicsServer3D.G6DOFJointAxisFlag, enable: boolean): void - /* gdvirtual */ _generic_6dof_joint_get_flag(joint: RID, axis: Vector3.Axis, flag: PhysicsServer3D.G6DOFJointAxisFlag): boolean - /* gdvirtual */ _joint_get_type(joint: RID): PhysicsServer3D.JointType - /* gdvirtual */ _joint_set_solver_priority(joint: RID, priority: int64): void - /* gdvirtual */ _joint_get_solver_priority(joint: RID): int64 - /* gdvirtual */ _joint_disable_collisions_between_bodies(joint: RID, disable: boolean): void - /* gdvirtual */ _joint_is_disabled_collisions_between_bodies(joint: RID): boolean - /* gdvirtual */ _free_rid(rid: RID): void - /* gdvirtual */ _set_active(active: boolean): void - /* gdvirtual */ _init(): void - /* gdvirtual */ _step(step: float64): void - /* gdvirtual */ _sync(): void - /* gdvirtual */ _flush_queries(): void - /* gdvirtual */ _end_sync(): void - /* gdvirtual */ _finish(): void - /* gdvirtual */ _is_flushing_queries(): boolean - /* gdvirtual */ _get_process_info(process_info: PhysicsServer3D.ProcessInfo): int64 - body_test_motion_is_excluding_body(body: RID): boolean - body_test_motion_is_excluding_object(object: int64): boolean - } - /** A class used to provide [method PhysicsServer3DExtension._soft_body_update_rendering_server] with a rendering handler for soft bodies. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_physicsserver3drenderingserverhandler.html - */ - class PhysicsServer3DRenderingServerHandler extends Object { - constructor(identifier?: any) - /** Called by the [PhysicsServer3D] to set the position for the [SoftBody3D] vertex at the index specified by [param vertex_id]. - * - * **Note:** The [param vertex] parameter used to be of type `const void*` prior to Godot 4.2. - */ - /* gdvirtual */ _set_vertex(vertex_id: int64, vertex: Vector3): void - - /** Called by the [PhysicsServer3D] to set the normal for the [SoftBody3D] vertex at the index specified by [param vertex_id]. - * - * **Note:** The [param normal] parameter used to be of type `const void*` prior to Godot 4.2. - */ - /* gdvirtual */ _set_normal(vertex_id: int64, normal: Vector3): void - - /** Called by the [PhysicsServer3D] to set the bounding box for the [SoftBody3D]. */ - /* gdvirtual */ _set_aabb(aabb: AABB): void - - /** Sets the position for the [SoftBody3D] vertex at the index specified by [param vertex_id]. */ - set_vertex(vertex_id: int64, vertex: Vector3): void - - /** Sets the normal for the [SoftBody3D] vertex at the index specified by [param vertex_id]. */ - set_normal(vertex_id: int64, normal: Vector3): void - - /** Sets the bounding box for the [SoftBody3D]. */ - set_aabb(aabb: AABB): void - } - /** Provides parameters for [method PhysicsDirectSpaceState2D.intersect_shape]. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_physicsshapequeryparameters2d.html - */ - class PhysicsShapeQueryParameters2D extends RefCounted { - constructor(identifier?: any) - /** The physics layers the query will detect (as a bitmask). By default, all collision layers are detected. See [url=https://docs.godotengine.org/en/4.3/tutorials/physics/physics_introduction.html#collision-layers-and-masks]Collision layers and masks[/url] in the documentation for more information. */ - get collision_mask(): int64 - set collision_mask(value: int64) - - /** The list of object [RID]s that will be excluded from collisions. Use [method CollisionObject2D.get_rid] to get the [RID] associated with a [CollisionObject2D]-derived node. - * - * **Note:** The returned array is copied and any changes to it will not update the original property value. To update the value you need to modify the returned array, and then assign it to the property again. - */ - get exclude(): GArray - set exclude(value: GArray) - - /** The collision margin for the shape. */ - get margin(): float64 - set margin(value: float64) - - /** The motion of the shape being queried for. */ - get motion(): Vector2 - set motion(value: Vector2) - - /** The [Shape2D] that will be used for collision/intersection queries. This stores the actual reference which avoids the shape to be released while being used for queries, so always prefer using this over [member shape_rid]. */ - get shape(): Shape2D - set shape(value: Shape2D) - - /** The queried shape's [RID] that will be used for collision/intersection queries. Use this over [member shape] if you want to optimize for performance using the Servers API: - * - */ - get shape_rid(): RID - set shape_rid(value: RID) - - /** The queried shape's transform matrix. */ - get transform(): Transform2D - set transform(value: Transform2D) - - /** If `true`, the query will take [PhysicsBody2D]s into account. */ - get collide_with_bodies(): boolean - set collide_with_bodies(value: boolean) - - /** If `true`, the query will take [Area2D]s into account. */ - get collide_with_areas(): boolean - set collide_with_areas(value: boolean) - } - /** Provides parameters for [method PhysicsDirectSpaceState3D.intersect_shape]. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_physicsshapequeryparameters3d.html - */ - class PhysicsShapeQueryParameters3D extends RefCounted { - constructor(identifier?: any) - /** The physics layers the query will detect (as a bitmask). By default, all collision layers are detected. See [url=https://docs.godotengine.org/en/4.3/tutorials/physics/physics_introduction.html#collision-layers-and-masks]Collision layers and masks[/url] in the documentation for more information. */ - get collision_mask(): int64 - set collision_mask(value: int64) - - /** The list of object [RID]s that will be excluded from collisions. Use [method CollisionObject3D.get_rid] to get the [RID] associated with a [CollisionObject3D]-derived node. - * - * **Note:** The returned array is copied and any changes to it will not update the original property value. To update the value you need to modify the returned array, and then assign it to the property again. - */ - get exclude(): GArray - set exclude(value: GArray) - - /** The collision margin for the shape. */ - get margin(): float64 - set margin(value: float64) - - /** The motion of the shape being queried for. */ - get motion(): Vector3 - set motion(value: Vector3) - - /** The [Shape3D] that will be used for collision/intersection queries. This stores the actual reference which avoids the shape to be released while being used for queries, so always prefer using this over [member shape_rid]. */ - get shape(): Shape3D - set shape(value: Shape3D) - - /** The queried shape's [RID] that will be used for collision/intersection queries. Use this over [member shape] if you want to optimize for performance using the Servers API: - * - */ - get shape_rid(): RID - set shape_rid(value: RID) - - /** The queried shape's transform matrix. */ - get transform(): Transform3D - set transform(value: Transform3D) - - /** If `true`, the query will take [PhysicsBody3D]s into account. */ - get collide_with_bodies(): boolean - set collide_with_bodies(value: boolean) - - /** If `true`, the query will take [Area3D]s into account. */ - get collide_with_areas(): boolean - set collide_with_areas(value: boolean) - } - /** Provides parameters for [method PhysicsServer2D.body_test_motion]. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_physicstestmotionparameters2d.html - */ - class PhysicsTestMotionParameters2D extends RefCounted { - constructor(identifier?: any) - /** Transform in global space where the motion should start. Usually set to [member Node2D.global_transform] for the current body's transform. */ - get from(): Transform2D - set from(value: Transform2D) - - /** Motion vector to define the length and direction of the motion to test. */ - get motion(): Vector2 - set motion(value: Vector2) - - /** Increases the size of the shapes involved in the collision detection. */ - get margin(): float64 - set margin(value: float64) - - /** If set to `true`, shapes of type [constant PhysicsServer2D.SHAPE_SEPARATION_RAY] are used to detect collisions and can stop the motion. Can be useful when snapping to the ground. - * If set to `false`, shapes of type [constant PhysicsServer2D.SHAPE_SEPARATION_RAY] are only used for separation when overlapping with other bodies. That's the main use for separation ray shapes. - */ - get collide_separation_ray(): boolean - set collide_separation_ray(value: boolean) - - /** Optional array of body [RID] to exclude from collision. Use [method CollisionObject2D.get_rid] to get the [RID] associated with a [CollisionObject2D]-derived node. */ - get exclude_bodies(): GArray - set exclude_bodies(value: GArray) - - /** Optional array of object unique instance ID to exclude from collision. See [method Object.get_instance_id]. */ - get exclude_objects(): GArray - set exclude_objects(value: GArray) - - /** If set to `true`, any depenetration from the recovery phase is reported as a collision; this is used e.g. by [CharacterBody2D] for improving floor detection during floor snapping. - * If set to `false`, only collisions resulting from the motion are reported, which is generally the desired behavior. - */ - get recovery_as_collision(): boolean - set recovery_as_collision(value: boolean) - } - /** Provides parameters for [method PhysicsServer3D.body_test_motion]. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_physicstestmotionparameters3d.html - */ - class PhysicsTestMotionParameters3D extends RefCounted { - constructor(identifier?: any) - /** Transform in global space where the motion should start. Usually set to [member Node3D.global_transform] for the current body's transform. */ - get from(): Transform3D - set from(value: Transform3D) - - /** Motion vector to define the length and direction of the motion to test. */ - get motion(): Vector3 - set motion(value: Vector3) - - /** Increases the size of the shapes involved in the collision detection. */ - get margin(): float64 - set margin(value: float64) - - /** Maximum number of returned collisions, between `1` and `32`. Always returns the deepest detected collisions. */ - get max_collisions(): int64 - set max_collisions(value: int64) - - /** If set to `true`, shapes of type [constant PhysicsServer3D.SHAPE_SEPARATION_RAY] are used to detect collisions and can stop the motion. Can be useful when snapping to the ground. - * If set to `false`, shapes of type [constant PhysicsServer3D.SHAPE_SEPARATION_RAY] are only used for separation when overlapping with other bodies. That's the main use for separation ray shapes. - */ - get collide_separation_ray(): boolean - set collide_separation_ray(value: boolean) - - /** Optional array of body [RID] to exclude from collision. Use [method CollisionObject3D.get_rid] to get the [RID] associated with a [CollisionObject3D]-derived node. */ - get exclude_bodies(): GArray - set exclude_bodies(value: GArray) - - /** Optional array of object unique instance ID to exclude from collision. See [method Object.get_instance_id]. */ - get exclude_objects(): GArray - set exclude_objects(value: GArray) - - /** If set to `true`, any depenetration from the recovery phase is reported as a collision; this is used e.g. by [CharacterBody3D] for improving floor detection during floor snapping. - * If set to `false`, only collisions resulting from the motion are reported, which is generally the desired behavior. - */ - get recovery_as_collision(): boolean - set recovery_as_collision(value: boolean) - } - /** Describes the motion and collision result from [method PhysicsServer2D.body_test_motion]. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_physicstestmotionresult2d.html - */ - class PhysicsTestMotionResult2D extends RefCounted { - constructor(identifier?: any) - /** Returns the moving object's travel before collision. */ - get_travel(): Vector2 - - /** Returns the moving object's remaining movement vector. */ - get_remainder(): Vector2 - - /** Returns the point of collision in global coordinates, if a collision occurred. */ - get_collision_point(): Vector2 - - /** Returns the colliding body's shape's normal at the point of collision, if a collision occurred. */ - get_collision_normal(): Vector2 - - /** Returns the colliding body's velocity, if a collision occurred. */ - get_collider_velocity(): Vector2 - - /** Returns the unique instance ID of the colliding body's attached [Object], if a collision occurred. See [method Object.get_instance_id]. */ - get_collider_id(): int64 - - /** Returns the colliding body's [RID] used by the [PhysicsServer2D], if a collision occurred. */ - get_collider_rid(): RID - - /** Returns the colliding body's attached [Object], if a collision occurred. */ - get_collider(): Object - - /** Returns the colliding body's shape index, if a collision occurred. See [CollisionObject2D]. */ - get_collider_shape(): int64 - - /** Returns the moving object's colliding shape, if a collision occurred. */ - get_collision_local_shape(): int64 - - /** Returns the length of overlap along the collision normal, if a collision occurred. */ - get_collision_depth(): float64 - - /** Returns the maximum fraction of the motion that can occur without a collision, between `0` and `1`. */ - get_collision_safe_fraction(): float64 - - /** Returns the minimum fraction of the motion needed to collide, if a collision occurred, between `0` and `1`. */ - get_collision_unsafe_fraction(): float64 - } - /** Describes the motion and collision result from [method PhysicsServer3D.body_test_motion]. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_physicstestmotionresult3d.html - */ - class PhysicsTestMotionResult3D extends RefCounted { - constructor(identifier?: any) - /** Returns the moving object's travel before collision. */ - get_travel(): Vector3 - - /** Returns the moving object's remaining movement vector. */ - get_remainder(): Vector3 - - /** Returns the maximum fraction of the motion that can occur without a collision, between `0` and `1`. */ - get_collision_safe_fraction(): float64 - - /** Returns the minimum fraction of the motion needed to collide, if a collision occurred, between `0` and `1`. */ - get_collision_unsafe_fraction(): float64 - - /** Returns the number of detected collisions. */ - get_collision_count(): int64 - - /** Returns the point of collision in global coordinates given a collision index (the deepest collision by default), if a collision occurred. */ - get_collision_point(collision_index: int64 = 0): Vector3 - - /** Returns the colliding body's shape's normal at the point of collision given a collision index (the deepest collision by default), if a collision occurred. */ - get_collision_normal(collision_index: int64 = 0): Vector3 - - /** Returns the colliding body's velocity given a collision index (the deepest collision by default), if a collision occurred. */ - get_collider_velocity(collision_index: int64 = 0): Vector3 - - /** Returns the unique instance ID of the colliding body's attached [Object] given a collision index (the deepest collision by default), if a collision occurred. See [method Object.get_instance_id]. */ - get_collider_id(collision_index: int64 = 0): int64 - - /** Returns the colliding body's [RID] used by the [PhysicsServer3D] given a collision index (the deepest collision by default), if a collision occurred. */ - get_collider_rid(collision_index: int64 = 0): RID - - /** Returns the colliding body's attached [Object] given a collision index (the deepest collision by default), if a collision occurred. */ - get_collider(collision_index: int64 = 0): Object - - /** Returns the colliding body's shape index given a collision index (the deepest collision by default), if a collision occurred. See [CollisionObject3D]. */ - get_collider_shape(collision_index: int64 = 0): int64 - - /** Returns the moving object's colliding shape given a collision index (the deepest collision by default), if a collision occurred. */ - get_collision_local_shape(collision_index: int64 = 0): int64 - - /** Returns the length of overlap along the collision normal given a collision index (the deepest collision by default), if a collision occurred. */ - get_collision_depth(collision_index: int64 = 0): float64 - } - /** A physics joint that attaches two 2D physics bodies at a single point, allowing them to freely rotate. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_pinjoint2d.html - */ - class PinJoint2D extends Joint2D { - constructor(identifier?: any) - /** The higher this value, the more the bond to the pinned partner can flex. */ - get softness(): float64 - set softness(value: float64) - - /** If `true`, the pin maximum and minimum rotation, defined by [member angular_limit_lower] and [member angular_limit_upper] are applied. */ - get angular_limit_enabled(): boolean - set angular_limit_enabled(value: boolean) - - /** The minimum rotation. Only active if [member angular_limit_enabled] is `true`. */ - get angular_limit_lower(): float64 - set angular_limit_lower(value: float64) - - /** The maximum rotation. Only active if [member angular_limit_enabled] is `true`. */ - get angular_limit_upper(): float64 - set angular_limit_upper(value: float64) - - /** When activated, a motor turns the pin. */ - get motor_enabled(): boolean - set motor_enabled(value: boolean) - - /** Target speed for the motor. In radians per second. */ - get motor_target_velocity(): float64 - set motor_target_velocity(value: float64) - } - namespace PinJoint3D { - enum Param { - /** The force with which the pinned objects stay in positional relation to each other. The higher, the stronger. */ - PARAM_BIAS = 0, - - /** The force with which the pinned objects stay in velocity relation to each other. The higher, the stronger. */ - PARAM_DAMPING = 1, - - /** If above 0, this value is the maximum value for an impulse that this Joint3D produces. */ - PARAM_IMPULSE_CLAMP = 2, - } - } - /** A physics joint that attaches two 3D physics bodies at a single point, allowing them to freely rotate. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_pinjoint3d.html - */ - class PinJoint3D extends Joint3D { - constructor(identifier?: any) - /** Sets the value of the specified parameter. */ - set_param(param: PinJoint3D.Param, value: float64): void - - /** Returns the value of the specified parameter. */ - get_param(param: PinJoint3D.Param): float64 - } - /** A [Cubemap] without image data. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_placeholdercubemap.html - */ - class PlaceholderCubemap extends PlaceholderTextureLayered { - constructor(identifier?: any) - } - /** A [CubemapArray] without image data. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_placeholdercubemaparray.html - */ - class PlaceholderCubemapArray extends PlaceholderTextureLayered { - constructor(identifier?: any) - } - /** Placeholder class for a material. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_placeholdermaterial.html - */ - class PlaceholderMaterial extends Material { - constructor(identifier?: any) - } - /** Placeholder class for a mesh. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_placeholdermesh.html - */ - class PlaceholderMesh extends Mesh { - constructor(identifier?: any) - /** The smallest [AABB] enclosing this mesh in local space. */ - get aabb(): AABB - set aabb(value: AABB) - } - /** Placeholder class for a 2-dimensional texture. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_placeholdertexture2d.html - */ - class PlaceholderTexture2D extends Texture2D { - constructor(identifier?: any) - /** The texture's size (in pixels). */ - get size(): Vector2 - set size(value: Vector2) - } - /** Placeholder class for a 2-dimensional texture array. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_placeholdertexture2darray.html - */ - class PlaceholderTexture2DArray extends PlaceholderTextureLayered { - constructor(identifier?: any) - } - /** Placeholder class for a 3-dimensional texture. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_placeholdertexture3d.html - */ - class PlaceholderTexture3D extends Texture3D { - constructor(identifier?: any) - /** The texture's size (in pixels). */ - get size(): Vector3i - set size(value: Vector3i) - } - /** Placeholder class for a 2-dimensional texture array. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_placeholdertexturelayered.html - */ - class PlaceholderTextureLayered extends TextureLayered { - constructor(identifier?: any) - /** The size of each texture layer (in pixels). */ - get size(): Vector2i - set size(value: Vector2i) - - /** The number of layers in the texture array. */ - get layers(): int64 - set layers(value: int64) - } - namespace PlaneMesh { - enum Orientation { - /** [PlaneMesh] will face the positive X-axis. */ - FACE_X = 0, - - /** [PlaneMesh] will face the positive Y-axis. This matches the behavior of the [PlaneMesh] in Godot 3.x. */ - FACE_Y = 1, - - /** [PlaneMesh] will face the positive Z-axis. This matches the behavior of the QuadMesh in Godot 3.x. */ - FACE_Z = 2, - } - } - /** Class representing a planar [PrimitiveMesh]. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_planemesh.html - */ - class PlaneMesh extends PrimitiveMesh { - constructor(identifier?: any) - /** Size of the generated plane. */ - get size(): Vector2 - set size(value: Vector2) - - /** Number of subdivision along the X axis. */ - get subdivide_width(): int64 - set subdivide_width(value: int64) - - /** Number of subdivision along the Z axis. */ - get subdivide_depth(): int64 - set subdivide_depth(value: int64) - - /** Offset of the generated plane. Useful for particles. */ - get center_offset(): Vector3 - set center_offset(value: Vector3) - - /** Direction that the [PlaneMesh] is facing. See [enum Orientation] for options. */ - get orientation(): int64 - set orientation(value: int64) - } - class PluginConfigDialog extends ConfirmationDialog { - constructor(identifier?: any) - readonly plugin_ready: Signal2 - } - /** Positional 2D light source. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_pointlight2d.html - */ - class PointLight2D extends Light2D { - constructor(identifier?: any) - /** [Texture2D] used for the light's appearance. */ - get texture(): Texture2D - set texture(value: Texture2D) - - /** The offset of the light's [member texture]. */ - get offset(): Vector2 - set offset(value: Vector2) - - /** The [member texture]'s scale factor. */ - get texture_scale(): float64 - set texture_scale(value: float64) - - /** The height of the light. Used with 2D normal mapping. The units are in pixels, e.g. if the height is 100, then it will illuminate an object 100 pixels away at a 45° angle to the plane. */ - get height(): float64 - set height(value: float64) - } - /** Mesh with a single Point primitive. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_pointmesh.html - */ - class PointMesh extends PrimitiveMesh { - constructor(identifier?: any) - } - /** A 2D polygon. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_polygon2d.html - */ - class Polygon2D extends Node2D { - constructor(identifier?: any) - /** Adds a bone with the specified [param path] and [param weights]. */ - add_bone(path: NodePath | string, weights: PackedFloat32Array | float32[]): void - - /** Returns the number of bones in this [Polygon2D]. */ - get_bone_count(): int64 - - /** Returns the path to the node associated with the specified bone. */ - get_bone_path(index: int64): NodePath - - /** Returns the weight values of the specified bone. */ - get_bone_weights(index: int64): PackedFloat32Array - - /** Removes the specified bone from this [Polygon2D]. */ - erase_bone(index: int64): void - - /** Removes all bones from this [Polygon2D]. */ - clear_bones(): void - - /** Sets the path to the node associated with the specified bone. */ - set_bone_path(index: int64, path: NodePath | string): void - - /** Sets the weight values for the specified bone. */ - set_bone_weights(index: int64, weights: PackedFloat32Array | float32[]): void - - /** The polygon's fill color. If [member texture] is set, it will be multiplied by this color. It will also be the default color for vertices not set in [member vertex_colors]. */ - get color(): Color - set color(value: Color) - - /** The offset applied to each vertex. */ - get offset(): Vector2 - set offset(value: Vector2) - - /** If `true`, polygon edges will be anti-aliased. */ - get antialiased(): boolean - set antialiased(value: boolean) - - /** The polygon's fill texture. Use [member uv] to set texture coordinates. */ - get texture(): Texture2D - set texture(value: Texture2D) - - /** Amount to offset the polygon's [member texture]. If set to `Vector2(0, 0)`, the texture's origin (its top-left corner) will be placed at the polygon's position. */ - get texture_offset(): Vector2 - set texture_offset(value: Vector2) - - /** Amount to multiply the [member uv] coordinates when using [member texture]. Larger values make the texture smaller, and vice versa. */ - get texture_scale(): Vector2 - set texture_scale(value: Vector2) - - /** The texture's rotation in radians. */ - get texture_rotation(): float64 - set texture_rotation(value: float64) - - /** Path to a [Skeleton2D] node used for skeleton-based deformations of this polygon. If empty or invalid, skeletal deformations will not be used. */ - get skeleton(): NodePath - set skeleton(value: NodePath | string) - - /** If `true`, the polygon will be inverted, containing the area outside the defined points and extending to the [member invert_border]. */ - get invert_enabled(): boolean - set invert_enabled(value: boolean) - - /** Added padding applied to the bounding box when [member invert_enabled] is set to `true`. Setting this value too small may result in a "Bad Polygon" error. */ - get invert_border(): float64 - set invert_border(value: float64) - - /** The polygon's list of vertices. The final point will be connected to the first. */ - get polygon(): PackedVector2Array - set polygon(value: PackedVector2Array | Vector2[]) - - /** Texture coordinates for each vertex of the polygon. There should be one UV value per polygon vertex. If there are fewer, undefined vertices will use `Vector2(0, 0)`. */ - get uv(): PackedVector2Array - set uv(value: PackedVector2Array | Vector2[]) - - /** Color for each vertex. Colors are interpolated between vertices, resulting in smooth gradients. There should be one per polygon vertex. If there are fewer, undefined vertices will use [member color]. */ - get vertex_colors(): PackedColorArray - set vertex_colors(value: PackedColorArray | Color[]) - - /** The list of polygons, in case more than one is being represented. Every individual polygon is stored as a [PackedInt32Array] where each [int] is an index to a point in [member polygon]. If empty, this property will be ignored, and the resulting single polygon will be composed of all points in [member polygon], using the order they are stored in. */ - get polygons(): GArray - set polygons(value: GArray) - - /** Internal list of [Bone2D] nodes used by the assigned [member skeleton]. Edited using the Polygon2D editor ("UV" button on the top toolbar). */ - get bones(): GArray - set bones(value: GArray) - - /** Number of internal vertices, used for UV mapping. */ - get internal_vertex_count(): int64 - set internal_vertex_count(value: int64) - } - class Polygon2DEditor extends AbstractPolygon2DEditor { - constructor(identifier?: any) - _update_bone_list(): void - _update_polygon_editing_state(): void - } - class Polygon2DEditorPlugin extends AbstractPolygon2DEditorPlugin { - constructor(identifier?: any) - } - class Polygon3DEditor extends HBoxContainer { - constructor(identifier?: any) - _polygon_draw(): void - } - class Polygon3DEditorPlugin extends EditorPlugin { - constructor(identifier?: any) - } - /** Flat 2D polygon shape for use with occlusion culling in [OccluderInstance3D]. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_polygonoccluder3d.html - */ - class PolygonOccluder3D extends Occluder3D { - constructor(identifier?: any) - _has_editable_3d_polygon_no_depth(): boolean - - /** The polygon to use for occlusion culling. The polygon can be convex or concave, but it should have as few points as possible to maximize performance. - * The polygon must *not* have intersecting lines. Otherwise, triangulation will fail (with an error message printed). - */ - get polygon(): PackedVector2Array - set polygon(value: PackedVector2Array | Vector2[]) - } - /** @link https://docs.godotengine.org/en/4.3/classes/class_polygonpathfinder.html */ - class PolygonPathFinder extends Resource { - constructor(identifier?: any) - setup(points: PackedVector2Array | Vector2[], connections: PackedInt32Array | int32[]): void - find_path(from: Vector2, to: Vector2): PackedVector2Array - get_intersections(from: Vector2, to: Vector2): PackedVector2Array - get_closest_point(point: Vector2): Vector2 - is_point_inside(point: Vector2): boolean - set_point_penalty(idx: int64, penalty: float64): void - get_point_penalty(idx: int64): float64 - get_bounds(): Rect2 - get data(): GDictionary - set data(value: GDictionary) - } - /** Base class for contextual windows and panels with fixed position. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_popup.html - */ - class Popup extends Window { - constructor(identifier?: any) - /** Emitted when the popup is hidden. */ - readonly popup_hide: Signal0 - } - /** A modal window used to display a list of options. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_popupmenu.html - */ - class PopupMenu extends Popup { - constructor(identifier?: any) - /** Checks the provided [param event] against the [PopupMenu]'s shortcuts and accelerators, and activates the first item with matching events. If [param for_global_only] is `true`, only shortcuts and accelerators with `global` set to `true` will be called. - * Returns `true` if an item was successfully activated. - * - * **Note:** Certain [Control]s, such as [MenuButton], will call this method automatically. - */ - activate_item_by_event(event: InputEvent, for_global_only: boolean = false): boolean - - /** Returns `true` if the system native menu is supported and currently used by this [PopupMenu]. */ - is_native_menu(): boolean - - /** Adds a new item with text [param label]. - * An [param id] can optionally be provided, as well as an accelerator ([param accel]). If no [param id] is provided, one will be created from the index. If no [param accel] is provided, then the default value of 0 (corresponding to [constant @GlobalScope.KEY_NONE]) will be assigned to the item (which means it won't have any accelerator). See [method get_item_accelerator] for more info on accelerators. - * - * **Note:** The provided [param id] is used only in [signal id_pressed] and [signal id_focused] signals. It's not related to the `index` arguments in e.g. [method set_item_checked]. - */ - add_item(label: string, id: int64 = -1, accel: Key = 0): void - - /** Adds a new item with text [param label] and icon [param texture]. - * An [param id] can optionally be provided, as well as an accelerator ([param accel]). If no [param id] is provided, one will be created from the index. If no [param accel] is provided, then the default value of 0 (corresponding to [constant @GlobalScope.KEY_NONE]) will be assigned to the item (which means it won't have any accelerator). See [method get_item_accelerator] for more info on accelerators. - */ - add_icon_item(texture: Texture2D, label: string, id: int64 = -1, accel: Key = 0): void - - /** Adds a new checkable item with text [param label]. - * An [param id] can optionally be provided, as well as an accelerator ([param accel]). If no [param id] is provided, one will be created from the index. If no [param accel] is provided, then the default value of 0 (corresponding to [constant @GlobalScope.KEY_NONE]) will be assigned to the item (which means it won't have any accelerator). See [method get_item_accelerator] for more info on accelerators. - * - * **Note:** Checkable items just display a checkmark, but don't have any built-in checking behavior and must be checked/unchecked manually. See [method set_item_checked] for more info on how to control it. - */ - add_check_item(label: string, id: int64 = -1, accel: Key = 0): void - - /** Adds a new checkable item with text [param label] and icon [param texture]. - * An [param id] can optionally be provided, as well as an accelerator ([param accel]). If no [param id] is provided, one will be created from the index. If no [param accel] is provided, then the default value of 0 (corresponding to [constant @GlobalScope.KEY_NONE]) will be assigned to the item (which means it won't have any accelerator). See [method get_item_accelerator] for more info on accelerators. - * - * **Note:** Checkable items just display a checkmark, but don't have any built-in checking behavior and must be checked/unchecked manually. See [method set_item_checked] for more info on how to control it. - */ - add_icon_check_item(texture: Texture2D, label: string, id: int64 = -1, accel: Key = 0): void - - /** Adds a new radio check button with text [param label]. - * An [param id] can optionally be provided, as well as an accelerator ([param accel]). If no [param id] is provided, one will be created from the index. If no [param accel] is provided, then the default value of 0 (corresponding to [constant @GlobalScope.KEY_NONE]) will be assigned to the item (which means it won't have any accelerator). See [method get_item_accelerator] for more info on accelerators. - * - * **Note:** Checkable items just display a checkmark, but don't have any built-in checking behavior and must be checked/unchecked manually. See [method set_item_checked] for more info on how to control it. - */ - add_radio_check_item(label: string, id: int64 = -1, accel: Key = 0): void - - /** Same as [method add_icon_check_item], but uses a radio check button. */ - add_icon_radio_check_item(texture: Texture2D, label: string, id: int64 = -1, accel: Key = 0): void - - /** Adds a new multistate item with text [param label]. - * Contrarily to normal binary items, multistate items can have more than two states, as defined by [param max_states]. The default value is defined by [param default_state]. - * An [param id] can optionally be provided, as well as an accelerator ([param accel]). If no [param id] is provided, one will be created from the index. If no [param accel] is provided, then the default value of 0 (corresponding to [constant @GlobalScope.KEY_NONE]) will be assigned to the item (which means it won't have any accelerator). See [method get_item_accelerator] for more info on accelerators. - * - * **Note:** Multistate items don't update their state automatically and must be done manually. See [method toggle_item_multistate], [method set_item_multistate] and [method get_item_multistate] for more info on how to control it. - * Example usage: - * - */ - add_multistate_item(label: string, max_states: int64, default_state: int64 = 0, id: int64 = -1, accel: Key = 0): void - - /** Adds a [Shortcut]. - * An [param id] can optionally be provided. If no [param id] is provided, one will be created from the index. - * If [param allow_echo] is `true`, the shortcut can be activated with echo events. - */ - add_shortcut(shortcut: Shortcut, id: int64 = -1, global: boolean = false, allow_echo: boolean = false): void - - /** Adds a new item and assigns the specified [Shortcut] and icon [param texture] to it. Sets the label of the checkbox to the [Shortcut]'s name. - * An [param id] can optionally be provided. If no [param id] is provided, one will be created from the index. - * If [param allow_echo] is `true`, the shortcut can be activated with echo events. - */ - add_icon_shortcut(texture: Texture2D, shortcut: Shortcut, id: int64 = -1, global: boolean = false, allow_echo: boolean = false): void - - /** Adds a new checkable item and assigns the specified [Shortcut] to it. Sets the label of the checkbox to the [Shortcut]'s name. - * An [param id] can optionally be provided. If no [param id] is provided, one will be created from the index. - * - * **Note:** Checkable items just display a checkmark, but don't have any built-in checking behavior and must be checked/unchecked manually. See [method set_item_checked] for more info on how to control it. - */ - add_check_shortcut(shortcut: Shortcut, id: int64 = -1, global: boolean = false): void - - /** Adds a new checkable item and assigns the specified [Shortcut] and icon [param texture] to it. Sets the label of the checkbox to the [Shortcut]'s name. - * An [param id] can optionally be provided. If no [param id] is provided, one will be created from the index. - * - * **Note:** Checkable items just display a checkmark, but don't have any built-in checking behavior and must be checked/unchecked manually. See [method set_item_checked] for more info on how to control it. - */ - add_icon_check_shortcut(texture: Texture2D, shortcut: Shortcut, id: int64 = -1, global: boolean = false): void - - /** Adds a new radio check button and assigns a [Shortcut] to it. Sets the label of the checkbox to the [Shortcut]'s name. - * An [param id] can optionally be provided. If no [param id] is provided, one will be created from the index. - * - * **Note:** Checkable items just display a checkmark, but don't have any built-in checking behavior and must be checked/unchecked manually. See [method set_item_checked] for more info on how to control it. - */ - add_radio_check_shortcut(shortcut: Shortcut, id: int64 = -1, global: boolean = false): void - - /** Same as [method add_icon_check_shortcut], but uses a radio check button. */ - add_icon_radio_check_shortcut(texture: Texture2D, shortcut: Shortcut, id: int64 = -1, global: boolean = false): void - - /** Adds an item that will act as a submenu of the parent [PopupMenu] node when clicked. The [param submenu] argument must be the name of an existing [PopupMenu] that has been added as a child to this node. This submenu will be shown when the item is clicked, hovered for long enough, or activated using the `ui_select` or `ui_right` input actions. - * An [param id] can optionally be provided. If no [param id] is provided, one will be created from the index. - */ - add_submenu_item(label: string, submenu: string, id: int64 = -1): void - - /** Adds an item that will act as a submenu of the parent [PopupMenu] node when clicked. This submenu will be shown when the item is clicked, hovered for long enough, or activated using the `ui_select` or `ui_right` input actions. - * [param submenu] must be either child of this [PopupMenu] or has no parent node (in which case it will be automatically added as a child). If the [param submenu] popup has another parent, this method will fail. - * An [param id] can optionally be provided. If no [param id] is provided, one will be created from the index. - */ - add_submenu_node_item(label: string, submenu: PopupMenu, id: int64 = -1): void - - /** Sets the text of the item at the given [param index]. */ - set_item_text(index: int64, text: string): void - - /** Sets item's text base writing direction. */ - set_item_text_direction(index: int64, direction: Control.TextDirection): void - - /** Sets language code of item's text used for line-breaking and text shaping algorithms, if left empty current locale is used instead. */ - set_item_language(index: int64, language: string): void - - /** Replaces the [Texture2D] icon of the item at the given [param index]. */ - set_item_icon(index: int64, icon: Texture2D): void - - /** Sets the maximum allowed width of the icon for the item at the given [param index]. This limit is applied on top of the default size of the icon and on top of [theme_item icon_max_width]. The height is adjusted according to the icon's ratio. */ - set_item_icon_max_width(index: int64, width: int64): void - - /** Sets a modulating [Color] of the item's icon at the given [param index]. */ - set_item_icon_modulate(index: int64, modulate: Color): void - - /** Sets the checkstate status of the item at the given [param index]. */ - set_item_checked(index: int64, checked: boolean): void - - /** Sets the [param id] of the item at the given [param index]. - * The [param id] is used in [signal id_pressed] and [signal id_focused] signals. - */ - set_item_id(index: int64, id: int64): void - - /** Sets the accelerator of the item at the given [param index]. An accelerator is a keyboard shortcut that can be pressed to trigger the menu button even if it's not currently open. [param accel] is generally a combination of [enum KeyModifierMask]s and [enum Key]s using bitwise OR such as `KEY_MASK_CTRL | KEY_A` ([kbd]Ctrl + A[/kbd]). */ - set_item_accelerator(index: int64, accel: Key): void - - /** Sets the metadata of an item, which may be of any type. You can later get it with [method get_item_metadata], which provides a simple way of assigning context data to items. */ - set_item_metadata(index: int64, metadata: any): void - - /** Enables/disables the item at the given [param index]. When it is disabled, it can't be selected and its action can't be invoked. */ - set_item_disabled(index: int64, disabled: boolean): void - - /** Sets the submenu of the item at the given [param index]. The submenu is the name of a child [PopupMenu] node that would be shown when the item is clicked. */ - set_item_submenu(index: int64, submenu: string): void - - /** Sets the submenu of the item at the given [param index]. The submenu is a [PopupMenu] node that would be shown when the item is clicked. It must either be a child of this [PopupMenu] or has no parent (in which case it will be automatically added as a child). If the [param submenu] popup has another parent, this method will fail. */ - set_item_submenu_node(index: int64, submenu: PopupMenu): void - - /** Mark the item at the given [param index] as a separator, which means that it would be displayed as a line. If `false`, sets the type of the item to plain text. */ - set_item_as_separator(index: int64, enable: boolean): void - - /** Sets whether the item at the given [param index] has a checkbox. If `false`, sets the type of the item to plain text. - * - * **Note:** Checkable items just display a checkmark, but don't have any built-in checking behavior and must be checked/unchecked manually. - */ - set_item_as_checkable(index: int64, enable: boolean): void - - /** Sets the type of the item at the given [param index] to radio button. If `false`, sets the type of the item to plain text. */ - set_item_as_radio_checkable(index: int64, enable: boolean): void - - /** Sets the [String] tooltip of the item at the given [param index]. */ - set_item_tooltip(index: int64, tooltip: string): void - - /** Sets a [Shortcut] for the item at the given [param index]. */ - set_item_shortcut(index: int64, shortcut: Shortcut, global: boolean = false): void - - /** Sets the horizontal offset of the item at the given [param index]. */ - set_item_indent(index: int64, indent: int64): void - - /** Sets the state of a multistate item. See [method add_multistate_item] for details. */ - set_item_multistate(index: int64, state: int64): void - - /** Sets the max states of a multistate item. See [method add_multistate_item] for details. */ - set_item_multistate_max(index: int64, max_states: int64): void - - /** Disables the [Shortcut] of the item at the given [param index]. */ - set_item_shortcut_disabled(index: int64, disabled: boolean): void - - /** Toggles the check state of the item at the given [param index]. */ - toggle_item_checked(index: int64): void - - /** Cycle to the next state of a multistate item. See [method add_multistate_item] for details. */ - toggle_item_multistate(index: int64): void - - /** Returns the text of the item at the given [param index]. */ - get_item_text(index: int64): string - - /** Returns item's text base writing direction. */ - get_item_text_direction(index: int64): Control.TextDirection - - /** Returns item's text language code. */ - get_item_language(index: int64): string - - /** Returns the icon of the item at the given [param index]. */ - get_item_icon(index: int64): Texture2D - - /** Returns the maximum allowed width of the icon for the item at the given [param index]. */ - get_item_icon_max_width(index: int64): int64 - - /** Returns a [Color] modulating the item's icon at the given [param index]. */ - get_item_icon_modulate(index: int64): Color - - /** Returns `true` if the item at the given [param index] is checked. */ - is_item_checked(index: int64): boolean - - /** Returns the ID of the item at the given [param index]. `id` can be manually assigned, while index can not. */ - get_item_id(index: int64): int64 - - /** Returns the index of the item containing the specified [param id]. Index is automatically assigned to each item by the engine and can not be set manually. */ - get_item_index(id: int64): int64 - - /** Returns the accelerator of the item at the given [param index]. An accelerator is a keyboard shortcut that can be pressed to trigger the menu button even if it's not currently open. The return value is an integer which is generally a combination of [enum KeyModifierMask]s and [enum Key]s using bitwise OR such as `KEY_MASK_CTRL | KEY_A` ([kbd]Ctrl + A[/kbd]). If no accelerator is defined for the specified [param index], [method get_item_accelerator] returns `0` (corresponding to [constant @GlobalScope.KEY_NONE]). */ - get_item_accelerator(index: int64): Key - - /** Returns the metadata of the specified item, which might be of any type. You can set it with [method set_item_metadata], which provides a simple way of assigning context data to items. */ - get_item_metadata(index: int64): any - - /** Returns `true` if the item at the given [param index] is disabled. When it is disabled it can't be selected, or its action invoked. - * See [method set_item_disabled] for more info on how to disable an item. - */ - is_item_disabled(index: int64): boolean - - /** Returns the submenu name of the item at the given [param index]. See [method add_submenu_item] for more info on how to add a submenu. */ - get_item_submenu(index: int64): string - - /** Returns the submenu of the item at the given [param index], or `null` if no submenu was added. See [method add_submenu_node_item] for more info on how to add a submenu. */ - get_item_submenu_node(index: int64): PopupMenu - - /** Returns `true` if the item is a separator. If it is, it will be displayed as a line. See [method add_separator] for more info on how to add a separator. */ - is_item_separator(index: int64): boolean - - /** Returns `true` if the item at the given [param index] is checkable in some way, i.e. if it has a checkbox or radio button. - * - * **Note:** Checkable items just display a checkmark or radio button, but don't have any built-in checking behavior and must be checked/unchecked manually. - */ - is_item_checkable(index: int64): boolean - - /** Returns `true` if the item at the given [param index] has radio button-style checkability. - * - * **Note:** This is purely cosmetic; you must add the logic for checking/unchecking items in radio groups. - */ - is_item_radio_checkable(index: int64): boolean - - /** Returns `true` if the specified item's shortcut is disabled. */ - is_item_shortcut_disabled(index: int64): boolean - - /** Returns the tooltip associated with the item at the given [param index]. */ - get_item_tooltip(index: int64): string - - /** Returns the [Shortcut] associated with the item at the given [param index]. */ - get_item_shortcut(index: int64): Shortcut - - /** Returns the horizontal offset of the item at the given [param index]. */ - get_item_indent(index: int64): int64 - - /** Returns the max states of the item at the given [param index]. */ - get_item_multistate_max(index: int64): int64 - - /** Returns the state of the item at the given [param index]. */ - get_item_multistate(index: int64): int64 - - /** Sets the currently focused item as the given [param index]. - * Passing `-1` as the index makes so that no item is focused. - */ - set_focused_item(index: int64): void - - /** Returns the index of the currently focused item. Returns `-1` if no item is focused. */ - get_focused_item(): int64 - - /** Moves the scroll view to make the item at the given [param index] visible. */ - scroll_to_item(index: int64): void - - /** Removes the item at the given [param index] from the menu. - * - * **Note:** The indices of items after the removed item will be shifted by one. - */ - remove_item(index: int64): void - - /** Adds a separator between items. Separators also occupy an index, which you can set by using the [param id] parameter. - * A [param label] can optionally be provided, which will appear at the center of the separator. - */ - add_separator(label: string = '', id: int64 = -1): void - - /** Removes all items from the [PopupMenu]. If [param free_submenus] is `true`, the submenu nodes are automatically freed. */ - clear(free_submenus: boolean = false): void - - /** Returns `true` if the menu is bound to the special system menu. */ - is_system_menu(): boolean - - /** If `true`, hides the [PopupMenu] when an item is selected. */ - get hide_on_item_selection(): boolean - set hide_on_item_selection(value: boolean) - - /** If `true`, hides the [PopupMenu] when a checkbox or radio button is selected. */ - get hide_on_checkable_item_selection(): boolean - set hide_on_checkable_item_selection(value: boolean) - - /** If `true`, hides the [PopupMenu] when a state item is selected. */ - get hide_on_state_item_selection(): boolean - set hide_on_state_item_selection(value: boolean) - - /** Sets the delay time in seconds for the submenu item to popup on mouse hovering. If the popup menu is added as a child of another (acting as a submenu), it will inherit the delay time of the parent menu item. */ - get submenu_popup_delay(): float64 - set submenu_popup_delay(value: float64) - - /** If `true`, allows navigating [PopupMenu] with letter keys. */ - get allow_search(): boolean - set allow_search(value: boolean) - - /** If set to one of the values of [enum NativeMenu.SystemMenus], this [PopupMenu] is bound to the special system menu. Only one [PopupMenu] can be bound to each special menu at a time. */ - get system_menu_id(): int64 - set system_menu_id(value: int64) - - /** If `true`, [MenuBar] will use native menu when supported. - * - * **Note:** If [PopupMenu] is linked to [StatusIndicator], [MenuBar], or another [PopupMenu] item it can use native menu regardless of this property, use [method is_native_menu] to check it. - */ - get prefer_native_menu(): boolean - set prefer_native_menu(value: boolean) - - /** The number of items currently in the list. */ - get item_count(): any /*Items,item_*/ - set item_count(value: any /*Items,item_*/) - - /** Emitted when an item of some [param id] is pressed or its accelerator is activated. - * - * **Note:** If [param id] is negative (either explicitly or due to overflow), this will return the corresponding index instead. - */ - readonly id_pressed: Signal1 - - /** Emitted when the user navigated to an item of some [param id] using the [member ProjectSettings.input/ui_up] or [member ProjectSettings.input/ui_down] input action. */ - readonly id_focused: Signal1 - - /** Emitted when an item of some [param index] is pressed or its accelerator is activated. */ - readonly index_pressed: Signal1 - - /** Emitted when any item is added, modified or removed. */ - readonly menu_changed: Signal0 - } - /** A popup with a panel background. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_popuppanel.html - */ - class PopupPanel extends Popup { - constructor(identifier?: any) - } - namespace PortableCompressedTexture2D { - enum CompressionMode { - COMPRESSION_MODE_LOSSLESS = 0, - COMPRESSION_MODE_LOSSY = 1, - COMPRESSION_MODE_BASIS_UNIVERSAL = 2, - COMPRESSION_MODE_S3TC = 3, - COMPRESSION_MODE_ETC2 = 4, - COMPRESSION_MODE_BPTC = 5, - } - } - /** Provides a compressed texture for disk and/or VRAM in a way that is portable. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_portablecompressedtexture2d.html - */ - class PortableCompressedTexture2D extends Texture2D { - constructor(identifier?: any) - /** Initializes the compressed texture from a base image. The compression mode must be provided. - * [param normal_map] is recommended to ensure optimum quality if this image will be used as a normal map. - * If lossy compression is requested, the quality setting can optionally be provided. This maps to Lossy WebP compression quality. - */ - create_from_image(image: Image, compression_mode: PortableCompressedTexture2D.CompressionMode, normal_map: boolean = false, lossy_quality: float64 = 0.8): void - - /** Return the image format used (valid after initialized). */ - get_format(): Image.Format - - /** Return the compression mode used (valid after initialized). */ - get_compression_mode(): PortableCompressedTexture2D.CompressionMode - - /** Overrides the flag globally for all textures of this type. This is used primarily by the editor. */ - static set_keep_all_compressed_buffers(keep: boolean): void - - /** Return whether the flag is overridden for all textures of this type. */ - static is_keeping_all_compressed_buffers(): boolean - get _data(): PackedByteArray - set _data(value: PackedByteArray | byte[] | ArrayBuffer) - - /** Allow overriding the texture size (for 2D only). */ - get size_override(): Vector2 - set size_override(value: Vector2) - - /** When running on the editor, this class will keep the source compressed data in memory. Otherwise, the source compressed data is lost after loading and the resource can't be re saved. - * This flag allows to keep the compressed data in memory if you intend it to persist after loading. - */ - get keep_compressed_buffer(): boolean - set keep_compressed_buffer(value: boolean) - } - class PostImportPluginSkeletonRenamer extends EditorScenePostImportPlugin { - constructor(identifier?: any) - } - class PostImportPluginSkeletonRestFixer extends EditorScenePostImportPlugin { - constructor(identifier?: any) - } - class PostImportPluginSkeletonTrackOrganizer extends EditorScenePostImportPlugin { - constructor(identifier?: any) - } - /** Base class for all primitive meshes. Handles applying a [Material] to a primitive mesh. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_primitivemesh.html - */ - class PrimitiveMesh extends Mesh { - constructor(identifier?: any) - /** Override this method to customize how this primitive mesh should be generated. Should return an [Array] where each element is another Array of values required for the mesh (see the [enum Mesh.ArrayType] constants). */ - /* gdvirtual */ _create_mesh_array(): GArray - - /** Returns mesh arrays used to constitute surface of [Mesh]. The result can be passed to [method ArrayMesh.add_surface_from_arrays] to create a new surface. For example: - * - */ - get_mesh_arrays(): GArray - - /** Request an update of this primitive mesh based on its properties. */ - request_update(): void - - /** The current [Material] of the primitive mesh. */ - get material(): BaseMaterial3D | ShaderMaterial - set material(value: BaseMaterial3D | ShaderMaterial) - - /** Overrides the [AABB] with one defined by user for use with frustum culling. Especially useful to avoid unexpected culling when using a shader to offset vertices. */ - get custom_aabb(): AABB - set custom_aabb(value: AABB) - - /** If set, the order of the vertices in each triangle are reversed resulting in the backside of the mesh being drawn. - * This gives the same result as using [constant BaseMaterial3D.CULL_FRONT] in [member BaseMaterial3D.cull_mode]. - */ - get flip_faces(): boolean - set flip_faces(value: boolean) - - /** If set, generates UV2 UV coordinates applying a padding using the [member uv2_padding] setting. UV2 is needed for lightmapping. */ - get add_uv2(): boolean - set add_uv2(value: boolean) - - /** If [member add_uv2] is set, specifies the padding in pixels applied along seams of the mesh. Lower padding values allow making better use of the lightmap texture (resulting in higher texel density), but may introduce visible lightmap bleeding along edges. - * If the size of the lightmap texture can't be determined when generating the mesh, UV2 is calculated assuming a texture size of 1024x1024. - */ - get uv2_padding(): float64 - set uv2_padding(value: float64) - } - /** Class representing a prism-shaped [PrimitiveMesh]. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_prismmesh.html - */ - class PrismMesh extends PrimitiveMesh { - constructor(identifier?: any) - /** Displacement of the upper edge along the X axis. 0.0 positions edge straight above the bottom-left edge. */ - get left_to_right(): float64 - set left_to_right(value: float64) - - /** Size of the prism. */ - get size(): Vector3 - set size(value: Vector3) - - /** Number of added edge loops along the X axis. */ - get subdivide_width(): int64 - set subdivide_width(value: int64) - - /** Number of added edge loops along the Y axis. */ - get subdivide_height(): int64 - set subdivide_height(value: int64) - - /** Number of added edge loops along the Z axis. */ - get subdivide_depth(): int64 - set subdivide_depth(value: int64) - } - /** A material that defines a simple sky for a [Sky] resource. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_proceduralskymaterial.html - */ - class ProceduralSkyMaterial extends Material { - constructor(identifier?: any) - /** Color of the sky at the top. Blends with [member sky_horizon_color]. */ - get sky_top_color(): Color - set sky_top_color(value: Color) - - /** Color of the sky at the horizon. Blends with [member sky_top_color]. */ - get sky_horizon_color(): Color - set sky_horizon_color(value: Color) - - /** How quickly the [member sky_horizon_color] fades into the [member sky_top_color]. */ - get sky_curve(): float64 - set sky_curve(value: float64) - - /** Multiplier for sky color. A higher value will make the sky brighter. */ - get sky_energy_multiplier(): float64 - set sky_energy_multiplier(value: float64) - - /** The sky cover texture to use. This texture must use an equirectangular projection (similar to [PanoramaSkyMaterial]). The texture's colors will be *added* to the existing sky color, and will be multiplied by [member sky_energy_multiplier] and [member sky_cover_modulate]. This is mainly suited to displaying stars at night, but it can also be used to display clouds at day or night (with a non-physically-accurate look). */ - get sky_cover(): Texture2D - set sky_cover(value: Texture2D) - - /** The tint to apply to the [member sky_cover] texture. This can be used to change the sky cover's colors or opacity independently of the sky energy, which is useful for day/night or weather transitions. Only effective if a texture is defined in [member sky_cover]. */ - get sky_cover_modulate(): Color - set sky_cover_modulate(value: Color) - - /** Color of the ground at the bottom. Blends with [member ground_horizon_color]. */ - get ground_bottom_color(): Color - set ground_bottom_color(value: Color) - - /** Color of the ground at the horizon. Blends with [member ground_bottom_color]. */ - get ground_horizon_color(): Color - set ground_horizon_color(value: Color) - - /** How quickly the [member ground_horizon_color] fades into the [member ground_bottom_color]. */ - get ground_curve(): float64 - set ground_curve(value: float64) - - /** Multiplier for ground color. A higher value will make the ground brighter. */ - get ground_energy_multiplier(): float64 - set ground_energy_multiplier(value: float64) - - /** Distance from center of sun where it fades out completely. */ - get sun_angle_max(): float64 - set sun_angle_max(value: float64) - - /** How quickly the sun fades away between the edge of the sun disk and [member sun_angle_max]. */ - get sun_curve(): float64 - set sun_curve(value: float64) - - /** If `true`, enables debanding. Debanding adds a small amount of noise which helps reduce banding that appears from the smooth changes in color in the sky. */ - get use_debanding(): boolean - set use_debanding(value: boolean) - - /** The sky's overall brightness multiplier. Higher values result in a brighter sky. */ - get energy_multiplier(): float64 - set energy_multiplier(value: float64) - } - class ProceduralSkyMaterialConversionPlugin extends EditorResourceConversionPlugin { - constructor(identifier?: any) - } - namespace ProgressBar { - enum FillMode { - /** The progress bar fills from begin to end horizontally, according to the language direction. If [method Control.is_layout_rtl] returns `false`, it fills from left to right, and if it returns `true`, it fills from right to left. */ - FILL_BEGIN_TO_END = 0, - - /** The progress bar fills from end to begin horizontally, according to the language direction. If [method Control.is_layout_rtl] returns `false`, it fills from right to left, and if it returns `true`, it fills from left to right. */ - FILL_END_TO_BEGIN = 1, - - /** The progress fills from top to bottom. */ - FILL_TOP_TO_BOTTOM = 2, - - /** The progress fills from bottom to top. */ - FILL_BOTTOM_TO_TOP = 3, - } - } - /** A control used for visual representation of a percentage. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_progressbar.html - */ - class ProgressBar extends Range { - constructor(identifier?: any) - /** The fill direction. See [enum FillMode] for possible values. */ - get fill_mode(): int64 - set fill_mode(value: int64) - - /** If `true`, the fill percentage is displayed on the bar. */ - get show_percentage(): boolean - set show_percentage(value: boolean) - - /** When set to `true`, the progress bar indicates that something is happening with an animation, but does not show the fill percentage or value. */ - get indeterminate(): boolean - set indeterminate(value: boolean) - - /** If `false`, the [member indeterminate] animation will be paused in the editor. */ - get editor_preview_indeterminate(): boolean - set editor_preview_indeterminate(value: boolean) - } - class ProgressDialog extends PopupPanel { - constructor(identifier?: any) - } - class ProjectExportDialog extends ConfirmationDialog { - constructor(identifier?: any) - get_current_preset(): any /*EditorExportPreset*/ - get export_path(): string - set export_path(value: string) - } - class ProjectExportTextureFormatError extends HBoxContainer { - constructor(identifier?: any) - readonly texture_format_enabled: Signal0 - } - class ProjectSettingsEditor extends AcceptDialog { - constructor(identifier?: any) - queue_save(): void - _update_action_map_editor(): void - } - class PropertySelector extends ConfirmationDialog { - constructor(identifier?: any) - readonly selected: Signal1 - } - /** Interpolates an [Object]'s property over time. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_propertytweener.html - */ - class PropertyTweener extends Tweener { - constructor(identifier?: any) - /** Sets a custom initial value to the [PropertyTweener]. - * **Example:** - * - */ - from(value: any): PropertyTweener - - /** Makes the [PropertyTweener] use the current property value (i.e. at the time of creating this [PropertyTweener]) as a starting point. This is equivalent of using [method from] with the current value. These two calls will do the same: - * - */ - from_current(): PropertyTweener - - /** When called, the final value will be used as a relative value instead. - * **Example:** - * - */ - as_relative(): PropertyTweener - - /** Sets the type of used transition from [enum Tween.TransitionType]. If not set, the default transition is used from the [Tween] that contains this Tweener. */ - set_trans(trans: Tween.TransitionType): PropertyTweener - - /** Sets the type of used easing from [enum Tween.EaseType]. If not set, the default easing is used from the [Tween] that contains this Tweener. */ - set_ease(ease: Tween.EaseType): PropertyTweener - - /** Allows interpolating the value with a custom easing function. The provided [param interpolator_method] will be called with a value ranging from `0.0` to `1.0` and is expected to return a value within the same range (values outside the range can be used for overshoot). The return value of the method is then used for interpolation between initial and final value. Note that the parameter passed to the method is still subject to the tweener's own easing. - * **Example:** - * - */ - set_custom_interpolator(interpolator_method: Callable): PropertyTweener - - /** Sets the time in seconds after which the [PropertyTweener] will start interpolating. By default there's no delay. */ - set_delay(delay: float64): PropertyTweener - } - /** Class representing a square mesh facing the camera. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_quadmesh.html - */ - class QuadMesh extends PlaneMesh { - constructor(identifier?: any) - } - /** Flat plane shape for use with occlusion culling in [OccluderInstance3D]. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_quadoccluder3d.html - */ - class QuadOccluder3D extends Occluder3D { - constructor(identifier?: any) - /** The quad's size in 3D units. */ - get size(): Vector2 - set size(value: Vector2) - } - /** Attachment format (used by [RenderingDevice]). - * - * @link https://docs.godotengine.org/en/4.3/classes/class_rdattachmentformat.html - */ - class RDAttachmentFormat extends RefCounted { - constructor(identifier?: any) - /** The attachment's data format. */ - get format(): int64 - set format(value: int64) - - /** The number of samples used when sampling the attachment. */ - get samples(): int64 - set samples(value: int64) - - /** The attachment's usage flags, which determine what can be done with it. */ - get usage_flags(): int64 - set usage_flags(value: int64) - } - /** Framebuffer pass attachment description (used by [RenderingDevice]). - * - * @link https://docs.godotengine.org/en/4.3/classes/class_rdframebufferpass.html - */ - class RDFramebufferPass extends RefCounted { - /** Attachment is unused. */ - static readonly ATTACHMENT_UNUSED = -1 - constructor(identifier?: any) - - /** Color attachments in order starting from 0. If this attachment is not used by the shader, pass ATTACHMENT_UNUSED to skip. */ - get color_attachments(): PackedInt32Array - set color_attachments(value: PackedInt32Array | int32[]) - - /** Used for multipass framebuffers (more than one render pass). Converts an attachment to an input. Make sure to also supply it properly in the [RDUniform] for the uniform set. */ - get input_attachments(): PackedInt32Array - set input_attachments(value: PackedInt32Array | int32[]) - - /** If the color attachments are multisampled, non-multisampled resolve attachments can be provided. */ - get resolve_attachments(): PackedInt32Array - set resolve_attachments(value: PackedInt32Array | int32[]) - - /** Attachments to preserve in this pass (otherwise they are erased). */ - get preserve_attachments(): PackedInt32Array - set preserve_attachments(value: PackedInt32Array | int32[]) - - /** Depth attachment. ATTACHMENT_UNUSED should be used if no depth buffer is required for this pass. */ - get depth_attachment(): int64 - set depth_attachment(value: int64) - } - /** Pipeline color blend state (used by [RenderingDevice]). - * - * @link https://docs.godotengine.org/en/4.3/classes/class_rdpipelinecolorblendstate.html - */ - class RDPipelineColorBlendState extends RefCounted { - constructor(identifier?: any) - /** If `true`, performs the logic operation defined in [member logic_op]. */ - get enable_logic_op(): boolean - set enable_logic_op(value: boolean) - - /** The logic operation to perform for blending. Only effective if [member enable_logic_op] is `true`. */ - get logic_op(): int64 - set logic_op(value: int64) - - /** The constant color to blend with. See also [method RenderingDevice.draw_list_set_blend_constants]. */ - get blend_constant(): Color - set blend_constant(value: Color) - - /** The attachments that are blended together. */ - get attachments(): GArray - set attachments(value: GArray) - } - /** Pipeline color blend state attachment (used by [RenderingDevice]). - * - * @link https://docs.godotengine.org/en/4.3/classes/class_rdpipelinecolorblendstateattachment.html - */ - class RDPipelineColorBlendStateAttachment extends RefCounted { - constructor(identifier?: any) - /** Convenience method to perform standard mix blending with straight (non-premultiplied) alpha. This sets [member enable_blend] to `true`, [member src_color_blend_factor] to [constant RenderingDevice.BLEND_FACTOR_SRC_ALPHA], [member dst_color_blend_factor] to [constant RenderingDevice.BLEND_FACTOR_ONE_MINUS_SRC_ALPHA], [member src_alpha_blend_factor] to [constant RenderingDevice.BLEND_FACTOR_SRC_ALPHA] and [member dst_alpha_blend_factor] to [constant RenderingDevice.BLEND_FACTOR_ONE_MINUS_SRC_ALPHA]. */ - set_as_mix(): void - - /** If `true`, performs blending between the source and destination according to the factors defined in [member src_color_blend_factor], [member dst_color_blend_factor], [member src_alpha_blend_factor] and [member dst_alpha_blend_factor]. The blend modes [member color_blend_op] and [member alpha_blend_op] are also taken into account, with [member write_r], [member write_g], [member write_b] and [member write_a] controlling the output. */ - get enable_blend(): boolean - set enable_blend(value: boolean) - - /** Controls how the blend factor for the color channels is determined based on the source's fragments. */ - get src_color_blend_factor(): int64 - set src_color_blend_factor(value: int64) - - /** Controls how the blend factor for the color channels is determined based on the destination's fragments. */ - get dst_color_blend_factor(): int64 - set dst_color_blend_factor(value: int64) - - /** The blend mode to use for the red/green/blue color channels. */ - get color_blend_op(): int64 - set color_blend_op(value: int64) - - /** Controls how the blend factor for the alpha channel is determined based on the source's fragments. */ - get src_alpha_blend_factor(): int64 - set src_alpha_blend_factor(value: int64) - - /** Controls how the blend factor for the alpha channel is determined based on the destination's fragments. */ - get dst_alpha_blend_factor(): int64 - set dst_alpha_blend_factor(value: int64) - - /** The blend mode to use for the alpha channel. */ - get alpha_blend_op(): int64 - set alpha_blend_op(value: int64) - - /** If `true`, writes the new red color channel to the final result. */ - get write_r(): boolean - set write_r(value: boolean) - - /** If `true`, writes the new green color channel to the final result. */ - get write_g(): boolean - set write_g(value: boolean) - - /** If `true`, writes the new blue color channel to the final result. */ - get write_b(): boolean - set write_b(value: boolean) - - /** If `true`, writes the new alpha channel to the final result. */ - get write_a(): boolean - set write_a(value: boolean) - } - /** Pipeline depth/stencil state (used by [RenderingDevice]). - * - * @link https://docs.godotengine.org/en/4.3/classes/class_rdpipelinedepthstencilstate.html - */ - class RDPipelineDepthStencilState extends RefCounted { - constructor(identifier?: any) - /** If `true`, enables depth testing which allows objects to be automatically occluded by other objects based on their depth. This also allows objects to be partially occluded by other objects. If `false`, objects will appear in the order they were drawn (like in Godot's 2D renderer). */ - get enable_depth_test(): boolean - set enable_depth_test(value: boolean) - - /** If `true`, writes to the depth buffer whenever the depth test returns true. Only works when enable_depth_test is also true. */ - get enable_depth_write(): boolean - set enable_depth_write(value: boolean) - - /** The method used for comparing the previous and current depth values. */ - get depth_compare_operator(): int64 - set depth_compare_operator(value: int64) - - /** If `true`, each depth value will be tested to see if it is between [member depth_range_min] and [member depth_range_max]. If it is outside of these values, it is discarded. */ - get enable_depth_range(): boolean - set enable_depth_range(value: boolean) - - /** The minimum depth that returns true for [member enable_depth_range]. */ - get depth_range_min(): float64 - set depth_range_min(value: float64) - - /** The maximum depth that returns true for [member enable_depth_range]. */ - get depth_range_max(): float64 - set depth_range_max(value: float64) - - /** If `true`, enables stencil testing. There are separate stencil buffers for front-facing triangles and back-facing triangles. See properties that begin with "front_op" and properties with "back_op" for each. */ - get enable_stencil(): boolean - set enable_stencil(value: boolean) - - /** The operation to perform on the stencil buffer for front pixels that fail the stencil test. */ - get front_op_fail(): int64 - set front_op_fail(value: int64) - - /** The operation to perform on the stencil buffer for front pixels that pass the stencil test. */ - get front_op_pass(): int64 - set front_op_pass(value: int64) - - /** The operation to perform on the stencil buffer for front pixels that pass the stencil test but fail the depth test. */ - get front_op_depth_fail(): int64 - set front_op_depth_fail(value: int64) - - /** The method used for comparing the previous front stencil value and [member front_op_reference]. */ - get front_op_compare(): int64 - set front_op_compare(value: int64) - - /** Selects which bits from the front stencil value will be compared. */ - get front_op_compare_mask(): int64 - set front_op_compare_mask(value: int64) - - /** Selects which bits from the front stencil value will be changed. */ - get front_op_write_mask(): int64 - set front_op_write_mask(value: int64) - - /** The value the previous front stencil value will be compared to. */ - get front_op_reference(): int64 - set front_op_reference(value: int64) - - /** The operation to perform on the stencil buffer for back pixels that fail the stencil test */ - get back_op_fail(): int64 - set back_op_fail(value: int64) - - /** The operation to perform on the stencil buffer for back pixels that pass the stencil test. */ - get back_op_pass(): int64 - set back_op_pass(value: int64) - - /** The operation to perform on the stencil buffer for back pixels that pass the stencil test but fail the depth test. */ - get back_op_depth_fail(): int64 - set back_op_depth_fail(value: int64) - - /** The method used for comparing the previous back stencil value and [member back_op_reference]. */ - get back_op_compare(): int64 - set back_op_compare(value: int64) - - /** Selects which bits from the back stencil value will be compared. */ - get back_op_compare_mask(): int64 - set back_op_compare_mask(value: int64) - - /** Selects which bits from the back stencil value will be changed. */ - get back_op_write_mask(): int64 - set back_op_write_mask(value: int64) - - /** The value the previous back stencil value will be compared to. */ - get back_op_reference(): int64 - set back_op_reference(value: int64) - } - /** Pipeline multisample state (used by [RenderingDevice]). - * - * @link https://docs.godotengine.org/en/4.3/classes/class_rdpipelinemultisamplestate.html - */ - class RDPipelineMultisampleState extends RefCounted { - constructor(identifier?: any) - /** The number of MSAA samples (or SSAA samples if [member enable_sample_shading] is `true`) to perform. Higher values result in better antialiasing, at the cost of performance. */ - get sample_count(): int64 - set sample_count(value: int64) - - /** If `true`, enables per-sample shading which replaces MSAA by SSAA. This provides higher quality antialiasing that works with transparent (alpha scissor) edges. This has a very high performance cost. See also [member min_sample_shading]. See the [url=https://registry.khronos.org/vulkan/specs/1.3-extensions/html/vkspec.html#primsrast-sampleshading]per-sample shading Vulkan documentation[/url] for more details. */ - get enable_sample_shading(): boolean - set enable_sample_shading(value: boolean) - - /** The multiplier of [member sample_count] that determines how many samples are performed for each fragment. Must be between `0.0` and `1.0` (inclusive). Only effective if [member enable_sample_shading] is `true`. If [member min_sample_shading] is `1.0`, fragment invocation must only read from the coverage index sample. Tile image access must not be used if [member enable_sample_shading] is *not* `1.0`. */ - get min_sample_shading(): float64 - set min_sample_shading(value: float64) - - /** If `true`, alpha to coverage is enabled. This generates a temporary coverage value based on the alpha component of the fragment's first color output. This allows alpha transparency to make use of multisample antialiasing. */ - get enable_alpha_to_coverage(): boolean - set enable_alpha_to_coverage(value: boolean) - - /** If `true`, alpha is forced to either `0.0` or `1.0`. This allows hardening the edges of antialiased alpha transparencies. Only relevant if [member enable_alpha_to_coverage] is `true`. */ - get enable_alpha_to_one(): boolean - set enable_alpha_to_one(value: boolean) - - /** The sample mask array. See the [url=https://registry.khronos.org/vulkan/specs/1.3-extensions/html/vkspec.html#fragops-samplemask]sample mask Vulkan documentation[/url] for more details. */ - get sample_masks(): GArray - set sample_masks(value: GArray) - } - /** Pipeline rasterization state (used by [RenderingDevice]). - * - * @link https://docs.godotengine.org/en/4.3/classes/class_rdpipelinerasterizationstate.html - */ - class RDPipelineRasterizationState extends RefCounted { - constructor(identifier?: any) - /** If `true`, clamps depth values according to the minimum and maximum depth of the associated viewport. */ - get enable_depth_clamp(): boolean - set enable_depth_clamp(value: boolean) - - /** If `true`, primitives are discarded immediately before the rasterization stage. */ - get discard_primitives(): boolean - set discard_primitives(value: boolean) - - /** If `true`, performs wireframe rendering for triangles instead of flat or textured rendering. */ - get wireframe(): boolean - set wireframe(value: boolean) - - /** The cull mode to use when drawing polygons, which determines whether front faces or backfaces are hidden. */ - get cull_mode(): int64 - set cull_mode(value: int64) - - /** The winding order to use to determine which face of a triangle is considered its front face. */ - get front_face(): int64 - set front_face(value: int64) - - /** If `true`, each generated depth value will by offset by some amount. The specific amount is generated per polygon based on the values of [member depth_bias_slope_factor] and [member depth_bias_constant_factor]. */ - get depth_bias_enabled(): boolean - set depth_bias_enabled(value: boolean) - - /** A constant offset added to each depth value. Applied after [member depth_bias_slope_factor]. */ - get depth_bias_constant_factor(): float64 - set depth_bias_constant_factor(value: float64) - - /** A limit for how much each depth value can be offset. If negative, it serves as a minimum value, but if positive, it serves as a maximum value. */ - get depth_bias_clamp(): float64 - set depth_bias_clamp(value: float64) - - /** A constant scale applied to the slope of each polygons' depth. Applied before [member depth_bias_constant_factor]. */ - get depth_bias_slope_factor(): float64 - set depth_bias_slope_factor(value: float64) - - /** The line width to use when drawing lines (in pixels). Thick lines may not be supported on all hardware. */ - get line_width(): float64 - set line_width(value: float64) - - /** The number of control points to use when drawing a patch with tessellation enabled. Higher values result in higher quality at the cost of performance. */ - get patch_control_points(): int64 - set patch_control_points(value: int64) - } - /** Pipeline specialization constant (used by [RenderingDevice]). - * - * @link https://docs.godotengine.org/en/4.3/classes/class_rdpipelinespecializationconstant.html - */ - class RDPipelineSpecializationConstant extends RefCounted { - constructor(identifier?: any) - /** The specialization constant's value. Only [bool], [int] and [float] types are valid for specialization constants. */ - get value(): any - set value(value: any) - - /** The identifier of the specialization constant. This is a value starting from `0` and that increments for every different specialization constant for a given shader. */ - get constant_id(): int64 - set constant_id(value: int64) - } - /** Sampler state (used by [RenderingDevice]). - * - * @link https://docs.godotengine.org/en/4.3/classes/class_rdsamplerstate.html - */ - class RDSamplerState extends RefCounted { - constructor(identifier?: any) - /** The sampler's magnification filter. It is the filtering method used when sampling texels that appear bigger than on-screen pixels. */ - get mag_filter(): int64 - set mag_filter(value: int64) - - /** The sampler's minification filter. It is the filtering method used when sampling texels that appear smaller than on-screen pixels. */ - get min_filter(): int64 - set min_filter(value: int64) - - /** The filtering method to use for mipmaps. */ - get mip_filter(): int64 - set mip_filter(value: int64) - - /** The repeat mode to use along the U axis of UV coordinates. This affects the returned values if sampling outside the UV bounds. */ - get repeat_u(): int64 - set repeat_u(value: int64) - - /** The repeat mode to use along the V axis of UV coordinates. This affects the returned values if sampling outside the UV bounds. */ - get repeat_v(): int64 - set repeat_v(value: int64) - - /** The repeat mode to use along the W axis of UV coordinates. This affects the returned values if sampling outside the UV bounds. Only effective for 3D samplers. */ - get repeat_w(): int64 - set repeat_w(value: int64) - - /** The mipmap LOD bias to use. Positive values will make the sampler blurrier at a given distance, while negative values will make the sampler sharper at a given distance (at the risk of looking grainy). Recommended values are between `-0.5` and `0.0`. Only effective if the sampler has mipmaps available. */ - get lod_bias(): float64 - set lod_bias(value: float64) - - /** If `true`, perform anisotropic sampling. See [member anisotropy_max]. */ - get use_anisotropy(): boolean - set use_anisotropy(value: boolean) - - /** Maximum anisotropy that can be used when sampling. Only effective if [member use_anisotropy] is `true`. Higher values result in a sharper sampler at oblique angles, at the cost of performance (due to memory bandwidth). This value may be limited by the graphics hardware in use. Most graphics hardware only supports values up to `16.0`. - * If [member anisotropy_max] is `1.0`, forcibly disables anisotropy even if [member use_anisotropy] is `true`. - */ - get anisotropy_max(): float64 - set anisotropy_max(value: float64) - - /** If `true`, returned values will be based on the comparison operation defined in [member compare_op]. This is a hardware-based approach and is therefore faster than performing this manually in a shader. For example, compare operations are used for shadow map rendering by comparing depth values from a shadow sampler. */ - get enable_compare(): boolean - set enable_compare(value: boolean) - - /** The compare operation to use. Only effective if [member enable_compare] is `true`. */ - get compare_op(): int64 - set compare_op(value: int64) - - /** The minimum mipmap LOD bias to display (highest resolution). Only effective if the sampler has mipmaps available. */ - get min_lod(): float64 - set min_lod(value: float64) - - /** The maximum mipmap LOD bias to display (lowest resolution). Only effective if the sampler has mipmaps available. */ - get max_lod(): float64 - set max_lod(value: float64) - - /** The border color that will be returned when sampling outside the sampler's bounds and the [member repeat_u], [member repeat_v] or [member repeat_w] modes have repeating disabled. */ - get border_color(): int64 - set border_color(value: int64) - - /** If `true`, the texture will be sampled with coordinates ranging from 0 to the texture's resolution. Otherwise, the coordinates will be normalized and range from 0 to 1. */ - get unnormalized_uvw(): boolean - set unnormalized_uvw(value: boolean) - } - /** Compiled shader file in SPIR-V form (used by [RenderingDevice]). Not to be confused with Godot's own [Shader]. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_rdshaderfile.html - */ - class RDShaderFile extends Resource { - constructor(identifier?: any) - /** Sets the SPIR-V [param bytecode] that will be compiled for the specified [param version]. */ - set_bytecode(bytecode: RDShaderSPIRV, version: StringName = ''): void - - /** Returns the SPIR-V intermediate representation for the specified shader [param version]. */ - get_spirv(version: StringName = ''): RDShaderSPIRV - - /** Returns the list of compiled versions for this shader. */ - get_version_list(): GArray - get _versions(): GDictionary - set _versions(value: GDictionary) - - /** The base compilation error message, which indicates errors not related to a specific shader stage if non-empty. If empty, shader compilation is not necessarily successful (check [RDShaderSPIRV]'s error message members). */ - get base_error(): string - set base_error(value: string) - } - /** SPIR-V intermediate representation as part of a [RDShaderFile] (used by [RenderingDevice]). - * - * @link https://docs.godotengine.org/en/4.3/classes/class_rdshaderspirv.html - */ - class RDShaderSPIRV extends Resource { - constructor(identifier?: any) - /** Sets the SPIR-V [param bytecode] for the given shader [param stage]. Equivalent to setting one of [member bytecode_compute], [member bytecode_fragment], [member bytecode_tesselation_control], [member bytecode_tesselation_evaluation], [member bytecode_vertex]. */ - set_stage_bytecode(stage: RenderingDevice.ShaderStage, bytecode: PackedByteArray | byte[] | ArrayBuffer): void - - /** Equivalent to getting one of [member bytecode_compute], [member bytecode_fragment], [member bytecode_tesselation_control], [member bytecode_tesselation_evaluation], [member bytecode_vertex]. */ - get_stage_bytecode(stage: RenderingDevice.ShaderStage): PackedByteArray - - /** Sets the compilation error message for the given shader [param stage] to [param compile_error]. Equivalent to setting one of [member compile_error_compute], [member compile_error_fragment], [member compile_error_tesselation_control], [member compile_error_tesselation_evaluation], [member compile_error_vertex]. */ - set_stage_compile_error(stage: RenderingDevice.ShaderStage, compile_error: string): void - - /** Returns the compilation error message for the given shader [param stage]. Equivalent to getting one of [member compile_error_compute], [member compile_error_fragment], [member compile_error_tesselation_control], [member compile_error_tesselation_evaluation], [member compile_error_vertex]. */ - get_stage_compile_error(stage: RenderingDevice.ShaderStage): string - - /** The SPIR-V bytecode for the vertex shader stage. */ - get bytecode_vertex(): PackedByteArray - set bytecode_vertex(value: PackedByteArray | byte[] | ArrayBuffer) - - /** The SPIR-V bytecode for the fragment shader stage. */ - get bytecode_fragment(): PackedByteArray - set bytecode_fragment(value: PackedByteArray | byte[] | ArrayBuffer) - - /** The SPIR-V bytecode for the tessellation control shader stage. */ - get bytecode_tesselation_control(): PackedByteArray - set bytecode_tesselation_control(value: PackedByteArray | byte[] | ArrayBuffer) - - /** The SPIR-V bytecode for the tessellation evaluation shader stage. */ - get bytecode_tesselation_evaluation(): PackedByteArray - set bytecode_tesselation_evaluation(value: PackedByteArray | byte[] | ArrayBuffer) - - /** The SPIR-V bytecode for the compute shader stage. */ - get bytecode_compute(): PackedByteArray - set bytecode_compute(value: PackedByteArray | byte[] | ArrayBuffer) - - /** The compilation error message for the vertex shader stage (set by the SPIR-V compiler and Godot). If empty, shader compilation was successful. */ - get compile_error_vertex(): string - set compile_error_vertex(value: string) - - /** The compilation error message for the fragment shader stage (set by the SPIR-V compiler and Godot). If empty, shader compilation was successful. */ - get compile_error_fragment(): string - set compile_error_fragment(value: string) - - /** The compilation error message for the tessellation control shader stage (set by the SPIR-V compiler and Godot). If empty, shader compilation was successful. */ - get compile_error_tesselation_control(): string - set compile_error_tesselation_control(value: string) - - /** The compilation error message for the tessellation evaluation shader stage (set by the SPIR-V compiler and Godot). If empty, shader compilation was successful. */ - get compile_error_tesselation_evaluation(): string - set compile_error_tesselation_evaluation(value: string) - - /** The compilation error message for the compute shader stage (set by the SPIR-V compiler and Godot). If empty, shader compilation was successful. */ - get compile_error_compute(): string - set compile_error_compute(value: string) - } - /** Shader source code (used by [RenderingDevice]). - * - * @link https://docs.godotengine.org/en/4.3/classes/class_rdshadersource.html - */ - class RDShaderSource extends RefCounted { - constructor(identifier?: any) - /** Sets [param source] code for the specified shader [param stage]. Equivalent to setting one of [member source_compute], [member source_fragment], [member source_tesselation_control], [member source_tesselation_evaluation] or [member source_vertex]. */ - set_stage_source(stage: RenderingDevice.ShaderStage, source: string): void - - /** Returns source code for the specified shader [param stage]. Equivalent to getting one of [member source_compute], [member source_fragment], [member source_tesselation_control], [member source_tesselation_evaluation] or [member source_vertex]. */ - get_stage_source(stage: RenderingDevice.ShaderStage): string - - /** Source code for the shader's vertex stage. */ - get source_vertex(): string - set source_vertex(value: string) - - /** Source code for the shader's fragment stage. */ - get source_fragment(): string - set source_fragment(value: string) - - /** Source code for the shader's tessellation control stage. */ - get source_tesselation_control(): string - set source_tesselation_control(value: string) - - /** Source code for the shader's tessellation evaluation stage. */ - get source_tesselation_evaluation(): string - set source_tesselation_evaluation(value: string) - - /** Source code for the shader's compute stage. */ - get source_compute(): string - set source_compute(value: string) - - /** The language the shader is written in. */ - get language(): int64 - set language(value: int64) - } - /** Texture format (used by [RenderingDevice]). - * - * @link https://docs.godotengine.org/en/4.3/classes/class_rdtextureformat.html - */ - class RDTextureFormat extends RefCounted { - constructor(identifier?: any) - add_shareable_format(format: RenderingDevice.DataFormat): void - remove_shareable_format(format: RenderingDevice.DataFormat): void - - /** The texture's pixel data format. */ - get format(): int64 - set format(value: int64) - - /** The texture's width (in pixels). */ - get width(): int64 - set width(value: int64) - - /** The texture's height (in pixels). */ - get height(): int64 - set height(value: int64) - - /** The texture's depth (in pixels). This is always `1` for 2D textures. */ - get depth(): int64 - set depth(value: int64) - - /** The number of layers in the texture. Only relevant for 2D texture arrays. */ - get array_layers(): int64 - set array_layers(value: int64) - - /** The number of mipmaps available in the texture. */ - get mipmaps(): int64 - set mipmaps(value: int64) - - /** The texture type. */ - get texture_type(): int64 - set texture_type(value: int64) - - /** The number of samples used when sampling the texture. */ - get samples(): int64 - set samples(value: int64) - - /** The texture's usage bits, which determine what can be done using the texture. */ - get usage_bits(): int64 - set usage_bits(value: int64) - } - /** Texture view (used by [RenderingDevice]). - * - * @link https://docs.godotengine.org/en/4.3/classes/class_rdtextureview.html - */ - class RDTextureView extends RefCounted { - constructor(identifier?: any) - /** Optional override for the data format to return sampled values in. The default value of [constant RenderingDevice.DATA_FORMAT_MAX] does not override the format. */ - get format_override(): int64 - set format_override(value: int64) - - /** The channel to sample when sampling the red color channel. */ - get swizzle_r(): int64 - set swizzle_r(value: int64) - - /** The channel to sample when sampling the green color channel. */ - get swizzle_g(): int64 - set swizzle_g(value: int64) - - /** The channel to sample when sampling the blue color channel. */ - get swizzle_b(): int64 - set swizzle_b(value: int64) - - /** The channel to sample when sampling the alpha channel. */ - get swizzle_a(): int64 - set swizzle_a(value: int64) - } - /** Shader uniform (used by [RenderingDevice]). - * - * @link https://docs.godotengine.org/en/4.3/classes/class_rduniform.html - */ - class RDUniform extends RefCounted { - constructor(identifier?: any) - /** Binds the given id to the uniform. The data associated with the id is then used when the uniform is passed to a shader. */ - add_id(id: RID): void - - /** Unbinds all ids currently bound to the uniform. */ - clear_ids(): void - - /** The uniform's data type. */ - get uniform_type(): int64 - set uniform_type(value: int64) - - /** The uniform's binding. */ - get binding(): int64 - set binding(value: int64) - get _ids(): GArray - set _ids(value: GArray) - } - /** Vertex attribute (used by [RenderingDevice]). - * - * @link https://docs.godotengine.org/en/4.3/classes/class_rdvertexattribute.html - */ - class RDVertexAttribute extends RefCounted { - constructor(identifier?: any) - get location(): int64 - set location(value: int64) - get offset(): int64 - set offset(value: int64) - get format(): int64 - set format(value: int64) - get stride(): int64 - set stride(value: int64) - get frequency(): int64 - set frequency(value: int64) - } - /** Provides methods for generating pseudo-random numbers. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_randomnumbergenerator.html - */ - class RandomNumberGenerator extends RefCounted { - constructor(identifier?: any) - /** Returns a pseudo-random 32-bit unsigned integer between `0` and `4294967295` (inclusive). */ - randi(): int64 - - /** Returns a pseudo-random float between `0.0` and `1.0` (inclusive). */ - randf(): float64 - - /** Returns a [url=https://en.wikipedia.org/wiki/Normal_distribution]normally-distributed[/url], pseudo-random floating-point number from the specified [param mean] and a standard [param deviation]. This is also known as a Gaussian distribution. - * - * **Note:** This method uses the [url=https://en.wikipedia.org/wiki/Box%E2%80%93Muller_transform]Box-Muller transform[/url] algorithm. - */ - randfn(mean: float64 = 0, deviation: float64 = 1): float64 - - /** Returns a pseudo-random float between [param from] and [param to] (inclusive). */ - randf_range(from: float64, to: float64): float64 - - /** Returns a pseudo-random 32-bit signed integer between [param from] and [param to] (inclusive). */ - randi_range(from: int64, to: int64): int64 - - /** Returns a random index with non-uniform weights. Prints an error and returns `-1` if the array is empty. - * - */ - rand_weighted(weights: PackedFloat32Array | float32[]): int64 - - /** Sets up a time-based seed for this [RandomNumberGenerator] instance. Unlike the [@GlobalScope] random number generation functions, different [RandomNumberGenerator] instances can use different seeds. */ - randomize(): void - - /** Initializes the random number generator state based on the given seed value. A given seed will give a reproducible sequence of pseudo-random numbers. - * - * **Note:** The RNG does not have an avalanche effect, and can output similar random streams given similar seeds. Consider using a hash function to improve your seed quality if they're sourced externally. - * - * **Note:** Setting this property produces a side effect of changing the internal [member state], so make sure to initialize the seed *before* modifying the [member state]: - * - * **Note:** The default value of this property is pseudo-random, and changes when calling [method randomize]. The `0` value documented here is a placeholder, and not the actual default seed. - * - */ - get seed(): int64 - set seed(value: int64) - - /** The current state of the random number generator. Save and restore this property to restore the generator to a previous state: - * - * - * **Note:** Do not set state to arbitrary values, since the random number generator requires the state to have certain qualities to behave properly. It should only be set to values that came from the state property itself. To initialize the random number generator with arbitrary input, use [member seed] instead. - * - * **Note:** The default value of this property is pseudo-random, and changes when calling [method randomize]. The `0` value documented here is a placeholder, and not the actual default seed. - */ - get state(): int64 - set state(value: int64) - } - /** Abstract base class for controls that represent a number within a range. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_range.html - */ - class Range extends Control { - constructor(identifier?: any) - /** Called when the [Range]'s value is changed (following the same conditions as [signal value_changed]). */ - /* gdvirtual */ _value_changed(new_value: float64): void - - /** Sets the [Range]'s current value to the specified [param value], without emitting the [signal value_changed] signal. */ - set_value_no_signal(value: float64): void - - /** Binds two [Range]s together along with any ranges previously grouped with either of them. When any of range's member variables change, it will share the new value with all other ranges in its group. */ - share(with_: Node): void - - /** Stops the [Range] from sharing its member variables with any other. */ - unshare(): void - - /** Minimum value. Range is clamped if [member value] is less than [member min_value]. */ - get min_value(): float64 - set min_value(value: float64) - - /** Maximum value. Range is clamped if [member value] is greater than [member max_value]. */ - get max_value(): float64 - set max_value(value: float64) - - /** If greater than 0, [member value] will always be rounded to a multiple of this property's value. If [member rounded] is also `true`, [member value] will first be rounded to a multiple of this property's value, then rounded to the nearest integer. */ - get step(): float64 - set step(value: float64) - - /** Page size. Used mainly for [ScrollBar]. ScrollBar's length is its size multiplied by [member page] over the difference between [member min_value] and [member max_value]. */ - get page(): float64 - set page(value: float64) - - /** Range's current value. Changing this property (even via code) will trigger [signal value_changed] signal. Use [method set_value_no_signal] if you want to avoid it. */ - get value(): float64 - set value(value: float64) - - /** The value mapped between 0 and 1. */ - get ratio(): float64 - set ratio(value: float64) - - /** If `true`, and [member min_value] is greater than 0, [member value] will be represented exponentially rather than linearly. */ - get exp_edit(): boolean - set exp_edit(value: boolean) - - /** If `true`, [member value] will always be rounded to the nearest integer. */ - get rounded(): boolean - set rounded(value: boolean) - - /** If `true`, [member value] may be greater than [member max_value]. */ - get allow_greater(): boolean - set allow_greater(value: boolean) - - /** If `true`, [member value] may be less than [member min_value]. */ - get allow_lesser(): boolean - set allow_lesser(value: boolean) - - /** Emitted when [member value] changes. When used on a [Slider], this is called continuously while dragging (potentially every frame). If you are performing an expensive operation in a function connected to [signal value_changed], consider using a *debouncing* [Timer] to call the function less often. - * - * **Note:** Unlike signals such as [signal LineEdit.text_changed], [signal value_changed] is also emitted when [param value] is set directly via code. - */ - readonly value_changed: Signal1 - - /** Emitted when [member min_value], [member max_value], [member page], or [member step] change. */ - readonly changed: Signal0 - } - /** A ray in 2D space, used to find the first [CollisionObject2D] it intersects. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_raycast2d.html - */ - class RayCast2D extends Node2D { - constructor(identifier?: any) - /** Returns whether any object is intersecting with the ray's vector (considering the vector length). */ - is_colliding(): boolean - - /** Updates the collision information for the ray immediately, without waiting for the next `_physics_process` call. Use this method, for example, when the ray or its parent has changed state. - * - * **Note:** [member enabled] does not need to be `true` for this to work. - */ - force_raycast_update(): void - - /** Returns the first object that the ray intersects, or `null` if no object is intersecting the ray (i.e. [method is_colliding] returns `false`). */ - get_collider(): Object - - /** Returns the [RID] of the first object that the ray intersects, or an empty [RID] if no object is intersecting the ray (i.e. [method is_colliding] returns `false`). */ - get_collider_rid(): RID - - /** Returns the shape ID of the first object that the ray intersects, or `0` if no object is intersecting the ray (i.e. [method is_colliding] returns `false`). - * To get the intersected shape node, for a [CollisionObject2D] target, use: - * - */ - get_collider_shape(): int64 - - /** Returns the collision point at which the ray intersects the closest object, in the global coordinate system. If [member hit_from_inside] is `true` and the ray starts inside of a collision shape, this function will return the origin point of the ray. - * - * **Note:** Check that [method is_colliding] returns `true` before calling this method to ensure the returned point is valid and up-to-date. - */ - get_collision_point(): Vector2 - - /** Returns the normal of the intersecting object's shape at the collision point, or `Vector2(0, 0)` if the ray starts inside the shape and [member hit_from_inside] is `true`. - * - * **Note:** Check that [method is_colliding] returns `true` before calling this method to ensure the returned normal is valid and up-to-date. - */ - get_collision_normal(): Vector2 - - /** Adds a collision exception so the ray does not report collisions with the specified [RID]. */ - add_exception_rid(rid: RID): void - - /** Adds a collision exception so the ray does not report collisions with the specified [CollisionObject2D] node. */ - add_exception(node: CollisionObject2D): void - - /** Removes a collision exception so the ray does report collisions with the specified [RID]. */ - remove_exception_rid(rid: RID): void - - /** Removes a collision exception so the ray does report collisions with the specified [CollisionObject2D] node. */ - remove_exception(node: CollisionObject2D): void - - /** Removes all collision exceptions for this ray. */ - clear_exceptions(): void - - /** Based on [param value], enables or disables the specified layer in the [member collision_mask], given a [param layer_number] between 1 and 32. */ - set_collision_mask_value(layer_number: int64, value: boolean): void - - /** Returns whether or not the specified layer of the [member collision_mask] is enabled, given a [param layer_number] between 1 and 32. */ - get_collision_mask_value(layer_number: int64): boolean - - /** If `true`, collisions will be reported. */ - get enabled(): boolean - set enabled(value: boolean) - - /** If `true`, the parent node will be excluded from collision detection. */ - get exclude_parent(): boolean - set exclude_parent(value: boolean) - - /** The ray's destination point, relative to the RayCast's `position`. */ - get target_position(): Vector2 - set target_position(value: Vector2) - - /** The ray's collision mask. Only objects in at least one collision layer enabled in the mask will be detected. See [url=https://docs.godotengine.org/en/4.3/tutorials/physics/physics_introduction.html#collision-layers-and-masks]Collision layers and masks[/url] in the documentation for more information. */ - get collision_mask(): int64 - set collision_mask(value: int64) - - /** If `true`, the ray will detect a hit when starting inside shapes. In this case the collision normal will be `Vector2(0, 0)`. Does not affect concave polygon shapes. */ - get hit_from_inside(): boolean - set hit_from_inside(value: boolean) - - /** If `true`, collisions with [Area2D]s will be reported. */ - get collide_with_areas(): boolean - set collide_with_areas(value: boolean) - - /** If `true`, collisions with [PhysicsBody2D]s will be reported. */ - get collide_with_bodies(): boolean - set collide_with_bodies(value: boolean) - } - /** A ray in 3D space, used to find the first [CollisionObject3D] it intersects. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_raycast3d.html - */ - class RayCast3D extends Node3D { - constructor(identifier?: any) - /** Returns whether any object is intersecting with the ray's vector (considering the vector length). */ - is_colliding(): boolean - - /** Updates the collision information for the ray immediately, without waiting for the next `_physics_process` call. Use this method, for example, when the ray or its parent has changed state. - * - * **Note:** [member enabled] does not need to be `true` for this to work. - */ - force_raycast_update(): void - - /** Returns the first object that the ray intersects, or `null` if no object is intersecting the ray (i.e. [method is_colliding] returns `false`). */ - get_collider(): Object - - /** Returns the [RID] of the first object that the ray intersects, or an empty [RID] if no object is intersecting the ray (i.e. [method is_colliding] returns `false`). */ - get_collider_rid(): RID - - /** Returns the shape ID of the first object that the ray intersects, or `0` if no object is intersecting the ray (i.e. [method is_colliding] returns `false`). - * To get the intersected shape node, for a [CollisionObject3D] target, use: - * - */ - get_collider_shape(): int64 - - /** Returns the collision point at which the ray intersects the closest object, in the global coordinate system. If [member hit_from_inside] is `true` and the ray starts inside of a collision shape, this function will return the origin point of the ray. - * - * **Note:** Check that [method is_colliding] returns `true` before calling this method to ensure the returned point is valid and up-to-date. - */ - get_collision_point(): Vector3 - - /** Returns the normal of the intersecting object's shape at the collision point, or `Vector3(0, 0, 0)` if the ray starts inside the shape and [member hit_from_inside] is `true`. - * - * **Note:** Check that [method is_colliding] returns `true` before calling this method to ensure the returned normal is valid and up-to-date. - */ - get_collision_normal(): Vector3 - - /** Returns the collision object's face index at the collision point, or `-1` if the shape intersecting the ray is not a [ConcavePolygonShape3D]. */ - get_collision_face_index(): int64 - - /** Adds a collision exception so the ray does not report collisions with the specified [RID]. */ - add_exception_rid(rid: RID): void - - /** Adds a collision exception so the ray does not report collisions with the specified [CollisionObject3D] node. */ - add_exception(node: CollisionObject3D): void - - /** Removes a collision exception so the ray does report collisions with the specified [RID]. */ - remove_exception_rid(rid: RID): void - - /** Removes a collision exception so the ray does report collisions with the specified [CollisionObject3D] node. */ - remove_exception(node: CollisionObject3D): void - - /** Removes all collision exceptions for this ray. */ - clear_exceptions(): void - - /** Based on [param value], enables or disables the specified layer in the [member collision_mask], given a [param layer_number] between 1 and 32. */ - set_collision_mask_value(layer_number: int64, value: boolean): void - - /** Returns whether or not the specified layer of the [member collision_mask] is enabled, given a [param layer_number] between 1 and 32. */ - get_collision_mask_value(layer_number: int64): boolean - - /** If `true`, collisions will be reported. */ - get enabled(): boolean - set enabled(value: boolean) - - /** If `true`, collisions will be ignored for this RayCast3D's immediate parent. */ - get exclude_parent(): boolean - set exclude_parent(value: boolean) - - /** The ray's destination point, relative to the RayCast's `position`. */ - get target_position(): Vector3 - set target_position(value: Vector3) - - /** The ray's collision mask. Only objects in at least one collision layer enabled in the mask will be detected. See [url=https://docs.godotengine.org/en/4.3/tutorials/physics/physics_introduction.html#collision-layers-and-masks]Collision layers and masks[/url] in the documentation for more information. */ - get collision_mask(): int64 - set collision_mask(value: int64) - - /** If `true`, the ray will detect a hit when starting inside shapes. In this case the collision normal will be `Vector3(0, 0, 0)`. Does not affect shapes with no volume like concave polygon or heightmap. */ - get hit_from_inside(): boolean - set hit_from_inside(value: boolean) - - /** If `true`, the ray will hit back faces with concave polygon shapes with back face enabled or heightmap shapes. */ - get hit_back_faces(): boolean - set hit_back_faces(value: boolean) - - /** If `true`, collisions with [Area3D]s will be reported. */ - get collide_with_areas(): boolean - set collide_with_areas(value: boolean) - - /** If `true`, collisions with [PhysicsBody3D]s will be reported. */ - get collide_with_bodies(): boolean - set collide_with_bodies(value: boolean) - - /** The custom color to use to draw the shape in the editor and at run-time if **Visible Collision Shapes** is enabled in the **Debug** menu. This color will be highlighted at run-time if the [RayCast3D] is colliding with something. - * If set to `Color(0.0, 0.0, 0.0)` (by default), the color set in [member ProjectSettings.debug/shapes/collision/shape_color] is used. - */ - get debug_shape_custom_color(): Color - set debug_shape_custom_color(value: Color) - - /** If set to `1`, a line is used as the debug shape. Otherwise, a truncated pyramid is drawn to represent the [RayCast3D]. Requires **Visible Collision Shapes** to be enabled in the **Debug** menu for the debug shape to be visible at run-time. */ - get debug_shape_thickness(): int64 - set debug_shape_thickness(value: int64) - } - class RayCast3DGizmoPlugin extends EditorNode3DGizmoPlugin { - constructor(identifier?: any) - } - /** A 2D rectangle shape used for physics collision. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_rectangleshape2d.html - */ - class RectangleShape2D extends Shape2D { - constructor(identifier?: any) - /** The rectangle's width and height. */ - get size(): Vector2 - set size(value: Vector2) - } - /** Base class for reference-counted objects. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_refcounted.html - */ - class RefCounted extends Object { - constructor(identifier?: any) - /** Initializes the internal reference counter. Use this only if you really know what you are doing. - * Returns whether the initialization was successful. - */ - init_ref(): boolean - - /** Increments the internal reference counter. Use this only if you really know what you are doing. - * Returns `true` if the increment was successful, `false` otherwise. - */ - reference(): boolean - - /** Decrements the internal reference counter. Use this only if you really know what you are doing. - * Returns `true` if the object should be freed after the decrement, `false` otherwise. - */ - unreference(): boolean - - /** Returns the current reference count. */ - get_reference_count(): int64 - } - /** A rectangle hint for designing UIs. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_referencerect.html - */ - class ReferenceRect extends Control { - constructor(identifier?: any) - /** Sets the border color of the [ReferenceRect]. */ - get border_color(): Color - set border_color(value: Color) - - /** Sets the border width of the [ReferenceRect]. The border grows both inwards and outwards with respect to the rectangle box. */ - get border_width(): float64 - set border_width(value: float64) - - /** If `true`, the [ReferenceRect] will only be visible while in editor. Otherwise, [ReferenceRect] will be visible in the running project. */ - get editor_only(): boolean - set editor_only(value: boolean) - } - namespace ReflectionProbe { - enum UpdateMode { - /** Update the probe once on the next frame (recommended for most objects). The corresponding radiance map will be generated over the following six frames. This takes more time to update than [constant UPDATE_ALWAYS], but it has a lower performance cost and can result in higher-quality reflections. The ReflectionProbe is updated when its transform changes, but not when nearby geometry changes. You can force a [ReflectionProbe] update by moving the [ReflectionProbe] slightly in any direction. */ - UPDATE_ONCE = 0, - - /** Update the probe every frame. This provides better results for fast-moving dynamic objects (such as cars). However, it has a significant performance cost. Due to the cost, it's recommended to only use one ReflectionProbe with [constant UPDATE_ALWAYS] at most per scene. For all other use cases, use [constant UPDATE_ONCE]. */ - UPDATE_ALWAYS = 1, - } - enum AmbientMode { - /** Do not apply any ambient lighting inside the [ReflectionProbe]'s box defined by its [member size]. */ - AMBIENT_DISABLED = 0, - - /** Apply automatically-sourced environment lighting inside the [ReflectionProbe]'s box defined by its [member size]. */ - AMBIENT_ENVIRONMENT = 1, - - /** Apply custom ambient lighting inside the [ReflectionProbe]'s box defined by its [member size]. See [member ambient_color] and [member ambient_color_energy]. */ - AMBIENT_COLOR = 2, - } - } - /** Captures its surroundings to create fast, accurate reflections from a given point. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_reflectionprobe.html - */ - class ReflectionProbe extends VisualInstance3D { - constructor(identifier?: any) - /** Sets how frequently the [ReflectionProbe] is updated. Can be [constant UPDATE_ONCE] or [constant UPDATE_ALWAYS]. */ - get update_mode(): int64 - set update_mode(value: int64) - - /** Defines the reflection intensity. Intensity modulates the strength of the reflection. */ - get intensity(): float64 - set intensity(value: float64) - - /** The maximum distance away from the [ReflectionProbe] an object can be before it is culled. Decrease this to improve performance, especially when using the [constant UPDATE_ALWAYS] [member update_mode]. - * - * **Note:** The maximum reflection distance is always at least equal to the probe's extents. This means that decreasing [member max_distance] will not always cull objects from reflections, especially if the reflection probe's box defined by its [member size] is already large. - */ - get max_distance(): float64 - set max_distance(value: float64) - - /** The size of the reflection probe. The larger the size, the more space covered by the probe, which will lower the perceived resolution. It is best to keep the size only as large as you need it. - * - * **Note:** To better fit areas that are not aligned to the grid, you can rotate the [ReflectionProbe] node. - */ - get size(): Vector3 - set size(value: Vector3) - - /** Sets the origin offset to be used when this [ReflectionProbe] is in [member box_projection] mode. This can be set to a non-zero value to ensure a reflection fits a rectangle-shaped room, while reducing the number of objects that "get in the way" of the reflection. */ - get origin_offset(): Vector3 - set origin_offset(value: Vector3) - - /** If `true`, enables box projection. This makes reflections look more correct in rectangle-shaped rooms by offsetting the reflection center depending on the camera's location. - * - * **Note:** To better fit rectangle-shaped rooms that are not aligned to the grid, you can rotate the [ReflectionProbe] node. - */ - get box_projection(): boolean - set box_projection(value: boolean) - - /** If `true`, reflections will ignore sky contribution. */ - get interior(): boolean - set interior(value: boolean) - - /** If `true`, computes shadows in the reflection probe. This makes the reflection probe slower to render; you may want to disable this if using the [constant UPDATE_ALWAYS] [member update_mode]. */ - get enable_shadows(): boolean - set enable_shadows(value: boolean) - - /** Sets the cull mask which determines what objects are drawn by this probe. Every [VisualInstance3D] with a layer included in this cull mask will be rendered by the probe. It is best to only include large objects which are likely to take up a lot of space in the reflection in order to save on rendering cost. - * This can also be used to prevent an object from reflecting upon itself (for instance, a [ReflectionProbe] centered on a vehicle). - */ - get cull_mask(): int64 - set cull_mask(value: int64) - - /** Sets the reflection mask which determines what objects have reflections applied from this probe. Every [VisualInstance3D] with a layer included in this reflection mask will have reflections applied from this probe. See also [member cull_mask], which can be used to exclude objects from appearing in the reflection while still making them affected by the [ReflectionProbe]. */ - get reflection_mask(): int64 - set reflection_mask(value: int64) - - /** The automatic LOD bias to use for meshes rendered within the [ReflectionProbe] (this is analog to [member Viewport.mesh_lod_threshold]). Higher values will use less detailed versions of meshes that have LOD variations generated. If set to `0.0`, automatic LOD is disabled. Increase [member mesh_lod_threshold] to improve performance at the cost of geometry detail, especially when using the [constant UPDATE_ALWAYS] [member update_mode]. - * - * **Note:** [member mesh_lod_threshold] does not affect [GeometryInstance3D] visibility ranges (also known as "manual" LOD or hierarchical LOD). - */ - get mesh_lod_threshold(): float64 - set mesh_lod_threshold(value: float64) - - /** The ambient color to use within the [ReflectionProbe]'s box defined by its [member size]. The ambient color will smoothly blend with other [ReflectionProbe]s and the rest of the scene (outside the [ReflectionProbe]'s box defined by its [member size]). */ - get ambient_mode(): int64 - set ambient_mode(value: int64) - - /** The custom ambient color to use within the [ReflectionProbe]'s box defined by its [member size]. Only effective if [member ambient_mode] is [constant AMBIENT_COLOR]. */ - get ambient_color(): Color - set ambient_color(value: Color) - - /** The custom ambient color energy to use within the [ReflectionProbe]'s box defined by its [member size]. Only effective if [member ambient_mode] is [constant AMBIENT_COLOR]. */ - get ambient_color_energy(): float64 - set ambient_color_energy(value: float64) - } - class ReflectionProbeGizmoPlugin extends EditorNode3DGizmoPlugin { - constructor(identifier?: any) - } - /** Class for searching text for patterns using regular expressions. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_regex.html - */ - class RegEx extends RefCounted { - constructor(identifier?: any) - /** Creates and compiles a new [RegEx] object. */ - static create_from_string(pattern: string): RegEx - - /** This method resets the state of the object, as if it was freshly created. Namely, it unassigns the regular expression of this object. */ - clear(): void - - /** Compiles and assign the search pattern to use. Returns [constant OK] if the compilation is successful. If an error is encountered, details are printed to standard output and an error is returned. */ - compile(pattern: string): GError - - /** Searches the text for the compiled pattern. Returns a [RegExMatch] container of the first matching result if found, otherwise `null`. - * The region to search within can be specified with [param offset] and [param end]. This is useful when searching for another match in the same [param subject] by calling this method again after a previous success. Note that setting these parameters differs from passing over a shortened string. For example, the start anchor `^` is not affected by [param offset], and the character before [param offset] will be checked for the word boundary `\b`. - */ - search(subject: string, offset: int64 = 0, end: int64 = -1): RegExMatch - - /** Searches the text for the compiled pattern. Returns an array of [RegExMatch] containers for each non-overlapping result. If no results were found, an empty array is returned instead. - * The region to search within can be specified with [param offset] and [param end]. This is useful when searching for another match in the same [param subject] by calling this method again after a previous success. Note that setting these parameters differs from passing over a shortened string. For example, the start anchor `^` is not affected by [param offset], and the character before [param offset] will be checked for the word boundary `\b`. - */ - search_all(subject: string, offset: int64 = 0, end: int64 = -1): GArray - - /** Searches the text for the compiled pattern and replaces it with the specified string. Escapes and backreferences such as `$1` and `$name` are expanded and resolved. By default, only the first instance is replaced, but it can be changed for all instances (global replacement). - * The region to search within can be specified with [param offset] and [param end]. This is useful when searching for another match in the same [param subject] by calling this method again after a previous success. Note that setting these parameters differs from passing over a shortened string. For example, the start anchor `^` is not affected by [param offset], and the character before [param offset] will be checked for the word boundary `\b`. - */ - sub(subject: string, replacement: string, all: boolean = false, offset: int64 = 0, end: int64 = -1): string - - /** Returns whether this object has a valid search pattern assigned. */ - is_valid(): boolean - - /** Returns the original search pattern that was compiled. */ - get_pattern(): string - - /** Returns the number of capturing groups in compiled pattern. */ - get_group_count(): int64 - - /** Returns an array of names of named capturing groups in the compiled pattern. They are ordered by appearance. */ - get_names(): PackedStringArray - } - /** Contains the results of a [RegEx] search. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_regexmatch.html - */ - class RegExMatch extends RefCounted { - constructor(identifier?: any) - /** Returns the number of capturing groups. */ - get_group_count(): int64 - - /** Returns the substring of the match from the source string. Capturing groups can be retrieved by providing its group number as an integer or its string name (if it's a named group). The default value of 0 refers to the whole pattern. - * Returns an empty string if the group did not match or doesn't exist. - */ - get_string(name: any = {}): string - - /** Returns the starting position of the match within the source string. The starting position of capturing groups can be retrieved by providing its group number as an integer or its string name (if it's a named group). The default value of 0 refers to the whole pattern. - * Returns -1 if the group did not match or doesn't exist. - */ - get_start(name: any = {}): int64 - - /** Returns the end position of the match within the source string. The end position of capturing groups can be retrieved by providing its group number as an integer or its string name (if it's a named group). The default value of 0 refers to the whole pattern. - * Returns -1 if the group did not match or doesn't exist. - */ - get_end(name: any = {}): int64 - - /** The source string used with the search pattern to find this matching result. */ - get subject(): string - - /** A dictionary of named groups and its corresponding group number. Only groups that were matched are included. If multiple groups have the same name, that name would refer to the first matching one. */ - get names(): GDictionary - - /** An [Array] of the match and its capturing groups. */ - get strings(): GArray - } - /** RemoteTransform2D pushes its own [Transform2D] to another [Node2D] derived node in the scene. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_remotetransform2d.html - */ - class RemoteTransform2D extends Node2D { - constructor(identifier?: any) - /** [RemoteTransform2D] caches the remote node. It may not notice if the remote node disappears; [method force_update_cache] forces it to update the cache again. */ - force_update_cache(): void - - /** The [NodePath] to the remote node, relative to the RemoteTransform2D's position in the scene. */ - get remote_path(): NodePath - set remote_path(value: NodePath | string) - - /** If `true`, global coordinates are used. If `false`, local coordinates are used. */ - get use_global_coordinates(): boolean - set use_global_coordinates(value: boolean) - - /** If `true`, the remote node's position is updated. */ - get update_position(): boolean - set update_position(value: boolean) - - /** If `true`, the remote node's rotation is updated. */ - get update_rotation(): boolean - set update_rotation(value: boolean) - - /** If `true`, the remote node's scale is updated. */ - get update_scale(): boolean - set update_scale(value: boolean) - } - /** RemoteTransform3D pushes its own [Transform3D] to another [Node3D] derived Node in the scene. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_remotetransform3d.html - */ - class RemoteTransform3D extends Node3D { - constructor(identifier?: any) - /** [RemoteTransform3D] caches the remote node. It may not notice if the remote node disappears; [method force_update_cache] forces it to update the cache again. */ - force_update_cache(): void - - /** The [NodePath] to the remote node, relative to the RemoteTransform3D's position in the scene. */ - get remote_path(): NodePath - set remote_path(value: NodePath | string) - - /** If `true`, global coordinates are used. If `false`, local coordinates are used. */ - get use_global_coordinates(): boolean - set use_global_coordinates(value: boolean) - - /** If `true`, the remote node's position is updated. */ - get update_position(): boolean - set update_position(value: boolean) - - /** If `true`, the remote node's rotation is updated. */ - get update_rotation(): boolean - set update_rotation(value: boolean) - - /** If `true`, the remote node's scale is updated. */ - get update_scale(): boolean - set update_scale(value: boolean) - } - class RenameDialog extends ConfirmationDialog { - constructor(identifier?: any) - rename(): void - } - class RenderBufferCustomDataRD extends RefCounted { - constructor(identifier?: any) - } - class RenderBufferDataForwardClustered extends RenderBufferCustomDataRD { - constructor(identifier?: any) - } - class RenderBuffersGI extends RenderBufferCustomDataRD { - constructor(identifier?: any) - } - /** Abstract render data object, holds frame data related to rendering a single frame of a viewport. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_renderdata.html - */ - class RenderData extends Object { - constructor(identifier?: any) - /** Returns the [RenderSceneBuffers] object managing the scene buffers for rendering this viewport. */ - get_render_scene_buffers(): RenderSceneBuffers - - /** Returns the [RenderSceneData] object managing this frames scene data. */ - get_render_scene_data(): RenderSceneData - - /** Returns the [RID] of the environments object in the [RenderingServer] being used to render this viewport. */ - get_environment(): RID - - /** Returns the [RID] of the camera attributes object in the [RenderingServer] being used to render this viewport. */ - get_camera_attributes(): RID - } - /** This class allows for a RenderData implementation to be made in GDExtension. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_renderdataextension.html - */ - class RenderDataExtension extends RenderData { - constructor(identifier?: any) - /** Implement this in GDExtension to return the implementation's [RenderSceneBuffers] object. */ - /* gdvirtual */ _get_render_scene_buffers(): RenderSceneBuffers - - /** Implement this in GDExtension to return the implementation's [RenderSceneDataExtension] object. */ - /* gdvirtual */ _get_render_scene_data(): RenderSceneData - - /** Implement this in GDExtension to return the [RID] of the implementation's environment object. */ - /* gdvirtual */ _get_environment(): RID - - /** Implement this in GDExtension to return the [RID] for the implementation's camera attributes object. */ - /* gdvirtual */ _get_camera_attributes(): RID - } - /** Render data implementation for the RenderingDevice based renderers. - * - * **Note:** This is an internal rendering server object, do not instantiate this from script. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_renderdatard.html - */ - class RenderDataRD extends RenderData { - constructor(identifier?: any) - } - /** Abstract scene buffers object, created for each viewport for which 3D rendering is done. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_renderscenebuffers.html - */ - class RenderSceneBuffers extends RefCounted { - constructor(identifier?: any) - /** This method is called by the rendering server when the associated viewports configuration is changed. It will discard the old buffers and recreate the internal buffers used. */ - configure(config: RenderSceneBuffersConfiguration): void - } - /** Configuration object used to setup a [RenderSceneBuffers] object. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_renderscenebuffersconfiguration.html - */ - class RenderSceneBuffersConfiguration extends RefCounted { - constructor(identifier?: any) - /** The render target associated with these buffer. */ - get render_target(): RID - set render_target(value: RID) - - /** The size of the 3D render buffer used for rendering. */ - get internal_size(): Vector2i - set internal_size(value: Vector2i) - - /** The target (upscale) size if scaling is used. */ - get target_size(): Vector2i - set target_size(value: Vector2i) - - /** The number of views we're rendering. */ - get view_count(): int64 - set view_count(value: int64) - - /** The requested scaling mode with which we upscale/downscale if [member internal_size] and [member target_size] are not equal. */ - get scaling_3d_mode(): int64 - set scaling_3d_mode(value: int64) - - /** The MSAA mode we're using for 3D rendering. */ - get msaa_3d(): int64 - set msaa_3d(value: int64) - - /** The requested screen space AA applied in post processing. */ - get screen_space_aa(): int64 - set screen_space_aa(value: int64) - - /** FSR Sharpness applicable if FSR upscaling is used. */ - get fsr_sharpness(): boolean - set fsr_sharpness(value: boolean) - - /** Bias applied to mipmaps. */ - get texture_mipmap_bias(): boolean - set texture_mipmap_bias(value: boolean) - } - /** This class allows for a RenderSceneBuffer implementation to be made in GDExtension. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_renderscenebuffersextension.html - */ - class RenderSceneBuffersExtension extends RenderSceneBuffers { - constructor(identifier?: any) - /** Implement this in GDExtension to handle the (re)sizing of a viewport. */ - /* gdvirtual */ _configure(config: RenderSceneBuffersConfiguration): void - - /** Implement this in GDExtension to record a new FSR sharpness value. */ - /* gdvirtual */ _set_fsr_sharpness(fsr_sharpness: float64): void - - /** Implement this in GDExtension to change the texture mipmap bias. */ - /* gdvirtual */ _set_texture_mipmap_bias(texture_mipmap_bias: float64): void - - /** Implement this in GDExtension to react to the debanding flag changing. */ - /* gdvirtual */ _set_use_debanding(use_debanding: boolean): void - } - /** Render scene buffer implementation for the RenderingDevice based renderers. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_renderscenebuffersrd.html - */ - class RenderSceneBuffersRD extends RenderSceneBuffers { - constructor(identifier?: any) - /** Returns `true` if a cached texture exists for this name. */ - has_texture(context: StringName, name: StringName): boolean - - /** Create a new texture with the given definition and cache this under the given name. Will return the existing texture if it already exists. */ - create_texture(context: StringName, name: StringName, data_format: RenderingDevice.DataFormat, usage_bits: int64, texture_samples: RenderingDevice.TextureSamples, size: Vector2i, layers: int64, mipmaps: int64, unique: boolean): RID - - /** Create a new texture using the given format and view and cache this under the given name. Will return the existing texture if it already exists. */ - create_texture_from_format(context: StringName, name: StringName, format: RDTextureFormat, view: RDTextureView, unique: boolean): RID - - /** Create a new texture view for an existing texture and cache this under the given view_name. Will return the existing teture view if it already exists. Will error if the source texture doesn't exist. */ - create_texture_view(context: StringName, name: StringName, view_name: StringName, view: RDTextureView): RID - - /** Returns a cached texture with this name. */ - get_texture(context: StringName, name: StringName): RID - - /** Returns the texture format information with which a cached texture was created. */ - get_texture_format(context: StringName, name: StringName): RDTextureFormat - - /** Returns a specific slice (layer or mipmap) for a cached texture. */ - get_texture_slice(context: StringName, name: StringName, layer: int64, mipmap: int64, layers: int64, mipmaps: int64): RID - - /** Returns a specific view of a slice (layer or mipmap) for a cached texture. */ - get_texture_slice_view(context: StringName, name: StringName, layer: int64, mipmap: int64, layers: int64, mipmaps: int64, view: RDTextureView): RID - - /** Returns the texture size of a given slice of a cached texture. */ - get_texture_slice_size(context: StringName, name: StringName, mipmap: int64): Vector2i - - /** Frees all buffers related to this context. */ - clear_context(context: StringName): void - - /** Returns the color texture we are rendering 3D content to. If multiview is used this will be a texture array with all views. - * If [param msaa] is **true** and MSAA is enabled, this returns the MSAA variant of the buffer. - */ - get_color_texture(msaa: boolean = false): RID - - /** Returns the specified layer from the color texture we are rendering 3D content to. - * If [param msaa] is **true** and MSAA is enabled, this returns the MSAA variant of the buffer. - */ - get_color_layer(layer: int64, msaa: boolean = false): RID - - /** Returns the depth texture we are rendering 3D content to. If multiview is used this will be a texture array with all views. - * If [param msaa] is **true** and MSAA is enabled, this returns the MSAA variant of the buffer. - */ - get_depth_texture(msaa: boolean = false): RID - - /** Returns the specified layer from the depth texture we are rendering 3D content to. - * If [param msaa] is **true** and MSAA is enabled, this returns the MSAA variant of the buffer. - */ - get_depth_layer(layer: int64, msaa: boolean = false): RID - - /** Returns the velocity texture we are rendering 3D content to. If multiview is used this will be a texture array with all views. - * If [param msaa] is **true** and MSAA is enabled, this returns the MSAA variant of the buffer. - */ - get_velocity_texture(msaa: boolean = false): RID - - /** Returns the specified layer from the velocity texture we are rendering 3D content to. */ - get_velocity_layer(layer: int64, msaa: boolean = false): RID - - /** Returns the render target associated with this buffers object. */ - get_render_target(): RID - - /** Returns the view count for the associated viewport. */ - get_view_count(): int64 - - /** Returns the internal size of the render buffer (size before upscaling) with which textures are created by default. */ - get_internal_size(): Vector2i - - /** Returns the target size of the render buffer (size after upscaling). */ - get_target_size(): Vector2i - - /** Returns the scaling mode used for upscaling. */ - get_scaling_3d_mode(): RenderingServer.ViewportScaling3DMode - - /** Returns the FSR sharpness value used while rendering the 3D content (if [method get_scaling_3d_mode] is an FSR mode). */ - get_fsr_sharpness(): float64 - - /** Returns the applied 3D MSAA mode for this viewport. */ - get_msaa_3d(): RenderingServer.ViewportMSAA - - /** Returns the number of MSAA samples used. */ - get_texture_samples(): RenderingDevice.TextureSamples - - /** Returns the screen-space antialiasing method applied. */ - get_screen_space_aa(): RenderingServer.ViewportScreenSpaceAA - - /** Returns `true` if TAA is enabled. */ - get_use_taa(): boolean - - /** Returns `true` if debanding is enabled. */ - get_use_debanding(): boolean - } - /** Abstract render data object, holds scene data related to rendering a single frame of a viewport. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_renderscenedata.html - */ - class RenderSceneData extends Object { - constructor(identifier?: any) - /** Returns the camera transform used to render this frame. - * - * **Note:** If more than one view is rendered, this will return a centered transform. - */ - get_cam_transform(): Transform3D - - /** Returns the camera projection used to render this frame. - * - * **Note:** If more than one view is rendered, this will return a combined projection. - */ - get_cam_projection(): Projection - - /** Returns the number of views being rendered. */ - get_view_count(): int64 - - /** Returns the eye offset per view used to render this frame. This is the offset between our camera transform and the eye transform. */ - get_view_eye_offset(view: int64): Vector3 - - /** Returns the view projection per view used to render this frame. - * - * **Note:** If a single view is rendered, this returns the camera projection. If more than one view is rendered, this will return a projection for the given view including the eye offset. - */ - get_view_projection(view: int64): Projection - - /** Return the [RID] of the uniform buffer containing the scene data as a UBO. */ - get_uniform_buffer(): RID - } - /** This class allows for a RenderSceneData implementation to be made in GDExtension. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_renderscenedataextension.html - */ - class RenderSceneDataExtension extends RenderSceneData { - constructor(identifier?: any) - /** Implement this in GDExtension to return the camera [Transform3D]. */ - /* gdvirtual */ _get_cam_transform(): Transform3D - - /** Implement this in GDExtension to return the camera [Projection]. */ - /* gdvirtual */ _get_cam_projection(): Projection - - /** Implement this in GDExtension to return the view count. */ - /* gdvirtual */ _get_view_count(): int64 - - /** Implement this in GDExtension to return the eye offset for the given [param view]. */ - /* gdvirtual */ _get_view_eye_offset(view: int64): Vector3 - - /** Implement this in GDExtension to return the view [Projection] for the given [param view]. */ - /* gdvirtual */ _get_view_projection(view: int64): Projection - - /** Implement this in GDExtension to return the [RID] of the uniform buffer containing the scene data as a UBO. */ - /* gdvirtual */ _get_uniform_buffer(): RID - } - /** Render scene data implementation for the RenderingDevice based renderers. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_renderscenedatard.html - */ - class RenderSceneDataRD extends RenderSceneData { - constructor(identifier?: any) - } - namespace RenderingDevice { - enum DeviceType { - /** Rendering device type does not match any of the other enum values or is unknown. */ - DEVICE_TYPE_OTHER = 0, - - /** Rendering device is an integrated GPU, which is typically *(but not always)* slower than dedicated GPUs ([constant DEVICE_TYPE_DISCRETE_GPU]). On Android and iOS, the rendering device type is always considered to be [constant DEVICE_TYPE_INTEGRATED_GPU]. */ - DEVICE_TYPE_INTEGRATED_GPU = 1, - - /** Rendering device is a dedicated GPU, which is typically *(but not always)* faster than integrated GPUs ([constant DEVICE_TYPE_INTEGRATED_GPU]). */ - DEVICE_TYPE_DISCRETE_GPU = 2, - - /** Rendering device is an emulated GPU in a virtual environment. This is typically much slower than the host GPU, which means the expected performance level on a dedicated GPU will be roughly equivalent to [constant DEVICE_TYPE_INTEGRATED_GPU]. Virtual machine GPU passthrough (such as VFIO) will not report the device type as [constant DEVICE_TYPE_VIRTUAL_GPU]. Instead, the host GPU's device type will be reported as if the GPU was not emulated. */ - DEVICE_TYPE_VIRTUAL_GPU = 3, - - /** Rendering device is provided by software emulation (such as Lavapipe or [url=https://github.com/google/swiftshader]SwiftShader[/url]). This is the slowest kind of rendering device available; it's typically much slower than [constant DEVICE_TYPE_INTEGRATED_GPU]. */ - DEVICE_TYPE_CPU = 4, - - /** Represents the size of the [enum DeviceType] enum. */ - DEVICE_TYPE_MAX = 5, - } - enum DriverResource { - /** Specific device object based on a physical device. - * - Vulkan: Vulkan device driver resource (`VkDevice`). (`rid` argument doesn't apply.) - */ - DRIVER_RESOURCE_LOGICAL_DEVICE = 0, - - /** Physical device the specific logical device is based on. - * - Vulkan: `VkDevice`. (`rid` argument doesn't apply.) - */ - DRIVER_RESOURCE_PHYSICAL_DEVICE = 1, - - /** Top-most graphics API entry object. - * - Vulkan: `VkInstance`. (`rid` argument doesn't apply.) - */ - DRIVER_RESOURCE_TOPMOST_OBJECT = 2, - - /** The main graphics-compute command queue. - * - Vulkan: `VkQueue`. (`rid` argument doesn't apply.) - */ - DRIVER_RESOURCE_COMMAND_QUEUE = 3, - - /** The specific family the main queue belongs to. - * - Vulkan: the queue family index, an `uint32_t`. (`rid` argument doesn't apply.) - */ - DRIVER_RESOURCE_QUEUE_FAMILY = 4, - - /** - Vulkan: `VkImage`. */ - DRIVER_RESOURCE_TEXTURE = 5, - - /** The view of an owned or shared texture. - * - Vulkan: `VkImageView`. - */ - DRIVER_RESOURCE_TEXTURE_VIEW = 6, - - /** The native id of the data format of the texture. - * - Vulkan: `VkFormat`. - */ - DRIVER_RESOURCE_TEXTURE_DATA_FORMAT = 7, - - /** - Vulkan: `VkSampler`. */ - DRIVER_RESOURCE_SAMPLER = 8, - - /** - Vulkan: `VkDescriptorSet`. */ - DRIVER_RESOURCE_UNIFORM_SET = 9, - - /** Buffer of any kind of (storage, vertex, etc.). - * - Vulkan: `VkBuffer`. - */ - DRIVER_RESOURCE_BUFFER = 10, - - /** - Vulkan: `VkPipeline`. */ - DRIVER_RESOURCE_COMPUTE_PIPELINE = 11, - - /** - Vulkan: `VkPipeline`. */ - DRIVER_RESOURCE_RENDER_PIPELINE = 12, - DRIVER_RESOURCE_VULKAN_DEVICE = 0, - DRIVER_RESOURCE_VULKAN_PHYSICAL_DEVICE = 1, - DRIVER_RESOURCE_VULKAN_INSTANCE = 2, - DRIVER_RESOURCE_VULKAN_QUEUE = 3, - DRIVER_RESOURCE_VULKAN_QUEUE_FAMILY_INDEX = 4, - DRIVER_RESOURCE_VULKAN_IMAGE = 5, - DRIVER_RESOURCE_VULKAN_IMAGE_VIEW = 6, - DRIVER_RESOURCE_VULKAN_IMAGE_NATIVE_TEXTURE_FORMAT = 7, - DRIVER_RESOURCE_VULKAN_SAMPLER = 8, - DRIVER_RESOURCE_VULKAN_DESCRIPTOR_SET = 9, - DRIVER_RESOURCE_VULKAN_BUFFER = 10, - DRIVER_RESOURCE_VULKAN_COMPUTE_PIPELINE = 11, - DRIVER_RESOURCE_VULKAN_RENDER_PIPELINE = 12, - } - enum DataFormat { - /** 4-bit-per-channel red/green channel data format, packed into 8 bits. Values are in the `[0.0, 1.0]` range. - * - * **Note:** More information on all data formats can be found on the [url=https://registry.khronos.org/vulkan/specs/1.1/html/vkspec.html#_identification_of_formats]Identification of formats[/url] section of the Vulkan specification, as well as the [url=https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VkFormat.html]VkFormat[/url] enum. - */ - DATA_FORMAT_R4G4_UNORM_PACK8 = 0, - - /** 4-bit-per-channel red/green/blue/alpha channel data format, packed into 16 bits. Values are in the `[0.0, 1.0]` range. */ - DATA_FORMAT_R4G4B4A4_UNORM_PACK16 = 1, - - /** 4-bit-per-channel blue/green/red/alpha channel data format, packed into 16 bits. Values are in the `[0.0, 1.0]` range. */ - DATA_FORMAT_B4G4R4A4_UNORM_PACK16 = 2, - - /** Red/green/blue channel data format with 5 bits of red, 6 bits of green and 5 bits of blue, packed into 16 bits. Values are in the `[0.0, 1.0]` range. */ - DATA_FORMAT_R5G6B5_UNORM_PACK16 = 3, - - /** Blue/green/red channel data format with 5 bits of blue, 6 bits of green and 5 bits of red, packed into 16 bits. Values are in the `[0.0, 1.0]` range. */ - DATA_FORMAT_B5G6R5_UNORM_PACK16 = 4, - - /** Red/green/blue/alpha channel data format with 5 bits of red, 6 bits of green, 5 bits of blue and 1 bit of alpha, packed into 16 bits. Values are in the `[0.0, 1.0]` range. */ - DATA_FORMAT_R5G5B5A1_UNORM_PACK16 = 5, - - /** Blue/green/red/alpha channel data format with 5 bits of blue, 6 bits of green, 5 bits of red and 1 bit of alpha, packed into 16 bits. Values are in the `[0.0, 1.0]` range. */ - DATA_FORMAT_B5G5R5A1_UNORM_PACK16 = 6, - - /** Alpha/red/green/blue channel data format with 1 bit of alpha, 5 bits of red, 6 bits of green and 5 bits of blue, packed into 16 bits. Values are in the `[0.0, 1.0]` range. */ - DATA_FORMAT_A1R5G5B5_UNORM_PACK16 = 7, - - /** 8-bit-per-channel unsigned floating-point red channel data format with normalized value. Values are in the `[0.0, 1.0]` range. */ - DATA_FORMAT_R8_UNORM = 8, - - /** 8-bit-per-channel signed floating-point red channel data format with normalized value. Values are in the `[-1.0, 1.0]` range. */ - DATA_FORMAT_R8_SNORM = 9, - - /** 8-bit-per-channel unsigned floating-point red channel data format with scaled value (value is converted from integer to float). Values are in the `[0.0, 255.0]` range. */ - DATA_FORMAT_R8_USCALED = 10, - - /** 8-bit-per-channel signed floating-point red channel data format with scaled value (value is converted from integer to float). Values are in the `[-127.0, 127.0]` range. */ - DATA_FORMAT_R8_SSCALED = 11, - - /** 8-bit-per-channel unsigned integer red channel data format. Values are in the `[0, 255]` range. */ - DATA_FORMAT_R8_UINT = 12, - - /** 8-bit-per-channel signed integer red channel data format. Values are in the `[-127, 127]` range. */ - DATA_FORMAT_R8_SINT = 13, - - /** 8-bit-per-channel unsigned floating-point red channel data format with normalized value and non-linear sRGB encoding. Values are in the `[0.0, 1.0]` range. */ - DATA_FORMAT_R8_SRGB = 14, - - /** 8-bit-per-channel unsigned floating-point red/green channel data format with normalized value. Values are in the `[0.0, 1.0]` range. */ - DATA_FORMAT_R8G8_UNORM = 15, - - /** 8-bit-per-channel signed floating-point red/green channel data format with normalized value. Values are in the `[-1.0, 1.0]` range. */ - DATA_FORMAT_R8G8_SNORM = 16, - - /** 8-bit-per-channel unsigned floating-point red/green channel data format with scaled value (value is converted from integer to float). Values are in the `[0.0, 255.0]` range. */ - DATA_FORMAT_R8G8_USCALED = 17, - - /** 8-bit-per-channel signed floating-point red/green channel data format with scaled value (value is converted from integer to float). Values are in the `[-127.0, 127.0]` range. */ - DATA_FORMAT_R8G8_SSCALED = 18, - - /** 8-bit-per-channel unsigned integer red/green channel data format. Values are in the `[0, 255]` range. */ - DATA_FORMAT_R8G8_UINT = 19, - - /** 8-bit-per-channel signed integer red/green channel data format. Values are in the `[-127, 127]` range. */ - DATA_FORMAT_R8G8_SINT = 20, - - /** 8-bit-per-channel unsigned floating-point red/green channel data format with normalized value and non-linear sRGB encoding. Values are in the `[0.0, 1.0]` range. */ - DATA_FORMAT_R8G8_SRGB = 21, - - /** 8-bit-per-channel unsigned floating-point red/green/blue channel data format with normalized value. Values are in the `[0.0, 1.0]` range. */ - DATA_FORMAT_R8G8B8_UNORM = 22, - - /** 8-bit-per-channel signed floating-point red/green/blue channel data format with normalized value. Values are in the `[-1.0, 1.0]` range. */ - DATA_FORMAT_R8G8B8_SNORM = 23, - - /** 8-bit-per-channel unsigned floating-point red/green/blue channel data format with scaled value (value is converted from integer to float). Values are in the `[0.0, 255.0]` range. */ - DATA_FORMAT_R8G8B8_USCALED = 24, - - /** 8-bit-per-channel signed floating-point red/green/blue channel data format with scaled value (value is converted from integer to float). Values are in the `[-127.0, 127.0]` range. */ - DATA_FORMAT_R8G8B8_SSCALED = 25, - - /** 8-bit-per-channel unsigned integer red/green/blue channel data format. Values are in the `[0, 255]` range. */ - DATA_FORMAT_R8G8B8_UINT = 26, - - /** 8-bit-per-channel signed integer red/green/blue channel data format. Values are in the `[-127, 127]` range. */ - DATA_FORMAT_R8G8B8_SINT = 27, - - /** 8-bit-per-channel unsigned floating-point red/green/blue/blue channel data format with normalized value and non-linear sRGB encoding. Values are in the `[0.0, 1.0]` range. */ - DATA_FORMAT_R8G8B8_SRGB = 28, - - /** 8-bit-per-channel unsigned floating-point blue/green/red channel data format with normalized value. Values are in the `[0.0, 1.0]` range. */ - DATA_FORMAT_B8G8R8_UNORM = 29, - - /** 8-bit-per-channel signed floating-point blue/green/red channel data format with normalized value. Values are in the `[-1.0, 1.0]` range. */ - DATA_FORMAT_B8G8R8_SNORM = 30, - - /** 8-bit-per-channel unsigned floating-point blue/green/red channel data format with scaled value (value is converted from integer to float). Values are in the `[0.0, 255.0]` range. */ - DATA_FORMAT_B8G8R8_USCALED = 31, - - /** 8-bit-per-channel signed floating-point blue/green/red channel data format with scaled value (value is converted from integer to float). Values are in the `[-127.0, 127.0]` range. */ - DATA_FORMAT_B8G8R8_SSCALED = 32, - - /** 8-bit-per-channel unsigned integer blue/green/red channel data format. Values are in the `[0, 255]` range. */ - DATA_FORMAT_B8G8R8_UINT = 33, - - /** 8-bit-per-channel signed integer blue/green/red channel data format. Values are in the `[-127, 127]` range. */ - DATA_FORMAT_B8G8R8_SINT = 34, - - /** 8-bit-per-channel unsigned floating-point blue/green/red data format with normalized value and non-linear sRGB encoding. Values are in the `[0.0, 1.0]` range. */ - DATA_FORMAT_B8G8R8_SRGB = 35, - - /** 8-bit-per-channel unsigned floating-point red/green/blue/alpha channel data format with normalized value. Values are in the `[0.0, 1.0]` range. */ - DATA_FORMAT_R8G8B8A8_UNORM = 36, - - /** 8-bit-per-channel signed floating-point red/green/blue/alpha channel data format with normalized value. Values are in the `[-1.0, 1.0]` range. */ - DATA_FORMAT_R8G8B8A8_SNORM = 37, - - /** 8-bit-per-channel unsigned floating-point red/green/blue/alpha channel data format with scaled value (value is converted from integer to float). Values are in the `[0.0, 255.0]` range. */ - DATA_FORMAT_R8G8B8A8_USCALED = 38, - - /** 8-bit-per-channel signed floating-point red/green/blue/alpha channel data format with scaled value (value is converted from integer to float). Values are in the `[-127.0, 127.0]` range. */ - DATA_FORMAT_R8G8B8A8_SSCALED = 39, - - /** 8-bit-per-channel unsigned integer red/green/blue/alpha channel data format. Values are in the `[0, 255]` range. */ - DATA_FORMAT_R8G8B8A8_UINT = 40, - - /** 8-bit-per-channel signed integer red/green/blue/alpha channel data format. Values are in the `[-127, 127]` range. */ - DATA_FORMAT_R8G8B8A8_SINT = 41, - - /** 8-bit-per-channel unsigned floating-point red/green/blue/alpha channel data format with normalized value and non-linear sRGB encoding. Values are in the `[0.0, 1.0]` range. */ - DATA_FORMAT_R8G8B8A8_SRGB = 42, - - /** 8-bit-per-channel unsigned floating-point blue/green/red/alpha channel data format with normalized value. Values are in the `[0.0, 1.0]` range. */ - DATA_FORMAT_B8G8R8A8_UNORM = 43, - - /** 8-bit-per-channel signed floating-point blue/green/red/alpha channel data format with normalized value. Values are in the `[-1.0, 1.0]` range. */ - DATA_FORMAT_B8G8R8A8_SNORM = 44, - - /** 8-bit-per-channel unsigned floating-point blue/green/red/alpha channel data format with scaled value (value is converted from integer to float). Values are in the `[0.0, 255.0]` range. */ - DATA_FORMAT_B8G8R8A8_USCALED = 45, - - /** 8-bit-per-channel signed floating-point blue/green/red/alpha channel data format with scaled value (value is converted from integer to float). Values are in the `[-127.0, 127.0]` range. */ - DATA_FORMAT_B8G8R8A8_SSCALED = 46, - - /** 8-bit-per-channel unsigned integer blue/green/red/alpha channel data format. Values are in the `[0, 255]` range. */ - DATA_FORMAT_B8G8R8A8_UINT = 47, - - /** 8-bit-per-channel signed integer blue/green/red/alpha channel data format. Values are in the `[-127, 127]` range. */ - DATA_FORMAT_B8G8R8A8_SINT = 48, - - /** 8-bit-per-channel unsigned floating-point blue/green/red/alpha channel data format with normalized value and non-linear sRGB encoding. Values are in the `[0.0, 1.0]` range. */ - DATA_FORMAT_B8G8R8A8_SRGB = 49, - - /** 8-bit-per-channel unsigned floating-point alpha/red/green/blue channel data format with normalized value, packed in 32 bits. Values are in the `[0.0, 1.0]` range. */ - DATA_FORMAT_A8B8G8R8_UNORM_PACK32 = 50, - - /** 8-bit-per-channel signed floating-point alpha/red/green/blue channel data format with normalized value, packed in 32 bits. Values are in the `[-1.0, 1.0]` range. */ - DATA_FORMAT_A8B8G8R8_SNORM_PACK32 = 51, - - /** 8-bit-per-channel unsigned floating-point alpha/red/green/blue channel data format with scaled value (value is converted from integer to float), packed in 32 bits. Values are in the `[0.0, 255.0]` range. */ - DATA_FORMAT_A8B8G8R8_USCALED_PACK32 = 52, - - /** 8-bit-per-channel signed floating-point alpha/red/green/blue channel data format with scaled value (value is converted from integer to float), packed in 32 bits. Values are in the `[-127.0, 127.0]` range. */ - DATA_FORMAT_A8B8G8R8_SSCALED_PACK32 = 53, - - /** 8-bit-per-channel unsigned integer alpha/red/green/blue channel data format, packed in 32 bits. Values are in the `[0, 255]` range. */ - DATA_FORMAT_A8B8G8R8_UINT_PACK32 = 54, - - /** 8-bit-per-channel signed integer alpha/red/green/blue channel data format, packed in 32 bits. Values are in the `[-127, 127]` range. */ - DATA_FORMAT_A8B8G8R8_SINT_PACK32 = 55, - - /** 8-bit-per-channel unsigned floating-point alpha/red/green/blue channel data format with normalized value and non-linear sRGB encoding, packed in 32 bits. Values are in the `[0.0, 1.0]` range. */ - DATA_FORMAT_A8B8G8R8_SRGB_PACK32 = 56, - - /** Unsigned floating-point alpha/red/green/blue channel data format with normalized value, packed in 32 bits. Format contains 2 bits of alpha, 10 bits of red, 10 bits of green and 10 bits of blue. Values are in the `[0.0, 1.0]` range. */ - DATA_FORMAT_A2R10G10B10_UNORM_PACK32 = 57, - - /** Signed floating-point alpha/red/green/blue channel data format with normalized value, packed in 32 bits. Format contains 2 bits of alpha, 10 bits of red, 10 bits of green and 10 bits of blue. Values are in the `[-1.0, 1.0]` range. */ - DATA_FORMAT_A2R10G10B10_SNORM_PACK32 = 58, - - /** Unsigned floating-point alpha/red/green/blue channel data format with normalized value, packed in 32 bits. Format contains 2 bits of alpha, 10 bits of red, 10 bits of green and 10 bits of blue. Values are in the `[0.0, 1023.0]` range for red/green/blue and `[0.0, 3.0]` for alpha. */ - DATA_FORMAT_A2R10G10B10_USCALED_PACK32 = 59, - - /** Signed floating-point alpha/red/green/blue channel data format with normalized value, packed in 32 bits. Format contains 2 bits of alpha, 10 bits of red, 10 bits of green and 10 bits of blue. Values are in the `[-511.0, 511.0]` range for red/green/blue and `[-1.0, 1.0]` for alpha. */ - DATA_FORMAT_A2R10G10B10_SSCALED_PACK32 = 60, - - /** Unsigned integer alpha/red/green/blue channel data format with normalized value, packed in 32 bits. Format contains 2 bits of alpha, 10 bits of red, 10 bits of green and 10 bits of blue. Values are in the `[0, 1023]` range for red/green/blue and `[0, 3]` for alpha. */ - DATA_FORMAT_A2R10G10B10_UINT_PACK32 = 61, - - /** Signed integer alpha/red/green/blue channel data format with normalized value, packed in 32 bits. Format contains 2 bits of alpha, 10 bits of red, 10 bits of green and 10 bits of blue. Values are in the `[-511, 511]` range for red/green/blue and `[-1, 1]` for alpha. */ - DATA_FORMAT_A2R10G10B10_SINT_PACK32 = 62, - - /** Unsigned floating-point alpha/blue/green/red channel data format with normalized value, packed in 32 bits. Format contains 2 bits of alpha, 10 bits of blue, 10 bits of green and 10 bits of red. Values are in the `[0.0, 1.0]` range. */ - DATA_FORMAT_A2B10G10R10_UNORM_PACK32 = 63, - - /** Signed floating-point alpha/blue/green/red channel data format with normalized value, packed in 32 bits. Format contains 2 bits of alpha, 10 bits of blue, 10 bits of green and 10 bits of red. Values are in the `[-1.0, 1.0]` range. */ - DATA_FORMAT_A2B10G10R10_SNORM_PACK32 = 64, - - /** Unsigned floating-point alpha/blue/green/red channel data format with normalized value, packed in 32 bits. Format contains 2 bits of alpha, 10 bits of blue, 10 bits of green and 10 bits of red. Values are in the `[0.0, 1023.0]` range for blue/green/red and `[0.0, 3.0]` for alpha. */ - DATA_FORMAT_A2B10G10R10_USCALED_PACK32 = 65, - - /** Signed floating-point alpha/blue/green/red channel data format with normalized value, packed in 32 bits. Format contains 2 bits of alpha, 10 bits of blue, 10 bits of green and 10 bits of red. Values are in the `[-511.0, 511.0]` range for blue/green/red and `[-1.0, 1.0]` for alpha. */ - DATA_FORMAT_A2B10G10R10_SSCALED_PACK32 = 66, - - /** Unsigned integer alpha/blue/green/red channel data format with normalized value, packed in 32 bits. Format contains 2 bits of alpha, 10 bits of blue, 10 bits of green and 10 bits of red. Values are in the `[0, 1023]` range for blue/green/red and `[0, 3]` for alpha. */ - DATA_FORMAT_A2B10G10R10_UINT_PACK32 = 67, - - /** Signed integer alpha/blue/green/red channel data format with normalized value, packed in 32 bits. Format contains 2 bits of alpha, 10 bits of blue, 10 bits of green and 10 bits of red. Values are in the `[-511, 511]` range for blue/green/red and `[-1, 1]` for alpha. */ - DATA_FORMAT_A2B10G10R10_SINT_PACK32 = 68, - - /** 16-bit-per-channel unsigned floating-point red channel data format with normalized value. Values are in the `[0.0, 1.0]` range. */ - DATA_FORMAT_R16_UNORM = 69, - - /** 16-bit-per-channel signed floating-point red channel data format with normalized value. Values are in the `[-1.0, 1.0]` range. */ - DATA_FORMAT_R16_SNORM = 70, - - /** 16-bit-per-channel unsigned floating-point red channel data format with scaled value (value is converted from integer to float). Values are in the `[0.0, 65535.0]` range. */ - DATA_FORMAT_R16_USCALED = 71, - - /** 16-bit-per-channel signed floating-point red channel data format with scaled value (value is converted from integer to float). Values are in the `[-32767.0, 32767.0]` range. */ - DATA_FORMAT_R16_SSCALED = 72, - - /** 16-bit-per-channel unsigned integer red channel data format. Values are in the `[0.0, 65535]` range. */ - DATA_FORMAT_R16_UINT = 73, - - /** 16-bit-per-channel signed integer red channel data format. Values are in the `[-32767, 32767]` range. */ - DATA_FORMAT_R16_SINT = 74, - - /** 16-bit-per-channel signed floating-point red channel data format with the value stored as-is. */ - DATA_FORMAT_R16_SFLOAT = 75, - - /** 16-bit-per-channel unsigned floating-point red/green channel data format with normalized value. Values are in the `[0.0, 1.0]` range. */ - DATA_FORMAT_R16G16_UNORM = 76, - - /** 16-bit-per-channel signed floating-point red/green channel data format with normalized value. Values are in the `[-1.0, 1.0]` range. */ - DATA_FORMAT_R16G16_SNORM = 77, - - /** 16-bit-per-channel unsigned floating-point red/green channel data format with scaled value (value is converted from integer to float). Values are in the `[0.0, 65535.0]` range. */ - DATA_FORMAT_R16G16_USCALED = 78, - - /** 16-bit-per-channel signed floating-point red/green channel data format with scaled value (value is converted from integer to float). Values are in the `[-32767.0, 32767.0]` range. */ - DATA_FORMAT_R16G16_SSCALED = 79, - - /** 16-bit-per-channel unsigned integer red/green channel data format. Values are in the `[0.0, 65535]` range. */ - DATA_FORMAT_R16G16_UINT = 80, - - /** 16-bit-per-channel signed integer red/green channel data format. Values are in the `[-32767, 32767]` range. */ - DATA_FORMAT_R16G16_SINT = 81, - - /** 16-bit-per-channel signed floating-point red/green channel data format with the value stored as-is. */ - DATA_FORMAT_R16G16_SFLOAT = 82, - - /** 16-bit-per-channel unsigned floating-point red/green/blue channel data format with normalized value. Values are in the `[0.0, 1.0]` range. */ - DATA_FORMAT_R16G16B16_UNORM = 83, - - /** 16-bit-per-channel signed floating-point red/green/blue channel data format with normalized value. Values are in the `[-1.0, 1.0]` range. */ - DATA_FORMAT_R16G16B16_SNORM = 84, - - /** 16-bit-per-channel unsigned floating-point red/green/blue channel data format with scaled value (value is converted from integer to float). Values are in the `[0.0, 65535.0]` range. */ - DATA_FORMAT_R16G16B16_USCALED = 85, - - /** 16-bit-per-channel signed floating-point red/green/blue channel data format with scaled value (value is converted from integer to float). Values are in the `[-32767.0, 32767.0]` range. */ - DATA_FORMAT_R16G16B16_SSCALED = 86, - - /** 16-bit-per-channel unsigned integer red/green/blue channel data format. Values are in the `[0.0, 65535]` range. */ - DATA_FORMAT_R16G16B16_UINT = 87, - - /** 16-bit-per-channel signed integer red/green/blue channel data format. Values are in the `[-32767, 32767]` range. */ - DATA_FORMAT_R16G16B16_SINT = 88, - - /** 16-bit-per-channel signed floating-point red/green/blue channel data format with the value stored as-is. */ - DATA_FORMAT_R16G16B16_SFLOAT = 89, - - /** 16-bit-per-channel unsigned floating-point red/green/blue/alpha channel data format with normalized value. Values are in the `[0.0, 1.0]` range. */ - DATA_FORMAT_R16G16B16A16_UNORM = 90, - - /** 16-bit-per-channel signed floating-point red/green/blue/alpha channel data format with normalized value. Values are in the `[-1.0, 1.0]` range. */ - DATA_FORMAT_R16G16B16A16_SNORM = 91, - - /** 16-bit-per-channel unsigned floating-point red/green/blue/alpha channel data format with scaled value (value is converted from integer to float). Values are in the `[0.0, 65535.0]` range. */ - DATA_FORMAT_R16G16B16A16_USCALED = 92, - - /** 16-bit-per-channel signed floating-point red/green/blue/alpha channel data format with scaled value (value is converted from integer to float). Values are in the `[-32767.0, 32767.0]` range. */ - DATA_FORMAT_R16G16B16A16_SSCALED = 93, - - /** 16-bit-per-channel unsigned integer red/green/blue/alpha channel data format. Values are in the `[0.0, 65535]` range. */ - DATA_FORMAT_R16G16B16A16_UINT = 94, - - /** 16-bit-per-channel signed integer red/green/blue/alpha channel data format. Values are in the `[-32767, 32767]` range. */ - DATA_FORMAT_R16G16B16A16_SINT = 95, - - /** 16-bit-per-channel signed floating-point red/green/blue/alpha channel data format with the value stored as-is. */ - DATA_FORMAT_R16G16B16A16_SFLOAT = 96, - - /** 32-bit-per-channel unsigned integer red channel data format. Values are in the `[0, 2^32 - 1]` range. */ - DATA_FORMAT_R32_UINT = 97, - - /** 32-bit-per-channel signed integer red channel data format. Values are in the `[2^31 + 1, 2^31 - 1]` range. */ - DATA_FORMAT_R32_SINT = 98, - - /** 32-bit-per-channel signed floating-point red channel data format with the value stored as-is. */ - DATA_FORMAT_R32_SFLOAT = 99, - - /** 32-bit-per-channel unsigned integer red/green channel data format. Values are in the `[0, 2^32 - 1]` range. */ - DATA_FORMAT_R32G32_UINT = 100, - - /** 32-bit-per-channel signed integer red/green channel data format. Values are in the `[2^31 + 1, 2^31 - 1]` range. */ - DATA_FORMAT_R32G32_SINT = 101, - - /** 32-bit-per-channel signed floating-point red/green channel data format with the value stored as-is. */ - DATA_FORMAT_R32G32_SFLOAT = 102, - - /** 32-bit-per-channel unsigned integer red/green/blue channel data format. Values are in the `[0, 2^32 - 1]` range. */ - DATA_FORMAT_R32G32B32_UINT = 103, - - /** 32-bit-per-channel signed integer red/green/blue channel data format. Values are in the `[2^31 + 1, 2^31 - 1]` range. */ - DATA_FORMAT_R32G32B32_SINT = 104, - - /** 32-bit-per-channel signed floating-point red/green/blue channel data format with the value stored as-is. */ - DATA_FORMAT_R32G32B32_SFLOAT = 105, - - /** 32-bit-per-channel unsigned integer red/green/blue/alpha channel data format. Values are in the `[0, 2^32 - 1]` range. */ - DATA_FORMAT_R32G32B32A32_UINT = 106, - - /** 32-bit-per-channel signed integer red/green/blue/alpha channel data format. Values are in the `[2^31 + 1, 2^31 - 1]` range. */ - DATA_FORMAT_R32G32B32A32_SINT = 107, - - /** 32-bit-per-channel signed floating-point red/green/blue/alpha channel data format with the value stored as-is. */ - DATA_FORMAT_R32G32B32A32_SFLOAT = 108, - - /** 64-bit-per-channel unsigned integer red channel data format. Values are in the `[0, 2^64 - 1]` range. */ - DATA_FORMAT_R64_UINT = 109, - - /** 64-bit-per-channel signed integer red channel data format. Values are in the `[2^63 + 1, 2^63 - 1]` range. */ - DATA_FORMAT_R64_SINT = 110, - - /** 64-bit-per-channel signed floating-point red channel data format with the value stored as-is. */ - DATA_FORMAT_R64_SFLOAT = 111, - - /** 64-bit-per-channel unsigned integer red/green channel data format. Values are in the `[0, 2^64 - 1]` range. */ - DATA_FORMAT_R64G64_UINT = 112, - - /** 64-bit-per-channel signed integer red/green channel data format. Values are in the `[2^63 + 1, 2^63 - 1]` range. */ - DATA_FORMAT_R64G64_SINT = 113, - - /** 64-bit-per-channel signed floating-point red/green channel data format with the value stored as-is. */ - DATA_FORMAT_R64G64_SFLOAT = 114, - - /** 64-bit-per-channel unsigned integer red/green/blue channel data format. Values are in the `[0, 2^64 - 1]` range. */ - DATA_FORMAT_R64G64B64_UINT = 115, - - /** 64-bit-per-channel signed integer red/green/blue channel data format. Values are in the `[2^63 + 1, 2^63 - 1]` range. */ - DATA_FORMAT_R64G64B64_SINT = 116, - - /** 64-bit-per-channel signed floating-point red/green/blue channel data format with the value stored as-is. */ - DATA_FORMAT_R64G64B64_SFLOAT = 117, - - /** 64-bit-per-channel unsigned integer red/green/blue/alpha channel data format. Values are in the `[0, 2^64 - 1]` range. */ - DATA_FORMAT_R64G64B64A64_UINT = 118, - - /** 64-bit-per-channel signed integer red/green/blue/alpha channel data format. Values are in the `[2^63 + 1, 2^63 - 1]` range. */ - DATA_FORMAT_R64G64B64A64_SINT = 119, - - /** 64-bit-per-channel signed floating-point red/green/blue/alpha channel data format with the value stored as-is. */ - DATA_FORMAT_R64G64B64A64_SFLOAT = 120, - - /** Unsigned floating-point blue/green/red data format with the value stored as-is, packed in 32 bits. The format's precision is 10 bits of blue channel, 11 bits of green channel and 11 bits of red channel. */ - DATA_FORMAT_B10G11R11_UFLOAT_PACK32 = 121, - - /** Unsigned floating-point exposure/blue/green/red data format with the value stored as-is, packed in 32 bits. The format's precision is 5 bits of exposure, 9 bits of blue channel, 9 bits of green channel and 9 bits of red channel. */ - DATA_FORMAT_E5B9G9R9_UFLOAT_PACK32 = 122, - - /** 16-bit unsigned floating-point depth data format with normalized value. Values are in the `[0.0, 1.0]` range. */ - DATA_FORMAT_D16_UNORM = 123, - - /** 24-bit unsigned floating-point depth data format with normalized value, plus 8 unused bits, packed in 32 bits. Values for depth are in the `[0.0, 1.0]` range. */ - DATA_FORMAT_X8_D24_UNORM_PACK32 = 124, - - /** 32-bit signed floating-point depth data format with the value stored as-is. */ - DATA_FORMAT_D32_SFLOAT = 125, - - /** 8-bit unsigned integer stencil data format. */ - DATA_FORMAT_S8_UINT = 126, - - /** 16-bit unsigned floating-point depth data format with normalized value, plus 8 bits of stencil in unsigned integer format. Values for depth are in the `[0.0, 1.0]` range. Values for stencil are in the `[0, 255]` range. */ - DATA_FORMAT_D16_UNORM_S8_UINT = 127, - - /** 24-bit unsigned floating-point depth data format with normalized value, plus 8 bits of stencil in unsigned integer format. Values for depth are in the `[0.0, 1.0]` range. Values for stencil are in the `[0, 255]` range. */ - DATA_FORMAT_D24_UNORM_S8_UINT = 128, - - /** 32-bit signed floating-point depth data format with the value stored as-is, plus 8 bits of stencil in unsigned integer format. Values for stencil are in the `[0, 255]` range. */ - DATA_FORMAT_D32_SFLOAT_S8_UINT = 129, - - /** VRAM-compressed unsigned red/green/blue channel data format with normalized value. Values are in the `[0.0, 1.0]` range. The format's precision is 5 bits of red channel, 6 bits of green channel and 5 bits of blue channel. Using BC1 texture compression (also known as S3TC DXT1). */ - DATA_FORMAT_BC1_RGB_UNORM_BLOCK = 130, - - /** VRAM-compressed unsigned red/green/blue channel data format with normalized value and non-linear sRGB encoding. Values are in the `[0.0, 1.0]` range. The format's precision is 5 bits of red channel, 6 bits of green channel and 5 bits of blue channel. Using BC1 texture compression (also known as S3TC DXT1). */ - DATA_FORMAT_BC1_RGB_SRGB_BLOCK = 131, - - /** VRAM-compressed unsigned red/green/blue/alpha channel data format with normalized value. Values are in the `[0.0, 1.0]` range. The format's precision is 5 bits of red channel, 6 bits of green channel, 5 bits of blue channel and 1 bit of alpha channel. Using BC1 texture compression (also known as S3TC DXT1). */ - DATA_FORMAT_BC1_RGBA_UNORM_BLOCK = 132, - - /** VRAM-compressed unsigned red/green/blue/alpha channel data format with normalized value and non-linear sRGB encoding. Values are in the `[0.0, 1.0]` range. The format's precision is 5 bits of red channel, 6 bits of green channel, 5 bits of blue channel and 1 bit of alpha channel. Using BC1 texture compression (also known as S3TC DXT1). */ - DATA_FORMAT_BC1_RGBA_SRGB_BLOCK = 133, - - /** VRAM-compressed unsigned red/green/blue/alpha channel data format with normalized value. Values are in the `[0.0, 1.0]` range. The format's precision is 5 bits of red channel, 6 bits of green channel, 5 bits of blue channel and 4 bits of alpha channel. Using BC2 texture compression (also known as S3TC DXT3). */ - DATA_FORMAT_BC2_UNORM_BLOCK = 134, - - /** VRAM-compressed unsigned red/green/blue/alpha channel data format with normalized value and non-linear sRGB encoding. Values are in the `[0.0, 1.0]` range. The format's precision is 5 bits of red channel, 6 bits of green channel, 5 bits of blue channel and 4 bits of alpha channel. Using BC2 texture compression (also known as S3TC DXT3). */ - DATA_FORMAT_BC2_SRGB_BLOCK = 135, - - /** VRAM-compressed unsigned red/green/blue/alpha channel data format with normalized value. Values are in the `[0.0, 1.0]` range. The format's precision is 5 bits of red channel, 6 bits of green channel, 5 bits of blue channel and 8 bits of alpha channel. Using BC3 texture compression (also known as S3TC DXT5). */ - DATA_FORMAT_BC3_UNORM_BLOCK = 136, - - /** VRAM-compressed unsigned red/green/blue/alpha channel data format with normalized value and non-linear sRGB encoding. Values are in the `[0.0, 1.0]` range. The format's precision is 5 bits of red channel, 6 bits of green channel, 5 bits of blue channel and 8 bits of alpha channel. Using BC3 texture compression (also known as S3TC DXT5). */ - DATA_FORMAT_BC3_SRGB_BLOCK = 137, - - /** VRAM-compressed unsigned red channel data format with normalized value. Values are in the `[0.0, 1.0]` range. The format's precision is 8 bits of red channel. Using BC4 texture compression. */ - DATA_FORMAT_BC4_UNORM_BLOCK = 138, - - /** VRAM-compressed signed red channel data format with normalized value. Values are in the `[-1.0, 1.0]` range. The format's precision is 8 bits of red channel. Using BC4 texture compression. */ - DATA_FORMAT_BC4_SNORM_BLOCK = 139, - - /** VRAM-compressed unsigned red/green channel data format with normalized value. Values are in the `[0.0, 1.0]` range. The format's precision is 8 bits of red channel and 8 bits of green channel. Using BC5 texture compression (also known as S3TC RGTC). */ - DATA_FORMAT_BC5_UNORM_BLOCK = 140, - - /** VRAM-compressed signed red/green channel data format with normalized value. Values are in the `[-1.0, 1.0]` range. The format's precision is 8 bits of red channel and 8 bits of green channel. Using BC5 texture compression (also known as S3TC RGTC). */ - DATA_FORMAT_BC5_SNORM_BLOCK = 141, - - /** VRAM-compressed unsigned red/green/blue channel data format with the floating-point value stored as-is. The format's precision is between 10 and 13 bits for the red/green/blue channels. Using BC6H texture compression (also known as BPTC HDR). */ - DATA_FORMAT_BC6H_UFLOAT_BLOCK = 142, - - /** VRAM-compressed signed red/green/blue channel data format with the floating-point value stored as-is. The format's precision is between 10 and 13 bits for the red/green/blue channels. Using BC6H texture compression (also known as BPTC HDR). */ - DATA_FORMAT_BC6H_SFLOAT_BLOCK = 143, - - /** VRAM-compressed unsigned red/green/blue/alpha channel data format with normalized value. Values are in the `[0.0, 1.0]` range. The format's precision is between 4 and 7 bits for the red/green/blue channels and between 0 and 8 bits for the alpha channel. Also known as BPTC LDR. */ - DATA_FORMAT_BC7_UNORM_BLOCK = 144, - - /** VRAM-compressed unsigned red/green/blue/alpha channel data format with normalized value and non-linear sRGB encoding. Values are in the `[0.0, 1.0]` range. The format's precision is between 4 and 7 bits for the red/green/blue channels and between 0 and 8 bits for the alpha channel. Also known as BPTC LDR. */ - DATA_FORMAT_BC7_SRGB_BLOCK = 145, - - /** VRAM-compressed unsigned red/green/blue channel data format with normalized value. Values are in the `[0.0, 1.0]` range. Using ETC2 texture compression. */ - DATA_FORMAT_ETC2_R8G8B8_UNORM_BLOCK = 146, - - /** VRAM-compressed unsigned red/green/blue channel data format with normalized value and non-linear sRGB encoding. Values are in the `[0.0, 1.0]` range. Using ETC2 texture compression. */ - DATA_FORMAT_ETC2_R8G8B8_SRGB_BLOCK = 147, - - /** VRAM-compressed unsigned red/green/blue/alpha channel data format with normalized value. Values are in the `[0.0, 1.0]` range. Red/green/blue use 8 bit of precision each, with alpha using 1 bit of precision. Using ETC2 texture compression. */ - DATA_FORMAT_ETC2_R8G8B8A1_UNORM_BLOCK = 148, - - /** VRAM-compressed unsigned red/green/blue/alpha channel data format with normalized value and non-linear sRGB encoding. Values are in the `[0.0, 1.0]` range. Red/green/blue use 8 bit of precision each, with alpha using 1 bit of precision. Using ETC2 texture compression. */ - DATA_FORMAT_ETC2_R8G8B8A1_SRGB_BLOCK = 149, - - /** VRAM-compressed unsigned red/green/blue/alpha channel data format with normalized value. Values are in the `[0.0, 1.0]` range. Red/green/blue use 8 bits of precision each, with alpha using 8 bits of precision. Using ETC2 texture compression. */ - DATA_FORMAT_ETC2_R8G8B8A8_UNORM_BLOCK = 150, - - /** VRAM-compressed unsigned red/green/blue/alpha channel data format with normalized value and non-linear sRGB encoding. Values are in the `[0.0, 1.0]` range. Red/green/blue use 8 bits of precision each, with alpha using 8 bits of precision. Using ETC2 texture compression. */ - DATA_FORMAT_ETC2_R8G8B8A8_SRGB_BLOCK = 151, - - /** 11-bit VRAM-compressed unsigned red channel data format with normalized value. Values are in the `[0.0, 1.0]` range. Using ETC2 texture compression. */ - DATA_FORMAT_EAC_R11_UNORM_BLOCK = 152, - - /** 11-bit VRAM-compressed signed red channel data format with normalized value. Values are in the `[-1.0, 1.0]` range. Using ETC2 texture compression. */ - DATA_FORMAT_EAC_R11_SNORM_BLOCK = 153, - - /** 11-bit VRAM-compressed unsigned red/green channel data format with normalized value. Values are in the `[0.0, 1.0]` range. Using ETC2 texture compression. */ - DATA_FORMAT_EAC_R11G11_UNORM_BLOCK = 154, - - /** 11-bit VRAM-compressed signed red/green channel data format with normalized value. Values are in the `[-1.0, 1.0]` range. Using ETC2 texture compression. */ - DATA_FORMAT_EAC_R11G11_SNORM_BLOCK = 155, - - /** VRAM-compressed unsigned floating-point data format with normalized value, packed in 4×4 blocks (highest quality). Values are in the `[0.0, 1.0]` range. Using ASTC compression. */ - DATA_FORMAT_ASTC_4x4_UNORM_BLOCK = 156, - - /** VRAM-compressed unsigned floating-point data format with normalized value and non-linear sRGB encoding, packed in 4×4 blocks (highest quality). Values are in the `[0.0, 1.0]` range. Using ASTC compression. */ - DATA_FORMAT_ASTC_4x4_SRGB_BLOCK = 157, - - /** VRAM-compressed unsigned floating-point data format with normalized value, packed in 5×4 blocks. Values are in the `[0.0, 1.0]` range. Using ASTC compression. */ - DATA_FORMAT_ASTC_5x4_UNORM_BLOCK = 158, - - /** VRAM-compressed unsigned floating-point data format with normalized value and non-linear sRGB encoding, packed in 5×4 blocks. Values are in the `[0.0, 1.0]` range. Using ASTC compression. */ - DATA_FORMAT_ASTC_5x4_SRGB_BLOCK = 159, - - /** VRAM-compressed unsigned floating-point data format with normalized value, packed in 5×5 blocks. Values are in the `[0.0, 1.0]` range. Using ASTC compression. */ - DATA_FORMAT_ASTC_5x5_UNORM_BLOCK = 160, - - /** VRAM-compressed unsigned floating-point data format with normalized value and non-linear sRGB encoding, packed in 5×5 blocks. Values are in the `[0.0, 1.0]` range. Using ASTC compression. */ - DATA_FORMAT_ASTC_5x5_SRGB_BLOCK = 161, - - /** VRAM-compressed unsigned floating-point data format with normalized value, packed in 6×5 blocks. Values are in the `[0.0, 1.0]` range. Using ASTC compression. */ - DATA_FORMAT_ASTC_6x5_UNORM_BLOCK = 162, - - /** VRAM-compressed unsigned floating-point data format with normalized value and non-linear sRGB encoding, packed in 6×5 blocks. Values are in the `[0.0, 1.0]` range. Using ASTC compression. */ - DATA_FORMAT_ASTC_6x5_SRGB_BLOCK = 163, - - /** VRAM-compressed unsigned floating-point data format with normalized value, packed in 6×6 blocks. Values are in the `[0.0, 1.0]` range. Using ASTC compression. */ - DATA_FORMAT_ASTC_6x6_UNORM_BLOCK = 164, - - /** VRAM-compressed unsigned floating-point data format with normalized value and non-linear sRGB encoding, packed in 6×6 blocks. Values are in the `[0.0, 1.0]` range. Using ASTC compression. */ - DATA_FORMAT_ASTC_6x6_SRGB_BLOCK = 165, - - /** VRAM-compressed unsigned floating-point data format with normalized value, packed in 8×5 blocks. Values are in the `[0.0, 1.0]` range. Using ASTC compression. */ - DATA_FORMAT_ASTC_8x5_UNORM_BLOCK = 166, - - /** VRAM-compressed unsigned floating-point data format with normalized value and non-linear sRGB encoding, packed in 8×5 blocks. Values are in the `[0.0, 1.0]` range. Using ASTC compression. */ - DATA_FORMAT_ASTC_8x5_SRGB_BLOCK = 167, - - /** VRAM-compressed unsigned floating-point data format with normalized value, packed in 8×6 blocks. Values are in the `[0.0, 1.0]` range. Using ASTC compression. */ - DATA_FORMAT_ASTC_8x6_UNORM_BLOCK = 168, - - /** VRAM-compressed unsigned floating-point data format with normalized value and non-linear sRGB encoding, packed in 8×6 blocks. Values are in the `[0.0, 1.0]` range. Using ASTC compression. */ - DATA_FORMAT_ASTC_8x6_SRGB_BLOCK = 169, - - /** VRAM-compressed unsigned floating-point data format with normalized value, packed in 8×8 blocks. Values are in the `[0.0, 1.0]` range. Using ASTC compression. */ - DATA_FORMAT_ASTC_8x8_UNORM_BLOCK = 170, - - /** VRAM-compressed unsigned floating-point data format with normalized value and non-linear sRGB encoding, packed in 8×8 blocks. Values are in the `[0.0, 1.0]` range. Using ASTC compression. */ - DATA_FORMAT_ASTC_8x8_SRGB_BLOCK = 171, - - /** VRAM-compressed unsigned floating-point data format with normalized value, packed in 10×5 blocks. Values are in the `[0.0, 1.0]` range. Using ASTC compression. */ - DATA_FORMAT_ASTC_10x5_UNORM_BLOCK = 172, - - /** VRAM-compressed unsigned floating-point data format with normalized value and non-linear sRGB encoding, packed in 10×5 blocks. Values are in the `[0.0, 1.0]` range. Using ASTC compression. */ - DATA_FORMAT_ASTC_10x5_SRGB_BLOCK = 173, - - /** VRAM-compressed unsigned floating-point data format with normalized value, packed in 10×6 blocks. Values are in the `[0.0, 1.0]` range. Using ASTC compression. */ - DATA_FORMAT_ASTC_10x6_UNORM_BLOCK = 174, - - /** VRAM-compressed unsigned floating-point data format with normalized value and non-linear sRGB encoding, packed in 10×6 blocks. Values are in the `[0.0, 1.0]` range. Using ASTC compression. */ - DATA_FORMAT_ASTC_10x6_SRGB_BLOCK = 175, - - /** VRAM-compressed unsigned floating-point data format with normalized value, packed in 10×8 blocks. Values are in the `[0.0, 1.0]` range. Using ASTC compression. */ - DATA_FORMAT_ASTC_10x8_UNORM_BLOCK = 176, - - /** VRAM-compressed unsigned floating-point data format with normalized value and non-linear sRGB encoding, packed in 10×8 blocks. Values are in the `[0.0, 1.0]` range. Using ASTC compression. */ - DATA_FORMAT_ASTC_10x8_SRGB_BLOCK = 177, - - /** VRAM-compressed unsigned floating-point data format with normalized value, packed in 10×10 blocks. Values are in the `[0.0, 1.0]` range. Using ASTC compression. */ - DATA_FORMAT_ASTC_10x10_UNORM_BLOCK = 178, - - /** VRAM-compressed unsigned floating-point data format with normalized value and non-linear sRGB encoding, packed in 10×10 blocks. Values are in the `[0.0, 1.0]` range. Using ASTC compression. */ - DATA_FORMAT_ASTC_10x10_SRGB_BLOCK = 179, - - /** VRAM-compressed unsigned floating-point data format with normalized value, packed in 12×10 blocks. Values are in the `[0.0, 1.0]` range. Using ASTC compression. */ - DATA_FORMAT_ASTC_12x10_UNORM_BLOCK = 180, - - /** VRAM-compressed unsigned floating-point data format with normalized value and non-linear sRGB encoding, packed in 12×10 blocks. Values are in the `[0.0, 1.0]` range. Using ASTC compression. */ - DATA_FORMAT_ASTC_12x10_SRGB_BLOCK = 181, - - /** VRAM-compressed unsigned floating-point data format with normalized value, packed in 12 blocks (lowest quality). Values are in the `[0.0, 1.0]` range. Using ASTC compression. */ - DATA_FORMAT_ASTC_12x12_UNORM_BLOCK = 182, - - /** VRAM-compressed unsigned floating-point data format with normalized value and non-linear sRGB encoding, packed in 12 blocks (lowest quality). Values are in the `[0.0, 1.0]` range. Using ASTC compression. */ - DATA_FORMAT_ASTC_12x12_SRGB_BLOCK = 183, - - /** 8-bit-per-channel unsigned floating-point green/blue/red channel data format with normalized value. Values are in the `[0.0, 1.0]` range. Blue and red channel data is stored at halved horizontal resolution (i.e. 2 horizontally adjacent pixels will share the same value for the blue/red channel). */ - DATA_FORMAT_G8B8G8R8_422_UNORM = 184, - - /** 8-bit-per-channel unsigned floating-point blue/green/red channel data format with normalized value. Values are in the `[0.0, 1.0]` range. Blue and red channel data is stored at halved horizontal resolution (i.e. 2 horizontally adjacent pixels will share the same value for the blue/red channel). */ - DATA_FORMAT_B8G8R8G8_422_UNORM = 185, - - /** 8-bit-per-channel unsigned floating-point green/blue/red channel data with normalized value, stored across 3 separate planes (green + blue + red). Values are in the `[0.0, 1.0]` range. Blue and red channel data is stored at halved horizontal and vertical resolution (i.e. 2×2 adjacent pixels will share the same value for the blue/red channel). */ - DATA_FORMAT_G8_B8_R8_3PLANE_420_UNORM = 186, - - /** 8-bit-per-channel unsigned floating-point green/blue/red channel data with normalized value, stored across 2 separate planes (green + blue/red). Values are in the `[0.0, 1.0]` range. Blue and red channel data is stored at halved horizontal and vertical resolution (i.e. 2×2 adjacent pixels will share the same value for the blue/red channel). */ - DATA_FORMAT_G8_B8R8_2PLANE_420_UNORM = 187, - - /** 8-bit-per-channel unsigned floating-point green/blue/red channel data with normalized value, stored across 2 separate planes (green + blue + red). Values are in the `[0.0, 1.0]` range. Blue and red channel data is stored at halved horizontal resolution (i.e. 2 horizontally adjacent pixels will share the same value for the blue/red channel). */ - DATA_FORMAT_G8_B8_R8_3PLANE_422_UNORM = 188, - - /** 8-bit-per-channel unsigned floating-point green/blue/red channel data with normalized value, stored across 2 separate planes (green + blue/red). Values are in the `[0.0, 1.0]` range. Blue and red channel data is stored at halved horizontal resolution (i.e. 2 horizontally adjacent pixels will share the same value for the blue/red channel). */ - DATA_FORMAT_G8_B8R8_2PLANE_422_UNORM = 189, - - /** 8-bit-per-channel unsigned floating-point green/blue/red channel data with normalized value, stored across 3 separate planes. Values are in the `[0.0, 1.0]` range. */ - DATA_FORMAT_G8_B8_R8_3PLANE_444_UNORM = 190, - - /** 10-bit-per-channel unsigned floating-point red channel data with normalized value, plus 6 unused bits, packed in 16 bits. Values are in the `[0.0, 1.0]` range. */ - DATA_FORMAT_R10X6_UNORM_PACK16 = 191, - - /** 10-bit-per-channel unsigned floating-point red/green channel data with normalized value, plus 6 unused bits after each channel, packed in 2×16 bits. Values are in the `[0.0, 1.0]` range. */ - DATA_FORMAT_R10X6G10X6_UNORM_2PACK16 = 192, - - /** 10-bit-per-channel unsigned floating-point red/green/blue/alpha channel data with normalized value, plus 6 unused bits after each channel, packed in 4×16 bits. Values are in the `[0.0, 1.0]` range. */ - DATA_FORMAT_R10X6G10X6B10X6A10X6_UNORM_4PACK16 = 193, - - /** 10-bit-per-channel unsigned floating-point green/blue/green/red channel data with normalized value, plus 6 unused bits after each channel, packed in 4×16 bits. Values are in the `[0.0, 1.0]` range. Blue and red channel data is stored at halved horizontal resolution (i.e. 2 horizontally adjacent pixels will share the same value for the blue/red channel). The green channel is listed twice, but contains different values to allow it to be represented at full resolution. */ - DATA_FORMAT_G10X6B10X6G10X6R10X6_422_UNORM_4PACK16 = 194, - - /** 10-bit-per-channel unsigned floating-point blue/green/red/green channel data with normalized value, plus 6 unused bits after each channel, packed in 4×16 bits. Values are in the `[0.0, 1.0]` range. Blue and red channel data is stored at halved horizontal resolution (i.e. 2 horizontally adjacent pixels will share the same value for the blue/red channel). The green channel is listed twice, but contains different values to allow it to be represented at full resolution. */ - DATA_FORMAT_B10X6G10X6R10X6G10X6_422_UNORM_4PACK16 = 195, - - /** 10-bit-per-channel unsigned floating-point green/blue/red channel data with normalized value, plus 6 unused bits after each channel. Packed in 3×16 bits and stored across 2 separate planes (green + blue + red). Values are in the `[0.0, 1.0]` range. Blue and red channel data is stored at halved horizontal and vertical resolution (i.e. 2×2 adjacent pixels will share the same value for the blue/red channel). */ - DATA_FORMAT_G10X6_B10X6_R10X6_3PLANE_420_UNORM_3PACK16 = 196, - - /** 10-bit-per-channel unsigned floating-point green/blue/red channel data with normalized value, plus 6 unused bits after each channel. Packed in 3×16 bits and stored across 2 separate planes (green + blue/red). Values are in the `[0.0, 1.0]` range. Blue and red channel data is stored at halved horizontal and vertical resolution (i.e. 2×2 adjacent pixels will share the same value for the blue/red channel). */ - DATA_FORMAT_G10X6_B10X6R10X6_2PLANE_420_UNORM_3PACK16 = 197, - - /** 10-bit-per-channel unsigned floating-point green/blue/red channel data with normalized value, plus 6 unused bits after each channel. Packed in 3×16 bits and stored across 3 separate planes (green + blue + red). Values are in the `[0.0, 1.0]` range. Blue and red channel data is stored at halved horizontal resolution (i.e. 2 horizontally adjacent pixels will share the same value for the blue/red channel). */ - DATA_FORMAT_G10X6_B10X6_R10X6_3PLANE_422_UNORM_3PACK16 = 198, - - /** 10-bit-per-channel unsigned floating-point green/blue/red channel data with normalized value, plus 6 unused bits after each channel. Packed in 3×16 bits and stored across 3 separate planes (green + blue/red). Values are in the `[0.0, 1.0]` range. Blue and red channel data is stored at halved horizontal resolution (i.e. 2 horizontally adjacent pixels will share the same value for the blue/red channel). */ - DATA_FORMAT_G10X6_B10X6R10X6_2PLANE_422_UNORM_3PACK16 = 199, - - /** 10-bit-per-channel unsigned floating-point green/blue/red channel data with normalized value, plus 6 unused bits after each channel. Packed in 3×16 bits and stored across 3 separate planes (green + blue + red). Values are in the `[0.0, 1.0]` range. */ - DATA_FORMAT_G10X6_B10X6_R10X6_3PLANE_444_UNORM_3PACK16 = 200, - - /** 12-bit-per-channel unsigned floating-point red channel data with normalized value, plus 6 unused bits, packed in 16 bits. Values are in the `[0.0, 1.0]` range. */ - DATA_FORMAT_R12X4_UNORM_PACK16 = 201, - - /** 12-bit-per-channel unsigned floating-point red/green channel data with normalized value, plus 6 unused bits after each channel, packed in 2×16 bits. Values are in the `[0.0, 1.0]` range. */ - DATA_FORMAT_R12X4G12X4_UNORM_2PACK16 = 202, - - /** 12-bit-per-channel unsigned floating-point red/green/blue/alpha channel data with normalized value, plus 6 unused bits after each channel, packed in 4×16 bits. Values are in the `[0.0, 1.0]` range. */ - DATA_FORMAT_R12X4G12X4B12X4A12X4_UNORM_4PACK16 = 203, - - /** 12-bit-per-channel unsigned floating-point green/blue/green/red channel data with normalized value, plus 6 unused bits after each channel, packed in 4×16 bits. Values are in the `[0.0, 1.0]` range. Blue and red channel data is stored at halved horizontal resolution (i.e. 2 horizontally adjacent pixels will share the same value for the blue/red channel). The green channel is listed twice, but contains different values to allow it to be represented at full resolution. */ - DATA_FORMAT_G12X4B12X4G12X4R12X4_422_UNORM_4PACK16 = 204, - - /** 12-bit-per-channel unsigned floating-point blue/green/red/green channel data with normalized value, plus 6 unused bits after each channel, packed in 4×16 bits. Values are in the `[0.0, 1.0]` range. Blue and red channel data is stored at halved horizontal resolution (i.e. 2 horizontally adjacent pixels will share the same value for the blue/red channel). The green channel is listed twice, but contains different values to allow it to be represented at full resolution. */ - DATA_FORMAT_B12X4G12X4R12X4G12X4_422_UNORM_4PACK16 = 205, - - /** 12-bit-per-channel unsigned floating-point green/blue/red channel data with normalized value, plus 6 unused bits after each channel. Packed in 3×16 bits and stored across 2 separate planes (green + blue + red). Values are in the `[0.0, 1.0]` range. Blue and red channel data is stored at halved horizontal and vertical resolution (i.e. 2×2 adjacent pixels will share the same value for the blue/red channel). */ - DATA_FORMAT_G12X4_B12X4_R12X4_3PLANE_420_UNORM_3PACK16 = 206, - - /** 12-bit-per-channel unsigned floating-point green/blue/red channel data with normalized value, plus 6 unused bits after each channel. Packed in 3×16 bits and stored across 2 separate planes (green + blue/red). Values are in the `[0.0, 1.0]` range. Blue and red channel data is stored at halved horizontal and vertical resolution (i.e. 2×2 adjacent pixels will share the same value for the blue/red channel). */ - DATA_FORMAT_G12X4_B12X4R12X4_2PLANE_420_UNORM_3PACK16 = 207, - - /** 12-bit-per-channel unsigned floating-point green/blue/red channel data with normalized value, plus 6 unused bits after each channel. Packed in 3×16 bits and stored across 3 separate planes (green + blue + red). Values are in the `[0.0, 1.0]` range. Blue and red channel data is stored at halved horizontal resolution (i.e. 2 horizontally adjacent pixels will share the same value for the blue/red channel). */ - DATA_FORMAT_G12X4_B12X4_R12X4_3PLANE_422_UNORM_3PACK16 = 208, - - /** 12-bit-per-channel unsigned floating-point green/blue/red channel data with normalized value, plus 6 unused bits after each channel. Packed in 3×16 bits and stored across 3 separate planes (green + blue/red). Values are in the `[0.0, 1.0]` range. Blue and red channel data is stored at halved horizontal resolution (i.e. 2 horizontally adjacent pixels will share the same value for the blue/red channel). */ - DATA_FORMAT_G12X4_B12X4R12X4_2PLANE_422_UNORM_3PACK16 = 209, - - /** 12-bit-per-channel unsigned floating-point green/blue/red channel data with normalized value, plus 6 unused bits after each channel. Packed in 3×16 bits and stored across 3 separate planes (green + blue + red). Values are in the `[0.0, 1.0]` range. */ - DATA_FORMAT_G12X4_B12X4_R12X4_3PLANE_444_UNORM_3PACK16 = 210, - - /** 16-bit-per-channel unsigned floating-point green/blue/red channel data format with normalized value. Values are in the `[0.0, 1.0]` range. Blue and red channel data is stored at halved horizontal resolution (i.e. 2 horizontally adjacent pixels will share the same value for the blue/red channel). */ - DATA_FORMAT_G16B16G16R16_422_UNORM = 211, - - /** 16-bit-per-channel unsigned floating-point blue/green/red channel data format with normalized value. Values are in the `[0.0, 1.0]` range. Blue and red channel data is stored at halved horizontal resolution (i.e. 2 horizontally adjacent pixels will share the same value for the blue/red channel). */ - DATA_FORMAT_B16G16R16G16_422_UNORM = 212, - - /** 16-bit-per-channel unsigned floating-point green/blue/red channel data with normalized value, plus 6 unused bits after each channel. Stored across 2 separate planes (green + blue + red). Values are in the `[0.0, 1.0]` range. Blue and red channel data is stored at halved horizontal and vertical resolution (i.e. 2×2 adjacent pixels will share the same value for the blue/red channel). */ - DATA_FORMAT_G16_B16_R16_3PLANE_420_UNORM = 213, - - /** 16-bit-per-channel unsigned floating-point green/blue/red channel data with normalized value, plus 6 unused bits after each channel. Stored across 2 separate planes (green + blue/red). Values are in the `[0.0, 1.0]` range. Blue and red channel data is stored at halved horizontal and vertical resolution (i.e. 2×2 adjacent pixels will share the same value for the blue/red channel). */ - DATA_FORMAT_G16_B16R16_2PLANE_420_UNORM = 214, - - /** 16-bit-per-channel unsigned floating-point green/blue/red channel data with normalized value, plus 6 unused bits after each channel. Stored across 3 separate planes (green + blue + red). Values are in the `[0.0, 1.0]` range. Blue and red channel data is stored at halved horizontal resolution (i.e. 2 horizontally adjacent pixels will share the same value for the blue/red channel). */ - DATA_FORMAT_G16_B16_R16_3PLANE_422_UNORM = 215, - - /** 16-bit-per-channel unsigned floating-point green/blue/red channel data with normalized value, plus 6 unused bits after each channel. Stored across 3 separate planes (green + blue/red). Values are in the `[0.0, 1.0]` range. Blue and red channel data is stored at halved horizontal resolution (i.e. 2 horizontally adjacent pixels will share the same value for the blue/red channel). */ - DATA_FORMAT_G16_B16R16_2PLANE_422_UNORM = 216, - - /** 16-bit-per-channel unsigned floating-point green/blue/red channel data with normalized value, plus 6 unused bits after each channel. Stored across 3 separate planes (green + blue + red). Values are in the `[0.0, 1.0]` range. */ - DATA_FORMAT_G16_B16_R16_3PLANE_444_UNORM = 217, - - /** Represents the size of the [enum DataFormat] enum. */ - DATA_FORMAT_MAX = 218, - } - enum BarrierMask { - /** Vertex shader barrier mask. */ - BARRIER_MASK_VERTEX = 1, - - /** Fragment shader barrier mask. */ - BARRIER_MASK_FRAGMENT = 8, - - /** Compute barrier mask. */ - BARRIER_MASK_COMPUTE = 2, - - /** Transfer barrier mask. */ - BARRIER_MASK_TRANSFER = 4, - - /** Raster barrier mask (vertex and fragment). Equivalent to `BARRIER_MASK_VERTEX | BARRIER_MASK_FRAGMENT`. */ - BARRIER_MASK_RASTER = 9, - - /** Barrier mask for all types (vertex, fragment, compute, transfer). */ - BARRIER_MASK_ALL_BARRIERS = 32767, - - /** No barrier for any type. */ - BARRIER_MASK_NO_BARRIER = 32768, - } - enum TextureType { - /** 1-dimensional texture. */ - TEXTURE_TYPE_1D = 0, - - /** 2-dimensional texture. */ - TEXTURE_TYPE_2D = 1, - - /** 3-dimensional texture. */ - TEXTURE_TYPE_3D = 2, - - /** [Cubemap] texture. */ - TEXTURE_TYPE_CUBE = 3, - - /** Array of 1-dimensional textures. */ - TEXTURE_TYPE_1D_ARRAY = 4, - - /** Array of 2-dimensional textures. */ - TEXTURE_TYPE_2D_ARRAY = 5, - - /** Array of [Cubemap] textures. */ - TEXTURE_TYPE_CUBE_ARRAY = 6, - - /** Represents the size of the [enum TextureType] enum. */ - TEXTURE_TYPE_MAX = 7, - } - enum TextureSamples { - /** Perform 1 texture sample (this is the fastest but lowest-quality for antialiasing). */ - TEXTURE_SAMPLES_1 = 0, - - /** Perform 2 texture samples. */ - TEXTURE_SAMPLES_2 = 1, - - /** Perform 4 texture samples. */ - TEXTURE_SAMPLES_4 = 2, - - /** Perform 8 texture samples. Not supported on mobile GPUs (including Apple Silicon). */ - TEXTURE_SAMPLES_8 = 3, - - /** Perform 16 texture samples. Not supported on mobile GPUs and many desktop GPUs. */ - TEXTURE_SAMPLES_16 = 4, - - /** Perform 32 texture samples. Not supported on most GPUs. */ - TEXTURE_SAMPLES_32 = 5, - - /** Perform 64 texture samples (this is the slowest but highest-quality for antialiasing). Not supported on most GPUs. */ - TEXTURE_SAMPLES_64 = 6, - - /** Represents the size of the [enum TextureSamples] enum. */ - TEXTURE_SAMPLES_MAX = 7, - } - enum TextureUsageBits { - /** Texture can be sampled. */ - TEXTURE_USAGE_SAMPLING_BIT = 1, - - /** Texture can be used as a color attachment in a framebuffer. */ - TEXTURE_USAGE_COLOR_ATTACHMENT_BIT = 2, - - /** Texture can be used as a depth/stencil attachment in a framebuffer. */ - TEXTURE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT = 4, - - /** Texture can be used as a [url=https://registry.khronos.org/vulkan/specs/1.3-extensions/html/vkspec.html#descriptorsets-storageimage]storage image[/url]. */ - TEXTURE_USAGE_STORAGE_BIT = 8, - - /** Texture can be used as a [url=https://registry.khronos.org/vulkan/specs/1.3-extensions/html/vkspec.html#descriptorsets-storageimage]storage image[/url] with support for atomic operations. */ - TEXTURE_USAGE_STORAGE_ATOMIC_BIT = 16, - - /** Texture can be read back on the CPU using [method texture_get_data] faster than without this bit, since it is always kept in the system memory. */ - TEXTURE_USAGE_CPU_READ_BIT = 32, - - /** Texture can be updated using [method texture_update]. */ - TEXTURE_USAGE_CAN_UPDATE_BIT = 64, - - /** Texture can be a source for [method texture_copy]. */ - TEXTURE_USAGE_CAN_COPY_FROM_BIT = 128, - - /** Texture can be a destination for [method texture_copy]. */ - TEXTURE_USAGE_CAN_COPY_TO_BIT = 256, - - /** Texture can be used as a [url=https://registry.khronos.org/vulkan/specs/1.3-extensions/html/vkspec.html#descriptorsets-inputattachment]input attachment[/url] in a framebuffer. */ - TEXTURE_USAGE_INPUT_ATTACHMENT_BIT = 512, - } - enum TextureSwizzle { - /** Return the sampled value as-is. */ - TEXTURE_SWIZZLE_IDENTITY = 0, - - /** Always return `0.0` when sampling. */ - TEXTURE_SWIZZLE_ZERO = 1, - - /** Always return `1.0` when sampling. */ - TEXTURE_SWIZZLE_ONE = 2, - - /** Sample the red color channel. */ - TEXTURE_SWIZZLE_R = 3, - - /** Sample the green color channel. */ - TEXTURE_SWIZZLE_G = 4, - - /** Sample the blue color channel. */ - TEXTURE_SWIZZLE_B = 5, - - /** Sample the alpha channel. */ - TEXTURE_SWIZZLE_A = 6, - - /** Represents the size of the [enum TextureSwizzle] enum. */ - TEXTURE_SWIZZLE_MAX = 7, - } - enum TextureSliceType { - /** 2-dimensional texture slice. */ - TEXTURE_SLICE_2D = 0, - - /** Cubemap texture slice. */ - TEXTURE_SLICE_CUBEMAP = 1, - - /** 3-dimensional texture slice. */ - TEXTURE_SLICE_3D = 2, - } - enum SamplerFilter { - /** Nearest-neighbor sampler filtering. Sampling at higher resolutions than the source will result in a pixelated look. */ - SAMPLER_FILTER_NEAREST = 0, - - /** Bilinear sampler filtering. Sampling at higher resolutions than the source will result in a blurry look. */ - SAMPLER_FILTER_LINEAR = 1, - } - enum SamplerRepeatMode { - /** Sample with repeating enabled. */ - SAMPLER_REPEAT_MODE_REPEAT = 0, - - /** Sample with mirrored repeating enabled. When sampling outside the `[0.0, 1.0]` range, return a mirrored version of the sampler. This mirrored version is mirrored again if sampling further away, with the pattern repeating indefinitely. */ - SAMPLER_REPEAT_MODE_MIRRORED_REPEAT = 1, - - /** Sample with repeating disabled. When sampling outside the `[0.0, 1.0]` range, return the color of the last pixel on the edge. */ - SAMPLER_REPEAT_MODE_CLAMP_TO_EDGE = 2, - - /** Sample with repeating disabled. When sampling outside the `[0.0, 1.0]` range, return the specified [member RDSamplerState.border_color]. */ - SAMPLER_REPEAT_MODE_CLAMP_TO_BORDER = 3, - - /** Sample with mirrored repeating enabled, but only once. When sampling in the `[-1.0, 0.0]` range, return a mirrored version of the sampler. When sampling outside the `[-1.0, 1.0]` range, return the color of the last pixel on the edge. */ - SAMPLER_REPEAT_MODE_MIRROR_CLAMP_TO_EDGE = 4, - - /** Represents the size of the [enum SamplerRepeatMode] enum. */ - SAMPLER_REPEAT_MODE_MAX = 5, - } - enum SamplerBorderColor { - /** Return a floating-point transparent black color when sampling outside the `[0.0, 1.0]` range. Only effective if the sampler repeat mode is [constant SAMPLER_REPEAT_MODE_CLAMP_TO_BORDER]. */ - SAMPLER_BORDER_COLOR_FLOAT_TRANSPARENT_BLACK = 0, - - /** Return a integer transparent black color when sampling outside the `[0.0, 1.0]` range. Only effective if the sampler repeat mode is [constant SAMPLER_REPEAT_MODE_CLAMP_TO_BORDER]. */ - SAMPLER_BORDER_COLOR_INT_TRANSPARENT_BLACK = 1, - - /** Return a floating-point opaque black color when sampling outside the `[0.0, 1.0]` range. Only effective if the sampler repeat mode is [constant SAMPLER_REPEAT_MODE_CLAMP_TO_BORDER]. */ - SAMPLER_BORDER_COLOR_FLOAT_OPAQUE_BLACK = 2, - - /** Return a integer opaque black color when sampling outside the `[0.0, 1.0]` range. Only effective if the sampler repeat mode is [constant SAMPLER_REPEAT_MODE_CLAMP_TO_BORDER]. */ - SAMPLER_BORDER_COLOR_INT_OPAQUE_BLACK = 3, - - /** Return a floating-point opaque white color when sampling outside the `[0.0, 1.0]` range. Only effective if the sampler repeat mode is [constant SAMPLER_REPEAT_MODE_CLAMP_TO_BORDER]. */ - SAMPLER_BORDER_COLOR_FLOAT_OPAQUE_WHITE = 4, - - /** Return a integer opaque white color when sampling outside the `[0.0, 1.0]` range. Only effective if the sampler repeat mode is [constant SAMPLER_REPEAT_MODE_CLAMP_TO_BORDER]. */ - SAMPLER_BORDER_COLOR_INT_OPAQUE_WHITE = 5, - - /** Represents the size of the [enum SamplerBorderColor] enum. */ - SAMPLER_BORDER_COLOR_MAX = 6, - } - enum VertexFrequency { - /** Vertex attribute addressing is a function of the vertex. This is used to specify the rate at which vertex attributes are pulled from buffers. */ - VERTEX_FREQUENCY_VERTEX = 0, - - /** Vertex attribute addressing is a function of the instance index. This is used to specify the rate at which vertex attributes are pulled from buffers. */ - VERTEX_FREQUENCY_INSTANCE = 1, - } - enum IndexBufferFormat { - /** Index buffer in 16-bit unsigned integer format. This limits the maximum index that can be specified to `65535`. */ - INDEX_BUFFER_FORMAT_UINT16 = 0, - - /** Index buffer in 32-bit unsigned integer format. This limits the maximum index that can be specified to `4294967295`. */ - INDEX_BUFFER_FORMAT_UINT32 = 1, - } - enum StorageBufferUsage { - STORAGE_BUFFER_USAGE_DISPATCH_INDIRECT = 1, - } - enum UniformType { - /** Sampler uniform. */ - UNIFORM_TYPE_SAMPLER = 0, - - /** Sampler uniform with a texture. */ - UNIFORM_TYPE_SAMPLER_WITH_TEXTURE = 1, - - /** Texture uniform. */ - UNIFORM_TYPE_TEXTURE = 2, - - /** Image uniform. */ - UNIFORM_TYPE_IMAGE = 3, - - /** Texture buffer uniform. */ - UNIFORM_TYPE_TEXTURE_BUFFER = 4, - - /** Sampler uniform with a texture buffer. */ - UNIFORM_TYPE_SAMPLER_WITH_TEXTURE_BUFFER = 5, - - /** Image buffer uniform. */ - UNIFORM_TYPE_IMAGE_BUFFER = 6, - - /** Uniform buffer uniform. */ - UNIFORM_TYPE_UNIFORM_BUFFER = 7, - - /** [url=https://vkguide.dev/docs/chapter-4/storage_buffers/]Storage buffer[/url] uniform. */ - UNIFORM_TYPE_STORAGE_BUFFER = 8, - - /** Input attachment uniform. */ - UNIFORM_TYPE_INPUT_ATTACHMENT = 9, - - /** Represents the size of the [enum UniformType] enum. */ - UNIFORM_TYPE_MAX = 10, - } - enum RenderPrimitive { - /** Point rendering primitive (with constant size, regardless of distance from camera). */ - RENDER_PRIMITIVE_POINTS = 0, - - /** Line list rendering primitive. Lines are drawn separated from each other. */ - RENDER_PRIMITIVE_LINES = 1, - - /** [url=https://registry.khronos.org/vulkan/specs/1.3-extensions/html/vkspec.html#drawing-line-lists-with-adjacency]Line list rendering primitive with adjacency.[/url] - * - * **Note:** Adjacency is only useful with geometry shaders, which Godot does not expose. - */ - RENDER_PRIMITIVE_LINES_WITH_ADJACENCY = 2, - - /** Line strip rendering primitive. Lines drawn are connected to the previous vertex. */ - RENDER_PRIMITIVE_LINESTRIPS = 3, - - /** [url=https://registry.khronos.org/vulkan/specs/1.3-extensions/html/vkspec.html#drawing-line-strips-with-adjacency]Line strip rendering primitive with adjacency.[/url] - * - * **Note:** Adjacency is only useful with geometry shaders, which Godot does not expose. - */ - RENDER_PRIMITIVE_LINESTRIPS_WITH_ADJACENCY = 4, - - /** Triangle list rendering primitive. Triangles are drawn separated from each other. */ - RENDER_PRIMITIVE_TRIANGLES = 5, - - /** [url=https://registry.khronos.org/vulkan/specs/1.3-extensions/html/vkspec.html#drawing-triangle-lists-with-adjacency]Triangle list rendering primitive with adjacency.[/url] - * - * **Note:** Adjacency is only useful with geometry shaders, which Godot does not expose. - */ - RENDER_PRIMITIVE_TRIANGLES_WITH_ADJACENCY = 6, - - /** Triangle strip rendering primitive. Triangles drawn are connected to the previous triangle. */ - RENDER_PRIMITIVE_TRIANGLE_STRIPS = 7, - - /** [url=https://registry.khronos.org/vulkan/specs/1.3-extensions/html/vkspec.html#drawing-triangle-strips-with-adjacency]Triangle strip rendering primitive with adjacency.[/url] - * - * **Note:** Adjacency is only useful with geometry shaders, which Godot does not expose. - */ - RENDER_PRIMITIVE_TRIANGLE_STRIPS_WITH_AJACENCY = 8, - - /** Triangle strip rendering primitive with *primitive restart* enabled. Triangles drawn are connected to the previous triangle, but a primitive restart index can be specified before drawing to create a second triangle strip after the specified index. - * - * **Note:** Only compatible with indexed draws. - */ - RENDER_PRIMITIVE_TRIANGLE_STRIPS_WITH_RESTART_INDEX = 9, - - /** Tessellation patch rendering primitive. Only useful with tessellation shaders, which can be used to deform these patches. */ - RENDER_PRIMITIVE_TESSELATION_PATCH = 10, - - /** Represents the size of the [enum RenderPrimitive] enum. */ - RENDER_PRIMITIVE_MAX = 11, - } - enum PolygonCullMode { - /** Do not use polygon front face or backface culling. */ - POLYGON_CULL_DISABLED = 0, - - /** Use polygon frontface culling (faces pointing towards the camera are hidden). */ - POLYGON_CULL_FRONT = 1, - - /** Use polygon backface culling (faces pointing away from the camera are hidden). */ - POLYGON_CULL_BACK = 2, - } - enum PolygonFrontFace { - /** Clockwise winding order to determine which face of a polygon is its front face. */ - POLYGON_FRONT_FACE_CLOCKWISE = 0, - - /** Counter-clockwise winding order to determine which face of a polygon is its front face. */ - POLYGON_FRONT_FACE_COUNTER_CLOCKWISE = 1, - } - enum StencilOperation { - /** Keep the current stencil value. */ - STENCIL_OP_KEEP = 0, - - /** Set the stencil value to `0`. */ - STENCIL_OP_ZERO = 1, - - /** Replace the existing stencil value with the new one. */ - STENCIL_OP_REPLACE = 2, - - /** Increment the existing stencil value and clamp to the maximum representable unsigned value if reached. Stencil bits are considered as an unsigned integer. */ - STENCIL_OP_INCREMENT_AND_CLAMP = 3, - - /** Decrement the existing stencil value and clamp to the minimum value if reached. Stencil bits are considered as an unsigned integer. */ - STENCIL_OP_DECREMENT_AND_CLAMP = 4, - - /** Bitwise-invert the existing stencil value. */ - STENCIL_OP_INVERT = 5, - - /** Increment the stencil value and wrap around to `0` if reaching the maximum representable unsigned. Stencil bits are considered as an unsigned integer. */ - STENCIL_OP_INCREMENT_AND_WRAP = 6, - - /** Decrement the stencil value and wrap around to the maximum representable unsigned if reaching the minimum. Stencil bits are considered as an unsigned integer. */ - STENCIL_OP_DECREMENT_AND_WRAP = 7, - - /** Represents the size of the [enum StencilOperation] enum. */ - STENCIL_OP_MAX = 8, - } - enum CompareOperator { - /** "Never" comparison (opposite of [constant COMPARE_OP_ALWAYS]). */ - COMPARE_OP_NEVER = 0, - - /** "Less than" comparison. */ - COMPARE_OP_LESS = 1, - - /** "Equal" comparison. */ - COMPARE_OP_EQUAL = 2, - - /** "Less than or equal" comparison. */ - COMPARE_OP_LESS_OR_EQUAL = 3, - - /** "Greater than" comparison. */ - COMPARE_OP_GREATER = 4, - - /** "Not equal" comparison. */ - COMPARE_OP_NOT_EQUAL = 5, - - /** "Greater than or equal" comparison. */ - COMPARE_OP_GREATER_OR_EQUAL = 6, - - /** "Always" comparison (opposite of [constant COMPARE_OP_NEVER]). */ - COMPARE_OP_ALWAYS = 7, - - /** Represents the size of the [enum CompareOperator] enum. */ - COMPARE_OP_MAX = 8, - } - enum LogicOperation { - /** Clear logic operation (result is always `0`). See also [constant LOGIC_OP_SET]. */ - LOGIC_OP_CLEAR = 0, - - /** AND logic operation. */ - LOGIC_OP_AND = 1, - - /** AND logic operation with the *destination* operand being inverted. See also [constant LOGIC_OP_AND_INVERTED]. */ - LOGIC_OP_AND_REVERSE = 2, - - /** Copy logic operation (keeps the *source* value as-is). See also [constant LOGIC_OP_COPY_INVERTED] and [constant LOGIC_OP_NO_OP]. */ - LOGIC_OP_COPY = 3, - - /** AND logic operation with the *source* operand being inverted. See also [constant LOGIC_OP_AND_REVERSE]. */ - LOGIC_OP_AND_INVERTED = 4, - - /** No-op logic operation (keeps the *destination* value as-is). See also [constant LOGIC_OP_COPY]. */ - LOGIC_OP_NO_OP = 5, - - /** Exclusive or (XOR) logic operation. */ - LOGIC_OP_XOR = 6, - - /** OR logic operation. */ - LOGIC_OP_OR = 7, - - /** Not-OR (NOR) logic operation. */ - LOGIC_OP_NOR = 8, - - /** Not-XOR (XNOR) logic operation. */ - LOGIC_OP_EQUIVALENT = 9, - - /** Invert logic operation. */ - LOGIC_OP_INVERT = 10, - - /** OR logic operation with the *destination* operand being inverted. See also [constant LOGIC_OP_OR_REVERSE]. */ - LOGIC_OP_OR_REVERSE = 11, - - /** NOT logic operation (inverts the value). See also [constant LOGIC_OP_COPY]. */ - LOGIC_OP_COPY_INVERTED = 12, - - /** OR logic operation with the *source* operand being inverted. See also [constant LOGIC_OP_OR_REVERSE]. */ - LOGIC_OP_OR_INVERTED = 13, - - /** Not-AND (NAND) logic operation. */ - LOGIC_OP_NAND = 14, - - /** SET logic operation (result is always `1`). See also [constant LOGIC_OP_CLEAR]. */ - LOGIC_OP_SET = 15, - - /** Represents the size of the [enum LogicOperation] enum. */ - LOGIC_OP_MAX = 16, - } - enum BlendFactor { - /** Constant `0.0` blend factor. */ - BLEND_FACTOR_ZERO = 0, - - /** Constant `1.0` blend factor. */ - BLEND_FACTOR_ONE = 1, - - /** Color blend factor is `source color`. Alpha blend factor is `source alpha`. */ - BLEND_FACTOR_SRC_COLOR = 2, - - /** Color blend factor is `1.0 - source color`. Alpha blend factor is `1.0 - source alpha`. */ - BLEND_FACTOR_ONE_MINUS_SRC_COLOR = 3, - - /** Color blend factor is `destination color`. Alpha blend factor is `destination alpha`. */ - BLEND_FACTOR_DST_COLOR = 4, - - /** Color blend factor is `1.0 - destination color`. Alpha blend factor is `1.0 - destination alpha`. */ - BLEND_FACTOR_ONE_MINUS_DST_COLOR = 5, - - /** Color and alpha blend factor is `source alpha`. */ - BLEND_FACTOR_SRC_ALPHA = 6, - - /** Color and alpha blend factor is `1.0 - source alpha`. */ - BLEND_FACTOR_ONE_MINUS_SRC_ALPHA = 7, - - /** Color and alpha blend factor is `destination alpha`. */ - BLEND_FACTOR_DST_ALPHA = 8, - - /** Color and alpha blend factor is `1.0 - destination alpha`. */ - BLEND_FACTOR_ONE_MINUS_DST_ALPHA = 9, - - /** Color blend factor is `blend constant color`. Alpha blend factor is `blend constant alpha` (see [method draw_list_set_blend_constants]). */ - BLEND_FACTOR_CONSTANT_COLOR = 10, - - /** Color blend factor is `1.0 - blend constant color`. Alpha blend factor is `1.0 - blend constant alpha` (see [method draw_list_set_blend_constants]). */ - BLEND_FACTOR_ONE_MINUS_CONSTANT_COLOR = 11, - - /** Color and alpha blend factor is `blend constant alpha` (see [method draw_list_set_blend_constants]). */ - BLEND_FACTOR_CONSTANT_ALPHA = 12, - - /** Color and alpha blend factor is `1.0 - blend constant alpha` (see [method draw_list_set_blend_constants]). */ - BLEND_FACTOR_ONE_MINUS_CONSTANT_ALPHA = 13, - - /** Color blend factor is `min(source alpha, 1.0 - destination alpha)`. Alpha blend factor is `1.0`. */ - BLEND_FACTOR_SRC_ALPHA_SATURATE = 14, - - /** Color blend factor is `second source color`. Alpha blend factor is `second source alpha`. Only relevant for dual-source blending. */ - BLEND_FACTOR_SRC1_COLOR = 15, - - /** Color blend factor is `1.0 - second source color`. Alpha blend factor is `1.0 - second source alpha`. Only relevant for dual-source blending. */ - BLEND_FACTOR_ONE_MINUS_SRC1_COLOR = 16, - - /** Color and alpha blend factor is `second source alpha`. Only relevant for dual-source blending. */ - BLEND_FACTOR_SRC1_ALPHA = 17, - - /** Color and alpha blend factor is `1.0 - second source alpha`. Only relevant for dual-source blending. */ - BLEND_FACTOR_ONE_MINUS_SRC1_ALPHA = 18, - - /** Represents the size of the [enum BlendFactor] enum. */ - BLEND_FACTOR_MAX = 19, - } - enum BlendOperation { - /** Additive blending operation (`source + destination`). */ - BLEND_OP_ADD = 0, - - /** Subtractive blending operation (`source - destination`). */ - BLEND_OP_SUBTRACT = 1, - - /** Reverse subtractive blending operation (`destination - source`). */ - BLEND_OP_REVERSE_SUBTRACT = 2, - - /** Minimum blending operation (keep the lowest value of the two). */ - BLEND_OP_MINIMUM = 3, - - /** Maximum blending operation (keep the highest value of the two). */ - BLEND_OP_MAXIMUM = 4, - - /** Represents the size of the [enum BlendOperation] enum. */ - BLEND_OP_MAX = 5, - } - enum PipelineDynamicStateFlags { - /** Allows dynamically changing the width of rendering lines. */ - DYNAMIC_STATE_LINE_WIDTH = 1, - - /** Allows dynamically changing the depth bias. */ - DYNAMIC_STATE_DEPTH_BIAS = 2, - DYNAMIC_STATE_BLEND_CONSTANTS = 4, - DYNAMIC_STATE_DEPTH_BOUNDS = 8, - DYNAMIC_STATE_STENCIL_COMPARE_MASK = 16, - DYNAMIC_STATE_STENCIL_WRITE_MASK = 32, - DYNAMIC_STATE_STENCIL_REFERENCE = 64, - } - enum InitialAction { - /** Load the previous contents of the framebuffer. */ - INITIAL_ACTION_LOAD = 0, - - /** Clear the whole framebuffer or its specified region. */ - INITIAL_ACTION_CLEAR = 1, - - /** Ignore the previous contents of the framebuffer. This is the fastest option if you'll overwrite all of the pixels and don't need to read any of them. */ - INITIAL_ACTION_DISCARD = 2, - - /** Represents the size of the [enum InitialAction] enum. */ - INITIAL_ACTION_MAX = 3, - INITIAL_ACTION_CLEAR_REGION = 1, - INITIAL_ACTION_CLEAR_REGION_CONTINUE = 1, - INITIAL_ACTION_KEEP = 0, - INITIAL_ACTION_DROP = 2, - INITIAL_ACTION_CONTINUE = 0, - } - enum FinalAction { - /** Store the result of the draw list in the framebuffer. This is generally what you want to do. */ - FINAL_ACTION_STORE = 0, - - /** Discard the contents of the framebuffer. This is the fastest option if you don't need to use the results of the draw list. */ - FINAL_ACTION_DISCARD = 1, - - /** Represents the size of the [enum FinalAction] enum. */ - FINAL_ACTION_MAX = 2, - FINAL_ACTION_READ = 0, - FINAL_ACTION_CONTINUE = 0, - } - enum ShaderStage { - /** Vertex shader stage. This can be used to manipulate vertices from a shader (but not create new vertices). */ - SHADER_STAGE_VERTEX = 0, - - /** Fragment shader stage (called "pixel shader" in Direct3D). This can be used to manipulate pixels from a shader. */ - SHADER_STAGE_FRAGMENT = 1, - - /** Tessellation control shader stage. This can be used to create additional geometry from a shader. */ - SHADER_STAGE_TESSELATION_CONTROL = 2, - - /** Tessellation evaluation shader stage. This can be used to create additional geometry from a shader. */ - SHADER_STAGE_TESSELATION_EVALUATION = 3, - - /** Compute shader stage. This can be used to run arbitrary computing tasks in a shader, performing them on the GPU instead of the CPU. */ - SHADER_STAGE_COMPUTE = 4, - - /** Represents the size of the [enum ShaderStage] enum. */ - SHADER_STAGE_MAX = 5, - - /** Vertex shader stage bit (see also [constant SHADER_STAGE_VERTEX]). */ - SHADER_STAGE_VERTEX_BIT = 1, - - /** Fragment shader stage bit (see also [constant SHADER_STAGE_FRAGMENT]). */ - SHADER_STAGE_FRAGMENT_BIT = 2, - - /** Tessellation control shader stage bit (see also [constant SHADER_STAGE_TESSELATION_CONTROL]). */ - SHADER_STAGE_TESSELATION_CONTROL_BIT = 4, - - /** Tessellation evaluation shader stage bit (see also [constant SHADER_STAGE_TESSELATION_EVALUATION]). */ - SHADER_STAGE_TESSELATION_EVALUATION_BIT = 8, - - /** Compute shader stage bit (see also [constant SHADER_STAGE_COMPUTE]). */ - SHADER_STAGE_COMPUTE_BIT = 16, - } - enum ShaderLanguage { - /** Khronos' GLSL shading language (used natively by OpenGL and Vulkan). This is the language used for core Godot shaders. */ - SHADER_LANGUAGE_GLSL = 0, - - /** Microsoft's High-Level Shading Language (used natively by Direct3D, but can also be used in Vulkan). */ - SHADER_LANGUAGE_HLSL = 1, - } - enum PipelineSpecializationConstantType { - /** Boolean specialization constant. */ - PIPELINE_SPECIALIZATION_CONSTANT_TYPE_BOOL = 0, - - /** Integer specialization constant. */ - PIPELINE_SPECIALIZATION_CONSTANT_TYPE_INT = 1, - - /** Floating-point specialization constant. */ - PIPELINE_SPECIALIZATION_CONSTANT_TYPE_FLOAT = 2, - } - enum Limit { - /** Maximum number of uniform sets that can be bound at a given time. */ - LIMIT_MAX_BOUND_UNIFORM_SETS = 0, - - /** Maximum number of color framebuffer attachments that can be used at a given time. */ - LIMIT_MAX_FRAMEBUFFER_COLOR_ATTACHMENTS = 1, - - /** Maximum number of textures that can be used per uniform set. */ - LIMIT_MAX_TEXTURES_PER_UNIFORM_SET = 2, - - /** Maximum number of samplers that can be used per uniform set. */ - LIMIT_MAX_SAMPLERS_PER_UNIFORM_SET = 3, - - /** Maximum number of [url=https://vkguide.dev/docs/chapter-4/storage_buffers/]storage buffers[/url] per uniform set. */ - LIMIT_MAX_STORAGE_BUFFERS_PER_UNIFORM_SET = 4, - - /** Maximum number of storage images per uniform set. */ - LIMIT_MAX_STORAGE_IMAGES_PER_UNIFORM_SET = 5, - - /** Maximum number of uniform buffers per uniform set. */ - LIMIT_MAX_UNIFORM_BUFFERS_PER_UNIFORM_SET = 6, - - /** Maximum index for an indexed draw command. */ - LIMIT_MAX_DRAW_INDEXED_INDEX = 7, - - /** Maximum height of a framebuffer (in pixels). */ - LIMIT_MAX_FRAMEBUFFER_HEIGHT = 8, - - /** Maximum width of a framebuffer (in pixels). */ - LIMIT_MAX_FRAMEBUFFER_WIDTH = 9, - - /** Maximum number of texture array layers. */ - LIMIT_MAX_TEXTURE_ARRAY_LAYERS = 10, - - /** Maximum supported 1-dimensional texture size (in pixels on a single axis). */ - LIMIT_MAX_TEXTURE_SIZE_1D = 11, - - /** Maximum supported 2-dimensional texture size (in pixels on a single axis). */ - LIMIT_MAX_TEXTURE_SIZE_2D = 12, - - /** Maximum supported 3-dimensional texture size (in pixels on a single axis). */ - LIMIT_MAX_TEXTURE_SIZE_3D = 13, - - /** Maximum supported cubemap texture size (in pixels on a single axis of a single face). */ - LIMIT_MAX_TEXTURE_SIZE_CUBE = 14, - - /** Maximum number of textures per shader stage. */ - LIMIT_MAX_TEXTURES_PER_SHADER_STAGE = 15, - - /** Maximum number of samplers per shader stage. */ - LIMIT_MAX_SAMPLERS_PER_SHADER_STAGE = 16, - - /** Maximum number of [url=https://vkguide.dev/docs/chapter-4/storage_buffers/]storage buffers[/url] per shader stage. */ - LIMIT_MAX_STORAGE_BUFFERS_PER_SHADER_STAGE = 17, - - /** Maximum number of storage images per shader stage. */ - LIMIT_MAX_STORAGE_IMAGES_PER_SHADER_STAGE = 18, - - /** Maximum number of uniform buffers per uniform set. */ - LIMIT_MAX_UNIFORM_BUFFERS_PER_SHADER_STAGE = 19, - - /** Maximum size of a push constant. A lot of devices are limited to 128 bytes, so try to avoid exceeding 128 bytes in push constants to ensure compatibility even if your GPU is reporting a higher value. */ - LIMIT_MAX_PUSH_CONSTANT_SIZE = 20, - - /** Maximum size of a uniform buffer. */ - LIMIT_MAX_UNIFORM_BUFFER_SIZE = 21, - - /** Maximum vertex input attribute offset. */ - LIMIT_MAX_VERTEX_INPUT_ATTRIBUTE_OFFSET = 22, - - /** Maximum number of vertex input attributes. */ - LIMIT_MAX_VERTEX_INPUT_ATTRIBUTES = 23, - - /** Maximum number of vertex input bindings. */ - LIMIT_MAX_VERTEX_INPUT_BINDINGS = 24, - - /** Maximum vertex input binding stride. */ - LIMIT_MAX_VERTEX_INPUT_BINDING_STRIDE = 25, - - /** Minimum uniform buffer offset alignment. */ - LIMIT_MIN_UNIFORM_BUFFER_OFFSET_ALIGNMENT = 26, - - /** Maximum shared memory size for compute shaders. */ - LIMIT_MAX_COMPUTE_SHARED_MEMORY_SIZE = 27, - - /** Maximum number of workgroups for compute shaders on the X axis. */ - LIMIT_MAX_COMPUTE_WORKGROUP_COUNT_X = 28, - - /** Maximum number of workgroups for compute shaders on the Y axis. */ - LIMIT_MAX_COMPUTE_WORKGROUP_COUNT_Y = 29, - - /** Maximum number of workgroups for compute shaders on the Z axis. */ - LIMIT_MAX_COMPUTE_WORKGROUP_COUNT_Z = 30, - - /** Maximum number of workgroup invocations for compute shaders. */ - LIMIT_MAX_COMPUTE_WORKGROUP_INVOCATIONS = 31, - - /** Maximum workgroup size for compute shaders on the X axis. */ - LIMIT_MAX_COMPUTE_WORKGROUP_SIZE_X = 32, - - /** Maximum workgroup size for compute shaders on the Y axis. */ - LIMIT_MAX_COMPUTE_WORKGROUP_SIZE_Y = 33, - - /** Maximum workgroup size for compute shaders on the Z axis. */ - LIMIT_MAX_COMPUTE_WORKGROUP_SIZE_Z = 34, - - /** Maximum viewport width (in pixels). */ - LIMIT_MAX_VIEWPORT_DIMENSIONS_X = 35, - - /** Maximum viewport height (in pixels). */ - LIMIT_MAX_VIEWPORT_DIMENSIONS_Y = 36, - } - enum MemoryType { - /** Memory taken by textures. */ - MEMORY_TEXTURES = 0, - - /** Memory taken by buffers. */ - MEMORY_BUFFERS = 1, - - /** Total memory taken. This is greater than the sum of [constant MEMORY_TEXTURES] and [constant MEMORY_BUFFERS], as it also includes miscellaneous memory usage. */ - MEMORY_TOTAL = 2, - } - } - /** Abstraction for working with modern low-level graphics APIs. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_renderingdevice.html - */ - class RenderingDevice extends Object { - /** Returned by functions that return an ID if a value is invalid. */ - static readonly INVALID_ID = -1 - - /** Returned by functions that return a format ID if a value is invalid. */ - static readonly INVALID_FORMAT_ID = -1 - constructor(identifier?: any) - - /** Creates a new texture. It can be accessed with the RID that is returned. - * Once finished with your RID, you will want to free the RID using the RenderingDevice's [method free_rid] method. - * - * **Note:** Not to be confused with [method RenderingServer.texture_2d_create], which creates the Godot-specific [Texture2D] resource as opposed to the graphics API's own texture type. - */ - texture_create(format: RDTextureFormat, view: RDTextureView, data: GArray = []): RID - - /** Creates a shared texture using the specified [param view] and the texture information from [param with_texture]. */ - texture_create_shared(view: RDTextureView, with_texture: RID): RID - - /** Creates a shared texture using the specified [param view] and the texture information from [param with_texture]'s [param layer] and [param mipmap]. The number of included mipmaps from the original texture can be controlled using the [param mipmaps] parameter. Only relevant for textures with multiple layers, such as 3D textures, texture arrays and cubemaps. For single-layer textures, use [method texture_create_shared] - * For 2D textures (which only have one layer), [param layer] must be `0`. - * - * **Note:** Layer slicing is only supported for 2D texture arrays, not 3D textures or cubemaps. - */ - texture_create_shared_from_slice(view: RDTextureView, with_texture: RID, layer: int64, mipmap: int64, mipmaps: int64 = 1, slice_type: RenderingDevice.TextureSliceType = 0): RID - - /** Returns an RID for an existing [param image] (`VkImage`) with the given [param type], [param format], [param samples], [param usage_flags], [param width], [param height], [param depth], and [param layers]. This can be used to allow Godot to render onto foreign images. */ - texture_create_from_extension(type: RenderingDevice.TextureType, format: RenderingDevice.DataFormat, samples: RenderingDevice.TextureSamples, usage_flags: RenderingDevice.TextureUsageBits, image: int64, width: int64, height: int64, depth: int64, layers: int64): RID - - /** Updates texture data with new data, replacing the previous data in place. The updated texture data must have the same dimensions and format. For 2D textures (which only have one layer), [param layer] must be `0`. Returns [constant @GlobalScope.OK] if the update was successful, [constant @GlobalScope.ERR_INVALID_PARAMETER] otherwise. - * - * **Note:** Updating textures is forbidden during creation of a draw or compute list. - * - * **Note:** The existing [param texture] can't be updated while a draw list that uses it as part of a framebuffer is being created. Ensure the draw list is finalized (and that the color/depth texture using it is not set to [constant FINAL_ACTION_CONTINUE]) to update this texture. - * - * **Note:** The existing [param texture] requires the [constant TEXTURE_USAGE_CAN_UPDATE_BIT] to be updatable. - */ - texture_update(texture: RID, layer: int64, data: PackedByteArray | byte[] | ArrayBuffer): GError - - /** Returns the [param texture] data for the specified [param layer] as raw binary data. For 2D textures (which only have one layer), [param layer] must be `0`. - * - * **Note:** [param texture] can't be retrieved while a draw list that uses it as part of a framebuffer is being created. Ensure the draw list is finalized (and that the color/depth texture using it is not set to [constant FINAL_ACTION_CONTINUE]) to retrieve this texture. Otherwise, an error is printed and a empty [PackedByteArray] is returned. - * - * **Note:** [param texture] requires the [constant TEXTURE_USAGE_CAN_COPY_FROM_BIT] to be retrieved. Otherwise, an error is printed and a empty [PackedByteArray] is returned. - */ - texture_get_data(texture: RID, layer: int64): PackedByteArray - - /** Returns `true` if the specified [param format] is supported for the given [param usage_flags], `false` otherwise. */ - texture_is_format_supported_for_usage(format: RenderingDevice.DataFormat, usage_flags: RenderingDevice.TextureUsageBits): boolean - - /** Returns `true` if the [param texture] is shared, `false` otherwise. See [RDTextureView]. */ - texture_is_shared(texture: RID): boolean - - /** Returns `true` if the [param texture] is valid, `false` otherwise. */ - texture_is_valid(texture: RID): boolean - - /** Copies the [param from_texture] to [param to_texture] with the specified [param from_pos], [param to_pos] and [param size] coordinates. The Z axis of the [param from_pos], [param to_pos] and [param size] must be `0` for 2-dimensional textures. Source and destination mipmaps/layers must also be specified, with these parameters being `0` for textures without mipmaps or single-layer textures. Returns [constant @GlobalScope.OK] if the texture copy was successful or [constant @GlobalScope.ERR_INVALID_PARAMETER] otherwise. - * - * **Note:** [param from_texture] texture can't be copied while a draw list that uses it as part of a framebuffer is being created. Ensure the draw list is finalized (and that the color/depth texture using it is not set to [constant FINAL_ACTION_CONTINUE]) to copy this texture. - * - * **Note:** [param from_texture] texture requires the [constant TEXTURE_USAGE_CAN_COPY_FROM_BIT] to be retrieved. - * - * **Note:** [param to_texture] can't be copied while a draw list that uses it as part of a framebuffer is being created. Ensure the draw list is finalized (and that the color/depth texture using it is not set to [constant FINAL_ACTION_CONTINUE]) to copy this texture. - * - * **Note:** [param to_texture] requires the [constant TEXTURE_USAGE_CAN_COPY_TO_BIT] to be retrieved. - * - * **Note:** [param from_texture] and [param to_texture] must be of the same type (color or depth). - */ - texture_copy(from_texture: RID, to_texture: RID, from_pos: Vector3, to_pos: Vector3, size: Vector3, src_mipmap: int64, dst_mipmap: int64, src_layer: int64, dst_layer: int64): GError - - /** Clears the specified [param texture] by replacing all of its pixels with the specified [param color]. [param base_mipmap] and [param mipmap_count] determine which mipmaps of the texture are affected by this clear operation, while [param base_layer] and [param layer_count] determine which layers of a 3D texture (or texture array) are affected by this clear operation. For 2D textures (which only have one layer by design), [param base_layer] must be `0` and [param layer_count] must be `1`. - * - * **Note:** [param texture] can't be cleared while a draw list that uses it as part of a framebuffer is being created. Ensure the draw list is finalized (and that the color/depth texture using it is not set to [constant FINAL_ACTION_CONTINUE]) to clear this texture. - */ - texture_clear(texture: RID, color: Color, base_mipmap: int64, mipmap_count: int64, base_layer: int64, layer_count: int64): GError - - /** Resolves the [param from_texture] texture onto [param to_texture] with multisample antialiasing enabled. This must be used when rendering a framebuffer for MSAA to work. Returns [constant @GlobalScope.OK] if successful, [constant @GlobalScope.ERR_INVALID_PARAMETER] otherwise. - * - * **Note:** [param from_texture] and [param to_texture] textures must have the same dimension, format and type (color or depth). - * - * **Note:** [param from_texture] can't be copied while a draw list that uses it as part of a framebuffer is being created. Ensure the draw list is finalized (and that the color/depth texture using it is not set to [constant FINAL_ACTION_CONTINUE]) to resolve this texture. - * - * **Note:** [param from_texture] requires the [constant TEXTURE_USAGE_CAN_COPY_FROM_BIT] to be retrieved. - * - * **Note:** [param from_texture] must be multisampled and must also be 2D (or a slice of a 3D/cubemap texture). - * - * **Note:** [param to_texture] can't be copied while a draw list that uses it as part of a framebuffer is being created. Ensure the draw list is finalized (and that the color/depth texture using it is not set to [constant FINAL_ACTION_CONTINUE]) to resolve this texture. - * - * **Note:** [param to_texture] texture requires the [constant TEXTURE_USAGE_CAN_COPY_TO_BIT] to be retrieved. - * - * **Note:** [param to_texture] texture must **not** be multisampled and must also be 2D (or a slice of a 3D/cubemap texture). - */ - texture_resolve_multisample(from_texture: RID, to_texture: RID): GError - - /** Returns the data format used to create this texture. */ - texture_get_format(texture: RID): RDTextureFormat - - /** Returns the internal graphics handle for this texture object. For use when communicating with third-party APIs mostly with GDExtension. - * - * **Note:** This function returns a `uint64_t` which internally maps to a `GLuint` (OpenGL) or `VkImage` (Vulkan). - */ - texture_get_native_handle(texture: RID): int64 - - /** Creates a new framebuffer format with the specified [param attachments] and [param view_count]. Returns the new framebuffer's unique framebuffer format ID. - * If [param view_count] is greater than or equal to `2`, enables multiview which is used for VR rendering. This requires support for the Vulkan multiview extension. - */ - framebuffer_format_create(attachments: GArray, view_count: int64 = 1): int64 - - /** Creates a multipass framebuffer format with the specified [param attachments], [param passes] and [param view_count] and returns its ID. If [param view_count] is greater than or equal to `2`, enables multiview which is used for VR rendering. This requires support for the Vulkan multiview extension. */ - framebuffer_format_create_multipass(attachments: GArray, passes: GArray, view_count: int64 = 1): int64 - - /** Creates a new empty framebuffer format with the specified number of [param samples] and returns its ID. */ - framebuffer_format_create_empty(samples: RenderingDevice.TextureSamples = 0): int64 - - /** Returns the number of texture samples used for the given framebuffer [param format] ID (returned by [method framebuffer_get_format]). */ - framebuffer_format_get_texture_samples(format: int64, render_pass: int64 = 0): RenderingDevice.TextureSamples - - /** Creates a new framebuffer. It can be accessed with the RID that is returned. - * Once finished with your RID, you will want to free the RID using the RenderingDevice's [method free_rid] method. - */ - framebuffer_create(textures: GArray, validate_with_format: int64 = -1, view_count: int64 = 1): RID - - /** Creates a new multipass framebuffer. It can be accessed with the RID that is returned. - * Once finished with your RID, you will want to free the RID using the RenderingDevice's [method free_rid] method. - */ - framebuffer_create_multipass(textures: GArray, passes: GArray, validate_with_format: int64 = -1, view_count: int64 = 1): RID - - /** Creates a new empty framebuffer. It can be accessed with the RID that is returned. - * Once finished with your RID, you will want to free the RID using the RenderingDevice's [method free_rid] method. - */ - framebuffer_create_empty(size: Vector2i, samples: RenderingDevice.TextureSamples = 0, validate_with_format: int64 = -1): RID - - /** Returns the format ID of the framebuffer specified by the [param framebuffer] RID. This ID is guaranteed to be unique for the same formats and does not need to be freed. */ - framebuffer_get_format(framebuffer: RID): int64 - - /** Returns `true` if the framebuffer specified by the [param framebuffer] RID is valid, `false` otherwise. */ - framebuffer_is_valid(framebuffer: RID): boolean - - /** Creates a new sampler. It can be accessed with the RID that is returned. - * Once finished with your RID, you will want to free the RID using the RenderingDevice's [method free_rid] method. - */ - sampler_create(state: RDSamplerState): RID - - /** Returns `true` if implementation supports using a texture of [param format] with the given [param sampler_filter]. */ - sampler_is_format_supported_for_filter(format: RenderingDevice.DataFormat, sampler_filter: RenderingDevice.SamplerFilter): boolean - - /** It can be accessed with the RID that is returned. - * Once finished with your RID, you will want to free the RID using the RenderingDevice's [method free_rid] method. - */ - vertex_buffer_create(size_bytes: int64, data: PackedByteArray | byte[] | ArrayBuffer = [], use_as_storage: boolean = false): RID - - /** Creates a new vertex format with the specified [param vertex_descriptions]. Returns a unique vertex format ID corresponding to the newly created vertex format. */ - vertex_format_create(vertex_descriptions: GArray): int64 - - /** Creates a vertex array based on the specified buffers. Optionally, [param offsets] (in bytes) may be defined for each buffer. */ - vertex_array_create(vertex_count: int64, vertex_format: int64, src_buffers: GArray, offsets: PackedInt64Array | int64[] = []): RID - - /** Creates a new index buffer. It can be accessed with the RID that is returned. - * Once finished with your RID, you will want to free the RID using the RenderingDevice's [method free_rid] method. - */ - index_buffer_create(size_indices: int64, format: RenderingDevice.IndexBufferFormat, data: PackedByteArray | byte[] | ArrayBuffer = [], use_restart_indices: boolean = false): RID - - /** Creates a new index array. It can be accessed with the RID that is returned. - * Once finished with your RID, you will want to free the RID using the RenderingDevice's [method free_rid] method. - */ - index_array_create(index_buffer: RID, index_offset: int64, index_count: int64): RID - - /** Compiles a SPIR-V from the shader source code in [param shader_source] and returns the SPIR-V as a [RDShaderSPIRV]. This intermediate language shader is portable across different GPU models and driver versions, but cannot be run directly by GPUs until compiled into a binary shader using [method shader_compile_binary_from_spirv]. - * If [param allow_cache] is `true`, make use of the shader cache generated by Godot. This avoids a potentially lengthy shader compilation step if the shader is already in cache. If [param allow_cache] is `false`, Godot's shader cache is ignored and the shader will always be recompiled. - */ - shader_compile_spirv_from_source(shader_source: RDShaderSource, allow_cache: boolean = true): RDShaderSPIRV - - /** Compiles a binary shader from [param spirv_data] and returns the compiled binary data as a [PackedByteArray]. This compiled shader is specific to the GPU model and driver version used; it will not work on different GPU models or even different driver versions. See also [method shader_compile_spirv_from_source]. - * [param name] is an optional human-readable name that can be given to the compiled shader for organizational purposes. - */ - shader_compile_binary_from_spirv(spirv_data: RDShaderSPIRV, name: string = ''): PackedByteArray - - /** Creates a new shader instance from SPIR-V intermediate code. It can be accessed with the RID that is returned. - * Once finished with your RID, you will want to free the RID using the RenderingDevice's [method free_rid] method. See also [method shader_compile_spirv_from_source] and [method shader_create_from_bytecode]. - */ - shader_create_from_spirv(spirv_data: RDShaderSPIRV, name: string = ''): RID - - /** Creates a new shader instance from a binary compiled shader. It can be accessed with the RID that is returned. - * Once finished with your RID, you will want to free the RID using the RenderingDevice's [method free_rid] method. See also [method shader_compile_binary_from_spirv] and [method shader_create_from_spirv]. - */ - shader_create_from_bytecode(binary_data: PackedByteArray | byte[] | ArrayBuffer, placeholder_rid: RID = new RID()): RID - - /** Create a placeholder RID by allocating an RID without initializing it for use in [method shader_create_from_bytecode]. This allows you to create an RID for a shader and pass it around, but defer compiling the shader to a later time. */ - shader_create_placeholder(): RID - - /** Returns the internal vertex input mask. Internally, the vertex input mask is an unsigned integer consisting of the locations (specified in GLSL via. `layout(location = ...)`) of the input variables (specified in GLSL by the `in` keyword). */ - shader_get_vertex_input_attribute_mask(shader: RID): int64 - - /** Creates a new uniform buffer. It can be accessed with the RID that is returned. - * Once finished with your RID, you will want to free the RID using the RenderingDevice's [method free_rid] method. - */ - uniform_buffer_create(size_bytes: int64, data: PackedByteArray | byte[] | ArrayBuffer = []): RID - - /** Creates a [url=https://vkguide.dev/docs/chapter-4/storage_buffers/]storage buffer[/url] with the specified [param data] and [param usage]. It can be accessed with the RID that is returned. - * Once finished with your RID, you will want to free the RID using the RenderingDevice's [method free_rid] method. - */ - storage_buffer_create(size_bytes: int64, data: PackedByteArray | byte[] | ArrayBuffer = [], usage: RenderingDevice.StorageBufferUsage = 0): RID - - /** Creates a new texture buffer. It can be accessed with the RID that is returned. - * Once finished with your RID, you will want to free the RID using the RenderingDevice's [method free_rid] method. - */ - texture_buffer_create(size_bytes: int64, format: RenderingDevice.DataFormat, data: PackedByteArray | byte[] | ArrayBuffer = []): RID - - /** Creates a new uniform set. It can be accessed with the RID that is returned. - * Once finished with your RID, you will want to free the RID using the RenderingDevice's [method free_rid] method. - */ - uniform_set_create(uniforms: GArray, shader: RID, shader_set: int64): RID - - /** Checks if the [param uniform_set] is valid, i.e. is owned. */ - uniform_set_is_valid(uniform_set: RID): boolean - - /** Copies [param size] bytes from the [param src_buffer] at [param src_offset] into [param dst_buffer] at [param dst_offset]. - * Prints an error if: - * - [param size] exceeds the size of either [param src_buffer] or [param dst_buffer] at their corresponding offsets - * - a draw list is currently active (created by [method draw_list_begin]) - * - a compute list is currently active (created by [method compute_list_begin]) - */ - buffer_copy(src_buffer: RID, dst_buffer: RID, src_offset: int64, dst_offset: int64, size: int64): GError - - /** Updates a region of [param size_bytes] bytes, starting at [param offset], in the buffer, with the specified [param data]. - * Prints an error if: - * - the region specified by [param offset] + [param size_bytes] exceeds the buffer - * - a draw list is currently active (created by [method draw_list_begin]) - * - a compute list is currently active (created by [method compute_list_begin]) - */ - buffer_update(buffer: RID, offset: int64, size_bytes: int64, data: PackedByteArray | byte[] | ArrayBuffer): GError - - /** Clears the contents of the [param buffer], clearing [param size_bytes] bytes, starting at [param offset]. - * Prints an error if: - * - the size isn't a multiple of four - * - the region specified by [param offset] + [param size_bytes] exceeds the buffer - * - a draw list is currently active (created by [method draw_list_begin]) - * - a compute list is currently active (created by [method compute_list_begin]) - */ - buffer_clear(buffer: RID, offset: int64, size_bytes: int64): GError - - /** Returns a copy of the data of the specified [param buffer], optionally [param offset_bytes] and [param size_bytes] can be set to copy only a portion of the buffer. */ - buffer_get_data(buffer: RID, offset_bytes: int64 = 0, size_bytes: int64 = 0): PackedByteArray - - /** Creates a new render pipeline. It can be accessed with the RID that is returned. - * Once finished with your RID, you will want to free the RID using the RenderingDevice's [method free_rid] method. - */ - render_pipeline_create(shader: RID, framebuffer_format: int64, vertex_format: int64, primitive: RenderingDevice.RenderPrimitive, rasterization_state: RDPipelineRasterizationState, multisample_state: RDPipelineMultisampleState, stencil_state: RDPipelineDepthStencilState, color_blend_state: RDPipelineColorBlendState, dynamic_state_flags: RenderingDevice.PipelineDynamicStateFlags = 0, for_render_pass: int64 = 0, specialization_constants: GArray = []): RID - - /** Returns `true` if the render pipeline specified by the [param render_pipeline] RID is valid, `false` otherwise. */ - render_pipeline_is_valid(render_pipeline: RID): boolean - - /** Creates a new compute pipeline. It can be accessed with the RID that is returned. - * Once finished with your RID, you will want to free the RID using the RenderingDevice's [method free_rid] method. - */ - compute_pipeline_create(shader: RID, specialization_constants: GArray = []): RID - - /** Returns `true` if the compute pipeline specified by the [param compute_pipeline] RID is valid, `false` otherwise. */ - compute_pipeline_is_valid(compute_pipeline: RID): boolean - - /** Returns the window width matching the graphics API context for the given window ID (in pixels). Despite the parameter being named [param screen], this returns the *window* size. See also [method screen_get_height]. - * - * **Note:** Only the main [RenderingDevice] returned by [method RenderingServer.get_rendering_device] has a width. If called on a local [RenderingDevice], this method prints an error and returns [constant INVALID_ID]. - */ - screen_get_width(screen: int64 = 0): int64 - - /** Returns the window height matching the graphics API context for the given window ID (in pixels). Despite the parameter being named [param screen], this returns the *window* size. See also [method screen_get_width]. - * - * **Note:** Only the main [RenderingDevice] returned by [method RenderingServer.get_rendering_device] has a height. If called on a local [RenderingDevice], this method prints an error and returns [constant INVALID_ID]. - */ - screen_get_height(screen: int64 = 0): int64 - - /** Returns the framebuffer format of the given screen. - * - * **Note:** Only the main [RenderingDevice] returned by [method RenderingServer.get_rendering_device] has a format. If called on a local [RenderingDevice], this method prints an error and returns [constant INVALID_ID]. - */ - screen_get_framebuffer_format(screen: int64 = 0): int64 - - /** High-level variant of [method draw_list_begin], with the parameters automatically being adjusted for drawing onto the window specified by the [param screen] ID. - * - * **Note:** Cannot be used with local RenderingDevices, as these don't have a screen. If called on a local RenderingDevice, [method draw_list_begin_for_screen] returns [constant INVALID_ID]. - */ - draw_list_begin_for_screen(screen: int64 = 0, clear_color: Color = new Color(0, 0, 0, 1)): int64 - - /** Starts a list of raster drawing commands created with the `draw_*` methods. The returned value should be passed to other `draw_list_*` functions. - * Multiple draw lists cannot be created at the same time; you must finish the previous draw list first using [method draw_list_end]. - * A simple drawing operation might look like this (code is not a complete example): - * - */ - draw_list_begin(framebuffer: RID, initial_color_action: RenderingDevice.InitialAction, final_color_action: RenderingDevice.FinalAction, initial_depth_action: RenderingDevice.InitialAction, final_depth_action: RenderingDevice.FinalAction, clear_color_values: PackedColorArray | Color[] = [], clear_depth: float64 = 1, clear_stencil: int64 = 0, region: Rect2 = new Rect2(0, 0, 0, 0)): int64 - - /** This method does nothing and always returns an empty [PackedInt64Array]. */ - draw_list_begin_split(framebuffer: RID, splits: int64, initial_color_action: RenderingDevice.InitialAction, final_color_action: RenderingDevice.FinalAction, initial_depth_action: RenderingDevice.InitialAction, final_depth_action: RenderingDevice.FinalAction, clear_color_values: PackedColorArray | Color[] = [], clear_depth: float64 = 1, clear_stencil: int64 = 0, region: Rect2 = new Rect2(0, 0, 0, 0), storage_textures: GArray = []): PackedInt64Array - - /** Sets blend constants for the specified [param draw_list] to [param color]. Blend constants are used only if the graphics pipeline is created with [constant DYNAMIC_STATE_BLEND_CONSTANTS] flag set. */ - draw_list_set_blend_constants(draw_list: int64, color: Color): void - - /** Binds [param render_pipeline] to the specified [param draw_list]. */ - draw_list_bind_render_pipeline(draw_list: int64, render_pipeline: RID): void - - /** Binds [param uniform_set] to the specified [param draw_list]. A [param set_index] must also be specified, which is an identifier starting from `0` that must match the one expected by the draw list. */ - draw_list_bind_uniform_set(draw_list: int64, uniform_set: RID, set_index: int64): void - - /** Binds [param vertex_array] to the specified [param draw_list]. */ - draw_list_bind_vertex_array(draw_list: int64, vertex_array: RID): void - - /** Binds [param index_array] to the specified [param draw_list]. */ - draw_list_bind_index_array(draw_list: int64, index_array: RID): void - - /** Sets the push constant data to [param buffer] for the specified [param draw_list]. The shader determines how this binary data is used. The buffer's size in bytes must also be specified in [param size_bytes] (this can be obtained by calling the [method PackedByteArray.size] method on the passed [param buffer]). */ - draw_list_set_push_constant(draw_list: int64, buffer: PackedByteArray | byte[] | ArrayBuffer, size_bytes: int64): void - - /** Submits [param draw_list] for rendering on the GPU. This is the raster equivalent to [method compute_list_dispatch]. */ - draw_list_draw(draw_list: int64, use_indices: boolean, instances: int64, procedural_vertex_count: int64 = 0): void - - /** Creates a scissor rectangle and enables it for the specified [param draw_list]. Scissor rectangles are used for clipping by discarding fragments that fall outside a specified rectangular portion of the screen. See also [method draw_list_disable_scissor]. - * - * **Note:** The specified [param rect] is automatically intersected with the screen's dimensions, which means it cannot exceed the screen's dimensions. - */ - draw_list_enable_scissor(draw_list: int64, rect: Rect2 = new Rect2(0, 0, 0, 0)): void - - /** Removes and disables the scissor rectangle for the specified [param draw_list]. See also [method draw_list_enable_scissor]. */ - draw_list_disable_scissor(draw_list: int64): void - - /** Switches to the next draw pass. */ - draw_list_switch_to_next_pass(): int64 - - /** This method does nothing and always returns an empty [PackedInt64Array]. */ - draw_list_switch_to_next_pass_split(splits: int64): PackedInt64Array - - /** Finishes a list of raster drawing commands created with the `draw_*` methods. */ - draw_list_end(): void - - /** Starts a list of compute commands created with the `compute_*` methods. The returned value should be passed to other `compute_list_*` functions. - * Multiple compute lists cannot be created at the same time; you must finish the previous compute list first using [method compute_list_end]. - * A simple compute operation might look like this (code is not a complete example): - * - */ - compute_list_begin(): int64 - - /** Tells the GPU what compute pipeline to use when processing the compute list. If the shader has changed since the last time this function was called, Godot will unbind all descriptor sets and will re-bind them inside [method compute_list_dispatch]. */ - compute_list_bind_compute_pipeline(compute_list: int64, compute_pipeline: RID): void - - /** Sets the push constant data to [param buffer] for the specified [param compute_list]. The shader determines how this binary data is used. The buffer's size in bytes must also be specified in [param size_bytes] (this can be obtained by calling the [method PackedByteArray.size] method on the passed [param buffer]). */ - compute_list_set_push_constant(compute_list: int64, buffer: PackedByteArray | byte[] | ArrayBuffer, size_bytes: int64): void - - /** Binds the [param uniform_set] to this [param compute_list]. Godot ensures that all textures in the uniform set have the correct Vulkan access masks. If Godot had to change access masks of textures, it will raise a Vulkan image memory barrier. */ - compute_list_bind_uniform_set(compute_list: int64, uniform_set: RID, set_index: int64): void - - /** Submits the compute list for processing on the GPU. This is the compute equivalent to [method draw_list_draw]. */ - compute_list_dispatch(compute_list: int64, x_groups: int64, y_groups: int64, z_groups: int64): void - - /** Submits the compute list for processing on the GPU with the given group counts stored in the [param buffer] at [param offset]. Buffer must have been created with [constant STORAGE_BUFFER_USAGE_DISPATCH_INDIRECT] flag. */ - compute_list_dispatch_indirect(compute_list: int64, buffer: RID, offset: int64): void - - /** Raises a Vulkan compute barrier in the specified [param compute_list]. */ - compute_list_add_barrier(compute_list: int64): void - - /** Finishes a list of compute commands created with the `compute_*` methods. */ - compute_list_end(): void - - /** Tries to free an object in the RenderingDevice. To avoid memory leaks, this should be called after using an object as memory management does not occur automatically when using RenderingDevice directly. */ - free_rid(rid: RID): void - - /** Creates a timestamp marker with the specified [param name]. This is used for performance reporting with the [method get_captured_timestamp_cpu_time], [method get_captured_timestamp_gpu_time] and [method get_captured_timestamp_name] methods. */ - capture_timestamp(name: string): void - - /** Returns the total number of timestamps (rendering steps) available for profiling. */ - get_captured_timestamps_count(): int64 - - /** Returns the index of the last frame rendered that has rendering timestamps available for querying. */ - get_captured_timestamps_frame(): int64 - - /** Returns the timestamp in GPU time for the rendering step specified by [param index] (in microseconds since the engine started). See also [method get_captured_timestamp_cpu_time] and [method capture_timestamp]. */ - get_captured_timestamp_gpu_time(index: int64): int64 - - /** Returns the timestamp in CPU time for the rendering step specified by [param index] (in microseconds since the engine started). See also [method get_captured_timestamp_gpu_time] and [method capture_timestamp]. */ - get_captured_timestamp_cpu_time(index: int64): int64 - - /** Returns the timestamp's name for the rendering step specified by [param index]. See also [method capture_timestamp]. */ - get_captured_timestamp_name(index: int64): string - - /** Returns the value of the specified [param limit]. This limit varies depending on the current graphics hardware (and sometimes the driver version). If the given limit is exceeded, rendering errors will occur. - * Limits for various graphics hardware can be found in the [url=https://vulkan.gpuinfo.org/]Vulkan Hardware Database[/url]. - */ - limit_get(limit: RenderingDevice.Limit): int64 - - /** Returns the frame count kept by the graphics API. Higher values result in higher input lag, but with more consistent throughput. For the main [RenderingDevice], frames are cycled (usually 3 with triple-buffered V-Sync enabled). However, local [RenderingDevice]s only have 1 frame. */ - get_frame_delay(): int64 - - /** Pushes the frame setup and draw command buffers then marks the local device as currently processing (which allows calling [method sync]). - * - * **Note:** Only available in local RenderingDevices. - */ - submit(): void - - /** Forces a synchronization between the CPU and GPU, which may be required in certain cases. Only call this when needed, as CPU-GPU synchronization has a performance cost. - * - * **Note:** Only available in local RenderingDevices. - * - * **Note:** [method sync] can only be called after a [method submit]. - */ - sync(): void - - /** This method does nothing. */ - barrier(from: RenderingDevice.BarrierMask = 32767, to: RenderingDevice.BarrierMask = 32767): void - - /** This method does nothing. */ - full_barrier(): void - - /** Create a new local [RenderingDevice]. This is most useful for performing compute operations on the GPU independently from the rest of the engine. */ - create_local_device(): RenderingDevice - - /** Sets the resource name for [param id] to [param name]. This is used for debugging with third-party tools such as [url=https://renderdoc.org/]RenderDoc[/url]. - * The following types of resources can be named: texture, sampler, vertex buffer, index buffer, uniform buffer, texture buffer, storage buffer, uniform set buffer, shader, render pipeline and compute pipeline. Framebuffers cannot be named. Attempting to name an incompatible resource type will print an error. - * - * **Note:** Resource names are only set when the engine runs in verbose mode ([method OS.is_stdout_verbose] = `true`), or when using an engine build compiled with the `dev_mode=yes` SCons option. The graphics driver must also support the `VK_EXT_DEBUG_UTILS_EXTENSION_NAME` Vulkan extension for named resources to work. - */ - set_resource_name(id: RID, name: string): void - - /** Create a command buffer debug label region that can be displayed in third-party tools such as [url=https://renderdoc.org/]RenderDoc[/url]. All regions must be ended with a [method draw_command_end_label] call. When viewed from the linear series of submissions to a single queue, calls to [method draw_command_begin_label] and [method draw_command_end_label] must be matched and balanced. - * The `VK_EXT_DEBUG_UTILS_EXTENSION_NAME` Vulkan extension must be available and enabled for command buffer debug label region to work. See also [method draw_command_end_label]. - */ - draw_command_begin_label(name: string, color: Color): void - - /** This method does nothing. */ - draw_command_insert_label(name: string, color: Color): void - - /** Ends the command buffer debug label region started by a [method draw_command_begin_label] call. */ - draw_command_end_label(): void - - /** Returns the vendor of the video adapter (e.g. "NVIDIA Corporation"). Equivalent to [method RenderingServer.get_video_adapter_vendor]. See also [method get_device_name]. */ - get_device_vendor_name(): string - - /** Returns the name of the video adapter (e.g. "GeForce GTX 1080/PCIe/SSE2"). Equivalent to [method RenderingServer.get_video_adapter_name]. See also [method get_device_vendor_name]. */ - get_device_name(): string - - /** Returns the universally unique identifier for the pipeline cache. This is used to cache shader files on disk, which avoids shader recompilations on subsequent engine runs. This UUID varies depending on the graphics card model, but also the driver version. Therefore, updating graphics drivers will invalidate the shader cache. */ - get_device_pipeline_cache_uuid(): string - - /** Returns the memory usage in bytes corresponding to the given [param type]. When using Vulkan, these statistics are calculated by [url=https://github.com/GPUOpen-LibrariesAndSDKs/VulkanMemoryAllocator]Vulkan Memory Allocator[/url]. */ - get_memory_usage(type: RenderingDevice.MemoryType): int64 - - /** Returns the unique identifier of the driver [param resource] for the specified [param rid]. Some driver resource types ignore the specified [param rid] (see [enum DriverResource] descriptions). [param index] is always ignored but must be specified anyway. */ - get_driver_resource(resource: RenderingDevice.DriverResource, rid: RID, index: int64): int64 - } } diff --git a/typings/godot5.gen.d.ts b/typings/godot5.gen.d.ts index 4d10048..10cd589 100644 --- a/typings/godot5.gen.d.ts +++ b/typings/godot5.gen.d.ts @@ -1,34 +1,8319 @@ // AUTO-GENERATED /// declare module "godot" { - class ReparentDialog extends ConfirmationDialog { + /** Draws a stereo correct visibility mask. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_openxrvisibilitymask.html + */ + class OpenXRVisibilityMask = Record> extends VisualInstance3D { + constructor(identifier?: any) + } + /** An optimized translation, used by default for CSV Translations. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_optimizedtranslation.html + */ + class OptimizedTranslation extends Translation { + constructor(identifier?: any) + /** Generates and sets an optimized translation from the given [Translation] resource. + * + * **Note:** This method is intended to be used in the editor. It does nothing when called from an exported project. + */ + generate(from: Translation): void + } + /** A button that brings up a dropdown with selectable options when pressed. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_optionbutton.html + */ + class OptionButton = Record> extends Button { + constructor(identifier?: any) + /** Adds an item, with text [param label] and (optionally) [param id]. If no [param id] is passed, the item index will be used as the item's ID. New items are appended at the end. */ + add_item(label: string, id: int64 = -1): void + + /** Adds an item, with a [param texture] icon, text [param label] and (optionally) [param id]. If no [param id] is passed, the item index will be used as the item's ID. New items are appended at the end. */ + add_icon_item(texture: Texture2D, label: string, id: int64 = -1): void + + /** Sets the text of the item at index [param idx]. */ + set_item_text(idx: int64, text: string): void + + /** Sets the icon of the item at index [param idx]. */ + set_item_icon(idx: int64, texture: Texture2D): void + + /** Sets whether the item at index [param idx] is disabled. + * Disabled items are drawn differently in the dropdown and are not selectable by the user. If the current selected item is set as disabled, it will remain selected. + */ + set_item_disabled(idx: int64, disabled: boolean): void + + /** Sets the ID of the item at index [param idx]. */ + set_item_id(idx: int64, id: int64): void + + /** Sets the metadata of an item. Metadata may be of any type and can be used to store extra information about an item, such as an external string ID. */ + set_item_metadata(idx: int64, metadata: any): void + + /** Sets the tooltip of the item at index [param idx]. */ + set_item_tooltip(idx: int64, tooltip: string): void + + /** Returns the text of the item at index [param idx]. */ + get_item_text(idx: int64): string + + /** Returns the icon of the item at index [param idx]. */ + get_item_icon(idx: int64): Texture2D + + /** Returns the ID of the item at index [param idx]. */ + get_item_id(idx: int64): int64 + + /** Returns the index of the item with the given [param id]. */ + get_item_index(id: int64): int64 + + /** Retrieves the metadata of an item. Metadata may be any type and can be used to store extra information about an item, such as an external string ID. */ + get_item_metadata(idx: int64): any + + /** Returns the tooltip of the item at index [param idx]. */ + get_item_tooltip(idx: int64): string + + /** Returns `true` if the item at index [param idx] is disabled. */ + is_item_disabled(idx: int64): boolean + + /** Returns `true` if the item at index [param idx] is marked as a separator. */ + is_item_separator(idx: int64): boolean + + /** Adds a separator to the list of items. Separators help to group items, and can optionally be given a [param text] header. A separator also gets an index assigned, and is appended at the end of the item list. */ + add_separator(text: string = ''): void + + /** Clears all the items in the [OptionButton]. */ + clear(): void + + /** Selects an item by index and makes it the current item. This will work even if the item is disabled. + * Passing `-1` as the index deselects any currently selected item. + */ + select(idx: int64): void + + /** Returns the ID of the selected item, or `-1` if no item is selected. */ + get_selected_id(): int64 + + /** Gets the metadata of the selected item. Metadata for items can be set using [method set_item_metadata]. */ + get_selected_metadata(): any + + /** Removes the item at index [param idx]. */ + remove_item(idx: int64): void + + /** Returns the [PopupMenu] contained in this button. + * **Warning:** This is a required internal node, removing and freeing it may cause a crash. If you wish to hide it or any of its children, use their [member Window.visible] property. + */ + get_popup(): PopupMenu + + /** Adjusts popup position and sizing for the [OptionButton], then shows the [PopupMenu]. Prefer this over using `get_popup().popup()`. */ + show_popup(): void + + /** Returns `true` if this button contains at least one item which is not disabled, or marked as a separator. */ + has_selectable_items(): boolean + + /** Returns the index of the first item which is not disabled, or marked as a separator. If [param from_last] is `true`, the items will be searched in reverse order. + * Returns `-1` if no item is found. + */ + get_selectable_item(from_last: boolean = false): int64 + + /** If `true`, shortcuts are disabled and cannot be used to trigger the button. */ + set_disable_shortcuts(disabled: boolean): void + + /** The index of the currently selected item, or `-1` if no item is selected. */ + get selected(): int64 + set selected(value: int64) + + /** If `true`, minimum size will be determined by the longest item's text, instead of the currently selected one's. + * + * **Note:** For performance reasons, the minimum size doesn't update immediately when adding, removing or modifying items. + */ + get fit_to_longest_item(): boolean + set fit_to_longest_item(value: boolean) + + /** If `true`, the currently selected item can be selected again. */ + get allow_reselect(): boolean + set allow_reselect(value: boolean) + + /** The number of items to select from. */ + get item_count(): any /*Items,popup/item_*/ + set item_count(value: any /*Items,popup/item_*/) + + /** Emitted when the current item has been changed by the user. The index of the item selected is passed as argument. + * [member allow_reselect] must be enabled to reselect an item. + */ + readonly item_selected: Signal1 + + /** Emitted when the user navigates to an item using the [member ProjectSettings.input/ui_up] or [member ProjectSettings.input/ui_down] input actions. The index of the item selected is passed as argument. */ + readonly item_focused: Signal1 + } + class OrphanResourcesDialog = Record> extends ConfirmationDialog { + constructor(identifier?: any) + } + /** Creates packages that can be loaded into a running project. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_pckpacker.html + */ + class PCKPacker extends RefCounted { + constructor(identifier?: any) + /** Creates a new PCK file at the file path [param pck_path]. The `.pck` file extension isn't added automatically, so it should be part of [param pck_path] (even though it's not required). */ + pck_start(pck_path: string, alignment: int64 = 32, key: string = '0000000000000000000000000000000000000000000000000000000000000000', encrypt_directory: boolean = false): GError + + /** Adds the [param source_path] file to the current PCK package at the [param target_path] internal path. The `res://` prefix for [param target_path] is optional and stripped internally. */ + add_file(target_path: string, source_path: string, encrypt: boolean = false): GError + + /** Registers a file removal of the [param target_path] internal path to the PCK. This is mainly used for patches. If the file at this path has been loaded from a previous PCK, it will be removed. The `res://` prefix for [param target_path] is optional and stripped internally. */ + add_file_removal(target_path: string): GError + + /** Writes the files specified using all [method add_file] calls since the last flush. If [param verbose] is `true`, a list of files added will be printed to the console for easier debugging. */ + flush(verbose: boolean = false): GError + } + /** Efficiently packs and serializes [Array] or [Dictionary]. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_packeddatacontainer.html + */ + class PackedDataContainer extends Resource { + constructor(identifier?: any) + _iter_init(_unnamed_arg0: GArray): any + _iter_get(_unnamed_arg0: any): any + _iter_next(_unnamed_arg0: GArray): any + + /** Packs the given container into a binary representation. The [param value] must be either [Array] or [Dictionary], any other type will result in invalid data error. + * + * **Note:** Subsequent calls to this method will overwrite the existing data. + */ + pack(value: any): GError + + /** Returns the size of the packed container (see [method Array.size] and [method Dictionary.size]). */ + size(): int64 + get __data__(): PackedByteArray + set __data__(value: PackedByteArray | byte[] | ArrayBuffer) + } + /** An internal class used by [PackedDataContainer] to pack nested arrays and dictionaries. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_packeddatacontainerref.html + */ + class PackedDataContainerRef extends RefCounted { + constructor(identifier?: any) + /** Returns the size of the packed container (see [method Array.size] and [method Dictionary.size]). */ + size(): int64 + _iter_init(_unnamed_arg0: GArray): any + _iter_get(_unnamed_arg0: any): any + _iter_next(_unnamed_arg0: GArray): any + } + namespace PackedScene { + enum GenEditState { + /** If passed to [method instantiate], blocks edits to the scene state. */ + GEN_EDIT_STATE_DISABLED = 0, + + /** If passed to [method instantiate], provides local scene resources to the local scene. + * + * **Note:** Only available in editor builds. + */ + GEN_EDIT_STATE_INSTANCE = 1, + + /** If passed to [method instantiate], provides local scene resources to the local scene. Only the main scene should receive the main edit state. + * + * **Note:** Only available in editor builds. + */ + GEN_EDIT_STATE_MAIN = 2, + + /** It's similar to [constant GEN_EDIT_STATE_MAIN], but for the case where the scene is being instantiated to be the base of another one. + * + * **Note:** Only available in editor builds. + */ + GEN_EDIT_STATE_MAIN_INHERITED = 3, + } + } + /** An abstraction of a serialized scene. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_packedscene.html + */ + class PackedScene extends Resource { + constructor(identifier?: any) + /** Packs the [param path] node, and all owned sub-nodes, into this [PackedScene]. Any existing data will be cleared. See [member Node.owner]. */ + pack(path: Node): GError + + /** Instantiates the scene's node hierarchy. Triggers child scene instantiation(s). Triggers a [constant Node.NOTIFICATION_SCENE_INSTANTIATED] notification on the root node. */ + instantiate(edit_state: PackedScene.GenEditState = 0): Node + + /** Returns `true` if the scene file has nodes. */ + can_instantiate(): boolean + + /** Returns the [SceneState] representing the scene file contents. */ + get_state(): SceneState + get _bundled(): GDictionary + set _bundled(value: GDictionary) + } + class PackedSceneEditorPlugin = Record> extends EditorPlugin { + constructor(identifier?: any) + } + class PackedSceneEditorTranslationParserPlugin extends EditorTranslationParserPlugin { + constructor(identifier?: any) + } + /** Abstraction and base class for packet-based protocols. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_packetpeer.html + */ + class PacketPeer extends RefCounted { + constructor(identifier?: any) + /** Gets a Variant. If [param allow_objects] is `true`, decoding objects is allowed. + * Internally, this uses the same decoding mechanism as the [method @GlobalScope.bytes_to_var] method. + * **Warning:** Deserialized objects can contain code which gets executed. Do not use this option if the serialized object comes from untrusted sources to avoid potential security threats such as remote code execution. + */ + get_var(allow_objects: boolean = false): any + + /** Sends a [Variant] as a packet. If [param full_objects] is `true`, encoding objects is allowed (and can potentially include code). + * Internally, this uses the same encoding mechanism as the [method @GlobalScope.var_to_bytes] method. + */ + put_var(var_: any, full_objects: boolean = false): GError + + /** Gets a raw packet. */ + get_packet(): PackedByteArray + + /** Sends a raw packet. */ + put_packet(buffer: PackedByteArray | byte[] | ArrayBuffer): GError + + /** Returns the error state of the last packet received (via [method get_packet] and [method get_var]). */ + get_packet_error(): GError + + /** Returns the number of packets currently available in the ring-buffer. */ + get_available_packet_count(): int64 + + /** Maximum buffer size allowed when encoding [Variant]s. Raise this value to support heavier memory allocations. + * The [method put_var] method allocates memory on the stack, and the buffer used will grow automatically to the closest power of two to match the size of the [Variant]. If the [Variant] is bigger than [member encode_buffer_max_size], the method will error out with [constant ERR_OUT_OF_MEMORY]. + */ + get encode_buffer_max_size(): int64 + set encode_buffer_max_size(value: int64) + } + namespace PacketPeerDTLS { + enum Status { + /** A status representing a [PacketPeerDTLS] that is disconnected. */ + STATUS_DISCONNECTED = 0, + + /** A status representing a [PacketPeerDTLS] that is currently performing the handshake with a remote peer. */ + STATUS_HANDSHAKING = 1, + + /** A status representing a [PacketPeerDTLS] that is connected to a remote peer. */ + STATUS_CONNECTED = 2, + + /** A status representing a [PacketPeerDTLS] in a generic error state. */ + STATUS_ERROR = 3, + + /** An error status that shows a mismatch in the DTLS certificate domain presented by the host and the domain requested for validation. */ + STATUS_ERROR_HOSTNAME_MISMATCH = 4, + } + } + /** DTLS packet peer. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_packetpeerdtls.html + */ + class PacketPeerDTLS extends PacketPeer { + constructor(identifier?: any) + /** Poll the connection to check for incoming packets. Call this frequently to update the status and keep the connection working. */ + poll(): void + + /** Connects a [param packet_peer] beginning the DTLS handshake using the underlying [PacketPeerUDP] which must be connected (see [method PacketPeerUDP.connect_to_host]). You can optionally specify the [param client_options] to be used while verifying the TLS connections. See [method TLSOptions.client] and [method TLSOptions.client_unsafe]. */ + connect_to_peer(packet_peer: PacketPeerUDP, hostname: string, client_options: TLSOptions = undefined): GError + + /** Returns the status of the connection. See [enum Status] for values. */ + get_status(): PacketPeerDTLS.Status + + /** Disconnects this peer, terminating the DTLS session. */ + disconnect_from_peer(): void + } + /** @link https://docs.godotengine.org/en/4.4/classes/class_packetpeerextension.html */ + class PacketPeerExtension extends PacketPeer { + constructor(identifier?: any) + /* gdvirtual */ _get_packet(r_buffer: int64, r_buffer_size: int64): GError + /* gdvirtual */ _put_packet(p_buffer: int64, p_buffer_size: int64): GError + /* gdvirtual */ _get_available_packet_count(): int64 + /* gdvirtual */ _get_max_packet_size(): int64 + } + /** Wrapper to use a PacketPeer over a StreamPeer. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_packetpeerstream.html + */ + class PacketPeerStream extends PacketPeer { + constructor(identifier?: any) + get input_buffer_max_size(): int64 + set input_buffer_max_size(value: int64) + get output_buffer_max_size(): int64 + set output_buffer_max_size(value: int64) + + /** The wrapped [StreamPeer] object. */ + get stream_peer(): StreamPeer + set stream_peer(value: StreamPeer) + } + /** UDP packet peer. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_packetpeerudp.html + */ + class PacketPeerUDP extends PacketPeer { + constructor(identifier?: any) + /** Binds this [PacketPeerUDP] to the specified [param port] and [param bind_address] with a buffer size [param recv_buf_size], allowing it to receive incoming packets. + * If [param bind_address] is set to `"*"` (default), the peer will be bound on all available addresses (both IPv4 and IPv6). + * If [param bind_address] is set to `"0.0.0.0"` (for IPv4) or `"::"` (for IPv6), the peer will be bound to all available addresses matching that IP type. + * If [param bind_address] is set to any valid address (e.g. `"192.168.1.101"`, `"::1"`, etc.), the peer will only be bound to the interface with that address (or fail if no interface with the given address exists). + */ + bind(port: int64, bind_address: string = '*', recv_buf_size: int64 = 65536): GError + + /** Closes the [PacketPeerUDP]'s underlying UDP socket. */ + close(): void + + /** Waits for a packet to arrive on the bound address. See [method bind]. + * + * **Note:** [method wait] can't be interrupted once it has been called. This can be worked around by allowing the other party to send a specific "death pill" packet like this: + * + */ + wait(): GError + + /** Returns whether this [PacketPeerUDP] is bound to an address and can receive packets. */ + is_bound(): boolean + + /** Calling this method connects this UDP peer to the given [param host]/[param port] pair. UDP is in reality connectionless, so this option only means that incoming packets from different addresses are automatically discarded, and that outgoing packets are always sent to the connected address (future calls to [method set_dest_address] are not allowed). This method does not send any data to the remote peer, to do that, use [method PacketPeer.put_var] or [method PacketPeer.put_packet] as usual. See also [UDPServer]. + * + * **Note:** Connecting to the remote peer does not help to protect from malicious attacks like IP spoofing, etc. Think about using an encryption technique like TLS or DTLS if you feel like your application is transferring sensitive information. + */ + connect_to_host(host: string, port: int64): GError + + /** Returns `true` if the UDP socket is open and has been connected to a remote address. See [method connect_to_host]. */ + is_socket_connected(): boolean + + /** Returns the IP of the remote peer that sent the last packet(that was received with [method PacketPeer.get_packet] or [method PacketPeer.get_var]). */ + get_packet_ip(): string + + /** Returns the port of the remote peer that sent the last packet(that was received with [method PacketPeer.get_packet] or [method PacketPeer.get_var]). */ + get_packet_port(): int64 + + /** Returns the local port to which this peer is bound. */ + get_local_port(): int64 + + /** Sets the destination address and port for sending packets and variables. A hostname will be resolved using DNS if needed. + * + * **Note:** [method set_broadcast_enabled] must be enabled before sending packets to a broadcast address (e.g. `255.255.255.255`). + */ + set_dest_address(host: string, port: int64): GError + + /** Enable or disable sending of broadcast packets (e.g. `set_dest_address("255.255.255.255", 4343)`. This option is disabled by default. + * + * **Note:** Some Android devices might require the `CHANGE_WIFI_MULTICAST_STATE` permission and this option to be enabled to receive broadcast packets too. + */ + set_broadcast_enabled(enabled: boolean): void + + /** Joins the multicast group specified by [param multicast_address] using the interface identified by [param interface_name]. + * You can join the same multicast group with multiple interfaces. Use [method IP.get_local_interfaces] to know which are available. + * + * **Note:** Some Android devices might require the `CHANGE_WIFI_MULTICAST_STATE` permission for multicast to work. + */ + join_multicast_group(multicast_address: string, interface_name: string): GError + + /** Removes the interface identified by [param interface_name] from the multicast group specified by [param multicast_address]. */ + leave_multicast_group(multicast_address: string, interface_name: string): GError + } + /** A GUI control that displays a [StyleBox]. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_panel.html + */ + class Panel = Record> extends Control { + constructor(identifier?: any) + } + /** A container that keeps its child controls within the area of a [StyleBox]. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_panelcontainer.html + */ + class PanelContainer = Record> extends Container { + constructor(identifier?: any) + } + /** A material that provides a special texture to a [Sky], usually an HDR panorama. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_panoramaskymaterial.html + */ + class PanoramaSkyMaterial extends Material { + constructor(identifier?: any) + /** [Texture2D] to be applied to the [PanoramaSkyMaterial]. */ + get panorama(): Texture2D + set panorama(value: Texture2D) + + /** A boolean value to determine if the background texture should be filtered or not. */ + get filter(): boolean + set filter(value: boolean) + + /** The sky's overall brightness multiplier. Higher values result in a brighter sky. */ + get energy_multiplier(): float64 + set energy_multiplier(value: float64) + } + class PanoramaSkyMaterialConversionPlugin extends EditorResourceConversionPlugin { + constructor(identifier?: any) + } + /** A node used to create a parallax scrolling background. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_parallax2d.html + */ + class Parallax2D = Record> extends Node2D { + constructor(identifier?: any) + _camera_moved(transform: Transform2D, screen_offset: Vector2, adj_screen_offset: Vector2): void + + /** Multiplier to the final [Parallax2D]'s offset. Can be used to simulate distance from the camera. + * For example, a value of `1` scrolls at the same speed as the camera. A value greater than `1` scrolls faster, making objects appear closer. Less than `1` scrolls slower, making objects appear further, and a value of `0` stops the objects completely. + */ + get scroll_scale(): Vector2 + set scroll_scale(value: Vector2) + + /** The [Parallax2D]'s offset. Similar to [member screen_offset] and [member Node2D.position], but will not be overridden. + * + * **Note:** Values will loop if [member repeat_size] is set higher than `0`. + */ + get scroll_offset(): Vector2 + set scroll_offset(value: Vector2) + + /** Repeats the [Texture2D] of each of this node's children and offsets them by this value. When scrolling, the node's position loops, giving the illusion of an infinite scrolling background if the values are larger than the screen size. If an axis is set to `0`, the [Texture2D] will not be repeated. */ + get repeat_size(): Vector2 + set repeat_size(value: Vector2) + + /** Velocity at which the offset scrolls automatically, in pixels per second. */ + get autoscroll(): Vector2 + set autoscroll(value: Vector2) + + /** Overrides the amount of times the texture repeats. Each texture copy spreads evenly from the original by [member repeat_size]. Useful for when zooming out with a camera. */ + get repeat_times(): int64 + set repeat_times(value: int64) + + /** Top-left limits for scrolling to begin. If the camera is outside of this limit, the [Parallax2D] stops scrolling. Must be lower than [member limit_end] minus the viewport size to work. */ + get limit_begin(): Vector2 + set limit_begin(value: Vector2) + + /** Bottom-right limits for scrolling to end. If the camera is outside of this limit, the [Parallax2D] will stop scrolling. Must be higher than [member limit_begin] and the viewport size combined to work. */ + get limit_end(): Vector2 + set limit_end(value: Vector2) + + /** If `true`, this [Parallax2D] is offset by the current camera's position. If the [Parallax2D] is in a [CanvasLayer] separate from the current camera, it may be desired to match the value with [member CanvasLayer.follow_viewport_enabled]. */ + get follow_viewport(): boolean + set follow_viewport(value: boolean) + + /** If `true`, [Parallax2D]'s position is not affected by the position of the camera. */ + get ignore_camera_scroll(): boolean + set ignore_camera_scroll(value: boolean) + + /** Offset used to scroll this [Parallax2D]. This value is updated automatically unless [member ignore_camera_scroll] is `true`. */ + get screen_offset(): Vector2 + set screen_offset(value: Vector2) + } + /** A node used to create a parallax scrolling background. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_parallaxbackground.html + */ + class ParallaxBackground = Record> extends CanvasLayer { + constructor(identifier?: any) + _camera_moved(_unnamed_arg0: Transform2D, _unnamed_arg1: Vector2, _unnamed_arg2: Vector2): void + + /** The ParallaxBackground's scroll value. Calculated automatically when using a [Camera2D], but can be used to manually manage scrolling when no camera is present. */ + get scroll_offset(): Vector2 + set scroll_offset(value: Vector2) + + /** The base position offset for all [ParallaxLayer] children. */ + get scroll_base_offset(): Vector2 + set scroll_base_offset(value: Vector2) + + /** The base motion scale for all [ParallaxLayer] children. */ + get scroll_base_scale(): Vector2 + set scroll_base_scale(value: Vector2) + + /** Top-left limits for scrolling to begin. If the camera is outside of this limit, the background will stop scrolling. Must be lower than [member scroll_limit_end] to work. */ + get scroll_limit_begin(): Vector2 + set scroll_limit_begin(value: Vector2) + + /** Bottom-right limits for scrolling to end. If the camera is outside of this limit, the background will stop scrolling. Must be higher than [member scroll_limit_begin] to work. */ + get scroll_limit_end(): Vector2 + set scroll_limit_end(value: Vector2) + + /** If `true`, elements in [ParallaxLayer] child aren't affected by the zoom level of the camera. */ + get scroll_ignore_camera_zoom(): boolean + set scroll_ignore_camera_zoom(value: boolean) + } + class ParallaxBackgroundEditorPlugin = Record> extends EditorPlugin { + constructor(identifier?: any) + } + /** A parallax scrolling layer to be used with [ParallaxBackground]. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_parallaxlayer.html + */ + class ParallaxLayer = Record> extends Node2D { + constructor(identifier?: any) + /** Multiplies the ParallaxLayer's motion. If an axis is set to `0`, it will not scroll. */ + get motion_scale(): Vector2 + set motion_scale(value: Vector2) + + /** The ParallaxLayer's offset relative to the parent ParallaxBackground's [member ParallaxBackground.scroll_offset]. */ + get motion_offset(): Vector2 + set motion_offset(value: Vector2) + + /** The interval, in pixels, at which the [ParallaxLayer] is drawn repeatedly. Useful for creating an infinitely scrolling background. If an axis is set to `0`, the [ParallaxLayer] will be drawn only once along that direction. + * + * **Note:** If you want the repetition to pixel-perfect match a [Texture2D] displayed by a child node, you should account for any scale applied to the texture when defining this interval. For example, if you use a child [Sprite2D] scaled to `0.5` to display a 600x600 texture, and want this sprite to be repeated continuously horizontally, you should set the mirroring to `Vector2(300, 0)`. + * + * **Note:** If the length of the viewport axis is bigger than twice the repeated axis size, it will not repeat infinitely, as the parallax layer only draws 2 instances of the layer at any given time. The visibility window is calculated from the parent [ParallaxBackground]'s position, not the layer's own position. So, if you use mirroring, **do not** change the [ParallaxLayer] position relative to its parent. Instead, if you need to adjust the background's position, set the [member CanvasLayer.offset] property in the parent [ParallaxBackground]. + * + * **Note:** Despite the name, the layer will not be mirrored, it will only be repeated. + */ + get motion_mirroring(): Vector2 + set motion_mirroring(value: Vector2) + } + namespace ParticleProcessMaterial { + enum Parameter { + /** Use with [method set_param_min], [method set_param_max], and [method set_param_texture] to set initial velocity properties. */ + PARAM_INITIAL_LINEAR_VELOCITY = 0, + + /** Use with [method set_param_min], [method set_param_max], and [method set_param_texture] to set angular velocity properties. */ + PARAM_ANGULAR_VELOCITY = 1, + + /** Use with [method set_param_min], [method set_param_max], and [method set_param_texture] to set orbital velocity properties. */ + PARAM_ORBIT_VELOCITY = 2, + + /** Use with [method set_param_min], [method set_param_max], and [method set_param_texture] to set linear acceleration properties. */ + PARAM_LINEAR_ACCEL = 3, + + /** Use with [method set_param_min], [method set_param_max], and [method set_param_texture] to set radial acceleration properties. */ + PARAM_RADIAL_ACCEL = 4, + + /** Use with [method set_param_min], [method set_param_max], and [method set_param_texture] to set tangential acceleration properties. */ + PARAM_TANGENTIAL_ACCEL = 5, + + /** Use with [method set_param_min], [method set_param_max], and [method set_param_texture] to set damping properties. */ + PARAM_DAMPING = 6, + + /** Use with [method set_param_min], [method set_param_max], and [method set_param_texture] to set angle properties. */ + PARAM_ANGLE = 7, + + /** Use with [method set_param_min], [method set_param_max], and [method set_param_texture] to set scale properties. */ + PARAM_SCALE = 8, + + /** Use with [method set_param_min], [method set_param_max], and [method set_param_texture] to set hue variation properties. */ + PARAM_HUE_VARIATION = 9, + + /** Use with [method set_param_min], [method set_param_max], and [method set_param_texture] to set animation speed properties. */ + PARAM_ANIM_SPEED = 10, + + /** Use with [method set_param_min], [method set_param_max], and [method set_param_texture] to set animation offset properties. */ + PARAM_ANIM_OFFSET = 11, + + /** Use with [method set_param_min], [method set_param_max], and [method set_param_texture] to set radial velocity properties. */ + PARAM_RADIAL_VELOCITY = 15, + + /** Use with [method set_param_min], [method set_param_max], and [method set_param_texture] to set directional velocity properties. */ + PARAM_DIRECTIONAL_VELOCITY = 16, + + /** Use with [method set_param_min], [method set_param_max], and [method set_param_texture] to set scale over velocity properties. */ + PARAM_SCALE_OVER_VELOCITY = 17, + + /** Represents the size of the [enum Parameter] enum. */ + PARAM_MAX = 18, + + /** Use with [method set_param_min] and [method set_param_max] to set the turbulence minimum und maximum influence on each particles velocity. */ + PARAM_TURB_VEL_INFLUENCE = 13, + + /** Use with [method set_param_min] and [method set_param_max] to set the turbulence minimum and maximum displacement of the particles spawn position. */ + PARAM_TURB_INIT_DISPLACEMENT = 14, + + /** Use with [method set_param_texture] to set the turbulence influence over the particles life time. */ + PARAM_TURB_INFLUENCE_OVER_LIFE = 12, + } + enum ParticleFlags { + /** Use with [method set_particle_flag] to set [member particle_flag_align_y]. */ + PARTICLE_FLAG_ALIGN_Y_TO_VELOCITY = 0, + + /** Use with [method set_particle_flag] to set [member particle_flag_rotate_y]. */ + PARTICLE_FLAG_ROTATE_Y = 1, + + /** Use with [method set_particle_flag] to set [member particle_flag_disable_z]. */ + PARTICLE_FLAG_DISABLE_Z = 2, + PARTICLE_FLAG_DAMPING_AS_FRICTION = 3, + + /** Represents the size of the [enum ParticleFlags] enum. */ + PARTICLE_FLAG_MAX = 4, + } + enum EmissionShape { + /** All particles will be emitted from a single point. */ + EMISSION_SHAPE_POINT = 0, + + /** Particles will be emitted in the volume of a sphere. */ + EMISSION_SHAPE_SPHERE = 1, + + /** Particles will be emitted on the surface of a sphere. */ + EMISSION_SHAPE_SPHERE_SURFACE = 2, + + /** Particles will be emitted in the volume of a box. */ + EMISSION_SHAPE_BOX = 3, + + /** Particles will be emitted at a position determined by sampling a random point on the [member emission_point_texture]. Particle color will be modulated by [member emission_color_texture]. */ + EMISSION_SHAPE_POINTS = 4, + + /** Particles will be emitted at a position determined by sampling a random point on the [member emission_point_texture]. Particle velocity and rotation will be set based on [member emission_normal_texture]. Particle color will be modulated by [member emission_color_texture]. */ + EMISSION_SHAPE_DIRECTED_POINTS = 5, + + /** Particles will be emitted in a ring or cylinder. */ + EMISSION_SHAPE_RING = 6, + + /** Represents the size of the [enum EmissionShape] enum. */ + EMISSION_SHAPE_MAX = 7, + } + enum SubEmitterMode { + SUB_EMITTER_DISABLED = 0, + SUB_EMITTER_CONSTANT = 1, + SUB_EMITTER_AT_END = 2, + SUB_EMITTER_AT_COLLISION = 3, + SUB_EMITTER_AT_START = 4, + + /** Represents the size of the [enum SubEmitterMode] enum. */ + SUB_EMITTER_MAX = 5, + } + enum CollisionMode { + /** No collision for particles. Particles will go through [GPUParticlesCollision3D] nodes. */ + COLLISION_DISABLED = 0, + + /** [RigidBody3D]-style collision for particles using [GPUParticlesCollision3D] nodes. */ + COLLISION_RIGID = 1, + + /** Hide particles instantly when colliding with a [GPUParticlesCollision3D] node. This can be combined with a subemitter that uses the [constant COLLISION_RIGID] collision mode to "replace" the parent particle with the subemitter on impact. */ + COLLISION_HIDE_ON_CONTACT = 2, + + /** Represents the size of the [enum CollisionMode] enum. */ + COLLISION_MAX = 3, + } + } + /** Holds a particle configuration for [GPUParticles2D] or [GPUParticles3D] nodes. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_particleprocessmaterial.html + */ + class ParticleProcessMaterial extends Material { + constructor(identifier?: any) + /** Sets the minimum and maximum values of the given [param param]. + * The `x` component of the argument vector corresponds to minimum and the `y` component corresponds to maximum. + */ + set_param(param: ParticleProcessMaterial.Parameter, value: Vector2): void + + /** Returns the minimum and maximum values of the given [param param] as a vector. + * The `x` component of the returned vector corresponds to minimum and the `y` component corresponds to maximum. + */ + get_param(param: ParticleProcessMaterial.Parameter): Vector2 + + /** Sets the minimum value range for the given parameter. */ + set_param_min(param: ParticleProcessMaterial.Parameter, value: float64): void + + /** Returns the minimum value range for the given parameter. */ + get_param_min(param: ParticleProcessMaterial.Parameter): float64 + + /** Sets the maximum value range for the given parameter. */ + set_param_max(param: ParticleProcessMaterial.Parameter, value: float64): void + + /** Returns the maximum value range for the given parameter. */ + get_param_max(param: ParticleProcessMaterial.Parameter): float64 + + /** Sets the [Texture2D] for the specified [enum Parameter]. */ + set_param_texture(param: ParticleProcessMaterial.Parameter, texture: Texture2D): void + + /** Returns the [Texture2D] used by the specified parameter. */ + get_param_texture(param: ParticleProcessMaterial.Parameter): Texture2D + + /** If `true`, enables the specified particle flag. See [enum ParticleFlags] for options. */ + set_particle_flag(particle_flag: ParticleProcessMaterial.ParticleFlags, enable: boolean): void + + /** Returns `true` if the specified particle flag is enabled. See [enum ParticleFlags] for options. */ + get_particle_flag(particle_flag: ParticleProcessMaterial.ParticleFlags): boolean + + /** Particle lifetime randomness ratio. The equation for the lifetime of a particle is `lifetime * (1.0 - randf() * lifetime_randomness)`. For example, a [member lifetime_randomness] of `0.4` scales the lifetime between `0.6` to `1.0` of its original value. */ + get lifetime_randomness(): float64 + set lifetime_randomness(value: float64) + + /** Align Y axis of particle with the direction of its velocity. */ + get particle_flag_align_y(): boolean + set particle_flag_align_y(value: boolean) + + /** If `true`, particles rotate around Y axis by [member angle_min]. */ + get particle_flag_rotate_y(): boolean + set particle_flag_rotate_y(value: boolean) + + /** If `true`, particles will not move on the z axis. */ + get particle_flag_disable_z(): boolean + set particle_flag_disable_z(value: boolean) + + /** Changes the behavior of the damping properties from a linear deceleration to a deceleration based on speed percentage. */ + get particle_flag_damping_as_friction(): boolean + set particle_flag_damping_as_friction(value: boolean) + + /** The offset for the [member emission_shape], in local space. */ + get emission_shape_offset(): Vector3 + set emission_shape_offset(value: Vector3) + + /** The scale of the [member emission_shape], in local space. */ + get emission_shape_scale(): Vector3 + set emission_shape_scale(value: Vector3) + + /** Particles will be emitted inside this region. Use [enum EmissionShape] constants for values. */ + get emission_shape(): int64 + set emission_shape(value: int64) + + /** The sphere's radius if [member emission_shape] is set to [constant EMISSION_SHAPE_SPHERE]. */ + get emission_sphere_radius(): float64 + set emission_sphere_radius(value: float64) + + /** The box's extents if [member emission_shape] is set to [constant EMISSION_SHAPE_BOX]. + * + * **Note:** [member emission_box_extents] starts from the center point and applies the X, Y, and Z values in both directions. The size is twice the area of the extents. + */ + get emission_box_extents(): Vector3 + set emission_box_extents(value: Vector3) + + /** Particles will be emitted at positions determined by sampling this texture at a random position. Used with [constant EMISSION_SHAPE_POINTS] and [constant EMISSION_SHAPE_DIRECTED_POINTS]. Can be created automatically from mesh or node by selecting "Create Emission Points from Mesh/Node" under the "Particles" tool in the toolbar. */ + get emission_point_texture(): Texture2D + set emission_point_texture(value: Texture2D) + + /** Particle velocity and rotation will be set by sampling this texture at the same point as the [member emission_point_texture]. Used only in [constant EMISSION_SHAPE_DIRECTED_POINTS]. Can be created automatically from mesh or node by selecting "Create Emission Points from Mesh/Node" under the "Particles" tool in the toolbar. */ + get emission_normal_texture(): Texture2D + set emission_normal_texture(value: Texture2D) + + /** Particle color will be modulated by color determined by sampling this texture at the same point as the [member emission_point_texture]. + * + * **Note:** [member emission_color_texture] multiplies the particle mesh's vertex colors. To have a visible effect on a [BaseMaterial3D], [member BaseMaterial3D.vertex_color_use_as_albedo] *must* be `true`. For a [ShaderMaterial], `ALBEDO *= COLOR.rgb;` must be inserted in the shader's `fragment()` function. Otherwise, [member emission_color_texture] will have no visible effect. + */ + get emission_color_texture(): Texture2D + set emission_color_texture(value: Texture2D) + + /** The number of emission points if [member emission_shape] is set to [constant EMISSION_SHAPE_POINTS] or [constant EMISSION_SHAPE_DIRECTED_POINTS]. */ + get emission_point_count(): int64 + set emission_point_count(value: int64) + + /** The axis of the ring when using the emitter [constant EMISSION_SHAPE_RING]. */ + get emission_ring_axis(): Vector3 + set emission_ring_axis(value: Vector3) + + /** The height of the ring when using the emitter [constant EMISSION_SHAPE_RING]. */ + get emission_ring_height(): float64 + set emission_ring_height(value: float64) + + /** The radius of the ring when using the emitter [constant EMISSION_SHAPE_RING]. */ + get emission_ring_radius(): float64 + set emission_ring_radius(value: float64) + + /** The inner radius of the ring when using the emitter [constant EMISSION_SHAPE_RING]. */ + get emission_ring_inner_radius(): float64 + set emission_ring_inner_radius(value: float64) + + /** The angle of the cone when using the emitter [constant EMISSION_SHAPE_RING]. The default angle of 90 degrees results in a ring, while an angle of 0 degrees results in a cone. Intermediate values will result in a ring where one end is larger than the other. + * + * **Note:** Depending on [member emission_ring_height], the angle may be clamped if the ring's end is reached to form a perfect cone. + */ + get emission_ring_cone_angle(): float64 + set emission_ring_cone_angle(value: float64) + get angle(): Vector2 + set angle(value: Vector2) + + /** Minimum equivalent of [member angle_max]. */ + get angle_min(): float64 + set angle_min(value: float64) + + /** Maximum initial rotation applied to each particle, in degrees. + * Only applied when [member particle_flag_disable_z] or [member particle_flag_rotate_y] are `true` or the [BaseMaterial3D] being used to draw the particle is using [constant BaseMaterial3D.BILLBOARD_PARTICLES]. + */ + get angle_max(): float64 + set angle_max(value: float64) + + /** Each particle's rotation will be animated along this [CurveTexture]. */ + get angle_curve(): CurveTexture + set angle_curve(value: CurveTexture) + + /** Percentage of the velocity of the respective [GPUParticles2D] or [GPUParticles3D] inherited by each particle when spawning. */ + get inherit_velocity_ratio(): float64 + set inherit_velocity_ratio(value: float64) + + /** A pivot point used to calculate radial and orbital velocity of particles. */ + get velocity_pivot(): Vector3 + set velocity_pivot(value: Vector3) + + /** Unit vector specifying the particles' emission direction. */ + get direction(): Vector3 + set direction(value: Vector3) + + /** Each particle's initial direction range from `+spread` to `-spread` degrees. */ + get spread(): float64 + set spread(value: float64) + + /** Amount of [member spread] along the Y axis. */ + get flatness(): float64 + set flatness(value: float64) + get initial_velocity(): Vector2 + set initial_velocity(value: Vector2) + + /** Minimum equivalent of [member initial_velocity_max]. */ + get initial_velocity_min(): float64 + set initial_velocity_min(value: float64) + + /** Maximum initial velocity magnitude for each particle. Direction comes from [member direction] and [member spread]. */ + get initial_velocity_max(): float64 + set initial_velocity_max(value: float64) + get angular_velocity(): Vector2 + set angular_velocity(value: Vector2) + + /** Minimum equivalent of [member angular_velocity_max]. */ + get angular_velocity_min(): float64 + set angular_velocity_min(value: float64) + + /** Maximum initial angular velocity (rotation speed) applied to each particle in *degrees* per second. + * Only applied when [member particle_flag_disable_z] or [member particle_flag_rotate_y] are `true` or the [BaseMaterial3D] being used to draw the particle is using [constant BaseMaterial3D.BILLBOARD_PARTICLES]. + */ + get angular_velocity_max(): float64 + set angular_velocity_max(value: float64) + + /** Each particle's angular velocity (rotation speed) will vary along this [CurveTexture] over its lifetime. */ + get angular_velocity_curve(): CurveTexture + set angular_velocity_curve(value: CurveTexture) + get directional_velocity(): Vector2 + set directional_velocity(value: Vector2) + + /** Minimum directional velocity value, which is multiplied by [member directional_velocity_curve]. + * + * **Note:** Animated velocities will not be affected by damping, use [member velocity_limit_curve] instead. + */ + get directional_velocity_min(): float64 + set directional_velocity_min(value: float64) + + /** Maximum directional velocity value, which is multiplied by [member directional_velocity_curve]. + * + * **Note:** Animated velocities will not be affected by damping, use [member velocity_limit_curve] instead. + */ + get directional_velocity_max(): float64 + set directional_velocity_max(value: float64) + + /** A curve that specifies the velocity along each of the axes of the particle system along its lifetime. + * + * **Note:** Animated velocities will not be affected by damping, use [member velocity_limit_curve] instead. + */ + get directional_velocity_curve(): CurveXYZTexture + set directional_velocity_curve(value: CurveXYZTexture) + get orbit_velocity(): Vector2 + set orbit_velocity(value: Vector2) + + /** Minimum equivalent of [member orbit_velocity_max]. + * + * **Note:** Animated velocities will not be affected by damping, use [member velocity_limit_curve] instead. + */ + get orbit_velocity_min(): float64 + set orbit_velocity_min(value: float64) + + /** Maximum orbital velocity applied to each particle. Makes the particles circle around origin. Specified in number of full rotations around origin per second. + * + * **Note:** Animated velocities will not be affected by damping, use [member velocity_limit_curve] instead. + */ + get orbit_velocity_max(): float64 + set orbit_velocity_max(value: float64) + + /** Each particle's orbital velocity will vary along this [CurveTexture]. + * + * **Note:** For 3D orbital velocity, use a [CurveXYZTexture]. + * + * **Note:** Animated velocities will not be affected by damping, use [member velocity_limit_curve] instead. + */ + get orbit_velocity_curve(): CurveTexture | CurveXYZTexture + set orbit_velocity_curve(value: CurveTexture | CurveXYZTexture) + get radial_velocity(): Vector2 + set radial_velocity(value: Vector2) + + /** Minimum radial velocity applied to each particle. Makes particles move away from the [member velocity_pivot], or toward it if negative. + * + * **Note:** Animated velocities will not be affected by damping, use [member velocity_limit_curve] instead. + */ + get radial_velocity_min(): float64 + set radial_velocity_min(value: float64) + + /** Maximum radial velocity applied to each particle. Makes particles move away from the [member velocity_pivot], or toward it if negative. + * + * **Note:** Animated velocities will not be affected by damping, use [member velocity_limit_curve] instead. + */ + get radial_velocity_max(): float64 + set radial_velocity_max(value: float64) + + /** A [CurveTexture] that defines the velocity over the particle's lifetime away (or toward) the [member velocity_pivot]. + * + * **Note:** Animated velocities will not be affected by damping, use [member velocity_limit_curve] instead. + */ + get radial_velocity_curve(): CurveTexture + set radial_velocity_curve(value: CurveTexture) + + /** A [CurveTexture] that defines the maximum velocity of a particle during its lifetime. */ + get velocity_limit_curve(): CurveTexture + set velocity_limit_curve(value: CurveTexture) + + /** Gravity applied to every particle. */ + get gravity(): Vector3 + set gravity(value: Vector3) + get linear_accel(): Vector2 + set linear_accel(value: Vector2) + + /** Minimum equivalent of [member linear_accel_max]. */ + get linear_accel_min(): float64 + set linear_accel_min(value: float64) + + /** Maximum linear acceleration applied to each particle in the direction of motion. */ + get linear_accel_max(): float64 + set linear_accel_max(value: float64) + + /** Each particle's linear acceleration will vary along this [CurveTexture]. */ + get linear_accel_curve(): CurveTexture + set linear_accel_curve(value: CurveTexture) + get radial_accel(): Vector2 + set radial_accel(value: Vector2) + + /** Minimum equivalent of [member radial_accel_max]. */ + get radial_accel_min(): float64 + set radial_accel_min(value: float64) + + /** Maximum radial acceleration applied to each particle. Makes particle accelerate away from the origin or towards it if negative. */ + get radial_accel_max(): float64 + set radial_accel_max(value: float64) + + /** Each particle's radial acceleration will vary along this [CurveTexture]. */ + get radial_accel_curve(): CurveTexture + set radial_accel_curve(value: CurveTexture) + get tangential_accel(): Vector2 + set tangential_accel(value: Vector2) + + /** Minimum equivalent of [member tangential_accel_max]. */ + get tangential_accel_min(): float64 + set tangential_accel_min(value: float64) + + /** Maximum tangential acceleration applied to each particle. Tangential acceleration is perpendicular to the particle's velocity giving the particles a swirling motion. */ + get tangential_accel_max(): float64 + set tangential_accel_max(value: float64) + + /** Each particle's tangential acceleration will vary along this [CurveTexture]. */ + get tangential_accel_curve(): CurveTexture + set tangential_accel_curve(value: CurveTexture) + get damping(): Vector2 + set damping(value: Vector2) + + /** Minimum equivalent of [member damping_max]. */ + get damping_min(): float64 + set damping_min(value: float64) + + /** The maximum rate at which particles lose velocity. For example value of `100` means that the particle will go from `100` velocity to `0` in `1` second. */ + get damping_max(): float64 + set damping_max(value: float64) + + /** Damping will vary along this [CurveTexture]. */ + get damping_curve(): CurveTexture + set damping_curve(value: CurveTexture) + + /** If `true`, interaction with particle attractors is enabled. In 3D, attraction only occurs within the area defined by the [GPUParticles3D] node's [member GPUParticles3D.visibility_aabb]. */ + get attractor_interaction_enabled(): boolean + set attractor_interaction_enabled(value: boolean) + get scale(): Vector2 + set scale(value: Vector2) + + /** Minimum equivalent of [member scale_max]. */ + get scale_min(): float64 + set scale_min(value: float64) + + /** Maximum initial scale applied to each particle. */ + get scale_max(): float64 + set scale_max(value: float64) + + /** Each particle's scale will vary along this [CurveTexture] over its lifetime. If a [CurveXYZTexture] is supplied instead, the scale will be separated per-axis. */ + get scale_curve(): CurveTexture | CurveXYZTexture + set scale_curve(value: CurveTexture | CurveXYZTexture) + get scale_over_velocity(): Vector2 + set scale_over_velocity(value: Vector2) + + /** Minimum velocity value reference for [member scale_over_velocity_curve]. + * [member scale_over_velocity_curve] will be interpolated between [member scale_over_velocity_min] and [member scale_over_velocity_max]. + */ + get scale_over_velocity_min(): float64 + set scale_over_velocity_min(value: float64) + + /** Maximum velocity value reference for [member scale_over_velocity_curve]. + * [member scale_over_velocity_curve] will be interpolated between [member scale_over_velocity_min] and [member scale_over_velocity_max]. + */ + get scale_over_velocity_max(): float64 + set scale_over_velocity_max(value: float64) + + /** Either a [CurveTexture] or a [CurveXYZTexture] that scales each particle based on its velocity. */ + get scale_over_velocity_curve(): CurveTexture | CurveXYZTexture + set scale_over_velocity_curve(value: CurveTexture | CurveXYZTexture) + + /** Each particle's initial color. If the [GPUParticles2D]'s `texture` is defined, it will be multiplied by this color. + * + * **Note:** [member color] multiplies the particle mesh's vertex colors. To have a visible effect on a [BaseMaterial3D], [member BaseMaterial3D.vertex_color_use_as_albedo] *must* be `true`. For a [ShaderMaterial], `ALBEDO *= COLOR.rgb;` must be inserted in the shader's `fragment()` function. Otherwise, [member color] will have no visible effect. + */ + get color(): Color + set color(value: Color) + + /** Each particle's color will vary along this [GradientTexture1D] over its lifetime (multiplied with [member color]). + * + * **Note:** [member color_ramp] multiplies the particle mesh's vertex colors. To have a visible effect on a [BaseMaterial3D], [member BaseMaterial3D.vertex_color_use_as_albedo] *must* be `true`. For a [ShaderMaterial], `ALBEDO *= COLOR.rgb;` must be inserted in the shader's `fragment()` function. Otherwise, [member color_ramp] will have no visible effect. + */ + get color_ramp(): GradientTexture1D + set color_ramp(value: GradientTexture1D) + + /** Each particle's initial color will vary along this [GradientTexture1D] (multiplied with [member color]). + * + * **Note:** [member color_initial_ramp] multiplies the particle mesh's vertex colors. To have a visible effect on a [BaseMaterial3D], [member BaseMaterial3D.vertex_color_use_as_albedo] *must* be `true`. For a [ShaderMaterial], `ALBEDO *= COLOR.rgb;` must be inserted in the shader's `fragment()` function. Otherwise, [member color_initial_ramp] will have no visible effect. + */ + get color_initial_ramp(): GradientTexture1D + set color_initial_ramp(value: GradientTexture1D) + + /** The alpha value of each particle's color will be multiplied by this [CurveTexture] over its lifetime. + * + * **Note:** [member alpha_curve] multiplies the particle mesh's vertex colors. To have a visible effect on a [BaseMaterial3D], [member BaseMaterial3D.vertex_color_use_as_albedo] *must* be `true`. For a [ShaderMaterial], `ALBEDO *= COLOR.rgb;` must be inserted in the shader's `fragment()` function. Otherwise, [member alpha_curve] will have no visible effect. + */ + get alpha_curve(): CurveTexture + set alpha_curve(value: CurveTexture) + + /** Each particle's color will be multiplied by this [CurveTexture] over its lifetime. + * + * **Note:** [member emission_curve] multiplies the particle mesh's vertex colors. To have a visible effect on a [BaseMaterial3D], [member BaseMaterial3D.vertex_color_use_as_albedo] *must* be `true`. For a [ShaderMaterial], `ALBEDO *= COLOR.rgb;` must be inserted in the shader's `fragment()` function. Otherwise, [member emission_curve] will have no visible effect. + */ + get emission_curve(): CurveTexture + set emission_curve(value: CurveTexture) + get hue_variation(): Vector2 + set hue_variation(value: Vector2) + + /** Minimum equivalent of [member hue_variation_max]. */ + get hue_variation_min(): float64 + set hue_variation_min(value: float64) + + /** Maximum initial hue variation applied to each particle. It will shift the particle color's hue. */ + get hue_variation_max(): float64 + set hue_variation_max(value: float64) + + /** Each particle's hue will vary along this [CurveTexture]. */ + get hue_variation_curve(): CurveTexture + set hue_variation_curve(value: CurveTexture) + get anim_speed(): Vector2 + set anim_speed(value: Vector2) + + /** Minimum equivalent of [member anim_speed_max]. */ + get anim_speed_min(): float64 + set anim_speed_min(value: float64) + + /** Maximum particle animation speed. Animation speed of `1` means that the particles will make full `0` to `1` offset cycle during lifetime, `2` means `2` cycles etc. + * With animation speed greater than `1`, remember to enable [member CanvasItemMaterial.particles_anim_loop] property if you want the animation to repeat. + */ + get anim_speed_max(): float64 + set anim_speed_max(value: float64) + + /** Each particle's animation speed will vary along this [CurveTexture]. */ + get anim_speed_curve(): CurveTexture + set anim_speed_curve(value: CurveTexture) + get anim_offset(): Vector2 + set anim_offset(value: Vector2) + + /** Minimum equivalent of [member anim_offset_max]. */ + get anim_offset_min(): float64 + set anim_offset_min(value: float64) + + /** Maximum animation offset that corresponds to frame index in the texture. `0` is the first frame, `1` is the last one. See [member CanvasItemMaterial.particles_animation]. */ + get anim_offset_max(): float64 + set anim_offset_max(value: float64) + + /** Each particle's animation offset will vary along this [CurveTexture]. */ + get anim_offset_curve(): CurveTexture + set anim_offset_curve(value: CurveTexture) + + /** If `true`, enables turbulence for the particle system. Turbulence can be used to vary particle movement according to its position (based on a 3D noise pattern). In 3D, [GPUParticlesAttractorVectorField3D] with [NoiseTexture3D] can be used as an alternative to turbulence that works in world space and with multiple particle systems reacting in the same way. + * + * **Note:** Enabling turbulence has a high performance cost on the GPU. Only enable turbulence on a few particle systems at once at most, and consider disabling it when targeting mobile/web platforms. + */ + get turbulence_enabled(): boolean + set turbulence_enabled(value: boolean) + + /** The turbulence noise strength. Increasing this will result in a stronger, more contrasting, flow pattern. */ + get turbulence_noise_strength(): float64 + set turbulence_noise_strength(value: float64) + + /** This value controls the overall scale/frequency of the turbulence noise pattern. + * A small scale will result in smaller features with more detail while a high scale will result in smoother noise with larger features. + */ + get turbulence_noise_scale(): float64 + set turbulence_noise_scale(value: float64) + + /** A scrolling velocity for the turbulence field. This sets a directional trend for the pattern to move in over time. + * The default value of `Vector3(0, 0, 0)` turns off the scrolling. + */ + get turbulence_noise_speed(): Vector3 + set turbulence_noise_speed(value: Vector3) + + /** The in-place rate of change of the turbulence field. This defines how quickly the noise pattern varies over time. + * A value of 0.0 will result in a fixed pattern. + */ + get turbulence_noise_speed_random(): float64 + set turbulence_noise_speed_random(value: float64) + get turbulence_influence(): Vector2 + set turbulence_influence(value: Vector2) + + /** Minimum turbulence influence on each particle. + * The actual amount of turbulence influence on each particle is calculated as a random value between [member turbulence_influence_min] and [member turbulence_influence_max] and multiplied by the amount of turbulence influence from [member turbulence_influence_over_life]. + */ + get turbulence_influence_min(): float64 + set turbulence_influence_min(value: float64) + + /** Maximum turbulence influence on each particle. + * The actual amount of turbulence influence on each particle is calculated as a random value between [member turbulence_influence_min] and [member turbulence_influence_max] and multiplied by the amount of turbulence influence from [member turbulence_influence_over_life]. + */ + get turbulence_influence_max(): float64 + set turbulence_influence_max(value: float64) + get turbulence_initial_displacement(): Vector2 + set turbulence_initial_displacement(value: Vector2) + + /** Minimum displacement of each particle's spawn position by the turbulence. + * The actual amount of displacement will be a factor of the underlying turbulence multiplied by a random value between [member turbulence_initial_displacement_min] and [member turbulence_initial_displacement_max]. + */ + get turbulence_initial_displacement_min(): float64 + set turbulence_initial_displacement_min(value: float64) + + /** Maximum displacement of each particle's spawn position by the turbulence. + * The actual amount of displacement will be a factor of the underlying turbulence multiplied by a random value between [member turbulence_initial_displacement_min] and [member turbulence_initial_displacement_max]. + */ + get turbulence_initial_displacement_max(): float64 + set turbulence_initial_displacement_max(value: float64) + + /** Each particle's amount of turbulence will be influenced along this [CurveTexture] over its life time. */ + get turbulence_influence_over_life(): CurveTexture + set turbulence_influence_over_life(value: CurveTexture) + + /** The particles' collision mode. + * + * **Note:** 3D Particles can only collide with [GPUParticlesCollision3D] nodes, not [PhysicsBody3D] nodes. To make particles collide with various objects, you can add [GPUParticlesCollision3D] nodes as children of [PhysicsBody3D] nodes. In 3D, collisions only occur within the area defined by the [GPUParticles3D] node's [member GPUParticles3D.visibility_aabb]. + * + * **Note:** 2D Particles can only collide with [LightOccluder2D] nodes, not [PhysicsBody2D] nodes. + */ + get collision_mode(): int64 + set collision_mode(value: int64) + + /** The particles' friction. Values range from `0` (frictionless) to `1` (maximum friction). Only effective if [member collision_mode] is [constant COLLISION_RIGID]. */ + get collision_friction(): float64 + set collision_friction(value: float64) + + /** The particles' bounciness. Values range from `0` (no bounce) to `1` (full bounciness). Only effective if [member collision_mode] is [constant COLLISION_RIGID]. */ + get collision_bounce(): float64 + set collision_bounce(value: float64) + + /** If `true`, [member GPUParticles3D.collision_base_size] is multiplied by the particle's effective scale (see [member scale_min], [member scale_max], [member scale_curve], and [member scale_over_velocity_curve]). */ + get collision_use_scale(): boolean + set collision_use_scale(value: boolean) + + /** The particle subemitter mode (see [member GPUParticles2D.sub_emitter] and [member GPUParticles3D.sub_emitter]). */ + get sub_emitter_mode(): int64 + set sub_emitter_mode(value: int64) + + /** The frequency at which particles should be emitted from the subemitter node. One particle will be spawned every [member sub_emitter_frequency] seconds. + * + * **Note:** This value shouldn't exceed [member GPUParticles2D.amount] or [member GPUParticles3D.amount] defined on the *subemitter node* (not the main node), relative to the subemitter's particle lifetime. If the number of particles is exceeded, no new particles will spawn from the subemitter until enough particles have expired. + */ + get sub_emitter_frequency(): float64 + set sub_emitter_frequency(value: float64) + + /** The amount of particles to spawn from the subemitter node when the particle expires. + * + * **Note:** This value shouldn't exceed [member GPUParticles2D.amount] or [member GPUParticles3D.amount] defined on the *subemitter node* (not the main node), relative to the subemitter's particle lifetime. If the number of particles is exceeded, no new particles will spawn from the subemitter until enough particles have expired. + */ + get sub_emitter_amount_at_end(): int64 + set sub_emitter_amount_at_end(value: int64) + + /** The amount of particles to spawn from the subemitter node when a collision occurs. When combined with [constant COLLISION_HIDE_ON_CONTACT] on the main particles material, this can be used to achieve effects such as raindrops hitting the ground. + * + * **Note:** This value shouldn't exceed [member GPUParticles2D.amount] or [member GPUParticles3D.amount] defined on the *subemitter node* (not the main node), relative to the subemitter's particle lifetime. If the number of particles is exceeded, no new particles will spawn from the subemitter until enough particles have expired. + */ + get sub_emitter_amount_at_collision(): int64 + set sub_emitter_amount_at_collision(value: int64) + + /** The amount of particles to spawn from the subemitter node when the particle spawns. + * + * **Note:** This value shouldn't exceed [member GPUParticles2D.amount] or [member GPUParticles3D.amount] defined on the *subemitter node* (not the main node), relative to the subemitter's particle lifetime. If the number of particles is exceeded, no new particles will spawn from the subemitter until enough particles have expired. + */ + get sub_emitter_amount_at_start(): int64 + set sub_emitter_amount_at_start(value: int64) + + /** If `true`, the subemitter inherits the parent particle's velocity when it spawns. */ + get sub_emitter_keep_velocity(): boolean + set sub_emitter_keep_velocity(value: boolean) + + /** Emitted when this material's emission shape is changed in any way. This includes changes to [member emission_shape], [member emission_shape_scale], or [member emission_sphere_radius], and any other property that affects the emission shape's offset, size, scale, or orientation. + * + * **Note:** This signal is only emitted inside the editor for performance reasons. + */ + readonly emission_shape_changed: Signal0 + } + class ParticleProcessMaterialConversionPlugin extends EditorResourceConversionPlugin { + constructor(identifier?: any) + } + class Particles2DEditorPlugin = Record> extends ParticlesEditorPlugin { + constructor(identifier?: any) + } + class Particles3DEditorPlugin = Record> extends ParticlesEditorPlugin { + constructor(identifier?: any) + } + class Particles3DEmissionShapeGizmoPlugin extends EditorNode3DGizmoPlugin { + constructor(identifier?: any) + } + class ParticlesEditorPlugin = Record> extends EditorPlugin { + constructor(identifier?: any) + } + /** Contains a [Curve2D] path for [PathFollow2D] nodes to follow. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_path2d.html + */ + class Path2D = Record> extends Node2D { + constructor(identifier?: any) + /** A [Curve2D] describing the path. */ + get curve(): Curve2D + set curve(value: Curve2D) + } + class Path2DEditor = Record> extends HBoxContainer { + constructor(identifier?: any) + _update_toolbar(): void + _clear_curve_points(_unnamed_arg0: Path2D): void + _restore_curve_points(_unnamed_arg0: Path2D, _unnamed_arg1: PackedVector2Array | Vector2[]): void + } + class Path2DEditorPlugin = Record> extends EditorPlugin { + constructor(identifier?: any) + } + /** Contains a [Curve3D] path for [PathFollow3D] nodes to follow. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_path3d.html + */ + class Path3D = Record> extends Node3D { + constructor(identifier?: any) + /** A [Curve3D] describing the path. */ + get curve(): Curve3D + set curve(value: Curve3D) + + /** Emitted when the [member curve] changes. */ + readonly curve_changed: Signal0 + } + class Path3DEditorPlugin = Record> extends EditorPlugin { + constructor(identifier?: any) + _update_toolbar(): void + _clear_curve_points(): void + _restore_curve_points(_unnamed_arg0: PackedVector3Array | Vector3[]): void + } + class Path3DGizmoPlugin extends EditorNode3DGizmoPlugin { + constructor(identifier?: any) + } + /** Point sampler for a [Path2D]. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_pathfollow2d.html + */ + class PathFollow2D = Record> extends Node2D { + constructor(identifier?: any) + /** The distance along the path, in pixels. Changing this value sets this node's position to a point within the path. */ + get progress(): float64 + set progress(value: float64) + + /** The distance along the path as a number in the range 0.0 (for the first vertex) to 1.0 (for the last). This is just another way of expressing the progress within the path, as the offset supplied is multiplied internally by the path's length. + * It can be set or get only if the [PathFollow2D] is the child of a [Path2D] which is part of the scene tree, and that this [Path2D] has a [Curve2D] with a non-zero length. Otherwise, trying to set this field will print an error, and getting this field will return `0.0`. + */ + get progress_ratio(): float64 + set progress_ratio(value: float64) + + /** The node's offset along the curve. */ + get h_offset(): float64 + set h_offset(value: float64) + + /** The node's offset perpendicular to the curve. */ + get v_offset(): float64 + set v_offset(value: float64) + + /** If `true`, this node rotates to follow the path, with the +X direction facing forward on the path. */ + get rotates(): boolean + set rotates(value: boolean) + + /** If `true`, the position between two cached points is interpolated cubically, and linearly otherwise. + * The points along the [Curve2D] of the [Path2D] are precomputed before use, for faster calculations. The point at the requested offset is then calculated interpolating between two adjacent cached points. This may present a problem if the curve makes sharp turns, as the cached points may not follow the curve closely enough. + * There are two answers to this problem: either increase the number of cached points and increase memory consumption, or make a cubic interpolation between two points at the cost of (slightly) slower calculations. + */ + get cubic_interp(): boolean + set cubic_interp(value: boolean) + + /** If `true`, any offset outside the path's length will wrap around, instead of stopping at the ends. Use it for cyclic paths. */ + get loop(): boolean + set loop(value: boolean) + } + namespace PathFollow3D { + enum RotationMode { + /** Forbids the PathFollow3D to rotate. */ + ROTATION_NONE = 0, + + /** Allows the PathFollow3D to rotate in the Y axis only. */ + ROTATION_Y = 1, + + /** Allows the PathFollow3D to rotate in both the X, and Y axes. */ + ROTATION_XY = 2, + + /** Allows the PathFollow3D to rotate in any axis. */ + ROTATION_XYZ = 3, + + /** Uses the up vector information in a [Curve3D] to enforce orientation. This rotation mode requires the [Path3D]'s [member Curve3D.up_vector_enabled] property to be set to `true`. */ + ROTATION_ORIENTED = 4, + } + } + /** Point sampler for a [Path3D]. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_pathfollow3d.html + */ + class PathFollow3D = Record> extends Node3D { + constructor(identifier?: any) + /** Correct the [param transform]. [param rotation_mode] implicitly specifies how posture (forward, up and sideway direction) is calculated. */ + static correct_posture(transform: Transform3D, rotation_mode: PathFollow3D.RotationMode): Transform3D + + /** The distance from the first vertex, measured in 3D units along the path. Changing this value sets this node's position to a point within the path. */ + get progress(): float64 + set progress(value: float64) + + /** The distance from the first vertex, considering 0.0 as the first vertex and 1.0 as the last. This is just another way of expressing the progress within the path, as the progress supplied is multiplied internally by the path's length. + * It can be set or get only if the [PathFollow3D] is the child of a [Path3D] which is part of the scene tree, and that this [Path3D] has a [Curve3D] with a non-zero length. Otherwise, trying to set this field will print an error, and getting this field will return `0.0`. + */ + get progress_ratio(): float64 + set progress_ratio(value: float64) + + /** The node's offset along the curve. */ + get h_offset(): float64 + set h_offset(value: float64) + + /** The node's offset perpendicular to the curve. */ + get v_offset(): float64 + set v_offset(value: float64) + + /** Allows or forbids rotation on one or more axes, depending on the [enum RotationMode] constants being used. */ + get rotation_mode(): int64 + set rotation_mode(value: int64) + + /** If `true`, the node moves on the travel path with orienting the +Z axis as forward. See also [constant Vector3.FORWARD] and [constant Vector3.MODEL_FRONT]. */ + get use_model_front(): boolean + set use_model_front(value: boolean) + + /** If `true`, the position between two cached points is interpolated cubically, and linearly otherwise. + * The points along the [Curve3D] of the [Path3D] are precomputed before use, for faster calculations. The point at the requested offset is then calculated interpolating between two adjacent cached points. This may present a problem if the curve makes sharp turns, as the cached points may not follow the curve closely enough. + * There are two answers to this problem: either increase the number of cached points and increase memory consumption, or make a cubic interpolation between two points at the cost of (slightly) slower calculations. + */ + get cubic_interp(): boolean + set cubic_interp(value: boolean) + + /** If `true`, any offset outside the path's length will wrap around, instead of stopping at the ends. Use it for cyclic paths. */ + get loop(): boolean + set loop(value: boolean) + + /** If `true`, the tilt property of [Curve3D] takes effect. */ + get tilt_enabled(): boolean + set tilt_enabled(value: boolean) + } + /** A [RigidBody2D]-derived node used to make [Bone2D]s in a [Skeleton2D] react to physics. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_physicalbone2d.html + */ + class PhysicalBone2D = Record> extends RigidBody2D { + constructor(identifier?: any) + /** Returns the first [Joint2D] child node, if one exists. This is mainly a helper function to make it easier to get the [Joint2D] that the [PhysicalBone2D] is autoconfiguring. */ + get_joint(): Joint2D + + /** Returns a boolean that indicates whether the [PhysicalBone2D] is running and simulating using the Godot 2D physics engine. When `true`, the PhysicalBone2D node is using physics. */ + is_simulating_physics(): boolean + + /** The [NodePath] to the [Bone2D] that this [PhysicalBone2D] should simulate. */ + get bone2d_nodepath(): NodePath + set bone2d_nodepath(value: NodePath | string) + + /** The index of the [Bone2D] that this [PhysicalBone2D] should simulate. */ + get bone2d_index(): int64 + set bone2d_index(value: int64) + + /** If `true`, the [PhysicalBone2D] will automatically configure the first [Joint2D] child node. The automatic configuration is limited to setting up the node properties and positioning the [Joint2D]. */ + get auto_configure_joint(): boolean + set auto_configure_joint(value: boolean) + + /** If `true`, the [PhysicalBone2D] will start simulating using physics. If `false`, the [PhysicalBone2D] will follow the transform of the [Bone2D] node. + * + * **Note:** To have the [Bone2D]s visually follow the [PhysicalBone2D], use a [SkeletonModification2DPhysicalBones] modification on the [Skeleton2D] node with the [Bone2D] nodes. + */ + get simulate_physics(): boolean + set simulate_physics(value: boolean) + + /** If `true`, the [PhysicalBone2D] will keep the transform of the bone it is bound to when simulating physics. */ + get follow_bone_when_simulating(): boolean + set follow_bone_when_simulating(value: boolean) + } + namespace PhysicalBone3D { + enum DampMode { + /** In this mode, the body's damping value is added to any value set in areas or the default value. */ + DAMP_MODE_COMBINE = 0, + + /** In this mode, the body's damping value replaces any value set in areas or the default value. */ + DAMP_MODE_REPLACE = 1, + } + enum JointType { + /** No joint is applied to the PhysicsBone3D. */ + JOINT_TYPE_NONE = 0, + + /** A pin joint is applied to the PhysicsBone3D. */ + JOINT_TYPE_PIN = 1, + + /** A cone joint is applied to the PhysicsBone3D. */ + JOINT_TYPE_CONE = 2, + + /** A hinge joint is applied to the PhysicsBone3D. */ + JOINT_TYPE_HINGE = 3, + + /** A slider joint is applied to the PhysicsBone3D. */ + JOINT_TYPE_SLIDER = 4, + + /** A 6 degrees of freedom joint is applied to the PhysicsBone3D. */ + JOINT_TYPE_6DOF = 5, + } + } + /** A physics body used to make bones in a [Skeleton3D] react to physics. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_physicalbone3d.html + */ + class PhysicalBone3D = Record> extends PhysicsBody3D { + constructor(identifier?: any) + /** Called during physics processing, allowing you to read and safely modify the simulation state for the object. By default, it is called before the standard force integration, but the [member custom_integrator] property allows you to disable the standard force integration and do fully custom force integration for a body. */ + /* gdvirtual */ _integrate_forces(state: PhysicsDirectBodyState3D): void + + /** Applies a directional impulse without affecting rotation. + * An impulse is time-independent! Applying an impulse every frame would result in a framerate-dependent force. For this reason, it should only be used when simulating one-time impacts (use the "_integrate_forces" functions otherwise). + * This is equivalent to using [method apply_impulse] at the body's center of mass. + */ + apply_central_impulse(impulse: Vector3): void + + /** Applies a positioned impulse to the PhysicsBone3D. + * An impulse is time-independent! Applying an impulse every frame would result in a framerate-dependent force. For this reason, it should only be used when simulating one-time impacts (use the "_integrate_forces" functions otherwise). + * [param position] is the offset from the PhysicsBone3D origin in global coordinates. + */ + apply_impulse(impulse: Vector3, position: Vector3 = new Vector3(0, 0, 0)): void + + /** Returns `true` if the PhysicsBone3D is allowed to simulate physics. */ + get_simulate_physics(): boolean + + /** Returns `true` if the PhysicsBone3D is currently simulating physics. */ + is_simulating_physics(): boolean + + /** Returns the unique identifier of the PhysicsBone3D. */ + get_bone_id(): int64 + + /** Sets the joint type. See [enum JointType] for possible values. */ + get joint_type(): int64 + set joint_type(value: int64) + + /** Sets the joint's transform. */ + get joint_offset(): Transform3D + set joint_offset(value: Transform3D) + + /** Sets the joint's rotation in radians. */ + get joint_rotation(): Vector3 + set joint_rotation(value: Vector3) + + /** Sets the body's transform. */ + get body_offset(): Transform3D + set body_offset(value: Transform3D) + + /** The body's mass. */ + get mass(): float64 + set mass(value: float64) + + /** The body's friction, from `0` (frictionless) to `1` (max friction). */ + get friction(): float64 + set friction(value: float64) + + /** The body's bounciness. Values range from `0` (no bounce) to `1` (full bounciness). + * + * **Note:** Even with [member bounce] set to `1.0`, some energy will be lost over time due to linear and angular damping. To have a [PhysicalBone3D] that preserves all its energy over time, set [member bounce] to `1.0`, [member linear_damp_mode] to [constant DAMP_MODE_REPLACE], [member linear_damp] to `0.0`, [member angular_damp_mode] to [constant DAMP_MODE_REPLACE], and [member angular_damp] to `0.0`. + */ + get bounce(): float64 + set bounce(value: float64) + + /** This is multiplied by [member ProjectSettings.physics/3d/default_gravity] to produce this body's gravity. For example, a value of `1.0` will apply normal gravity, `2.0` will apply double the gravity, and `0.5` will apply half the gravity to this body. */ + get gravity_scale(): float64 + set gravity_scale(value: float64) + + /** If `true`, the standard force integration (like gravity or damping) will be disabled for this body. Other than collision response, the body will only move as determined by the [method _integrate_forces] method, if that virtual method is overridden. + * Setting this property will call the method [method PhysicsServer3D.body_set_omit_force_integration] internally. + */ + get custom_integrator(): boolean + set custom_integrator(value: boolean) + + /** Defines how [member linear_damp] is applied. See [enum DampMode] for possible values. */ + get linear_damp_mode(): int64 + set linear_damp_mode(value: int64) + + /** Damps the body's movement. By default, the body will use [member ProjectSettings.physics/3d/default_linear_damp] or any value override set by an [Area3D] the body is in. Depending on [member linear_damp_mode], [member linear_damp] may be added to or replace the body's damping value. + * See [member ProjectSettings.physics/3d/default_linear_damp] for more details about damping. + */ + get linear_damp(): float64 + set linear_damp(value: float64) + + /** Defines how [member angular_damp] is applied. See [enum DampMode] for possible values. */ + get angular_damp_mode(): int64 + set angular_damp_mode(value: int64) + + /** Damps the body's rotation. By default, the body will use the [member ProjectSettings.physics/3d/default_angular_damp] project setting or any value override set by an [Area3D] the body is in. Depending on [member angular_damp_mode], you can set [member angular_damp] to be added to or to replace the body's damping value. + * See [member ProjectSettings.physics/3d/default_angular_damp] for more details about damping. + */ + get angular_damp(): float64 + set angular_damp(value: float64) + + /** The body's linear velocity in units per second. Can be used sporadically, but **don't set this every frame**, because physics may run in another thread and runs at a different granularity. Use [method _integrate_forces] as your process loop for precise control of the body state. */ + get linear_velocity(): Vector3 + set linear_velocity(value: Vector3) + + /** The PhysicalBone3D's rotational velocity in *radians* per second. */ + get angular_velocity(): Vector3 + set angular_velocity(value: Vector3) + + /** If `true`, the body is deactivated when there is no movement, so it will not take part in the simulation until it is awakened by an external force. */ + get can_sleep(): boolean + set can_sleep(value: boolean) + } + class PhysicalBone3DEditorPlugin = Record> extends EditorPlugin { + constructor(identifier?: any) + } + class PhysicalBone3DGizmoPlugin extends EditorNode3DGizmoPlugin { + constructor(identifier?: any) + } + /** Node that can be the parent of [PhysicalBone3D] and can apply the simulation results to [Skeleton3D]. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_physicalbonesimulator3d.html + */ + class PhysicalBoneSimulator3D = Record> extends SkeletonModifier3D { + constructor(identifier?: any) + /** Returns a boolean that indicates whether the [PhysicalBoneSimulator3D] is running and simulating. */ + is_simulating_physics(): boolean + + /** Tells the [PhysicalBone3D] nodes in the Skeleton to stop simulating. */ + physical_bones_stop_simulation(): void + + /** Tells the [PhysicalBone3D] nodes in the Skeleton to start simulating and reacting to the physics world. + * Optionally, a list of bone names can be passed-in, allowing only the passed-in bones to be simulated. + */ + physical_bones_start_simulation(bones: GArray = []): void + + /** Adds a collision exception to the physical bone. + * Works just like the [RigidBody3D] node. + */ + physical_bones_add_collision_exception(exception: RID): void + + /** Removes a collision exception to the physical bone. + * Works just like the [RigidBody3D] node. + */ + physical_bones_remove_collision_exception(exception: RID): void + } + /** A material that defines a sky for a [Sky] resource by a set of physical properties. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_physicalskymaterial.html + */ + class PhysicalSkyMaterial extends Material { + constructor(identifier?: any) + /** Controls the strength of the [url=https://en.wikipedia.org/wiki/Rayleigh_scattering]Rayleigh scattering[/url]. Rayleigh scattering results from light colliding with small particles. It is responsible for the blue color of the sky. */ + get rayleigh_coefficient(): float64 + set rayleigh_coefficient(value: float64) + + /** Controls the [Color] of the [url=https://en.wikipedia.org/wiki/Rayleigh_scattering]Rayleigh scattering[/url]. While not physically accurate, this allows for the creation of alien-looking planets. For example, setting this to a red [Color] results in a Mars-looking atmosphere with a corresponding blue sunset. */ + get rayleigh_color(): Color + set rayleigh_color(value: Color) + + /** Controls the strength of [url=https://en.wikipedia.org/wiki/Mie_scattering]Mie scattering[/url] for the sky. Mie scattering results from light colliding with larger particles (like water). On earth, Mie scattering results in a whitish color around the sun and horizon. */ + get mie_coefficient(): float64 + set mie_coefficient(value: float64) + + /** Controls the direction of the [url=https://en.wikipedia.org/wiki/Mie_scattering]Mie scattering[/url]. A value of `1` means that when light hits a particle it's passing through straight forward. A value of `-1` means that all light is scatter backwards. */ + get mie_eccentricity(): float64 + set mie_eccentricity(value: float64) + + /** Controls the [Color] of the [url=https://en.wikipedia.org/wiki/Mie_scattering]Mie scattering[/url] effect. While not physically accurate, this allows for the creation of alien-looking planets. */ + get mie_color(): Color + set mie_color(value: Color) + + /** Sets the thickness of the atmosphere. High turbidity creates a foggy-looking atmosphere, while a low turbidity results in a clearer atmosphere. */ + get turbidity(): float64 + set turbidity(value: float64) + + /** Sets the size of the sun disk. Default value is based on Sol's perceived size from Earth. */ + get sun_disk_scale(): float64 + set sun_disk_scale(value: float64) + + /** Modulates the [Color] on the bottom half of the sky to represent the ground. */ + get ground_color(): Color + set ground_color(value: Color) + + /** The sky's overall brightness multiplier. Higher values result in a brighter sky. */ + get energy_multiplier(): float64 + set energy_multiplier(value: float64) + + /** If `true`, enables debanding. Debanding adds a small amount of noise which helps reduce banding that appears from the smooth changes in color in the sky. */ + get use_debanding(): boolean + set use_debanding(value: boolean) + + /** [Texture2D] for the night sky. This is added to the sky, so if it is bright enough, it may be visible during the day. */ + get night_sky(): Texture2D + set night_sky(value: Texture2D) + } + class PhysicalSkyMaterialConversionPlugin extends EditorResourceConversionPlugin { + constructor(identifier?: any) + } + /** Abstract base class for 2D game objects affected by physics. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_physicsbody2d.html + */ + class PhysicsBody2D = Record> extends CollisionObject2D { + constructor(identifier?: any) + /** Moves the body along the vector [param motion]. In order to be frame rate independent in [method Node._physics_process] or [method Node._process], [param motion] should be computed using `delta`. + * Returns a [KinematicCollision2D], which contains information about the collision when stopped, or when touching another body along the motion. + * If [param test_only] is `true`, the body does not move but the would-be collision information is given. + * [param safe_margin] is the extra margin used for collision recovery (see [member CharacterBody2D.safe_margin] for more details). + * If [param recovery_as_collision] is `true`, any depenetration from the recovery phase is also reported as a collision; this is used e.g. by [CharacterBody2D] for improving floor detection during floor snapping. + */ + move_and_collide(motion: Vector2, test_only: boolean = false, safe_margin: float64 = 0.08, recovery_as_collision: boolean = false): KinematicCollision2D + + /** Checks for collisions without moving the body. In order to be frame rate independent in [method Node._physics_process] or [method Node._process], [param motion] should be computed using `delta`. + * Virtually sets the node's position, scale and rotation to that of the given [Transform2D], then tries to move the body along the vector [param motion]. Returns `true` if a collision would stop the body from moving along the whole path. + * [param collision] is an optional object of type [KinematicCollision2D], which contains additional information about the collision when stopped, or when touching another body along the motion. + * [param safe_margin] is the extra margin used for collision recovery (see [member CharacterBody2D.safe_margin] for more details). + * If [param recovery_as_collision] is `true`, any depenetration from the recovery phase is also reported as a collision; this is useful for checking whether the body would *touch* any other bodies. + */ + test_move(from: Transform2D, motion: Vector2, collision: KinematicCollision2D = undefined, safe_margin: float64 = 0.08, recovery_as_collision: boolean = false): boolean + + /** Returns the gravity vector computed from all sources that can affect the body, including all gravity overrides from [Area2D] nodes and the global world gravity. */ + get_gravity(): Vector2 + + /** Returns an array of nodes that were added as collision exceptions for this body. */ + get_collision_exceptions(): GArray + + /** Adds a body to the list of bodies that this body can't collide with. */ + add_collision_exception_with(body: Node): void + + /** Removes a body from the list of bodies that this body can't collide with. */ + remove_collision_exception_with(body: Node): void + } + /** Abstract base class for 3D game objects affected by physics. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_physicsbody3d.html + */ + class PhysicsBody3D = Record> extends CollisionObject3D { + constructor(identifier?: any) + /** Moves the body along the vector [param motion]. In order to be frame rate independent in [method Node._physics_process] or [method Node._process], [param motion] should be computed using `delta`. + * The body will stop if it collides. Returns a [KinematicCollision3D], which contains information about the collision when stopped, or when touching another body along the motion. + * If [param test_only] is `true`, the body does not move but the would-be collision information is given. + * [param safe_margin] is the extra margin used for collision recovery (see [member CharacterBody3D.safe_margin] for more details). + * If [param recovery_as_collision] is `true`, any depenetration from the recovery phase is also reported as a collision; this is used e.g. by [CharacterBody3D] for improving floor detection during floor snapping. + * [param max_collisions] allows to retrieve more than one collision result. + */ + move_and_collide(motion: Vector3, test_only: boolean = false, safe_margin: float64 = 0.001, recovery_as_collision: boolean = false, max_collisions: int64 = 1): KinematicCollision3D + + /** Checks for collisions without moving the body. In order to be frame rate independent in [method Node._physics_process] or [method Node._process], [param motion] should be computed using `delta`. + * Virtually sets the node's position, scale and rotation to that of the given [Transform3D], then tries to move the body along the vector [param motion]. Returns `true` if a collision would stop the body from moving along the whole path. + * [param collision] is an optional object of type [KinematicCollision3D], which contains additional information about the collision when stopped, or when touching another body along the motion. + * [param safe_margin] is the extra margin used for collision recovery (see [member CharacterBody3D.safe_margin] for more details). + * If [param recovery_as_collision] is `true`, any depenetration from the recovery phase is also reported as a collision; this is useful for checking whether the body would *touch* any other bodies. + * [param max_collisions] allows to retrieve more than one collision result. + */ + test_move(from: Transform3D, motion: Vector3, collision: KinematicCollision3D = undefined, safe_margin: float64 = 0.001, recovery_as_collision: boolean = false, max_collisions: int64 = 1): boolean + + /** Returns the gravity vector computed from all sources that can affect the body, including all gravity overrides from [Area3D] nodes and the global world gravity. */ + get_gravity(): Vector3 + + /** Locks or unlocks the specified linear or rotational [param axis] depending on the value of [param lock]. */ + set_axis_lock(axis: PhysicsServer3D.BodyAxis, lock: boolean): void + + /** Returns `true` if the specified linear or rotational [param axis] is locked. */ + get_axis_lock(axis: PhysicsServer3D.BodyAxis): boolean + + /** Returns an array of nodes that were added as collision exceptions for this body. */ + get_collision_exceptions(): GArray + + /** Adds a body to the list of bodies that this body can't collide with. */ + add_collision_exception_with(body: Node): void + + /** Removes a body from the list of bodies that this body can't collide with. */ + remove_collision_exception_with(body: Node): void + + /** Lock the body's linear movement in the X axis. */ + get axis_lock_linear_x(): boolean + set axis_lock_linear_x(value: boolean) + + /** Lock the body's linear movement in the Y axis. */ + get axis_lock_linear_y(): boolean + set axis_lock_linear_y(value: boolean) + + /** Lock the body's linear movement in the Z axis. */ + get axis_lock_linear_z(): boolean + set axis_lock_linear_z(value: boolean) + + /** Lock the body's rotation in the X axis. */ + get axis_lock_angular_x(): boolean + set axis_lock_angular_x(value: boolean) + + /** Lock the body's rotation in the Y axis. */ + get axis_lock_angular_y(): boolean + set axis_lock_angular_y(value: boolean) + + /** Lock the body's rotation in the Z axis. */ + get axis_lock_angular_z(): boolean + set axis_lock_angular_z(value: boolean) + } + /** Provides direct access to a physics body in the [PhysicsServer2D]. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_physicsdirectbodystate2d.html + */ + class PhysicsDirectBodyState2D extends Object { + constructor(identifier?: any) + /** Returns the body's velocity at the given relative position, including both translation and rotation. */ + get_velocity_at_local_position(local_position: Vector2): Vector2 + + /** Applies a directional impulse without affecting rotation. + * An impulse is time-independent! Applying an impulse every frame would result in a framerate-dependent force. For this reason, it should only be used when simulating one-time impacts (use the "_force" functions otherwise). + * This is equivalent to using [method apply_impulse] at the body's center of mass. + */ + apply_central_impulse(impulse: Vector2): void + + /** Applies a rotational impulse to the body without affecting the position. + * An impulse is time-independent! Applying an impulse every frame would result in a framerate-dependent force. For this reason, it should only be used when simulating one-time impacts (use the "_force" functions otherwise). + * + * **Note:** [member inverse_inertia] is required for this to work. To have [member inverse_inertia], an active [CollisionShape2D] must be a child of the node, or you can manually set [member inverse_inertia]. + */ + apply_torque_impulse(impulse: float64): void + + /** Applies a positioned impulse to the body. + * An impulse is time-independent! Applying an impulse every frame would result in a framerate-dependent force. For this reason, it should only be used when simulating one-time impacts (use the "_force" functions otherwise). + * [param position] is the offset from the body origin in global coordinates. + */ + apply_impulse(impulse: Vector2, position: Vector2 = Vector2.ZERO): void + + /** Applies a directional force without affecting rotation. A force is time dependent and meant to be applied every physics update. + * This is equivalent to using [method apply_force] at the body's center of mass. + */ + apply_central_force(force: Vector2 = Vector2.ZERO): void + + /** Applies a positioned force to the body. A force is time dependent and meant to be applied every physics update. + * [param position] is the offset from the body origin in global coordinates. + */ + apply_force(force: Vector2, position: Vector2 = Vector2.ZERO): void + + /** Applies a rotational force without affecting position. A force is time dependent and meant to be applied every physics update. + * + * **Note:** [member inverse_inertia] is required for this to work. To have [member inverse_inertia], an active [CollisionShape2D] must be a child of the node, or you can manually set [member inverse_inertia]. + */ + apply_torque(torque: float64): void + + /** Adds a constant directional force without affecting rotation that keeps being applied over time until cleared with `constant_force = Vector2(0, 0)`. + * This is equivalent to using [method add_constant_force] at the body's center of mass. + */ + add_constant_central_force(force: Vector2 = Vector2.ZERO): void + + /** Adds a constant positioned force to the body that keeps being applied over time until cleared with `constant_force = Vector2(0, 0)`. + * [param position] is the offset from the body origin in global coordinates. + */ + add_constant_force(force: Vector2, position: Vector2 = Vector2.ZERO): void + + /** Adds a constant rotational force without affecting position that keeps being applied over time until cleared with `constant_torque = 0`. */ + add_constant_torque(torque: float64): void + + /** Sets the body's total constant positional forces applied during each physics update. + * See [method add_constant_force] and [method add_constant_central_force]. + */ + set_constant_force(force: Vector2): void + + /** Returns the body's total constant positional forces applied during each physics update. + * See [method add_constant_force] and [method add_constant_central_force]. + */ + get_constant_force(): Vector2 + + /** Sets the body's total constant rotational forces applied during each physics update. + * See [method add_constant_torque]. + */ + set_constant_torque(torque: float64): void + + /** Returns the body's total constant rotational forces applied during each physics update. + * See [method add_constant_torque]. + */ + get_constant_torque(): float64 + + /** Returns the number of contacts this body has with other bodies. + * + * **Note:** By default, this returns 0 unless bodies are configured to monitor contacts. See [member RigidBody2D.contact_monitor]. + */ + get_contact_count(): int64 + + /** Returns the position of the contact point on the body in the global coordinate system. */ + get_contact_local_position(contact_idx: int64): Vector2 + + /** Returns the local normal at the contact point. */ + get_contact_local_normal(contact_idx: int64): Vector2 + + /** Returns the local shape index of the collision. */ + get_contact_local_shape(contact_idx: int64): int64 + + /** Returns the velocity vector at the body's contact point. */ + get_contact_local_velocity_at_position(contact_idx: int64): Vector2 + + /** Returns the collider's [RID]. */ + get_contact_collider(contact_idx: int64): RID + + /** Returns the position of the contact point on the collider in the global coordinate system. */ + get_contact_collider_position(contact_idx: int64): Vector2 + + /** Returns the collider's object id. */ + get_contact_collider_id(contact_idx: int64): int64 + + /** Returns the collider object. This depends on how it was created (will return a scene node if such was used to create it). */ + get_contact_collider_object(contact_idx: int64): Object + + /** Returns the collider's shape index. */ + get_contact_collider_shape(contact_idx: int64): int64 + + /** Returns the velocity vector at the collider's contact point. */ + get_contact_collider_velocity_at_position(contact_idx: int64): Vector2 + + /** Returns the impulse created by the contact. */ + get_contact_impulse(contact_idx: int64): Vector2 + + /** Updates the body's linear and angular velocity by applying gravity and damping for the equivalent of one physics tick. */ + integrate_forces(): void + + /** Returns the current state of the space, useful for queries. */ + get_space_state(): PhysicsDirectSpaceState2D + + /** The timestep (delta) used for the simulation. */ + get step(): float64 + + /** The inverse of the mass of the body. */ + get inverse_mass(): float64 + + /** The inverse of the inertia of the body. */ + get inverse_inertia(): float64 + + /** The rate at which the body stops rotating, if there are not any other forces moving it. */ + get total_angular_damp(): float64 + + /** The rate at which the body stops moving, if there are not any other forces moving it. */ + get total_linear_damp(): float64 + + /** The total gravity vector being currently applied to this body. */ + get total_gravity(): Vector2 + + /** The body's center of mass position relative to the body's center in the global coordinate system. */ + get center_of_mass(): Vector2 + + /** The body's center of mass position in the body's local coordinate system. */ + get center_of_mass_local(): Vector2 + + /** The body's rotational velocity in *radians* per second. */ + get angular_velocity(): float64 + set angular_velocity(value: float64) + + /** The body's linear velocity in pixels per second. */ + get linear_velocity(): Vector2 + set linear_velocity(value: Vector2) + + /** If `true`, this body is currently sleeping (not active). */ + get sleeping(): boolean + set sleeping(value: boolean) + + /** The body's transformation matrix. */ + get transform(): Transform2D + set transform(value: Transform2D) + } + /** Provides virtual methods that can be overridden to create custom [PhysicsDirectBodyState2D] implementations. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_physicsdirectbodystate2dextension.html + */ + class PhysicsDirectBodyState2DExtension extends PhysicsDirectBodyState2D { + constructor(identifier?: any) + /** Implement to override the behavior of [member PhysicsDirectBodyState2D.total_gravity] and its respective getter. */ + /* gdvirtual */ _get_total_gravity(): Vector2 + + /** Implement to override the behavior of [member PhysicsDirectBodyState2D.total_linear_damp] and its respective getter. */ + /* gdvirtual */ _get_total_linear_damp(): float64 + + /** Implement to override the behavior of [member PhysicsDirectBodyState2D.total_angular_damp] and its respective getter. */ + /* gdvirtual */ _get_total_angular_damp(): float64 + + /** Implement to override the behavior of [member PhysicsDirectBodyState2D.center_of_mass] and its respective getter. */ + /* gdvirtual */ _get_center_of_mass(): Vector2 + + /** Implement to override the behavior of [member PhysicsDirectBodyState2D.center_of_mass_local] and its respective getter. */ + /* gdvirtual */ _get_center_of_mass_local(): Vector2 + + /** Implement to override the behavior of [member PhysicsDirectBodyState2D.inverse_mass] and its respective getter. */ + /* gdvirtual */ _get_inverse_mass(): float64 + + /** Implement to override the behavior of [member PhysicsDirectBodyState2D.inverse_inertia] and its respective getter. */ + /* gdvirtual */ _get_inverse_inertia(): float64 + + /** Implement to override the behavior of [member PhysicsDirectBodyState2D.linear_velocity] and its respective setter. */ + /* gdvirtual */ _set_linear_velocity(velocity: Vector2): void + + /** Implement to override the behavior of [member PhysicsDirectBodyState2D.linear_velocity] and its respective getter. */ + /* gdvirtual */ _get_linear_velocity(): Vector2 + + /** Implement to override the behavior of [member PhysicsDirectBodyState2D.angular_velocity] and its respective setter. */ + /* gdvirtual */ _set_angular_velocity(velocity: float64): void + + /** Implement to override the behavior of [member PhysicsDirectBodyState2D.angular_velocity] and its respective getter. */ + /* gdvirtual */ _get_angular_velocity(): float64 + + /** Implement to override the behavior of [member PhysicsDirectBodyState2D.transform] and its respective setter. */ + /* gdvirtual */ _set_transform(transform: Transform2D): void + + /** Implement to override the behavior of [member PhysicsDirectBodyState2D.transform] and its respective getter. */ + /* gdvirtual */ _get_transform(): Transform2D + + /** Overridable version of [method PhysicsDirectBodyState2D.get_velocity_at_local_position]. */ + /* gdvirtual */ _get_velocity_at_local_position(local_position: Vector2): Vector2 + + /** Overridable version of [method PhysicsDirectBodyState2D.apply_central_impulse]. */ + /* gdvirtual */ _apply_central_impulse(impulse: Vector2): void + + /** Overridable version of [method PhysicsDirectBodyState2D.apply_impulse]. */ + /* gdvirtual */ _apply_impulse(impulse: Vector2, position: Vector2): void + + /** Overridable version of [method PhysicsDirectBodyState2D.apply_torque_impulse]. */ + /* gdvirtual */ _apply_torque_impulse(impulse: float64): void + + /** Overridable version of [method PhysicsDirectBodyState2D.apply_central_force]. */ + /* gdvirtual */ _apply_central_force(force: Vector2): void + + /** Overridable version of [method PhysicsDirectBodyState2D.apply_force]. */ + /* gdvirtual */ _apply_force(force: Vector2, position: Vector2): void + + /** Overridable version of [method PhysicsDirectBodyState2D.apply_torque]. */ + /* gdvirtual */ _apply_torque(torque: float64): void + + /** Overridable version of [method PhysicsDirectBodyState2D.add_constant_central_force]. */ + /* gdvirtual */ _add_constant_central_force(force: Vector2): void + + /** Overridable version of [method PhysicsDirectBodyState2D.add_constant_force]. */ + /* gdvirtual */ _add_constant_force(force: Vector2, position: Vector2): void + + /** Overridable version of [method PhysicsDirectBodyState2D.add_constant_torque]. */ + /* gdvirtual */ _add_constant_torque(torque: float64): void + + /** Overridable version of [method PhysicsDirectBodyState2D.set_constant_force]. */ + /* gdvirtual */ _set_constant_force(force: Vector2): void + + /** Overridable version of [method PhysicsDirectBodyState2D.get_constant_force]. */ + /* gdvirtual */ _get_constant_force(): Vector2 + + /** Overridable version of [method PhysicsDirectBodyState2D.set_constant_torque]. */ + /* gdvirtual */ _set_constant_torque(torque: float64): void + + /** Overridable version of [method PhysicsDirectBodyState2D.get_constant_torque]. */ + /* gdvirtual */ _get_constant_torque(): float64 + + /** Implement to override the behavior of [member PhysicsDirectBodyState2D.sleeping] and its respective setter. */ + /* gdvirtual */ _set_sleep_state(enabled: boolean): void + + /** Implement to override the behavior of [member PhysicsDirectBodyState2D.sleeping] and its respective getter. */ + /* gdvirtual */ _is_sleeping(): boolean + + /** Overridable version of [method PhysicsDirectBodyState2D.get_contact_count]. */ + /* gdvirtual */ _get_contact_count(): int64 + + /** Overridable version of [method PhysicsDirectBodyState2D.get_contact_local_position]. */ + /* gdvirtual */ _get_contact_local_position(contact_idx: int64): Vector2 + + /** Overridable version of [method PhysicsDirectBodyState2D.get_contact_local_normal]. */ + /* gdvirtual */ _get_contact_local_normal(contact_idx: int64): Vector2 + + /** Overridable version of [method PhysicsDirectBodyState2D.get_contact_local_shape]. */ + /* gdvirtual */ _get_contact_local_shape(contact_idx: int64): int64 + + /** Overridable version of [method PhysicsDirectBodyState2D.get_contact_local_velocity_at_position]. */ + /* gdvirtual */ _get_contact_local_velocity_at_position(contact_idx: int64): Vector2 + + /** Overridable version of [method PhysicsDirectBodyState2D.get_contact_collider]. */ + /* gdvirtual */ _get_contact_collider(contact_idx: int64): RID + + /** Overridable version of [method PhysicsDirectBodyState2D.get_contact_collider_position]. */ + /* gdvirtual */ _get_contact_collider_position(contact_idx: int64): Vector2 + + /** Overridable version of [method PhysicsDirectBodyState2D.get_contact_collider_id]. */ + /* gdvirtual */ _get_contact_collider_id(contact_idx: int64): int64 + + /** Overridable version of [method PhysicsDirectBodyState2D.get_contact_collider_object]. */ + /* gdvirtual */ _get_contact_collider_object(contact_idx: int64): Object + + /** Overridable version of [method PhysicsDirectBodyState2D.get_contact_collider_shape]. */ + /* gdvirtual */ _get_contact_collider_shape(contact_idx: int64): int64 + + /** Overridable version of [method PhysicsDirectBodyState2D.get_contact_collider_velocity_at_position]. */ + /* gdvirtual */ _get_contact_collider_velocity_at_position(contact_idx: int64): Vector2 + + /** Overridable version of [method PhysicsDirectBodyState2D.get_contact_impulse]. */ + /* gdvirtual */ _get_contact_impulse(contact_idx: int64): Vector2 + + /** Implement to override the behavior of [member PhysicsDirectBodyState2D.step] and its respective getter. */ + /* gdvirtual */ _get_step(): float64 + + /** Overridable version of [method PhysicsDirectBodyState2D.integrate_forces]. */ + /* gdvirtual */ _integrate_forces(): void + + /** Overridable version of [method PhysicsDirectBodyState2D.get_space_state]. */ + /* gdvirtual */ _get_space_state(): PhysicsDirectSpaceState2D + } + /** Provides direct access to a physics body in the [PhysicsServer3D]. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_physicsdirectbodystate3d.html + */ + class PhysicsDirectBodyState3D extends Object { + constructor(identifier?: any) + /** Returns the body's velocity at the given relative position, including both translation and rotation. */ + get_velocity_at_local_position(local_position: Vector3): Vector3 + + /** Applies a directional impulse without affecting rotation. + * An impulse is time-independent! Applying an impulse every frame would result in a framerate-dependent force. For this reason, it should only be used when simulating one-time impacts (use the "_force" functions otherwise). + * This is equivalent to using [method apply_impulse] at the body's center of mass. + */ + apply_central_impulse(impulse: Vector3 = new Vector3(0, 0, 0)): void + + /** Applies a positioned impulse to the body. + * An impulse is time-independent! Applying an impulse every frame would result in a framerate-dependent force. For this reason, it should only be used when simulating one-time impacts (use the "_force" functions otherwise). + * [param position] is the offset from the body origin in global coordinates. + */ + apply_impulse(impulse: Vector3, position: Vector3 = new Vector3(0, 0, 0)): void + + /** Applies a rotational impulse to the body without affecting the position. + * An impulse is time-independent! Applying an impulse every frame would result in a framerate-dependent force. For this reason, it should only be used when simulating one-time impacts (use the "_force" functions otherwise). + * + * **Note:** [member inverse_inertia] is required for this to work. To have [member inverse_inertia], an active [CollisionShape3D] must be a child of the node, or you can manually set [member inverse_inertia]. + */ + apply_torque_impulse(impulse: Vector3): void + + /** Applies a directional force without affecting rotation. A force is time dependent and meant to be applied every physics update. + * This is equivalent to using [method apply_force] at the body's center of mass. + */ + apply_central_force(force: Vector3 = new Vector3(0, 0, 0)): void + + /** Applies a positioned force to the body. A force is time dependent and meant to be applied every physics update. + * [param position] is the offset from the body origin in global coordinates. + */ + apply_force(force: Vector3, position: Vector3 = new Vector3(0, 0, 0)): void + + /** Applies a rotational force without affecting position. A force is time dependent and meant to be applied every physics update. + * + * **Note:** [member inverse_inertia] is required for this to work. To have [member inverse_inertia], an active [CollisionShape3D] must be a child of the node, or you can manually set [member inverse_inertia]. + */ + apply_torque(torque: Vector3): void + + /** Adds a constant directional force without affecting rotation that keeps being applied over time until cleared with `constant_force = Vector3(0, 0, 0)`. + * This is equivalent to using [method add_constant_force] at the body's center of mass. + */ + add_constant_central_force(force: Vector3 = new Vector3(0, 0, 0)): void + + /** Adds a constant positioned force to the body that keeps being applied over time until cleared with `constant_force = Vector3(0, 0, 0)`. + * [param position] is the offset from the body origin in global coordinates. + */ + add_constant_force(force: Vector3, position: Vector3 = new Vector3(0, 0, 0)): void + + /** Adds a constant rotational force without affecting position that keeps being applied over time until cleared with `constant_torque = Vector3(0, 0, 0)`. */ + add_constant_torque(torque: Vector3): void + + /** Sets the body's total constant positional forces applied during each physics update. + * See [method add_constant_force] and [method add_constant_central_force]. + */ + set_constant_force(force: Vector3): void + + /** Returns the body's total constant positional forces applied during each physics update. + * See [method add_constant_force] and [method add_constant_central_force]. + */ + get_constant_force(): Vector3 + + /** Sets the body's total constant rotational forces applied during each physics update. + * See [method add_constant_torque]. + */ + set_constant_torque(torque: Vector3): void + + /** Returns the body's total constant rotational forces applied during each physics update. + * See [method add_constant_torque]. + */ + get_constant_torque(): Vector3 + + /** Returns the number of contacts this body has with other bodies. + * + * **Note:** By default, this returns 0 unless bodies are configured to monitor contacts. See [member RigidBody3D.contact_monitor]. + */ + get_contact_count(): int64 + + /** Returns the position of the contact point on the body in the global coordinate system. */ + get_contact_local_position(contact_idx: int64): Vector3 + + /** Returns the local normal at the contact point. */ + get_contact_local_normal(contact_idx: int64): Vector3 + + /** Impulse created by the contact. */ + get_contact_impulse(contact_idx: int64): Vector3 + + /** Returns the local shape index of the collision. */ + get_contact_local_shape(contact_idx: int64): int64 + + /** Returns the linear velocity vector at the body's contact point. */ + get_contact_local_velocity_at_position(contact_idx: int64): Vector3 + + /** Returns the collider's [RID]. */ + get_contact_collider(contact_idx: int64): RID + + /** Returns the position of the contact point on the collider in the global coordinate system. */ + get_contact_collider_position(contact_idx: int64): Vector3 + + /** Returns the collider's object id. */ + get_contact_collider_id(contact_idx: int64): int64 + + /** Returns the collider object. */ + get_contact_collider_object(contact_idx: int64): Object + + /** Returns the collider's shape index. */ + get_contact_collider_shape(contact_idx: int64): int64 + + /** Returns the linear velocity vector at the collider's contact point. */ + get_contact_collider_velocity_at_position(contact_idx: int64): Vector3 + + /** Updates the body's linear and angular velocity by applying gravity and damping for the equivalent of one physics tick. */ + integrate_forces(): void + + /** Returns the current state of the space, useful for queries. */ + get_space_state(): PhysicsDirectSpaceState3D + + /** The timestep (delta) used for the simulation. */ + get step(): float64 + + /** The inverse of the mass of the body. */ + get inverse_mass(): float64 + + /** The rate at which the body stops rotating, if there are not any other forces moving it. */ + get total_angular_damp(): float64 + + /** The rate at which the body stops moving, if there are not any other forces moving it. */ + get total_linear_damp(): float64 + + /** The inverse of the inertia of the body. */ + get inverse_inertia(): Vector3 + + /** The inverse of the inertia tensor of the body. */ + get inverse_inertia_tensor(): Basis + + /** The total gravity vector being currently applied to this body. */ + get total_gravity(): Vector3 + + /** The body's center of mass position relative to the body's center in the global coordinate system. */ + get center_of_mass(): Vector3 + + /** The body's center of mass position in the body's local coordinate system. */ + get center_of_mass_local(): Vector3 + get principal_inertia_axes(): Basis + + /** The body's rotational velocity in *radians* per second. */ + get angular_velocity(): Vector3 + set angular_velocity(value: Vector3) + + /** The body's linear velocity in units per second. */ + get linear_velocity(): Vector3 + set linear_velocity(value: Vector3) + + /** If `true`, this body is currently sleeping (not active). */ + get sleeping(): boolean + set sleeping(value: boolean) + + /** The body's transformation matrix. */ + get transform(): Transform3D + set transform(value: Transform3D) + } + /** Provides virtual methods that can be overridden to create custom [PhysicsDirectBodyState3D] implementations. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_physicsdirectbodystate3dextension.html + */ + class PhysicsDirectBodyState3DExtension extends PhysicsDirectBodyState3D { + constructor(identifier?: any) + /* gdvirtual */ _get_total_gravity(): Vector3 + /* gdvirtual */ _get_total_linear_damp(): float64 + /* gdvirtual */ _get_total_angular_damp(): float64 + /* gdvirtual */ _get_center_of_mass(): Vector3 + /* gdvirtual */ _get_center_of_mass_local(): Vector3 + /* gdvirtual */ _get_principal_inertia_axes(): Basis + /* gdvirtual */ _get_inverse_mass(): float64 + /* gdvirtual */ _get_inverse_inertia(): Vector3 + /* gdvirtual */ _get_inverse_inertia_tensor(): Basis + /* gdvirtual */ _set_linear_velocity(velocity: Vector3): void + /* gdvirtual */ _get_linear_velocity(): Vector3 + /* gdvirtual */ _set_angular_velocity(velocity: Vector3): void + /* gdvirtual */ _get_angular_velocity(): Vector3 + /* gdvirtual */ _set_transform(transform: Transform3D): void + /* gdvirtual */ _get_transform(): Transform3D + /* gdvirtual */ _get_velocity_at_local_position(local_position: Vector3): Vector3 + /* gdvirtual */ _apply_central_impulse(impulse: Vector3): void + /* gdvirtual */ _apply_impulse(impulse: Vector3, position: Vector3): void + /* gdvirtual */ _apply_torque_impulse(impulse: Vector3): void + /* gdvirtual */ _apply_central_force(force: Vector3): void + /* gdvirtual */ _apply_force(force: Vector3, position: Vector3): void + /* gdvirtual */ _apply_torque(torque: Vector3): void + /* gdvirtual */ _add_constant_central_force(force: Vector3): void + /* gdvirtual */ _add_constant_force(force: Vector3, position: Vector3): void + /* gdvirtual */ _add_constant_torque(torque: Vector3): void + /* gdvirtual */ _set_constant_force(force: Vector3): void + /* gdvirtual */ _get_constant_force(): Vector3 + /* gdvirtual */ _set_constant_torque(torque: Vector3): void + /* gdvirtual */ _get_constant_torque(): Vector3 + /* gdvirtual */ _set_sleep_state(enabled: boolean): void + /* gdvirtual */ _is_sleeping(): boolean + /* gdvirtual */ _get_contact_count(): int64 + /* gdvirtual */ _get_contact_local_position(contact_idx: int64): Vector3 + /* gdvirtual */ _get_contact_local_normal(contact_idx: int64): Vector3 + /* gdvirtual */ _get_contact_impulse(contact_idx: int64): Vector3 + /* gdvirtual */ _get_contact_local_shape(contact_idx: int64): int64 + /* gdvirtual */ _get_contact_local_velocity_at_position(contact_idx: int64): Vector3 + /* gdvirtual */ _get_contact_collider(contact_idx: int64): RID + /* gdvirtual */ _get_contact_collider_position(contact_idx: int64): Vector3 + /* gdvirtual */ _get_contact_collider_id(contact_idx: int64): int64 + /* gdvirtual */ _get_contact_collider_object(contact_idx: int64): Object + /* gdvirtual */ _get_contact_collider_shape(contact_idx: int64): int64 + /* gdvirtual */ _get_contact_collider_velocity_at_position(contact_idx: int64): Vector3 + /* gdvirtual */ _get_step(): float64 + /* gdvirtual */ _integrate_forces(): void + /* gdvirtual */ _get_space_state(): PhysicsDirectSpaceState3D + } + /** Provides direct access to a physics space in the [PhysicsServer2D]. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_physicsdirectspacestate2d.html + */ + class PhysicsDirectSpaceState2D extends Object { + constructor(identifier?: any) + /** Checks whether a point is inside any solid shape. Position and other parameters are defined through [PhysicsPointQueryParameters2D]. The shapes the point is inside of are returned in an array containing dictionaries with the following fields: + * `collider`: The colliding object. + * `collider_id`: The colliding object's ID. + * `rid`: The intersecting object's [RID]. + * `shape`: The shape index of the colliding shape. + * The number of intersections can be limited with the [param max_results] parameter, to reduce the processing time. + * + * **Note:** [ConcavePolygonShape2D]s and [CollisionPolygon2D]s in `Segments` build mode are not solid shapes. Therefore, they will not be detected. + */ + intersect_point(parameters: PhysicsPointQueryParameters2D, max_results: int64 = 32): GArray + + /** Intersects a ray in a given space. Ray position and other parameters are defined through [PhysicsRayQueryParameters2D]. The returned object is a dictionary with the following fields: + * `collider`: The colliding object. + * `collider_id`: The colliding object's ID. + * `normal`: The object's surface normal at the intersection point, or `Vector2(0, 0)` if the ray starts inside the shape and [member PhysicsRayQueryParameters2D.hit_from_inside] is `true`. + * `position`: The intersection point. + * `rid`: The intersecting object's [RID]. + * `shape`: The shape index of the colliding shape. + * If the ray did not intersect anything, then an empty dictionary is returned instead. + */ + intersect_ray(parameters: PhysicsRayQueryParameters2D): GDictionary + + /** Checks the intersections of a shape, given through a [PhysicsShapeQueryParameters2D] object, against the space. The intersected shapes are returned in an array containing dictionaries with the following fields: + * `collider`: The colliding object. + * `collider_id`: The colliding object's ID. + * `rid`: The intersecting object's [RID]. + * `shape`: The shape index of the colliding shape. + * The number of intersections can be limited with the [param max_results] parameter, to reduce the processing time. + */ + intersect_shape(parameters: PhysicsShapeQueryParameters2D, max_results: int64 = 32): GArray + + /** Checks how far a [Shape2D] can move without colliding. All the parameters for the query, including the shape and the motion, are supplied through a [PhysicsShapeQueryParameters2D] object. + * Returns an array with the safe and unsafe proportions (between 0 and 1) of the motion. The safe proportion is the maximum fraction of the motion that can be made without a collision. The unsafe proportion is the minimum fraction of the distance that must be moved for a collision. If no collision is detected a result of `[1.0, 1.0]` will be returned. + * + * **Note:** Any [Shape2D]s that the shape is already colliding with e.g. inside of, will be ignored. Use [method collide_shape] to determine the [Shape2D]s that the shape is already colliding with. + */ + cast_motion(parameters: PhysicsShapeQueryParameters2D): PackedFloat32Array + + /** Checks the intersections of a shape, given through a [PhysicsShapeQueryParameters2D] object, against the space. The resulting array contains a list of points where the shape intersects another. Like with [method intersect_shape], the number of returned results can be limited to save processing time. + * Returned points are a list of pairs of contact points. For each pair the first one is in the shape passed in [PhysicsShapeQueryParameters2D] object, second one is in the collided shape from the physics space. + */ + collide_shape(parameters: PhysicsShapeQueryParameters2D, max_results: int64 = 32): GArray + + /** Checks the intersections of a shape, given through a [PhysicsShapeQueryParameters2D] object, against the space. If it collides with more than one shape, the nearest one is selected. If the shape did not intersect anything, then an empty dictionary is returned instead. + * + * **Note:** This method does not take into account the `motion` property of the object. The returned object is a dictionary containing the following fields: + * `collider_id`: The colliding object's ID. + * `linear_velocity`: The colliding object's velocity [Vector2]. If the object is an [Area2D], the result is `(0, 0)`. + * `normal`: The collision normal of the query shape at the intersection point, pointing away from the intersecting object. + * `point`: The intersection point. + * `rid`: The intersecting object's [RID]. + * `shape`: The shape index of the colliding shape. + */ + get_rest_info(parameters: PhysicsShapeQueryParameters2D): GDictionary + } + /** Provides virtual methods that can be overridden to create custom [PhysicsDirectSpaceState2D] implementations. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_physicsdirectspacestate2dextension.html + */ + class PhysicsDirectSpaceState2DExtension extends PhysicsDirectSpaceState2D { + constructor(identifier?: any) + /* gdvirtual */ _intersect_ray(from: Vector2, to: Vector2, collision_mask: int64, collide_with_bodies: boolean, collide_with_areas: boolean, hit_from_inside: boolean, result: int64): boolean + /* gdvirtual */ _intersect_point(position: Vector2, canvas_instance_id: int64, collision_mask: int64, collide_with_bodies: boolean, collide_with_areas: boolean, results: int64, max_results: int64): int64 + /* gdvirtual */ _intersect_shape(shape_rid: RID, transform: Transform2D, motion: Vector2, margin: float64, collision_mask: int64, collide_with_bodies: boolean, collide_with_areas: boolean, result: int64, max_results: int64): int64 + /* gdvirtual */ _cast_motion(shape_rid: RID, transform: Transform2D, motion: Vector2, margin: float64, collision_mask: int64, collide_with_bodies: boolean, collide_with_areas: boolean, closest_safe: int64, closest_unsafe: int64): boolean + /* gdvirtual */ _collide_shape(shape_rid: RID, transform: Transform2D, motion: Vector2, margin: float64, collision_mask: int64, collide_with_bodies: boolean, collide_with_areas: boolean, results: int64, max_results: int64, result_count: int64): boolean + /* gdvirtual */ _rest_info(shape_rid: RID, transform: Transform2D, motion: Vector2, margin: float64, collision_mask: int64, collide_with_bodies: boolean, collide_with_areas: boolean, rest_info: int64): boolean + is_body_excluded_from_query(body: RID): boolean + } + /** Provides direct access to a physics space in the [PhysicsServer3D]. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_physicsdirectspacestate3d.html + */ + class PhysicsDirectSpaceState3D extends Object { + constructor(identifier?: any) + /** Checks whether a point is inside any solid shape. Position and other parameters are defined through [PhysicsPointQueryParameters3D]. The shapes the point is inside of are returned in an array containing dictionaries with the following fields: + * `collider`: The colliding object. + * `collider_id`: The colliding object's ID. + * `rid`: The intersecting object's [RID]. + * `shape`: The shape index of the colliding shape. + * The number of intersections can be limited with the [param max_results] parameter, to reduce the processing time. + */ + intersect_point(parameters: PhysicsPointQueryParameters3D, max_results: int64 = 32): GArray + + /** Intersects a ray in a given space. Ray position and other parameters are defined through [PhysicsRayQueryParameters3D]. The returned object is a dictionary with the following fields: + * `collider`: The colliding object. + * `collider_id`: The colliding object's ID. + * `normal`: The object's surface normal at the intersection point, or `Vector3(0, 0, 0)` if the ray starts inside the shape and [member PhysicsRayQueryParameters3D.hit_from_inside] is `true`. + * `position`: The intersection point. + * `face_index`: The face index at the intersection point. + * + * **Note:** Returns a valid number only if the intersected shape is a [ConcavePolygonShape3D]. Otherwise, `-1` is returned. + * `rid`: The intersecting object's [RID]. + * `shape`: The shape index of the colliding shape. + * If the ray did not intersect anything, then an empty dictionary is returned instead. + */ + intersect_ray(parameters: PhysicsRayQueryParameters3D): GDictionary + + /** Checks the intersections of a shape, given through a [PhysicsShapeQueryParameters3D] object, against the space. The intersected shapes are returned in an array containing dictionaries with the following fields: + * `collider`: The colliding object. + * `collider_id`: The colliding object's ID. + * `rid`: The intersecting object's [RID]. + * `shape`: The shape index of the colliding shape. + * The number of intersections can be limited with the [param max_results] parameter, to reduce the processing time. + * + * **Note:** This method does not take into account the `motion` property of the object. + */ + intersect_shape(parameters: PhysicsShapeQueryParameters3D, max_results: int64 = 32): GArray + + /** Checks how far a [Shape3D] can move without colliding. All the parameters for the query, including the shape, are supplied through a [PhysicsShapeQueryParameters3D] object. + * Returns an array with the safe and unsafe proportions (between 0 and 1) of the motion. The safe proportion is the maximum fraction of the motion that can be made without a collision. The unsafe proportion is the minimum fraction of the distance that must be moved for a collision. If no collision is detected a result of `[1.0, 1.0]` will be returned. + * + * **Note:** Any [Shape3D]s that the shape is already colliding with e.g. inside of, will be ignored. Use [method collide_shape] to determine the [Shape3D]s that the shape is already colliding with. + */ + cast_motion(parameters: PhysicsShapeQueryParameters3D): PackedFloat32Array + + /** Checks the intersections of a shape, given through a [PhysicsShapeQueryParameters3D] object, against the space. The resulting array contains a list of points where the shape intersects another. Like with [method intersect_shape], the number of returned results can be limited to save processing time. + * Returned points are a list of pairs of contact points. For each pair the first one is in the shape passed in [PhysicsShapeQueryParameters3D] object, second one is in the collided shape from the physics space. + * + * **Note:** This method does not take into account the `motion` property of the object. + */ + collide_shape(parameters: PhysicsShapeQueryParameters3D, max_results: int64 = 32): GArray + + /** Checks the intersections of a shape, given through a [PhysicsShapeQueryParameters3D] object, against the space. If it collides with more than one shape, the nearest one is selected. The returned object is a dictionary containing the following fields: + * `collider_id`: The colliding object's ID. + * `linear_velocity`: The colliding object's velocity [Vector3]. If the object is an [Area3D], the result is `(0, 0, 0)`. + * `normal`: The collision normal of the query shape at the intersection point, pointing away from the intersecting object. + * `point`: The intersection point. + * `rid`: The intersecting object's [RID]. + * `shape`: The shape index of the colliding shape. + * If the shape did not intersect anything, then an empty dictionary is returned instead. + * + * **Note:** This method does not take into account the `motion` property of the object. + */ + get_rest_info(parameters: PhysicsShapeQueryParameters3D): GDictionary + } + /** Provides virtual methods that can be overridden to create custom [PhysicsDirectSpaceState3D] implementations. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_physicsdirectspacestate3dextension.html + */ + class PhysicsDirectSpaceState3DExtension extends PhysicsDirectSpaceState3D { + constructor(identifier?: any) + /* gdvirtual */ _intersect_ray(from: Vector3, to: Vector3, collision_mask: int64, collide_with_bodies: boolean, collide_with_areas: boolean, hit_from_inside: boolean, hit_back_faces: boolean, pick_ray: boolean, result: int64): boolean + /* gdvirtual */ _intersect_point(position: Vector3, collision_mask: int64, collide_with_bodies: boolean, collide_with_areas: boolean, results: int64, max_results: int64): int64 + /* gdvirtual */ _intersect_shape(shape_rid: RID, transform: Transform3D, motion: Vector3, margin: float64, collision_mask: int64, collide_with_bodies: boolean, collide_with_areas: boolean, result_count: int64, max_results: int64): int64 + /* gdvirtual */ _cast_motion(shape_rid: RID, transform: Transform3D, motion: Vector3, margin: float64, collision_mask: int64, collide_with_bodies: boolean, collide_with_areas: boolean, closest_safe: int64, closest_unsafe: int64, info: int64): boolean + /* gdvirtual */ _collide_shape(shape_rid: RID, transform: Transform3D, motion: Vector3, margin: float64, collision_mask: int64, collide_with_bodies: boolean, collide_with_areas: boolean, results: int64, max_results: int64, result_count: int64): boolean + /* gdvirtual */ _rest_info(shape_rid: RID, transform: Transform3D, motion: Vector3, margin: float64, collision_mask: int64, collide_with_bodies: boolean, collide_with_areas: boolean, rest_info: int64): boolean + /* gdvirtual */ _get_closest_point_to_object_volume(object: RID, point: Vector3): Vector3 + is_body_excluded_from_query(body: RID): boolean + } + /** Holds physics-related properties of a surface, namely its roughness and bounciness. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_physicsmaterial.html + */ + class PhysicsMaterial extends Resource { + constructor(identifier?: any) + /** The body's friction. Values range from `0` (frictionless) to `1` (maximum friction). */ + get friction(): float64 + set friction(value: float64) + + /** If `true`, the physics engine will use the friction of the object marked as "rough" when two objects collide. If `false`, the physics engine will use the lowest friction of all colliding objects instead. If `true` for both colliding objects, the physics engine will use the highest friction. */ + get rough(): boolean + set rough(value: boolean) + + /** The body's bounciness. Values range from `0` (no bounce) to `1` (full bounciness). + * + * **Note:** Even with [member bounce] set to `1.0`, some energy will be lost over time due to linear and angular damping. To have a physics body that preserves all its energy over time, set [member bounce] to `1.0`, the body's linear damp mode to **Replace** (if applicable), its linear damp to `0.0`, its angular damp mode to **Replace** (if applicable), and its angular damp to `0.0`. + */ + get bounce(): float64 + set bounce(value: float64) + + /** If `true`, subtracts the bounciness from the colliding object's bounciness instead of adding it. */ + get absorbent(): boolean + set absorbent(value: boolean) + } + /** Provides parameters for [method PhysicsDirectSpaceState2D.intersect_point]. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_physicspointqueryparameters2d.html + */ + class PhysicsPointQueryParameters2D extends RefCounted { + constructor(identifier?: any) + /** The position being queried for, in global coordinates. */ + get position(): Vector2 + set position(value: Vector2) + + /** If different from `0`, restricts the query to a specific canvas layer specified by its instance ID. See [method Object.get_instance_id]. + * If `0`, restricts the query to the Viewport's default canvas layer. + */ + get canvas_instance_id(): int64 + set canvas_instance_id(value: int64) + + /** The physics layers the query will detect (as a bitmask). By default, all collision layers are detected. See [url=https://docs.godotengine.org/en/4.4/tutorials/physics/physics_introduction.html#collision-layers-and-masks]Collision layers and masks[/url] in the documentation for more information. */ + get collision_mask(): int64 + set collision_mask(value: int64) + + /** The list of object [RID]s that will be excluded from collisions. Use [method CollisionObject2D.get_rid] to get the [RID] associated with a [CollisionObject2D]-derived node. + * + * **Note:** The returned array is copied and any changes to it will not update the original property value. To update the value you need to modify the returned array, and then assign it to the property again. + */ + get exclude(): GArray + set exclude(value: GArray) + + /** If `true`, the query will take [PhysicsBody2D]s into account. */ + get collide_with_bodies(): boolean + set collide_with_bodies(value: boolean) + + /** If `true`, the query will take [Area2D]s into account. */ + get collide_with_areas(): boolean + set collide_with_areas(value: boolean) + } + /** Provides parameters for [method PhysicsDirectSpaceState3D.intersect_point]. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_physicspointqueryparameters3d.html + */ + class PhysicsPointQueryParameters3D extends RefCounted { + constructor(identifier?: any) + /** The position being queried for, in global coordinates. */ + get position(): Vector3 + set position(value: Vector3) + + /** The physics layers the query will detect (as a bitmask). By default, all collision layers are detected. See [url=https://docs.godotengine.org/en/4.4/tutorials/physics/physics_introduction.html#collision-layers-and-masks]Collision layers and masks[/url] in the documentation for more information. */ + get collision_mask(): int64 + set collision_mask(value: int64) + + /** The list of object [RID]s that will be excluded from collisions. Use [method CollisionObject3D.get_rid] to get the [RID] associated with a [CollisionObject3D]-derived node. + * + * **Note:** The returned array is copied and any changes to it will not update the original property value. To update the value you need to modify the returned array, and then assign it to the property again. + */ + get exclude(): GArray + set exclude(value: GArray) + + /** If `true`, the query will take [PhysicsBody3D]s into account. */ + get collide_with_bodies(): boolean + set collide_with_bodies(value: boolean) + + /** If `true`, the query will take [Area3D]s into account. */ + get collide_with_areas(): boolean + set collide_with_areas(value: boolean) + } + /** Provides parameters for [method PhysicsDirectSpaceState2D.intersect_ray]. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_physicsrayqueryparameters2d.html + */ + class PhysicsRayQueryParameters2D extends RefCounted { + constructor(identifier?: any) + /** Returns a new, pre-configured [PhysicsRayQueryParameters2D] object. Use it to quickly create query parameters using the most common options. + * + */ + static create(from: Vector2, to: Vector2, collision_mask: int64 = 4294967295, exclude: GArray = []): PhysicsRayQueryParameters2D + + /** The starting point of the ray being queried for, in global coordinates. */ + get from(): Vector2 + set from(value: Vector2) + + /** The ending point of the ray being queried for, in global coordinates. */ + get to(): Vector2 + set to(value: Vector2) + + /** The physics layers the query will detect (as a bitmask). By default, all collision layers are detected. See [url=https://docs.godotengine.org/en/4.4/tutorials/physics/physics_introduction.html#collision-layers-and-masks]Collision layers and masks[/url] in the documentation for more information. */ + get collision_mask(): int64 + set collision_mask(value: int64) + + /** The list of object [RID]s that will be excluded from collisions. Use [method CollisionObject2D.get_rid] to get the [RID] associated with a [CollisionObject2D]-derived node. + * + * **Note:** The returned array is copied and any changes to it will not update the original property value. To update the value you need to modify the returned array, and then assign it to the property again. + */ + get exclude(): GArray + set exclude(value: GArray) + + /** If `true`, the query will take [PhysicsBody2D]s into account. */ + get collide_with_bodies(): boolean + set collide_with_bodies(value: boolean) + + /** If `true`, the query will take [Area2D]s into account. */ + get collide_with_areas(): boolean + set collide_with_areas(value: boolean) + + /** If `true`, the query will detect a hit when starting inside shapes. In this case the collision normal will be `Vector2(0, 0)`. Does not affect concave polygon shapes. */ + get hit_from_inside(): boolean + set hit_from_inside(value: boolean) + } + /** Provides parameters for [method PhysicsDirectSpaceState3D.intersect_ray]. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_physicsrayqueryparameters3d.html + */ + class PhysicsRayQueryParameters3D extends RefCounted { + constructor(identifier?: any) + /** Returns a new, pre-configured [PhysicsRayQueryParameters3D] object. Use it to quickly create query parameters using the most common options. + * + */ + static create(from: Vector3, to: Vector3, collision_mask: int64 = 4294967295, exclude: GArray = []): PhysicsRayQueryParameters3D + + /** The starting point of the ray being queried for, in global coordinates. */ + get from(): Vector3 + set from(value: Vector3) + + /** The ending point of the ray being queried for, in global coordinates. */ + get to(): Vector3 + set to(value: Vector3) + + /** The physics layers the query will detect (as a bitmask). By default, all collision layers are detected. See [url=https://docs.godotengine.org/en/4.4/tutorials/physics/physics_introduction.html#collision-layers-and-masks]Collision layers and masks[/url] in the documentation for more information. */ + get collision_mask(): int64 + set collision_mask(value: int64) + + /** The list of object [RID]s that will be excluded from collisions. Use [method CollisionObject3D.get_rid] to get the [RID] associated with a [CollisionObject3D]-derived node. + * + * **Note:** The returned array is copied and any changes to it will not update the original property value. To update the value you need to modify the returned array, and then assign it to the property again. + */ + get exclude(): GArray + set exclude(value: GArray) + + /** If `true`, the query will take [PhysicsBody3D]s into account. */ + get collide_with_bodies(): boolean + set collide_with_bodies(value: boolean) + + /** If `true`, the query will take [Area3D]s into account. */ + get collide_with_areas(): boolean + set collide_with_areas(value: boolean) + + /** If `true`, the query will detect a hit when starting inside shapes. In this case the collision normal will be `Vector3(0, 0, 0)`. Does not affect concave polygon shapes or heightmap shapes. */ + get hit_from_inside(): boolean + set hit_from_inside(value: boolean) + + /** If `true`, the query will hit back faces with concave polygon shapes with back face enabled or heightmap shapes. */ + get hit_back_faces(): boolean + set hit_back_faces(value: boolean) + } + /** Provides virtual methods that can be overridden to create custom [PhysicsServer2D] implementations. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_physicsserver2dextension.html + */ + class PhysicsServer2DExtension extends PhysicsServer2D { + constructor(identifier?: any) + /** Overridable version of [method PhysicsServer2D.world_boundary_shape_create]. */ + /* gdvirtual */ _world_boundary_shape_create(): RID + + /** Overridable version of [method PhysicsServer2D.separation_ray_shape_create]. */ + /* gdvirtual */ _separation_ray_shape_create(): RID + + /** Overridable version of [method PhysicsServer2D.segment_shape_create]. */ + /* gdvirtual */ _segment_shape_create(): RID + + /** Overridable version of [method PhysicsServer2D.circle_shape_create]. */ + /* gdvirtual */ _circle_shape_create(): RID + + /** Overridable version of [method PhysicsServer2D.rectangle_shape_create]. */ + /* gdvirtual */ _rectangle_shape_create(): RID + + /** Overridable version of [method PhysicsServer2D.capsule_shape_create]. */ + /* gdvirtual */ _capsule_shape_create(): RID + + /** Overridable version of [method PhysicsServer2D.convex_polygon_shape_create]. */ + /* gdvirtual */ _convex_polygon_shape_create(): RID + + /** Overridable version of [method PhysicsServer2D.concave_polygon_shape_create]. */ + /* gdvirtual */ _concave_polygon_shape_create(): RID + + /** Overridable version of [method PhysicsServer2D.shape_set_data]. */ + /* gdvirtual */ _shape_set_data(shape: RID, data: any): void + + /** Should set the custom solver bias for the given [param shape]. It defines how much bodies are forced to separate on contact. + * Overridable version of [PhysicsServer2D]'s internal `shape_get_custom_solver_bias` method. Corresponds to [member Shape2D.custom_solver_bias]. + */ + /* gdvirtual */ _shape_set_custom_solver_bias(shape: RID, bias: float64): void + + /** Overridable version of [method PhysicsServer2D.shape_get_type]. */ + /* gdvirtual */ _shape_get_type(shape: RID): PhysicsServer2D.ShapeType + + /** Overridable version of [method PhysicsServer2D.shape_get_data]. */ + /* gdvirtual */ _shape_get_data(shape: RID): any + + /** Should return the custom solver bias of the given [param shape], which defines how much bodies are forced to separate on contact when this shape is involved. + * Overridable version of [PhysicsServer2D]'s internal `shape_get_custom_solver_bias` method. Corresponds to [member Shape2D.custom_solver_bias]. + */ + /* gdvirtual */ _shape_get_custom_solver_bias(shape: RID): float64 + + /** Given two shapes and their parameters, should return `true` if a collision between the two would occur, with additional details passed in [param results]. + * Overridable version of [PhysicsServer2D]'s internal `shape_collide` method. Corresponds to [method PhysicsDirectSpaceState2D.collide_shape]. + */ + /* gdvirtual */ _shape_collide(shape_A: RID, xform_A: Transform2D, motion_A: Vector2, shape_B: RID, xform_B: Transform2D, motion_B: Vector2, results: int64, result_max: int64, result_count: int64): boolean + + /** Overridable version of [method PhysicsServer2D.space_create]. */ + /* gdvirtual */ _space_create(): RID + + /** Overridable version of [method PhysicsServer2D.space_set_active]. */ + /* gdvirtual */ _space_set_active(space: RID, active: boolean): void + + /** Overridable version of [method PhysicsServer2D.space_is_active]. */ + /* gdvirtual */ _space_is_active(space: RID): boolean + + /** Overridable version of [method PhysicsServer2D.space_set_param]. */ + /* gdvirtual */ _space_set_param(space: RID, param: PhysicsServer2D.SpaceParameter, value: float64): void + + /** Overridable version of [method PhysicsServer2D.space_get_param]. */ + /* gdvirtual */ _space_get_param(space: RID, param: PhysicsServer2D.SpaceParameter): float64 + + /** Overridable version of [method PhysicsServer2D.space_get_direct_state]. */ + /* gdvirtual */ _space_get_direct_state(space: RID): PhysicsDirectSpaceState2D + + /** Used internally to allow the given [param space] to store contact points, up to [param max_contacts]. This is automatically set for the main [World2D]'s space when [member SceneTree.debug_collisions_hint] is `true`, or by checking "Visible Collision Shapes" in the editor. Only works in debug builds. + * Overridable version of [PhysicsServer2D]'s internal `space_set_debug_contacts` method. + */ + /* gdvirtual */ _space_set_debug_contacts(space: RID, max_contacts: int64): void + + /** Should return the positions of all contacts that have occurred during the last physics step in the given [param space]. See also [method _space_get_contact_count] and [method _space_set_debug_contacts]. + * Overridable version of [PhysicsServer2D]'s internal `space_get_contacts` method. + */ + /* gdvirtual */ _space_get_contacts(space: RID): PackedVector2Array + + /** Should return how many contacts have occurred during the last physics step in the given [param space]. See also [method _space_get_contacts] and [method _space_set_debug_contacts]. + * Overridable version of [PhysicsServer2D]'s internal `space_get_contact_count` method. + */ + /* gdvirtual */ _space_get_contact_count(space: RID): int64 + + /** Overridable version of [method PhysicsServer2D.area_create]. */ + /* gdvirtual */ _area_create(): RID + + /** Overridable version of [method PhysicsServer2D.area_set_space]. */ + /* gdvirtual */ _area_set_space(area: RID, space: RID): void + + /** Overridable version of [method PhysicsServer2D.area_get_space]. */ + /* gdvirtual */ _area_get_space(area: RID): RID + + /** Overridable version of [method PhysicsServer2D.area_add_shape]. */ + /* gdvirtual */ _area_add_shape(area: RID, shape: RID, transform: Transform2D, disabled: boolean): void + + /** Overridable version of [method PhysicsServer2D.area_set_shape]. */ + /* gdvirtual */ _area_set_shape(area: RID, shape_idx: int64, shape: RID): void + + /** Overridable version of [method PhysicsServer2D.area_set_shape_transform]. */ + /* gdvirtual */ _area_set_shape_transform(area: RID, shape_idx: int64, transform: Transform2D): void + + /** Overridable version of [method PhysicsServer2D.area_set_shape_disabled]. */ + /* gdvirtual */ _area_set_shape_disabled(area: RID, shape_idx: int64, disabled: boolean): void + + /** Overridable version of [method PhysicsServer2D.area_get_shape_count]. */ + /* gdvirtual */ _area_get_shape_count(area: RID): int64 + + /** Overridable version of [method PhysicsServer2D.area_get_shape]. */ + /* gdvirtual */ _area_get_shape(area: RID, shape_idx: int64): RID + + /** Overridable version of [method PhysicsServer2D.area_get_shape_transform]. */ + /* gdvirtual */ _area_get_shape_transform(area: RID, shape_idx: int64): Transform2D + + /** Overridable version of [method PhysicsServer2D.area_remove_shape]. */ + /* gdvirtual */ _area_remove_shape(area: RID, shape_idx: int64): void + + /** Overridable version of [method PhysicsServer2D.area_clear_shapes]. */ + /* gdvirtual */ _area_clear_shapes(area: RID): void + + /** Overridable version of [method PhysicsServer2D.area_attach_object_instance_id]. */ + /* gdvirtual */ _area_attach_object_instance_id(area: RID, id: int64): void + + /** Overridable version of [method PhysicsServer2D.area_get_object_instance_id]. */ + /* gdvirtual */ _area_get_object_instance_id(area: RID): int64 + + /** Overridable version of [method PhysicsServer2D.area_attach_canvas_instance_id]. */ + /* gdvirtual */ _area_attach_canvas_instance_id(area: RID, id: int64): void + + /** Overridable version of [method PhysicsServer2D.area_get_canvas_instance_id]. */ + /* gdvirtual */ _area_get_canvas_instance_id(area: RID): int64 + + /** Overridable version of [method PhysicsServer2D.area_set_param]. */ + /* gdvirtual */ _area_set_param(area: RID, param: PhysicsServer2D.AreaParameter, value: any): void + + /** Overridable version of [method PhysicsServer2D.area_set_transform]. */ + /* gdvirtual */ _area_set_transform(area: RID, transform: Transform2D): void + + /** Overridable version of [method PhysicsServer2D.area_get_param]. */ + /* gdvirtual */ _area_get_param(area: RID, param: PhysicsServer2D.AreaParameter): any + + /** Overridable version of [method PhysicsServer2D.area_get_transform]. */ + /* gdvirtual */ _area_get_transform(area: RID): Transform2D + + /** Overridable version of [method PhysicsServer2D.area_set_collision_layer]. */ + /* gdvirtual */ _area_set_collision_layer(area: RID, layer: int64): void + + /** Overridable version of [method PhysicsServer2D.area_get_collision_layer]. */ + /* gdvirtual */ _area_get_collision_layer(area: RID): int64 + + /** Overridable version of [method PhysicsServer2D.area_set_collision_mask]. */ + /* gdvirtual */ _area_set_collision_mask(area: RID, mask: int64): void + + /** Overridable version of [method PhysicsServer2D.area_get_collision_mask]. */ + /* gdvirtual */ _area_get_collision_mask(area: RID): int64 + + /** Overridable version of [method PhysicsServer2D.area_set_monitorable]. */ + /* gdvirtual */ _area_set_monitorable(area: RID, monitorable: boolean): void + + /** If set to `true`, allows the area with the given [RID] to detect mouse inputs when the mouse cursor is hovering on it. + * Overridable version of [PhysicsServer2D]'s internal `area_set_pickable` method. Corresponds to [member CollisionObject2D.input_pickable]. + */ + /* gdvirtual */ _area_set_pickable(area: RID, pickable: boolean): void + + /** Overridable version of [method PhysicsServer2D.area_set_monitor_callback]. */ + /* gdvirtual */ _area_set_monitor_callback(area: RID, callback: Callable): void + + /** Overridable version of [method PhysicsServer2D.area_set_area_monitor_callback]. */ + /* gdvirtual */ _area_set_area_monitor_callback(area: RID, callback: Callable): void + + /** Overridable version of [method PhysicsServer2D.body_create]. */ + /* gdvirtual */ _body_create(): RID + + /** Overridable version of [method PhysicsServer2D.body_set_space]. */ + /* gdvirtual */ _body_set_space(body: RID, space: RID): void + + /** Overridable version of [method PhysicsServer2D.body_get_space]. */ + /* gdvirtual */ _body_get_space(body: RID): RID + + /** Overridable version of [method PhysicsServer2D.body_set_mode]. */ + /* gdvirtual */ _body_set_mode(body: RID, mode: PhysicsServer2D.BodyMode): void + + /** Overridable version of [method PhysicsServer2D.body_get_mode]. */ + /* gdvirtual */ _body_get_mode(body: RID): PhysicsServer2D.BodyMode + + /** Overridable version of [method PhysicsServer2D.body_add_shape]. */ + /* gdvirtual */ _body_add_shape(body: RID, shape: RID, transform: Transform2D, disabled: boolean): void + + /** Overridable version of [method PhysicsServer2D.body_set_shape]. */ + /* gdvirtual */ _body_set_shape(body: RID, shape_idx: int64, shape: RID): void + + /** Overridable version of [method PhysicsServer2D.body_set_shape_transform]. */ + /* gdvirtual */ _body_set_shape_transform(body: RID, shape_idx: int64, transform: Transform2D): void + + /** Overridable version of [method PhysicsServer2D.body_get_shape_count]. */ + /* gdvirtual */ _body_get_shape_count(body: RID): int64 + + /** Overridable version of [method PhysicsServer2D.body_get_shape]. */ + /* gdvirtual */ _body_get_shape(body: RID, shape_idx: int64): RID + + /** Overridable version of [method PhysicsServer2D.body_get_shape_transform]. */ + /* gdvirtual */ _body_get_shape_transform(body: RID, shape_idx: int64): Transform2D + + /** Overridable version of [method PhysicsServer2D.body_set_shape_disabled]. */ + /* gdvirtual */ _body_set_shape_disabled(body: RID, shape_idx: int64, disabled: boolean): void + + /** Overridable version of [method PhysicsServer2D.body_set_shape_as_one_way_collision]. */ + /* gdvirtual */ _body_set_shape_as_one_way_collision(body: RID, shape_idx: int64, enable: boolean, margin: float64): void + + /** Overridable version of [method PhysicsServer2D.body_remove_shape]. */ + /* gdvirtual */ _body_remove_shape(body: RID, shape_idx: int64): void + + /** Overridable version of [method PhysicsServer2D.body_clear_shapes]. */ + /* gdvirtual */ _body_clear_shapes(body: RID): void + + /** Overridable version of [method PhysicsServer2D.body_attach_object_instance_id]. */ + /* gdvirtual */ _body_attach_object_instance_id(body: RID, id: int64): void + + /** Overridable version of [method PhysicsServer2D.body_get_object_instance_id]. */ + /* gdvirtual */ _body_get_object_instance_id(body: RID): int64 + + /** Overridable version of [method PhysicsServer2D.body_attach_canvas_instance_id]. */ + /* gdvirtual */ _body_attach_canvas_instance_id(body: RID, id: int64): void + + /** Overridable version of [method PhysicsServer2D.body_get_canvas_instance_id]. */ + /* gdvirtual */ _body_get_canvas_instance_id(body: RID): int64 + + /** Overridable version of [method PhysicsServer2D.body_set_continuous_collision_detection_mode]. */ + /* gdvirtual */ _body_set_continuous_collision_detection_mode(body: RID, mode: PhysicsServer2D.CCDMode): void + + /** Overridable version of [method PhysicsServer2D.body_get_continuous_collision_detection_mode]. */ + /* gdvirtual */ _body_get_continuous_collision_detection_mode(body: RID): PhysicsServer2D.CCDMode + + /** Overridable version of [method PhysicsServer2D.body_set_collision_layer]. */ + /* gdvirtual */ _body_set_collision_layer(body: RID, layer: int64): void + + /** Overridable version of [method PhysicsServer2D.body_get_collision_layer]. */ + /* gdvirtual */ _body_get_collision_layer(body: RID): int64 + + /** Overridable version of [method PhysicsServer2D.body_set_collision_mask]. */ + /* gdvirtual */ _body_set_collision_mask(body: RID, mask: int64): void + + /** Overridable version of [method PhysicsServer2D.body_get_collision_mask]. */ + /* gdvirtual */ _body_get_collision_mask(body: RID): int64 + + /** Overridable version of [method PhysicsServer2D.body_set_collision_priority]. */ + /* gdvirtual */ _body_set_collision_priority(body: RID, priority: float64): void + + /** Overridable version of [method PhysicsServer2D.body_get_collision_priority]. */ + /* gdvirtual */ _body_get_collision_priority(body: RID): float64 + + /** Overridable version of [method PhysicsServer2D.body_set_param]. */ + /* gdvirtual */ _body_set_param(body: RID, param: PhysicsServer2D.BodyParameter, value: any): void + + /** Overridable version of [method PhysicsServer2D.body_get_param]. */ + /* gdvirtual */ _body_get_param(body: RID, param: PhysicsServer2D.BodyParameter): any + + /** Overridable version of [method PhysicsServer2D.body_reset_mass_properties]. */ + /* gdvirtual */ _body_reset_mass_properties(body: RID): void + + /** Overridable version of [method PhysicsServer2D.body_set_state]. */ + /* gdvirtual */ _body_set_state(body: RID, state: PhysicsServer2D.BodyState, value: any): void + + /** Overridable version of [method PhysicsServer2D.body_get_state]. */ + /* gdvirtual */ _body_get_state(body: RID, state: PhysicsServer2D.BodyState): any + + /** Overridable version of [method PhysicsServer2D.body_apply_central_impulse]. */ + /* gdvirtual */ _body_apply_central_impulse(body: RID, impulse: Vector2): void + + /** Overridable version of [method PhysicsServer2D.body_apply_torque_impulse]. */ + /* gdvirtual */ _body_apply_torque_impulse(body: RID, impulse: float64): void + + /** Overridable version of [method PhysicsServer2D.body_apply_impulse]. */ + /* gdvirtual */ _body_apply_impulse(body: RID, impulse: Vector2, position: Vector2): void + + /** Overridable version of [method PhysicsServer2D.body_apply_central_force]. */ + /* gdvirtual */ _body_apply_central_force(body: RID, force: Vector2): void + + /** Overridable version of [method PhysicsServer2D.body_apply_force]. */ + /* gdvirtual */ _body_apply_force(body: RID, force: Vector2, position: Vector2): void + + /** Overridable version of [method PhysicsServer2D.body_apply_torque]. */ + /* gdvirtual */ _body_apply_torque(body: RID, torque: float64): void + + /** Overridable version of [method PhysicsServer2D.body_add_constant_central_force]. */ + /* gdvirtual */ _body_add_constant_central_force(body: RID, force: Vector2): void + + /** Overridable version of [method PhysicsServer2D.body_add_constant_force]. */ + /* gdvirtual */ _body_add_constant_force(body: RID, force: Vector2, position: Vector2): void + + /** Overridable version of [method PhysicsServer2D.body_add_constant_torque]. */ + /* gdvirtual */ _body_add_constant_torque(body: RID, torque: float64): void + + /** Overridable version of [method PhysicsServer2D.body_set_constant_force]. */ + /* gdvirtual */ _body_set_constant_force(body: RID, force: Vector2): void + + /** Overridable version of [method PhysicsServer2D.body_get_constant_force]. */ + /* gdvirtual */ _body_get_constant_force(body: RID): Vector2 + + /** Overridable version of [method PhysicsServer2D.body_set_constant_torque]. */ + /* gdvirtual */ _body_set_constant_torque(body: RID, torque: float64): void + + /** Overridable version of [method PhysicsServer2D.body_get_constant_torque]. */ + /* gdvirtual */ _body_get_constant_torque(body: RID): float64 + + /** Overridable version of [method PhysicsServer2D.body_set_axis_velocity]. */ + /* gdvirtual */ _body_set_axis_velocity(body: RID, axis_velocity: Vector2): void + + /** Overridable version of [method PhysicsServer2D.body_add_collision_exception]. */ + /* gdvirtual */ _body_add_collision_exception(body: RID, excepted_body: RID): void + + /** Overridable version of [method PhysicsServer2D.body_remove_collision_exception]. */ + /* gdvirtual */ _body_remove_collision_exception(body: RID, excepted_body: RID): void + + /** Returns the [RID]s of all bodies added as collision exceptions for the given [param body]. See also [method _body_add_collision_exception] and [method _body_remove_collision_exception]. + * Overridable version of [PhysicsServer2D]'s internal `body_get_collision_exceptions` method. Corresponds to [method PhysicsBody2D.get_collision_exceptions]. + */ + /* gdvirtual */ _body_get_collision_exceptions(body: RID): GArray + + /** Overridable version of [method PhysicsServer2D.body_set_max_contacts_reported]. */ + /* gdvirtual */ _body_set_max_contacts_reported(body: RID, amount: int64): void + + /** Overridable version of [method PhysicsServer2D.body_get_max_contacts_reported]. */ + /* gdvirtual */ _body_get_max_contacts_reported(body: RID): int64 + + /** Overridable version of [PhysicsServer2D]'s internal `body_set_contacts_reported_depth_threshold` method. + * + * **Note:** This method is currently unused by Godot's default physics implementation. + */ + /* gdvirtual */ _body_set_contacts_reported_depth_threshold(body: RID, threshold: float64): void + + /** Overridable version of [PhysicsServer2D]'s internal `body_get_contacts_reported_depth_threshold` method. + * + * **Note:** This method is currently unused by Godot's default physics implementation. + */ + /* gdvirtual */ _body_get_contacts_reported_depth_threshold(body: RID): float64 + + /** Overridable version of [method PhysicsServer2D.body_set_omit_force_integration]. */ + /* gdvirtual */ _body_set_omit_force_integration(body: RID, enable: boolean): void + + /** Overridable version of [method PhysicsServer2D.body_is_omitting_force_integration]. */ + /* gdvirtual */ _body_is_omitting_force_integration(body: RID): boolean + + /** Assigns the [param body] to call the given [param callable] during the synchronization phase of the loop, before [method _step] is called. See also [method _sync]. + * Overridable version of [method PhysicsServer2D.body_set_state_sync_callback]. + */ + /* gdvirtual */ _body_set_state_sync_callback(body: RID, callable: Callable): void + + /** Overridable version of [method PhysicsServer2D.body_set_force_integration_callback]. */ + /* gdvirtual */ _body_set_force_integration_callback(body: RID, callable: Callable, userdata: any): void + + /** Given a [param body], a [param shape], and their respective parameters, this method should return `true` if a collision between the two would occur, with additional details passed in [param results]. + * Overridable version of [PhysicsServer2D]'s internal `shape_collide` method. Corresponds to [method PhysicsDirectSpaceState2D.collide_shape]. + */ + /* gdvirtual */ _body_collide_shape(body: RID, body_shape: int64, shape: RID, shape_xform: Transform2D, motion: Vector2, results: int64, result_max: int64, result_count: int64): boolean + + /** If set to `true`, allows the body with the given [RID] to detect mouse inputs when the mouse cursor is hovering on it. + * Overridable version of [PhysicsServer2D]'s internal `body_set_pickable` method. Corresponds to [member CollisionObject2D.input_pickable]. + */ + /* gdvirtual */ _body_set_pickable(body: RID, pickable: boolean): void + + /** Overridable version of [method PhysicsServer2D.body_get_direct_state]. */ + /* gdvirtual */ _body_get_direct_state(body: RID): PhysicsDirectBodyState2D + + /** Overridable version of [method PhysicsServer2D.body_test_motion]. Unlike the exposed implementation, this method does not receive all of the arguments inside a [PhysicsTestMotionParameters2D]. */ + /* gdvirtual */ _body_test_motion(body: RID, from: Transform2D, motion: Vector2, margin: float64, collide_separation_ray: boolean, recovery_as_collision: boolean, result: int64): boolean + + /** Overridable version of [method PhysicsServer2D.joint_create]. */ + /* gdvirtual */ _joint_create(): RID + + /** Overridable version of [method PhysicsServer2D.joint_clear]. */ + /* gdvirtual */ _joint_clear(joint: RID): void + + /** Overridable version of [method PhysicsServer2D.joint_set_param]. */ + /* gdvirtual */ _joint_set_param(joint: RID, param: PhysicsServer2D.JointParam, value: float64): void + + /** Overridable version of [method PhysicsServer2D.joint_get_param]. */ + /* gdvirtual */ _joint_get_param(joint: RID, param: PhysicsServer2D.JointParam): float64 + + /** Overridable version of [method PhysicsServer2D.joint_disable_collisions_between_bodies]. */ + /* gdvirtual */ _joint_disable_collisions_between_bodies(joint: RID, disable: boolean): void + + /** Overridable version of [method PhysicsServer2D.joint_is_disabled_collisions_between_bodies]. */ + /* gdvirtual */ _joint_is_disabled_collisions_between_bodies(joint: RID): boolean + + /** Overridable version of [method PhysicsServer2D.joint_make_pin]. */ + /* gdvirtual */ _joint_make_pin(joint: RID, anchor: Vector2, body_a: RID, body_b: RID): void + + /** Overridable version of [method PhysicsServer2D.joint_make_groove]. */ + /* gdvirtual */ _joint_make_groove(joint: RID, a_groove1: Vector2, a_groove2: Vector2, b_anchor: Vector2, body_a: RID, body_b: RID): void + + /** Overridable version of [method PhysicsServer2D.joint_make_damped_spring]. */ + /* gdvirtual */ _joint_make_damped_spring(joint: RID, anchor_a: Vector2, anchor_b: Vector2, body_a: RID, body_b: RID): void + + /** Overridable version of [method PhysicsServer2D.pin_joint_set_flag]. */ + /* gdvirtual */ _pin_joint_set_flag(joint: RID, flag: PhysicsServer2D.PinJointFlag, enabled: boolean): void + + /** Overridable version of [method PhysicsServer2D.pin_joint_get_flag]. */ + /* gdvirtual */ _pin_joint_get_flag(joint: RID, flag: PhysicsServer2D.PinJointFlag): boolean + + /** Overridable version of [method PhysicsServer2D.pin_joint_set_param]. */ + /* gdvirtual */ _pin_joint_set_param(joint: RID, param: PhysicsServer2D.PinJointParam, value: float64): void + + /** Overridable version of [method PhysicsServer2D.pin_joint_get_param]. */ + /* gdvirtual */ _pin_joint_get_param(joint: RID, param: PhysicsServer2D.PinJointParam): float64 + + /** Overridable version of [method PhysicsServer2D.damped_spring_joint_set_param]. */ + /* gdvirtual */ _damped_spring_joint_set_param(joint: RID, param: PhysicsServer2D.DampedSpringParam, value: float64): void + + /** Overridable version of [method PhysicsServer2D.damped_spring_joint_get_param]. */ + /* gdvirtual */ _damped_spring_joint_get_param(joint: RID, param: PhysicsServer2D.DampedSpringParam): float64 + + /** Overridable version of [method PhysicsServer2D.joint_get_type]. */ + /* gdvirtual */ _joint_get_type(joint: RID): PhysicsServer2D.JointType + + /** Overridable version of [method PhysicsServer2D.free_rid]. */ + /* gdvirtual */ _free_rid(rid: RID): void + + /** Overridable version of [method PhysicsServer2D.set_active]. */ + /* gdvirtual */ _set_active(active: boolean): void + + /** Called when the main loop is initialized and creates a new instance of this physics server. See also [method MainLoop._initialize] and [method _finish]. + * Overridable version of [PhysicsServer2D]'s internal `init` method. + */ + /* gdvirtual */ _init(): void + + /** Called every physics step to process the physics simulation. [param step] is the time elapsed since the last physics step, in seconds. It is usually the same as [method Node.get_physics_process_delta_time]. + * Overridable version of [PhysicsServer2D]'s internal [code skip-lint]step` method. + */ + /* gdvirtual */ _step(step: float64): void + + /** Called to indicate that the physics server is synchronizing and cannot access physics states if running on a separate thread. See also [method _end_sync]. + * Overridable version of [PhysicsServer2D]'s internal `sync` method. + */ + /* gdvirtual */ _sync(): void + + /** Called every physics step before [method _step] to process all remaining queries. + * Overridable version of [PhysicsServer2D]'s internal `flush_queries` method. + */ + /* gdvirtual */ _flush_queries(): void + + /** Called to indicate that the physics server has stopped synchronizing. It is in the loop's iteration/physics phase, and can access physics objects even if running on a separate thread. See also [method _sync]. + * Overridable version of [PhysicsServer2D]'s internal `end_sync` method. + */ + /* gdvirtual */ _end_sync(): void + + /** Called when the main loop finalizes to shut down the physics server. See also [method MainLoop._finalize] and [method _init]. + * Overridable version of [PhysicsServer2D]'s internal `finish` method. + */ + /* gdvirtual */ _finish(): void + + /** Overridable method that should return `true` when the physics server is processing queries. See also [method _flush_queries]. + * Overridable version of [PhysicsServer2D]'s internal `is_flushing_queries` method. + */ + /* gdvirtual */ _is_flushing_queries(): boolean + + /** Overridable version of [method PhysicsServer2D.get_process_info]. */ + /* gdvirtual */ _get_process_info(process_info: PhysicsServer2D.ProcessInfo): int64 + + /** Returns `true` if the body with the given [RID] is being excluded from [method _body_test_motion]. See also [method Object.get_instance_id]. */ + body_test_motion_is_excluding_body(body: RID): boolean + + /** Returns `true` if the object with the given instance ID is being excluded from [method _body_test_motion]. See also [method Object.get_instance_id]. */ + body_test_motion_is_excluding_object(object: int64): boolean + } + /** Provides virtual methods that can be overridden to create custom [PhysicsServer3D] implementations. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_physicsserver3dextension.html + */ + class PhysicsServer3DExtension extends PhysicsServer3D { + constructor(identifier?: any) + /* gdvirtual */ _world_boundary_shape_create(): RID + /* gdvirtual */ _separation_ray_shape_create(): RID + /* gdvirtual */ _sphere_shape_create(): RID + /* gdvirtual */ _box_shape_create(): RID + /* gdvirtual */ _capsule_shape_create(): RID + /* gdvirtual */ _cylinder_shape_create(): RID + /* gdvirtual */ _convex_polygon_shape_create(): RID + /* gdvirtual */ _concave_polygon_shape_create(): RID + /* gdvirtual */ _heightmap_shape_create(): RID + /* gdvirtual */ _custom_shape_create(): RID + /* gdvirtual */ _shape_set_data(shape: RID, data: any): void + /* gdvirtual */ _shape_set_custom_solver_bias(shape: RID, bias: float64): void + /* gdvirtual */ _shape_set_margin(shape: RID, margin: float64): void + /* gdvirtual */ _shape_get_margin(shape: RID): float64 + /* gdvirtual */ _shape_get_type(shape: RID): PhysicsServer3D.ShapeType + /* gdvirtual */ _shape_get_data(shape: RID): any + /* gdvirtual */ _shape_get_custom_solver_bias(shape: RID): float64 + /* gdvirtual */ _space_create(): RID + /* gdvirtual */ _space_set_active(space: RID, active: boolean): void + /* gdvirtual */ _space_is_active(space: RID): boolean + /* gdvirtual */ _space_set_param(space: RID, param: PhysicsServer3D.SpaceParameter, value: float64): void + /* gdvirtual */ _space_get_param(space: RID, param: PhysicsServer3D.SpaceParameter): float64 + /* gdvirtual */ _space_get_direct_state(space: RID): PhysicsDirectSpaceState3D + /* gdvirtual */ _space_set_debug_contacts(space: RID, max_contacts: int64): void + /* gdvirtual */ _space_get_contacts(space: RID): PackedVector3Array + /* gdvirtual */ _space_get_contact_count(space: RID): int64 + /* gdvirtual */ _area_create(): RID + /* gdvirtual */ _area_set_space(area: RID, space: RID): void + /* gdvirtual */ _area_get_space(area: RID): RID + /* gdvirtual */ _area_add_shape(area: RID, shape: RID, transform: Transform3D, disabled: boolean): void + /* gdvirtual */ _area_set_shape(area: RID, shape_idx: int64, shape: RID): void + /* gdvirtual */ _area_set_shape_transform(area: RID, shape_idx: int64, transform: Transform3D): void + /* gdvirtual */ _area_set_shape_disabled(area: RID, shape_idx: int64, disabled: boolean): void + /* gdvirtual */ _area_get_shape_count(area: RID): int64 + /* gdvirtual */ _area_get_shape(area: RID, shape_idx: int64): RID + /* gdvirtual */ _area_get_shape_transform(area: RID, shape_idx: int64): Transform3D + /* gdvirtual */ _area_remove_shape(area: RID, shape_idx: int64): void + /* gdvirtual */ _area_clear_shapes(area: RID): void + /* gdvirtual */ _area_attach_object_instance_id(area: RID, id: int64): void + /* gdvirtual */ _area_get_object_instance_id(area: RID): int64 + /* gdvirtual */ _area_set_param(area: RID, param: PhysicsServer3D.AreaParameter, value: any): void + /* gdvirtual */ _area_set_transform(area: RID, transform: Transform3D): void + /* gdvirtual */ _area_get_param(area: RID, param: PhysicsServer3D.AreaParameter): any + /* gdvirtual */ _area_get_transform(area: RID): Transform3D + /* gdvirtual */ _area_set_collision_layer(area: RID, layer: int64): void + /* gdvirtual */ _area_get_collision_layer(area: RID): int64 + /* gdvirtual */ _area_set_collision_mask(area: RID, mask: int64): void + /* gdvirtual */ _area_get_collision_mask(area: RID): int64 + /* gdvirtual */ _area_set_monitorable(area: RID, monitorable: boolean): void + /* gdvirtual */ _area_set_ray_pickable(area: RID, enable: boolean): void + /* gdvirtual */ _area_set_monitor_callback(area: RID, callback: Callable): void + /* gdvirtual */ _area_set_area_monitor_callback(area: RID, callback: Callable): void + /* gdvirtual */ _body_create(): RID + /* gdvirtual */ _body_set_space(body: RID, space: RID): void + /* gdvirtual */ _body_get_space(body: RID): RID + /* gdvirtual */ _body_set_mode(body: RID, mode: PhysicsServer3D.BodyMode): void + /* gdvirtual */ _body_get_mode(body: RID): PhysicsServer3D.BodyMode + /* gdvirtual */ _body_add_shape(body: RID, shape: RID, transform: Transform3D, disabled: boolean): void + /* gdvirtual */ _body_set_shape(body: RID, shape_idx: int64, shape: RID): void + /* gdvirtual */ _body_set_shape_transform(body: RID, shape_idx: int64, transform: Transform3D): void + /* gdvirtual */ _body_set_shape_disabled(body: RID, shape_idx: int64, disabled: boolean): void + /* gdvirtual */ _body_get_shape_count(body: RID): int64 + /* gdvirtual */ _body_get_shape(body: RID, shape_idx: int64): RID + /* gdvirtual */ _body_get_shape_transform(body: RID, shape_idx: int64): Transform3D + /* gdvirtual */ _body_remove_shape(body: RID, shape_idx: int64): void + /* gdvirtual */ _body_clear_shapes(body: RID): void + /* gdvirtual */ _body_attach_object_instance_id(body: RID, id: int64): void + /* gdvirtual */ _body_get_object_instance_id(body: RID): int64 + /* gdvirtual */ _body_set_enable_continuous_collision_detection(body: RID, enable: boolean): void + /* gdvirtual */ _body_is_continuous_collision_detection_enabled(body: RID): boolean + /* gdvirtual */ _body_set_collision_layer(body: RID, layer: int64): void + /* gdvirtual */ _body_get_collision_layer(body: RID): int64 + /* gdvirtual */ _body_set_collision_mask(body: RID, mask: int64): void + /* gdvirtual */ _body_get_collision_mask(body: RID): int64 + /* gdvirtual */ _body_set_collision_priority(body: RID, priority: float64): void + /* gdvirtual */ _body_get_collision_priority(body: RID): float64 + /* gdvirtual */ _body_set_user_flags(body: RID, flags: int64): void + /* gdvirtual */ _body_get_user_flags(body: RID): int64 + /* gdvirtual */ _body_set_param(body: RID, param: PhysicsServer3D.BodyParameter, value: any): void + /* gdvirtual */ _body_get_param(body: RID, param: PhysicsServer3D.BodyParameter): any + /* gdvirtual */ _body_reset_mass_properties(body: RID): void + /* gdvirtual */ _body_set_state(body: RID, state: PhysicsServer3D.BodyState, value: any): void + /* gdvirtual */ _body_get_state(body: RID, state: PhysicsServer3D.BodyState): any + /* gdvirtual */ _body_apply_central_impulse(body: RID, impulse: Vector3): void + /* gdvirtual */ _body_apply_impulse(body: RID, impulse: Vector3, position: Vector3): void + /* gdvirtual */ _body_apply_torque_impulse(body: RID, impulse: Vector3): void + /* gdvirtual */ _body_apply_central_force(body: RID, force: Vector3): void + /* gdvirtual */ _body_apply_force(body: RID, force: Vector3, position: Vector3): void + /* gdvirtual */ _body_apply_torque(body: RID, torque: Vector3): void + /* gdvirtual */ _body_add_constant_central_force(body: RID, force: Vector3): void + /* gdvirtual */ _body_add_constant_force(body: RID, force: Vector3, position: Vector3): void + /* gdvirtual */ _body_add_constant_torque(body: RID, torque: Vector3): void + /* gdvirtual */ _body_set_constant_force(body: RID, force: Vector3): void + /* gdvirtual */ _body_get_constant_force(body: RID): Vector3 + /* gdvirtual */ _body_set_constant_torque(body: RID, torque: Vector3): void + /* gdvirtual */ _body_get_constant_torque(body: RID): Vector3 + /* gdvirtual */ _body_set_axis_velocity(body: RID, axis_velocity: Vector3): void + /* gdvirtual */ _body_set_axis_lock(body: RID, axis: PhysicsServer3D.BodyAxis, lock: boolean): void + /* gdvirtual */ _body_is_axis_locked(body: RID, axis: PhysicsServer3D.BodyAxis): boolean + /* gdvirtual */ _body_add_collision_exception(body: RID, excepted_body: RID): void + /* gdvirtual */ _body_remove_collision_exception(body: RID, excepted_body: RID): void + /* gdvirtual */ _body_get_collision_exceptions(body: RID): GArray + /* gdvirtual */ _body_set_max_contacts_reported(body: RID, amount: int64): void + /* gdvirtual */ _body_get_max_contacts_reported(body: RID): int64 + /* gdvirtual */ _body_set_contacts_reported_depth_threshold(body: RID, threshold: float64): void + /* gdvirtual */ _body_get_contacts_reported_depth_threshold(body: RID): float64 + /* gdvirtual */ _body_set_omit_force_integration(body: RID, enable: boolean): void + /* gdvirtual */ _body_is_omitting_force_integration(body: RID): boolean + /* gdvirtual */ _body_set_state_sync_callback(body: RID, callable: Callable): void + /* gdvirtual */ _body_set_force_integration_callback(body: RID, callable: Callable, userdata: any): void + /* gdvirtual */ _body_set_ray_pickable(body: RID, enable: boolean): void + /* gdvirtual */ _body_test_motion(body: RID, from: Transform3D, motion: Vector3, margin: float64, max_collisions: int64, collide_separation_ray: boolean, recovery_as_collision: boolean, result: int64): boolean + /* gdvirtual */ _body_get_direct_state(body: RID): PhysicsDirectBodyState3D + /* gdvirtual */ _soft_body_create(): RID + /* gdvirtual */ _soft_body_update_rendering_server(body: RID, rendering_server_handler: PhysicsServer3DRenderingServerHandler): void + /* gdvirtual */ _soft_body_set_space(body: RID, space: RID): void + /* gdvirtual */ _soft_body_get_space(body: RID): RID + /* gdvirtual */ _soft_body_set_ray_pickable(body: RID, enable: boolean): void + /* gdvirtual */ _soft_body_set_collision_layer(body: RID, layer: int64): void + /* gdvirtual */ _soft_body_get_collision_layer(body: RID): int64 + /* gdvirtual */ _soft_body_set_collision_mask(body: RID, mask: int64): void + /* gdvirtual */ _soft_body_get_collision_mask(body: RID): int64 + /* gdvirtual */ _soft_body_add_collision_exception(body: RID, body_b: RID): void + /* gdvirtual */ _soft_body_remove_collision_exception(body: RID, body_b: RID): void + /* gdvirtual */ _soft_body_get_collision_exceptions(body: RID): GArray + /* gdvirtual */ _soft_body_set_state(body: RID, state: PhysicsServer3D.BodyState, variant: any): void + /* gdvirtual */ _soft_body_get_state(body: RID, state: PhysicsServer3D.BodyState): any + /* gdvirtual */ _soft_body_set_transform(body: RID, transform: Transform3D): void + /* gdvirtual */ _soft_body_set_simulation_precision(body: RID, simulation_precision: int64): void + /* gdvirtual */ _soft_body_get_simulation_precision(body: RID): int64 + /* gdvirtual */ _soft_body_set_total_mass(body: RID, total_mass: float64): void + /* gdvirtual */ _soft_body_get_total_mass(body: RID): float64 + /* gdvirtual */ _soft_body_set_linear_stiffness(body: RID, linear_stiffness: float64): void + /* gdvirtual */ _soft_body_get_linear_stiffness(body: RID): float64 + /* gdvirtual */ _soft_body_set_pressure_coefficient(body: RID, pressure_coefficient: float64): void + /* gdvirtual */ _soft_body_get_pressure_coefficient(body: RID): float64 + /* gdvirtual */ _soft_body_set_damping_coefficient(body: RID, damping_coefficient: float64): void + /* gdvirtual */ _soft_body_get_damping_coefficient(body: RID): float64 + /* gdvirtual */ _soft_body_set_drag_coefficient(body: RID, drag_coefficient: float64): void + /* gdvirtual */ _soft_body_get_drag_coefficient(body: RID): float64 + /* gdvirtual */ _soft_body_set_mesh(body: RID, mesh: RID): void + /* gdvirtual */ _soft_body_get_bounds(body: RID): AABB + /* gdvirtual */ _soft_body_move_point(body: RID, point_index: int64, global_position: Vector3): void + /* gdvirtual */ _soft_body_get_point_global_position(body: RID, point_index: int64): Vector3 + /* gdvirtual */ _soft_body_remove_all_pinned_points(body: RID): void + /* gdvirtual */ _soft_body_pin_point(body: RID, point_index: int64, pin: boolean): void + /* gdvirtual */ _soft_body_is_point_pinned(body: RID, point_index: int64): boolean + /* gdvirtual */ _joint_create(): RID + /* gdvirtual */ _joint_clear(joint: RID): void + /* gdvirtual */ _joint_make_pin(joint: RID, body_A: RID, local_A: Vector3, body_B: RID, local_B: Vector3): void + /* gdvirtual */ _pin_joint_set_param(joint: RID, param: PhysicsServer3D.PinJointParam, value: float64): void + /* gdvirtual */ _pin_joint_get_param(joint: RID, param: PhysicsServer3D.PinJointParam): float64 + /* gdvirtual */ _pin_joint_set_local_a(joint: RID, local_A: Vector3): void + /* gdvirtual */ _pin_joint_get_local_a(joint: RID): Vector3 + /* gdvirtual */ _pin_joint_set_local_b(joint: RID, local_B: Vector3): void + /* gdvirtual */ _pin_joint_get_local_b(joint: RID): Vector3 + /* gdvirtual */ _joint_make_hinge(joint: RID, body_A: RID, hinge_A: Transform3D, body_B: RID, hinge_B: Transform3D): void + /* gdvirtual */ _joint_make_hinge_simple(joint: RID, body_A: RID, pivot_A: Vector3, axis_A: Vector3, body_B: RID, pivot_B: Vector3, axis_B: Vector3): void + /* gdvirtual */ _hinge_joint_set_param(joint: RID, param: PhysicsServer3D.HingeJointParam, value: float64): void + /* gdvirtual */ _hinge_joint_get_param(joint: RID, param: PhysicsServer3D.HingeJointParam): float64 + /* gdvirtual */ _hinge_joint_set_flag(joint: RID, flag: PhysicsServer3D.HingeJointFlag, enabled: boolean): void + /* gdvirtual */ _hinge_joint_get_flag(joint: RID, flag: PhysicsServer3D.HingeJointFlag): boolean + /* gdvirtual */ _joint_make_slider(joint: RID, body_A: RID, local_ref_A: Transform3D, body_B: RID, local_ref_B: Transform3D): void + /* gdvirtual */ _slider_joint_set_param(joint: RID, param: PhysicsServer3D.SliderJointParam, value: float64): void + /* gdvirtual */ _slider_joint_get_param(joint: RID, param: PhysicsServer3D.SliderJointParam): float64 + /* gdvirtual */ _joint_make_cone_twist(joint: RID, body_A: RID, local_ref_A: Transform3D, body_B: RID, local_ref_B: Transform3D): void + /* gdvirtual */ _cone_twist_joint_set_param(joint: RID, param: PhysicsServer3D.ConeTwistJointParam, value: float64): void + /* gdvirtual */ _cone_twist_joint_get_param(joint: RID, param: PhysicsServer3D.ConeTwistJointParam): float64 + /* gdvirtual */ _joint_make_generic_6dof(joint: RID, body_A: RID, local_ref_A: Transform3D, body_B: RID, local_ref_B: Transform3D): void + /* gdvirtual */ _generic_6dof_joint_set_param(joint: RID, axis: Vector3.Axis, param: PhysicsServer3D.G6DOFJointAxisParam, value: float64): void + /* gdvirtual */ _generic_6dof_joint_get_param(joint: RID, axis: Vector3.Axis, param: PhysicsServer3D.G6DOFJointAxisParam): float64 + /* gdvirtual */ _generic_6dof_joint_set_flag(joint: RID, axis: Vector3.Axis, flag: PhysicsServer3D.G6DOFJointAxisFlag, enable: boolean): void + /* gdvirtual */ _generic_6dof_joint_get_flag(joint: RID, axis: Vector3.Axis, flag: PhysicsServer3D.G6DOFJointAxisFlag): boolean + /* gdvirtual */ _joint_get_type(joint: RID): PhysicsServer3D.JointType + /* gdvirtual */ _joint_set_solver_priority(joint: RID, priority: int64): void + /* gdvirtual */ _joint_get_solver_priority(joint: RID): int64 + /* gdvirtual */ _joint_disable_collisions_between_bodies(joint: RID, disable: boolean): void + /* gdvirtual */ _joint_is_disabled_collisions_between_bodies(joint: RID): boolean + /* gdvirtual */ _free_rid(rid: RID): void + /* gdvirtual */ _set_active(active: boolean): void + /* gdvirtual */ _init(): void + /* gdvirtual */ _step(step: float64): void + /* gdvirtual */ _sync(): void + /* gdvirtual */ _flush_queries(): void + /* gdvirtual */ _end_sync(): void + /* gdvirtual */ _finish(): void + /* gdvirtual */ _is_flushing_queries(): boolean + /* gdvirtual */ _get_process_info(process_info: PhysicsServer3D.ProcessInfo): int64 + body_test_motion_is_excluding_body(body: RID): boolean + body_test_motion_is_excluding_object(object: int64): boolean + } + /** A class used to provide [method PhysicsServer3DExtension._soft_body_update_rendering_server] with a rendering handler for soft bodies. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_physicsserver3drenderingserverhandler.html + */ + class PhysicsServer3DRenderingServerHandler extends Object { + constructor(identifier?: any) + /** Called by the [PhysicsServer3D] to set the position for the [SoftBody3D] vertex at the index specified by [param vertex_id]. + * + * **Note:** The [param vertex] parameter used to be of type `const void*` prior to Godot 4.2. + */ + /* gdvirtual */ _set_vertex(vertex_id: int64, vertex: Vector3): void + + /** Called by the [PhysicsServer3D] to set the normal for the [SoftBody3D] vertex at the index specified by [param vertex_id]. + * + * **Note:** The [param normal] parameter used to be of type `const void*` prior to Godot 4.2. + */ + /* gdvirtual */ _set_normal(vertex_id: int64, normal: Vector3): void + + /** Called by the [PhysicsServer3D] to set the bounding box for the [SoftBody3D]. */ + /* gdvirtual */ _set_aabb(aabb: AABB): void + + /** Sets the position for the [SoftBody3D] vertex at the index specified by [param vertex_id]. */ + set_vertex(vertex_id: int64, vertex: Vector3): void + + /** Sets the normal for the [SoftBody3D] vertex at the index specified by [param vertex_id]. */ + set_normal(vertex_id: int64, normal: Vector3): void + + /** Sets the bounding box for the [SoftBody3D]. */ + set_aabb(aabb: AABB): void + } + /** Provides parameters for [method PhysicsDirectSpaceState2D.intersect_shape]. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_physicsshapequeryparameters2d.html + */ + class PhysicsShapeQueryParameters2D extends RefCounted { + constructor(identifier?: any) + /** The physics layers the query will detect (as a bitmask). By default, all collision layers are detected. See [url=https://docs.godotengine.org/en/4.4/tutorials/physics/physics_introduction.html#collision-layers-and-masks]Collision layers and masks[/url] in the documentation for more information. */ + get collision_mask(): int64 + set collision_mask(value: int64) + + /** The list of object [RID]s that will be excluded from collisions. Use [method CollisionObject2D.get_rid] to get the [RID] associated with a [CollisionObject2D]-derived node. + * + * **Note:** The returned array is copied and any changes to it will not update the original property value. To update the value you need to modify the returned array, and then assign it to the property again. + */ + get exclude(): GArray + set exclude(value: GArray) + + /** The collision margin for the shape. */ + get margin(): float64 + set margin(value: float64) + + /** The motion of the shape being queried for. */ + get motion(): Vector2 + set motion(value: Vector2) + + /** The [Shape2D] that will be used for collision/intersection queries. This stores the actual reference which avoids the shape to be released while being used for queries, so always prefer using this over [member shape_rid]. */ + get shape(): Shape2D + set shape(value: Shape2D) + + /** The queried shape's [RID] that will be used for collision/intersection queries. Use this over [member shape] if you want to optimize for performance using the Servers API: + * + */ + get shape_rid(): RID + set shape_rid(value: RID) + + /** The queried shape's transform matrix. */ + get transform(): Transform2D + set transform(value: Transform2D) + + /** If `true`, the query will take [PhysicsBody2D]s into account. */ + get collide_with_bodies(): boolean + set collide_with_bodies(value: boolean) + + /** If `true`, the query will take [Area2D]s into account. */ + get collide_with_areas(): boolean + set collide_with_areas(value: boolean) + } + /** Provides parameters for [method PhysicsDirectSpaceState3D.intersect_shape]. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_physicsshapequeryparameters3d.html + */ + class PhysicsShapeQueryParameters3D extends RefCounted { + constructor(identifier?: any) + /** The physics layers the query will detect (as a bitmask). By default, all collision layers are detected. See [url=https://docs.godotengine.org/en/4.4/tutorials/physics/physics_introduction.html#collision-layers-and-masks]Collision layers and masks[/url] in the documentation for more information. */ + get collision_mask(): int64 + set collision_mask(value: int64) + + /** The list of object [RID]s that will be excluded from collisions. Use [method CollisionObject3D.get_rid] to get the [RID] associated with a [CollisionObject3D]-derived node. + * + * **Note:** The returned array is copied and any changes to it will not update the original property value. To update the value you need to modify the returned array, and then assign it to the property again. + */ + get exclude(): GArray + set exclude(value: GArray) + + /** The collision margin for the shape. */ + get margin(): float64 + set margin(value: float64) + + /** The motion of the shape being queried for. */ + get motion(): Vector3 + set motion(value: Vector3) + + /** The [Shape3D] that will be used for collision/intersection queries. This stores the actual reference which avoids the shape to be released while being used for queries, so always prefer using this over [member shape_rid]. */ + get shape(): Shape3D + set shape(value: Shape3D) + + /** The queried shape's [RID] that will be used for collision/intersection queries. Use this over [member shape] if you want to optimize for performance using the Servers API: + * + */ + get shape_rid(): RID + set shape_rid(value: RID) + + /** The queried shape's transform matrix. */ + get transform(): Transform3D + set transform(value: Transform3D) + + /** If `true`, the query will take [PhysicsBody3D]s into account. */ + get collide_with_bodies(): boolean + set collide_with_bodies(value: boolean) + + /** If `true`, the query will take [Area3D]s into account. */ + get collide_with_areas(): boolean + set collide_with_areas(value: boolean) + } + /** Provides parameters for [method PhysicsServer2D.body_test_motion]. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_physicstestmotionparameters2d.html + */ + class PhysicsTestMotionParameters2D extends RefCounted { + constructor(identifier?: any) + /** Transform in global space where the motion should start. Usually set to [member Node2D.global_transform] for the current body's transform. */ + get from(): Transform2D + set from(value: Transform2D) + + /** Motion vector to define the length and direction of the motion to test. */ + get motion(): Vector2 + set motion(value: Vector2) + + /** Increases the size of the shapes involved in the collision detection. */ + get margin(): float64 + set margin(value: float64) + + /** If set to `true`, shapes of type [constant PhysicsServer2D.SHAPE_SEPARATION_RAY] are used to detect collisions and can stop the motion. Can be useful when snapping to the ground. + * If set to `false`, shapes of type [constant PhysicsServer2D.SHAPE_SEPARATION_RAY] are only used for separation when overlapping with other bodies. That's the main use for separation ray shapes. + */ + get collide_separation_ray(): boolean + set collide_separation_ray(value: boolean) + + /** Optional array of body [RID] to exclude from collision. Use [method CollisionObject2D.get_rid] to get the [RID] associated with a [CollisionObject2D]-derived node. */ + get exclude_bodies(): GArray + set exclude_bodies(value: GArray) + + /** Optional array of object unique instance ID to exclude from collision. See [method Object.get_instance_id]. */ + get exclude_objects(): GArray + set exclude_objects(value: GArray) + + /** If set to `true`, any depenetration from the recovery phase is reported as a collision; this is used e.g. by [CharacterBody2D] for improving floor detection during floor snapping. + * If set to `false`, only collisions resulting from the motion are reported, which is generally the desired behavior. + */ + get recovery_as_collision(): boolean + set recovery_as_collision(value: boolean) + } + /** Provides parameters for [method PhysicsServer3D.body_test_motion]. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_physicstestmotionparameters3d.html + */ + class PhysicsTestMotionParameters3D extends RefCounted { + constructor(identifier?: any) + /** Transform in global space where the motion should start. Usually set to [member Node3D.global_transform] for the current body's transform. */ + get from(): Transform3D + set from(value: Transform3D) + + /** Motion vector to define the length and direction of the motion to test. */ + get motion(): Vector3 + set motion(value: Vector3) + + /** Increases the size of the shapes involved in the collision detection. */ + get margin(): float64 + set margin(value: float64) + + /** Maximum number of returned collisions, between `1` and `32`. Always returns the deepest detected collisions. */ + get max_collisions(): int64 + set max_collisions(value: int64) + + /** If set to `true`, shapes of type [constant PhysicsServer3D.SHAPE_SEPARATION_RAY] are used to detect collisions and can stop the motion. Can be useful when snapping to the ground. + * If set to `false`, shapes of type [constant PhysicsServer3D.SHAPE_SEPARATION_RAY] are only used for separation when overlapping with other bodies. That's the main use for separation ray shapes. + */ + get collide_separation_ray(): boolean + set collide_separation_ray(value: boolean) + + /** Optional array of body [RID] to exclude from collision. Use [method CollisionObject3D.get_rid] to get the [RID] associated with a [CollisionObject3D]-derived node. */ + get exclude_bodies(): GArray + set exclude_bodies(value: GArray) + + /** Optional array of object unique instance ID to exclude from collision. See [method Object.get_instance_id]. */ + get exclude_objects(): GArray + set exclude_objects(value: GArray) + + /** If set to `true`, any depenetration from the recovery phase is reported as a collision; this is used e.g. by [CharacterBody3D] for improving floor detection during floor snapping. + * If set to `false`, only collisions resulting from the motion are reported, which is generally the desired behavior. + */ + get recovery_as_collision(): boolean + set recovery_as_collision(value: boolean) + } + /** Describes the motion and collision result from [method PhysicsServer2D.body_test_motion]. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_physicstestmotionresult2d.html + */ + class PhysicsTestMotionResult2D extends RefCounted { + constructor(identifier?: any) + /** Returns the moving object's travel before collision. */ + get_travel(): Vector2 + + /** Returns the moving object's remaining movement vector. */ + get_remainder(): Vector2 + + /** Returns the point of collision in global coordinates, if a collision occurred. */ + get_collision_point(): Vector2 + + /** Returns the colliding body's shape's normal at the point of collision, if a collision occurred. */ + get_collision_normal(): Vector2 + + /** Returns the colliding body's velocity, if a collision occurred. */ + get_collider_velocity(): Vector2 + + /** Returns the unique instance ID of the colliding body's attached [Object], if a collision occurred. See [method Object.get_instance_id]. */ + get_collider_id(): int64 + + /** Returns the colliding body's [RID] used by the [PhysicsServer2D], if a collision occurred. */ + get_collider_rid(): RID + + /** Returns the colliding body's attached [Object], if a collision occurred. */ + get_collider(): Object + + /** Returns the colliding body's shape index, if a collision occurred. See [CollisionObject2D]. */ + get_collider_shape(): int64 + + /** Returns the moving object's colliding shape, if a collision occurred. */ + get_collision_local_shape(): int64 + + /** Returns the length of overlap along the collision normal, if a collision occurred. */ + get_collision_depth(): float64 + + /** Returns the maximum fraction of the motion that can occur without a collision, between `0` and `1`. */ + get_collision_safe_fraction(): float64 + + /** Returns the minimum fraction of the motion needed to collide, if a collision occurred, between `0` and `1`. */ + get_collision_unsafe_fraction(): float64 + } + /** Describes the motion and collision result from [method PhysicsServer3D.body_test_motion]. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_physicstestmotionresult3d.html + */ + class PhysicsTestMotionResult3D extends RefCounted { + constructor(identifier?: any) + /** Returns the moving object's travel before collision. */ + get_travel(): Vector3 + + /** Returns the moving object's remaining movement vector. */ + get_remainder(): Vector3 + + /** Returns the maximum fraction of the motion that can occur without a collision, between `0` and `1`. */ + get_collision_safe_fraction(): float64 + + /** Returns the minimum fraction of the motion needed to collide, if a collision occurred, between `0` and `1`. */ + get_collision_unsafe_fraction(): float64 + + /** Returns the number of detected collisions. */ + get_collision_count(): int64 + + /** Returns the point of collision in global coordinates given a collision index (the deepest collision by default), if a collision occurred. */ + get_collision_point(collision_index: int64 = 0): Vector3 + + /** Returns the colliding body's shape's normal at the point of collision given a collision index (the deepest collision by default), if a collision occurred. */ + get_collision_normal(collision_index: int64 = 0): Vector3 + + /** Returns the colliding body's velocity given a collision index (the deepest collision by default), if a collision occurred. */ + get_collider_velocity(collision_index: int64 = 0): Vector3 + + /** Returns the unique instance ID of the colliding body's attached [Object] given a collision index (the deepest collision by default), if a collision occurred. See [method Object.get_instance_id]. */ + get_collider_id(collision_index: int64 = 0): int64 + + /** Returns the colliding body's [RID] used by the [PhysicsServer3D] given a collision index (the deepest collision by default), if a collision occurred. */ + get_collider_rid(collision_index: int64 = 0): RID + + /** Returns the colliding body's attached [Object] given a collision index (the deepest collision by default), if a collision occurred. */ + get_collider(collision_index: int64 = 0): Object + + /** Returns the colliding body's shape index given a collision index (the deepest collision by default), if a collision occurred. See [CollisionObject3D]. */ + get_collider_shape(collision_index: int64 = 0): int64 + + /** Returns the moving object's colliding shape given a collision index (the deepest collision by default), if a collision occurred. */ + get_collision_local_shape(collision_index: int64 = 0): int64 + + /** Returns the length of overlap along the collision normal given a collision index (the deepest collision by default), if a collision occurred. */ + get_collision_depth(collision_index: int64 = 0): float64 + } + /** A physics joint that attaches two 2D physics bodies at a single point, allowing them to freely rotate. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_pinjoint2d.html + */ + class PinJoint2D = Record> extends Joint2D { + constructor(identifier?: any) + /** The higher this value, the more the bond to the pinned partner can flex. */ + get softness(): float64 + set softness(value: float64) + + /** If `true`, the pin maximum and minimum rotation, defined by [member angular_limit_lower] and [member angular_limit_upper] are applied. */ + get angular_limit_enabled(): boolean + set angular_limit_enabled(value: boolean) + + /** The minimum rotation. Only active if [member angular_limit_enabled] is `true`. */ + get angular_limit_lower(): float64 + set angular_limit_lower(value: float64) + + /** The maximum rotation. Only active if [member angular_limit_enabled] is `true`. */ + get angular_limit_upper(): float64 + set angular_limit_upper(value: float64) + + /** When activated, a motor turns the pin. */ + get motor_enabled(): boolean + set motor_enabled(value: boolean) + + /** Target speed for the motor. In radians per second. */ + get motor_target_velocity(): float64 + set motor_target_velocity(value: float64) + } + namespace PinJoint3D { + enum Param { + /** The force with which the pinned objects stay in positional relation to each other. The higher, the stronger. */ + PARAM_BIAS = 0, + + /** The force with which the pinned objects stay in velocity relation to each other. The higher, the stronger. */ + PARAM_DAMPING = 1, + + /** If above 0, this value is the maximum value for an impulse that this Joint3D produces. */ + PARAM_IMPULSE_CLAMP = 2, + } + } + /** A physics joint that attaches two 3D physics bodies at a single point, allowing them to freely rotate. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_pinjoint3d.html + */ + class PinJoint3D = Record> extends Joint3D { + constructor(identifier?: any) + /** Sets the value of the specified parameter. */ + set_param(param: PinJoint3D.Param, value: float64): void + + /** Returns the value of the specified parameter. */ + get_param(param: PinJoint3D.Param): float64 + + /** The force with which the pinned objects stay in positional relation to each other. The higher, the stronger. */ + get "params/bias"(): float64 + set "params/bias"(value: float64) + + /** The force with which the pinned objects stay in velocity relation to each other. The higher, the stronger. */ + get "params/damping"(): float64 + set "params/damping"(value: float64) + + /** If above 0, this value is the maximum value for an impulse that this Joint3D produces. */ + get "params/impulse_clamp"(): float64 + set "params/impulse_clamp"(value: float64) + } + /** A [Cubemap] without image data. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_placeholdercubemap.html + */ + class PlaceholderCubemap extends PlaceholderTextureLayered { + constructor(identifier?: any) + } + /** A [CubemapArray] without image data. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_placeholdercubemaparray.html + */ + class PlaceholderCubemapArray extends PlaceholderTextureLayered { + constructor(identifier?: any) + } + /** Placeholder class for a material. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_placeholdermaterial.html + */ + class PlaceholderMaterial extends Material { + constructor(identifier?: any) + } + /** Placeholder class for a mesh. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_placeholdermesh.html + */ + class PlaceholderMesh extends Mesh { + constructor(identifier?: any) + /** The smallest [AABB] enclosing this mesh in local space. */ + get aabb(): AABB + set aabb(value: AABB) + } + /** Placeholder class for a 2-dimensional texture. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_placeholdertexture2d.html + */ + class PlaceholderTexture2D extends Texture2D { + constructor(identifier?: any) + /** The texture's size (in pixels). */ + get size(): Vector2 + set size(value: Vector2) + } + /** Placeholder class for a 2-dimensional texture array. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_placeholdertexture2darray.html + */ + class PlaceholderTexture2DArray extends PlaceholderTextureLayered { + constructor(identifier?: any) + } + /** Placeholder class for a 3-dimensional texture. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_placeholdertexture3d.html + */ + class PlaceholderTexture3D extends Texture3D { + constructor(identifier?: any) + /** The texture's size (in pixels). */ + get size(): Vector3i + set size(value: Vector3i) + } + /** Placeholder class for a 2-dimensional texture array. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_placeholdertexturelayered.html + */ + class PlaceholderTextureLayered extends TextureLayered { + constructor(identifier?: any) + /** The size of each texture layer (in pixels). */ + get size(): Vector2i + set size(value: Vector2i) + + /** The number of layers in the texture array. */ + get layers(): int64 + set layers(value: int64) + } + namespace PlaneMesh { + enum Orientation { + /** [PlaneMesh] will face the positive X-axis. */ + FACE_X = 0, + + /** [PlaneMesh] will face the positive Y-axis. This matches the behavior of the [PlaneMesh] in Godot 3.x. */ + FACE_Y = 1, + + /** [PlaneMesh] will face the positive Z-axis. This matches the behavior of the QuadMesh in Godot 3.x. */ + FACE_Z = 2, + } + } + /** Class representing a planar [PrimitiveMesh]. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_planemesh.html + */ + class PlaneMesh extends PrimitiveMesh { + constructor(identifier?: any) + /** Size of the generated plane. */ + get size(): Vector2 + set size(value: Vector2) + + /** Number of subdivision along the X axis. */ + get subdivide_width(): int64 + set subdivide_width(value: int64) + + /** Number of subdivision along the Z axis. */ + get subdivide_depth(): int64 + set subdivide_depth(value: int64) + + /** Offset of the generated plane. Useful for particles. */ + get center_offset(): Vector3 + set center_offset(value: Vector3) + + /** Direction that the [PlaneMesh] is facing. See [enum Orientation] for options. */ + get orientation(): int64 + set orientation(value: int64) + } + class PluginConfigDialog = Record> extends ConfirmationDialog { + constructor(identifier?: any) + readonly plugin_ready: Signal2 + } + /** Positional 2D light source. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_pointlight2d.html + */ + class PointLight2D = Record> extends Light2D { + constructor(identifier?: any) + /** [Texture2D] used for the light's appearance. */ + get texture(): Texture2D | any /*-AnimatedTexture*/ | any /*-AtlasTexture*/ | any /*-CameraTexture*/ | any /*-CanvasTexture*/ | any /*-MeshTexture*/ | any /*-Texture2DRD*/ | any /*-ViewportTexture*/ + set texture(value: Texture2D | any /*-AnimatedTexture*/ | any /*-AtlasTexture*/ | any /*-CameraTexture*/ | any /*-CanvasTexture*/ | any /*-MeshTexture*/ | any /*-Texture2DRD*/ | any /*-ViewportTexture*/) + + /** The offset of the light's [member texture]. */ + get offset(): Vector2 + set offset(value: Vector2) + + /** The [member texture]'s scale factor. */ + get texture_scale(): float64 + set texture_scale(value: float64) + + /** The height of the light. Used with 2D normal mapping. The units are in pixels, e.g. if the height is 100, then it will illuminate an object 100 pixels away at a 45° angle to the plane. */ + get height(): float64 + set height(value: float64) + } + /** Mesh with a single Point primitive. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_pointmesh.html + */ + class PointMesh extends PrimitiveMesh { + constructor(identifier?: any) + } + /** A 2D polygon. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_polygon2d.html + */ + class Polygon2D = Record> extends Node2D { + constructor(identifier?: any) + /** Adds a bone with the specified [param path] and [param weights]. */ + add_bone(path: NodePath | string, weights: PackedFloat32Array | float32[]): void + + /** Returns the number of bones in this [Polygon2D]. */ + get_bone_count(): int64 + + /** Returns the path to the node associated with the specified bone. */ + get_bone_path(index: int64): NodePath + + /** Returns the weight values of the specified bone. */ + get_bone_weights(index: int64): PackedFloat32Array + + /** Removes the specified bone from this [Polygon2D]. */ + erase_bone(index: int64): void + + /** Removes all bones from this [Polygon2D]. */ + clear_bones(): void + + /** Sets the path to the node associated with the specified bone. */ + set_bone_path(index: int64, path: NodePath | string): void + + /** Sets the weight values for the specified bone. */ + set_bone_weights(index: int64, weights: PackedFloat32Array | float32[]): void + + /** The polygon's fill color. If [member texture] is set, it will be multiplied by this color. It will also be the default color for vertices not set in [member vertex_colors]. */ + get color(): Color + set color(value: Color) + + /** The offset applied to each vertex. */ + get offset(): Vector2 + set offset(value: Vector2) + + /** If `true`, polygon edges will be anti-aliased. */ + get antialiased(): boolean + set antialiased(value: boolean) + + /** The polygon's fill texture. Use [member uv] to set texture coordinates. */ + get texture(): Texture2D + set texture(value: Texture2D) + + /** Amount to offset the polygon's [member texture]. If set to `Vector2(0, 0)`, the texture's origin (its top-left corner) will be placed at the polygon's position. */ + get texture_offset(): Vector2 + set texture_offset(value: Vector2) + + /** Amount to multiply the [member uv] coordinates when using [member texture]. Larger values make the texture smaller, and vice versa. */ + get texture_scale(): Vector2 + set texture_scale(value: Vector2) + + /** The texture's rotation in radians. */ + get texture_rotation(): float64 + set texture_rotation(value: float64) + + /** Path to a [Skeleton2D] node used for skeleton-based deformations of this polygon. If empty or invalid, skeletal deformations will not be used. */ + get skeleton(): NodePath + set skeleton(value: NodePath | string) + + /** If `true`, the polygon will be inverted, containing the area outside the defined points and extending to the [member invert_border]. */ + get invert_enabled(): boolean + set invert_enabled(value: boolean) + + /** Added padding applied to the bounding box when [member invert_enabled] is set to `true`. Setting this value too small may result in a "Bad Polygon" error. */ + get invert_border(): float64 + set invert_border(value: float64) + + /** The polygon's list of vertices. The final point will be connected to the first. */ + get polygon(): PackedVector2Array + set polygon(value: PackedVector2Array | Vector2[]) + + /** Texture coordinates for each vertex of the polygon. There should be one UV value per polygon vertex. If there are fewer, undefined vertices will use `Vector2(0, 0)`. */ + get uv(): PackedVector2Array + set uv(value: PackedVector2Array | Vector2[]) + + /** Color for each vertex. Colors are interpolated between vertices, resulting in smooth gradients. There should be one per polygon vertex. If there are fewer, undefined vertices will use [member color]. */ + get vertex_colors(): PackedColorArray + set vertex_colors(value: PackedColorArray | Color[]) + + /** The list of polygons, in case more than one is being represented. Every individual polygon is stored as a [PackedInt32Array] where each [int] is an index to a point in [member polygon]. If empty, this property will be ignored, and the resulting single polygon will be composed of all points in [member polygon], using the order they are stored in. */ + get polygons(): GArray + set polygons(value: GArray) + get bones(): GArray + set bones(value: GArray) + + /** Number of internal vertices, used for UV mapping. */ + get internal_vertex_count(): int64 + set internal_vertex_count(value: int64) + } + class Polygon2DEditor = Record> extends AbstractPolygon2DEditor { + constructor(identifier?: any) + _update_bone_list(): void + _update_polygon_editing_state(): void + } + class Polygon2DEditorPlugin = Record> extends AbstractPolygon2DEditorPlugin { + constructor(identifier?: any) + } + class Polygon3DEditor = Record> extends HBoxContainer { + constructor(identifier?: any) + _polygon_draw(): void + } + class Polygon3DEditorPlugin = Record> extends EditorPlugin { + constructor(identifier?: any) + } + /** Flat 2D polygon shape for use with occlusion culling in [OccluderInstance3D]. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_polygonoccluder3d.html + */ + class PolygonOccluder3D extends Occluder3D { + constructor(identifier?: any) + _has_editable_3d_polygon_no_depth(): boolean + + /** The polygon to use for occlusion culling. The polygon can be convex or concave, but it should have as few points as possible to maximize performance. + * The polygon must *not* have intersecting lines. Otherwise, triangulation will fail (with an error message printed). + */ + get polygon(): PackedVector2Array + set polygon(value: PackedVector2Array | Vector2[]) + } + /** @link https://docs.godotengine.org/en/4.4/classes/class_polygonpathfinder.html */ + class PolygonPathFinder extends Resource { + constructor(identifier?: any) + /** Sets up [PolygonPathFinder] with an array of points that define the vertices of the polygon, and an array of indices that determine the edges of the polygon. + * The length of [param connections] must be even, returns an error if odd. + * + */ + setup(points: PackedVector2Array | Vector2[], connections: PackedInt32Array | int32[]): void + find_path(from: Vector2, to: Vector2): PackedVector2Array + get_intersections(from: Vector2, to: Vector2): PackedVector2Array + get_closest_point(point: Vector2): Vector2 + + /** Returns `true` if [param point] falls inside the polygon area. + * + */ + is_point_inside(point: Vector2): boolean + set_point_penalty(idx: int64, penalty: float64): void + get_point_penalty(idx: int64): float64 + get_bounds(): Rect2 + get data(): GDictionary + set data(value: GDictionary) + } + /** Base class for contextual windows and panels with fixed position. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_popup.html + */ + class Popup = Record> extends Window { + constructor(identifier?: any) + /** Emitted when the popup is hidden. */ + readonly popup_hide: Signal0 + } + /** A modal window used to display a list of options. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_popupmenu.html + */ + class PopupMenu = Record> extends Popup { + constructor(identifier?: any) + /** Checks the provided [param event] against the [PopupMenu]'s shortcuts and accelerators, and activates the first item with matching events. If [param for_global_only] is `true`, only shortcuts and accelerators with `global` set to `true` will be called. + * Returns `true` if an item was successfully activated. + * + * **Note:** Certain [Control]s, such as [MenuButton], will call this method automatically. + */ + activate_item_by_event(event: InputEvent, for_global_only: boolean = false): boolean + + /** Returns `true` if the system native menu is supported and currently used by this [PopupMenu]. */ + is_native_menu(): boolean + + /** Adds a new item with text [param label]. + * An [param id] can optionally be provided, as well as an accelerator ([param accel]). If no [param id] is provided, one will be created from the index. If no [param accel] is provided, then the default value of 0 (corresponding to [constant @GlobalScope.KEY_NONE]) will be assigned to the item (which means it won't have any accelerator). See [method get_item_accelerator] for more info on accelerators. + * + * **Note:** The provided [param id] is used only in [signal id_pressed] and [signal id_focused] signals. It's not related to the `index` arguments in e.g. [method set_item_checked]. + */ + add_item(label: string, id: int64 = -1, accel: Key = 0): void + + /** Adds a new item with text [param label] and icon [param texture]. + * An [param id] can optionally be provided, as well as an accelerator ([param accel]). If no [param id] is provided, one will be created from the index. If no [param accel] is provided, then the default value of 0 (corresponding to [constant @GlobalScope.KEY_NONE]) will be assigned to the item (which means it won't have any accelerator). See [method get_item_accelerator] for more info on accelerators. + */ + add_icon_item(texture: Texture2D, label: string, id: int64 = -1, accel: Key = 0): void + + /** Adds a new checkable item with text [param label]. + * An [param id] can optionally be provided, as well as an accelerator ([param accel]). If no [param id] is provided, one will be created from the index. If no [param accel] is provided, then the default value of 0 (corresponding to [constant @GlobalScope.KEY_NONE]) will be assigned to the item (which means it won't have any accelerator). See [method get_item_accelerator] for more info on accelerators. + * + * **Note:** Checkable items just display a checkmark, but don't have any built-in checking behavior and must be checked/unchecked manually. See [method set_item_checked] for more info on how to control it. + */ + add_check_item(label: string, id: int64 = -1, accel: Key = 0): void + + /** Adds a new checkable item with text [param label] and icon [param texture]. + * An [param id] can optionally be provided, as well as an accelerator ([param accel]). If no [param id] is provided, one will be created from the index. If no [param accel] is provided, then the default value of 0 (corresponding to [constant @GlobalScope.KEY_NONE]) will be assigned to the item (which means it won't have any accelerator). See [method get_item_accelerator] for more info on accelerators. + * + * **Note:** Checkable items just display a checkmark, but don't have any built-in checking behavior and must be checked/unchecked manually. See [method set_item_checked] for more info on how to control it. + */ + add_icon_check_item(texture: Texture2D, label: string, id: int64 = -1, accel: Key = 0): void + + /** Adds a new radio check button with text [param label]. + * An [param id] can optionally be provided, as well as an accelerator ([param accel]). If no [param id] is provided, one will be created from the index. If no [param accel] is provided, then the default value of 0 (corresponding to [constant @GlobalScope.KEY_NONE]) will be assigned to the item (which means it won't have any accelerator). See [method get_item_accelerator] for more info on accelerators. + * + * **Note:** Checkable items just display a checkmark, but don't have any built-in checking behavior and must be checked/unchecked manually. See [method set_item_checked] for more info on how to control it. + */ + add_radio_check_item(label: string, id: int64 = -1, accel: Key = 0): void + + /** Same as [method add_icon_check_item], but uses a radio check button. */ + add_icon_radio_check_item(texture: Texture2D, label: string, id: int64 = -1, accel: Key = 0): void + + /** Adds a new multistate item with text [param label]. + * Contrarily to normal binary items, multistate items can have more than two states, as defined by [param max_states]. The default value is defined by [param default_state]. + * An [param id] can optionally be provided, as well as an accelerator ([param accel]). If no [param id] is provided, one will be created from the index. If no [param accel] is provided, then the default value of 0 (corresponding to [constant @GlobalScope.KEY_NONE]) will be assigned to the item (which means it won't have any accelerator). See [method get_item_accelerator] for more info on accelerators. + * + * + * **Note:** Multistate items don't update their state automatically and must be done manually. See [method toggle_item_multistate], [method set_item_multistate] and [method get_item_multistate] for more info on how to control it. + */ + add_multistate_item(label: string, max_states: int64, default_state: int64 = 0, id: int64 = -1, accel: Key = 0): void + + /** Adds a [Shortcut]. + * An [param id] can optionally be provided. If no [param id] is provided, one will be created from the index. + * If [param allow_echo] is `true`, the shortcut can be activated with echo events. + */ + add_shortcut(shortcut: Shortcut, id: int64 = -1, global: boolean = false, allow_echo: boolean = false): void + + /** Adds a new item and assigns the specified [Shortcut] and icon [param texture] to it. Sets the label of the checkbox to the [Shortcut]'s name. + * An [param id] can optionally be provided. If no [param id] is provided, one will be created from the index. + * If [param allow_echo] is `true`, the shortcut can be activated with echo events. + */ + add_icon_shortcut(texture: Texture2D, shortcut: Shortcut, id: int64 = -1, global: boolean = false, allow_echo: boolean = false): void + + /** Adds a new checkable item and assigns the specified [Shortcut] to it. Sets the label of the checkbox to the [Shortcut]'s name. + * An [param id] can optionally be provided. If no [param id] is provided, one will be created from the index. + * + * **Note:** Checkable items just display a checkmark, but don't have any built-in checking behavior and must be checked/unchecked manually. See [method set_item_checked] for more info on how to control it. + */ + add_check_shortcut(shortcut: Shortcut, id: int64 = -1, global: boolean = false): void + + /** Adds a new checkable item and assigns the specified [Shortcut] and icon [param texture] to it. Sets the label of the checkbox to the [Shortcut]'s name. + * An [param id] can optionally be provided. If no [param id] is provided, one will be created from the index. + * + * **Note:** Checkable items just display a checkmark, but don't have any built-in checking behavior and must be checked/unchecked manually. See [method set_item_checked] for more info on how to control it. + */ + add_icon_check_shortcut(texture: Texture2D, shortcut: Shortcut, id: int64 = -1, global: boolean = false): void + + /** Adds a new radio check button and assigns a [Shortcut] to it. Sets the label of the checkbox to the [Shortcut]'s name. + * An [param id] can optionally be provided. If no [param id] is provided, one will be created from the index. + * + * **Note:** Checkable items just display a checkmark, but don't have any built-in checking behavior and must be checked/unchecked manually. See [method set_item_checked] for more info on how to control it. + */ + add_radio_check_shortcut(shortcut: Shortcut, id: int64 = -1, global: boolean = false): void + + /** Same as [method add_icon_check_shortcut], but uses a radio check button. */ + add_icon_radio_check_shortcut(texture: Texture2D, shortcut: Shortcut, id: int64 = -1, global: boolean = false): void + + /** Adds an item that will act as a submenu of the parent [PopupMenu] node when clicked. The [param submenu] argument must be the name of an existing [PopupMenu] that has been added as a child to this node. This submenu will be shown when the item is clicked, hovered for long enough, or activated using the `ui_select` or `ui_right` input actions. + * An [param id] can optionally be provided. If no [param id] is provided, one will be created from the index. + */ + add_submenu_item(label: string, submenu: string, id: int64 = -1): void + + /** Adds an item that will act as a submenu of the parent [PopupMenu] node when clicked. This submenu will be shown when the item is clicked, hovered for long enough, or activated using the `ui_select` or `ui_right` input actions. + * [param submenu] must be either child of this [PopupMenu] or has no parent node (in which case it will be automatically added as a child). If the [param submenu] popup has another parent, this method will fail. + * An [param id] can optionally be provided. If no [param id] is provided, one will be created from the index. + */ + add_submenu_node_item(label: string, submenu: PopupMenu, id: int64 = -1): void + + /** Sets the text of the item at the given [param index]. */ + set_item_text(index: int64, text: string): void + + /** Sets item's text base writing direction. */ + set_item_text_direction(index: int64, direction: Control.TextDirection): void + + /** Sets language code of item's text used for line-breaking and text shaping algorithms, if left empty current locale is used instead. */ + set_item_language(index: int64, language: string): void + + /** Replaces the [Texture2D] icon of the item at the given [param index]. */ + set_item_icon(index: int64, icon: Texture2D): void + + /** Sets the maximum allowed width of the icon for the item at the given [param index]. This limit is applied on top of the default size of the icon and on top of [theme_item icon_max_width]. The height is adjusted according to the icon's ratio. */ + set_item_icon_max_width(index: int64, width: int64): void + + /** Sets a modulating [Color] of the item's icon at the given [param index]. */ + set_item_icon_modulate(index: int64, modulate: Color): void + + /** Sets the checkstate status of the item at the given [param index]. */ + set_item_checked(index: int64, checked: boolean): void + + /** Sets the [param id] of the item at the given [param index]. + * The [param id] is used in [signal id_pressed] and [signal id_focused] signals. + */ + set_item_id(index: int64, id: int64): void + + /** Sets the accelerator of the item at the given [param index]. An accelerator is a keyboard shortcut that can be pressed to trigger the menu button even if it's not currently open. [param accel] is generally a combination of [enum KeyModifierMask]s and [enum Key]s using bitwise OR such as `KEY_MASK_CTRL | KEY_A` ([kbd]Ctrl + A[/kbd]). */ + set_item_accelerator(index: int64, accel: Key): void + + /** Sets the metadata of an item, which may be of any type. You can later get it with [method get_item_metadata], which provides a simple way of assigning context data to items. */ + set_item_metadata(index: int64, metadata: any): void + + /** Enables/disables the item at the given [param index]. When it is disabled, it can't be selected and its action can't be invoked. */ + set_item_disabled(index: int64, disabled: boolean): void + + /** Sets the submenu of the item at the given [param index]. The submenu is the name of a child [PopupMenu] node that would be shown when the item is clicked. */ + set_item_submenu(index: int64, submenu: string): void + + /** Sets the submenu of the item at the given [param index]. The submenu is a [PopupMenu] node that would be shown when the item is clicked. It must either be a child of this [PopupMenu] or has no parent (in which case it will be automatically added as a child). If the [param submenu] popup has another parent, this method will fail. */ + set_item_submenu_node(index: int64, submenu: PopupMenu): void + + /** Mark the item at the given [param index] as a separator, which means that it would be displayed as a line. If `false`, sets the type of the item to plain text. */ + set_item_as_separator(index: int64, enable: boolean): void + + /** Sets whether the item at the given [param index] has a checkbox. If `false`, sets the type of the item to plain text. + * + * **Note:** Checkable items just display a checkmark, but don't have any built-in checking behavior and must be checked/unchecked manually. + */ + set_item_as_checkable(index: int64, enable: boolean): void + + /** Sets the type of the item at the given [param index] to radio button. If `false`, sets the type of the item to plain text. */ + set_item_as_radio_checkable(index: int64, enable: boolean): void + + /** Sets the [String] tooltip of the item at the given [param index]. */ + set_item_tooltip(index: int64, tooltip: string): void + + /** Sets a [Shortcut] for the item at the given [param index]. */ + set_item_shortcut(index: int64, shortcut: Shortcut, global: boolean = false): void + + /** Sets the horizontal offset of the item at the given [param index]. */ + set_item_indent(index: int64, indent: int64): void + + /** Sets the state of a multistate item. See [method add_multistate_item] for details. */ + set_item_multistate(index: int64, state: int64): void + + /** Sets the max states of a multistate item. See [method add_multistate_item] for details. */ + set_item_multistate_max(index: int64, max_states: int64): void + + /** Disables the [Shortcut] of the item at the given [param index]. */ + set_item_shortcut_disabled(index: int64, disabled: boolean): void + + /** Toggles the check state of the item at the given [param index]. */ + toggle_item_checked(index: int64): void + + /** Cycle to the next state of a multistate item. See [method add_multistate_item] for details. */ + toggle_item_multistate(index: int64): void + + /** Returns the text of the item at the given [param index]. */ + get_item_text(index: int64): string + + /** Returns item's text base writing direction. */ + get_item_text_direction(index: int64): Control.TextDirection + + /** Returns item's text language code. */ + get_item_language(index: int64): string + + /** Returns the icon of the item at the given [param index]. */ + get_item_icon(index: int64): Texture2D + + /** Returns the maximum allowed width of the icon for the item at the given [param index]. */ + get_item_icon_max_width(index: int64): int64 + + /** Returns a [Color] modulating the item's icon at the given [param index]. */ + get_item_icon_modulate(index: int64): Color + + /** Returns `true` if the item at the given [param index] is checked. */ + is_item_checked(index: int64): boolean + + /** Returns the ID of the item at the given [param index]. `id` can be manually assigned, while index can not. */ + get_item_id(index: int64): int64 + + /** Returns the index of the item containing the specified [param id]. Index is automatically assigned to each item by the engine and can not be set manually. */ + get_item_index(id: int64): int64 + + /** Returns the accelerator of the item at the given [param index]. An accelerator is a keyboard shortcut that can be pressed to trigger the menu button even if it's not currently open. The return value is an integer which is generally a combination of [enum KeyModifierMask]s and [enum Key]s using bitwise OR such as `KEY_MASK_CTRL | KEY_A` ([kbd]Ctrl + A[/kbd]). If no accelerator is defined for the specified [param index], [method get_item_accelerator] returns `0` (corresponding to [constant @GlobalScope.KEY_NONE]). */ + get_item_accelerator(index: int64): Key + + /** Returns the metadata of the specified item, which might be of any type. You can set it with [method set_item_metadata], which provides a simple way of assigning context data to items. */ + get_item_metadata(index: int64): any + + /** Returns `true` if the item at the given [param index] is disabled. When it is disabled it can't be selected, or its action invoked. + * See [method set_item_disabled] for more info on how to disable an item. + */ + is_item_disabled(index: int64): boolean + + /** Returns the submenu name of the item at the given [param index]. See [method add_submenu_item] for more info on how to add a submenu. */ + get_item_submenu(index: int64): string + + /** Returns the submenu of the item at the given [param index], or `null` if no submenu was added. See [method add_submenu_node_item] for more info on how to add a submenu. */ + get_item_submenu_node(index: int64): PopupMenu + + /** Returns `true` if the item is a separator. If it is, it will be displayed as a line. See [method add_separator] for more info on how to add a separator. */ + is_item_separator(index: int64): boolean + + /** Returns `true` if the item at the given [param index] is checkable in some way, i.e. if it has a checkbox or radio button. + * + * **Note:** Checkable items just display a checkmark or radio button, but don't have any built-in checking behavior and must be checked/unchecked manually. + */ + is_item_checkable(index: int64): boolean + + /** Returns `true` if the item at the given [param index] has radio button-style checkability. + * + * **Note:** This is purely cosmetic; you must add the logic for checking/unchecking items in radio groups. + */ + is_item_radio_checkable(index: int64): boolean + + /** Returns `true` if the specified item's shortcut is disabled. */ + is_item_shortcut_disabled(index: int64): boolean + + /** Returns the tooltip associated with the item at the given [param index]. */ + get_item_tooltip(index: int64): string + + /** Returns the [Shortcut] associated with the item at the given [param index]. */ + get_item_shortcut(index: int64): Shortcut + + /** Returns the horizontal offset of the item at the given [param index]. */ + get_item_indent(index: int64): int64 + + /** Returns the max states of the item at the given [param index]. */ + get_item_multistate_max(index: int64): int64 + + /** Returns the state of the item at the given [param index]. */ + get_item_multistate(index: int64): int64 + + /** Sets the currently focused item as the given [param index]. + * Passing `-1` as the index makes so that no item is focused. + */ + set_focused_item(index: int64): void + + /** Returns the index of the currently focused item. Returns `-1` if no item is focused. */ + get_focused_item(): int64 + + /** Moves the scroll view to make the item at the given [param index] visible. */ + scroll_to_item(index: int64): void + + /** Removes the item at the given [param index] from the menu. + * + * **Note:** The indices of items after the removed item will be shifted by one. + */ + remove_item(index: int64): void + + /** Adds a separator between items. Separators also occupy an index, which you can set by using the [param id] parameter. + * A [param label] can optionally be provided, which will appear at the center of the separator. + */ + add_separator(label: string = '', id: int64 = -1): void + + /** Removes all items from the [PopupMenu]. If [param free_submenus] is `true`, the submenu nodes are automatically freed. */ + clear(free_submenus: boolean = false): void + + /** Returns `true` if the menu is bound to the special system menu. */ + is_system_menu(): boolean + + /** If `true`, hides the [PopupMenu] when an item is selected. */ + get hide_on_item_selection(): boolean + set hide_on_item_selection(value: boolean) + + /** If `true`, hides the [PopupMenu] when a checkbox or radio button is selected. */ + get hide_on_checkable_item_selection(): boolean + set hide_on_checkable_item_selection(value: boolean) + + /** If `true`, hides the [PopupMenu] when a state item is selected. */ + get hide_on_state_item_selection(): boolean + set hide_on_state_item_selection(value: boolean) + + /** Sets the delay time in seconds for the submenu item to popup on mouse hovering. If the popup menu is added as a child of another (acting as a submenu), it will inherit the delay time of the parent menu item. */ + get submenu_popup_delay(): float64 + set submenu_popup_delay(value: float64) + + /** If `true`, allows navigating [PopupMenu] with letter keys. */ + get allow_search(): boolean + set allow_search(value: boolean) + + /** If set to one of the values of [enum NativeMenu.SystemMenus], this [PopupMenu] is bound to the special system menu. Only one [PopupMenu] can be bound to each special menu at a time. */ + get system_menu_id(): int64 + set system_menu_id(value: int64) + + /** If `true`, [MenuBar] will use native menu when supported. + * + * **Note:** If [PopupMenu] is linked to [StatusIndicator], [MenuBar], or another [PopupMenu] item it can use native menu regardless of this property, use [method is_native_menu] to check it. + */ + get prefer_native_menu(): boolean + set prefer_native_menu(value: boolean) + + /** The number of items currently in the list. */ + get item_count(): any /*Items,item_*/ + set item_count(value: any /*Items,item_*/) + + /** Emitted when an item of some [param id] is pressed or its accelerator is activated. + * + * **Note:** If [param id] is negative (either explicitly or due to overflow), this will return the corresponding index instead. + */ + readonly id_pressed: Signal1 + + /** Emitted when the user navigated to an item of some [param id] using the [member ProjectSettings.input/ui_up] or [member ProjectSettings.input/ui_down] input action. */ + readonly id_focused: Signal1 + + /** Emitted when an item of some [param index] is pressed or its accelerator is activated. */ + readonly index_pressed: Signal1 + + /** Emitted when any item is added, modified or removed. */ + readonly menu_changed: Signal0 + } + /** A popup with a panel background. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_popuppanel.html + */ + class PopupPanel = Record> extends Popup { + constructor(identifier?: any) + } + namespace PortableCompressedTexture2D { + enum CompressionMode { + COMPRESSION_MODE_LOSSLESS = 0, + COMPRESSION_MODE_LOSSY = 1, + COMPRESSION_MODE_BASIS_UNIVERSAL = 2, + COMPRESSION_MODE_S3TC = 3, + COMPRESSION_MODE_ETC2 = 4, + COMPRESSION_MODE_BPTC = 5, + } + } + /** Provides a compressed texture for disk and/or VRAM in a way that is portable. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_portablecompressedtexture2d.html + */ + class PortableCompressedTexture2D extends Texture2D { + constructor(identifier?: any) + /** Initializes the compressed texture from a base image. The compression mode must be provided. + * [param normal_map] is recommended to ensure optimum quality if this image will be used as a normal map. + * If lossy compression is requested, the quality setting can optionally be provided. This maps to Lossy WebP compression quality. + */ + create_from_image(image: Image, compression_mode: PortableCompressedTexture2D.CompressionMode, normal_map: boolean = false, lossy_quality: float64 = 0.8): void + + /** Return the image format used (valid after initialized). */ + get_format(): Image.Format + + /** Return the compression mode used (valid after initialized). */ + get_compression_mode(): PortableCompressedTexture2D.CompressionMode + + /** Overrides the flag globally for all textures of this type. This is used primarily by the editor. */ + static set_keep_all_compressed_buffers(keep: boolean): void + + /** Return whether the flag is overridden for all textures of this type. */ + static is_keeping_all_compressed_buffers(): boolean + get _data(): PackedByteArray + set _data(value: PackedByteArray | byte[] | ArrayBuffer) + + /** Allow overriding the texture size (for 2D only). */ + get size_override(): Vector2 + set size_override(value: Vector2) + + /** When running on the editor, this class will keep the source compressed data in memory. Otherwise, the source compressed data is lost after loading and the resource can't be re saved. + * This flag allows to keep the compressed data in memory if you intend it to persist after loading. + */ + get keep_compressed_buffer(): boolean + set keep_compressed_buffer(value: boolean) + } + class PostImportPluginSkeletonRenamer extends EditorScenePostImportPlugin { + constructor(identifier?: any) + } + class PostImportPluginSkeletonRestFixer extends EditorScenePostImportPlugin { + constructor(identifier?: any) + } + class PostImportPluginSkeletonTrackOrganizer extends EditorScenePostImportPlugin { + constructor(identifier?: any) + } + /** Base class for all primitive meshes. Handles applying a [Material] to a primitive mesh. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_primitivemesh.html + */ + class PrimitiveMesh extends Mesh { + constructor(identifier?: any) + /** Override this method to customize how this primitive mesh should be generated. Should return an [Array] where each element is another Array of values required for the mesh (see the [enum Mesh.ArrayType] constants). */ + /* gdvirtual */ _create_mesh_array(): GArray + + /** Returns the mesh arrays used to make up the surface of this primitive mesh. + * **Example:** Pass the result to [method ArrayMesh.add_surface_from_arrays] to create a new surface: + * + */ + get_mesh_arrays(): GArray + + /** Request an update of this primitive mesh based on its properties. */ + request_update(): void + + /** The current [Material] of the primitive mesh. */ + get material(): BaseMaterial3D | ShaderMaterial + set material(value: BaseMaterial3D | ShaderMaterial) + + /** Overrides the [AABB] with one defined by user for use with frustum culling. Especially useful to avoid unexpected culling when using a shader to offset vertices. */ + get custom_aabb(): AABB + set custom_aabb(value: AABB) + + /** If set, the order of the vertices in each triangle are reversed resulting in the backside of the mesh being drawn. + * This gives the same result as using [constant BaseMaterial3D.CULL_FRONT] in [member BaseMaterial3D.cull_mode]. + */ + get flip_faces(): boolean + set flip_faces(value: boolean) + + /** If set, generates UV2 UV coordinates applying a padding using the [member uv2_padding] setting. UV2 is needed for lightmapping. */ + get add_uv2(): boolean + set add_uv2(value: boolean) + + /** If [member add_uv2] is set, specifies the padding in pixels applied along seams of the mesh. Lower padding values allow making better use of the lightmap texture (resulting in higher texel density), but may introduce visible lightmap bleeding along edges. + * If the size of the lightmap texture can't be determined when generating the mesh, UV2 is calculated assuming a texture size of 1024x1024. + */ + get uv2_padding(): float64 + set uv2_padding(value: float64) + } + /** Class representing a prism-shaped [PrimitiveMesh]. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_prismmesh.html + */ + class PrismMesh extends PrimitiveMesh { + constructor(identifier?: any) + /** Displacement of the upper edge along the X axis. 0.0 positions edge straight above the bottom-left edge. */ + get left_to_right(): float64 + set left_to_right(value: float64) + + /** Size of the prism. */ + get size(): Vector3 + set size(value: Vector3) + + /** Number of added edge loops along the X axis. */ + get subdivide_width(): int64 + set subdivide_width(value: int64) + + /** Number of added edge loops along the Y axis. */ + get subdivide_height(): int64 + set subdivide_height(value: int64) + + /** Number of added edge loops along the Z axis. */ + get subdivide_depth(): int64 + set subdivide_depth(value: int64) + } + /** A material that defines a simple sky for a [Sky] resource. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_proceduralskymaterial.html + */ + class ProceduralSkyMaterial extends Material { + constructor(identifier?: any) + /** Color of the sky at the top. Blends with [member sky_horizon_color]. */ + get sky_top_color(): Color + set sky_top_color(value: Color) + + /** Color of the sky at the horizon. Blends with [member sky_top_color]. */ + get sky_horizon_color(): Color + set sky_horizon_color(value: Color) + + /** How quickly the [member sky_horizon_color] fades into the [member sky_top_color]. */ + get sky_curve(): float64 + set sky_curve(value: float64) + + /** Multiplier for sky color. A higher value will make the sky brighter. */ + get sky_energy_multiplier(): float64 + set sky_energy_multiplier(value: float64) + + /** The sky cover texture to use. This texture must use an equirectangular projection (similar to [PanoramaSkyMaterial]). The texture's colors will be *added* to the existing sky color, and will be multiplied by [member sky_energy_multiplier] and [member sky_cover_modulate]. This is mainly suited to displaying stars at night, but it can also be used to display clouds at day or night (with a non-physically-accurate look). */ + get sky_cover(): Texture2D + set sky_cover(value: Texture2D) + + /** The tint to apply to the [member sky_cover] texture. This can be used to change the sky cover's colors or opacity independently of the sky energy, which is useful for day/night or weather transitions. Only effective if a texture is defined in [member sky_cover]. */ + get sky_cover_modulate(): Color + set sky_cover_modulate(value: Color) + + /** Color of the ground at the bottom. Blends with [member ground_horizon_color]. */ + get ground_bottom_color(): Color + set ground_bottom_color(value: Color) + + /** Color of the ground at the horizon. Blends with [member ground_bottom_color]. */ + get ground_horizon_color(): Color + set ground_horizon_color(value: Color) + + /** How quickly the [member ground_horizon_color] fades into the [member ground_bottom_color]. */ + get ground_curve(): float64 + set ground_curve(value: float64) + + /** Multiplier for ground color. A higher value will make the ground brighter. */ + get ground_energy_multiplier(): float64 + set ground_energy_multiplier(value: float64) + + /** Distance from center of sun where it fades out completely. */ + get sun_angle_max(): float64 + set sun_angle_max(value: float64) + + /** How quickly the sun fades away between the edge of the sun disk and [member sun_angle_max]. */ + get sun_curve(): float64 + set sun_curve(value: float64) + + /** If `true`, enables debanding. Debanding adds a small amount of noise which helps reduce banding that appears from the smooth changes in color in the sky. */ + get use_debanding(): boolean + set use_debanding(value: boolean) + + /** The sky's overall brightness multiplier. Higher values result in a brighter sky. */ + get energy_multiplier(): float64 + set energy_multiplier(value: float64) + } + class ProceduralSkyMaterialConversionPlugin extends EditorResourceConversionPlugin { + constructor(identifier?: any) + } + namespace ProgressBar { + enum FillMode { + /** The progress bar fills from begin to end horizontally, according to the language direction. If [method Control.is_layout_rtl] returns `false`, it fills from left to right, and if it returns `true`, it fills from right to left. */ + FILL_BEGIN_TO_END = 0, + + /** The progress bar fills from end to begin horizontally, according to the language direction. If [method Control.is_layout_rtl] returns `false`, it fills from right to left, and if it returns `true`, it fills from left to right. */ + FILL_END_TO_BEGIN = 1, + + /** The progress fills from top to bottom. */ + FILL_TOP_TO_BOTTOM = 2, + + /** The progress fills from bottom to top. */ + FILL_BOTTOM_TO_TOP = 3, + } + } + /** A control used for visual representation of a percentage. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_progressbar.html + */ + class ProgressBar = Record> extends Range { + constructor(identifier?: any) + /** The fill direction. See [enum FillMode] for possible values. */ + get fill_mode(): int64 + set fill_mode(value: int64) + + /** If `true`, the fill percentage is displayed on the bar. */ + get show_percentage(): boolean + set show_percentage(value: boolean) + + /** When set to `true`, the progress bar indicates that something is happening with an animation, but does not show the fill percentage or value. */ + get indeterminate(): boolean + set indeterminate(value: boolean) + + /** If `false`, the [member indeterminate] animation will be paused in the editor. */ + get editor_preview_indeterminate(): boolean + set editor_preview_indeterminate(value: boolean) + } + class ProgressDialog = Record> extends CenterContainer { + constructor(identifier?: any) + } + class ProjectExportDialog = Record> extends ConfirmationDialog { + constructor(identifier?: any) + get_current_preset(): EditorExportPreset + get export_path(): string + set export_path(value: string) + } + class ProjectExportTextureFormatError = Record> extends HBoxContainer { + constructor(identifier?: any) + readonly texture_format_enabled: Signal0 + } + class ProjectSettingsEditor = Record> extends AcceptDialog { + constructor(identifier?: any) + queue_save(): void + _update_action_map_editor(): void + } + class PropertySelector = Record> extends ConfirmationDialog { + constructor(identifier?: any) + readonly selected: Signal1 + } + /** Interpolates an [Object]'s property over time. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_propertytweener.html + */ + class PropertyTweener extends Tweener { + constructor(identifier?: any) + /** Sets a custom initial value to the [PropertyTweener]. + * **Example:** Move the node from position `(100, 100)` to `(200, 100)`. + * + */ + from(value: any): PropertyTweener + + /** Makes the [PropertyTweener] use the current property value (i.e. at the time of creating this [PropertyTweener]) as a starting point. This is equivalent of using [method from] with the current value. These two calls will do the same: + * + */ + from_current(): PropertyTweener + + /** When called, the final value will be used as a relative value instead. + * **Example:** Move the node by `100` pixels to the right. + * + */ + as_relative(): PropertyTweener + + /** Sets the type of used transition from [enum Tween.TransitionType]. If not set, the default transition is used from the [Tween] that contains this Tweener. */ + set_trans(trans: Tween.TransitionType): PropertyTweener + + /** Sets the type of used easing from [enum Tween.EaseType]. If not set, the default easing is used from the [Tween] that contains this Tweener. */ + set_ease(ease: Tween.EaseType): PropertyTweener + + /** Allows interpolating the value with a custom easing function. The provided [param interpolator_method] will be called with a value ranging from `0.0` to `1.0` and is expected to return a value within the same range (values outside the range can be used for overshoot). The return value of the method is then used for interpolation between initial and final value. Note that the parameter passed to the method is still subject to the tweener's own easing. + * + */ + set_custom_interpolator(interpolator_method: Callable): PropertyTweener + + /** Sets the time in seconds after which the [PropertyTweener] will start interpolating. By default there's no delay. */ + set_delay(delay: float64): PropertyTweener + } + /** Class representing a square mesh facing the camera. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_quadmesh.html + */ + class QuadMesh extends PlaneMesh { + constructor(identifier?: any) + } + /** Flat plane shape for use with occlusion culling in [OccluderInstance3D]. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_quadoccluder3d.html + */ + class QuadOccluder3D extends Occluder3D { + constructor(identifier?: any) + /** The quad's size in 3D units. */ + get size(): Vector2 + set size(value: Vector2) + } + class QuickOpenResultContainer = Record> extends VBoxContainer { + constructor(identifier?: any) + readonly result_clicked: Signal0 + } + /** Attachment format (used by [RenderingDevice]). + * + * @link https://docs.godotengine.org/en/4.4/classes/class_rdattachmentformat.html + */ + class RDAttachmentFormat extends RefCounted { + constructor(identifier?: any) + /** The attachment's data format. */ + get format(): int64 + set format(value: int64) + + /** The number of samples used when sampling the attachment. */ + get samples(): int64 + set samples(value: int64) + + /** The attachment's usage flags, which determine what can be done with it. */ + get usage_flags(): int64 + set usage_flags(value: int64) + } + /** Framebuffer pass attachment description (used by [RenderingDevice]). + * + * @link https://docs.godotengine.org/en/4.4/classes/class_rdframebufferpass.html + */ + class RDFramebufferPass extends RefCounted { + /** Attachment is unused. */ + static readonly ATTACHMENT_UNUSED = -1 + constructor(identifier?: any) + + /** Color attachments in order starting from 0. If this attachment is not used by the shader, pass ATTACHMENT_UNUSED to skip. */ + get color_attachments(): PackedInt32Array + set color_attachments(value: PackedInt32Array | int32[]) + + /** Used for multipass framebuffers (more than one render pass). Converts an attachment to an input. Make sure to also supply it properly in the [RDUniform] for the uniform set. */ + get input_attachments(): PackedInt32Array + set input_attachments(value: PackedInt32Array | int32[]) + + /** If the color attachments are multisampled, non-multisampled resolve attachments can be provided. */ + get resolve_attachments(): PackedInt32Array + set resolve_attachments(value: PackedInt32Array | int32[]) + + /** Attachments to preserve in this pass (otherwise they are erased). */ + get preserve_attachments(): PackedInt32Array + set preserve_attachments(value: PackedInt32Array | int32[]) + + /** Depth attachment. ATTACHMENT_UNUSED should be used if no depth buffer is required for this pass. */ + get depth_attachment(): int64 + set depth_attachment(value: int64) + } + /** Pipeline color blend state (used by [RenderingDevice]). + * + * @link https://docs.godotengine.org/en/4.4/classes/class_rdpipelinecolorblendstate.html + */ + class RDPipelineColorBlendState extends RefCounted { + constructor(identifier?: any) + /** If `true`, performs the logic operation defined in [member logic_op]. */ + get enable_logic_op(): boolean + set enable_logic_op(value: boolean) + + /** The logic operation to perform for blending. Only effective if [member enable_logic_op] is `true`. */ + get logic_op(): int64 + set logic_op(value: int64) + + /** The constant color to blend with. See also [method RenderingDevice.draw_list_set_blend_constants]. */ + get blend_constant(): Color + set blend_constant(value: Color) + + /** The attachments that are blended together. */ + get attachments(): GArray + set attachments(value: GArray) + } + /** Pipeline color blend state attachment (used by [RenderingDevice]). + * + * @link https://docs.godotengine.org/en/4.4/classes/class_rdpipelinecolorblendstateattachment.html + */ + class RDPipelineColorBlendStateAttachment extends RefCounted { + constructor(identifier?: any) + /** Convenience method to perform standard mix blending with straight (non-premultiplied) alpha. This sets [member enable_blend] to `true`, [member src_color_blend_factor] to [constant RenderingDevice.BLEND_FACTOR_SRC_ALPHA], [member dst_color_blend_factor] to [constant RenderingDevice.BLEND_FACTOR_ONE_MINUS_SRC_ALPHA], [member src_alpha_blend_factor] to [constant RenderingDevice.BLEND_FACTOR_SRC_ALPHA] and [member dst_alpha_blend_factor] to [constant RenderingDevice.BLEND_FACTOR_ONE_MINUS_SRC_ALPHA]. */ + set_as_mix(): void + + /** If `true`, performs blending between the source and destination according to the factors defined in [member src_color_blend_factor], [member dst_color_blend_factor], [member src_alpha_blend_factor] and [member dst_alpha_blend_factor]. The blend modes [member color_blend_op] and [member alpha_blend_op] are also taken into account, with [member write_r], [member write_g], [member write_b] and [member write_a] controlling the output. */ + get enable_blend(): boolean + set enable_blend(value: boolean) + + /** Controls how the blend factor for the color channels is determined based on the source's fragments. */ + get src_color_blend_factor(): int64 + set src_color_blend_factor(value: int64) + + /** Controls how the blend factor for the color channels is determined based on the destination's fragments. */ + get dst_color_blend_factor(): int64 + set dst_color_blend_factor(value: int64) + + /** The blend mode to use for the red/green/blue color channels. */ + get color_blend_op(): int64 + set color_blend_op(value: int64) + + /** Controls how the blend factor for the alpha channel is determined based on the source's fragments. */ + get src_alpha_blend_factor(): int64 + set src_alpha_blend_factor(value: int64) + + /** Controls how the blend factor for the alpha channel is determined based on the destination's fragments. */ + get dst_alpha_blend_factor(): int64 + set dst_alpha_blend_factor(value: int64) + + /** The blend mode to use for the alpha channel. */ + get alpha_blend_op(): int64 + set alpha_blend_op(value: int64) + + /** If `true`, writes the new red color channel to the final result. */ + get write_r(): boolean + set write_r(value: boolean) + + /** If `true`, writes the new green color channel to the final result. */ + get write_g(): boolean + set write_g(value: boolean) + + /** If `true`, writes the new blue color channel to the final result. */ + get write_b(): boolean + set write_b(value: boolean) + + /** If `true`, writes the new alpha channel to the final result. */ + get write_a(): boolean + set write_a(value: boolean) + } + /** Pipeline depth/stencil state (used by [RenderingDevice]). + * + * @link https://docs.godotengine.org/en/4.4/classes/class_rdpipelinedepthstencilstate.html + */ + class RDPipelineDepthStencilState extends RefCounted { + constructor(identifier?: any) + /** If `true`, enables depth testing which allows objects to be automatically occluded by other objects based on their depth. This also allows objects to be partially occluded by other objects. If `false`, objects will appear in the order they were drawn (like in Godot's 2D renderer). */ + get enable_depth_test(): boolean + set enable_depth_test(value: boolean) + + /** If `true`, writes to the depth buffer whenever the depth test returns `true`. Only works when enable_depth_test is also `true`. */ + get enable_depth_write(): boolean + set enable_depth_write(value: boolean) + + /** The method used for comparing the previous and current depth values. */ + get depth_compare_operator(): int64 + set depth_compare_operator(value: int64) + + /** If `true`, each depth value will be tested to see if it is between [member depth_range_min] and [member depth_range_max]. If it is outside of these values, it is discarded. */ + get enable_depth_range(): boolean + set enable_depth_range(value: boolean) + + /** The minimum depth that returns `true` for [member enable_depth_range]. */ + get depth_range_min(): float64 + set depth_range_min(value: float64) + + /** The maximum depth that returns `true` for [member enable_depth_range]. */ + get depth_range_max(): float64 + set depth_range_max(value: float64) + + /** If `true`, enables stencil testing. There are separate stencil buffers for front-facing triangles and back-facing triangles. See properties that begin with "front_op" and properties with "back_op" for each. */ + get enable_stencil(): boolean + set enable_stencil(value: boolean) + + /** The operation to perform on the stencil buffer for front pixels that fail the stencil test. */ + get front_op_fail(): int64 + set front_op_fail(value: int64) + + /** The operation to perform on the stencil buffer for front pixels that pass the stencil test. */ + get front_op_pass(): int64 + set front_op_pass(value: int64) + + /** The operation to perform on the stencil buffer for front pixels that pass the stencil test but fail the depth test. */ + get front_op_depth_fail(): int64 + set front_op_depth_fail(value: int64) + + /** The method used for comparing the previous front stencil value and [member front_op_reference]. */ + get front_op_compare(): int64 + set front_op_compare(value: int64) + + /** Selects which bits from the front stencil value will be compared. */ + get front_op_compare_mask(): int64 + set front_op_compare_mask(value: int64) + + /** Selects which bits from the front stencil value will be changed. */ + get front_op_write_mask(): int64 + set front_op_write_mask(value: int64) + + /** The value the previous front stencil value will be compared to. */ + get front_op_reference(): int64 + set front_op_reference(value: int64) + + /** The operation to perform on the stencil buffer for back pixels that fail the stencil test. */ + get back_op_fail(): int64 + set back_op_fail(value: int64) + + /** The operation to perform on the stencil buffer for back pixels that pass the stencil test. */ + get back_op_pass(): int64 + set back_op_pass(value: int64) + + /** The operation to perform on the stencil buffer for back pixels that pass the stencil test but fail the depth test. */ + get back_op_depth_fail(): int64 + set back_op_depth_fail(value: int64) + + /** The method used for comparing the previous back stencil value and [member back_op_reference]. */ + get back_op_compare(): int64 + set back_op_compare(value: int64) + + /** Selects which bits from the back stencil value will be compared. */ + get back_op_compare_mask(): int64 + set back_op_compare_mask(value: int64) + + /** Selects which bits from the back stencil value will be changed. */ + get back_op_write_mask(): int64 + set back_op_write_mask(value: int64) + + /** The value the previous back stencil value will be compared to. */ + get back_op_reference(): int64 + set back_op_reference(value: int64) + } + /** Pipeline multisample state (used by [RenderingDevice]). + * + * @link https://docs.godotengine.org/en/4.4/classes/class_rdpipelinemultisamplestate.html + */ + class RDPipelineMultisampleState extends RefCounted { + constructor(identifier?: any) + /** The number of MSAA samples (or SSAA samples if [member enable_sample_shading] is `true`) to perform. Higher values result in better antialiasing, at the cost of performance. */ + get sample_count(): int64 + set sample_count(value: int64) + + /** If `true`, enables per-sample shading which replaces MSAA by SSAA. This provides higher quality antialiasing that works with transparent (alpha scissor) edges. This has a very high performance cost. See also [member min_sample_shading]. See the [url=https://registry.khronos.org/vulkan/specs/1.3-extensions/html/vkspec.html#primsrast-sampleshading]per-sample shading Vulkan documentation[/url] for more details. */ + get enable_sample_shading(): boolean + set enable_sample_shading(value: boolean) + + /** The multiplier of [member sample_count] that determines how many samples are performed for each fragment. Must be between `0.0` and `1.0` (inclusive). Only effective if [member enable_sample_shading] is `true`. If [member min_sample_shading] is `1.0`, fragment invocation must only read from the coverage index sample. Tile image access must not be used if [member enable_sample_shading] is *not* `1.0`. */ + get min_sample_shading(): float64 + set min_sample_shading(value: float64) + + /** If `true`, alpha to coverage is enabled. This generates a temporary coverage value based on the alpha component of the fragment's first color output. This allows alpha transparency to make use of multisample antialiasing. */ + get enable_alpha_to_coverage(): boolean + set enable_alpha_to_coverage(value: boolean) + + /** If `true`, alpha is forced to either `0.0` or `1.0`. This allows hardening the edges of antialiased alpha transparencies. Only relevant if [member enable_alpha_to_coverage] is `true`. */ + get enable_alpha_to_one(): boolean + set enable_alpha_to_one(value: boolean) + + /** The sample mask array. See the [url=https://registry.khronos.org/vulkan/specs/1.3-extensions/html/vkspec.html#fragops-samplemask]sample mask Vulkan documentation[/url] for more details. */ + get sample_masks(): GArray + set sample_masks(value: GArray) + } + /** Pipeline rasterization state (used by [RenderingDevice]). + * + * @link https://docs.godotengine.org/en/4.4/classes/class_rdpipelinerasterizationstate.html + */ + class RDPipelineRasterizationState extends RefCounted { + constructor(identifier?: any) + /** If `true`, clamps depth values according to the minimum and maximum depth of the associated viewport. */ + get enable_depth_clamp(): boolean + set enable_depth_clamp(value: boolean) + + /** If `true`, primitives are discarded immediately before the rasterization stage. */ + get discard_primitives(): boolean + set discard_primitives(value: boolean) + + /** If `true`, performs wireframe rendering for triangles instead of flat or textured rendering. */ + get wireframe(): boolean + set wireframe(value: boolean) + + /** The cull mode to use when drawing polygons, which determines whether front faces or backfaces are hidden. */ + get cull_mode(): int64 + set cull_mode(value: int64) + + /** The winding order to use to determine which face of a triangle is considered its front face. */ + get front_face(): int64 + set front_face(value: int64) + + /** If `true`, each generated depth value will by offset by some amount. The specific amount is generated per polygon based on the values of [member depth_bias_slope_factor] and [member depth_bias_constant_factor]. */ + get depth_bias_enabled(): boolean + set depth_bias_enabled(value: boolean) + + /** A constant offset added to each depth value. Applied after [member depth_bias_slope_factor]. */ + get depth_bias_constant_factor(): float64 + set depth_bias_constant_factor(value: float64) + + /** A limit for how much each depth value can be offset. If negative, it serves as a minimum value, but if positive, it serves as a maximum value. */ + get depth_bias_clamp(): float64 + set depth_bias_clamp(value: float64) + + /** A constant scale applied to the slope of each polygons' depth. Applied before [member depth_bias_constant_factor]. */ + get depth_bias_slope_factor(): float64 + set depth_bias_slope_factor(value: float64) + + /** The line width to use when drawing lines (in pixels). Thick lines may not be supported on all hardware. */ + get line_width(): float64 + set line_width(value: float64) + + /** The number of control points to use when drawing a patch with tessellation enabled. Higher values result in higher quality at the cost of performance. */ + get patch_control_points(): int64 + set patch_control_points(value: int64) + } + /** Pipeline specialization constant (used by [RenderingDevice]). + * + * @link https://docs.godotengine.org/en/4.4/classes/class_rdpipelinespecializationconstant.html + */ + class RDPipelineSpecializationConstant extends RefCounted { + constructor(identifier?: any) + /** The specialization constant's value. Only [bool], [int] and [float] types are valid for specialization constants. */ + get value(): any + set value(value: any) + + /** The identifier of the specialization constant. This is a value starting from `0` and that increments for every different specialization constant for a given shader. */ + get constant_id(): int64 + set constant_id(value: int64) + } + /** Sampler state (used by [RenderingDevice]). + * + * @link https://docs.godotengine.org/en/4.4/classes/class_rdsamplerstate.html + */ + class RDSamplerState extends RefCounted { + constructor(identifier?: any) + /** The sampler's magnification filter. It is the filtering method used when sampling texels that appear bigger than on-screen pixels. */ + get mag_filter(): int64 + set mag_filter(value: int64) + + /** The sampler's minification filter. It is the filtering method used when sampling texels that appear smaller than on-screen pixels. */ + get min_filter(): int64 + set min_filter(value: int64) + + /** The filtering method to use for mipmaps. */ + get mip_filter(): int64 + set mip_filter(value: int64) + + /** The repeat mode to use along the U axis of UV coordinates. This affects the returned values if sampling outside the UV bounds. */ + get repeat_u(): int64 + set repeat_u(value: int64) + + /** The repeat mode to use along the V axis of UV coordinates. This affects the returned values if sampling outside the UV bounds. */ + get repeat_v(): int64 + set repeat_v(value: int64) + + /** The repeat mode to use along the W axis of UV coordinates. This affects the returned values if sampling outside the UV bounds. Only effective for 3D samplers. */ + get repeat_w(): int64 + set repeat_w(value: int64) + + /** The mipmap LOD bias to use. Positive values will make the sampler blurrier at a given distance, while negative values will make the sampler sharper at a given distance (at the risk of looking grainy). Recommended values are between `-0.5` and `0.0`. Only effective if the sampler has mipmaps available. */ + get lod_bias(): float64 + set lod_bias(value: float64) + + /** If `true`, perform anisotropic sampling. See [member anisotropy_max]. */ + get use_anisotropy(): boolean + set use_anisotropy(value: boolean) + + /** Maximum anisotropy that can be used when sampling. Only effective if [member use_anisotropy] is `true`. Higher values result in a sharper sampler at oblique angles, at the cost of performance (due to memory bandwidth). This value may be limited by the graphics hardware in use. Most graphics hardware only supports values up to `16.0`. + * If [member anisotropy_max] is `1.0`, forcibly disables anisotropy even if [member use_anisotropy] is `true`. + */ + get anisotropy_max(): float64 + set anisotropy_max(value: float64) + + /** If `true`, returned values will be based on the comparison operation defined in [member compare_op]. This is a hardware-based approach and is therefore faster than performing this manually in a shader. For example, compare operations are used for shadow map rendering by comparing depth values from a shadow sampler. */ + get enable_compare(): boolean + set enable_compare(value: boolean) + + /** The compare operation to use. Only effective if [member enable_compare] is `true`. */ + get compare_op(): int64 + set compare_op(value: int64) + + /** The minimum mipmap LOD bias to display (highest resolution). Only effective if the sampler has mipmaps available. */ + get min_lod(): float64 + set min_lod(value: float64) + + /** The maximum mipmap LOD bias to display (lowest resolution). Only effective if the sampler has mipmaps available. */ + get max_lod(): float64 + set max_lod(value: float64) + + /** The border color that will be returned when sampling outside the sampler's bounds and the [member repeat_u], [member repeat_v] or [member repeat_w] modes have repeating disabled. */ + get border_color(): int64 + set border_color(value: int64) + + /** If `true`, the texture will be sampled with coordinates ranging from 0 to the texture's resolution. Otherwise, the coordinates will be normalized and range from 0 to 1. */ + get unnormalized_uvw(): boolean + set unnormalized_uvw(value: boolean) + } + /** Compiled shader file in SPIR-V form (used by [RenderingDevice]). Not to be confused with Godot's own [Shader]. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_rdshaderfile.html + */ + class RDShaderFile extends Resource { + constructor(identifier?: any) + /** Sets the SPIR-V [param bytecode] that will be compiled for the specified [param version]. */ + set_bytecode(bytecode: RDShaderSPIRV, version: StringName = ''): void + + /** Returns the SPIR-V intermediate representation for the specified shader [param version]. */ + get_spirv(version: StringName = ''): RDShaderSPIRV + + /** Returns the list of compiled versions for this shader. */ + get_version_list(): GArray + get _versions(): GDictionary + set _versions(value: GDictionary) + + /** The base compilation error message, which indicates errors not related to a specific shader stage if non-empty. If empty, shader compilation is not necessarily successful (check [RDShaderSPIRV]'s error message members). */ + get base_error(): string + set base_error(value: string) + } + /** SPIR-V intermediate representation as part of a [RDShaderFile] (used by [RenderingDevice]). + * + * @link https://docs.godotengine.org/en/4.4/classes/class_rdshaderspirv.html + */ + class RDShaderSPIRV extends Resource { + constructor(identifier?: any) + /** Sets the SPIR-V [param bytecode] for the given shader [param stage]. Equivalent to setting one of [member bytecode_compute], [member bytecode_fragment], [member bytecode_tesselation_control], [member bytecode_tesselation_evaluation], [member bytecode_vertex]. */ + set_stage_bytecode(stage: RenderingDevice.ShaderStage, bytecode: PackedByteArray | byte[] | ArrayBuffer): void + + /** Equivalent to getting one of [member bytecode_compute], [member bytecode_fragment], [member bytecode_tesselation_control], [member bytecode_tesselation_evaluation], [member bytecode_vertex]. */ + get_stage_bytecode(stage: RenderingDevice.ShaderStage): PackedByteArray + + /** Sets the compilation error message for the given shader [param stage] to [param compile_error]. Equivalent to setting one of [member compile_error_compute], [member compile_error_fragment], [member compile_error_tesselation_control], [member compile_error_tesselation_evaluation], [member compile_error_vertex]. */ + set_stage_compile_error(stage: RenderingDevice.ShaderStage, compile_error: string): void + + /** Returns the compilation error message for the given shader [param stage]. Equivalent to getting one of [member compile_error_compute], [member compile_error_fragment], [member compile_error_tesselation_control], [member compile_error_tesselation_evaluation], [member compile_error_vertex]. */ + get_stage_compile_error(stage: RenderingDevice.ShaderStage): string + + /** The SPIR-V bytecode for the vertex shader stage. */ + get bytecode_vertex(): PackedByteArray + set bytecode_vertex(value: PackedByteArray | byte[] | ArrayBuffer) + + /** The SPIR-V bytecode for the fragment shader stage. */ + get bytecode_fragment(): PackedByteArray + set bytecode_fragment(value: PackedByteArray | byte[] | ArrayBuffer) + + /** The SPIR-V bytecode for the tessellation control shader stage. */ + get bytecode_tesselation_control(): PackedByteArray + set bytecode_tesselation_control(value: PackedByteArray | byte[] | ArrayBuffer) + + /** The SPIR-V bytecode for the tessellation evaluation shader stage. */ + get bytecode_tesselation_evaluation(): PackedByteArray + set bytecode_tesselation_evaluation(value: PackedByteArray | byte[] | ArrayBuffer) + + /** The SPIR-V bytecode for the compute shader stage. */ + get bytecode_compute(): PackedByteArray + set bytecode_compute(value: PackedByteArray | byte[] | ArrayBuffer) + + /** The compilation error message for the vertex shader stage (set by the SPIR-V compiler and Godot). If empty, shader compilation was successful. */ + get compile_error_vertex(): string + set compile_error_vertex(value: string) + + /** The compilation error message for the fragment shader stage (set by the SPIR-V compiler and Godot). If empty, shader compilation was successful. */ + get compile_error_fragment(): string + set compile_error_fragment(value: string) + + /** The compilation error message for the tessellation control shader stage (set by the SPIR-V compiler and Godot). If empty, shader compilation was successful. */ + get compile_error_tesselation_control(): string + set compile_error_tesselation_control(value: string) + + /** The compilation error message for the tessellation evaluation shader stage (set by the SPIR-V compiler and Godot). If empty, shader compilation was successful. */ + get compile_error_tesselation_evaluation(): string + set compile_error_tesselation_evaluation(value: string) + + /** The compilation error message for the compute shader stage (set by the SPIR-V compiler and Godot). If empty, shader compilation was successful. */ + get compile_error_compute(): string + set compile_error_compute(value: string) + } + /** Shader source code (used by [RenderingDevice]). + * + * @link https://docs.godotengine.org/en/4.4/classes/class_rdshadersource.html + */ + class RDShaderSource extends RefCounted { + constructor(identifier?: any) + /** Sets [param source] code for the specified shader [param stage]. Equivalent to setting one of [member source_compute], [member source_fragment], [member source_tesselation_control], [member source_tesselation_evaluation] or [member source_vertex]. + * + * **Note:** If you set the compute shader source code using this method directly, remember to remove the Godot-specific hint `#[compute]`. + */ + set_stage_source(stage: RenderingDevice.ShaderStage, source: string): void + + /** Returns source code for the specified shader [param stage]. Equivalent to getting one of [member source_compute], [member source_fragment], [member source_tesselation_control], [member source_tesselation_evaluation] or [member source_vertex]. */ + get_stage_source(stage: RenderingDevice.ShaderStage): string + + /** Source code for the shader's vertex stage. */ + get source_vertex(): string + set source_vertex(value: string) + + /** Source code for the shader's fragment stage. */ + get source_fragment(): string + set source_fragment(value: string) + + /** Source code for the shader's tessellation control stage. */ + get source_tesselation_control(): string + set source_tesselation_control(value: string) + + /** Source code for the shader's tessellation evaluation stage. */ + get source_tesselation_evaluation(): string + set source_tesselation_evaluation(value: string) + + /** Source code for the shader's compute stage. */ + get source_compute(): string + set source_compute(value: string) + + /** The language the shader is written in. */ + get language(): int64 + set language(value: int64) + } + /** Texture format (used by [RenderingDevice]). + * + * @link https://docs.godotengine.org/en/4.4/classes/class_rdtextureformat.html + */ + class RDTextureFormat extends RefCounted { + constructor(identifier?: any) + /** Adds [param format] as a valid format for the corresponding [RDTextureView]'s [member RDTextureView.format_override] property. If any format is added as shareable, then the main [member format] must also be added. */ + add_shareable_format(format: RenderingDevice.DataFormat): void + + /** Removes [param format] from the list of valid formats that the corresponding [RDTextureView]'s [member RDTextureView.format_override] property can be set to. */ + remove_shareable_format(format: RenderingDevice.DataFormat): void + + /** The texture's pixel data format. */ + get format(): int64 + set format(value: int64) + + /** The texture's width (in pixels). */ + get width(): int64 + set width(value: int64) + + /** The texture's height (in pixels). */ + get height(): int64 + set height(value: int64) + + /** The texture's depth (in pixels). This is always `1` for 2D textures. */ + get depth(): int64 + set depth(value: int64) + + /** The number of layers in the texture. Only relevant for 2D texture arrays. */ + get array_layers(): int64 + set array_layers(value: int64) + + /** The number of mipmaps available in the texture. */ + get mipmaps(): int64 + set mipmaps(value: int64) + + /** The texture type. */ + get texture_type(): int64 + set texture_type(value: int64) + + /** The number of samples used when sampling the texture. */ + get samples(): int64 + set samples(value: int64) + + /** The texture's usage bits, which determine what can be done using the texture. */ + get usage_bits(): int64 + set usage_bits(value: int64) + + /** The texture will be used as the destination of a resolve operation. */ + get is_resolve_buffer(): boolean + set is_resolve_buffer(value: boolean) + + /** If a texture is discardable, its contents do not need to be preserved between frames. This flag is only relevant when the texture is used as target in a draw list. + * This information is used by [RenderingDevice] to figure out if a texture's contents can be discarded, eliminating unnecessary writes to memory and boosting performance. + */ + get is_discardable(): boolean + set is_discardable(value: boolean) + } + /** Texture view (used by [RenderingDevice]). + * + * @link https://docs.godotengine.org/en/4.4/classes/class_rdtextureview.html + */ + class RDTextureView extends RefCounted { + constructor(identifier?: any) + /** Optional override for the data format to return sampled values in. The corresponding [RDTextureFormat] must have had this added as a shareable format. The default value of [constant RenderingDevice.DATA_FORMAT_MAX] does not override the format. */ + get format_override(): int64 + set format_override(value: int64) + + /** The channel to sample when sampling the red color channel. */ + get swizzle_r(): int64 + set swizzle_r(value: int64) + + /** The channel to sample when sampling the green color channel. */ + get swizzle_g(): int64 + set swizzle_g(value: int64) + + /** The channel to sample when sampling the blue color channel. */ + get swizzle_b(): int64 + set swizzle_b(value: int64) + + /** The channel to sample when sampling the alpha channel. */ + get swizzle_a(): int64 + set swizzle_a(value: int64) + } + /** Shader uniform (used by [RenderingDevice]). + * + * @link https://docs.godotengine.org/en/4.4/classes/class_rduniform.html + */ + class RDUniform extends RefCounted { + constructor(identifier?: any) + /** Binds the given id to the uniform. The data associated with the id is then used when the uniform is passed to a shader. */ + add_id(id: RID): void + + /** Unbinds all ids currently bound to the uniform. */ + clear_ids(): void + + /** The uniform's data type. */ + get uniform_type(): int64 + set uniform_type(value: int64) + + /** The uniform's binding. */ + get binding(): int64 + set binding(value: int64) + get _ids(): GArray + set _ids(value: GArray) + } + /** Vertex attribute (used by [RenderingDevice]). + * + * @link https://docs.godotengine.org/en/4.4/classes/class_rdvertexattribute.html + */ + class RDVertexAttribute extends RefCounted { + constructor(identifier?: any) + /** The location in the shader that this attribute is bound to. */ + get location(): int64 + set location(value: int64) + + /** The number of bytes between the start of the vertex buffer and the first instance of this attribute. */ + get offset(): int64 + set offset(value: int64) + + /** The way that this attribute's data is interpreted when sent to a shader. */ + get format(): int64 + set format(value: int64) + + /** The number of bytes between the starts of consecutive instances of this attribute. */ + get stride(): int64 + set stride(value: int64) + + /** The rate at which this attribute is pulled from its vertex buffer. */ + get frequency(): int64 + set frequency(value: int64) + } + /** Provides methods for generating pseudo-random numbers. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_randomnumbergenerator.html + */ + class RandomNumberGenerator extends RefCounted { + constructor(identifier?: any) + /** Returns a pseudo-random 32-bit unsigned integer between `0` and `4294967295` (inclusive). */ + randi(): int64 + + /** Returns a pseudo-random float between `0.0` and `1.0` (inclusive). */ + randf(): float64 + + /** Returns a [url=https://en.wikipedia.org/wiki/Normal_distribution]normally-distributed[/url], pseudo-random floating-point number from the specified [param mean] and a standard [param deviation]. This is also known as a Gaussian distribution. + * + * **Note:** This method uses the [url=https://en.wikipedia.org/wiki/Box%E2%80%93Muller_transform]Box-Muller transform[/url] algorithm. + */ + randfn(mean: float64 = 0, deviation: float64 = 1): float64 + + /** Returns a pseudo-random float between [param from] and [param to] (inclusive). */ + randf_range(from: float64, to: float64): float64 + + /** Returns a pseudo-random 32-bit signed integer between [param from] and [param to] (inclusive). */ + randi_range(from: int64, to: int64): int64 + + /** Returns a random index with non-uniform weights. Prints an error and returns `-1` if the array is empty. + * + */ + rand_weighted(weights: PackedFloat32Array | float32[]): int64 + + /** Sets up a time-based seed for this [RandomNumberGenerator] instance. Unlike the [@GlobalScope] random number generation functions, different [RandomNumberGenerator] instances can use different seeds. */ + randomize(): void + + /** Initializes the random number generator state based on the given seed value. A given seed will give a reproducible sequence of pseudo-random numbers. + * + * **Note:** The RNG does not have an avalanche effect, and can output similar random streams given similar seeds. Consider using a hash function to improve your seed quality if they're sourced externally. + * + * **Note:** Setting this property produces a side effect of changing the internal [member state], so make sure to initialize the seed *before* modifying the [member state]: + * + * **Note:** The default value of this property is pseudo-random, and changes when calling [method randomize]. The `0` value documented here is a placeholder, and not the actual default seed. + * + */ + get seed(): int64 + set seed(value: int64) + + /** The current state of the random number generator. Save and restore this property to restore the generator to a previous state: + * + * + * **Note:** Do not set state to arbitrary values, since the random number generator requires the state to have certain qualities to behave properly. It should only be set to values that came from the state property itself. To initialize the random number generator with arbitrary input, use [member seed] instead. + * + * **Note:** The default value of this property is pseudo-random, and changes when calling [method randomize]. The `0` value documented here is a placeholder, and not the actual default seed. + */ + get state(): int64 + set state(value: int64) + } + /** Abstract base class for controls that represent a number within a range. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_range.html + */ + class Range = Record> extends Control { + constructor(identifier?: any) + /** Called when the [Range]'s value is changed (following the same conditions as [signal value_changed]). */ + /* gdvirtual */ _value_changed(new_value: float64): void + + /** Sets the [Range]'s current value to the specified [param value], without emitting the [signal value_changed] signal. */ + set_value_no_signal(value: float64): void + + /** Binds two [Range]s together along with any ranges previously grouped with either of them. When any of range's member variables change, it will share the new value with all other ranges in its group. */ + share(with_: Node): void + + /** Stops the [Range] from sharing its member variables with any other. */ + unshare(): void + + /** Minimum value. Range is clamped if [member value] is less than [member min_value]. */ + get min_value(): float64 + set min_value(value: float64) + + /** Maximum value. Range is clamped if [member value] is greater than [member max_value]. */ + get max_value(): float64 + set max_value(value: float64) + + /** If greater than 0, [member value] will always be rounded to a multiple of this property's value. If [member rounded] is also `true`, [member value] will first be rounded to a multiple of this property's value, then rounded to the nearest integer. */ + get step(): float64 + set step(value: float64) + + /** Page size. Used mainly for [ScrollBar]. A [ScrollBar]'s grabber length is the [ScrollBar]'s size multiplied by [member page] over the difference between [member min_value] and [member max_value]. */ + get page(): float64 + set page(value: float64) + + /** Range's current value. Changing this property (even via code) will trigger [signal value_changed] signal. Use [method set_value_no_signal] if you want to avoid it. */ + get value(): float64 + set value(value: float64) + + /** The value mapped between 0 and 1. */ + get ratio(): float64 + set ratio(value: float64) + + /** If `true`, and [member min_value] is greater than 0, [member value] will be represented exponentially rather than linearly. */ + get exp_edit(): boolean + set exp_edit(value: boolean) + + /** If `true`, [member value] will always be rounded to the nearest integer. */ + get rounded(): boolean + set rounded(value: boolean) + + /** If `true`, [member value] may be greater than [member max_value]. */ + get allow_greater(): boolean + set allow_greater(value: boolean) + + /** If `true`, [member value] may be less than [member min_value]. */ + get allow_lesser(): boolean + set allow_lesser(value: boolean) + + /** Emitted when [member value] changes. When used on a [Slider], this is called continuously while dragging (potentially every frame). If you are performing an expensive operation in a function connected to [signal value_changed], consider using a *debouncing* [Timer] to call the function less often. + * + * **Note:** Unlike signals such as [signal LineEdit.text_changed], [signal value_changed] is also emitted when [param value] is set directly via code. + */ + readonly value_changed: Signal1 + + /** Emitted when [member min_value], [member max_value], [member page], or [member step] change. */ + readonly changed: Signal0 + } + /** A ray in 2D space, used to find the first [CollisionObject2D] it intersects. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_raycast2d.html + */ + class RayCast2D = Record> extends Node2D { + constructor(identifier?: any) + /** Returns whether any object is intersecting with the ray's vector (considering the vector length). */ + is_colliding(): boolean + + /** Updates the collision information for the ray immediately, without waiting for the next `_physics_process` call. Use this method, for example, when the ray or its parent has changed state. + * + * **Note:** [member enabled] does not need to be `true` for this to work. + */ + force_raycast_update(): void + + /** Returns the first object that the ray intersects, or `null` if no object is intersecting the ray (i.e. [method is_colliding] returns `false`). */ + get_collider(): Object + + /** Returns the [RID] of the first object that the ray intersects, or an empty [RID] if no object is intersecting the ray (i.e. [method is_colliding] returns `false`). */ + get_collider_rid(): RID + + /** Returns the shape ID of the first object that the ray intersects, or `0` if no object is intersecting the ray (i.e. [method is_colliding] returns `false`). + * To get the intersected shape node, for a [CollisionObject2D] target, use: + * + */ + get_collider_shape(): int64 + + /** Returns the collision point at which the ray intersects the closest object, in the global coordinate system. If [member hit_from_inside] is `true` and the ray starts inside of a collision shape, this function will return the origin point of the ray. + * + * **Note:** Check that [method is_colliding] returns `true` before calling this method to ensure the returned point is valid and up-to-date. + */ + get_collision_point(): Vector2 + + /** Returns the normal of the intersecting object's shape at the collision point, or `Vector2(0, 0)` if the ray starts inside the shape and [member hit_from_inside] is `true`. + * + * **Note:** Check that [method is_colliding] returns `true` before calling this method to ensure the returned normal is valid and up-to-date. + */ + get_collision_normal(): Vector2 + + /** Adds a collision exception so the ray does not report collisions with the specified [RID]. */ + add_exception_rid(rid: RID): void + + /** Adds a collision exception so the ray does not report collisions with the specified [CollisionObject2D] node. */ + add_exception(node: CollisionObject2D): void + + /** Removes a collision exception so the ray does report collisions with the specified [RID]. */ + remove_exception_rid(rid: RID): void + + /** Removes a collision exception so the ray does report collisions with the specified [CollisionObject2D] node. */ + remove_exception(node: CollisionObject2D): void + + /** Removes all collision exceptions for this ray. */ + clear_exceptions(): void + + /** Based on [param value], enables or disables the specified layer in the [member collision_mask], given a [param layer_number] between 1 and 32. */ + set_collision_mask_value(layer_number: int64, value: boolean): void + + /** Returns whether or not the specified layer of the [member collision_mask] is enabled, given a [param layer_number] between 1 and 32. */ + get_collision_mask_value(layer_number: int64): boolean + + /** If `true`, collisions will be reported. */ + get enabled(): boolean + set enabled(value: boolean) + + /** If `true`, the parent node will be excluded from collision detection. */ + get exclude_parent(): boolean + set exclude_parent(value: boolean) + + /** The ray's destination point, relative to the RayCast's `position`. */ + get target_position(): Vector2 + set target_position(value: Vector2) + + /** The ray's collision mask. Only objects in at least one collision layer enabled in the mask will be detected. See [url=https://docs.godotengine.org/en/4.4/tutorials/physics/physics_introduction.html#collision-layers-and-masks]Collision layers and masks[/url] in the documentation for more information. */ + get collision_mask(): int64 + set collision_mask(value: int64) + + /** If `true`, the ray will detect a hit when starting inside shapes. In this case the collision normal will be `Vector2(0, 0)`. Does not affect concave polygon shapes. */ + get hit_from_inside(): boolean + set hit_from_inside(value: boolean) + + /** If `true`, collisions with [Area2D]s will be reported. */ + get collide_with_areas(): boolean + set collide_with_areas(value: boolean) + + /** If `true`, collisions with [PhysicsBody2D]s will be reported. */ + get collide_with_bodies(): boolean + set collide_with_bodies(value: boolean) + } + /** A ray in 3D space, used to find the first object it intersects. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_raycast3d.html + */ + class RayCast3D = Record> extends Node3D { + constructor(identifier?: any) + /** Returns whether any object is intersecting with the ray's vector (considering the vector length). */ + is_colliding(): boolean + + /** Updates the collision information for the ray immediately, without waiting for the next `_physics_process` call. Use this method, for example, when the ray or its parent has changed state. + * + * **Note:** [member enabled] does not need to be `true` for this to work. + */ + force_raycast_update(): void + + /** Returns the first object that the ray intersects, or `null` if no object is intersecting the ray (i.e. [method is_colliding] returns `false`). + * + * **Note:** This object is not guaranteed to be a [CollisionObject3D]. For example, if the ray intersects a [CSGShape3D] or a [GridMap], the method will return a [CSGShape3D] or [GridMap] instance. + */ + get_collider(): Object + + /** Returns the [RID] of the first object that the ray intersects, or an empty [RID] if no object is intersecting the ray (i.e. [method is_colliding] returns `false`). */ + get_collider_rid(): RID + + /** Returns the shape ID of the first object that the ray intersects, or `0` if no object is intersecting the ray (i.e. [method is_colliding] returns `false`). + * To get the intersected shape node, for a [CollisionObject3D] target, use: + * + */ + get_collider_shape(): int64 + + /** Returns the collision point at which the ray intersects the closest object, in the global coordinate system. If [member hit_from_inside] is `true` and the ray starts inside of a collision shape, this function will return the origin point of the ray. + * + * **Note:** Check that [method is_colliding] returns `true` before calling this method to ensure the returned point is valid and up-to-date. + */ + get_collision_point(): Vector3 + + /** Returns the normal of the intersecting object's shape at the collision point, or `Vector3(0, 0, 0)` if the ray starts inside the shape and [member hit_from_inside] is `true`. + * + * **Note:** Check that [method is_colliding] returns `true` before calling this method to ensure the returned normal is valid and up-to-date. + */ + get_collision_normal(): Vector3 + + /** Returns the collision object's face index at the collision point, or `-1` if the shape intersecting the ray is not a [ConcavePolygonShape3D]. */ + get_collision_face_index(): int64 + + /** Adds a collision exception so the ray does not report collisions with the specified [RID]. */ + add_exception_rid(rid: RID): void + + /** Adds a collision exception so the ray does not report collisions with the specified [CollisionObject3D] node. */ + add_exception(node: CollisionObject3D): void + + /** Removes a collision exception so the ray does report collisions with the specified [RID]. */ + remove_exception_rid(rid: RID): void + + /** Removes a collision exception so the ray does report collisions with the specified [CollisionObject3D] node. */ + remove_exception(node: CollisionObject3D): void + + /** Removes all collision exceptions for this ray. */ + clear_exceptions(): void + + /** Based on [param value], enables or disables the specified layer in the [member collision_mask], given a [param layer_number] between 1 and 32. */ + set_collision_mask_value(layer_number: int64, value: boolean): void + + /** Returns whether or not the specified layer of the [member collision_mask] is enabled, given a [param layer_number] between 1 and 32. */ + get_collision_mask_value(layer_number: int64): boolean + + /** If `true`, collisions will be reported. */ + get enabled(): boolean + set enabled(value: boolean) + + /** If `true`, collisions will be ignored for this RayCast3D's immediate parent. */ + get exclude_parent(): boolean + set exclude_parent(value: boolean) + + /** The ray's destination point, relative to the RayCast's `position`. */ + get target_position(): Vector3 + set target_position(value: Vector3) + + /** The ray's collision mask. Only objects in at least one collision layer enabled in the mask will be detected. See [url=https://docs.godotengine.org/en/4.4/tutorials/physics/physics_introduction.html#collision-layers-and-masks]Collision layers and masks[/url] in the documentation for more information. */ + get collision_mask(): int64 + set collision_mask(value: int64) + + /** If `true`, the ray will detect a hit when starting inside shapes. In this case the collision normal will be `Vector3(0, 0, 0)`. Does not affect shapes with no volume like concave polygon or heightmap. */ + get hit_from_inside(): boolean + set hit_from_inside(value: boolean) + + /** If `true`, the ray will hit back faces with concave polygon shapes with back face enabled or heightmap shapes. */ + get hit_back_faces(): boolean + set hit_back_faces(value: boolean) + + /** If `true`, collisions with [Area3D]s will be reported. */ + get collide_with_areas(): boolean + set collide_with_areas(value: boolean) + + /** If `true`, collisions with [PhysicsBody3D]s will be reported. */ + get collide_with_bodies(): boolean + set collide_with_bodies(value: boolean) + + /** The custom color to use to draw the shape in the editor and at run-time if **Visible Collision Shapes** is enabled in the **Debug** menu. This color will be highlighted at run-time if the [RayCast3D] is colliding with something. + * If set to `Color(0.0, 0.0, 0.0)` (by default), the color set in [member ProjectSettings.debug/shapes/collision/shape_color] is used. + */ + get debug_shape_custom_color(): Color + set debug_shape_custom_color(value: Color) + + /** If set to `1`, a line is used as the debug shape. Otherwise, a truncated pyramid is drawn to represent the [RayCast3D]. Requires **Visible Collision Shapes** to be enabled in the **Debug** menu for the debug shape to be visible at run-time. */ + get debug_shape_thickness(): int64 + set debug_shape_thickness(value: int64) + } + class RayCast3DGizmoPlugin extends EditorNode3DGizmoPlugin { + constructor(identifier?: any) + } + /** A 2D rectangle shape used for physics collision. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_rectangleshape2d.html + */ + class RectangleShape2D extends Shape2D { + constructor(identifier?: any) + /** The rectangle's width and height. */ + get size(): Vector2 + set size(value: Vector2) + } + /** Base class for reference-counted objects. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_refcounted.html + */ + class RefCounted extends Object { + constructor(identifier?: any) + /** Initializes the internal reference counter. Use this only if you really know what you are doing. + * Returns whether the initialization was successful. + */ + init_ref(): boolean + + /** Increments the internal reference counter. Use this only if you really know what you are doing. + * Returns `true` if the increment was successful, `false` otherwise. + */ + reference(): boolean + + /** Decrements the internal reference counter. Use this only if you really know what you are doing. + * Returns `true` if the object should be freed after the decrement, `false` otherwise. + */ + unreference(): boolean + + /** Returns the current reference count. */ + get_reference_count(): int64 + } + /** A rectangle hint for designing UIs. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_referencerect.html + */ + class ReferenceRect = Record> extends Control { + constructor(identifier?: any) + /** Sets the border color of the [ReferenceRect]. */ + get border_color(): Color + set border_color(value: Color) + + /** Sets the border width of the [ReferenceRect]. The border grows both inwards and outwards with respect to the rectangle box. */ + get border_width(): float64 + set border_width(value: float64) + + /** If `true`, the [ReferenceRect] will only be visible while in editor. Otherwise, [ReferenceRect] will be visible in the running project. */ + get editor_only(): boolean + set editor_only(value: boolean) + } + namespace ReflectionProbe { + enum UpdateMode { + /** Update the probe once on the next frame (recommended for most objects). The corresponding radiance map will be generated over the following six frames. This takes more time to update than [constant UPDATE_ALWAYS], but it has a lower performance cost and can result in higher-quality reflections. The ReflectionProbe is updated when its transform changes, but not when nearby geometry changes. You can force a [ReflectionProbe] update by moving the [ReflectionProbe] slightly in any direction. */ + UPDATE_ONCE = 0, + + /** Update the probe every frame. This provides better results for fast-moving dynamic objects (such as cars). However, it has a significant performance cost. Due to the cost, it's recommended to only use one ReflectionProbe with [constant UPDATE_ALWAYS] at most per scene. For all other use cases, use [constant UPDATE_ONCE]. */ + UPDATE_ALWAYS = 1, + } + enum AmbientMode { + /** Do not apply any ambient lighting inside the [ReflectionProbe]'s box defined by its [member size]. */ + AMBIENT_DISABLED = 0, + + /** Apply automatically-sourced environment lighting inside the [ReflectionProbe]'s box defined by its [member size]. */ + AMBIENT_ENVIRONMENT = 1, + + /** Apply custom ambient lighting inside the [ReflectionProbe]'s box defined by its [member size]. See [member ambient_color] and [member ambient_color_energy]. */ + AMBIENT_COLOR = 2, + } + } + /** Captures its surroundings to create fast, accurate reflections from a given point. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_reflectionprobe.html + */ + class ReflectionProbe = Record> extends VisualInstance3D { + constructor(identifier?: any) + /** Sets how frequently the [ReflectionProbe] is updated. Can be [constant UPDATE_ONCE] or [constant UPDATE_ALWAYS]. */ + get update_mode(): int64 + set update_mode(value: int64) + + /** Defines the reflection intensity. Intensity modulates the strength of the reflection. */ + get intensity(): float64 + set intensity(value: float64) + + /** Defines the distance in meters over which a probe blends into the scene. */ + get blend_distance(): float64 + set blend_distance(value: float64) + + /** The maximum distance away from the [ReflectionProbe] an object can be before it is culled. Decrease this to improve performance, especially when using the [constant UPDATE_ALWAYS] [member update_mode]. + * + * **Note:** The maximum reflection distance is always at least equal to the probe's extents. This means that decreasing [member max_distance] will not always cull objects from reflections, especially if the reflection probe's box defined by its [member size] is already large. + */ + get max_distance(): float64 + set max_distance(value: float64) + + /** The size of the reflection probe. The larger the size, the more space covered by the probe, which will lower the perceived resolution. It is best to keep the size only as large as you need it. + * + * **Note:** To better fit areas that are not aligned to the grid, you can rotate the [ReflectionProbe] node. + */ + get size(): Vector3 + set size(value: Vector3) + + /** Sets the origin offset to be used when this [ReflectionProbe] is in [member box_projection] mode. This can be set to a non-zero value to ensure a reflection fits a rectangle-shaped room, while reducing the number of objects that "get in the way" of the reflection. */ + get origin_offset(): Vector3 + set origin_offset(value: Vector3) + + /** If `true`, enables box projection. This makes reflections look more correct in rectangle-shaped rooms by offsetting the reflection center depending on the camera's location. + * + * **Note:** To better fit rectangle-shaped rooms that are not aligned to the grid, you can rotate the [ReflectionProbe] node. + */ + get box_projection(): boolean + set box_projection(value: boolean) + + /** If `true`, reflections will ignore sky contribution. */ + get interior(): boolean + set interior(value: boolean) + + /** If `true`, computes shadows in the reflection probe. This makes the reflection probe slower to render; you may want to disable this if using the [constant UPDATE_ALWAYS] [member update_mode]. */ + get enable_shadows(): boolean + set enable_shadows(value: boolean) + + /** Sets the cull mask which determines what objects are drawn by this probe. Every [VisualInstance3D] with a layer included in this cull mask will be rendered by the probe. It is best to only include large objects which are likely to take up a lot of space in the reflection in order to save on rendering cost. + * This can also be used to prevent an object from reflecting upon itself (for instance, a [ReflectionProbe] centered on a vehicle). + */ + get cull_mask(): int64 + set cull_mask(value: int64) + + /** Sets the reflection mask which determines what objects have reflections applied from this probe. Every [VisualInstance3D] with a layer included in this reflection mask will have reflections applied from this probe. See also [member cull_mask], which can be used to exclude objects from appearing in the reflection while still making them affected by the [ReflectionProbe]. */ + get reflection_mask(): int64 + set reflection_mask(value: int64) + + /** The automatic LOD bias to use for meshes rendered within the [ReflectionProbe] (this is analog to [member Viewport.mesh_lod_threshold]). Higher values will use less detailed versions of meshes that have LOD variations generated. If set to `0.0`, automatic LOD is disabled. Increase [member mesh_lod_threshold] to improve performance at the cost of geometry detail, especially when using the [constant UPDATE_ALWAYS] [member update_mode]. + * + * **Note:** [member mesh_lod_threshold] does not affect [GeometryInstance3D] visibility ranges (also known as "manual" LOD or hierarchical LOD). + */ + get mesh_lod_threshold(): float64 + set mesh_lod_threshold(value: float64) + + /** The ambient color to use within the [ReflectionProbe]'s box defined by its [member size]. The ambient color will smoothly blend with other [ReflectionProbe]s and the rest of the scene (outside the [ReflectionProbe]'s box defined by its [member size]). */ + get ambient_mode(): int64 + set ambient_mode(value: int64) + + /** The custom ambient color to use within the [ReflectionProbe]'s box defined by its [member size]. Only effective if [member ambient_mode] is [constant AMBIENT_COLOR]. */ + get ambient_color(): Color + set ambient_color(value: Color) + + /** The custom ambient color energy to use within the [ReflectionProbe]'s box defined by its [member size]. Only effective if [member ambient_mode] is [constant AMBIENT_COLOR]. */ + get ambient_color_energy(): float64 + set ambient_color_energy(value: float64) + } + class ReflectionProbeGizmoPlugin extends EditorNode3DGizmoPlugin { + constructor(identifier?: any) + } + /** Class for searching text for patterns using regular expressions. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_regex.html + */ + class RegEx extends RefCounted { + constructor(identifier?: any) + /** Creates and compiles a new [RegEx] object. See also [method compile]. */ + static create_from_string(pattern: string, show_error: boolean = true): RegEx + + /** This method resets the state of the object, as if it was freshly created. Namely, it unassigns the regular expression of this object. */ + clear(): void + + /** Compiles and assign the search pattern to use. Returns [constant OK] if the compilation is successful. If compilation fails, returns [constant FAILED] and when [param show_error] is `true`, details are printed to standard output. */ + compile(pattern: string, show_error: boolean = true): GError + + /** Searches the text for the compiled pattern. Returns a [RegExMatch] container of the first matching result if found, otherwise `null`. + * The region to search within can be specified with [param offset] and [param end]. This is useful when searching for another match in the same [param subject] by calling this method again after a previous success. Note that setting these parameters differs from passing over a shortened string. For example, the start anchor `^` is not affected by [param offset], and the character before [param offset] will be checked for the word boundary `\b`. + */ + search(subject: string, offset: int64 = 0, end: int64 = -1): RegExMatch + + /** Searches the text for the compiled pattern. Returns an array of [RegExMatch] containers for each non-overlapping result. If no results were found, an empty array is returned instead. + * The region to search within can be specified with [param offset] and [param end]. This is useful when searching for another match in the same [param subject] by calling this method again after a previous success. Note that setting these parameters differs from passing over a shortened string. For example, the start anchor `^` is not affected by [param offset], and the character before [param offset] will be checked for the word boundary `\b`. + */ + search_all(subject: string, offset: int64 = 0, end: int64 = -1): GArray + + /** Searches the text for the compiled pattern and replaces it with the specified string. Escapes and backreferences such as `$1` and `$name` are expanded and resolved. By default, only the first instance is replaced, but it can be changed for all instances (global replacement). + * The region to search within can be specified with [param offset] and [param end]. This is useful when searching for another match in the same [param subject] by calling this method again after a previous success. Note that setting these parameters differs from passing over a shortened string. For example, the start anchor `^` is not affected by [param offset], and the character before [param offset] will be checked for the word boundary `\b`. + */ + sub(subject: string, replacement: string, all: boolean = false, offset: int64 = 0, end: int64 = -1): string + + /** Returns whether this object has a valid search pattern assigned. */ + is_valid(): boolean + + /** Returns the original search pattern that was compiled. */ + get_pattern(): string + + /** Returns the number of capturing groups in compiled pattern. */ + get_group_count(): int64 + + /** Returns an array of names of named capturing groups in the compiled pattern. They are ordered by appearance. */ + get_names(): PackedStringArray + } + /** Contains the results of a [RegEx] search. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_regexmatch.html + */ + class RegExMatch extends RefCounted { + constructor(identifier?: any) + /** Returns the number of capturing groups. */ + get_group_count(): int64 + + /** Returns the substring of the match from the source string. Capturing groups can be retrieved by providing its group number as an integer or its string name (if it's a named group). The default value of 0 refers to the whole pattern. + * Returns an empty string if the group did not match or doesn't exist. + */ + get_string(name: any = {}): string + + /** Returns the starting position of the match within the source string. The starting position of capturing groups can be retrieved by providing its group number as an integer or its string name (if it's a named group). The default value of 0 refers to the whole pattern. + * Returns -1 if the group did not match or doesn't exist. + */ + get_start(name: any = {}): int64 + + /** Returns the end position of the match within the source string. The end position of capturing groups can be retrieved by providing its group number as an integer or its string name (if it's a named group). The default value of 0 refers to the whole pattern. + * Returns -1 if the group did not match or doesn't exist. + */ + get_end(name: any = {}): int64 + + /** The source string used with the search pattern to find this matching result. */ + get subject(): string + + /** A dictionary of named groups and its corresponding group number. Only groups that were matched are included. If multiple groups have the same name, that name would refer to the first matching one. */ + get names(): GDictionary + + /** An [Array] of the match and its capturing groups. */ + get strings(): GArray + } + /** RemoteTransform2D pushes its own [Transform2D] to another [Node2D] derived node in the scene. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_remotetransform2d.html + */ + class RemoteTransform2D = Record> extends Node2D { + constructor(identifier?: any) + /** [RemoteTransform2D] caches the remote node. It may not notice if the remote node disappears; [method force_update_cache] forces it to update the cache again. */ + force_update_cache(): void + + /** The [NodePath] to the remote node, relative to the RemoteTransform2D's position in the scene. */ + get remote_path(): NodePath + set remote_path(value: NodePath | string) + + /** If `true`, global coordinates are used. If `false`, local coordinates are used. */ + get use_global_coordinates(): boolean + set use_global_coordinates(value: boolean) + + /** If `true`, the remote node's position is updated. */ + get update_position(): boolean + set update_position(value: boolean) + + /** If `true`, the remote node's rotation is updated. */ + get update_rotation(): boolean + set update_rotation(value: boolean) + + /** If `true`, the remote node's scale is updated. */ + get update_scale(): boolean + set update_scale(value: boolean) + } + /** RemoteTransform3D pushes its own [Transform3D] to another [Node3D] derived Node in the scene. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_remotetransform3d.html + */ + class RemoteTransform3D = Record> extends Node3D { + constructor(identifier?: any) + /** [RemoteTransform3D] caches the remote node. It may not notice if the remote node disappears; [method force_update_cache] forces it to update the cache again. */ + force_update_cache(): void + + /** The [NodePath] to the remote node, relative to the RemoteTransform3D's position in the scene. */ + get remote_path(): NodePath + set remote_path(value: NodePath | string) + + /** If `true`, global coordinates are used. If `false`, local coordinates are used. */ + get use_global_coordinates(): boolean + set use_global_coordinates(value: boolean) + + /** If `true`, the remote node's position is updated. */ + get update_position(): boolean + set update_position(value: boolean) + + /** If `true`, the remote node's rotation is updated. */ + get update_rotation(): boolean + set update_rotation(value: boolean) + + /** If `true`, the remote node's scale is updated. */ + get update_scale(): boolean + set update_scale(value: boolean) + } + class RenameDialog = Record> extends ConfirmationDialog { + constructor(identifier?: any) + rename(): void + } + class RenderBufferCustomDataRD extends RefCounted { + constructor(identifier?: any) + } + class RenderBufferDataForwardClustered extends RenderBufferCustomDataRD { + constructor(identifier?: any) + } + class RenderBuffersGI extends RenderBufferCustomDataRD { + constructor(identifier?: any) + } + /** Abstract render data object, holds frame data related to rendering a single frame of a viewport. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_renderdata.html + */ + class RenderData extends Object { + constructor(identifier?: any) + /** Returns the [RenderSceneBuffers] object managing the scene buffers for rendering this viewport. */ + get_render_scene_buffers(): RenderSceneBuffers + + /** Returns the [RenderSceneData] object managing this frames scene data. */ + get_render_scene_data(): RenderSceneData + + /** Returns the [RID] of the environment object in the [RenderingServer] being used to render this viewport. */ + get_environment(): RID + + /** Returns the [RID] of the camera attributes object in the [RenderingServer] being used to render this viewport. */ + get_camera_attributes(): RID + } + /** This class allows for a RenderData implementation to be made in GDExtension. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_renderdataextension.html + */ + class RenderDataExtension extends RenderData { + constructor(identifier?: any) + /** Implement this in GDExtension to return the implementation's [RenderSceneBuffers] object. */ + /* gdvirtual */ _get_render_scene_buffers(): RenderSceneBuffers + + /** Implement this in GDExtension to return the implementation's [RenderSceneDataExtension] object. */ + /* gdvirtual */ _get_render_scene_data(): RenderSceneData + + /** Implement this in GDExtension to return the [RID] of the implementation's environment object. */ + /* gdvirtual */ _get_environment(): RID + + /** Implement this in GDExtension to return the [RID] for the implementation's camera attributes object. */ + /* gdvirtual */ _get_camera_attributes(): RID + } + /** Render data implementation for the RenderingDevice based renderers. + * + * **Note:** This is an internal rendering server object, do not instantiate this from script. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_renderdatard.html + */ + class RenderDataRD extends RenderData { + constructor(identifier?: any) + } + /** Abstract scene buffers object, created for each viewport for which 3D rendering is done. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_renderscenebuffers.html + */ + class RenderSceneBuffers extends RefCounted { + constructor(identifier?: any) + /** This method is called by the rendering server when the associated viewports configuration is changed. It will discard the old buffers and recreate the internal buffers used. */ + configure(config: RenderSceneBuffersConfiguration): void + } + /** Configuration object used to setup a [RenderSceneBuffers] object. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_renderscenebuffersconfiguration.html + */ + class RenderSceneBuffersConfiguration extends RefCounted { + constructor(identifier?: any) + /** The render target associated with these buffer. */ + get render_target(): RID + set render_target(value: RID) + + /** The size of the 3D render buffer used for rendering. */ + get internal_size(): Vector2i + set internal_size(value: Vector2i) + + /** The target (upscale) size if scaling is used. */ + get target_size(): Vector2i + set target_size(value: Vector2i) + + /** The number of views we're rendering. */ + get view_count(): int64 + set view_count(value: int64) + + /** The requested scaling mode with which we upscale/downscale if [member internal_size] and [member target_size] are not equal. */ + get scaling_3d_mode(): int64 + set scaling_3d_mode(value: int64) + + /** The MSAA mode we're using for 3D rendering. */ + get msaa_3d(): int64 + set msaa_3d(value: int64) + + /** The requested screen space AA applied in post processing. */ + get screen_space_aa(): int64 + set screen_space_aa(value: int64) + + /** FSR Sharpness applicable if FSR upscaling is used. */ + get fsr_sharpness(): boolean + set fsr_sharpness(value: boolean) + + /** Bias applied to mipmaps. */ + get texture_mipmap_bias(): boolean + set texture_mipmap_bias(value: boolean) + + /** Level of the anisotropic filter. */ + get anisotropic_filtering_level(): int64 + set anisotropic_filtering_level(value: int64) + } + /** This class allows for a RenderSceneBuffer implementation to be made in GDExtension. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_renderscenebuffersextension.html + */ + class RenderSceneBuffersExtension extends RenderSceneBuffers { + constructor(identifier?: any) + /** Implement this in GDExtension to handle the (re)sizing of a viewport. */ + /* gdvirtual */ _configure(config: RenderSceneBuffersConfiguration): void + + /** Implement this in GDExtension to record a new FSR sharpness value. */ + /* gdvirtual */ _set_fsr_sharpness(fsr_sharpness: float64): void + + /** Implement this in GDExtension to change the texture mipmap bias. */ + /* gdvirtual */ _set_texture_mipmap_bias(texture_mipmap_bias: float64): void + + /** Implement this in GDExtension to change the anisotropic filtering level. */ + /* gdvirtual */ _set_anisotropic_filtering_level(anisotropic_filtering_level: int64): void + + /** Implement this in GDExtension to react to the debanding flag changing. */ + /* gdvirtual */ _set_use_debanding(use_debanding: boolean): void + } + /** Render scene buffer implementation for the RenderingDevice based renderers. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_renderscenebuffersrd.html + */ + class RenderSceneBuffersRD extends RenderSceneBuffers { + constructor(identifier?: any) + /** Returns `true` if a cached texture exists for this name. */ + has_texture(context: StringName, name: StringName): boolean + + /** Create a new texture with the given definition and cache this under the given name. Will return the existing texture if it already exists. */ + create_texture(context: StringName, name: StringName, data_format: RenderingDevice.DataFormat, usage_bits: int64, texture_samples: RenderingDevice.TextureSamples, size: Vector2i, layers: int64, mipmaps: int64, unique: boolean, discardable: boolean): RID + + /** Create a new texture using the given format and view and cache this under the given name. Will return the existing texture if it already exists. */ + create_texture_from_format(context: StringName, name: StringName, format: RDTextureFormat, view: RDTextureView, unique: boolean): RID + + /** Create a new texture view for an existing texture and cache this under the given [param view_name]. Will return the existing texture view if it already exists. Will error if the source texture doesn't exist. */ + create_texture_view(context: StringName, name: StringName, view_name: StringName, view: RDTextureView): RID + + /** Returns a cached texture with this name. */ + get_texture(context: StringName, name: StringName): RID + + /** Returns the texture format information with which a cached texture was created. */ + get_texture_format(context: StringName, name: StringName): RDTextureFormat + + /** Returns a specific slice (layer or mipmap) for a cached texture. */ + get_texture_slice(context: StringName, name: StringName, layer: int64, mipmap: int64, layers: int64, mipmaps: int64): RID + + /** Returns a specific view of a slice (layer or mipmap) for a cached texture. */ + get_texture_slice_view(context: StringName, name: StringName, layer: int64, mipmap: int64, layers: int64, mipmaps: int64, view: RDTextureView): RID + + /** Returns the texture size of a given slice of a cached texture. */ + get_texture_slice_size(context: StringName, name: StringName, mipmap: int64): Vector2i + + /** Frees all buffers related to this context. */ + clear_context(context: StringName): void + + /** Returns the color texture we are rendering 3D content to. If multiview is used this will be a texture array with all views. + * If [param msaa] is `true` and MSAA is enabled, this returns the MSAA variant of the buffer. + */ + get_color_texture(msaa: boolean = false): RID + + /** Returns the specified layer from the color texture we are rendering 3D content to. + * If [param msaa] is `true` and MSAA is enabled, this returns the MSAA variant of the buffer. + */ + get_color_layer(layer: int64, msaa: boolean = false): RID + + /** Returns the depth texture we are rendering 3D content to. If multiview is used this will be a texture array with all views. + * If [param msaa] is `true` and MSAA is enabled, this returns the MSAA variant of the buffer. + */ + get_depth_texture(msaa: boolean = false): RID + + /** Returns the specified layer from the depth texture we are rendering 3D content to. + * If [param msaa] is `true` and MSAA is enabled, this returns the MSAA variant of the buffer. + */ + get_depth_layer(layer: int64, msaa: boolean = false): RID + + /** Returns the velocity texture we are rendering 3D content to. If multiview is used this will be a texture array with all views. + * If [param msaa] is **true** and MSAA is enabled, this returns the MSAA variant of the buffer. + */ + get_velocity_texture(msaa: boolean = false): RID + + /** Returns the specified layer from the velocity texture we are rendering 3D content to. */ + get_velocity_layer(layer: int64, msaa: boolean = false): RID + + /** Returns the render target associated with this buffers object. */ + get_render_target(): RID + + /** Returns the view count for the associated viewport. */ + get_view_count(): int64 + + /** Returns the internal size of the render buffer (size before upscaling) with which textures are created by default. */ + get_internal_size(): Vector2i + + /** Returns the target size of the render buffer (size after upscaling). */ + get_target_size(): Vector2i + + /** Returns the scaling mode used for upscaling. */ + get_scaling_3d_mode(): RenderingServer.ViewportScaling3DMode + + /** Returns the FSR sharpness value used while rendering the 3D content (if [method get_scaling_3d_mode] is an FSR mode). */ + get_fsr_sharpness(): float64 + + /** Returns the applied 3D MSAA mode for this viewport. */ + get_msaa_3d(): RenderingServer.ViewportMSAA + + /** Returns the number of MSAA samples used. */ + get_texture_samples(): RenderingDevice.TextureSamples + + /** Returns the screen-space antialiasing method applied. */ + get_screen_space_aa(): RenderingServer.ViewportScreenSpaceAA + + /** Returns `true` if TAA is enabled. */ + get_use_taa(): boolean + + /** Returns `true` if debanding is enabled. */ + get_use_debanding(): boolean + } + /** Abstract render data object, holds scene data related to rendering a single frame of a viewport. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_renderscenedata.html + */ + class RenderSceneData extends Object { + constructor(identifier?: any) + /** Returns the camera transform used to render this frame. + * + * **Note:** If more than one view is rendered, this will return a centered transform. + */ + get_cam_transform(): Transform3D + + /** Returns the camera projection used to render this frame. + * + * **Note:** If more than one view is rendered, this will return a combined projection. + */ + get_cam_projection(): Projection + + /** Returns the number of views being rendered. */ + get_view_count(): int64 + + /** Returns the eye offset per view used to render this frame. This is the offset between our camera transform and the eye transform. */ + get_view_eye_offset(view: int64): Vector3 + + /** Returns the view projection per view used to render this frame. + * + * **Note:** If a single view is rendered, this returns the camera projection. If more than one view is rendered, this will return a projection for the given view including the eye offset. + */ + get_view_projection(view: int64): Projection + + /** Return the [RID] of the uniform buffer containing the scene data as a UBO. */ + get_uniform_buffer(): RID + } + /** This class allows for a RenderSceneData implementation to be made in GDExtension. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_renderscenedataextension.html + */ + class RenderSceneDataExtension extends RenderSceneData { + constructor(identifier?: any) + /** Implement this in GDExtension to return the camera [Transform3D]. */ + /* gdvirtual */ _get_cam_transform(): Transform3D + + /** Implement this in GDExtension to return the camera [Projection]. */ + /* gdvirtual */ _get_cam_projection(): Projection + + /** Implement this in GDExtension to return the view count. */ + /* gdvirtual */ _get_view_count(): int64 + + /** Implement this in GDExtension to return the eye offset for the given [param view]. */ + /* gdvirtual */ _get_view_eye_offset(view: int64): Vector3 + + /** Implement this in GDExtension to return the view [Projection] for the given [param view]. */ + /* gdvirtual */ _get_view_projection(view: int64): Projection + + /** Implement this in GDExtension to return the [RID] of the uniform buffer containing the scene data as a UBO. */ + /* gdvirtual */ _get_uniform_buffer(): RID + } + /** Render scene data implementation for the RenderingDevice based renderers. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_renderscenedatard.html + */ + class RenderSceneDataRD extends RenderSceneData { + constructor(identifier?: any) + } + namespace RenderingDevice { + enum DeviceType { + /** Rendering device type does not match any of the other enum values or is unknown. */ + DEVICE_TYPE_OTHER = 0, + + /** Rendering device is an integrated GPU, which is typically *(but not always)* slower than dedicated GPUs ([constant DEVICE_TYPE_DISCRETE_GPU]). On Android and iOS, the rendering device type is always considered to be [constant DEVICE_TYPE_INTEGRATED_GPU]. */ + DEVICE_TYPE_INTEGRATED_GPU = 1, + + /** Rendering device is a dedicated GPU, which is typically *(but not always)* faster than integrated GPUs ([constant DEVICE_TYPE_INTEGRATED_GPU]). */ + DEVICE_TYPE_DISCRETE_GPU = 2, + + /** Rendering device is an emulated GPU in a virtual environment. This is typically much slower than the host GPU, which means the expected performance level on a dedicated GPU will be roughly equivalent to [constant DEVICE_TYPE_INTEGRATED_GPU]. Virtual machine GPU passthrough (such as VFIO) will not report the device type as [constant DEVICE_TYPE_VIRTUAL_GPU]. Instead, the host GPU's device type will be reported as if the GPU was not emulated. */ + DEVICE_TYPE_VIRTUAL_GPU = 3, + + /** Rendering device is provided by software emulation (such as Lavapipe or [url=https://github.com/google/swiftshader]SwiftShader[/url]). This is the slowest kind of rendering device available; it's typically much slower than [constant DEVICE_TYPE_INTEGRATED_GPU]. */ + DEVICE_TYPE_CPU = 4, + + /** Represents the size of the [enum DeviceType] enum. */ + DEVICE_TYPE_MAX = 5, + } + enum DriverResource { + /** Specific device object based on a physical device. + * - Vulkan: Vulkan device driver resource (`VkDevice`). (`rid` argument doesn't apply.) + */ + DRIVER_RESOURCE_LOGICAL_DEVICE = 0, + + /** Physical device the specific logical device is based on. + * - Vulkan: `VkDevice`. (`rid` argument doesn't apply.) + */ + DRIVER_RESOURCE_PHYSICAL_DEVICE = 1, + + /** Top-most graphics API entry object. + * - Vulkan: `VkInstance`. (`rid` argument doesn't apply.) + */ + DRIVER_RESOURCE_TOPMOST_OBJECT = 2, + + /** The main graphics-compute command queue. + * - Vulkan: `VkQueue`. (`rid` argument doesn't apply.) + */ + DRIVER_RESOURCE_COMMAND_QUEUE = 3, + + /** The specific family the main queue belongs to. + * - Vulkan: the queue family index, an `uint32_t`. (`rid` argument doesn't apply.) + */ + DRIVER_RESOURCE_QUEUE_FAMILY = 4, + + /** - Vulkan: `VkImage`. */ + DRIVER_RESOURCE_TEXTURE = 5, + + /** The view of an owned or shared texture. + * - Vulkan: `VkImageView`. + */ + DRIVER_RESOURCE_TEXTURE_VIEW = 6, + + /** The native id of the data format of the texture. + * - Vulkan: `VkFormat`. + */ + DRIVER_RESOURCE_TEXTURE_DATA_FORMAT = 7, + + /** - Vulkan: `VkSampler`. */ + DRIVER_RESOURCE_SAMPLER = 8, + + /** - Vulkan: `VkDescriptorSet`. */ + DRIVER_RESOURCE_UNIFORM_SET = 9, + + /** Buffer of any kind of (storage, vertex, etc.). + * - Vulkan: `VkBuffer`. + */ + DRIVER_RESOURCE_BUFFER = 10, + + /** - Vulkan: `VkPipeline`. */ + DRIVER_RESOURCE_COMPUTE_PIPELINE = 11, + + /** - Vulkan: `VkPipeline`. */ + DRIVER_RESOURCE_RENDER_PIPELINE = 12, + DRIVER_RESOURCE_VULKAN_DEVICE = 0, + DRIVER_RESOURCE_VULKAN_PHYSICAL_DEVICE = 1, + DRIVER_RESOURCE_VULKAN_INSTANCE = 2, + DRIVER_RESOURCE_VULKAN_QUEUE = 3, + DRIVER_RESOURCE_VULKAN_QUEUE_FAMILY_INDEX = 4, + DRIVER_RESOURCE_VULKAN_IMAGE = 5, + DRIVER_RESOURCE_VULKAN_IMAGE_VIEW = 6, + DRIVER_RESOURCE_VULKAN_IMAGE_NATIVE_TEXTURE_FORMAT = 7, + DRIVER_RESOURCE_VULKAN_SAMPLER = 8, + DRIVER_RESOURCE_VULKAN_DESCRIPTOR_SET = 9, + DRIVER_RESOURCE_VULKAN_BUFFER = 10, + DRIVER_RESOURCE_VULKAN_COMPUTE_PIPELINE = 11, + DRIVER_RESOURCE_VULKAN_RENDER_PIPELINE = 12, + } + enum DataFormat { + /** 4-bit-per-channel red/green channel data format, packed into 8 bits. Values are in the `[0.0, 1.0]` range. + * + * **Note:** More information on all data formats can be found on the [url=https://registry.khronos.org/vulkan/specs/1.1/html/vkspec.html#_identification_of_formats]Identification of formats[/url] section of the Vulkan specification, as well as the [url=https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VkFormat.html]VkFormat[/url] enum. + */ + DATA_FORMAT_R4G4_UNORM_PACK8 = 0, + + /** 4-bit-per-channel red/green/blue/alpha channel data format, packed into 16 bits. Values are in the `[0.0, 1.0]` range. */ + DATA_FORMAT_R4G4B4A4_UNORM_PACK16 = 1, + + /** 4-bit-per-channel blue/green/red/alpha channel data format, packed into 16 bits. Values are in the `[0.0, 1.0]` range. */ + DATA_FORMAT_B4G4R4A4_UNORM_PACK16 = 2, + + /** Red/green/blue channel data format with 5 bits of red, 6 bits of green and 5 bits of blue, packed into 16 bits. Values are in the `[0.0, 1.0]` range. */ + DATA_FORMAT_R5G6B5_UNORM_PACK16 = 3, + + /** Blue/green/red channel data format with 5 bits of blue, 6 bits of green and 5 bits of red, packed into 16 bits. Values are in the `[0.0, 1.0]` range. */ + DATA_FORMAT_B5G6R5_UNORM_PACK16 = 4, + + /** Red/green/blue/alpha channel data format with 5 bits of red, 6 bits of green, 5 bits of blue and 1 bit of alpha, packed into 16 bits. Values are in the `[0.0, 1.0]` range. */ + DATA_FORMAT_R5G5B5A1_UNORM_PACK16 = 5, + + /** Blue/green/red/alpha channel data format with 5 bits of blue, 6 bits of green, 5 bits of red and 1 bit of alpha, packed into 16 bits. Values are in the `[0.0, 1.0]` range. */ + DATA_FORMAT_B5G5R5A1_UNORM_PACK16 = 6, + + /** Alpha/red/green/blue channel data format with 1 bit of alpha, 5 bits of red, 6 bits of green and 5 bits of blue, packed into 16 bits. Values are in the `[0.0, 1.0]` range. */ + DATA_FORMAT_A1R5G5B5_UNORM_PACK16 = 7, + + /** 8-bit-per-channel unsigned floating-point red channel data format with normalized value. Values are in the `[0.0, 1.0]` range. */ + DATA_FORMAT_R8_UNORM = 8, + + /** 8-bit-per-channel signed floating-point red channel data format with normalized value. Values are in the `[-1.0, 1.0]` range. */ + DATA_FORMAT_R8_SNORM = 9, + + /** 8-bit-per-channel unsigned floating-point red channel data format with scaled value (value is converted from integer to float). Values are in the `[0.0, 255.0]` range. */ + DATA_FORMAT_R8_USCALED = 10, + + /** 8-bit-per-channel signed floating-point red channel data format with scaled value (value is converted from integer to float). Values are in the `[-127.0, 127.0]` range. */ + DATA_FORMAT_R8_SSCALED = 11, + + /** 8-bit-per-channel unsigned integer red channel data format. Values are in the `[0, 255]` range. */ + DATA_FORMAT_R8_UINT = 12, + + /** 8-bit-per-channel signed integer red channel data format. Values are in the `[-127, 127]` range. */ + DATA_FORMAT_R8_SINT = 13, + + /** 8-bit-per-channel unsigned floating-point red channel data format with normalized value and non-linear sRGB encoding. Values are in the `[0.0, 1.0]` range. */ + DATA_FORMAT_R8_SRGB = 14, + + /** 8-bit-per-channel unsigned floating-point red/green channel data format with normalized value. Values are in the `[0.0, 1.0]` range. */ + DATA_FORMAT_R8G8_UNORM = 15, + + /** 8-bit-per-channel signed floating-point red/green channel data format with normalized value. Values are in the `[-1.0, 1.0]` range. */ + DATA_FORMAT_R8G8_SNORM = 16, + + /** 8-bit-per-channel unsigned floating-point red/green channel data format with scaled value (value is converted from integer to float). Values are in the `[0.0, 255.0]` range. */ + DATA_FORMAT_R8G8_USCALED = 17, + + /** 8-bit-per-channel signed floating-point red/green channel data format with scaled value (value is converted from integer to float). Values are in the `[-127.0, 127.0]` range. */ + DATA_FORMAT_R8G8_SSCALED = 18, + + /** 8-bit-per-channel unsigned integer red/green channel data format. Values are in the `[0, 255]` range. */ + DATA_FORMAT_R8G8_UINT = 19, + + /** 8-bit-per-channel signed integer red/green channel data format. Values are in the `[-127, 127]` range. */ + DATA_FORMAT_R8G8_SINT = 20, + + /** 8-bit-per-channel unsigned floating-point red/green channel data format with normalized value and non-linear sRGB encoding. Values are in the `[0.0, 1.0]` range. */ + DATA_FORMAT_R8G8_SRGB = 21, + + /** 8-bit-per-channel unsigned floating-point red/green/blue channel data format with normalized value. Values are in the `[0.0, 1.0]` range. */ + DATA_FORMAT_R8G8B8_UNORM = 22, + + /** 8-bit-per-channel signed floating-point red/green/blue channel data format with normalized value. Values are in the `[-1.0, 1.0]` range. */ + DATA_FORMAT_R8G8B8_SNORM = 23, + + /** 8-bit-per-channel unsigned floating-point red/green/blue channel data format with scaled value (value is converted from integer to float). Values are in the `[0.0, 255.0]` range. */ + DATA_FORMAT_R8G8B8_USCALED = 24, + + /** 8-bit-per-channel signed floating-point red/green/blue channel data format with scaled value (value is converted from integer to float). Values are in the `[-127.0, 127.0]` range. */ + DATA_FORMAT_R8G8B8_SSCALED = 25, + + /** 8-bit-per-channel unsigned integer red/green/blue channel data format. Values are in the `[0, 255]` range. */ + DATA_FORMAT_R8G8B8_UINT = 26, + + /** 8-bit-per-channel signed integer red/green/blue channel data format. Values are in the `[-127, 127]` range. */ + DATA_FORMAT_R8G8B8_SINT = 27, + + /** 8-bit-per-channel unsigned floating-point red/green/blue/blue channel data format with normalized value and non-linear sRGB encoding. Values are in the `[0.0, 1.0]` range. */ + DATA_FORMAT_R8G8B8_SRGB = 28, + + /** 8-bit-per-channel unsigned floating-point blue/green/red channel data format with normalized value. Values are in the `[0.0, 1.0]` range. */ + DATA_FORMAT_B8G8R8_UNORM = 29, + + /** 8-bit-per-channel signed floating-point blue/green/red channel data format with normalized value. Values are in the `[-1.0, 1.0]` range. */ + DATA_FORMAT_B8G8R8_SNORM = 30, + + /** 8-bit-per-channel unsigned floating-point blue/green/red channel data format with scaled value (value is converted from integer to float). Values are in the `[0.0, 255.0]` range. */ + DATA_FORMAT_B8G8R8_USCALED = 31, + + /** 8-bit-per-channel signed floating-point blue/green/red channel data format with scaled value (value is converted from integer to float). Values are in the `[-127.0, 127.0]` range. */ + DATA_FORMAT_B8G8R8_SSCALED = 32, + + /** 8-bit-per-channel unsigned integer blue/green/red channel data format. Values are in the `[0, 255]` range. */ + DATA_FORMAT_B8G8R8_UINT = 33, + + /** 8-bit-per-channel signed integer blue/green/red channel data format. Values are in the `[-127, 127]` range. */ + DATA_FORMAT_B8G8R8_SINT = 34, + + /** 8-bit-per-channel unsigned floating-point blue/green/red data format with normalized value and non-linear sRGB encoding. Values are in the `[0.0, 1.0]` range. */ + DATA_FORMAT_B8G8R8_SRGB = 35, + + /** 8-bit-per-channel unsigned floating-point red/green/blue/alpha channel data format with normalized value. Values are in the `[0.0, 1.0]` range. */ + DATA_FORMAT_R8G8B8A8_UNORM = 36, + + /** 8-bit-per-channel signed floating-point red/green/blue/alpha channel data format with normalized value. Values are in the `[-1.0, 1.0]` range. */ + DATA_FORMAT_R8G8B8A8_SNORM = 37, + + /** 8-bit-per-channel unsigned floating-point red/green/blue/alpha channel data format with scaled value (value is converted from integer to float). Values are in the `[0.0, 255.0]` range. */ + DATA_FORMAT_R8G8B8A8_USCALED = 38, + + /** 8-bit-per-channel signed floating-point red/green/blue/alpha channel data format with scaled value (value is converted from integer to float). Values are in the `[-127.0, 127.0]` range. */ + DATA_FORMAT_R8G8B8A8_SSCALED = 39, + + /** 8-bit-per-channel unsigned integer red/green/blue/alpha channel data format. Values are in the `[0, 255]` range. */ + DATA_FORMAT_R8G8B8A8_UINT = 40, + + /** 8-bit-per-channel signed integer red/green/blue/alpha channel data format. Values are in the `[-127, 127]` range. */ + DATA_FORMAT_R8G8B8A8_SINT = 41, + + /** 8-bit-per-channel unsigned floating-point red/green/blue/alpha channel data format with normalized value and non-linear sRGB encoding. Values are in the `[0.0, 1.0]` range. */ + DATA_FORMAT_R8G8B8A8_SRGB = 42, + + /** 8-bit-per-channel unsigned floating-point blue/green/red/alpha channel data format with normalized value. Values are in the `[0.0, 1.0]` range. */ + DATA_FORMAT_B8G8R8A8_UNORM = 43, + + /** 8-bit-per-channel signed floating-point blue/green/red/alpha channel data format with normalized value. Values are in the `[-1.0, 1.0]` range. */ + DATA_FORMAT_B8G8R8A8_SNORM = 44, + + /** 8-bit-per-channel unsigned floating-point blue/green/red/alpha channel data format with scaled value (value is converted from integer to float). Values are in the `[0.0, 255.0]` range. */ + DATA_FORMAT_B8G8R8A8_USCALED = 45, + + /** 8-bit-per-channel signed floating-point blue/green/red/alpha channel data format with scaled value (value is converted from integer to float). Values are in the `[-127.0, 127.0]` range. */ + DATA_FORMAT_B8G8R8A8_SSCALED = 46, + + /** 8-bit-per-channel unsigned integer blue/green/red/alpha channel data format. Values are in the `[0, 255]` range. */ + DATA_FORMAT_B8G8R8A8_UINT = 47, + + /** 8-bit-per-channel signed integer blue/green/red/alpha channel data format. Values are in the `[-127, 127]` range. */ + DATA_FORMAT_B8G8R8A8_SINT = 48, + + /** 8-bit-per-channel unsigned floating-point blue/green/red/alpha channel data format with normalized value and non-linear sRGB encoding. Values are in the `[0.0, 1.0]` range. */ + DATA_FORMAT_B8G8R8A8_SRGB = 49, + + /** 8-bit-per-channel unsigned floating-point alpha/red/green/blue channel data format with normalized value, packed in 32 bits. Values are in the `[0.0, 1.0]` range. */ + DATA_FORMAT_A8B8G8R8_UNORM_PACK32 = 50, + + /** 8-bit-per-channel signed floating-point alpha/red/green/blue channel data format with normalized value, packed in 32 bits. Values are in the `[-1.0, 1.0]` range. */ + DATA_FORMAT_A8B8G8R8_SNORM_PACK32 = 51, + + /** 8-bit-per-channel unsigned floating-point alpha/red/green/blue channel data format with scaled value (value is converted from integer to float), packed in 32 bits. Values are in the `[0.0, 255.0]` range. */ + DATA_FORMAT_A8B8G8R8_USCALED_PACK32 = 52, + + /** 8-bit-per-channel signed floating-point alpha/red/green/blue channel data format with scaled value (value is converted from integer to float), packed in 32 bits. Values are in the `[-127.0, 127.0]` range. */ + DATA_FORMAT_A8B8G8R8_SSCALED_PACK32 = 53, + + /** 8-bit-per-channel unsigned integer alpha/red/green/blue channel data format, packed in 32 bits. Values are in the `[0, 255]` range. */ + DATA_FORMAT_A8B8G8R8_UINT_PACK32 = 54, + + /** 8-bit-per-channel signed integer alpha/red/green/blue channel data format, packed in 32 bits. Values are in the `[-127, 127]` range. */ + DATA_FORMAT_A8B8G8R8_SINT_PACK32 = 55, + + /** 8-bit-per-channel unsigned floating-point alpha/red/green/blue channel data format with normalized value and non-linear sRGB encoding, packed in 32 bits. Values are in the `[0.0, 1.0]` range. */ + DATA_FORMAT_A8B8G8R8_SRGB_PACK32 = 56, + + /** Unsigned floating-point alpha/red/green/blue channel data format with normalized value, packed in 32 bits. Format contains 2 bits of alpha, 10 bits of red, 10 bits of green and 10 bits of blue. Values are in the `[0.0, 1.0]` range. */ + DATA_FORMAT_A2R10G10B10_UNORM_PACK32 = 57, + + /** Signed floating-point alpha/red/green/blue channel data format with normalized value, packed in 32 bits. Format contains 2 bits of alpha, 10 bits of red, 10 bits of green and 10 bits of blue. Values are in the `[-1.0, 1.0]` range. */ + DATA_FORMAT_A2R10G10B10_SNORM_PACK32 = 58, + + /** Unsigned floating-point alpha/red/green/blue channel data format with normalized value, packed in 32 bits. Format contains 2 bits of alpha, 10 bits of red, 10 bits of green and 10 bits of blue. Values are in the `[0.0, 1023.0]` range for red/green/blue and `[0.0, 3.0]` for alpha. */ + DATA_FORMAT_A2R10G10B10_USCALED_PACK32 = 59, + + /** Signed floating-point alpha/red/green/blue channel data format with normalized value, packed in 32 bits. Format contains 2 bits of alpha, 10 bits of red, 10 bits of green and 10 bits of blue. Values are in the `[-511.0, 511.0]` range for red/green/blue and `[-1.0, 1.0]` for alpha. */ + DATA_FORMAT_A2R10G10B10_SSCALED_PACK32 = 60, + + /** Unsigned integer alpha/red/green/blue channel data format with normalized value, packed in 32 bits. Format contains 2 bits of alpha, 10 bits of red, 10 bits of green and 10 bits of blue. Values are in the `[0, 1023]` range for red/green/blue and `[0, 3]` for alpha. */ + DATA_FORMAT_A2R10G10B10_UINT_PACK32 = 61, + + /** Signed integer alpha/red/green/blue channel data format with normalized value, packed in 32 bits. Format contains 2 bits of alpha, 10 bits of red, 10 bits of green and 10 bits of blue. Values are in the `[-511, 511]` range for red/green/blue and `[-1, 1]` for alpha. */ + DATA_FORMAT_A2R10G10B10_SINT_PACK32 = 62, + + /** Unsigned floating-point alpha/blue/green/red channel data format with normalized value, packed in 32 bits. Format contains 2 bits of alpha, 10 bits of blue, 10 bits of green and 10 bits of red. Values are in the `[0.0, 1.0]` range. */ + DATA_FORMAT_A2B10G10R10_UNORM_PACK32 = 63, + + /** Signed floating-point alpha/blue/green/red channel data format with normalized value, packed in 32 bits. Format contains 2 bits of alpha, 10 bits of blue, 10 bits of green and 10 bits of red. Values are in the `[-1.0, 1.0]` range. */ + DATA_FORMAT_A2B10G10R10_SNORM_PACK32 = 64, + + /** Unsigned floating-point alpha/blue/green/red channel data format with normalized value, packed in 32 bits. Format contains 2 bits of alpha, 10 bits of blue, 10 bits of green and 10 bits of red. Values are in the `[0.0, 1023.0]` range for blue/green/red and `[0.0, 3.0]` for alpha. */ + DATA_FORMAT_A2B10G10R10_USCALED_PACK32 = 65, + + /** Signed floating-point alpha/blue/green/red channel data format with normalized value, packed in 32 bits. Format contains 2 bits of alpha, 10 bits of blue, 10 bits of green and 10 bits of red. Values are in the `[-511.0, 511.0]` range for blue/green/red and `[-1.0, 1.0]` for alpha. */ + DATA_FORMAT_A2B10G10R10_SSCALED_PACK32 = 66, + + /** Unsigned integer alpha/blue/green/red channel data format with normalized value, packed in 32 bits. Format contains 2 bits of alpha, 10 bits of blue, 10 bits of green and 10 bits of red. Values are in the `[0, 1023]` range for blue/green/red and `[0, 3]` for alpha. */ + DATA_FORMAT_A2B10G10R10_UINT_PACK32 = 67, + + /** Signed integer alpha/blue/green/red channel data format with normalized value, packed in 32 bits. Format contains 2 bits of alpha, 10 bits of blue, 10 bits of green and 10 bits of red. Values are in the `[-511, 511]` range for blue/green/red and `[-1, 1]` for alpha. */ + DATA_FORMAT_A2B10G10R10_SINT_PACK32 = 68, + + /** 16-bit-per-channel unsigned floating-point red channel data format with normalized value. Values are in the `[0.0, 1.0]` range. */ + DATA_FORMAT_R16_UNORM = 69, + + /** 16-bit-per-channel signed floating-point red channel data format with normalized value. Values are in the `[-1.0, 1.0]` range. */ + DATA_FORMAT_R16_SNORM = 70, + + /** 16-bit-per-channel unsigned floating-point red channel data format with scaled value (value is converted from integer to float). Values are in the `[0.0, 65535.0]` range. */ + DATA_FORMAT_R16_USCALED = 71, + + /** 16-bit-per-channel signed floating-point red channel data format with scaled value (value is converted from integer to float). Values are in the `[-32767.0, 32767.0]` range. */ + DATA_FORMAT_R16_SSCALED = 72, + + /** 16-bit-per-channel unsigned integer red channel data format. Values are in the `[0.0, 65535]` range. */ + DATA_FORMAT_R16_UINT = 73, + + /** 16-bit-per-channel signed integer red channel data format. Values are in the `[-32767, 32767]` range. */ + DATA_FORMAT_R16_SINT = 74, + + /** 16-bit-per-channel signed floating-point red channel data format with the value stored as-is. */ + DATA_FORMAT_R16_SFLOAT = 75, + + /** 16-bit-per-channel unsigned floating-point red/green channel data format with normalized value. Values are in the `[0.0, 1.0]` range. */ + DATA_FORMAT_R16G16_UNORM = 76, + + /** 16-bit-per-channel signed floating-point red/green channel data format with normalized value. Values are in the `[-1.0, 1.0]` range. */ + DATA_FORMAT_R16G16_SNORM = 77, + + /** 16-bit-per-channel unsigned floating-point red/green channel data format with scaled value (value is converted from integer to float). Values are in the `[0.0, 65535.0]` range. */ + DATA_FORMAT_R16G16_USCALED = 78, + + /** 16-bit-per-channel signed floating-point red/green channel data format with scaled value (value is converted from integer to float). Values are in the `[-32767.0, 32767.0]` range. */ + DATA_FORMAT_R16G16_SSCALED = 79, + + /** 16-bit-per-channel unsigned integer red/green channel data format. Values are in the `[0.0, 65535]` range. */ + DATA_FORMAT_R16G16_UINT = 80, + + /** 16-bit-per-channel signed integer red/green channel data format. Values are in the `[-32767, 32767]` range. */ + DATA_FORMAT_R16G16_SINT = 81, + + /** 16-bit-per-channel signed floating-point red/green channel data format with the value stored as-is. */ + DATA_FORMAT_R16G16_SFLOAT = 82, + + /** 16-bit-per-channel unsigned floating-point red/green/blue channel data format with normalized value. Values are in the `[0.0, 1.0]` range. */ + DATA_FORMAT_R16G16B16_UNORM = 83, + + /** 16-bit-per-channel signed floating-point red/green/blue channel data format with normalized value. Values are in the `[-1.0, 1.0]` range. */ + DATA_FORMAT_R16G16B16_SNORM = 84, + + /** 16-bit-per-channel unsigned floating-point red/green/blue channel data format with scaled value (value is converted from integer to float). Values are in the `[0.0, 65535.0]` range. */ + DATA_FORMAT_R16G16B16_USCALED = 85, + + /** 16-bit-per-channel signed floating-point red/green/blue channel data format with scaled value (value is converted from integer to float). Values are in the `[-32767.0, 32767.0]` range. */ + DATA_FORMAT_R16G16B16_SSCALED = 86, + + /** 16-bit-per-channel unsigned integer red/green/blue channel data format. Values are in the `[0.0, 65535]` range. */ + DATA_FORMAT_R16G16B16_UINT = 87, + + /** 16-bit-per-channel signed integer red/green/blue channel data format. Values are in the `[-32767, 32767]` range. */ + DATA_FORMAT_R16G16B16_SINT = 88, + + /** 16-bit-per-channel signed floating-point red/green/blue channel data format with the value stored as-is. */ + DATA_FORMAT_R16G16B16_SFLOAT = 89, + + /** 16-bit-per-channel unsigned floating-point red/green/blue/alpha channel data format with normalized value. Values are in the `[0.0, 1.0]` range. */ + DATA_FORMAT_R16G16B16A16_UNORM = 90, + + /** 16-bit-per-channel signed floating-point red/green/blue/alpha channel data format with normalized value. Values are in the `[-1.0, 1.0]` range. */ + DATA_FORMAT_R16G16B16A16_SNORM = 91, + + /** 16-bit-per-channel unsigned floating-point red/green/blue/alpha channel data format with scaled value (value is converted from integer to float). Values are in the `[0.0, 65535.0]` range. */ + DATA_FORMAT_R16G16B16A16_USCALED = 92, + + /** 16-bit-per-channel signed floating-point red/green/blue/alpha channel data format with scaled value (value is converted from integer to float). Values are in the `[-32767.0, 32767.0]` range. */ + DATA_FORMAT_R16G16B16A16_SSCALED = 93, + + /** 16-bit-per-channel unsigned integer red/green/blue/alpha channel data format. Values are in the `[0.0, 65535]` range. */ + DATA_FORMAT_R16G16B16A16_UINT = 94, + + /** 16-bit-per-channel signed integer red/green/blue/alpha channel data format. Values are in the `[-32767, 32767]` range. */ + DATA_FORMAT_R16G16B16A16_SINT = 95, + + /** 16-bit-per-channel signed floating-point red/green/blue/alpha channel data format with the value stored as-is. */ + DATA_FORMAT_R16G16B16A16_SFLOAT = 96, + + /** 32-bit-per-channel unsigned integer red channel data format. Values are in the `[0, 2^32 - 1]` range. */ + DATA_FORMAT_R32_UINT = 97, + + /** 32-bit-per-channel signed integer red channel data format. Values are in the `[2^31 + 1, 2^31 - 1]` range. */ + DATA_FORMAT_R32_SINT = 98, + + /** 32-bit-per-channel signed floating-point red channel data format with the value stored as-is. */ + DATA_FORMAT_R32_SFLOAT = 99, + + /** 32-bit-per-channel unsigned integer red/green channel data format. Values are in the `[0, 2^32 - 1]` range. */ + DATA_FORMAT_R32G32_UINT = 100, + + /** 32-bit-per-channel signed integer red/green channel data format. Values are in the `[2^31 + 1, 2^31 - 1]` range. */ + DATA_FORMAT_R32G32_SINT = 101, + + /** 32-bit-per-channel signed floating-point red/green channel data format with the value stored as-is. */ + DATA_FORMAT_R32G32_SFLOAT = 102, + + /** 32-bit-per-channel unsigned integer red/green/blue channel data format. Values are in the `[0, 2^32 - 1]` range. */ + DATA_FORMAT_R32G32B32_UINT = 103, + + /** 32-bit-per-channel signed integer red/green/blue channel data format. Values are in the `[2^31 + 1, 2^31 - 1]` range. */ + DATA_FORMAT_R32G32B32_SINT = 104, + + /** 32-bit-per-channel signed floating-point red/green/blue channel data format with the value stored as-is. */ + DATA_FORMAT_R32G32B32_SFLOAT = 105, + + /** 32-bit-per-channel unsigned integer red/green/blue/alpha channel data format. Values are in the `[0, 2^32 - 1]` range. */ + DATA_FORMAT_R32G32B32A32_UINT = 106, + + /** 32-bit-per-channel signed integer red/green/blue/alpha channel data format. Values are in the `[2^31 + 1, 2^31 - 1]` range. */ + DATA_FORMAT_R32G32B32A32_SINT = 107, + + /** 32-bit-per-channel signed floating-point red/green/blue/alpha channel data format with the value stored as-is. */ + DATA_FORMAT_R32G32B32A32_SFLOAT = 108, + + /** 64-bit-per-channel unsigned integer red channel data format. Values are in the `[0, 2^64 - 1]` range. */ + DATA_FORMAT_R64_UINT = 109, + + /** 64-bit-per-channel signed integer red channel data format. Values are in the `[2^63 + 1, 2^63 - 1]` range. */ + DATA_FORMAT_R64_SINT = 110, + + /** 64-bit-per-channel signed floating-point red channel data format with the value stored as-is. */ + DATA_FORMAT_R64_SFLOAT = 111, + + /** 64-bit-per-channel unsigned integer red/green channel data format. Values are in the `[0, 2^64 - 1]` range. */ + DATA_FORMAT_R64G64_UINT = 112, + + /** 64-bit-per-channel signed integer red/green channel data format. Values are in the `[2^63 + 1, 2^63 - 1]` range. */ + DATA_FORMAT_R64G64_SINT = 113, + + /** 64-bit-per-channel signed floating-point red/green channel data format with the value stored as-is. */ + DATA_FORMAT_R64G64_SFLOAT = 114, + + /** 64-bit-per-channel unsigned integer red/green/blue channel data format. Values are in the `[0, 2^64 - 1]` range. */ + DATA_FORMAT_R64G64B64_UINT = 115, + + /** 64-bit-per-channel signed integer red/green/blue channel data format. Values are in the `[2^63 + 1, 2^63 - 1]` range. */ + DATA_FORMAT_R64G64B64_SINT = 116, + + /** 64-bit-per-channel signed floating-point red/green/blue channel data format with the value stored as-is. */ + DATA_FORMAT_R64G64B64_SFLOAT = 117, + + /** 64-bit-per-channel unsigned integer red/green/blue/alpha channel data format. Values are in the `[0, 2^64 - 1]` range. */ + DATA_FORMAT_R64G64B64A64_UINT = 118, + + /** 64-bit-per-channel signed integer red/green/blue/alpha channel data format. Values are in the `[2^63 + 1, 2^63 - 1]` range. */ + DATA_FORMAT_R64G64B64A64_SINT = 119, + + /** 64-bit-per-channel signed floating-point red/green/blue/alpha channel data format with the value stored as-is. */ + DATA_FORMAT_R64G64B64A64_SFLOAT = 120, + + /** Unsigned floating-point blue/green/red data format with the value stored as-is, packed in 32 bits. The format's precision is 10 bits of blue channel, 11 bits of green channel and 11 bits of red channel. */ + DATA_FORMAT_B10G11R11_UFLOAT_PACK32 = 121, + + /** Unsigned floating-point exposure/blue/green/red data format with the value stored as-is, packed in 32 bits. The format's precision is 5 bits of exposure, 9 bits of blue channel, 9 bits of green channel and 9 bits of red channel. */ + DATA_FORMAT_E5B9G9R9_UFLOAT_PACK32 = 122, + + /** 16-bit unsigned floating-point depth data format with normalized value. Values are in the `[0.0, 1.0]` range. */ + DATA_FORMAT_D16_UNORM = 123, + + /** 24-bit unsigned floating-point depth data format with normalized value, plus 8 unused bits, packed in 32 bits. Values for depth are in the `[0.0, 1.0]` range. */ + DATA_FORMAT_X8_D24_UNORM_PACK32 = 124, + + /** 32-bit signed floating-point depth data format with the value stored as-is. */ + DATA_FORMAT_D32_SFLOAT = 125, + + /** 8-bit unsigned integer stencil data format. */ + DATA_FORMAT_S8_UINT = 126, + + /** 16-bit unsigned floating-point depth data format with normalized value, plus 8 bits of stencil in unsigned integer format. Values for depth are in the `[0.0, 1.0]` range. Values for stencil are in the `[0, 255]` range. */ + DATA_FORMAT_D16_UNORM_S8_UINT = 127, + + /** 24-bit unsigned floating-point depth data format with normalized value, plus 8 bits of stencil in unsigned integer format. Values for depth are in the `[0.0, 1.0]` range. Values for stencil are in the `[0, 255]` range. */ + DATA_FORMAT_D24_UNORM_S8_UINT = 128, + + /** 32-bit signed floating-point depth data format with the value stored as-is, plus 8 bits of stencil in unsigned integer format. Values for stencil are in the `[0, 255]` range. */ + DATA_FORMAT_D32_SFLOAT_S8_UINT = 129, + + /** VRAM-compressed unsigned red/green/blue channel data format with normalized value. Values are in the `[0.0, 1.0]` range. The format's precision is 5 bits of red channel, 6 bits of green channel and 5 bits of blue channel. Using BC1 texture compression (also known as S3TC DXT1). */ + DATA_FORMAT_BC1_RGB_UNORM_BLOCK = 130, + + /** VRAM-compressed unsigned red/green/blue channel data format with normalized value and non-linear sRGB encoding. Values are in the `[0.0, 1.0]` range. The format's precision is 5 bits of red channel, 6 bits of green channel and 5 bits of blue channel. Using BC1 texture compression (also known as S3TC DXT1). */ + DATA_FORMAT_BC1_RGB_SRGB_BLOCK = 131, + + /** VRAM-compressed unsigned red/green/blue/alpha channel data format with normalized value. Values are in the `[0.0, 1.0]` range. The format's precision is 5 bits of red channel, 6 bits of green channel, 5 bits of blue channel and 1 bit of alpha channel. Using BC1 texture compression (also known as S3TC DXT1). */ + DATA_FORMAT_BC1_RGBA_UNORM_BLOCK = 132, + + /** VRAM-compressed unsigned red/green/blue/alpha channel data format with normalized value and non-linear sRGB encoding. Values are in the `[0.0, 1.0]` range. The format's precision is 5 bits of red channel, 6 bits of green channel, 5 bits of blue channel and 1 bit of alpha channel. Using BC1 texture compression (also known as S3TC DXT1). */ + DATA_FORMAT_BC1_RGBA_SRGB_BLOCK = 133, + + /** VRAM-compressed unsigned red/green/blue/alpha channel data format with normalized value. Values are in the `[0.0, 1.0]` range. The format's precision is 5 bits of red channel, 6 bits of green channel, 5 bits of blue channel and 4 bits of alpha channel. Using BC2 texture compression (also known as S3TC DXT3). */ + DATA_FORMAT_BC2_UNORM_BLOCK = 134, + + /** VRAM-compressed unsigned red/green/blue/alpha channel data format with normalized value and non-linear sRGB encoding. Values are in the `[0.0, 1.0]` range. The format's precision is 5 bits of red channel, 6 bits of green channel, 5 bits of blue channel and 4 bits of alpha channel. Using BC2 texture compression (also known as S3TC DXT3). */ + DATA_FORMAT_BC2_SRGB_BLOCK = 135, + + /** VRAM-compressed unsigned red/green/blue/alpha channel data format with normalized value. Values are in the `[0.0, 1.0]` range. The format's precision is 5 bits of red channel, 6 bits of green channel, 5 bits of blue channel and 8 bits of alpha channel. Using BC3 texture compression (also known as S3TC DXT5). */ + DATA_FORMAT_BC3_UNORM_BLOCK = 136, + + /** VRAM-compressed unsigned red/green/blue/alpha channel data format with normalized value and non-linear sRGB encoding. Values are in the `[0.0, 1.0]` range. The format's precision is 5 bits of red channel, 6 bits of green channel, 5 bits of blue channel and 8 bits of alpha channel. Using BC3 texture compression (also known as S3TC DXT5). */ + DATA_FORMAT_BC3_SRGB_BLOCK = 137, + + /** VRAM-compressed unsigned red channel data format with normalized value. Values are in the `[0.0, 1.0]` range. The format's precision is 8 bits of red channel. Using BC4 texture compression. */ + DATA_FORMAT_BC4_UNORM_BLOCK = 138, + + /** VRAM-compressed signed red channel data format with normalized value. Values are in the `[-1.0, 1.0]` range. The format's precision is 8 bits of red channel. Using BC4 texture compression. */ + DATA_FORMAT_BC4_SNORM_BLOCK = 139, + + /** VRAM-compressed unsigned red/green channel data format with normalized value. Values are in the `[0.0, 1.0]` range. The format's precision is 8 bits of red channel and 8 bits of green channel. Using BC5 texture compression (also known as S3TC RGTC). */ + DATA_FORMAT_BC5_UNORM_BLOCK = 140, + + /** VRAM-compressed signed red/green channel data format with normalized value. Values are in the `[-1.0, 1.0]` range. The format's precision is 8 bits of red channel and 8 bits of green channel. Using BC5 texture compression (also known as S3TC RGTC). */ + DATA_FORMAT_BC5_SNORM_BLOCK = 141, + + /** VRAM-compressed unsigned red/green/blue channel data format with the floating-point value stored as-is. The format's precision is between 10 and 13 bits for the red/green/blue channels. Using BC6H texture compression (also known as BPTC HDR). */ + DATA_FORMAT_BC6H_UFLOAT_BLOCK = 142, + + /** VRAM-compressed signed red/green/blue channel data format with the floating-point value stored as-is. The format's precision is between 10 and 13 bits for the red/green/blue channels. Using BC6H texture compression (also known as BPTC HDR). */ + DATA_FORMAT_BC6H_SFLOAT_BLOCK = 143, + + /** VRAM-compressed unsigned red/green/blue/alpha channel data format with normalized value. Values are in the `[0.0, 1.0]` range. The format's precision is between 4 and 7 bits for the red/green/blue channels and between 0 and 8 bits for the alpha channel. Also known as BPTC LDR. */ + DATA_FORMAT_BC7_UNORM_BLOCK = 144, + + /** VRAM-compressed unsigned red/green/blue/alpha channel data format with normalized value and non-linear sRGB encoding. Values are in the `[0.0, 1.0]` range. The format's precision is between 4 and 7 bits for the red/green/blue channels and between 0 and 8 bits for the alpha channel. Also known as BPTC LDR. */ + DATA_FORMAT_BC7_SRGB_BLOCK = 145, + + /** VRAM-compressed unsigned red/green/blue channel data format with normalized value. Values are in the `[0.0, 1.0]` range. Using ETC2 texture compression. */ + DATA_FORMAT_ETC2_R8G8B8_UNORM_BLOCK = 146, + + /** VRAM-compressed unsigned red/green/blue channel data format with normalized value and non-linear sRGB encoding. Values are in the `[0.0, 1.0]` range. Using ETC2 texture compression. */ + DATA_FORMAT_ETC2_R8G8B8_SRGB_BLOCK = 147, + + /** VRAM-compressed unsigned red/green/blue/alpha channel data format with normalized value. Values are in the `[0.0, 1.0]` range. Red/green/blue use 8 bit of precision each, with alpha using 1 bit of precision. Using ETC2 texture compression. */ + DATA_FORMAT_ETC2_R8G8B8A1_UNORM_BLOCK = 148, + + /** VRAM-compressed unsigned red/green/blue/alpha channel data format with normalized value and non-linear sRGB encoding. Values are in the `[0.0, 1.0]` range. Red/green/blue use 8 bit of precision each, with alpha using 1 bit of precision. Using ETC2 texture compression. */ + DATA_FORMAT_ETC2_R8G8B8A1_SRGB_BLOCK = 149, + + /** VRAM-compressed unsigned red/green/blue/alpha channel data format with normalized value. Values are in the `[0.0, 1.0]` range. Red/green/blue use 8 bits of precision each, with alpha using 8 bits of precision. Using ETC2 texture compression. */ + DATA_FORMAT_ETC2_R8G8B8A8_UNORM_BLOCK = 150, + + /** VRAM-compressed unsigned red/green/blue/alpha channel data format with normalized value and non-linear sRGB encoding. Values are in the `[0.0, 1.0]` range. Red/green/blue use 8 bits of precision each, with alpha using 8 bits of precision. Using ETC2 texture compression. */ + DATA_FORMAT_ETC2_R8G8B8A8_SRGB_BLOCK = 151, + + /** 11-bit VRAM-compressed unsigned red channel data format with normalized value. Values are in the `[0.0, 1.0]` range. Using ETC2 texture compression. */ + DATA_FORMAT_EAC_R11_UNORM_BLOCK = 152, + + /** 11-bit VRAM-compressed signed red channel data format with normalized value. Values are in the `[-1.0, 1.0]` range. Using ETC2 texture compression. */ + DATA_FORMAT_EAC_R11_SNORM_BLOCK = 153, + + /** 11-bit VRAM-compressed unsigned red/green channel data format with normalized value. Values are in the `[0.0, 1.0]` range. Using ETC2 texture compression. */ + DATA_FORMAT_EAC_R11G11_UNORM_BLOCK = 154, + + /** 11-bit VRAM-compressed signed red/green channel data format with normalized value. Values are in the `[-1.0, 1.0]` range. Using ETC2 texture compression. */ + DATA_FORMAT_EAC_R11G11_SNORM_BLOCK = 155, + + /** VRAM-compressed unsigned floating-point data format with normalized value, packed in 4×4 blocks (highest quality). Values are in the `[0.0, 1.0]` range. Using ASTC compression. */ + DATA_FORMAT_ASTC_4x4_UNORM_BLOCK = 156, + + /** VRAM-compressed unsigned floating-point data format with normalized value and non-linear sRGB encoding, packed in 4×4 blocks (highest quality). Values are in the `[0.0, 1.0]` range. Using ASTC compression. */ + DATA_FORMAT_ASTC_4x4_SRGB_BLOCK = 157, + + /** VRAM-compressed unsigned floating-point data format with normalized value, packed in 5×4 blocks. Values are in the `[0.0, 1.0]` range. Using ASTC compression. */ + DATA_FORMAT_ASTC_5x4_UNORM_BLOCK = 158, + + /** VRAM-compressed unsigned floating-point data format with normalized value and non-linear sRGB encoding, packed in 5×4 blocks. Values are in the `[0.0, 1.0]` range. Using ASTC compression. */ + DATA_FORMAT_ASTC_5x4_SRGB_BLOCK = 159, + + /** VRAM-compressed unsigned floating-point data format with normalized value, packed in 5×5 blocks. Values are in the `[0.0, 1.0]` range. Using ASTC compression. */ + DATA_FORMAT_ASTC_5x5_UNORM_BLOCK = 160, + + /** VRAM-compressed unsigned floating-point data format with normalized value and non-linear sRGB encoding, packed in 5×5 blocks. Values are in the `[0.0, 1.0]` range. Using ASTC compression. */ + DATA_FORMAT_ASTC_5x5_SRGB_BLOCK = 161, + + /** VRAM-compressed unsigned floating-point data format with normalized value, packed in 6×5 blocks. Values are in the `[0.0, 1.0]` range. Using ASTC compression. */ + DATA_FORMAT_ASTC_6x5_UNORM_BLOCK = 162, + + /** VRAM-compressed unsigned floating-point data format with normalized value and non-linear sRGB encoding, packed in 6×5 blocks. Values are in the `[0.0, 1.0]` range. Using ASTC compression. */ + DATA_FORMAT_ASTC_6x5_SRGB_BLOCK = 163, + + /** VRAM-compressed unsigned floating-point data format with normalized value, packed in 6×6 blocks. Values are in the `[0.0, 1.0]` range. Using ASTC compression. */ + DATA_FORMAT_ASTC_6x6_UNORM_BLOCK = 164, + + /** VRAM-compressed unsigned floating-point data format with normalized value and non-linear sRGB encoding, packed in 6×6 blocks. Values are in the `[0.0, 1.0]` range. Using ASTC compression. */ + DATA_FORMAT_ASTC_6x6_SRGB_BLOCK = 165, + + /** VRAM-compressed unsigned floating-point data format with normalized value, packed in 8×5 blocks. Values are in the `[0.0, 1.0]` range. Using ASTC compression. */ + DATA_FORMAT_ASTC_8x5_UNORM_BLOCK = 166, + + /** VRAM-compressed unsigned floating-point data format with normalized value and non-linear sRGB encoding, packed in 8×5 blocks. Values are in the `[0.0, 1.0]` range. Using ASTC compression. */ + DATA_FORMAT_ASTC_8x5_SRGB_BLOCK = 167, + + /** VRAM-compressed unsigned floating-point data format with normalized value, packed in 8×6 blocks. Values are in the `[0.0, 1.0]` range. Using ASTC compression. */ + DATA_FORMAT_ASTC_8x6_UNORM_BLOCK = 168, + + /** VRAM-compressed unsigned floating-point data format with normalized value and non-linear sRGB encoding, packed in 8×6 blocks. Values are in the `[0.0, 1.0]` range. Using ASTC compression. */ + DATA_FORMAT_ASTC_8x6_SRGB_BLOCK = 169, + + /** VRAM-compressed unsigned floating-point data format with normalized value, packed in 8×8 blocks. Values are in the `[0.0, 1.0]` range. Using ASTC compression. */ + DATA_FORMAT_ASTC_8x8_UNORM_BLOCK = 170, + + /** VRAM-compressed unsigned floating-point data format with normalized value and non-linear sRGB encoding, packed in 8×8 blocks. Values are in the `[0.0, 1.0]` range. Using ASTC compression. */ + DATA_FORMAT_ASTC_8x8_SRGB_BLOCK = 171, + + /** VRAM-compressed unsigned floating-point data format with normalized value, packed in 10×5 blocks. Values are in the `[0.0, 1.0]` range. Using ASTC compression. */ + DATA_FORMAT_ASTC_10x5_UNORM_BLOCK = 172, + + /** VRAM-compressed unsigned floating-point data format with normalized value and non-linear sRGB encoding, packed in 10×5 blocks. Values are in the `[0.0, 1.0]` range. Using ASTC compression. */ + DATA_FORMAT_ASTC_10x5_SRGB_BLOCK = 173, + + /** VRAM-compressed unsigned floating-point data format with normalized value, packed in 10×6 blocks. Values are in the `[0.0, 1.0]` range. Using ASTC compression. */ + DATA_FORMAT_ASTC_10x6_UNORM_BLOCK = 174, + + /** VRAM-compressed unsigned floating-point data format with normalized value and non-linear sRGB encoding, packed in 10×6 blocks. Values are in the `[0.0, 1.0]` range. Using ASTC compression. */ + DATA_FORMAT_ASTC_10x6_SRGB_BLOCK = 175, + + /** VRAM-compressed unsigned floating-point data format with normalized value, packed in 10×8 blocks. Values are in the `[0.0, 1.0]` range. Using ASTC compression. */ + DATA_FORMAT_ASTC_10x8_UNORM_BLOCK = 176, + + /** VRAM-compressed unsigned floating-point data format with normalized value and non-linear sRGB encoding, packed in 10×8 blocks. Values are in the `[0.0, 1.0]` range. Using ASTC compression. */ + DATA_FORMAT_ASTC_10x8_SRGB_BLOCK = 177, + + /** VRAM-compressed unsigned floating-point data format with normalized value, packed in 10×10 blocks. Values are in the `[0.0, 1.0]` range. Using ASTC compression. */ + DATA_FORMAT_ASTC_10x10_UNORM_BLOCK = 178, + + /** VRAM-compressed unsigned floating-point data format with normalized value and non-linear sRGB encoding, packed in 10×10 blocks. Values are in the `[0.0, 1.0]` range. Using ASTC compression. */ + DATA_FORMAT_ASTC_10x10_SRGB_BLOCK = 179, + + /** VRAM-compressed unsigned floating-point data format with normalized value, packed in 12×10 blocks. Values are in the `[0.0, 1.0]` range. Using ASTC compression. */ + DATA_FORMAT_ASTC_12x10_UNORM_BLOCK = 180, + + /** VRAM-compressed unsigned floating-point data format with normalized value and non-linear sRGB encoding, packed in 12×10 blocks. Values are in the `[0.0, 1.0]` range. Using ASTC compression. */ + DATA_FORMAT_ASTC_12x10_SRGB_BLOCK = 181, + + /** VRAM-compressed unsigned floating-point data format with normalized value, packed in 12 blocks (lowest quality). Values are in the `[0.0, 1.0]` range. Using ASTC compression. */ + DATA_FORMAT_ASTC_12x12_UNORM_BLOCK = 182, + + /** VRAM-compressed unsigned floating-point data format with normalized value and non-linear sRGB encoding, packed in 12 blocks (lowest quality). Values are in the `[0.0, 1.0]` range. Using ASTC compression. */ + DATA_FORMAT_ASTC_12x12_SRGB_BLOCK = 183, + + /** 8-bit-per-channel unsigned floating-point green/blue/red channel data format with normalized value. Values are in the `[0.0, 1.0]` range. Blue and red channel data is stored at halved horizontal resolution (i.e. 2 horizontally adjacent pixels will share the same value for the blue/red channel). */ + DATA_FORMAT_G8B8G8R8_422_UNORM = 184, + + /** 8-bit-per-channel unsigned floating-point blue/green/red channel data format with normalized value. Values are in the `[0.0, 1.0]` range. Blue and red channel data is stored at halved horizontal resolution (i.e. 2 horizontally adjacent pixels will share the same value for the blue/red channel). */ + DATA_FORMAT_B8G8R8G8_422_UNORM = 185, + + /** 8-bit-per-channel unsigned floating-point green/blue/red channel data with normalized value, stored across 3 separate planes (green + blue + red). Values are in the `[0.0, 1.0]` range. Blue and red channel data is stored at halved horizontal and vertical resolution (i.e. 2×2 adjacent pixels will share the same value for the blue/red channel). */ + DATA_FORMAT_G8_B8_R8_3PLANE_420_UNORM = 186, + + /** 8-bit-per-channel unsigned floating-point green/blue/red channel data with normalized value, stored across 2 separate planes (green + blue/red). Values are in the `[0.0, 1.0]` range. Blue and red channel data is stored at halved horizontal and vertical resolution (i.e. 2×2 adjacent pixels will share the same value for the blue/red channel). */ + DATA_FORMAT_G8_B8R8_2PLANE_420_UNORM = 187, + + /** 8-bit-per-channel unsigned floating-point green/blue/red channel data with normalized value, stored across 2 separate planes (green + blue + red). Values are in the `[0.0, 1.0]` range. Blue and red channel data is stored at halved horizontal resolution (i.e. 2 horizontally adjacent pixels will share the same value for the blue/red channel). */ + DATA_FORMAT_G8_B8_R8_3PLANE_422_UNORM = 188, + + /** 8-bit-per-channel unsigned floating-point green/blue/red channel data with normalized value, stored across 2 separate planes (green + blue/red). Values are in the `[0.0, 1.0]` range. Blue and red channel data is stored at halved horizontal resolution (i.e. 2 horizontally adjacent pixels will share the same value for the blue/red channel). */ + DATA_FORMAT_G8_B8R8_2PLANE_422_UNORM = 189, + + /** 8-bit-per-channel unsigned floating-point green/blue/red channel data with normalized value, stored across 3 separate planes. Values are in the `[0.0, 1.0]` range. */ + DATA_FORMAT_G8_B8_R8_3PLANE_444_UNORM = 190, + + /** 10-bit-per-channel unsigned floating-point red channel data with normalized value, plus 6 unused bits, packed in 16 bits. Values are in the `[0.0, 1.0]` range. */ + DATA_FORMAT_R10X6_UNORM_PACK16 = 191, + + /** 10-bit-per-channel unsigned floating-point red/green channel data with normalized value, plus 6 unused bits after each channel, packed in 2×16 bits. Values are in the `[0.0, 1.0]` range. */ + DATA_FORMAT_R10X6G10X6_UNORM_2PACK16 = 192, + + /** 10-bit-per-channel unsigned floating-point red/green/blue/alpha channel data with normalized value, plus 6 unused bits after each channel, packed in 4×16 bits. Values are in the `[0.0, 1.0]` range. */ + DATA_FORMAT_R10X6G10X6B10X6A10X6_UNORM_4PACK16 = 193, + + /** 10-bit-per-channel unsigned floating-point green/blue/green/red channel data with normalized value, plus 6 unused bits after each channel, packed in 4×16 bits. Values are in the `[0.0, 1.0]` range. Blue and red channel data is stored at halved horizontal resolution (i.e. 2 horizontally adjacent pixels will share the same value for the blue/red channel). The green channel is listed twice, but contains different values to allow it to be represented at full resolution. */ + DATA_FORMAT_G10X6B10X6G10X6R10X6_422_UNORM_4PACK16 = 194, + + /** 10-bit-per-channel unsigned floating-point blue/green/red/green channel data with normalized value, plus 6 unused bits after each channel, packed in 4×16 bits. Values are in the `[0.0, 1.0]` range. Blue and red channel data is stored at halved horizontal resolution (i.e. 2 horizontally adjacent pixels will share the same value for the blue/red channel). The green channel is listed twice, but contains different values to allow it to be represented at full resolution. */ + DATA_FORMAT_B10X6G10X6R10X6G10X6_422_UNORM_4PACK16 = 195, + + /** 10-bit-per-channel unsigned floating-point green/blue/red channel data with normalized value, plus 6 unused bits after each channel. Packed in 3×16 bits and stored across 2 separate planes (green + blue + red). Values are in the `[0.0, 1.0]` range. Blue and red channel data is stored at halved horizontal and vertical resolution (i.e. 2×2 adjacent pixels will share the same value for the blue/red channel). */ + DATA_FORMAT_G10X6_B10X6_R10X6_3PLANE_420_UNORM_3PACK16 = 196, + + /** 10-bit-per-channel unsigned floating-point green/blue/red channel data with normalized value, plus 6 unused bits after each channel. Packed in 3×16 bits and stored across 2 separate planes (green + blue/red). Values are in the `[0.0, 1.0]` range. Blue and red channel data is stored at halved horizontal and vertical resolution (i.e. 2×2 adjacent pixels will share the same value for the blue/red channel). */ + DATA_FORMAT_G10X6_B10X6R10X6_2PLANE_420_UNORM_3PACK16 = 197, + + /** 10-bit-per-channel unsigned floating-point green/blue/red channel data with normalized value, plus 6 unused bits after each channel. Packed in 3×16 bits and stored across 3 separate planes (green + blue + red). Values are in the `[0.0, 1.0]` range. Blue and red channel data is stored at halved horizontal resolution (i.e. 2 horizontally adjacent pixels will share the same value for the blue/red channel). */ + DATA_FORMAT_G10X6_B10X6_R10X6_3PLANE_422_UNORM_3PACK16 = 198, + + /** 10-bit-per-channel unsigned floating-point green/blue/red channel data with normalized value, plus 6 unused bits after each channel. Packed in 3×16 bits and stored across 3 separate planes (green + blue/red). Values are in the `[0.0, 1.0]` range. Blue and red channel data is stored at halved horizontal resolution (i.e. 2 horizontally adjacent pixels will share the same value for the blue/red channel). */ + DATA_FORMAT_G10X6_B10X6R10X6_2PLANE_422_UNORM_3PACK16 = 199, + + /** 10-bit-per-channel unsigned floating-point green/blue/red channel data with normalized value, plus 6 unused bits after each channel. Packed in 3×16 bits and stored across 3 separate planes (green + blue + red). Values are in the `[0.0, 1.0]` range. */ + DATA_FORMAT_G10X6_B10X6_R10X6_3PLANE_444_UNORM_3PACK16 = 200, + + /** 12-bit-per-channel unsigned floating-point red channel data with normalized value, plus 6 unused bits, packed in 16 bits. Values are in the `[0.0, 1.0]` range. */ + DATA_FORMAT_R12X4_UNORM_PACK16 = 201, + + /** 12-bit-per-channel unsigned floating-point red/green channel data with normalized value, plus 6 unused bits after each channel, packed in 2×16 bits. Values are in the `[0.0, 1.0]` range. */ + DATA_FORMAT_R12X4G12X4_UNORM_2PACK16 = 202, + + /** 12-bit-per-channel unsigned floating-point red/green/blue/alpha channel data with normalized value, plus 6 unused bits after each channel, packed in 4×16 bits. Values are in the `[0.0, 1.0]` range. */ + DATA_FORMAT_R12X4G12X4B12X4A12X4_UNORM_4PACK16 = 203, + + /** 12-bit-per-channel unsigned floating-point green/blue/green/red channel data with normalized value, plus 6 unused bits after each channel, packed in 4×16 bits. Values are in the `[0.0, 1.0]` range. Blue and red channel data is stored at halved horizontal resolution (i.e. 2 horizontally adjacent pixels will share the same value for the blue/red channel). The green channel is listed twice, but contains different values to allow it to be represented at full resolution. */ + DATA_FORMAT_G12X4B12X4G12X4R12X4_422_UNORM_4PACK16 = 204, + + /** 12-bit-per-channel unsigned floating-point blue/green/red/green channel data with normalized value, plus 6 unused bits after each channel, packed in 4×16 bits. Values are in the `[0.0, 1.0]` range. Blue and red channel data is stored at halved horizontal resolution (i.e. 2 horizontally adjacent pixels will share the same value for the blue/red channel). The green channel is listed twice, but contains different values to allow it to be represented at full resolution. */ + DATA_FORMAT_B12X4G12X4R12X4G12X4_422_UNORM_4PACK16 = 205, + + /** 12-bit-per-channel unsigned floating-point green/blue/red channel data with normalized value, plus 6 unused bits after each channel. Packed in 3×16 bits and stored across 2 separate planes (green + blue + red). Values are in the `[0.0, 1.0]` range. Blue and red channel data is stored at halved horizontal and vertical resolution (i.e. 2×2 adjacent pixels will share the same value for the blue/red channel). */ + DATA_FORMAT_G12X4_B12X4_R12X4_3PLANE_420_UNORM_3PACK16 = 206, + + /** 12-bit-per-channel unsigned floating-point green/blue/red channel data with normalized value, plus 6 unused bits after each channel. Packed in 3×16 bits and stored across 2 separate planes (green + blue/red). Values are in the `[0.0, 1.0]` range. Blue and red channel data is stored at halved horizontal and vertical resolution (i.e. 2×2 adjacent pixels will share the same value for the blue/red channel). */ + DATA_FORMAT_G12X4_B12X4R12X4_2PLANE_420_UNORM_3PACK16 = 207, + + /** 12-bit-per-channel unsigned floating-point green/blue/red channel data with normalized value, plus 6 unused bits after each channel. Packed in 3×16 bits and stored across 3 separate planes (green + blue + red). Values are in the `[0.0, 1.0]` range. Blue and red channel data is stored at halved horizontal resolution (i.e. 2 horizontally adjacent pixels will share the same value for the blue/red channel). */ + DATA_FORMAT_G12X4_B12X4_R12X4_3PLANE_422_UNORM_3PACK16 = 208, + + /** 12-bit-per-channel unsigned floating-point green/blue/red channel data with normalized value, plus 6 unused bits after each channel. Packed in 3×16 bits and stored across 3 separate planes (green + blue/red). Values are in the `[0.0, 1.0]` range. Blue and red channel data is stored at halved horizontal resolution (i.e. 2 horizontally adjacent pixels will share the same value for the blue/red channel). */ + DATA_FORMAT_G12X4_B12X4R12X4_2PLANE_422_UNORM_3PACK16 = 209, + + /** 12-bit-per-channel unsigned floating-point green/blue/red channel data with normalized value, plus 6 unused bits after each channel. Packed in 3×16 bits and stored across 3 separate planes (green + blue + red). Values are in the `[0.0, 1.0]` range. */ + DATA_FORMAT_G12X4_B12X4_R12X4_3PLANE_444_UNORM_3PACK16 = 210, + + /** 16-bit-per-channel unsigned floating-point green/blue/red channel data format with normalized value. Values are in the `[0.0, 1.0]` range. Blue and red channel data is stored at halved horizontal resolution (i.e. 2 horizontally adjacent pixels will share the same value for the blue/red channel). */ + DATA_FORMAT_G16B16G16R16_422_UNORM = 211, + + /** 16-bit-per-channel unsigned floating-point blue/green/red channel data format with normalized value. Values are in the `[0.0, 1.0]` range. Blue and red channel data is stored at halved horizontal resolution (i.e. 2 horizontally adjacent pixels will share the same value for the blue/red channel). */ + DATA_FORMAT_B16G16R16G16_422_UNORM = 212, + + /** 16-bit-per-channel unsigned floating-point green/blue/red channel data with normalized value, plus 6 unused bits after each channel. Stored across 2 separate planes (green + blue + red). Values are in the `[0.0, 1.0]` range. Blue and red channel data is stored at halved horizontal and vertical resolution (i.e. 2×2 adjacent pixels will share the same value for the blue/red channel). */ + DATA_FORMAT_G16_B16_R16_3PLANE_420_UNORM = 213, + + /** 16-bit-per-channel unsigned floating-point green/blue/red channel data with normalized value, plus 6 unused bits after each channel. Stored across 2 separate planes (green + blue/red). Values are in the `[0.0, 1.0]` range. Blue and red channel data is stored at halved horizontal and vertical resolution (i.e. 2×2 adjacent pixels will share the same value for the blue/red channel). */ + DATA_FORMAT_G16_B16R16_2PLANE_420_UNORM = 214, + + /** 16-bit-per-channel unsigned floating-point green/blue/red channel data with normalized value, plus 6 unused bits after each channel. Stored across 3 separate planes (green + blue + red). Values are in the `[0.0, 1.0]` range. Blue and red channel data is stored at halved horizontal resolution (i.e. 2 horizontally adjacent pixels will share the same value for the blue/red channel). */ + DATA_FORMAT_G16_B16_R16_3PLANE_422_UNORM = 215, + + /** 16-bit-per-channel unsigned floating-point green/blue/red channel data with normalized value, plus 6 unused bits after each channel. Stored across 3 separate planes (green + blue/red). Values are in the `[0.0, 1.0]` range. Blue and red channel data is stored at halved horizontal resolution (i.e. 2 horizontally adjacent pixels will share the same value for the blue/red channel). */ + DATA_FORMAT_G16_B16R16_2PLANE_422_UNORM = 216, + + /** 16-bit-per-channel unsigned floating-point green/blue/red channel data with normalized value, plus 6 unused bits after each channel. Stored across 3 separate planes (green + blue + red). Values are in the `[0.0, 1.0]` range. */ + DATA_FORMAT_G16_B16_R16_3PLANE_444_UNORM = 217, + DATA_FORMAT_ASTC_4x4_SFLOAT_BLOCK = 218, + DATA_FORMAT_ASTC_5x4_SFLOAT_BLOCK = 219, + DATA_FORMAT_ASTC_5x5_SFLOAT_BLOCK = 220, + DATA_FORMAT_ASTC_6x5_SFLOAT_BLOCK = 221, + DATA_FORMAT_ASTC_6x6_SFLOAT_BLOCK = 222, + DATA_FORMAT_ASTC_8x5_SFLOAT_BLOCK = 223, + DATA_FORMAT_ASTC_8x6_SFLOAT_BLOCK = 224, + DATA_FORMAT_ASTC_8x8_SFLOAT_BLOCK = 225, + DATA_FORMAT_ASTC_10x5_SFLOAT_BLOCK = 226, + DATA_FORMAT_ASTC_10x6_SFLOAT_BLOCK = 227, + DATA_FORMAT_ASTC_10x8_SFLOAT_BLOCK = 228, + DATA_FORMAT_ASTC_10x10_SFLOAT_BLOCK = 229, + DATA_FORMAT_ASTC_12x10_SFLOAT_BLOCK = 230, + DATA_FORMAT_ASTC_12x12_SFLOAT_BLOCK = 231, + + /** Represents the size of the [enum DataFormat] enum. */ + DATA_FORMAT_MAX = 232, + } + enum BarrierMask { + /** Vertex shader barrier mask. */ + BARRIER_MASK_VERTEX = 1, + + /** Fragment shader barrier mask. */ + BARRIER_MASK_FRAGMENT = 8, + + /** Compute barrier mask. */ + BARRIER_MASK_COMPUTE = 2, + + /** Transfer barrier mask. */ + BARRIER_MASK_TRANSFER = 4, + + /** Raster barrier mask (vertex and fragment). Equivalent to `BARRIER_MASK_VERTEX | BARRIER_MASK_FRAGMENT`. */ + BARRIER_MASK_RASTER = 9, + + /** Barrier mask for all types (vertex, fragment, compute, transfer). */ + BARRIER_MASK_ALL_BARRIERS = 32767, + + /** No barrier for any type. */ + BARRIER_MASK_NO_BARRIER = 32768, + } + enum TextureType { + /** 1-dimensional texture. */ + TEXTURE_TYPE_1D = 0, + + /** 2-dimensional texture. */ + TEXTURE_TYPE_2D = 1, + + /** 3-dimensional texture. */ + TEXTURE_TYPE_3D = 2, + + /** [Cubemap] texture. */ + TEXTURE_TYPE_CUBE = 3, + + /** Array of 1-dimensional textures. */ + TEXTURE_TYPE_1D_ARRAY = 4, + + /** Array of 2-dimensional textures. */ + TEXTURE_TYPE_2D_ARRAY = 5, + + /** Array of [Cubemap] textures. */ + TEXTURE_TYPE_CUBE_ARRAY = 6, + + /** Represents the size of the [enum TextureType] enum. */ + TEXTURE_TYPE_MAX = 7, + } + enum TextureSamples { + /** Perform 1 texture sample (this is the fastest but lowest-quality for antialiasing). */ + TEXTURE_SAMPLES_1 = 0, + + /** Perform 2 texture samples. */ + TEXTURE_SAMPLES_2 = 1, + + /** Perform 4 texture samples. */ + TEXTURE_SAMPLES_4 = 2, + + /** Perform 8 texture samples. Not supported on mobile GPUs (including Apple Silicon). */ + TEXTURE_SAMPLES_8 = 3, + + /** Perform 16 texture samples. Not supported on mobile GPUs and many desktop GPUs. */ + TEXTURE_SAMPLES_16 = 4, + + /** Perform 32 texture samples. Not supported on most GPUs. */ + TEXTURE_SAMPLES_32 = 5, + + /** Perform 64 texture samples (this is the slowest but highest-quality for antialiasing). Not supported on most GPUs. */ + TEXTURE_SAMPLES_64 = 6, + + /** Represents the size of the [enum TextureSamples] enum. */ + TEXTURE_SAMPLES_MAX = 7, + } + enum TextureUsageBits { + /** Texture can be sampled. */ + TEXTURE_USAGE_SAMPLING_BIT = 1, + + /** Texture can be used as a color attachment in a framebuffer. */ + TEXTURE_USAGE_COLOR_ATTACHMENT_BIT = 2, + + /** Texture can be used as a depth/stencil attachment in a framebuffer. */ + TEXTURE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT = 4, + + /** Texture can be used as a [url=https://registry.khronos.org/vulkan/specs/1.3-extensions/html/vkspec.html#descriptorsets-storageimage]storage image[/url]. */ + TEXTURE_USAGE_STORAGE_BIT = 8, + + /** Texture can be used as a [url=https://registry.khronos.org/vulkan/specs/1.3-extensions/html/vkspec.html#descriptorsets-storageimage]storage image[/url] with support for atomic operations. */ + TEXTURE_USAGE_STORAGE_ATOMIC_BIT = 16, + + /** Texture can be read back on the CPU using [method texture_get_data] faster than without this bit, since it is always kept in the system memory. */ + TEXTURE_USAGE_CPU_READ_BIT = 32, + + /** Texture can be updated using [method texture_update]. */ + TEXTURE_USAGE_CAN_UPDATE_BIT = 64, + + /** Texture can be a source for [method texture_copy]. */ + TEXTURE_USAGE_CAN_COPY_FROM_BIT = 128, + + /** Texture can be a destination for [method texture_copy]. */ + TEXTURE_USAGE_CAN_COPY_TO_BIT = 256, + + /** Texture can be used as a [url=https://registry.khronos.org/vulkan/specs/1.3-extensions/html/vkspec.html#descriptorsets-inputattachment]input attachment[/url] in a framebuffer. */ + TEXTURE_USAGE_INPUT_ATTACHMENT_BIT = 512, + } + enum TextureSwizzle { + /** Return the sampled value as-is. */ + TEXTURE_SWIZZLE_IDENTITY = 0, + + /** Always return `0.0` when sampling. */ + TEXTURE_SWIZZLE_ZERO = 1, + + /** Always return `1.0` when sampling. */ + TEXTURE_SWIZZLE_ONE = 2, + + /** Sample the red color channel. */ + TEXTURE_SWIZZLE_R = 3, + + /** Sample the green color channel. */ + TEXTURE_SWIZZLE_G = 4, + + /** Sample the blue color channel. */ + TEXTURE_SWIZZLE_B = 5, + + /** Sample the alpha channel. */ + TEXTURE_SWIZZLE_A = 6, + + /** Represents the size of the [enum TextureSwizzle] enum. */ + TEXTURE_SWIZZLE_MAX = 7, + } + enum TextureSliceType { + /** 2-dimensional texture slice. */ + TEXTURE_SLICE_2D = 0, + + /** Cubemap texture slice. */ + TEXTURE_SLICE_CUBEMAP = 1, + + /** 3-dimensional texture slice. */ + TEXTURE_SLICE_3D = 2, + } + enum SamplerFilter { + /** Nearest-neighbor sampler filtering. Sampling at higher resolutions than the source will result in a pixelated look. */ + SAMPLER_FILTER_NEAREST = 0, + + /** Bilinear sampler filtering. Sampling at higher resolutions than the source will result in a blurry look. */ + SAMPLER_FILTER_LINEAR = 1, + } + enum SamplerRepeatMode { + /** Sample with repeating enabled. */ + SAMPLER_REPEAT_MODE_REPEAT = 0, + + /** Sample with mirrored repeating enabled. When sampling outside the `[0.0, 1.0]` range, return a mirrored version of the sampler. This mirrored version is mirrored again if sampling further away, with the pattern repeating indefinitely. */ + SAMPLER_REPEAT_MODE_MIRRORED_REPEAT = 1, + + /** Sample with repeating disabled. When sampling outside the `[0.0, 1.0]` range, return the color of the last pixel on the edge. */ + SAMPLER_REPEAT_MODE_CLAMP_TO_EDGE = 2, + + /** Sample with repeating disabled. When sampling outside the `[0.0, 1.0]` range, return the specified [member RDSamplerState.border_color]. */ + SAMPLER_REPEAT_MODE_CLAMP_TO_BORDER = 3, + + /** Sample with mirrored repeating enabled, but only once. When sampling in the `[-1.0, 0.0]` range, return a mirrored version of the sampler. When sampling outside the `[-1.0, 1.0]` range, return the color of the last pixel on the edge. */ + SAMPLER_REPEAT_MODE_MIRROR_CLAMP_TO_EDGE = 4, + + /** Represents the size of the [enum SamplerRepeatMode] enum. */ + SAMPLER_REPEAT_MODE_MAX = 5, + } + enum SamplerBorderColor { + /** Return a floating-point transparent black color when sampling outside the `[0.0, 1.0]` range. Only effective if the sampler repeat mode is [constant SAMPLER_REPEAT_MODE_CLAMP_TO_BORDER]. */ + SAMPLER_BORDER_COLOR_FLOAT_TRANSPARENT_BLACK = 0, + + /** Return a integer transparent black color when sampling outside the `[0.0, 1.0]` range. Only effective if the sampler repeat mode is [constant SAMPLER_REPEAT_MODE_CLAMP_TO_BORDER]. */ + SAMPLER_BORDER_COLOR_INT_TRANSPARENT_BLACK = 1, + + /** Return a floating-point opaque black color when sampling outside the `[0.0, 1.0]` range. Only effective if the sampler repeat mode is [constant SAMPLER_REPEAT_MODE_CLAMP_TO_BORDER]. */ + SAMPLER_BORDER_COLOR_FLOAT_OPAQUE_BLACK = 2, + + /** Return a integer opaque black color when sampling outside the `[0.0, 1.0]` range. Only effective if the sampler repeat mode is [constant SAMPLER_REPEAT_MODE_CLAMP_TO_BORDER]. */ + SAMPLER_BORDER_COLOR_INT_OPAQUE_BLACK = 3, + + /** Return a floating-point opaque white color when sampling outside the `[0.0, 1.0]` range. Only effective if the sampler repeat mode is [constant SAMPLER_REPEAT_MODE_CLAMP_TO_BORDER]. */ + SAMPLER_BORDER_COLOR_FLOAT_OPAQUE_WHITE = 4, + + /** Return a integer opaque white color when sampling outside the `[0.0, 1.0]` range. Only effective if the sampler repeat mode is [constant SAMPLER_REPEAT_MODE_CLAMP_TO_BORDER]. */ + SAMPLER_BORDER_COLOR_INT_OPAQUE_WHITE = 5, + + /** Represents the size of the [enum SamplerBorderColor] enum. */ + SAMPLER_BORDER_COLOR_MAX = 6, + } + enum VertexFrequency { + /** Vertex attribute addressing is a function of the vertex. This is used to specify the rate at which vertex attributes are pulled from buffers. */ + VERTEX_FREQUENCY_VERTEX = 0, + + /** Vertex attribute addressing is a function of the instance index. This is used to specify the rate at which vertex attributes are pulled from buffers. */ + VERTEX_FREQUENCY_INSTANCE = 1, + } + enum IndexBufferFormat { + /** Index buffer in 16-bit unsigned integer format. This limits the maximum index that can be specified to `65535`. */ + INDEX_BUFFER_FORMAT_UINT16 = 0, + + /** Index buffer in 32-bit unsigned integer format. This limits the maximum index that can be specified to `4294967295`. */ + INDEX_BUFFER_FORMAT_UINT32 = 1, + } + enum StorageBufferUsage { + STORAGE_BUFFER_USAGE_DISPATCH_INDIRECT = 1, + } + enum BufferCreationBits { + /** Optionally, set this flag if you wish to use [method buffer_get_device_address] functionality. You must first check the GPU supports it: + * + */ + BUFFER_CREATION_DEVICE_ADDRESS_BIT = 1, + + /** Set this flag so that it is created as storage. This is useful if Compute Shaders need access (for reading or writing) to the buffer, e.g. skeletal animations are processed in Compute Shaders which need access to vertex buffers, to be later consumed by vertex shaders as part of the regular rasterization pipeline. */ + BUFFER_CREATION_AS_STORAGE_BIT = 2, + } + enum UniformType { + /** Sampler uniform. */ + UNIFORM_TYPE_SAMPLER = 0, + + /** Sampler uniform with a texture. */ + UNIFORM_TYPE_SAMPLER_WITH_TEXTURE = 1, + + /** Texture uniform. */ + UNIFORM_TYPE_TEXTURE = 2, + + /** Image uniform. */ + UNIFORM_TYPE_IMAGE = 3, + + /** Texture buffer uniform. */ + UNIFORM_TYPE_TEXTURE_BUFFER = 4, + + /** Sampler uniform with a texture buffer. */ + UNIFORM_TYPE_SAMPLER_WITH_TEXTURE_BUFFER = 5, + + /** Image buffer uniform. */ + UNIFORM_TYPE_IMAGE_BUFFER = 6, + + /** Uniform buffer uniform. */ + UNIFORM_TYPE_UNIFORM_BUFFER = 7, + + /** [url=https://vkguide.dev/docs/chapter-4/storage_buffers/]Storage buffer[/url] uniform. */ + UNIFORM_TYPE_STORAGE_BUFFER = 8, + + /** Input attachment uniform. */ + UNIFORM_TYPE_INPUT_ATTACHMENT = 9, + + /** Represents the size of the [enum UniformType] enum. */ + UNIFORM_TYPE_MAX = 10, + } + enum RenderPrimitive { + /** Point rendering primitive (with constant size, regardless of distance from camera). */ + RENDER_PRIMITIVE_POINTS = 0, + + /** Line list rendering primitive. Lines are drawn separated from each other. */ + RENDER_PRIMITIVE_LINES = 1, + + /** [url=https://registry.khronos.org/vulkan/specs/1.3-extensions/html/vkspec.html#drawing-line-lists-with-adjacency]Line list rendering primitive with adjacency.[/url] + * + * **Note:** Adjacency is only useful with geometry shaders, which Godot does not expose. + */ + RENDER_PRIMITIVE_LINES_WITH_ADJACENCY = 2, + + /** Line strip rendering primitive. Lines drawn are connected to the previous vertex. */ + RENDER_PRIMITIVE_LINESTRIPS = 3, + + /** [url=https://registry.khronos.org/vulkan/specs/1.3-extensions/html/vkspec.html#drawing-line-strips-with-adjacency]Line strip rendering primitive with adjacency.[/url] + * + * **Note:** Adjacency is only useful with geometry shaders, which Godot does not expose. + */ + RENDER_PRIMITIVE_LINESTRIPS_WITH_ADJACENCY = 4, + + /** Triangle list rendering primitive. Triangles are drawn separated from each other. */ + RENDER_PRIMITIVE_TRIANGLES = 5, + + /** [url=https://registry.khronos.org/vulkan/specs/1.3-extensions/html/vkspec.html#drawing-triangle-lists-with-adjacency]Triangle list rendering primitive with adjacency.[/url] + * + * **Note:** Adjacency is only useful with geometry shaders, which Godot does not expose. + */ + RENDER_PRIMITIVE_TRIANGLES_WITH_ADJACENCY = 6, + + /** Triangle strip rendering primitive. Triangles drawn are connected to the previous triangle. */ + RENDER_PRIMITIVE_TRIANGLE_STRIPS = 7, + + /** [url=https://registry.khronos.org/vulkan/specs/1.3-extensions/html/vkspec.html#drawing-triangle-strips-with-adjacency]Triangle strip rendering primitive with adjacency.[/url] + * + * **Note:** Adjacency is only useful with geometry shaders, which Godot does not expose. + */ + RENDER_PRIMITIVE_TRIANGLE_STRIPS_WITH_AJACENCY = 8, + + /** Triangle strip rendering primitive with *primitive restart* enabled. Triangles drawn are connected to the previous triangle, but a primitive restart index can be specified before drawing to create a second triangle strip after the specified index. + * + * **Note:** Only compatible with indexed draws. + */ + RENDER_PRIMITIVE_TRIANGLE_STRIPS_WITH_RESTART_INDEX = 9, + + /** Tessellation patch rendering primitive. Only useful with tessellation shaders, which can be used to deform these patches. */ + RENDER_PRIMITIVE_TESSELATION_PATCH = 10, + + /** Represents the size of the [enum RenderPrimitive] enum. */ + RENDER_PRIMITIVE_MAX = 11, + } + enum PolygonCullMode { + /** Do not use polygon front face or backface culling. */ + POLYGON_CULL_DISABLED = 0, + + /** Use polygon frontface culling (faces pointing towards the camera are hidden). */ + POLYGON_CULL_FRONT = 1, + + /** Use polygon backface culling (faces pointing away from the camera are hidden). */ + POLYGON_CULL_BACK = 2, + } + enum PolygonFrontFace { + /** Clockwise winding order to determine which face of a polygon is its front face. */ + POLYGON_FRONT_FACE_CLOCKWISE = 0, + + /** Counter-clockwise winding order to determine which face of a polygon is its front face. */ + POLYGON_FRONT_FACE_COUNTER_CLOCKWISE = 1, + } + enum StencilOperation { + /** Keep the current stencil value. */ + STENCIL_OP_KEEP = 0, + + /** Set the stencil value to `0`. */ + STENCIL_OP_ZERO = 1, + + /** Replace the existing stencil value with the new one. */ + STENCIL_OP_REPLACE = 2, + + /** Increment the existing stencil value and clamp to the maximum representable unsigned value if reached. Stencil bits are considered as an unsigned integer. */ + STENCIL_OP_INCREMENT_AND_CLAMP = 3, + + /** Decrement the existing stencil value and clamp to the minimum value if reached. Stencil bits are considered as an unsigned integer. */ + STENCIL_OP_DECREMENT_AND_CLAMP = 4, + + /** Bitwise-invert the existing stencil value. */ + STENCIL_OP_INVERT = 5, + + /** Increment the stencil value and wrap around to `0` if reaching the maximum representable unsigned. Stencil bits are considered as an unsigned integer. */ + STENCIL_OP_INCREMENT_AND_WRAP = 6, + + /** Decrement the stencil value and wrap around to the maximum representable unsigned if reaching the minimum. Stencil bits are considered as an unsigned integer. */ + STENCIL_OP_DECREMENT_AND_WRAP = 7, + + /** Represents the size of the [enum StencilOperation] enum. */ + STENCIL_OP_MAX = 8, + } + enum CompareOperator { + /** "Never" comparison (opposite of [constant COMPARE_OP_ALWAYS]). */ + COMPARE_OP_NEVER = 0, + + /** "Less than" comparison. */ + COMPARE_OP_LESS = 1, + + /** "Equal" comparison. */ + COMPARE_OP_EQUAL = 2, + + /** "Less than or equal" comparison. */ + COMPARE_OP_LESS_OR_EQUAL = 3, + + /** "Greater than" comparison. */ + COMPARE_OP_GREATER = 4, + + /** "Not equal" comparison. */ + COMPARE_OP_NOT_EQUAL = 5, + + /** "Greater than or equal" comparison. */ + COMPARE_OP_GREATER_OR_EQUAL = 6, + + /** "Always" comparison (opposite of [constant COMPARE_OP_NEVER]). */ + COMPARE_OP_ALWAYS = 7, + + /** Represents the size of the [enum CompareOperator] enum. */ + COMPARE_OP_MAX = 8, + } + enum LogicOperation { + /** Clear logic operation (result is always `0`). See also [constant LOGIC_OP_SET]. */ + LOGIC_OP_CLEAR = 0, + + /** AND logic operation. */ + LOGIC_OP_AND = 1, + + /** AND logic operation with the *destination* operand being inverted. See also [constant LOGIC_OP_AND_INVERTED]. */ + LOGIC_OP_AND_REVERSE = 2, + + /** Copy logic operation (keeps the *source* value as-is). See also [constant LOGIC_OP_COPY_INVERTED] and [constant LOGIC_OP_NO_OP]. */ + LOGIC_OP_COPY = 3, + + /** AND logic operation with the *source* operand being inverted. See also [constant LOGIC_OP_AND_REVERSE]. */ + LOGIC_OP_AND_INVERTED = 4, + + /** No-op logic operation (keeps the *destination* value as-is). See also [constant LOGIC_OP_COPY]. */ + LOGIC_OP_NO_OP = 5, + + /** Exclusive or (XOR) logic operation. */ + LOGIC_OP_XOR = 6, + + /** OR logic operation. */ + LOGIC_OP_OR = 7, + + /** Not-OR (NOR) logic operation. */ + LOGIC_OP_NOR = 8, + + /** Not-XOR (XNOR) logic operation. */ + LOGIC_OP_EQUIVALENT = 9, + + /** Invert logic operation. */ + LOGIC_OP_INVERT = 10, + + /** OR logic operation with the *destination* operand being inverted. See also [constant LOGIC_OP_OR_REVERSE]. */ + LOGIC_OP_OR_REVERSE = 11, + + /** NOT logic operation (inverts the value). See also [constant LOGIC_OP_COPY]. */ + LOGIC_OP_COPY_INVERTED = 12, + + /** OR logic operation with the *source* operand being inverted. See also [constant LOGIC_OP_OR_REVERSE]. */ + LOGIC_OP_OR_INVERTED = 13, + + /** Not-AND (NAND) logic operation. */ + LOGIC_OP_NAND = 14, + + /** SET logic operation (result is always `1`). See also [constant LOGIC_OP_CLEAR]. */ + LOGIC_OP_SET = 15, + + /** Represents the size of the [enum LogicOperation] enum. */ + LOGIC_OP_MAX = 16, + } + enum BlendFactor { + /** Constant `0.0` blend factor. */ + BLEND_FACTOR_ZERO = 0, + + /** Constant `1.0` blend factor. */ + BLEND_FACTOR_ONE = 1, + + /** Color blend factor is `source color`. Alpha blend factor is `source alpha`. */ + BLEND_FACTOR_SRC_COLOR = 2, + + /** Color blend factor is `1.0 - source color`. Alpha blend factor is `1.0 - source alpha`. */ + BLEND_FACTOR_ONE_MINUS_SRC_COLOR = 3, + + /** Color blend factor is `destination color`. Alpha blend factor is `destination alpha`. */ + BLEND_FACTOR_DST_COLOR = 4, + + /** Color blend factor is `1.0 - destination color`. Alpha blend factor is `1.0 - destination alpha`. */ + BLEND_FACTOR_ONE_MINUS_DST_COLOR = 5, + + /** Color and alpha blend factor is `source alpha`. */ + BLEND_FACTOR_SRC_ALPHA = 6, + + /** Color and alpha blend factor is `1.0 - source alpha`. */ + BLEND_FACTOR_ONE_MINUS_SRC_ALPHA = 7, + + /** Color and alpha blend factor is `destination alpha`. */ + BLEND_FACTOR_DST_ALPHA = 8, + + /** Color and alpha blend factor is `1.0 - destination alpha`. */ + BLEND_FACTOR_ONE_MINUS_DST_ALPHA = 9, + + /** Color blend factor is `blend constant color`. Alpha blend factor is `blend constant alpha` (see [method draw_list_set_blend_constants]). */ + BLEND_FACTOR_CONSTANT_COLOR = 10, + + /** Color blend factor is `1.0 - blend constant color`. Alpha blend factor is `1.0 - blend constant alpha` (see [method draw_list_set_blend_constants]). */ + BLEND_FACTOR_ONE_MINUS_CONSTANT_COLOR = 11, + + /** Color and alpha blend factor is `blend constant alpha` (see [method draw_list_set_blend_constants]). */ + BLEND_FACTOR_CONSTANT_ALPHA = 12, + + /** Color and alpha blend factor is `1.0 - blend constant alpha` (see [method draw_list_set_blend_constants]). */ + BLEND_FACTOR_ONE_MINUS_CONSTANT_ALPHA = 13, + + /** Color blend factor is `min(source alpha, 1.0 - destination alpha)`. Alpha blend factor is `1.0`. */ + BLEND_FACTOR_SRC_ALPHA_SATURATE = 14, + + /** Color blend factor is `second source color`. Alpha blend factor is `second source alpha`. Only relevant for dual-source blending. */ + BLEND_FACTOR_SRC1_COLOR = 15, + + /** Color blend factor is `1.0 - second source color`. Alpha blend factor is `1.0 - second source alpha`. Only relevant for dual-source blending. */ + BLEND_FACTOR_ONE_MINUS_SRC1_COLOR = 16, + + /** Color and alpha blend factor is `second source alpha`. Only relevant for dual-source blending. */ + BLEND_FACTOR_SRC1_ALPHA = 17, + + /** Color and alpha blend factor is `1.0 - second source alpha`. Only relevant for dual-source blending. */ + BLEND_FACTOR_ONE_MINUS_SRC1_ALPHA = 18, + + /** Represents the size of the [enum BlendFactor] enum. */ + BLEND_FACTOR_MAX = 19, + } + enum BlendOperation { + /** Additive blending operation (`source + destination`). */ + BLEND_OP_ADD = 0, + + /** Subtractive blending operation (`source - destination`). */ + BLEND_OP_SUBTRACT = 1, + + /** Reverse subtractive blending operation (`destination - source`). */ + BLEND_OP_REVERSE_SUBTRACT = 2, + + /** Minimum blending operation (keep the lowest value of the two). */ + BLEND_OP_MINIMUM = 3, + + /** Maximum blending operation (keep the highest value of the two). */ + BLEND_OP_MAXIMUM = 4, + + /** Represents the size of the [enum BlendOperation] enum. */ + BLEND_OP_MAX = 5, + } + enum PipelineDynamicStateFlags { + /** Allows dynamically changing the width of rendering lines. */ + DYNAMIC_STATE_LINE_WIDTH = 1, + + /** Allows dynamically changing the depth bias. */ + DYNAMIC_STATE_DEPTH_BIAS = 2, + DYNAMIC_STATE_BLEND_CONSTANTS = 4, + DYNAMIC_STATE_DEPTH_BOUNDS = 8, + DYNAMIC_STATE_STENCIL_COMPARE_MASK = 16, + DYNAMIC_STATE_STENCIL_WRITE_MASK = 32, + DYNAMIC_STATE_STENCIL_REFERENCE = 64, + } + enum InitialAction { + /** Load the previous contents of the framebuffer. */ + INITIAL_ACTION_LOAD = 0, + + /** Clear the whole framebuffer or its specified region. */ + INITIAL_ACTION_CLEAR = 1, + + /** Ignore the previous contents of the framebuffer. This is the fastest option if you'll overwrite all of the pixels and don't need to read any of them. */ + INITIAL_ACTION_DISCARD = 2, + + /** Represents the size of the [enum InitialAction] enum. */ + INITIAL_ACTION_MAX = 3, + INITIAL_ACTION_CLEAR_REGION = 1, + INITIAL_ACTION_CLEAR_REGION_CONTINUE = 1, + INITIAL_ACTION_KEEP = 0, + INITIAL_ACTION_DROP = 2, + INITIAL_ACTION_CONTINUE = 0, + } + enum FinalAction { + /** Store the result of the draw list in the framebuffer. This is generally what you want to do. */ + FINAL_ACTION_STORE = 0, + + /** Discard the contents of the framebuffer. This is the fastest option if you don't need to use the results of the draw list. */ + FINAL_ACTION_DISCARD = 1, + + /** Represents the size of the [enum FinalAction] enum. */ + FINAL_ACTION_MAX = 2, + FINAL_ACTION_READ = 0, + FINAL_ACTION_CONTINUE = 0, + } + enum ShaderStage { + /** Vertex shader stage. This can be used to manipulate vertices from a shader (but not create new vertices). */ + SHADER_STAGE_VERTEX = 0, + + /** Fragment shader stage (called "pixel shader" in Direct3D). This can be used to manipulate pixels from a shader. */ + SHADER_STAGE_FRAGMENT = 1, + + /** Tessellation control shader stage. This can be used to create additional geometry from a shader. */ + SHADER_STAGE_TESSELATION_CONTROL = 2, + + /** Tessellation evaluation shader stage. This can be used to create additional geometry from a shader. */ + SHADER_STAGE_TESSELATION_EVALUATION = 3, + + /** Compute shader stage. This can be used to run arbitrary computing tasks in a shader, performing them on the GPU instead of the CPU. */ + SHADER_STAGE_COMPUTE = 4, + + /** Represents the size of the [enum ShaderStage] enum. */ + SHADER_STAGE_MAX = 5, + + /** Vertex shader stage bit (see also [constant SHADER_STAGE_VERTEX]). */ + SHADER_STAGE_VERTEX_BIT = 1, + + /** Fragment shader stage bit (see also [constant SHADER_STAGE_FRAGMENT]). */ + SHADER_STAGE_FRAGMENT_BIT = 2, + + /** Tessellation control shader stage bit (see also [constant SHADER_STAGE_TESSELATION_CONTROL]). */ + SHADER_STAGE_TESSELATION_CONTROL_BIT = 4, + + /** Tessellation evaluation shader stage bit (see also [constant SHADER_STAGE_TESSELATION_EVALUATION]). */ + SHADER_STAGE_TESSELATION_EVALUATION_BIT = 8, + + /** Compute shader stage bit (see also [constant SHADER_STAGE_COMPUTE]). */ + SHADER_STAGE_COMPUTE_BIT = 16, + } + enum ShaderLanguage { + /** Khronos' GLSL shading language (used natively by OpenGL and Vulkan). This is the language used for core Godot shaders. */ + SHADER_LANGUAGE_GLSL = 0, + + /** Microsoft's High-Level Shading Language (used natively by Direct3D, but can also be used in Vulkan). */ + SHADER_LANGUAGE_HLSL = 1, + } + enum PipelineSpecializationConstantType { + /** Boolean specialization constant. */ + PIPELINE_SPECIALIZATION_CONSTANT_TYPE_BOOL = 0, + + /** Integer specialization constant. */ + PIPELINE_SPECIALIZATION_CONSTANT_TYPE_INT = 1, + + /** Floating-point specialization constant. */ + PIPELINE_SPECIALIZATION_CONSTANT_TYPE_FLOAT = 2, + } + enum Features { + /** Features support for buffer device address extension. */ + SUPPORTS_BUFFER_DEVICE_ADDRESS = 6, + } + enum Limit { + /** Maximum number of uniform sets that can be bound at a given time. */ + LIMIT_MAX_BOUND_UNIFORM_SETS = 0, + + /** Maximum number of color framebuffer attachments that can be used at a given time. */ + LIMIT_MAX_FRAMEBUFFER_COLOR_ATTACHMENTS = 1, + + /** Maximum number of textures that can be used per uniform set. */ + LIMIT_MAX_TEXTURES_PER_UNIFORM_SET = 2, + + /** Maximum number of samplers that can be used per uniform set. */ + LIMIT_MAX_SAMPLERS_PER_UNIFORM_SET = 3, + + /** Maximum number of [url=https://vkguide.dev/docs/chapter-4/storage_buffers/]storage buffers[/url] per uniform set. */ + LIMIT_MAX_STORAGE_BUFFERS_PER_UNIFORM_SET = 4, + + /** Maximum number of storage images per uniform set. */ + LIMIT_MAX_STORAGE_IMAGES_PER_UNIFORM_SET = 5, + + /** Maximum number of uniform buffers per uniform set. */ + LIMIT_MAX_UNIFORM_BUFFERS_PER_UNIFORM_SET = 6, + + /** Maximum index for an indexed draw command. */ + LIMIT_MAX_DRAW_INDEXED_INDEX = 7, + + /** Maximum height of a framebuffer (in pixels). */ + LIMIT_MAX_FRAMEBUFFER_HEIGHT = 8, + + /** Maximum width of a framebuffer (in pixels). */ + LIMIT_MAX_FRAMEBUFFER_WIDTH = 9, + + /** Maximum number of texture array layers. */ + LIMIT_MAX_TEXTURE_ARRAY_LAYERS = 10, + + /** Maximum supported 1-dimensional texture size (in pixels on a single axis). */ + LIMIT_MAX_TEXTURE_SIZE_1D = 11, + + /** Maximum supported 2-dimensional texture size (in pixels on a single axis). */ + LIMIT_MAX_TEXTURE_SIZE_2D = 12, + + /** Maximum supported 3-dimensional texture size (in pixels on a single axis). */ + LIMIT_MAX_TEXTURE_SIZE_3D = 13, + + /** Maximum supported cubemap texture size (in pixels on a single axis of a single face). */ + LIMIT_MAX_TEXTURE_SIZE_CUBE = 14, + + /** Maximum number of textures per shader stage. */ + LIMIT_MAX_TEXTURES_PER_SHADER_STAGE = 15, + + /** Maximum number of samplers per shader stage. */ + LIMIT_MAX_SAMPLERS_PER_SHADER_STAGE = 16, + + /** Maximum number of [url=https://vkguide.dev/docs/chapter-4/storage_buffers/]storage buffers[/url] per shader stage. */ + LIMIT_MAX_STORAGE_BUFFERS_PER_SHADER_STAGE = 17, + + /** Maximum number of storage images per shader stage. */ + LIMIT_MAX_STORAGE_IMAGES_PER_SHADER_STAGE = 18, + + /** Maximum number of uniform buffers per uniform set. */ + LIMIT_MAX_UNIFORM_BUFFERS_PER_SHADER_STAGE = 19, + + /** Maximum size of a push constant. A lot of devices are limited to 128 bytes, so try to avoid exceeding 128 bytes in push constants to ensure compatibility even if your GPU is reporting a higher value. */ + LIMIT_MAX_PUSH_CONSTANT_SIZE = 20, + + /** Maximum size of a uniform buffer. */ + LIMIT_MAX_UNIFORM_BUFFER_SIZE = 21, + + /** Maximum vertex input attribute offset. */ + LIMIT_MAX_VERTEX_INPUT_ATTRIBUTE_OFFSET = 22, + + /** Maximum number of vertex input attributes. */ + LIMIT_MAX_VERTEX_INPUT_ATTRIBUTES = 23, + + /** Maximum number of vertex input bindings. */ + LIMIT_MAX_VERTEX_INPUT_BINDINGS = 24, + + /** Maximum vertex input binding stride. */ + LIMIT_MAX_VERTEX_INPUT_BINDING_STRIDE = 25, + + /** Minimum uniform buffer offset alignment. */ + LIMIT_MIN_UNIFORM_BUFFER_OFFSET_ALIGNMENT = 26, + + /** Maximum shared memory size for compute shaders. */ + LIMIT_MAX_COMPUTE_SHARED_MEMORY_SIZE = 27, + + /** Maximum number of workgroups for compute shaders on the X axis. */ + LIMIT_MAX_COMPUTE_WORKGROUP_COUNT_X = 28, + + /** Maximum number of workgroups for compute shaders on the Y axis. */ + LIMIT_MAX_COMPUTE_WORKGROUP_COUNT_Y = 29, + + /** Maximum number of workgroups for compute shaders on the Z axis. */ + LIMIT_MAX_COMPUTE_WORKGROUP_COUNT_Z = 30, + + /** Maximum number of workgroup invocations for compute shaders. */ + LIMIT_MAX_COMPUTE_WORKGROUP_INVOCATIONS = 31, + + /** Maximum workgroup size for compute shaders on the X axis. */ + LIMIT_MAX_COMPUTE_WORKGROUP_SIZE_X = 32, + + /** Maximum workgroup size for compute shaders on the Y axis. */ + LIMIT_MAX_COMPUTE_WORKGROUP_SIZE_Y = 33, + + /** Maximum workgroup size for compute shaders on the Z axis. */ + LIMIT_MAX_COMPUTE_WORKGROUP_SIZE_Z = 34, + + /** Maximum viewport width (in pixels). */ + LIMIT_MAX_VIEWPORT_DIMENSIONS_X = 35, + + /** Maximum viewport height (in pixels). */ + LIMIT_MAX_VIEWPORT_DIMENSIONS_Y = 36, + + /** Returns the smallest value for [member ProjectSettings.rendering/scaling_3d/scale] when using the MetalFX temporal upscaler. + * + * **Note:** The returned value is multiplied by a factor of `1000000` to preserve 6 digits of precision. It must be divided by `1000000.0` to convert the value to a floating point number. + */ + LIMIT_METALFX_TEMPORAL_SCALER_MIN_SCALE = 46, + + /** Returns the largest value for [member ProjectSettings.rendering/scaling_3d/scale] when using the MetalFX temporal upscaler. + * + * **Note:** The returned value is multiplied by a factor of `1000000` to preserve 6 digits of precision. It must be divided by `1000000.0` to convert the value to a floating point number. + */ + LIMIT_METALFX_TEMPORAL_SCALER_MAX_SCALE = 47, + } + enum MemoryType { + /** Memory taken by textures. */ + MEMORY_TEXTURES = 0, + + /** Memory taken by buffers. */ + MEMORY_BUFFERS = 1, + + /** Total memory taken. This is greater than the sum of [constant MEMORY_TEXTURES] and [constant MEMORY_BUFFERS], as it also includes miscellaneous memory usage. */ + MEMORY_TOTAL = 2, + } + enum BreadcrumbMarker { + NONE = 0, + REFLECTION_PROBES = 65536, + SKY_PASS = 131072, + LIGHTMAPPER_PASS = 196608, + SHADOW_PASS_DIRECTIONAL = 262144, + SHADOW_PASS_CUBE = 327680, + OPAQUE_PASS = 393216, + ALPHA_PASS = 458752, + TRANSPARENT_PASS = 524288, + POST_PROCESSING_PASS = 589824, + BLIT_PASS = 655360, + UI_PASS = 720896, + DEBUG_PASS = 786432, + } + enum DrawFlags { + /** Do not clear or ignore any attachments. */ + DRAW_DEFAULT_ALL = 0, + + /** Clear the first color attachment. */ + DRAW_CLEAR_COLOR_0 = 1, + + /** Clear the second color attachment. */ + DRAW_CLEAR_COLOR_1 = 2, + + /** Clear the third color attachment. */ + DRAW_CLEAR_COLOR_2 = 4, + + /** Clear the fourth color attachment. */ + DRAW_CLEAR_COLOR_3 = 8, + + /** Clear the fifth color attachment. */ + DRAW_CLEAR_COLOR_4 = 16, + + /** Clear the sixth color attachment. */ + DRAW_CLEAR_COLOR_5 = 32, + + /** Clear the seventh color attachment. */ + DRAW_CLEAR_COLOR_6 = 64, + + /** Clear the eighth color attachment. */ + DRAW_CLEAR_COLOR_7 = 128, + + /** Mask for clearing all color attachments. */ + DRAW_CLEAR_COLOR_MASK = 255, + + /** Clear all color attachments. */ + DRAW_CLEAR_COLOR_ALL = 255, + + /** Ignore the previous contents of the first color attachment. */ + DRAW_IGNORE_COLOR_0 = 256, + + /** Ignore the previous contents of the second color attachment. */ + DRAW_IGNORE_COLOR_1 = 512, + + /** Ignore the previous contents of the third color attachment. */ + DRAW_IGNORE_COLOR_2 = 1024, + + /** Ignore the previous contents of the fourth color attachment. */ + DRAW_IGNORE_COLOR_3 = 2048, + + /** Ignore the previous contents of the fifth color attachment. */ + DRAW_IGNORE_COLOR_4 = 4096, + + /** Ignore the previous contents of the sixth color attachment. */ + DRAW_IGNORE_COLOR_5 = 8192, + + /** Ignore the previous contents of the seventh color attachment. */ + DRAW_IGNORE_COLOR_6 = 16384, + + /** Ignore the previous contents of the eighth color attachment. */ + DRAW_IGNORE_COLOR_7 = 32768, + + /** Mask for ignoring all the previous contents of the color attachments. */ + DRAW_IGNORE_COLOR_MASK = 65280, + + /** Ignore the previous contents of all color attachments. */ + DRAW_IGNORE_COLOR_ALL = 65280, + + /** Clear the depth attachment. */ + DRAW_CLEAR_DEPTH = 65536, + + /** Ignore the previous contents of the depth attachment. */ + DRAW_IGNORE_DEPTH = 131072, + + /** Clear the stencil attachment. */ + DRAW_CLEAR_STENCIL = 262144, + + /** Ignore the previous contents of the stencil attachment. */ + DRAW_IGNORE_STENCIL = 524288, + + /** Clear all attachments. */ + DRAW_CLEAR_ALL = 327935, + + /** Ignore the previous contents of all attachments. */ + DRAW_IGNORE_ALL = 720640, + } + } + /** Abstraction for working with modern low-level graphics APIs. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_renderingdevice.html + */ + class RenderingDevice extends Object { + /** Returned by functions that return an ID if a value is invalid. */ + static readonly INVALID_ID = -1 + + /** Returned by functions that return a format ID if a value is invalid. */ + static readonly INVALID_FORMAT_ID = -1 + constructor(identifier?: any) + + /** Creates a new texture. It can be accessed with the RID that is returned. + * Once finished with your RID, you will want to free the RID using the RenderingDevice's [method free_rid] method. + * + * **Note:** Not to be confused with [method RenderingServer.texture_2d_create], which creates the Godot-specific [Texture2D] resource as opposed to the graphics API's own texture type. + */ + texture_create(format: RDTextureFormat, view: RDTextureView, data: GArray = []): RID + + /** Creates a shared texture using the specified [param view] and the texture information from [param with_texture]. */ + texture_create_shared(view: RDTextureView, with_texture: RID): RID + + /** Creates a shared texture using the specified [param view] and the texture information from [param with_texture]'s [param layer] and [param mipmap]. The number of included mipmaps from the original texture can be controlled using the [param mipmaps] parameter. Only relevant for textures with multiple layers, such as 3D textures, texture arrays and cubemaps. For single-layer textures, use [method texture_create_shared]. + * For 2D textures (which only have one layer), [param layer] must be `0`. + * + * **Note:** Layer slicing is only supported for 2D texture arrays, not 3D textures or cubemaps. + */ + texture_create_shared_from_slice(view: RDTextureView, with_texture: RID, layer: int64, mipmap: int64, mipmaps: int64 = 1, slice_type: RenderingDevice.TextureSliceType = 0): RID + + /** Returns an RID for an existing [param image] (`VkImage`) with the given [param type], [param format], [param samples], [param usage_flags], [param width], [param height], [param depth], and [param layers]. This can be used to allow Godot to render onto foreign images. */ + texture_create_from_extension(type: RenderingDevice.TextureType, format: RenderingDevice.DataFormat, samples: RenderingDevice.TextureSamples, usage_flags: RenderingDevice.TextureUsageBits, image: int64, width: int64, height: int64, depth: int64, layers: int64): RID + + /** Updates texture data with new data, replacing the previous data in place. The updated texture data must have the same dimensions and format. For 2D textures (which only have one layer), [param layer] must be `0`. Returns [constant @GlobalScope.OK] if the update was successful, [constant @GlobalScope.ERR_INVALID_PARAMETER] otherwise. + * + * **Note:** Updating textures is forbidden during creation of a draw or compute list. + * + * **Note:** The existing [param texture] can't be updated while a draw list that uses it as part of a framebuffer is being created. Ensure the draw list is finalized (and that the color/depth texture using it is not set to [constant FINAL_ACTION_CONTINUE]) to update this texture. + * + * **Note:** The existing [param texture] requires the [constant TEXTURE_USAGE_CAN_UPDATE_BIT] to be updatable. + */ + texture_update(texture: RID, layer: int64, data: PackedByteArray | byte[] | ArrayBuffer): GError + + /** Returns the [param texture] data for the specified [param layer] as raw binary data. For 2D textures (which only have one layer), [param layer] must be `0`. + * + * **Note:** [param texture] can't be retrieved while a draw list that uses it as part of a framebuffer is being created. Ensure the draw list is finalized (and that the color/depth texture using it is not set to [constant FINAL_ACTION_CONTINUE]) to retrieve this texture. Otherwise, an error is printed and a empty [PackedByteArray] is returned. + * + * **Note:** [param texture] requires the [constant TEXTURE_USAGE_CAN_COPY_FROM_BIT] to be retrieved. Otherwise, an error is printed and a empty [PackedByteArray] is returned. + * + * **Note:** This method will block the GPU from working until the data is retrieved. Refer to [method texture_get_data_async] for an alternative that returns the data in more performant way. + */ + texture_get_data(texture: RID, layer: int64): PackedByteArray + + /** Asynchronous version of [method texture_get_data]. RenderingDevice will call [param callback] in a certain amount of frames with the data the texture had at the time of the request. + * + * **Note:** At the moment, the delay corresponds to the amount of frames specified by [member ProjectSettings.rendering/rendering_device/vsync/frame_queue_size]. + * + * **Note:** Downloading large textures can have a prohibitive cost for real-time even when using the asynchronous method due to hardware bandwidth limitations. When dealing with large resources, you can adjust settings such as [member ProjectSettings.rendering/rendering_device/staging_buffer/texture_download_region_size_px] and [member ProjectSettings.rendering/rendering_device/staging_buffer/block_size_kb] to improve the transfer speed at the cost of extra memory. + * + */ + texture_get_data_async(texture: RID, layer: int64, callback: Callable): GError + + /** Returns `true` if the specified [param format] is supported for the given [param usage_flags], `false` otherwise. */ + texture_is_format_supported_for_usage(format: RenderingDevice.DataFormat, usage_flags: RenderingDevice.TextureUsageBits): boolean + + /** Returns `true` if the [param texture] is shared, `false` otherwise. See [RDTextureView]. */ + texture_is_shared(texture: RID): boolean + + /** Returns `true` if the [param texture] is valid, `false` otherwise. */ + texture_is_valid(texture: RID): boolean + + /** Updates the discardable property of [param texture]. + * If a texture is discardable, its contents do not need to be preserved between frames. This flag is only relevant when the texture is used as target in a draw list. + * This information is used by [RenderingDevice] to figure out if a texture's contents can be discarded, eliminating unnecessary writes to memory and boosting performance. + */ + texture_set_discardable(texture: RID, discardable: boolean): void + + /** Returns `true` if the [param texture] is discardable, `false` otherwise. See [RDTextureFormat] or [method texture_set_discardable]. */ + texture_is_discardable(texture: RID): boolean + + /** Copies the [param from_texture] to [param to_texture] with the specified [param from_pos], [param to_pos] and [param size] coordinates. The Z axis of the [param from_pos], [param to_pos] and [param size] must be `0` for 2-dimensional textures. Source and destination mipmaps/layers must also be specified, with these parameters being `0` for textures without mipmaps or single-layer textures. Returns [constant @GlobalScope.OK] if the texture copy was successful or [constant @GlobalScope.ERR_INVALID_PARAMETER] otherwise. + * + * **Note:** [param from_texture] texture can't be copied while a draw list that uses it as part of a framebuffer is being created. Ensure the draw list is finalized (and that the color/depth texture using it is not set to [constant FINAL_ACTION_CONTINUE]) to copy this texture. + * + * **Note:** [param from_texture] texture requires the [constant TEXTURE_USAGE_CAN_COPY_FROM_BIT] to be retrieved. + * + * **Note:** [param to_texture] can't be copied while a draw list that uses it as part of a framebuffer is being created. Ensure the draw list is finalized (and that the color/depth texture using it is not set to [constant FINAL_ACTION_CONTINUE]) to copy this texture. + * + * **Note:** [param to_texture] requires the [constant TEXTURE_USAGE_CAN_COPY_TO_BIT] to be retrieved. + * + * **Note:** [param from_texture] and [param to_texture] must be of the same type (color or depth). + */ + texture_copy(from_texture: RID, to_texture: RID, from_pos: Vector3, to_pos: Vector3, size: Vector3, src_mipmap: int64, dst_mipmap: int64, src_layer: int64, dst_layer: int64): GError + + /** Clears the specified [param texture] by replacing all of its pixels with the specified [param color]. [param base_mipmap] and [param mipmap_count] determine which mipmaps of the texture are affected by this clear operation, while [param base_layer] and [param layer_count] determine which layers of a 3D texture (or texture array) are affected by this clear operation. For 2D textures (which only have one layer by design), [param base_layer] must be `0` and [param layer_count] must be `1`. + * + * **Note:** [param texture] can't be cleared while a draw list that uses it as part of a framebuffer is being created. Ensure the draw list is finalized (and that the color/depth texture using it is not set to [constant FINAL_ACTION_CONTINUE]) to clear this texture. + */ + texture_clear(texture: RID, color: Color, base_mipmap: int64, mipmap_count: int64, base_layer: int64, layer_count: int64): GError + + /** Resolves the [param from_texture] texture onto [param to_texture] with multisample antialiasing enabled. This must be used when rendering a framebuffer for MSAA to work. Returns [constant @GlobalScope.OK] if successful, [constant @GlobalScope.ERR_INVALID_PARAMETER] otherwise. + * + * **Note:** [param from_texture] and [param to_texture] textures must have the same dimension, format and type (color or depth). + * + * **Note:** [param from_texture] can't be copied while a draw list that uses it as part of a framebuffer is being created. Ensure the draw list is finalized (and that the color/depth texture using it is not set to [constant FINAL_ACTION_CONTINUE]) to resolve this texture. + * + * **Note:** [param from_texture] requires the [constant TEXTURE_USAGE_CAN_COPY_FROM_BIT] to be retrieved. + * + * **Note:** [param from_texture] must be multisampled and must also be 2D (or a slice of a 3D/cubemap texture). + * + * **Note:** [param to_texture] can't be copied while a draw list that uses it as part of a framebuffer is being created. Ensure the draw list is finalized (and that the color/depth texture using it is not set to [constant FINAL_ACTION_CONTINUE]) to resolve this texture. + * + * **Note:** [param to_texture] texture requires the [constant TEXTURE_USAGE_CAN_COPY_TO_BIT] to be retrieved. + * + * **Note:** [param to_texture] texture must **not** be multisampled and must also be 2D (or a slice of a 3D/cubemap texture). + */ + texture_resolve_multisample(from_texture: RID, to_texture: RID): GError + + /** Returns the data format used to create this texture. */ + texture_get_format(texture: RID): RDTextureFormat + + /** Returns the internal graphics handle for this texture object. For use when communicating with third-party APIs mostly with GDExtension. + * + * **Note:** This function returns a `uint64_t` which internally maps to a `GLuint` (OpenGL) or `VkImage` (Vulkan). + */ + texture_get_native_handle(texture: RID): int64 + + /** Creates a new framebuffer format with the specified [param attachments] and [param view_count]. Returns the new framebuffer's unique framebuffer format ID. + * If [param view_count] is greater than or equal to `2`, enables multiview which is used for VR rendering. This requires support for the Vulkan multiview extension. + */ + framebuffer_format_create(attachments: GArray, view_count: int64 = 1): int64 + + /** Creates a multipass framebuffer format with the specified [param attachments], [param passes] and [param view_count] and returns its ID. If [param view_count] is greater than or equal to `2`, enables multiview which is used for VR rendering. This requires support for the Vulkan multiview extension. */ + framebuffer_format_create_multipass(attachments: GArray, passes: GArray, view_count: int64 = 1): int64 + + /** Creates a new empty framebuffer format with the specified number of [param samples] and returns its ID. */ + framebuffer_format_create_empty(samples: RenderingDevice.TextureSamples = 0): int64 + + /** Returns the number of texture samples used for the given framebuffer [param format] ID (returned by [method framebuffer_get_format]). */ + framebuffer_format_get_texture_samples(format: int64, render_pass: int64 = 0): RenderingDevice.TextureSamples + + /** Creates a new framebuffer. It can be accessed with the RID that is returned. + * Once finished with your RID, you will want to free the RID using the RenderingDevice's [method free_rid] method. + */ + framebuffer_create(textures: GArray, validate_with_format: int64 = -1, view_count: int64 = 1): RID + + /** Creates a new multipass framebuffer. It can be accessed with the RID that is returned. + * Once finished with your RID, you will want to free the RID using the RenderingDevice's [method free_rid] method. + */ + framebuffer_create_multipass(textures: GArray, passes: GArray, validate_with_format: int64 = -1, view_count: int64 = 1): RID + + /** Creates a new empty framebuffer. It can be accessed with the RID that is returned. + * Once finished with your RID, you will want to free the RID using the RenderingDevice's [method free_rid] method. + */ + framebuffer_create_empty(size: Vector2i, samples: RenderingDevice.TextureSamples = 0, validate_with_format: int64 = -1): RID + + /** Returns the format ID of the framebuffer specified by the [param framebuffer] RID. This ID is guaranteed to be unique for the same formats and does not need to be freed. */ + framebuffer_get_format(framebuffer: RID): int64 + + /** Returns `true` if the framebuffer specified by the [param framebuffer] RID is valid, `false` otherwise. */ + framebuffer_is_valid(framebuffer: RID): boolean + + /** Creates a new sampler. It can be accessed with the RID that is returned. + * Once finished with your RID, you will want to free the RID using the RenderingDevice's [method free_rid] method. + */ + sampler_create(state: RDSamplerState): RID + + /** Returns `true` if implementation supports using a texture of [param format] with the given [param sampler_filter]. */ + sampler_is_format_supported_for_filter(format: RenderingDevice.DataFormat, sampler_filter: RenderingDevice.SamplerFilter): boolean + + /** It can be accessed with the RID that is returned. + * Once finished with your RID, you will want to free the RID using the RenderingDevice's [method free_rid] method. + */ + vertex_buffer_create(size_bytes: int64, data: PackedByteArray | byte[] | ArrayBuffer = [], creation_bits: RenderingDevice.BufferCreationBits = 0): RID + + /** Creates a new vertex format with the specified [param vertex_descriptions]. Returns a unique vertex format ID corresponding to the newly created vertex format. */ + vertex_format_create(vertex_descriptions: GArray): int64 + + /** Creates a vertex array based on the specified buffers. Optionally, [param offsets] (in bytes) may be defined for each buffer. */ + vertex_array_create(vertex_count: int64, vertex_format: int64, src_buffers: GArray, offsets: PackedInt64Array | int64[] = []): RID + + /** Creates a new index buffer. It can be accessed with the RID that is returned. + * Once finished with your RID, you will want to free the RID using the RenderingDevice's [method free_rid] method. + */ + index_buffer_create(size_indices: int64, format: RenderingDevice.IndexBufferFormat, data: PackedByteArray | byte[] | ArrayBuffer = [], use_restart_indices: boolean = false, creation_bits: RenderingDevice.BufferCreationBits = 0): RID + + /** Creates a new index array. It can be accessed with the RID that is returned. + * Once finished with your RID, you will want to free the RID using the RenderingDevice's [method free_rid] method. + */ + index_array_create(index_buffer: RID, index_offset: int64, index_count: int64): RID + + /** Compiles a SPIR-V from the shader source code in [param shader_source] and returns the SPIR-V as a [RDShaderSPIRV]. This intermediate language shader is portable across different GPU models and driver versions, but cannot be run directly by GPUs until compiled into a binary shader using [method shader_compile_binary_from_spirv]. + * If [param allow_cache] is `true`, make use of the shader cache generated by Godot. This avoids a potentially lengthy shader compilation step if the shader is already in cache. If [param allow_cache] is `false`, Godot's shader cache is ignored and the shader will always be recompiled. + */ + shader_compile_spirv_from_source(shader_source: RDShaderSource, allow_cache: boolean = true): RDShaderSPIRV + + /** Compiles a binary shader from [param spirv_data] and returns the compiled binary data as a [PackedByteArray]. This compiled shader is specific to the GPU model and driver version used; it will not work on different GPU models or even different driver versions. See also [method shader_compile_spirv_from_source]. + * [param name] is an optional human-readable name that can be given to the compiled shader for organizational purposes. + */ + shader_compile_binary_from_spirv(spirv_data: RDShaderSPIRV, name: string = ''): PackedByteArray + + /** Creates a new shader instance from SPIR-V intermediate code. It can be accessed with the RID that is returned. + * Once finished with your RID, you will want to free the RID using the RenderingDevice's [method free_rid] method. See also [method shader_compile_spirv_from_source] and [method shader_create_from_bytecode]. + */ + shader_create_from_spirv(spirv_data: RDShaderSPIRV, name: string = ''): RID + + /** Creates a new shader instance from a binary compiled shader. It can be accessed with the RID that is returned. + * Once finished with your RID, you will want to free the RID using the RenderingDevice's [method free_rid] method. See also [method shader_compile_binary_from_spirv] and [method shader_create_from_spirv]. + */ + shader_create_from_bytecode(binary_data: PackedByteArray | byte[] | ArrayBuffer, placeholder_rid: RID = new RID()): RID + + /** Create a placeholder RID by allocating an RID without initializing it for use in [method shader_create_from_bytecode]. This allows you to create an RID for a shader and pass it around, but defer compiling the shader to a later time. */ + shader_create_placeholder(): RID + + /** Returns the internal vertex input mask. Internally, the vertex input mask is an unsigned integer consisting of the locations (specified in GLSL via. `layout(location = ...)`) of the input variables (specified in GLSL by the `in` keyword). */ + shader_get_vertex_input_attribute_mask(shader: RID): int64 + + /** Creates a new uniform buffer. It can be accessed with the RID that is returned. + * Once finished with your RID, you will want to free the RID using the RenderingDevice's [method free_rid] method. + */ + uniform_buffer_create(size_bytes: int64, data: PackedByteArray | byte[] | ArrayBuffer = [], creation_bits: RenderingDevice.BufferCreationBits = 0): RID + + /** Creates a [url=https://vkguide.dev/docs/chapter-4/storage_buffers/]storage buffer[/url] with the specified [param data] and [param usage]. It can be accessed with the RID that is returned. + * Once finished with your RID, you will want to free the RID using the RenderingDevice's [method free_rid] method. + */ + storage_buffer_create(size_bytes: int64, data: PackedByteArray | byte[] | ArrayBuffer = [], usage: RenderingDevice.StorageBufferUsage = 0, creation_bits: RenderingDevice.BufferCreationBits = 0): RID + + /** Creates a new texture buffer. It can be accessed with the RID that is returned. + * Once finished with your RID, you will want to free the RID using the RenderingDevice's [method free_rid] method. + */ + texture_buffer_create(size_bytes: int64, format: RenderingDevice.DataFormat, data: PackedByteArray | byte[] | ArrayBuffer = []): RID + + /** Creates a new uniform set. It can be accessed with the RID that is returned. + * Once finished with your RID, you will want to free the RID using the RenderingDevice's [method free_rid] method. + */ + uniform_set_create(uniforms: GArray, shader: RID, shader_set: int64): RID + + /** Checks if the [param uniform_set] is valid, i.e. is owned. */ + uniform_set_is_valid(uniform_set: RID): boolean + + /** Copies [param size] bytes from the [param src_buffer] at [param src_offset] into [param dst_buffer] at [param dst_offset]. + * Prints an error if: + * - [param size] exceeds the size of either [param src_buffer] or [param dst_buffer] at their corresponding offsets + * - a draw list is currently active (created by [method draw_list_begin]) + * - a compute list is currently active (created by [method compute_list_begin]) + */ + buffer_copy(src_buffer: RID, dst_buffer: RID, src_offset: int64, dst_offset: int64, size: int64): GError + + /** Updates a region of [param size_bytes] bytes, starting at [param offset], in the buffer, with the specified [param data]. + * Prints an error if: + * - the region specified by [param offset] + [param size_bytes] exceeds the buffer + * - a draw list is currently active (created by [method draw_list_begin]) + * - a compute list is currently active (created by [method compute_list_begin]) + */ + buffer_update(buffer: RID, offset: int64, size_bytes: int64, data: PackedByteArray | byte[] | ArrayBuffer): GError + + /** Clears the contents of the [param buffer], clearing [param size_bytes] bytes, starting at [param offset]. + * Prints an error if: + * - the size isn't a multiple of four + * - the region specified by [param offset] + [param size_bytes] exceeds the buffer + * - a draw list is currently active (created by [method draw_list_begin]) + * - a compute list is currently active (created by [method compute_list_begin]) + */ + buffer_clear(buffer: RID, offset: int64, size_bytes: int64): GError + + /** Returns a copy of the data of the specified [param buffer], optionally [param offset_bytes] and [param size_bytes] can be set to copy only a portion of the buffer. + * + * **Note:** This method will block the GPU from working until the data is retrieved. Refer to [method buffer_get_data_async] for an alternative that returns the data in more performant way. + */ + buffer_get_data(buffer: RID, offset_bytes: int64 = 0, size_bytes: int64 = 0): PackedByteArray + + /** Asynchronous version of [method buffer_get_data]. RenderingDevice will call [param callback] in a certain amount of frames with the data the buffer had at the time of the request. + * + * **Note:** At the moment, the delay corresponds to the amount of frames specified by [member ProjectSettings.rendering/rendering_device/vsync/frame_queue_size]. + * + * **Note:** Downloading large buffers can have a prohibitive cost for real-time even when using the asynchronous method due to hardware bandwidth limitations. When dealing with large resources, you can adjust settings such as [member ProjectSettings.rendering/rendering_device/staging_buffer/block_size_kb] to improve the transfer speed at the cost of extra memory. + * + */ + buffer_get_data_async(buffer: RID, callback: Callable, offset_bytes: int64 = 0, size_bytes: int64 = 0): GError + + /** Returns the address of the given [param buffer] which can be passed to shaders in any way to access underlying data. Buffer must have been created with this feature enabled. + * + * **Note:** You must check that the GPU supports this functionality by calling [method has_feature] with [constant SUPPORTS_BUFFER_DEVICE_ADDRESS] as a parameter. + */ + buffer_get_device_address(buffer: RID): int64 + + /** Creates a new render pipeline. It can be accessed with the RID that is returned. + * Once finished with your RID, you will want to free the RID using the RenderingDevice's [method free_rid] method. + */ + render_pipeline_create(shader: RID, framebuffer_format: int64, vertex_format: int64, primitive: RenderingDevice.RenderPrimitive, rasterization_state: RDPipelineRasterizationState, multisample_state: RDPipelineMultisampleState, stencil_state: RDPipelineDepthStencilState, color_blend_state: RDPipelineColorBlendState, dynamic_state_flags: RenderingDevice.PipelineDynamicStateFlags = 0, for_render_pass: int64 = 0, specialization_constants: GArray = []): RID + + /** Returns `true` if the render pipeline specified by the [param render_pipeline] RID is valid, `false` otherwise. */ + render_pipeline_is_valid(render_pipeline: RID): boolean + + /** Creates a new compute pipeline. It can be accessed with the RID that is returned. + * Once finished with your RID, you will want to free the RID using the RenderingDevice's [method free_rid] method. + */ + compute_pipeline_create(shader: RID, specialization_constants: GArray = []): RID + + /** Returns `true` if the compute pipeline specified by the [param compute_pipeline] RID is valid, `false` otherwise. */ + compute_pipeline_is_valid(compute_pipeline: RID): boolean + + /** Returns the window width matching the graphics API context for the given window ID (in pixels). Despite the parameter being named [param screen], this returns the *window* size. See also [method screen_get_height]. + * + * **Note:** Only the main [RenderingDevice] returned by [method RenderingServer.get_rendering_device] has a width. If called on a local [RenderingDevice], this method prints an error and returns [constant INVALID_ID]. + */ + screen_get_width(screen: int64 = 0): int64 + + /** Returns the window height matching the graphics API context for the given window ID (in pixels). Despite the parameter being named [param screen], this returns the *window* size. See also [method screen_get_width]. + * + * **Note:** Only the main [RenderingDevice] returned by [method RenderingServer.get_rendering_device] has a height. If called on a local [RenderingDevice], this method prints an error and returns [constant INVALID_ID]. + */ + screen_get_height(screen: int64 = 0): int64 + + /** Returns the framebuffer format of the given screen. + * + * **Note:** Only the main [RenderingDevice] returned by [method RenderingServer.get_rendering_device] has a format. If called on a local [RenderingDevice], this method prints an error and returns [constant INVALID_ID]. + */ + screen_get_framebuffer_format(screen: int64 = 0): int64 + + /** High-level variant of [method draw_list_begin], with the parameters automatically being adjusted for drawing onto the window specified by the [param screen] ID. + * + * **Note:** Cannot be used with local RenderingDevices, as these don't have a screen. If called on a local RenderingDevice, [method draw_list_begin_for_screen] returns [constant INVALID_ID]. + */ + draw_list_begin_for_screen(screen: int64 = 0, clear_color: Color = new Color(0, 0, 0, 1)): int64 + + /** Starts a list of raster drawing commands created with the `draw_*` methods. The returned value should be passed to other `draw_list_*` functions. + * Multiple draw lists cannot be created at the same time; you must finish the previous draw list first using [method draw_list_end]. + * A simple drawing operation might look like this (code is not a complete example): + * + * The [param draw_flags] indicates if the texture attachments of the framebuffer should be cleared or ignored. Only one of the two flags can be used for each individual attachment. Ignoring an attachment means that any contents that existed before the draw list will be completely discarded, reducing the memory bandwidth used by the render pass but producing garbage results if the pixels aren't replaced. The default behavior allows the engine to figure out the right operation to use if the texture is discardable, which can result in increased performance. See [RDTextureFormat] or [method texture_set_discardable]. + * The [param breadcrumb] parameter can be an arbitrary 32-bit integer that is useful to diagnose GPU crashes. If Godot is built in dev or debug mode; when the GPU crashes Godot will dump all shaders that were being executed at the time of the crash and the breadcrumb is useful to diagnose what passes did those shaders belong to. + * It does not affect rendering behavior and can be set to 0. It is recommended to use [enum BreadcrumbMarker] enumerations for consistency but it's not required. It is also possible to use bitwise operations to add extra data. e.g. + * + */ + draw_list_begin(framebuffer: RID, draw_flags: RenderingDevice.DrawFlags = 0, clear_color_values: PackedColorArray | Color[] = [], clear_depth_value: float64 = 1, clear_stencil_value: int64 = 0, region: Rect2 = new Rect2(0, 0, 0, 0), breadcrumb: int64 = 0): int64 + + /** This method does nothing and always returns an empty [PackedInt64Array]. */ + draw_list_begin_split(framebuffer: RID, splits: int64, initial_color_action: RenderingDevice.InitialAction, final_color_action: RenderingDevice.FinalAction, initial_depth_action: RenderingDevice.InitialAction, final_depth_action: RenderingDevice.FinalAction, clear_color_values: PackedColorArray | Color[] = [], clear_depth: float64 = 1, clear_stencil: int64 = 0, region: Rect2 = new Rect2(0, 0, 0, 0), storage_textures: GArray = []): PackedInt64Array + + /** Sets blend constants for the specified [param draw_list] to [param color]. Blend constants are used only if the graphics pipeline is created with [constant DYNAMIC_STATE_BLEND_CONSTANTS] flag set. */ + draw_list_set_blend_constants(draw_list: int64, color: Color): void + + /** Binds [param render_pipeline] to the specified [param draw_list]. */ + draw_list_bind_render_pipeline(draw_list: int64, render_pipeline: RID): void + + /** Binds [param uniform_set] to the specified [param draw_list]. A [param set_index] must also be specified, which is an identifier starting from `0` that must match the one expected by the draw list. */ + draw_list_bind_uniform_set(draw_list: int64, uniform_set: RID, set_index: int64): void + + /** Binds [param vertex_array] to the specified [param draw_list]. */ + draw_list_bind_vertex_array(draw_list: int64, vertex_array: RID): void + + /** Binds [param index_array] to the specified [param draw_list]. */ + draw_list_bind_index_array(draw_list: int64, index_array: RID): void + + /** Sets the push constant data to [param buffer] for the specified [param draw_list]. The shader determines how this binary data is used. The buffer's size in bytes must also be specified in [param size_bytes] (this can be obtained by calling the [method PackedByteArray.size] method on the passed [param buffer]). */ + draw_list_set_push_constant(draw_list: int64, buffer: PackedByteArray | byte[] | ArrayBuffer, size_bytes: int64): void + + /** Submits [param draw_list] for rendering on the GPU. This is the raster equivalent to [method compute_list_dispatch]. */ + draw_list_draw(draw_list: int64, use_indices: boolean, instances: int64, procedural_vertex_count: int64 = 0): void + + /** Submits [param draw_list] for rendering on the GPU with the given parameters stored in the [param buffer] at [param offset]. Parameters being integers: vertex count, instance count, first vertex, first instance. And when using indices: index count, instance count, first index, vertex offset, first instance. Buffer must have been created with [constant STORAGE_BUFFER_USAGE_DISPATCH_INDIRECT] flag. */ + draw_list_draw_indirect(draw_list: int64, use_indices: boolean, buffer: RID, offset: int64 = 0, draw_count: int64 = 1, stride: int64 = 0): void + + /** Creates a scissor rectangle and enables it for the specified [param draw_list]. Scissor rectangles are used for clipping by discarding fragments that fall outside a specified rectangular portion of the screen. See also [method draw_list_disable_scissor]. + * + * **Note:** The specified [param rect] is automatically intersected with the screen's dimensions, which means it cannot exceed the screen's dimensions. + */ + draw_list_enable_scissor(draw_list: int64, rect: Rect2 = new Rect2(0, 0, 0, 0)): void + + /** Removes and disables the scissor rectangle for the specified [param draw_list]. See also [method draw_list_enable_scissor]. */ + draw_list_disable_scissor(draw_list: int64): void + + /** Switches to the next draw pass. */ + draw_list_switch_to_next_pass(): int64 + + /** This method does nothing and always returns an empty [PackedInt64Array]. */ + draw_list_switch_to_next_pass_split(splits: int64): PackedInt64Array + + /** Finishes a list of raster drawing commands created with the `draw_*` methods. */ + draw_list_end(): void + + /** Starts a list of compute commands created with the `compute_*` methods. The returned value should be passed to other `compute_list_*` functions. + * Multiple compute lists cannot be created at the same time; you must finish the previous compute list first using [method compute_list_end]. + * A simple compute operation might look like this (code is not a complete example): + * + */ + compute_list_begin(): int64 + + /** Tells the GPU what compute pipeline to use when processing the compute list. If the shader has changed since the last time this function was called, Godot will unbind all descriptor sets and will re-bind them inside [method compute_list_dispatch]. */ + compute_list_bind_compute_pipeline(compute_list: int64, compute_pipeline: RID): void + + /** Sets the push constant data to [param buffer] for the specified [param compute_list]. The shader determines how this binary data is used. The buffer's size in bytes must also be specified in [param size_bytes] (this can be obtained by calling the [method PackedByteArray.size] method on the passed [param buffer]). */ + compute_list_set_push_constant(compute_list: int64, buffer: PackedByteArray | byte[] | ArrayBuffer, size_bytes: int64): void + + /** Binds the [param uniform_set] to this [param compute_list]. Godot ensures that all textures in the uniform set have the correct Vulkan access masks. If Godot had to change access masks of textures, it will raise a Vulkan image memory barrier. */ + compute_list_bind_uniform_set(compute_list: int64, uniform_set: RID, set_index: int64): void + + /** Submits the compute list for processing on the GPU. This is the compute equivalent to [method draw_list_draw]. */ + compute_list_dispatch(compute_list: int64, x_groups: int64, y_groups: int64, z_groups: int64): void + + /** Submits the compute list for processing on the GPU with the given group counts stored in the [param buffer] at [param offset]. Buffer must have been created with [constant STORAGE_BUFFER_USAGE_DISPATCH_INDIRECT] flag. */ + compute_list_dispatch_indirect(compute_list: int64, buffer: RID, offset: int64): void + + /** Raises a Vulkan compute barrier in the specified [param compute_list]. */ + compute_list_add_barrier(compute_list: int64): void + + /** Finishes a list of compute commands created with the `compute_*` methods. */ + compute_list_end(): void + + /** Tries to free an object in the RenderingDevice. To avoid memory leaks, this should be called after using an object as memory management does not occur automatically when using RenderingDevice directly. */ + free_rid(rid: RID): void + + /** Creates a timestamp marker with the specified [param name]. This is used for performance reporting with the [method get_captured_timestamp_cpu_time], [method get_captured_timestamp_gpu_time] and [method get_captured_timestamp_name] methods. */ + capture_timestamp(name: string): void + + /** Returns the total number of timestamps (rendering steps) available for profiling. */ + get_captured_timestamps_count(): int64 + + /** Returns the index of the last frame rendered that has rendering timestamps available for querying. */ + get_captured_timestamps_frame(): int64 + + /** Returns the timestamp in GPU time for the rendering step specified by [param index] (in microseconds since the engine started). See also [method get_captured_timestamp_cpu_time] and [method capture_timestamp]. */ + get_captured_timestamp_gpu_time(index: int64): int64 + + /** Returns the timestamp in CPU time for the rendering step specified by [param index] (in microseconds since the engine started). See also [method get_captured_timestamp_gpu_time] and [method capture_timestamp]. */ + get_captured_timestamp_cpu_time(index: int64): int64 + + /** Returns the timestamp's name for the rendering step specified by [param index]. See also [method capture_timestamp]. */ + get_captured_timestamp_name(index: int64): string + + /** Returns `true` if the [param feature] is supported by the GPU. */ + has_feature(feature: RenderingDevice.Features): boolean + + /** Returns the value of the specified [param limit]. This limit varies depending on the current graphics hardware (and sometimes the driver version). If the given limit is exceeded, rendering errors will occur. + * Limits for various graphics hardware can be found in the [url=https://vulkan.gpuinfo.org/]Vulkan Hardware Database[/url]. + */ + limit_get(limit: RenderingDevice.Limit): int64 + + /** Returns the frame count kept by the graphics API. Higher values result in higher input lag, but with more consistent throughput. For the main [RenderingDevice], frames are cycled (usually 3 with triple-buffered V-Sync enabled). However, local [RenderingDevice]s only have 1 frame. */ + get_frame_delay(): int64 + + /** Pushes the frame setup and draw command buffers then marks the local device as currently processing (which allows calling [method sync]). + * + * **Note:** Only available in local RenderingDevices. + */ + submit(): void + + /** Forces a synchronization between the CPU and GPU, which may be required in certain cases. Only call this when needed, as CPU-GPU synchronization has a performance cost. + * + * **Note:** Only available in local RenderingDevices. + * + * **Note:** [method sync] can only be called after a [method submit]. + */ + sync(): void + + /** This method does nothing. */ + barrier(from: RenderingDevice.BarrierMask = 32767, to: RenderingDevice.BarrierMask = 32767): void + + /** This method does nothing. */ + full_barrier(): void + + /** Create a new local [RenderingDevice]. This is most useful for performing compute operations on the GPU independently from the rest of the engine. */ + create_local_device(): RenderingDevice + + /** Sets the resource name for [param id] to [param name]. This is used for debugging with third-party tools such as [url=https://renderdoc.org/]RenderDoc[/url]. + * The following types of resources can be named: texture, sampler, vertex buffer, index buffer, uniform buffer, texture buffer, storage buffer, uniform set buffer, shader, render pipeline and compute pipeline. Framebuffers cannot be named. Attempting to name an incompatible resource type will print an error. + * + * **Note:** Resource names are only set when the engine runs in verbose mode ([method OS.is_stdout_verbose] = `true`), or when using an engine build compiled with the `dev_mode=yes` SCons option. The graphics driver must also support the `VK_EXT_DEBUG_UTILS_EXTENSION_NAME` Vulkan extension for named resources to work. + */ + set_resource_name(id: RID, name: string): void + + /** Create a command buffer debug label region that can be displayed in third-party tools such as [url=https://renderdoc.org/]RenderDoc[/url]. All regions must be ended with a [method draw_command_end_label] call. When viewed from the linear series of submissions to a single queue, calls to [method draw_command_begin_label] and [method draw_command_end_label] must be matched and balanced. + * The `VK_EXT_DEBUG_UTILS_EXTENSION_NAME` Vulkan extension must be available and enabled for command buffer debug label region to work. See also [method draw_command_end_label]. + */ + draw_command_begin_label(name: string, color: Color): void + + /** This method does nothing. */ + draw_command_insert_label(name: string, color: Color): void + + /** Ends the command buffer debug label region started by a [method draw_command_begin_label] call. */ + draw_command_end_label(): void + + /** Returns the vendor of the video adapter (e.g. "NVIDIA Corporation"). Equivalent to [method RenderingServer.get_video_adapter_vendor]. See also [method get_device_name]. */ + get_device_vendor_name(): string + + /** Returns the name of the video adapter (e.g. "GeForce GTX 1080/PCIe/SSE2"). Equivalent to [method RenderingServer.get_video_adapter_name]. See also [method get_device_vendor_name]. */ + get_device_name(): string + + /** Returns the universally unique identifier for the pipeline cache. This is used to cache shader files on disk, which avoids shader recompilations on subsequent engine runs. This UUID varies depending on the graphics card model, but also the driver version. Therefore, updating graphics drivers will invalidate the shader cache. */ + get_device_pipeline_cache_uuid(): string + + /** Returns the memory usage in bytes corresponding to the given [param type]. When using Vulkan, these statistics are calculated by [url=https://github.com/GPUOpen-LibrariesAndSDKs/VulkanMemoryAllocator]Vulkan Memory Allocator[/url]. */ + get_memory_usage(type: RenderingDevice.MemoryType): int64 + + /** Returns the unique identifier of the driver [param resource] for the specified [param rid]. Some driver resource types ignore the specified [param rid] (see [enum DriverResource] descriptions). [param index] is always ignored but must be specified anyway. */ + get_driver_resource(resource: RenderingDevice.DriverResource, rid: RID, index: int64): int64 + + /** Returns a string with a performance report from the past frame. Updates every frame. */ + get_perf_report(): string + + /** Returns string report in CSV format using the following methods: + * - [method get_tracked_object_name] + * - [method get_tracked_object_type_count] + * - [method get_driver_total_memory] + * - [method get_driver_allocation_count] + * - [method get_driver_memory_by_object_type] + * - [method get_driver_allocs_by_object_type] + * - [method get_device_total_memory] + * - [method get_device_allocation_count] + * - [method get_device_memory_by_object_type] + * - [method get_device_allocs_by_object_type] + * This is only used by Vulkan in debug builds. Godot must also be started with the `--extra-gpu-memory-tracking` [url=https://docs.godotengine.org/en/4.4/tutorials/editor/command_line_tutorial.html]command line argument[/url]. + */ + get_driver_and_device_memory_report(): string + + /** Returns the name of the type of object for the given [param type_index]. This value must be in range `[0; get_tracked_object_type_count - 1]`. If [method get_tracked_object_type_count] is 0, then type argument is ignored and always returns the same string. + * The return value is important because it gives meaning to the types passed to [method get_driver_memory_by_object_type], [method get_driver_allocs_by_object_type], [method get_device_memory_by_object_type], and [method get_device_allocs_by_object_type]. Examples of strings it can return (not exhaustive): + * - DEVICE_MEMORY + * - PIPELINE_CACHE + * - SWAPCHAIN_KHR + * - COMMAND_POOL + * Thus if e.g. `get_tracked_object_name(5)` returns "COMMAND_POOL", then `get_device_memory_by_object_type(5)` returns the bytes used by the GPU for command pools. + * This is only used by Vulkan in debug builds. Godot must also be started with the `--extra-gpu-memory-tracking` [url=https://docs.godotengine.org/en/4.4/tutorials/editor/command_line_tutorial.html]command line argument[/url]. + */ + get_tracked_object_name(type_index: int64): string + + /** Returns how many types of trackable objects are. + * This is only used by Vulkan in debug builds. Godot must also be started with the `--extra-gpu-memory-tracking` [url=https://docs.godotengine.org/en/4.4/tutorials/editor/command_line_tutorial.html]command line argument[/url]. + */ + get_tracked_object_type_count(): int64 + + /** Returns how much bytes the GPU driver is using for internal driver structures. + * This is only used by Vulkan in debug builds and can return 0 when this information is not tracked or unknown. + */ + get_driver_total_memory(): int64 + + /** Returns how many allocations the GPU driver has performed for internal driver structures. + * This is only used by Vulkan in debug builds and can return 0 when this information is not tracked or unknown. + */ + get_driver_allocation_count(): int64 + + /** Same as [method get_driver_total_memory] but filtered for a given object type. + * The type argument must be in range `[0; get_tracked_object_type_count - 1]`. If [method get_tracked_object_type_count] is 0, then type argument is ignored and always returns 0. + * This is only used by Vulkan in debug builds and can return 0 when this information is not tracked or unknown. + */ + get_driver_memory_by_object_type(type: int64): int64 + + /** Same as [method get_driver_allocation_count] but filtered for a given object type. + * The type argument must be in range `[0; get_tracked_object_type_count - 1]`. If [method get_tracked_object_type_count] is 0, then type argument is ignored and always returns 0. + * This is only used by Vulkan in debug builds and can return 0 when this information is not tracked or unknown. + */ + get_driver_allocs_by_object_type(type: int64): int64 + + /** Returns how much bytes the GPU is using. + * This is only used by Vulkan in debug builds and can return 0 when this information is not tracked or unknown. + */ + get_device_total_memory(): int64 + + /** Returns how many allocations the GPU has performed for internal driver structures. + * This is only used by Vulkan in debug builds and can return 0 when this information is not tracked or unknown. + */ + get_device_allocation_count(): int64 + + /** Same as [method get_device_total_memory] but filtered for a given object type. + * The type argument must be in range `[0; get_tracked_object_type_count - 1]`. If [method get_tracked_object_type_count] is 0, then type argument is ignored and always returns 0. + * This is only used by Vulkan in debug builds and can return 0 when this information is not tracked or unknown. + */ + get_device_memory_by_object_type(type: int64): int64 + + /** Same as [method get_device_allocation_count] but filtered for a given object type. + * The type argument must be in range `[0; get_tracked_object_type_count - 1]`. If [method get_tracked_object_type_count] is 0, then type argument is ignored and always returns 0. + * This is only used by Vulkan in debug builds and can return 0 when this information is not tracked or unknown. + */ + get_device_allocs_by_object_type(type: int64): int64 + } + class ReparentDialog = Record> extends ConfirmationDialog { constructor(identifier?: any) _cancel(): void readonly reparent: Signal2 } - class ReplicationEditor extends VBoxContainer { + class ReplicationEditor = Record> extends VBoxContainer { constructor(identifier?: any) _update_config(): void _update_value(property: NodePath | string, column: int64, value: int64): void } /** Base class for serializable objects. * - * @link https://docs.godotengine.org/en/4.3/classes/class_resource.html + * @link https://docs.godotengine.org/en/4.4/classes/class_resource.html */ class Resource extends RefCounted { constructor(identifier?: any) - /** Override this method to return a custom [RID] when [method get_rid] is called. */ - /* gdvirtual */ _get_rid(): RID - /** Override this method to customize the newly duplicated resource created from [method PackedScene.instantiate], if the original's [member resource_local_to_scene] is set to `true`. - * **Example:** Set a random `damage` value to every local resource from an instantiated scene. + * **Example:** Set a random `damage` value to every local resource from an instantiated scene: * */ /* gdvirtual */ _setup_local_to_scene(): void + /** Override this method to return a custom [RID] when [method get_rid] is called. */ + /* gdvirtual */ _get_rid(): RID + + /** For resources that use a variable number of properties, either via [method Object._validate_property] or [method Object._get_property_list], this method should be implemented to correctly clear the resource's state. */ + /* gdvirtual */ _reset_state(): void + + /** Sets the resource's path to [param path] without involving the resource cache. */ + /* gdvirtual */ _set_path_cache(path: string): void + /** Sets the [member resource_path] to [param path], potentially overriding an existing cache entry for this path. Further attempts to load an overridden resource by path will instead return this resource. */ take_over_path(path: string): void + /** Sets the resource's path to [param path] without involving the resource cache. */ + set_path_cache(path: string): void + /** Returns the [RID] of this resource (or an empty RID). Many resources (such as [Texture2D], [Mesh], and so on) are high-level abstractions of resources stored in a specialized server ([DisplayServer], [RenderingServer], etc.), so this function will return the original [RID]. */ get_rid(): RID @@ -38,6 +8323,24 @@ declare module "godot" { /** Calls [method _setup_local_to_scene]. If [member resource_local_to_scene] is set to `true`, this method is automatically called from [method PackedScene.instantiate] by the newly duplicated resource within the scene instance. */ setup_local_to_scene(): void + /** For resources that use a variable number of properties, either via [method Object._validate_property] or [method Object._get_property_list], override [method _reset_state] to correctly clear the resource's state. */ + reset_state(): void + + /** Sets the unique identifier to [param id] for the resource with the given [param path] in the resource cache. If the unique identifier is empty, the cache entry using [param path] is removed if it exists. + * + * **Note:** This method is only implemented when running in an editor context. + */ + set_id_for_path(path: string, id: string): void + + /** Returns the unique identifier for the resource with the given [param path] from the resource cache. If the resource is not loaded and cached, an empty string is returned. + * + * **Note:** This method is only implemented when running in an editor context. At runtime, it returns an empty string. + */ + get_id_for_path(path: string): string + + /** Returns `true` if the resource is built-in (from the engine) or `false` if it is user-defined. */ + is_built_in(): boolean + /** Generates a unique identifier for a resource to be contained inside a [PackedScene], based on the current date, time, and a random value. The returned string is only composed of letters (`a` to `y`) and numbers (`0` to `8`). See also [member resource_scene_unique_id]. */ static generate_scene_unique_id(): string @@ -122,7 +8425,7 @@ declare module "godot" { } /** Loads a specific resource type from a file. * - * @link https://docs.godotengine.org/en/4.3/classes/class_resourceformatloader.html + * @link https://docs.godotengine.org/en/4.4/classes/class_resourceformatloader.html */ class ResourceFormatLoader extends RefCounted { constructor(identifier?: any) @@ -148,6 +8451,8 @@ declare module "godot" { /** Returns the script class name associated with the [Resource] under the given [param path]. If the resource has no script or the script isn't a named class, it should return `""`. */ /* gdvirtual */ _get_resource_script_class(path: string): string + + /** Should return the unique ID for the resource associated with the given path. If this method is not overridden, a `.uid` file is generated along with the resource file, containing the unique ID. */ /* gdvirtual */ _get_resource_uid(path: string): int64 /** If implemented, gets the dependencies of a given resource. If [param add_types] is `true`, paths should be appended `::TypeName`, where `TypeName` is the class name of the dependency. @@ -170,7 +8475,7 @@ declare module "godot" { } /** Saves a specific resource type to a file. * - * @link https://docs.godotengine.org/en/4.3/classes/class_resourceformatsaver.html + * @link https://docs.godotengine.org/en/4.4/classes/class_resourceformatsaver.html */ class ResourceFormatSaver extends RefCounted { constructor(identifier?: any) @@ -204,126 +8509,126 @@ declare module "godot" { } /** Base class for resource importers. * - * @link https://docs.godotengine.org/en/4.3/classes/class_resourceimporter.html + * @link https://docs.godotengine.org/en/4.4/classes/class_resourceimporter.html */ class ResourceImporter extends RefCounted { constructor(identifier?: any) } /** Imports a bitmap font in the BMFont (`.fnt`) format. * - * @link https://docs.godotengine.org/en/4.3/classes/class_resourceimporterbmfont.html + * @link https://docs.godotengine.org/en/4.4/classes/class_resourceimporterbmfont.html */ class ResourceImporterBMFont extends ResourceImporter { constructor(identifier?: any) } /** Imports a [BitMap] resource (2D array of boolean values). * - * @link https://docs.godotengine.org/en/4.3/classes/class_resourceimporterbitmap.html + * @link https://docs.godotengine.org/en/4.4/classes/class_resourceimporterbitmap.html */ class ResourceImporterBitMap extends ResourceImporter { constructor(identifier?: any) } /** Imports comma-separated values * - * @link https://docs.godotengine.org/en/4.3/classes/class_resourceimportercsvtranslation.html + * @link https://docs.godotengine.org/en/4.4/classes/class_resourceimportercsvtranslation.html */ class ResourceImporterCSVTranslation extends ResourceImporter { constructor(identifier?: any) } /** Imports a TTF, TTC, OTF, OTC, WOFF or WOFF2 font file for font rendering that adapts to any size. * - * @link https://docs.godotengine.org/en/4.3/classes/class_resourceimporterdynamicfont.html + * @link https://docs.godotengine.org/en/4.4/classes/class_resourceimporterdynamicfont.html */ class ResourceImporterDynamicFont extends ResourceImporter { constructor(identifier?: any) } /** Imports a image for use in scripting, with no rendering capabilities. * - * @link https://docs.godotengine.org/en/4.3/classes/class_resourceimporterimage.html + * @link https://docs.godotengine.org/en/4.4/classes/class_resourceimporterimage.html */ class ResourceImporterImage extends ResourceImporter { constructor(identifier?: any) } /** Imports a bitmap font where all glyphs have the same width and height. * - * @link https://docs.godotengine.org/en/4.3/classes/class_resourceimporterimagefont.html + * @link https://docs.godotengine.org/en/4.4/classes/class_resourceimporterimagefont.html */ class ResourceImporterImageFont extends ResourceImporter { constructor(identifier?: any) } /** Imports a 3-dimensional texture ([Texture3D]), a [Texture2DArray], a [Cubemap] or a [CubemapArray]. * - * @link https://docs.godotengine.org/en/4.3/classes/class_resourceimporterlayeredtexture.html + * @link https://docs.godotengine.org/en/4.4/classes/class_resourceimporterlayeredtexture.html */ class ResourceImporterLayeredTexture extends ResourceImporter { constructor(identifier?: any) } /** Imports an MP3 audio file for playback. * - * @link https://docs.godotengine.org/en/4.3/classes/class_resourceimportermp3.html + * @link https://docs.godotengine.org/en/4.4/classes/class_resourceimportermp3.html */ class ResourceImporterMP3 extends ResourceImporter { constructor(identifier?: any) } /** Imports an OBJ 3D model as an independent [Mesh] or scene. * - * @link https://docs.godotengine.org/en/4.3/classes/class_resourceimporterobj.html + * @link https://docs.godotengine.org/en/4.4/classes/class_resourceimporterobj.html */ class ResourceImporterOBJ extends ResourceImporter { constructor(identifier?: any) } /** Imports an Ogg Vorbis audio file for playback. * - * @link https://docs.godotengine.org/en/4.3/classes/class_resourceimporteroggvorbis.html + * @link https://docs.godotengine.org/en/4.4/classes/class_resourceimporteroggvorbis.html */ class ResourceImporterOggVorbis extends ResourceImporter { constructor(identifier?: any) - /** This method loads audio data from a PackedByteArray buffer into an AudioStreamOggVorbis object. */ - static load_from_buffer(buffer: PackedByteArray | byte[] | ArrayBuffer): AudioStreamOggVorbis + /** Creates a new [AudioStreamOggVorbis] instance from the given buffer. The buffer must contain Ogg Vorbis data. */ + static load_from_buffer(stream_data: PackedByteArray | byte[] | ArrayBuffer): AudioStreamOggVorbis - /** This method loads audio data from a file into an AudioStreamOggVorbis object. The file path is provided as a string. */ + /** Creates a new [AudioStreamOggVorbis] instance from the given file path. The file must be in Ogg Vorbis format. */ static load_from_file(path: string): AudioStreamOggVorbis } /** Imports a glTF, FBX, Collada or Blender 3D scene. * - * @link https://docs.godotengine.org/en/4.3/classes/class_resourceimporterscene.html + * @link https://docs.godotengine.org/en/4.4/classes/class_resourceimporterscene.html */ class ResourceImporterScene extends ResourceImporter { constructor(identifier?: any) } /** Imports native GLSL shaders (not Godot shaders) as a [RDShaderFile]. * - * @link https://docs.godotengine.org/en/4.3/classes/class_resourceimportershaderfile.html + * @link https://docs.godotengine.org/en/4.4/classes/class_resourceimportershaderfile.html */ class ResourceImporterShaderFile extends ResourceImporter { constructor(identifier?: any) } /** Imports an image for use in 2D or 3D rendering. * - * @link https://docs.godotengine.org/en/4.3/classes/class_resourceimportertexture.html + * @link https://docs.godotengine.org/en/4.4/classes/class_resourceimportertexture.html */ class ResourceImporterTexture extends ResourceImporter { constructor(identifier?: any) } /** Imports a collection of textures from a PNG image into an optimized [AtlasTexture] for 2D rendering. * - * @link https://docs.godotengine.org/en/4.3/classes/class_resourceimportertextureatlas.html + * @link https://docs.godotengine.org/en/4.4/classes/class_resourceimportertextureatlas.html */ class ResourceImporterTextureAtlas extends ResourceImporter { constructor(identifier?: any) } /** Imports a WAV audio file for playback. * - * @link https://docs.godotengine.org/en/4.3/classes/class_resourceimporterwav.html + * @link https://docs.godotengine.org/en/4.4/classes/class_resourceimporterwav.html */ class ResourceImporterWAV extends ResourceImporter { constructor(identifier?: any) } /** A node used to preload sub-resources inside a scene. * - * @link https://docs.godotengine.org/en/4.3/classes/class_resourcepreloader.html + * @link https://docs.godotengine.org/en/4.4/classes/class_resourcepreloader.html */ - class ResourcePreloader extends Node { + class ResourcePreloader = Record> extends Node { constructor(identifier?: any) /** Adds a resource to the preloader with the given [param name]. If a resource with the given [param name] already exists, the new resource will be renamed to "[param name] N" where N is an incrementing number starting from 2. */ add_resource(name: StringName, resource: Resource): void @@ -345,14 +8650,70 @@ declare module "godot" { get resources(): GArray set resources(value: GArray) } - class ResourcePreloaderEditor extends PanelContainer { + class ResourcePreloaderEditor = Record> extends PanelContainer { constructor(identifier?: any) _update_library(): void _remove_resource(to_remove: string): void } - class ResourcePreloaderEditorPlugin extends EditorPlugin { + class ResourcePreloaderEditorPlugin = Record> extends EditorPlugin { constructor(identifier?: any) } + namespace RetargetModifier3D { + enum TransformFlag { + /** If set, allows to retarget the position. */ + TRANSFORM_FLAG_POSITION = 1, + + /** If set, allows to retarget the rotation. */ + TRANSFORM_FLAG_ROTATION = 2, + + /** If set, allows to retarget the scale. */ + TRANSFORM_FLAG_SCALE = 4, + + /** If set, allows to retarget the position/rotation/scale. */ + TRANSFORM_FLAG_ALL = 7, + } + } + /** A modifier to transfer parent skeleton poses (or global poses) to child skeletons in model space with different rests. + * + * @link https://docs.godotengine.org/en/4.4/classes/class_retargetmodifier3d.html + */ + class RetargetModifier3D = Record> extends SkeletonModifier3D { + constructor(identifier?: any) + /** Sets [constant TRANSFORM_FLAG_POSITION] into [member enable]. */ + set_position_enabled(enabled: boolean): void + + /** Returns `true` if [member enable] has [constant TRANSFORM_FLAG_POSITION]. */ + is_position_enabled(): boolean + + /** Sets [constant TRANSFORM_FLAG_ROTATION] into [member enable]. */ + set_rotation_enabled(enabled: boolean): void + + /** Returns `true` if [member enable] has [constant TRANSFORM_FLAG_ROTATION]. */ + is_rotation_enabled(): boolean + + /** Sets [constant TRANSFORM_FLAG_SCALE] into [member enable]. */ + set_scale_enabled(enabled: boolean): void + + /** Returns `true` if [member enable] has [constant TRANSFORM_FLAG_SCALE]. */ + is_scale_enabled(): boolean + + /** [SkeletonProfile] for retargeting bones with names matching the bone list. */ + get profile(): SkeletonProfile + set profile(value: SkeletonProfile) + + /** If `false`, in case the target skeleton has fewer bones than the source skeleton, the source bone parent's transform will be ignored. + * Instead, it is possible to retarget between models with different body shapes, and position, rotation, and scale can be retargeted separately. + * If `true`, retargeting is performed taking into account global pose. + * In case the target skeleton has fewer bones than the source skeleton, the source bone parent's transform is taken into account. However, bone length between skeletons must match exactly, if not, the bones will be forced to expand or shrink. + * This is useful for using dummy bone with length `0` to match postures when retargeting between models with different number of bones. + */ + get use_global_pose(): boolean + set use_global_pose(value: boolean) + + /** Flags to control the process of the transform elements individually when [member use_global_pose] is disabled. */ + get enable(): int64 + set enable(value: int64) + } namespace RibbonTrailMesh { enum Shape { /** Gives the mesh a single flat face. */ @@ -364,7 +8725,7 @@ declare module "godot" { } /** Represents a straight ribbon-shaped [PrimitiveMesh] with variable width. * - * @link https://docs.godotengine.org/en/4.3/classes/class_ribbontrailmesh.html + * @link https://docs.godotengine.org/en/4.4/classes/class_ribbontrailmesh.html */ class RibbonTrailMesh extends PrimitiveMesh { constructor(identifier?: any) @@ -388,13 +8749,13 @@ declare module "godot" { get section_segments(): int64 set section_segments(value: int64) - /** Determines the size of the ribbon along its length. The size of a particular section segment is obtained by multiplying the baseline [member size] by the value of this curve at the given distance. For values smaller than `0`, the faces will be inverted. */ + /** Determines the size of the ribbon along its length. The size of a particular section segment is obtained by multiplying the baseline [member size] by the value of this curve at the given distance. For values smaller than `0`, the faces will be inverted. Should be a unit [Curve]. */ get curve(): Curve set curve(value: Curve) } /** A custom effect for a [RichTextLabel]. * - * @link https://docs.godotengine.org/en/4.3/classes/class_richtexteffect.html + * @link https://docs.godotengine.org/en/4.4/classes/class_richtexteffect.html */ class RichTextEffect extends Resource { constructor(identifier?: any) @@ -463,9 +8824,9 @@ declare module "godot" { } /** A control for displaying text that can contain different font styles, images, and basic formatting. * - * @link https://docs.godotengine.org/en/4.3/classes/class_richtextlabel.html + * @link https://docs.godotengine.org/en/4.4/classes/class_richtextlabel.html */ - class RichTextLabel extends Control { + class RichTextLabel = Record> extends Control { constructor(identifier?: any) /** Returns the text without BBCode mark-up. */ get_parsed_text(): string @@ -543,7 +8904,7 @@ declare module "godot" { * * **Note:** Meta tags do nothing by default when clicked. To assign behavior when clicked, connect [signal meta_clicked] to a function that is called when the meta tag is clicked. */ - push_meta(data: any, underline_mode: RichTextLabel.MetaUnderline = 1): void + push_meta(data: any, underline_mode: RichTextLabel.MetaUnderline = 1, tooltip: string = ''): void /** Adds a [code skip-lint][hint]` tag to the tag stack. Same as BBCode [code skip-lint][hint=something]{text}[/hint]`. */ push_hint(description: string): void @@ -567,7 +8928,7 @@ declare module "godot" { * For example, 2 columns with ratios 3 and 4 plus 70 pixels in available width would expand 30 and 40 pixels, respectively. * If [param expand] is `false`, the column will not contribute to the total ratio. */ - set_table_column_expand(column: int64, expand: boolean, ratio: int64 = 1): void + set_table_column_expand(column: int64, expand: boolean, ratio: int64 = 1, shrink: boolean = true): void /** Sets color of a table cell. Separate colors for alternating rows can be specified. */ set_cell_row_background_color(odd_row_bg: Color, even_row_bg: Color): void @@ -631,6 +8992,9 @@ declare module "godot" { /** Returns the current selection last character index if a selection is active, `-1` otherwise. Does not include BBCodes. */ get_selection_to(): int64 + /** Returns the current selection vertical line offset if a selection is active, `-1.0` otherwise. */ + get_selection_line_offset(): float64 + /** Select all the text. * If [member selection_enabled] is `false`, no selection will occur. */ @@ -654,15 +9018,18 @@ declare module "godot" { /** If [member threaded] is enabled, returns `true` if the background thread has finished text processing, otherwise always return `true`. */ is_ready(): boolean + /** If [member threaded] is enabled, returns `true` if the background thread has finished text processing, otherwise always return `true`. */ + is_finished(): boolean + /** Returns the line number of the character position provided. Line and character numbers are both zero-indexed. * - * **Note:** If [member threaded] is enabled, this method returns a value for the loaded part of the document. Use [method is_ready] or [signal finished] to determine whether document is fully loaded. + * **Note:** If [member threaded] is enabled, this method returns a value for the loaded part of the document. Use [method is_finished] or [signal finished] to determine whether document is fully loaded. */ get_character_line(character: int64): int64 /** Returns the paragraph number of the character position provided. Paragraph and character numbers are both zero-indexed. * - * **Note:** If [member threaded] is enabled, this method returns a value for the loaded part of the document. Use [method is_ready] or [signal finished] to determine whether document is fully loaded. + * **Note:** If [member threaded] is enabled, this method returns a value for the loaded part of the document. Use [method is_finished] or [signal finished] to determine whether document is fully loaded. */ get_character_paragraph(character: int64): int64 @@ -671,13 +9038,23 @@ declare module "godot" { /** Returns the total number of lines in the text. Wrapped text is counted as multiple lines. * - * **Note:** If [member threaded] is enabled, this method returns a value for the loaded part of the document. Use [method is_ready] or [signal finished] to determine whether document is fully loaded. + * **Note:** If [member visible_characters_behavior] is set to [constant TextServer.VC_CHARS_BEFORE_SHAPING] only visible wrapped lines are counted. + * + * **Note:** If [member threaded] is enabled, this method returns a value for the loaded part of the document. Use [method is_finished] or [signal finished] to determine whether document is fully loaded. */ get_line_count(): int64 + /** Returns the indexes of the first and last visible characters for the given [param line], as a [Vector2i]. + * + * **Note:** If [member visible_characters_behavior] is set to [constant TextServer.VC_CHARS_BEFORE_SHAPING] only visible wrapped lines are counted. + * + * **Note:** If [member threaded] is enabled, this method returns a value for the loaded part of the document. Use [method is_finished] or [signal finished] to determine whether document is fully loaded. + */ + get_line_range(line: int64): Vector2i + /** Returns the number of visible lines. * - * **Note:** If [member threaded] is enabled, this method returns a value for the loaded part of the document. Use [method is_ready] or [signal finished] to determine whether document is fully loaded. + * **Note:** If [member threaded] is enabled, this method returns a value for the loaded part of the document. Use [method is_finished] or [signal finished] to determine whether document is fully loaded. */ get_visible_line_count(): int64 @@ -686,41 +9063,41 @@ declare module "godot" { /** Returns the number of visible paragraphs. A paragraph is considered visible if at least one of its lines is visible. * - * **Note:** If [member threaded] is enabled, this method returns a value for the loaded part of the document. Use [method is_ready] or [signal finished] to determine whether document is fully loaded. + * **Note:** If [member threaded] is enabled, this method returns a value for the loaded part of the document. Use [method is_finished] or [signal finished] to determine whether document is fully loaded. */ get_visible_paragraph_count(): int64 /** Returns the height of the content. * - * **Note:** If [member threaded] is enabled, this method returns a value for the loaded part of the document. Use [method is_ready] or [signal finished] to determine whether document is fully loaded. + * **Note:** If [member threaded] is enabled, this method returns a value for the loaded part of the document. Use [method is_finished] or [signal finished] to determine whether document is fully loaded. */ get_content_height(): int64 /** Returns the width of the content. * - * **Note:** If [member threaded] is enabled, this method returns a value for the loaded part of the document. Use [method is_ready] or [signal finished] to determine whether document is fully loaded. + * **Note:** If [member threaded] is enabled, this method returns a value for the loaded part of the document. Use [method is_finished] or [signal finished] to determine whether document is fully loaded. */ get_content_width(): int64 /** Returns the vertical offset of the line found at the provided index. * - * **Note:** If [member threaded] is enabled, this method returns a value for the loaded part of the document. Use [method is_ready] or [signal finished] to determine whether document is fully loaded. + * **Note:** If [member threaded] is enabled, this method returns a value for the loaded part of the document. Use [method is_finished] or [signal finished] to determine whether document is fully loaded. */ get_line_offset(line: int64): float64 /** Returns the vertical offset of the paragraph found at the provided index. * - * **Note:** If [member threaded] is enabled, this method returns a value for the loaded part of the document. Use [method is_ready] or [signal finished] to determine whether document is fully loaded. + * **Note:** If [member threaded] is enabled, this method returns a value for the loaded part of the document. Use [method is_finished] or [signal finished] to determine whether document is fully loaded. */ get_paragraph_offset(paragraph: int64): float64 /** Parses BBCode parameter [param expressions] into a dictionary. */ parse_expressions_for_values(expressions: PackedStringArray | string[]): GDictionary - /** Installs a custom effect. This can also be done in the RichTextLabel inspector using the [member custom_effects] property. [param effect] should be a valid [RichTextEffect]. - * Example RichTextEffect: + /** Installs a custom effect. This can also be done in the Inspector through the [member custom_effects] property. [param effect] should be a valid [RichTextEffect]. + * **Example:** With the following script extending from [RichTextEffect]: * - * Registering the above effect in RichTextLabel from script: + * The above effect can be installed in [RichTextLabel] from a script: * */ install_effect(effect: any): void @@ -780,6 +9157,22 @@ declare module "godot" { get shortcut_keys_enabled(): boolean set shortcut_keys_enabled(value: boolean) + /** Controls the text's horizontal alignment. Supports left, center, right, and fill, or justify. Set it to one of the [enum HorizontalAlignment] constants. */ + get horizontal_alignment(): int64 + set horizontal_alignment(value: int64) + + /** Controls the text's vertical alignment. Supports top, center, bottom, and fill. Set it to one of the [enum VerticalAlignment] constants. */ + get vertical_alignment(): int64 + set vertical_alignment(value: int64) + + /** Line fill alignment rules. See [enum TextServer.JustificationFlag] for more information. */ + get justification_flags(): int64 + set justification_flags(value: int64) + + /** Aligns text to the given tab-stops. */ + get tab_stops(): PackedFloat32Array + set tab_stops(value: PackedFloat32Array | float32[]) + /** The currently installed custom effects. This is an array of [RichTextEffect]s. * To add a custom effect, it's more convenient to use [method install_effect]. */ @@ -863,8830 +9256,10 @@ declare module "godot" { /** Triggers when the mouse exits a meta tag. */ readonly meta_hover_ended: Signal1 - /** Triggered when the document is fully loaded. */ + /** Triggered when the document is fully loaded. + * + * **Note:** This can happen before the text is processed for drawing. Scrolling values may not be valid until the document is drawn for the first time after this signal. + */ readonly finished: Signal0 } - namespace RigidBody2D { - enum FreezeMode { - /** Static body freeze mode (default). The body is not affected by gravity and forces. It can be only moved by user code and doesn't collide with other bodies along its path. */ - FREEZE_MODE_STATIC = 0, - - /** Kinematic body freeze mode. Similar to [constant FREEZE_MODE_STATIC], but collides with other bodies along its path when moved. Useful for a frozen body that needs to be animated. */ - FREEZE_MODE_KINEMATIC = 1, - } - enum CenterOfMassMode { - /** In this mode, the body's center of mass is calculated automatically based on its shapes. This assumes that the shapes' origins are also their center of mass. */ - CENTER_OF_MASS_MODE_AUTO = 0, - - /** In this mode, the body's center of mass is set through [member center_of_mass]. Defaults to the body's origin position. */ - CENTER_OF_MASS_MODE_CUSTOM = 1, - } - enum DampMode { - /** In this mode, the body's damping value is added to any value set in areas or the default value. */ - DAMP_MODE_COMBINE = 0, - - /** In this mode, the body's damping value replaces any value set in areas or the default value. */ - DAMP_MODE_REPLACE = 1, - } - enum CCDMode { - /** Continuous collision detection disabled. This is the fastest way to detect body collisions, but can miss small, fast-moving objects. */ - CCD_MODE_DISABLED = 0, - - /** Continuous collision detection enabled using raycasting. This is faster than shapecasting but less precise. */ - CCD_MODE_CAST_RAY = 1, - - /** Continuous collision detection enabled using shapecasting. This is the slowest CCD method and the most precise. */ - CCD_MODE_CAST_SHAPE = 2, - } - } - /** A 2D physics body that is moved by a physics simulation. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_rigidbody2d.html - */ - class RigidBody2D extends PhysicsBody2D { - constructor(identifier?: any) - /** Called during physics processing, allowing you to read and safely modify the simulation state for the object. By default, it is called before the standard force integration, but the [member custom_integrator] property allows you to disable the standard force integration and do fully custom force integration for a body. */ - /* gdvirtual */ _integrate_forces(state: PhysicsDirectBodyState2D): void - - /** Returns the number of contacts this body has with other bodies. By default, this returns 0 unless bodies are configured to monitor contacts (see [member contact_monitor]). - * - * **Note:** To retrieve the colliding bodies, use [method get_colliding_bodies]. - */ - get_contact_count(): int64 - - /** Sets the body's velocity on the given axis. The velocity in the given vector axis will be set as the given vector length. This is useful for jumping behavior. */ - set_axis_velocity(axis_velocity: Vector2): void - - /** Applies a directional impulse without affecting rotation. - * An impulse is time-independent! Applying an impulse every frame would result in a framerate-dependent force. For this reason, it should only be used when simulating one-time impacts (use the "_force" functions otherwise). - * This is equivalent to using [method apply_impulse] at the body's center of mass. - */ - apply_central_impulse(impulse: Vector2 = Vector2.ZERO): void - - /** Applies a positioned impulse to the body. - * An impulse is time-independent! Applying an impulse every frame would result in a framerate-dependent force. For this reason, it should only be used when simulating one-time impacts (use the "_force" functions otherwise). - * [param position] is the offset from the body origin in global coordinates. - */ - apply_impulse(impulse: Vector2, position: Vector2 = Vector2.ZERO): void - - /** Applies a rotational impulse to the body without affecting the position. - * An impulse is time-independent! Applying an impulse every frame would result in a framerate-dependent force. For this reason, it should only be used when simulating one-time impacts (use the "_force" functions otherwise). - * - * **Note:** [member inertia] is required for this to work. To have [member inertia], an active [CollisionShape2D] must be a child of the node, or you can manually set [member inertia]. - */ - apply_torque_impulse(torque: float64): void - - /** Applies a directional force without affecting rotation. A force is time dependent and meant to be applied every physics update. - * This is equivalent to using [method apply_force] at the body's center of mass. - */ - apply_central_force(force: Vector2): void - - /** Applies a positioned force to the body. A force is time dependent and meant to be applied every physics update. - * [param position] is the offset from the body origin in global coordinates. - */ - apply_force(force: Vector2, position: Vector2 = Vector2.ZERO): void - - /** Applies a rotational force without affecting position. A force is time dependent and meant to be applied every physics update. - * - * **Note:** [member inertia] is required for this to work. To have [member inertia], an active [CollisionShape2D] must be a child of the node, or you can manually set [member inertia]. - */ - apply_torque(torque: float64): void - - /** Adds a constant directional force without affecting rotation that keeps being applied over time until cleared with `constant_force = Vector2(0, 0)`. - * This is equivalent to using [method add_constant_force] at the body's center of mass. - */ - add_constant_central_force(force: Vector2): void - - /** Adds a constant positioned force to the body that keeps being applied over time until cleared with `constant_force = Vector2(0, 0)`. - * [param position] is the offset from the body origin in global coordinates. - */ - add_constant_force(force: Vector2, position: Vector2 = Vector2.ZERO): void - - /** Adds a constant rotational force without affecting position that keeps being applied over time until cleared with `constant_torque = 0`. */ - add_constant_torque(torque: float64): void - - /** Returns a list of the bodies colliding with this one. Requires [member contact_monitor] to be set to `true` and [member max_contacts_reported] to be set high enough to detect all the collisions. - * - * **Note:** The result of this test is not immediate after moving objects. For performance, list of collisions is updated once per frame and before the physics step. Consider using signals instead. - */ - get_colliding_bodies(): GArray - - /** The body's mass. */ - get mass(): float64 - set mass(value: float64) - - /** The physics material override for the body. - * If a material is assigned to this property, it will be used instead of any other physics material, such as an inherited one. - */ - get physics_material_override(): PhysicsMaterial - set physics_material_override(value: PhysicsMaterial) - - /** Multiplies the gravity applied to the body. The body's gravity is calculated from the **Default Gravity** value in **Project > Project Settings > Physics > 2d** and/or any additional gravity vector applied by [Area2D]s. */ - get gravity_scale(): float64 - set gravity_scale(value: float64) - - /** Defines the way the body's center of mass is set. See [enum CenterOfMassMode] for possible values. */ - get center_of_mass_mode(): int64 - set center_of_mass_mode(value: int64) - - /** The body's custom center of mass, relative to the body's origin position, when [member center_of_mass_mode] is set to [constant CENTER_OF_MASS_MODE_CUSTOM]. This is the balanced point of the body, where applied forces only cause linear acceleration. Applying forces outside of the center of mass causes angular acceleration. - * When [member center_of_mass_mode] is set to [constant CENTER_OF_MASS_MODE_AUTO] (default value), the center of mass is automatically computed. - */ - get center_of_mass(): Vector2 - set center_of_mass(value: Vector2) - - /** The body's moment of inertia. This is like mass, but for rotation: it determines how much torque it takes to rotate the body. The moment of inertia is usually computed automatically from the mass and the shapes, but this property allows you to set a custom value. - * If set to `0`, inertia is automatically computed (default value). - * - * **Note:** This value does not change when inertia is automatically computed. Use [PhysicsServer2D] to get the computed inertia. - * - */ - get inertia(): float64 - set inertia(value: float64) - - /** If `true`, the body will not move and will not calculate forces until woken up by another body through, for example, a collision, or by using the [method apply_impulse] or [method apply_force] methods. */ - get sleeping(): boolean - set sleeping(value: boolean) - - /** If `true`, the body can enter sleep mode when there is no movement. See [member sleeping]. */ - get can_sleep(): boolean - set can_sleep(value: boolean) - - /** If `true`, the body cannot rotate. Gravity and forces only apply linear movement. */ - get lock_rotation(): boolean - set lock_rotation(value: boolean) - - /** If `true`, the body is frozen. Gravity and forces are not applied anymore. - * See [member freeze_mode] to set the body's behavior when frozen. - * For a body that is always frozen, use [StaticBody2D] or [AnimatableBody2D] instead. - */ - get freeze(): boolean - set freeze(value: boolean) - - /** The body's freeze mode. Can be used to set the body's behavior when [member freeze] is enabled. See [enum FreezeMode] for possible values. - * For a body that is always frozen, use [StaticBody2D] or [AnimatableBody2D] instead. - */ - get freeze_mode(): int64 - set freeze_mode(value: int64) - - /** If `true`, the standard force integration (like gravity or damping) will be disabled for this body. Other than collision response, the body will only move as determined by the [method _integrate_forces] method, if that virtual method is overridden. - * Setting this property will call the method [method PhysicsServer2D.body_set_omit_force_integration] internally. - */ - get custom_integrator(): boolean - set custom_integrator(value: boolean) - - /** Continuous collision detection mode. - * Continuous collision detection tries to predict where a moving body will collide instead of moving it and correcting its movement after collision. Continuous collision detection is slower, but more precise and misses fewer collisions with small, fast-moving objects. Raycasting and shapecasting methods are available. See [enum CCDMode] for details. - */ - get continuous_cd(): int64 - set continuous_cd(value: int64) - - /** If `true`, the RigidBody2D will emit signals when it collides with another body. - * - * **Note:** By default the maximum contacts reported is set to 0, meaning nothing will be recorded, see [member max_contacts_reported]. - */ - get contact_monitor(): boolean - set contact_monitor(value: boolean) - - /** The maximum number of contacts that will be recorded. Requires a value greater than 0 and [member contact_monitor] to be set to `true` to start to register contacts. Use [method get_contact_count] to retrieve the count or [method get_colliding_bodies] to retrieve bodies that have been collided with. - * - * **Note:** The number of contacts is different from the number of collisions. Collisions between parallel edges will result in two contacts (one at each end), and collisions between parallel faces will result in four contacts (one at each corner). - */ - get max_contacts_reported(): int64 - set max_contacts_reported(value: int64) - - /** The body's linear velocity in pixels per second. Can be used sporadically, but **don't set this every frame**, because physics may run in another thread and runs at a different granularity. Use [method _integrate_forces] as your process loop for precise control of the body state. */ - get linear_velocity(): Vector2 - set linear_velocity(value: Vector2) - - /** Defines how [member linear_damp] is applied. See [enum DampMode] for possible values. */ - get linear_damp_mode(): int64 - set linear_damp_mode(value: int64) - - /** Damps the body's movement. By default, the body will use the **Default Linear Damp** in **Project > Project Settings > Physics > 2d** or any value override set by an [Area2D] the body is in. Depending on [member linear_damp_mode], you can set [member linear_damp] to be added to or to replace the body's damping value. - * See [member ProjectSettings.physics/2d/default_linear_damp] for more details about damping. - */ - get linear_damp(): float64 - set linear_damp(value: float64) - - /** The body's rotational velocity in *radians* per second. */ - get angular_velocity(): float64 - set angular_velocity(value: float64) - - /** Defines how [member angular_damp] is applied. See [enum DampMode] for possible values. */ - get angular_damp_mode(): int64 - set angular_damp_mode(value: int64) - - /** Damps the body's rotation. By default, the body will use the **Default Angular Damp** in **Project > Project Settings > Physics > 2d** or any value override set by an [Area2D] the body is in. Depending on [member angular_damp_mode], you can set [member angular_damp] to be added to or to replace the body's damping value. - * See [member ProjectSettings.physics/2d/default_angular_damp] for more details about damping. - */ - get angular_damp(): float64 - set angular_damp(value: float64) - - /** The body's total constant positional forces applied during each physics update. - * See [method add_constant_force] and [method add_constant_central_force]. - */ - get constant_force(): Vector2 - set constant_force(value: Vector2) - - /** The body's total constant rotational forces applied during each physics update. - * See [method add_constant_torque]. - */ - get constant_torque(): float64 - set constant_torque(value: float64) - - /** Emitted when one of this RigidBody2D's [Shape2D]s collides with another [PhysicsBody2D] or [TileMap]'s [Shape2D]s. Requires [member contact_monitor] to be set to `true` and [member max_contacts_reported] to be set high enough to detect all the collisions. [TileMap]s are detected if the [TileSet] has Collision [Shape2D]s. - * [param body_rid] the [RID] of the other [PhysicsBody2D] or [TileSet]'s [CollisionObject2D] used by the [PhysicsServer2D]. - * [param body] the [Node], if it exists in the tree, of the other [PhysicsBody2D] or [TileMap]. - * [param body_shape_index] the index of the [Shape2D] of the other [PhysicsBody2D] or [TileMap] used by the [PhysicsServer2D]. Get the [CollisionShape2D] node with `body.shape_owner_get_owner(body.shape_find_owner(body_shape_index))`. - * [param local_shape_index] the index of the [Shape2D] of this RigidBody2D used by the [PhysicsServer2D]. Get the [CollisionShape2D] node with `self.shape_owner_get_owner(self.shape_find_owner(local_shape_index))`. - */ - readonly body_shape_entered: Signal4 - - /** Emitted when the collision between one of this RigidBody2D's [Shape2D]s and another [PhysicsBody2D] or [TileMap]'s [Shape2D]s ends. Requires [member contact_monitor] to be set to `true` and [member max_contacts_reported] to be set high enough to detect all the collisions. [TileMap]s are detected if the [TileSet] has Collision [Shape2D]s. - * [param body_rid] the [RID] of the other [PhysicsBody2D] or [TileSet]'s [CollisionObject2D] used by the [PhysicsServer2D]. - * [param body] the [Node], if it exists in the tree, of the other [PhysicsBody2D] or [TileMap]. - * [param body_shape_index] the index of the [Shape2D] of the other [PhysicsBody2D] or [TileMap] used by the [PhysicsServer2D]. Get the [CollisionShape2D] node with `body.shape_owner_get_owner(body.shape_find_owner(body_shape_index))`. - * [param local_shape_index] the index of the [Shape2D] of this RigidBody2D used by the [PhysicsServer2D]. Get the [CollisionShape2D] node with `self.shape_owner_get_owner(self.shape_find_owner(local_shape_index))`. - */ - readonly body_shape_exited: Signal4 - - /** Emitted when a collision with another [PhysicsBody2D] or [TileMap] occurs. Requires [member contact_monitor] to be set to `true` and [member max_contacts_reported] to be set high enough to detect all the collisions. [TileMap]s are detected if the [TileSet] has Collision [Shape2D]s. - * [param body] the [Node], if it exists in the tree, of the other [PhysicsBody2D] or [TileMap]. - */ - readonly body_entered: Signal1 - - /** Emitted when the collision with another [PhysicsBody2D] or [TileMap] ends. Requires [member contact_monitor] to be set to `true` and [member max_contacts_reported] to be set high enough to detect all the collisions. [TileMap]s are detected if the [TileSet] has Collision [Shape2D]s. - * [param body] the [Node], if it exists in the tree, of the other [PhysicsBody2D] or [TileMap]. - */ - readonly body_exited: Signal1 - - /** Emitted when the physics engine changes the body's sleeping state. - * - * **Note:** Changing the value [member sleeping] will not trigger this signal. It is only emitted if the sleeping state is changed by the physics engine or `emit_signal("sleeping_state_changed")` is used. - */ - readonly sleeping_state_changed: Signal0 - } - namespace RigidBody3D { - enum FreezeMode { - /** Static body freeze mode (default). The body is not affected by gravity and forces. It can be only moved by user code and doesn't collide with other bodies along its path. */ - FREEZE_MODE_STATIC = 0, - - /** Kinematic body freeze mode. Similar to [constant FREEZE_MODE_STATIC], but collides with other bodies along its path when moved. Useful for a frozen body that needs to be animated. */ - FREEZE_MODE_KINEMATIC = 1, - } - enum CenterOfMassMode { - /** In this mode, the body's center of mass is calculated automatically based on its shapes. This assumes that the shapes' origins are also their center of mass. */ - CENTER_OF_MASS_MODE_AUTO = 0, - - /** In this mode, the body's center of mass is set through [member center_of_mass]. Defaults to the body's origin position. */ - CENTER_OF_MASS_MODE_CUSTOM = 1, - } - enum DampMode { - /** In this mode, the body's damping value is added to any value set in areas or the default value. */ - DAMP_MODE_COMBINE = 0, - - /** In this mode, the body's damping value replaces any value set in areas or the default value. */ - DAMP_MODE_REPLACE = 1, - } - } - /** A 3D physics body that is moved by a physics simulation. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_rigidbody3d.html - */ - class RigidBody3D extends PhysicsBody3D { - constructor(identifier?: any) - /** Called during physics processing, allowing you to read and safely modify the simulation state for the object. By default, it is called before the standard force integration, but the [member custom_integrator] property allows you to disable the standard force integration and do fully custom force integration for a body. */ - /* gdvirtual */ _integrate_forces(state: PhysicsDirectBodyState3D): void - - /** Returns the inverse inertia tensor basis. This is used to calculate the angular acceleration resulting from a torque applied to the [RigidBody3D]. */ - get_inverse_inertia_tensor(): Basis - - /** Returns the number of contacts this body has with other bodies. By default, this returns 0 unless bodies are configured to monitor contacts (see [member contact_monitor]). - * - * **Note:** To retrieve the colliding bodies, use [method get_colliding_bodies]. - */ - get_contact_count(): int64 - - /** Sets an axis velocity. The velocity in the given vector axis will be set as the given vector length. This is useful for jumping behavior. */ - set_axis_velocity(axis_velocity: Vector3): void - - /** Applies a directional impulse without affecting rotation. - * An impulse is time-independent! Applying an impulse every frame would result in a framerate-dependent force. For this reason, it should only be used when simulating one-time impacts (use the "_force" functions otherwise). - * This is equivalent to using [method apply_impulse] at the body's center of mass. - */ - apply_central_impulse(impulse: Vector3): void - - /** Applies a positioned impulse to the body. - * An impulse is time-independent! Applying an impulse every frame would result in a framerate-dependent force. For this reason, it should only be used when simulating one-time impacts (use the "_force" functions otherwise). - * [param position] is the offset from the body origin in global coordinates. - */ - apply_impulse(impulse: Vector3, position: Vector3 = new Vector3(0, 0, 0)): void - - /** Applies a rotational impulse to the body without affecting the position. - * An impulse is time-independent! Applying an impulse every frame would result in a framerate-dependent force. For this reason, it should only be used when simulating one-time impacts (use the "_force" functions otherwise). - * - * **Note:** [member inertia] is required for this to work. To have [member inertia], an active [CollisionShape3D] must be a child of the node, or you can manually set [member inertia]. - */ - apply_torque_impulse(impulse: Vector3): void - - /** Applies a directional force without affecting rotation. A force is time dependent and meant to be applied every physics update. - * This is equivalent to using [method apply_force] at the body's center of mass. - */ - apply_central_force(force: Vector3): void - - /** Applies a positioned force to the body. A force is time dependent and meant to be applied every physics update. - * [param position] is the offset from the body origin in global coordinates. - */ - apply_force(force: Vector3, position: Vector3 = new Vector3(0, 0, 0)): void - - /** Applies a rotational force without affecting position. A force is time dependent and meant to be applied every physics update. - * - * **Note:** [member inertia] is required for this to work. To have [member inertia], an active [CollisionShape3D] must be a child of the node, or you can manually set [member inertia]. - */ - apply_torque(torque: Vector3): void - - /** Adds a constant directional force without affecting rotation that keeps being applied over time until cleared with `constant_force = Vector3(0, 0, 0)`. - * This is equivalent to using [method add_constant_force] at the body's center of mass. - */ - add_constant_central_force(force: Vector3): void - - /** Adds a constant positioned force to the body that keeps being applied over time until cleared with `constant_force = Vector3(0, 0, 0)`. - * [param position] is the offset from the body origin in global coordinates. - */ - add_constant_force(force: Vector3, position: Vector3 = new Vector3(0, 0, 0)): void - - /** Adds a constant rotational force without affecting position that keeps being applied over time until cleared with `constant_torque = Vector3(0, 0, 0)`. */ - add_constant_torque(torque: Vector3): void - - /** Returns a list of the bodies colliding with this one. Requires [member contact_monitor] to be set to `true` and [member max_contacts_reported] to be set high enough to detect all the collisions. - * - * **Note:** The result of this test is not immediate after moving objects. For performance, list of collisions is updated once per frame and before the physics step. Consider using signals instead. - */ - get_colliding_bodies(): GArray - - /** The body's mass. */ - get mass(): float64 - set mass(value: float64) - - /** The physics material override for the body. - * If a material is assigned to this property, it will be used instead of any other physics material, such as an inherited one. - */ - get physics_material_override(): PhysicsMaterial - set physics_material_override(value: PhysicsMaterial) - - /** This is multiplied by the global 3D gravity setting found in **Project > Project Settings > Physics > 3d** to produce RigidBody3D's gravity. For example, a value of 1 will be normal gravity, 2 will apply double gravity, and 0.5 will apply half gravity to this object. */ - get gravity_scale(): float64 - set gravity_scale(value: float64) - - /** Defines the way the body's center of mass is set. See [enum CenterOfMassMode] for possible values. */ - get center_of_mass_mode(): int64 - set center_of_mass_mode(value: int64) - - /** The body's custom center of mass, relative to the body's origin position, when [member center_of_mass_mode] is set to [constant CENTER_OF_MASS_MODE_CUSTOM]. This is the balanced point of the body, where applied forces only cause linear acceleration. Applying forces outside of the center of mass causes angular acceleration. - * When [member center_of_mass_mode] is set to [constant CENTER_OF_MASS_MODE_AUTO] (default value), the center of mass is automatically computed. - */ - get center_of_mass(): Vector3 - set center_of_mass(value: Vector3) - - /** The body's moment of inertia. This is like mass, but for rotation: it determines how much torque it takes to rotate the body on each axis. The moment of inertia is usually computed automatically from the mass and the shapes, but this property allows you to set a custom value. - * If set to [constant Vector3.ZERO], inertia is automatically computed (default value). - * - * **Note:** This value does not change when inertia is automatically computed. Use [PhysicsServer3D] to get the computed inertia. - * - */ - get inertia(): Vector3 - set inertia(value: Vector3) - - /** If `true`, the body will not move and will not calculate forces until woken up by another body through, for example, a collision, or by using the [method apply_impulse] or [method apply_force] methods. */ - get sleeping(): boolean - set sleeping(value: boolean) - - /** If `true`, the body can enter sleep mode when there is no movement. See [member sleeping]. */ - get can_sleep(): boolean - set can_sleep(value: boolean) - - /** If `true`, the body cannot rotate. Gravity and forces only apply linear movement. */ - get lock_rotation(): boolean - set lock_rotation(value: boolean) - - /** If `true`, the body is frozen. Gravity and forces are not applied anymore. - * See [member freeze_mode] to set the body's behavior when frozen. - * For a body that is always frozen, use [StaticBody3D] or [AnimatableBody3D] instead. - */ - get freeze(): boolean - set freeze(value: boolean) - - /** The body's freeze mode. Can be used to set the body's behavior when [member freeze] is enabled. See [enum FreezeMode] for possible values. - * For a body that is always frozen, use [StaticBody3D] or [AnimatableBody3D] instead. - */ - get freeze_mode(): int64 - set freeze_mode(value: int64) - - /** If `true`, the standard force integration (like gravity or damping) will be disabled for this body. Other than collision response, the body will only move as determined by the [method _integrate_forces] method, if that virtual method is overridden. - * Setting this property will call the method [method PhysicsServer3D.body_set_omit_force_integration] internally. - */ - get custom_integrator(): boolean - set custom_integrator(value: boolean) - - /** If `true`, continuous collision detection is used. - * Continuous collision detection tries to predict where a moving body will collide, instead of moving it and correcting its movement if it collided. Continuous collision detection is more precise, and misses fewer impacts by small, fast-moving objects. Not using continuous collision detection is faster to compute, but can miss small, fast-moving objects. - */ - get continuous_cd(): boolean - set continuous_cd(value: boolean) - - /** If `true`, the RigidBody3D will emit signals when it collides with another body. - * - * **Note:** By default the maximum contacts reported is set to 0, meaning nothing will be recorded, see [member max_contacts_reported]. - */ - get contact_monitor(): boolean - set contact_monitor(value: boolean) - - /** The maximum number of contacts that will be recorded. Requires a value greater than 0 and [member contact_monitor] to be set to `true` to start to register contacts. Use [method get_contact_count] to retrieve the count or [method get_colliding_bodies] to retrieve bodies that have been collided with. - * - * **Note:** The number of contacts is different from the number of collisions. Collisions between parallel edges will result in two contacts (one at each end), and collisions between parallel faces will result in four contacts (one at each corner). - */ - get max_contacts_reported(): int64 - set max_contacts_reported(value: int64) - - /** The body's linear velocity in units per second. Can be used sporadically, but **don't set this every frame**, because physics may run in another thread and runs at a different granularity. Use [method _integrate_forces] as your process loop for precise control of the body state. */ - get linear_velocity(): Vector3 - set linear_velocity(value: Vector3) - - /** Defines how [member linear_damp] is applied. See [enum DampMode] for possible values. */ - get linear_damp_mode(): int64 - set linear_damp_mode(value: int64) - - /** Damps the body's movement. By default, the body will use the **Default Linear Damp** in **Project > Project Settings > Physics > 3d** or any value override set by an [Area3D] the body is in. Depending on [member linear_damp_mode], you can set [member linear_damp] to be added to or to replace the body's damping value. - * See [member ProjectSettings.physics/3d/default_linear_damp] for more details about damping. - */ - get linear_damp(): float64 - set linear_damp(value: float64) - - /** The RigidBody3D's rotational velocity in *radians* per second. */ - get angular_velocity(): Vector3 - set angular_velocity(value: Vector3) - - /** Defines how [member angular_damp] is applied. See [enum DampMode] for possible values. */ - get angular_damp_mode(): int64 - set angular_damp_mode(value: int64) - - /** Damps the body's rotation. By default, the body will use the **Default Angular Damp** in **Project > Project Settings > Physics > 3d** or any value override set by an [Area3D] the body is in. Depending on [member angular_damp_mode], you can set [member angular_damp] to be added to or to replace the body's damping value. - * See [member ProjectSettings.physics/3d/default_angular_damp] for more details about damping. - */ - get angular_damp(): float64 - set angular_damp(value: float64) - - /** The body's total constant positional forces applied during each physics update. - * See [method add_constant_force] and [method add_constant_central_force]. - */ - get constant_force(): Vector3 - set constant_force(value: Vector3) - - /** The body's total constant rotational forces applied during each physics update. - * See [method add_constant_torque]. - */ - get constant_torque(): Vector3 - set constant_torque(value: Vector3) - - /** Emitted when one of this RigidBody3D's [Shape3D]s collides with another [PhysicsBody3D] or [GridMap]'s [Shape3D]s. Requires [member contact_monitor] to be set to `true` and [member max_contacts_reported] to be set high enough to detect all the collisions. [GridMap]s are detected if the [MeshLibrary] has Collision [Shape3D]s. - * [param body_rid] the [RID] of the other [PhysicsBody3D] or [MeshLibrary]'s [CollisionObject3D] used by the [PhysicsServer3D]. - * [param body] the [Node], if it exists in the tree, of the other [PhysicsBody3D] or [GridMap]. - * [param body_shape_index] the index of the [Shape3D] of the other [PhysicsBody3D] or [GridMap] used by the [PhysicsServer3D]. Get the [CollisionShape3D] node with `body.shape_owner_get_owner(body.shape_find_owner(body_shape_index))`. - * [param local_shape_index] the index of the [Shape3D] of this RigidBody3D used by the [PhysicsServer3D]. Get the [CollisionShape3D] node with `self.shape_owner_get_owner(self.shape_find_owner(local_shape_index))`. - */ - readonly body_shape_entered: Signal4 - - /** Emitted when the collision between one of this RigidBody3D's [Shape3D]s and another [PhysicsBody3D] or [GridMap]'s [Shape3D]s ends. Requires [member contact_monitor] to be set to `true` and [member max_contacts_reported] to be set high enough to detect all the collisions. [GridMap]s are detected if the [MeshLibrary] has Collision [Shape3D]s. - * [param body_rid] the [RID] of the other [PhysicsBody3D] or [MeshLibrary]'s [CollisionObject3D] used by the [PhysicsServer3D]. [GridMap]s are detected if the Meshes have [Shape3D]s. - * [param body] the [Node], if it exists in the tree, of the other [PhysicsBody3D] or [GridMap]. - * [param body_shape_index] the index of the [Shape3D] of the other [PhysicsBody3D] or [GridMap] used by the [PhysicsServer3D]. Get the [CollisionShape3D] node with `body.shape_owner_get_owner(body.shape_find_owner(body_shape_index))`. - * [param local_shape_index] the index of the [Shape3D] of this RigidBody3D used by the [PhysicsServer3D]. Get the [CollisionShape3D] node with `self.shape_owner_get_owner(self.shape_find_owner(local_shape_index))`. - */ - readonly body_shape_exited: Signal4 - - /** Emitted when a collision with another [PhysicsBody3D] or [GridMap] occurs. Requires [member contact_monitor] to be set to `true` and [member max_contacts_reported] to be set high enough to detect all the collisions. [GridMap]s are detected if the [MeshLibrary] has Collision [Shape3D]s. - * [param body] the [Node], if it exists in the tree, of the other [PhysicsBody3D] or [GridMap]. - */ - readonly body_entered: Signal1 - - /** Emitted when the collision with another [PhysicsBody3D] or [GridMap] ends. Requires [member contact_monitor] to be set to `true` and [member max_contacts_reported] to be set high enough to detect all the collisions. [GridMap]s are detected if the [MeshLibrary] has Collision [Shape3D]s. - * [param body] the [Node], if it exists in the tree, of the other [PhysicsBody3D] or [GridMap]. - */ - readonly body_exited: Signal1 - - /** Emitted when the physics engine changes the body's sleeping state. - * - * **Note:** Changing the value [member sleeping] will not trigger this signal. It is only emitted if the sleeping state is changed by the physics engine or `emit_signal("sleeping_state_changed")` is used. - */ - readonly sleeping_state_changed: Signal0 - } - /** Editor-only helper for setting up root motion in [AnimationMixer]. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_rootmotionview.html - */ - class RootMotionView extends VisualInstance3D { - constructor(identifier?: any) - /** Path to an [AnimationMixer] node to use as a basis for root motion. */ - get animation_path(): NodePath - set animation_path(value: NodePath | string) - - /** The grid's color. */ - get color(): Color - set color(value: Color) - - /** The grid's cell size in 3D units. */ - get cell_size(): float64 - set cell_size(value: float64) - - /** The grid's radius in 3D units. The grid's opacity will fade gradually as the distance from the origin increases until this [member radius] is reached. */ - get radius(): float64 - set radius(value: float64) - - /** If `true`, the grid's points will all be on the same Y coordinate ( *local* Y = 0). If `false`, the points' original Y coordinate is preserved. */ - get zero_y(): boolean - set zero_y(value: boolean) - } - class RunInstancesDialog extends AcceptDialog { - constructor(identifier?: any) - } - class SceneCacheInterface extends RefCounted { - constructor(identifier?: any) - } - class SceneCreateDialog extends ConfirmationDialog { - constructor(identifier?: any) - } - class SceneExporterGLTFPlugin extends EditorPlugin { - constructor(identifier?: any) - } - class SceneImportSettingsData extends Object { - constructor(identifier?: any) - } - class SceneImportSettingsDialog extends ConfirmationDialog { - constructor(identifier?: any) - } - /** High-level multiplayer API implementation. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_scenemultiplayer.html - */ - class SceneMultiplayer extends MultiplayerAPI { - constructor(identifier?: any) - /** Clears the current SceneMultiplayer network state (you shouldn't call this unless you know what you are doing). */ - clear(): void - - /** Disconnects the peer identified by [param id], removing it from the list of connected peers, and closing the underlying connection with it. */ - disconnect_peer(id: int64): void - - /** Returns the IDs of the peers currently trying to authenticate with this [MultiplayerAPI]. */ - get_authenticating_peers(): PackedInt32Array - - /** Sends the specified [param data] to the remote peer identified by [param id] as part of an authentication message. This can be used to authenticate peers, and control when [signal MultiplayerAPI.peer_connected] is emitted (and the remote peer accepted as one of the connected peers). */ - send_auth(id: int64, data: PackedByteArray | byte[] | ArrayBuffer): GError - - /** Mark the authentication step as completed for the remote peer identified by [param id]. The [signal MultiplayerAPI.peer_connected] signal will be emitted for this peer once the remote side also completes the authentication. No further authentication messages are expected to be received from this peer. - * If a peer disconnects before completing authentication, either due to a network issue, the [member auth_timeout] expiring, or manually calling [method disconnect_peer], the [signal peer_authentication_failed] signal will be emitted instead of [signal MultiplayerAPI.peer_disconnected]. - */ - complete_auth(id: int64): GError - - /** Sends the given raw [param bytes] to a specific peer identified by [param id] (see [method MultiplayerPeer.set_target_peer]). Default ID is `0`, i.e. broadcast to all peers. */ - send_bytes(bytes: PackedByteArray | byte[] | ArrayBuffer, id: int64 = 0, mode: MultiplayerPeer.TransferMode = 2, channel: int64 = 0): GError - - /** The root path to use for RPCs and replication. Instead of an absolute path, a relative path will be used to find the node upon which the RPC should be executed. - * This effectively allows to have different branches of the scene tree to be managed by different MultiplayerAPI, allowing for example to run both client and server in the same scene. - */ - get root_path(): NodePath - set root_path(value: NodePath | string) - - /** The callback to execute when when receiving authentication data sent via [method send_auth]. If the [Callable] is empty (default), peers will be automatically accepted as soon as they connect. */ - get auth_callback(): Callable - set auth_callback(value: Callable) - - /** If set to a value greater than `0.0`, the maximum amount of time peers can stay in the authenticating state, after which the authentication will automatically fail. See the [signal peer_authenticating] and [signal peer_authentication_failed] signals. */ - get auth_timeout(): float64 - set auth_timeout(value: float64) - - /** If `true`, the MultiplayerAPI will allow encoding and decoding of object during RPCs. - * **Warning:** Deserialized objects can contain code which gets executed. Do not use this option if the serialized object comes from untrusted sources to avoid potential security threat such as remote code execution. - */ - get allow_object_decoding(): boolean - set allow_object_decoding(value: boolean) - - /** If `true`, the MultiplayerAPI's [member MultiplayerAPI.multiplayer_peer] refuses new incoming connections. */ - get refuse_new_connections(): boolean - set refuse_new_connections(value: boolean) - - /** Enable or disable the server feature that notifies clients of other peers' connection/disconnection, and relays messages between them. When this option is `false`, clients won't be automatically notified of other peers and won't be able to send them packets through the server. - * - * **Note:** Changing this option while other peers are connected may lead to unexpected behaviors. - * - * **Note:** Support for this feature may depend on the current [MultiplayerPeer] configuration. See [method MultiplayerPeer.is_server_relay_supported]. - */ - get server_relay(): boolean - set server_relay(value: boolean) - - /** Maximum size of each synchronization packet. Higher values increase the chance of receiving full updates in a single frame, but also the chance of packet loss. See [MultiplayerSynchronizer]. */ - get max_sync_packet_size(): int64 - set max_sync_packet_size(value: int64) - - /** Maximum size of each delta packet. Higher values increase the chance of receiving full updates in a single frame, but also the chance of causing networking congestion (higher latency, disconnections). See [MultiplayerSynchronizer]. */ - get max_delta_packet_size(): int64 - set max_delta_packet_size(value: int64) - - /** Emitted when this MultiplayerAPI's [member MultiplayerAPI.multiplayer_peer] connects to a new peer and a valid [member auth_callback] is set. In this case, the [signal MultiplayerAPI.peer_connected] will not be emitted until [method complete_auth] is called with given peer [param id]. While in this state, the peer will not be included in the list returned by [method MultiplayerAPI.get_peers] (but in the one returned by [method get_authenticating_peers]), and only authentication data will be sent or received. See [method send_auth] for sending authentication data. */ - readonly peer_authenticating: Signal1 - - /** Emitted when this MultiplayerAPI's [member MultiplayerAPI.multiplayer_peer] disconnects from a peer for which authentication had not yet completed. See [signal peer_authenticating]. */ - readonly peer_authentication_failed: Signal1 - - /** Emitted when this MultiplayerAPI's [member MultiplayerAPI.multiplayer_peer] receives a [param packet] with custom data (see [method send_bytes]). ID is the peer ID of the peer that sent the packet. */ - readonly peer_packet: Signal2 - } - class SceneRPCInterface extends RefCounted { - constructor(identifier?: any) - } - namespace SceneReplicationConfig { - enum ReplicationMode { - /** Do not keep the given property synchronized. */ - REPLICATION_MODE_NEVER = 0, - - /** Replicate the given property on process by constantly sending updates using unreliable transfer mode. */ - REPLICATION_MODE_ALWAYS = 1, - - /** Replicate the given property on process by sending updates using reliable transfer mode when its value changes. */ - REPLICATION_MODE_ON_CHANGE = 2, - } - } - /** Configuration for properties to synchronize with a [MultiplayerSynchronizer]. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_scenereplicationconfig.html - */ - class SceneReplicationConfig extends Resource { - constructor(identifier?: any) - /** Returns a list of synchronized property [NodePath]s. */ - get_properties(): GArray - - /** Adds the property identified by the given [param path] to the list of the properties being synchronized, optionally passing an [param index]. - * - * **Note:** For details on restrictions and limitations on property synchronization, see [MultiplayerSynchronizer]. - */ - add_property(path: NodePath | string, index: int64 = -1): void - - /** Returns `true` if the given [param path] is configured for synchronization. */ - has_property(path: NodePath | string): boolean - - /** Removes the property identified by the given [param path] from the configuration. */ - remove_property(path: NodePath | string): void - - /** Finds the index of the given [param path]. */ - property_get_index(path: NodePath | string): int64 - - /** Returns `true` if the property identified by the given [param path] is configured to be synchronized on spawn. */ - property_get_spawn(path: NodePath | string): boolean - - /** Sets whether the property identified by the given [param path] is configured to be synchronized on spawn. */ - property_set_spawn(path: NodePath | string, enabled: boolean): void - - /** Returns the replication mode for the property identified by the given [param path]. See [enum ReplicationMode]. */ - property_get_replication_mode(path: NodePath | string): SceneReplicationConfig.ReplicationMode - - /** Sets the synchronization mode for the property identified by the given [param path]. See [enum ReplicationMode]. */ - property_set_replication_mode(path: NodePath | string, mode: SceneReplicationConfig.ReplicationMode): void - - /** Returns `true` if the property identified by the given [param path] is configured to be synchronized on process. */ - property_get_sync(path: NodePath | string): boolean - - /** Sets whether the property identified by the given [param path] is configured to be synchronized on process. */ - property_set_sync(path: NodePath | string, enabled: boolean): void - - /** Returns `true` if the property identified by the given [param path] is configured to be reliably synchronized when changes are detected on process. */ - property_get_watch(path: NodePath | string): boolean - - /** Sets whether the property identified by the given [param path] is configured to be reliably synchronized when changes are detected on process. */ - property_set_watch(path: NodePath | string, enabled: boolean): void - } - class SceneReplicationInterface extends RefCounted { - constructor(identifier?: any) - } - namespace SceneState { - enum GenEditState { - /** If passed to [method PackedScene.instantiate], blocks edits to the scene state. */ - GEN_EDIT_STATE_DISABLED = 0, - - /** If passed to [method PackedScene.instantiate], provides inherited scene resources to the local scene. - * - * **Note:** Only available in editor builds. - */ - GEN_EDIT_STATE_INSTANCE = 1, - - /** If passed to [method PackedScene.instantiate], provides local scene resources to the local scene. Only the main scene should receive the main edit state. - * - * **Note:** Only available in editor builds. - */ - GEN_EDIT_STATE_MAIN = 2, - - /** If passed to [method PackedScene.instantiate], it's similar to [constant GEN_EDIT_STATE_MAIN], but for the case where the scene is being instantiated to be the base of another one. - * - * **Note:** Only available in editor builds. - */ - GEN_EDIT_STATE_MAIN_INHERITED = 3, - } - } - /** Provides access to a scene file's information. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_scenestate.html - */ - class SceneState extends RefCounted { - constructor(identifier?: any) - /** Returns the number of nodes in the scene. - * The `idx` argument used to query node data in other `get_node_*` methods in the interval `[0, get_node_count() - 1]`. - */ - get_node_count(): int64 - - /** Returns the type of the node at [param idx]. */ - get_node_type(idx: int64): StringName - - /** Returns the name of the node at [param idx]. */ - get_node_name(idx: int64): StringName - - /** Returns the path to the node at [param idx]. - * If [param for_parent] is `true`, returns the path of the [param idx] node's parent instead. - */ - get_node_path(idx: int64, for_parent: boolean = false): NodePath - - /** Returns the path to the owner of the node at [param idx], relative to the root node. */ - get_node_owner_path(idx: int64): NodePath - - /** Returns `true` if the node at [param idx] is an [InstancePlaceholder]. */ - is_node_instance_placeholder(idx: int64): boolean - - /** Returns the path to the represented scene file if the node at [param idx] is an [InstancePlaceholder]. */ - get_node_instance_placeholder(idx: int64): string - - /** Returns a [PackedScene] for the node at [param idx] (i.e. the whole branch starting at this node, with its child nodes and resources), or `null` if the node is not an instance. */ - get_node_instance(idx: int64): PackedScene - - /** Returns the list of group names associated with the node at [param idx]. */ - get_node_groups(idx: int64): PackedStringArray - - /** Returns the node's index, which is its position relative to its siblings. This is only relevant and saved in scenes for cases where new nodes are added to an instantiated or inherited scene among siblings from the base scene. Despite the name, this index is not related to the [param idx] argument used here and in other methods. */ - get_node_index(idx: int64): int64 - - /** Returns the number of exported or overridden properties for the node at [param idx]. - * The `prop_idx` argument used to query node property data in other `get_node_property_*` methods in the interval `[0, get_node_property_count() - 1]`. - */ - get_node_property_count(idx: int64): int64 - - /** Returns the name of the property at [param prop_idx] for the node at [param idx]. */ - get_node_property_name(idx: int64, prop_idx: int64): StringName - - /** Returns the value of the property at [param prop_idx] for the node at [param idx]. */ - get_node_property_value(idx: int64, prop_idx: int64): any - - /** Returns the number of signal connections in the scene. - * The `idx` argument used to query connection metadata in other `get_connection_*` methods in the interval `[0, get_connection_count() - 1]`. - */ - get_connection_count(): int64 - - /** Returns the path to the node that owns the signal at [param idx], relative to the root node. */ - get_connection_source(idx: int64): NodePath - - /** Returns the name of the signal at [param idx]. */ - get_connection_signal(idx: int64): StringName - - /** Returns the path to the node that owns the method connected to the signal at [param idx], relative to the root node. */ - get_connection_target(idx: int64): NodePath - - /** Returns the method connected to the signal at [param idx]. */ - get_connection_method(idx: int64): StringName - - /** Returns the connection flags for the signal at [param idx]. See [enum Object.ConnectFlags] constants. */ - get_connection_flags(idx: int64): int64 - - /** Returns the list of bound parameters for the signal at [param idx]. */ - get_connection_binds(idx: int64): GArray - - /** Returns the number of unbound parameters for the signal at [param idx]. */ - get_connection_unbinds(idx: int64): int64 - } - class SceneTileProxyObject extends Object { - constructor(identifier?: any) - readonly changed: Signal1 - } - namespace SceneTree { - enum GroupCallFlags { - /** Call nodes within a group with no special behavior (default). */ - GROUP_CALL_DEFAULT = 0, - - /** Call nodes within a group in reverse tree hierarchy order (all nested children are called before their respective parent nodes). */ - GROUP_CALL_REVERSE = 1, - - /** Call nodes within a group at the end of the current frame (can be either process or physics frame), similar to [method Object.call_deferred]. */ - GROUP_CALL_DEFERRED = 2, - - /** Call nodes within a group only once, even if the call is executed many times in the same frame. Must be combined with [constant GROUP_CALL_DEFERRED] to work. - * - * **Note:** Different arguments are not taken into account. Therefore, when the same call is executed with different arguments, only the first call will be performed. - */ - GROUP_CALL_UNIQUE = 4, - } - } - /** Manages the game loop via a hierarchy of nodes. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_scenetree.html - */ - class SceneTree extends MainLoop { - constructor(identifier?: any) - /** Returns `true` if a node added to the given group [param name] exists in the tree. */ - has_group(name: StringName): boolean - - /** Returns a new [SceneTreeTimer]. After [param time_sec] in seconds have passed, the timer will emit [signal SceneTreeTimer.timeout] and will be automatically freed. - * If [param process_always] is `false`, the timer will be paused when setting [member SceneTree.paused] to `true`. - * If [param process_in_physics] is `true`, the timer will update at the end of the physics frame, instead of the process frame. - * If [param ignore_time_scale] is `true`, the timer will ignore [member Engine.time_scale] and update with the real, elapsed time. - * This method is commonly used to create a one-shot delay timer, as in the following example: - * - * - * **Note:** The timer is always updated *after* all of the nodes in the tree. A node's [method Node._process] method would be called before the timer updates (or [method Node._physics_process] if [param process_in_physics] is set to `true`). - */ - create_timer(time_sec: float64, process_always: boolean = true, process_in_physics: boolean = false, ignore_time_scale: boolean = false): SceneTreeTimer - - /** Creates and returns a new [Tween] processed in this tree. The Tween will start automatically on the next process frame or physics frame (depending on its [enum Tween.TweenProcessMode]). - * - * **Note:** A [Tween] created using this method is not bound to any [Node]. It may keep working until there is nothing left to animate. If you want the [Tween] to be automatically killed when the [Node] is freed, use [method Node.create_tween] or [method Tween.bind_node]. - */ - create_tween(): Tween - - /** Returns an [Array] of currently existing [Tween]s in the tree, including paused tweens. */ - get_processed_tweens(): GArray - - /** Returns the number of nodes inside this tree. */ - get_node_count(): int64 - - /** Returns how many frames have been processed, since the application started. This is *not* a measurement of elapsed time. */ - get_frame(): int64 - - /** Quits the application at the end of the current iteration, with the given [param exit_code]. - * By convention, an exit code of `0` indicates success, whereas any other exit code indicates an error. For portability reasons, it should be between `0` and `125` (inclusive). - * - * **Note:** On iOS this method doesn't work. Instead, as recommended by the [url=https://developer.apple.com/library/archive/qa/qa1561/_index.html]iOS Human Interface Guidelines[/url], the user is expected to close apps via the Home button. - */ - quit(exit_code: int64 = 0): void - - /** Queues the given [param obj] to be deleted, calling its [method Object.free] at the end of the current frame. This method is similar to [method Node.queue_free]. */ - queue_delete(obj: Object): void - - /** Calls the given [param method] on each node inside this tree added to the given [param group]. Use [param flags] to customize this method's behavior (see [enum GroupCallFlags]). Additional arguments for [param method] can be passed at the end of this method. Nodes that cannot call [param method] (either because the method doesn't exist or the arguments do not match) are ignored. - * - * - * **Note:** In C#, [param method] must be in snake_case when referring to built-in Godot methods. Prefer using the names exposed in the `MethodName` class to avoid allocating a new [StringName] on each call. - */ - call_group_flags(flags: int64, group: StringName, method: StringName, ...vargargs: any[]): void - - /** Calls [method Object.notification] with the given [param notification] to all nodes inside this tree added to the [param group]. Use [param call_flags] to customize this method's behavior (see [enum GroupCallFlags]). */ - notify_group_flags(call_flags: int64, group: StringName, notification: int64): void - - /** Sets the given [param property] to [param value] on all nodes inside this tree added to the given [param group]. Nodes that do not have the [param property] are ignored. Use [param call_flags] to customize this method's behavior (see [enum GroupCallFlags]). - * - * **Note:** In C#, [param property] must be in snake_case when referring to built-in Godot properties. Prefer using the names exposed in the `PropertyName` class to avoid allocating a new [StringName] on each call. - */ - set_group_flags(call_flags: int64, group: StringName, property: string, value: any): void - - /** Calls [param method] on each node inside this tree added to the given [param group]. You can pass arguments to [param method] by specifying them at the end of this method call. Nodes that cannot call [param method] (either because the method doesn't exist or the arguments do not match) are ignored. See also [method set_group] and [method notify_group]. - * - * **Note:** This method acts immediately on all selected nodes at once, which may cause stuttering in some performance-intensive situations. - * - * **Note:** In C#, [param method] must be in snake_case when referring to built-in Godot methods. Prefer using the names exposed in the `MethodName` class to avoid allocating a new [StringName] on each call. - */ - call_group(group: StringName, method: StringName, ...vargargs: any[]): void - - /** Calls [method Object.notification] with the given [param notification] to all nodes inside this tree added to the [param group]. See also [url=https://docs.godotengine.org/en/4.3/tutorials/best_practices/godot_notifications.html]Godot notifications[/url] and [method call_group] and [method set_group]. - * - * **Note:** This method acts immediately on all selected nodes at once, which may cause stuttering in some performance-intensive situations. - */ - notify_group(group: StringName, notification: int64): void - - /** Sets the given [param property] to [param value] on all nodes inside this tree added to the given [param group]. Nodes that do not have the [param property] are ignored. See also [method call_group] and [method notify_group]. - * - * **Note:** This method acts immediately on all selected nodes at once, which may cause stuttering in some performance-intensive situations. - * - * **Note:** In C#, [param property] must be in snake_case when referring to built-in Godot properties. Prefer using the names exposed in the `PropertyName` class to avoid allocating a new [StringName] on each call. - */ - set_group(group: StringName, property: string, value: any): void - - /** Returns an [Array] containing all nodes inside this tree, that have been added to the given [param group], in scene hierarchy order. */ - get_nodes_in_group(group: StringName): GArray - - /** Returns the first [Node] found inside the tree, that has been added to the given [param group], in scene hierarchy order. Returns `null` if no match is found. See also [method get_nodes_in_group]. */ - get_first_node_in_group(group: StringName): Node - - /** Returns the number of nodes assigned to the given group. */ - get_node_count_in_group(group: StringName): int64 - - /** Changes the running scene to the one at the given [param path], after loading it into a [PackedScene] and creating a new instance. - * Returns [constant OK] on success, [constant ERR_CANT_OPEN] if the [param path] cannot be loaded into a [PackedScene], or [constant ERR_CANT_CREATE] if that scene cannot be instantiated. - * - * **Note:** See [method change_scene_to_packed] for details on the order of operations. - */ - change_scene_to_file(path: string): GError - - /** Changes the running scene to a new instance of the given [PackedScene] (which must be valid). - * Returns [constant OK] on success, [constant ERR_CANT_CREATE] if the scene cannot be instantiated, or [constant ERR_INVALID_PARAMETER] if the scene is invalid. - * - * **Note:** Operations happen in the following order when [method change_scene_to_packed] is called: - * 1. The current scene node is immediately removed from the tree. From that point, [method Node.get_tree] called on the current (outgoing) scene will return `null`. [member current_scene] will be `null`, too, because the new scene is not available yet. - * 2. At the end of the frame, the formerly current scene, already removed from the tree, will be deleted (freed from memory) and then the new scene will be instantiated and added to the tree. [method Node.get_tree] and [member current_scene] will be back to working as usual. - * This ensures that both scenes aren't running at the same time, while still freeing the previous scene in a safe way similar to [method Node.queue_free]. - */ - change_scene_to_packed(packed_scene: PackedScene): GError - - /** Reloads the currently active scene, replacing [member current_scene] with a new instance of its original [PackedScene]. - * Returns [constant OK] on success, [constant ERR_UNCONFIGURED] if no [member current_scene] is defined, [constant ERR_CANT_OPEN] if [member current_scene] cannot be loaded into a [PackedScene], or [constant ERR_CANT_CREATE] if the scene cannot be instantiated. - */ - reload_current_scene(): GError - - /** If a current scene is loaded, calling this method will unload it. */ - unload_current_scene(): void - - /** Sets a custom [MultiplayerAPI] with the given [param root_path] (controlling also the relative subpaths), or override the default one if [param root_path] is empty. - * - * **Note:** No [MultiplayerAPI] must be configured for the subpath containing [param root_path], nested custom multiplayers are not allowed. I.e. if one is configured for `"/root/Foo"` setting one for `"/root/Foo/Bar"` will cause an error. - */ - set_multiplayer(multiplayer: MultiplayerAPI, root_path: NodePath | string = ''): void - - /** Searches for the [MultiplayerAPI] configured for the given path, if one does not exist it searches the parent paths until one is found. If the path is empty, or none is found, the default one is returned. See [method set_multiplayer]. */ - get_multiplayer(for_path: NodePath | string = ''): MultiplayerAPI - - /** If `true`, the application automatically accepts quitting requests. - * For mobile platforms, see [member quit_on_go_back]. - */ - get auto_accept_quit(): boolean - set auto_accept_quit(value: boolean) - - /** If `true`, the application quits automatically when navigating back (e.g. using the system "Back" button on Android). - * To handle 'Go Back' button when this option is disabled, use [constant DisplayServer.WINDOW_EVENT_GO_BACK_REQUEST]. - */ - get quit_on_go_back(): boolean - set quit_on_go_back(value: boolean) - - /** If `true`, collision shapes will be visible when running the game from the editor for debugging purposes. - * - * **Note:** This property is not designed to be changed at run-time. Changing the value of [member debug_collisions_hint] while the project is running will not have the desired effect. - */ - get debug_collisions_hint(): boolean - set debug_collisions_hint(value: boolean) - - /** If `true`, curves from [Path2D] and [Path3D] nodes will be visible when running the game from the editor for debugging purposes. - * - * **Note:** This property is not designed to be changed at run-time. Changing the value of [member debug_paths_hint] while the project is running will not have the desired effect. - */ - get debug_paths_hint(): boolean - set debug_paths_hint(value: boolean) - - /** If `true`, navigation polygons will be visible when running the game from the editor for debugging purposes. - * - * **Note:** This property is not designed to be changed at run-time. Changing the value of [member debug_navigation_hint] while the project is running will not have the desired effect. - */ - get debug_navigation_hint(): boolean - set debug_navigation_hint(value: boolean) - - /** If `true`, the scene tree is considered paused. This causes the following behavior: - * - 2D and 3D physics will be stopped, as well as collision detection and related signals. - * - Depending on each node's [member Node.process_mode], their [method Node._process], [method Node._physics_process] and [method Node._input] callback methods may not called anymore. - */ - get paused(): boolean - set paused(value: boolean) - - /** The root of the scene currently being edited in the editor. This is usually a direct child of [member root]. - * - * **Note:** This property does nothing in release builds. - */ - get edited_scene_root(): Node - set edited_scene_root(value: Node) - - /** The root node of the currently loaded main scene, usually as a direct child of [member root]. See also [method change_scene_to_file], [method change_scene_to_packed], and [method reload_current_scene]. - * **Warning:** Setting this property directly may not work as expected, as it does *not* add or remove any nodes from this tree. - */ - get current_scene(): Node - set current_scene(value: Node) - - /** The tree's root [Window]. This is top-most [Node] of the scene tree, and is always present. An absolute [NodePath] always starts from this node. Children of the root node may include the loaded [member current_scene], as well as any [url=https://docs.godotengine.org/en/4.3/tutorials/scripting/singletons_autoload.html]AutoLoad[/url] configured in the Project Settings. - * **Warning:** Do not delete this node. This will result in unstable behavior, followed by a crash. - */ - get root(): Node - - /** If `true` (default value), enables automatic polling of the [MultiplayerAPI] for this SceneTree during [signal process_frame]. - * If `false`, you need to manually call [method MultiplayerAPI.poll] to process network packets and deliver RPCs. This allows running RPCs in a different loop (e.g. physics, thread, specific time step) and for manual [Mutex] protection when accessing the [MultiplayerAPI] from threads. - */ - get multiplayer_poll(): boolean - set multiplayer_poll(value: boolean) - - /** If `true`, the renderer will interpolate the transforms of physics objects between the last two transforms, so that smooth motion is seen even when physics ticks do not coincide with rendered frames. - * The default value of this property is controlled by [member ProjectSettings.physics/common/physics_interpolation]. - */ - get physics_interpolation(): boolean - set physics_interpolation(value: boolean) - - /** Emitted any time the tree's hierarchy changes (nodes being moved, renamed, etc.). */ - readonly tree_changed: Signal0 - - /** Emitted when the [member Node.process_mode] of any node inside the tree is changed. Only emitted in the editor, to update the visibility of disabled nodes. */ - readonly tree_process_mode_changed: Signal0 - - /** Emitted when the [param node] enters this tree. */ - readonly node_added: Signal1 - - /** Emitted when the [param node] exits this tree. */ - readonly node_removed: Signal1 - - /** Emitted when the [param node]'s [member Node.name] is changed. */ - readonly node_renamed: Signal1 - - /** Emitted when the [param node]'s [method Node.update_configuration_warnings] is called. Only emitted in the editor. */ - readonly node_configuration_warning_changed: Signal1 - - /** Emitted immediately before [method Node._process] is called on every node in this tree. */ - readonly process_frame: Signal0 - - /** Emitted immediately before [method Node._physics_process] is called on every node in this tree. */ - readonly physics_frame: Signal0 - } - class SceneTreeDialog extends ConfirmationDialog { - constructor(identifier?: any) - _cancel(): void - readonly selected: Signal1 - } - class SceneTreeDock extends VBoxContainer { - constructor(identifier?: any) - _post_do_create(_unnamed_arg0: Node): void - _set_owners(_unnamed_arg0: Node, _unnamed_arg1: GArray): void - _reparent_nodes_to_root(_unnamed_arg0: Node, _unnamed_arg1: GArray, _unnamed_arg2: Node): void - _reparent_nodes_to_paths_with_transform_and_name(_unnamed_arg0: Node, _unnamed_arg1: GArray, _unnamed_arg2: GArray, _unnamed_arg3: GArray, _unnamed_arg4: GArray, _unnamed_arg5: Node): void - _update_script_button(): void - instantiate(_unnamed_arg0: string): void - get_tree_editor(): SceneTreeEditor - replace_node(_unnamed_arg0: Node, _unnamed_arg1: Node, _unnamed_arg2: boolean, _unnamed_arg3: boolean): void - readonly remote_tree_selected: Signal0 - readonly add_node_used: Signal0 - readonly node_created: Signal1 - } - class SceneTreeEditor extends Control { - constructor(identifier?: any) - _update_tree(_unnamed_arg0: boolean = false): void - update_tree(): void - readonly node_selected: Signal0 - readonly node_renamed: Signal0 - readonly node_prerename: Signal0 - readonly node_changed: Signal0 - readonly nodes_dragged: Signal0 - readonly nodes_rearranged: Signal3 - readonly files_dropped: Signal3 - readonly script_dropped: Signal2 - readonly rmb_pressed: Signal1 - readonly open: Signal0 - readonly open_script: Signal0 - } - /** One-shot timer. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_scenetreetimer.html - */ - class SceneTreeTimer extends RefCounted { - constructor(identifier?: any) - /** The time remaining (in seconds). */ - get time_left(): float64 - set time_left(value: float64) - - /** Emitted when the timer reaches 0. */ - readonly timeout: Signal0 - } - class ScreenSelect extends Button { - constructor(identifier?: any) - readonly request_open_in_screen: Signal1 - } - /** A class stored as a resource. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_script.html - */ - class Script extends Resource { - constructor(identifier?: any) - /** Returns `true` if the script can be instantiated. */ - can_instantiate(): boolean - - /** Returns `true` if [param base_object] is an instance of this script. */ - instance_has(base_object: Object): boolean - - /** Returns `true` if the script contains non-empty source code. - * - * **Note:** If a script does not have source code, this does not mean that it is invalid or unusable. For example, a [GDScript] that was exported with binary tokenization has no source code, but still behaves as expected and could be instantiated. This can be checked with [method can_instantiate]. - */ - has_source_code(): boolean - - /** Reloads the script's class implementation. Returns an error code. */ - reload(keep_state: boolean = false): GError - - /** Returns the script directly inherited by this script. */ - get_base_script(): Script - - /** Returns the script's base type. */ - get_instance_base_type(): StringName - - /** Returns the class name associated with the script, if there is one. Returns an empty string otherwise. - * To give the script a global name, you can use the `class_name` keyword in GDScript and the `[GlobalClass]` attribute in C#. - * - */ - get_global_name(): StringName - - /** Returns `true` if the script, or a base class, defines a signal with the given name. */ - has_script_signal(signal_name: StringName): boolean - - /** Returns the list of properties in this [Script]. */ - get_script_property_list(): GArray - - /** Returns the list of methods in this [Script]. */ - get_script_method_list(): GArray - - /** Returns the list of user signals defined in this [Script]. */ - get_script_signal_list(): GArray - - /** Returns a dictionary containing constant names and their values. */ - get_script_constant_map(): GDictionary - - /** Returns the default value of the specified property. */ - get_property_default_value(property: StringName): any - - /** Returns `true` if the script is a tool script. A tool script can run in the editor. */ - is_tool(): boolean - - /** Returns `true` if the script is an abstract script. An abstract script does not have a constructor and cannot be instantiated. */ - is_abstract(): boolean - - /** The script source code or an empty string if source code is not available. When set, does not reload the class implementation automatically. */ - get source_code(): string - set source_code(value: string) - } - /** Godot editor's popup dialog for creating new [Script] files. - * - * @link https://docs.godotengine.org/en/4.3/classes/class_scriptcreatedialog.html - */ - class ScriptCreateDialog extends ConfirmationDialog { - constructor(identifier?: any) - /** Prefills required fields to configure the ScriptCreateDialog for use. */ - config(inherits: string, path: string, built_in_enabled: boolean = true, load_enabled: boolean = true): void - - /** Emitted when the user clicks the OK button. */ - readonly script_created: Signal1