// AUTO-GENERATED
///
declare module "godot" {
/** A syntax highlighter intended for code.
*
* @link https://docs.godotengine.org/en/4.3/classes/class_codehighlighter.html
*/
class CodeHighlighter extends SyntaxHighlighter {
constructor(identifier?: any)
/** Sets the color for a keyword.
* The keyword cannot contain any symbols except '_'.
*/
add_keyword_color(keyword: string, color: Color): void
/** Removes the keyword. */
remove_keyword_color(keyword: string): void
/** Returns `true` if the keyword exists, else `false`. */
has_keyword_color(keyword: string): boolean
/** Returns the color for a keyword. */
get_keyword_color(keyword: string): Color
/** Removes all keywords. */
clear_keyword_colors(): void
/** Sets the color for a member keyword.
* The member keyword cannot contain any symbols except '_'.
* It will not be highlighted if preceded by a '.'.
*/
add_member_keyword_color(member_keyword: string, color: Color): void
/** Removes the member keyword. */
remove_member_keyword_color(member_keyword: string): void
/** Returns `true` if the member keyword exists, else `false`. */
has_member_keyword_color(member_keyword: string): boolean
/** Returns the color for a member keyword. */
get_member_keyword_color(member_keyword: string): Color
/** Removes all member keywords. */
clear_member_keyword_colors(): void
/** Adds a color region (such as for comments or strings) 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_color_region(start_key: string, end_key: string, color: Color, line_only: boolean = false): void
/** Removes the color region that uses that start key. */
remove_color_region(start_key: string): void
/** Returns `true` if the start key exists, else `false`. */
has_color_region(start_key: string): boolean
/** Removes all color regions. */
clear_color_regions(): void
/** Sets the color for numbers. */
get number_color(): Color
set number_color(value: Color)
/** Sets the color for symbols. */
get symbol_color(): Color
set symbol_color(value: Color)
/** Sets color for functions. A function is a non-keyword string followed by a '('. */
get function_color(): Color
set function_color(value: Color)
/** Sets color for member variables. A member variable is non-keyword, non-function string proceeded with a '.'. */
get member_variable_color(): Color
set member_variable_color(value: Color)
/** Sets the keyword colors. All existing keywords will be removed. The [Dictionary] key is the keyword. The value is the keyword color. */
get keyword_colors(): GDictionary
set keyword_colors(value: GDictionary)
/** Sets the member keyword colors. All existing member keyword will be removed. The [Dictionary] key is the member keyword. The value is the member keyword color. */
get member_keyword_colors(): GDictionary
set member_keyword_colors(value: GDictionary)
/** Sets the color regions. All existing regions will be removed. The [Dictionary] key is the region start and end key, separated by a space. The value is the region color. */
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].
* Automatically re-added to the physics simulation when the [Node] is processed again.
*/
DISABLE_MODE_REMOVE = 0,
/** When [member Node.process_mode] is set to [constant Node.PROCESS_MODE_DISABLED], make the body static. Doesn't affect [Area2D]. [PhysicsBody2D] can't be affected by forces or other bodies while static.
* Automatically set [PhysicsBody2D] back to its original mode when the [Node] is processed again.
*/
DISABLE_MODE_MAKE_STATIC = 1,
/** When [member Node.process_mode] is set to [constant Node.PROCESS_MODE_DISABLED], do not affect the physics simulation. */
DISABLE_MODE_KEEP_ACTIVE = 2,
}
}
/** Abstract base class for 2D physics objects.
*
* @link https://docs.godotengine.org/en/4.3/classes/class_collisionobject2d.html
*/
class CollisionObject2D 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.
*
* **Note:** [method _input_event] requires [member input_pickable] to be `true` and at least one [member collision_layer] bit to be set.
*/
/* gdvirtual */ _input_event(viewport: Viewport, event: InputEvent, shape_idx: int64): void
/** Called when the mouse pointer enters any of this object's shapes. Requires [member input_pickable] to be `true` and at least one [member collision_layer] bit to be set. Note that moving between different shapes within a single [CollisionObject2D] won't cause this function to be called. */
/* gdvirtual */ _mouse_enter(): void
/** Called when the mouse pointer exits all this object's shapes. Requires [member input_pickable] to be `true` and at least one [member collision_layer] bit to be set. Note that moving between different shapes within a single [CollisionObject2D] won't cause this function to be called. */
/* gdvirtual */ _mouse_exit(): void
/** Called when the mouse pointer enters any of this object's shapes or moves from one shape to another. [param shape_idx] is the child index of the newly entered [Shape2D]. Requires [member input_pickable] to be `true` and at least one [member collision_layer] bit to be called. */
/* gdvirtual */ _mouse_shape_enter(shape_idx: int64): void
/** Called when the mouse pointer exits any of this object's shapes. [param shape_idx] is the child index of the exited [Shape2D]. Requires [member input_pickable] to be `true` and at least one [member collision_layer] bit to be called. */
/* gdvirtual */ _mouse_shape_exit(shape_idx: int64): void
/** Returns the object's [RID]. */
get_rid(): 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
/** 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
/** Creates a new shape owner for the given object. Returns `owner_id` of the new owner for future reference. */
create_shape_owner(owner: Object): int64
/** Removes the given shape owner. */
remove_shape_owner(owner_id: int64): void
/** Returns an [Array] of `owner_id` identifiers. You can use these ids in other methods that take `owner_id` as an argument. */
get_shape_owners(): PackedInt32Array
/** Sets the [Transform2D] of the given shape owner. */
shape_owner_set_transform(owner_id: int64, transform: Transform2D): void
/** Returns the shape owner's [Transform2D]. */
shape_owner_get_transform(owner_id: int64): Transform2D
/** Returns the parent object of the given shape owner. */
shape_owner_get_owner(owner_id: int64): Object
/** If `true`, disables the given shape owner. */
shape_owner_set_disabled(owner_id: int64, disabled: boolean): void
/** If `true`, the shape owner and its shapes are disabled. */
is_shape_owner_disabled(owner_id: int64): boolean
/** If [param enable] is `true`, collisions for the shape owner originating from this [CollisionObject2D] will not be reported to collided with [CollisionObject2D]s. */
shape_owner_set_one_way_collision(owner_id: int64, enable: boolean): void
/** Returns `true` if collisions for the shape owner originating from this [CollisionObject2D] will not be reported to collided with [CollisionObject2D]s. */
is_shape_owner_one_way_collision_enabled(owner_id: int64): boolean
/** Sets the `one_way_collision_margin` of the shape owner identified by given [param owner_id] to [param margin] pixels. */
shape_owner_set_one_way_collision_margin(owner_id: int64, margin: float64): void
/** Returns the `one_way_collision_margin` of the shape owner identified by given [param owner_id]. */
get_shape_owner_one_way_collision_margin(owner_id: int64): float64
/** Adds a [Shape2D] to the shape owner. */
shape_owner_add_shape(owner_id: int64, shape: Shape2D): void
/** Returns the number of shapes the given shape owner contains. */
shape_owner_get_shape_count(owner_id: int64): int64
/** Returns the [Shape2D] with the given ID from the given shape owner. */
shape_owner_get_shape(owner_id: int64, shape_id: int64): Shape2D
/** Returns the child index of the [Shape2D] with the given ID from the given shape owner. */
shape_owner_get_shape_index(owner_id: int64, shape_id: int64): int64
/** Removes a shape from the given shape owner. */
shape_owner_remove_shape(owner_id: int64, shape_id: int64): void
/** Removes all shapes from the shape owner. */
shape_owner_clear_shapes(owner_id: int64): void
/** Returns the `owner_id` of the given shape. */
shape_find_owner(shape_index: int64): int64
/** Defines the behavior in physics when [member Node.process_mode] is set to [constant Node.PROCESS_MODE_DISABLED]. See [enum DisableMode] for more details about the different modes. */
get disable_mode(): int64
set disable_mode(value: int64)
/** 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.
*/
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.
*/
get collision_mask(): int64
set collision_mask(value: int64)
/** The priority used to solve colliding when occurring penetration. 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)
/** If `true`, this object is pickable. A pickable object can detect the mouse pointer entering/leaving, and if the mouse is inside it, report input events. Requires at least one [member collision_layer] bit to be set. */
get input_pickable(): boolean
set input_pickable(value: boolean)
/** Emitted when an input event occurs. Requires [member input_pickable] to be `true` and at least one [member collision_layer] bit to be set. See [method _input_event] for details. */
readonly input_event: Signal3
/** Emitted when the mouse pointer enters any of this object's shapes. Requires [member input_pickable] to be `true` and at least one [member collision_layer] bit to be set. Note that moving between different shapes within a single [CollisionObject2D] won't cause this signal to be emitted.
*
* **Note:** Due to the lack of continuous collision detection, this signal may not be emitted in the expected order if the mouse moves fast enough and the [CollisionObject2D]'s area is small. This signal may also not be emitted if another [CollisionObject2D] is overlapping the [CollisionObject2D] in question.
*/
readonly mouse_entered: Signal0
/** Emitted when the mouse pointer exits all this object's shapes. Requires [member input_pickable] to be `true` and at least one [member collision_layer] bit to be set. Note that moving between different shapes within a single [CollisionObject2D] won't cause this signal to be emitted.
*
* **Note:** Due to the lack of continuous collision detection, this signal may not be emitted in the expected order if the mouse moves fast enough and the [CollisionObject2D]'s area is small. This signal may also not be emitted if another [CollisionObject2D] is overlapping the [CollisionObject2D] in question.
*/
readonly mouse_exited: Signal0
/** Emitted when the mouse pointer enters any of this object's shapes or moves from one shape to another. [param shape_idx] is the child index of the newly entered [Shape2D]. Requires [member input_pickable] to be `true` and at least one [member collision_layer] bit to be set. */
readonly mouse_shape_entered: Signal1
/** Emitted when the mouse pointer exits any of this object's shapes. [param shape_idx] is the child index of the exited [Shape2D]. Requires [member input_pickable] to be `true` and at least one [member collision_layer] bit to be set. */
readonly mouse_shape_exited: Signal1
}
namespace CollisionObject3D {
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 [CollisionObject3D].
* Automatically re-added to the physics simulation when the [Node] is processed again.
*/
DISABLE_MODE_REMOVE = 0,
/** When [member Node.process_mode] is set to [constant Node.PROCESS_MODE_DISABLED], make the body static. Doesn't affect [Area3D]. [PhysicsBody3D] can't be affected by forces or other bodies while static.
* Automatically set [PhysicsBody3D] back to its original mode when the [Node] is processed again.
*/
DISABLE_MODE_MAKE_STATIC = 1,
/** When [member Node.process_mode] is set to [constant Node.PROCESS_MODE_DISABLED], do not affect the physics simulation. */
DISABLE_MODE_KEEP_ACTIVE = 2,
}
}
/** Abstract base class for 3D physics objects.
*
* @link https://docs.godotengine.org/en/4.3/classes/class_collisionobject3d.html
*/
class CollisionObject3D 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.
*
* **Note:** [method _input_event] requires [member input_ray_pickable] to be `true` and at least one [member collision_layer] bit to be set.
*/
/* gdvirtual */ _input_event(camera: Camera3D, event: InputEvent, event_position: Vector3, normal: Vector3, shape_idx: int64): void
/** Called when the mouse pointer enters any of this object's shapes. Requires [member input_ray_pickable] to be `true` and at least one [member collision_layer] bit to be set. Note that moving between different shapes within a single [CollisionObject3D] won't cause this function to be called. */
/* gdvirtual */ _mouse_enter(): void
/** Called when the mouse pointer exits all this object's shapes. Requires [member input_ray_pickable] to be `true` and at least one [member collision_layer] bit to be set. Note that moving between different shapes within a single [CollisionObject3D] won't cause this function to be called. */
/* gdvirtual */ _mouse_exit(): void
/** 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
/** 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
/** Returns the object's [RID]. */
get_rid(): RID
/** Creates a new shape owner for the given object. Returns `owner_id` of the new owner for future reference. */
create_shape_owner(owner: Object): int64
/** Removes the given shape owner. */
remove_shape_owner(owner_id: int64): void
/** Returns an [Array] of `owner_id` identifiers. You can use these ids in other methods that take `owner_id` as an argument. */
get_shape_owners(): PackedInt32Array
/** Sets the [Transform3D] of the given shape owner. */
shape_owner_set_transform(owner_id: int64, transform: Transform3D): void
/** Returns the shape owner's [Transform3D]. */
shape_owner_get_transform(owner_id: int64): Transform3D
/** Returns the parent object of the given shape owner. */
shape_owner_get_owner(owner_id: int64): Object
/** If `true`, disables the given shape owner. */
shape_owner_set_disabled(owner_id: int64, disabled: boolean): void
/** If `true`, the shape owner and its shapes are disabled. */
is_shape_owner_disabled(owner_id: int64): boolean
/** Adds a [Shape3D] to the shape owner. */
shape_owner_add_shape(owner_id: int64, shape: Shape3D): void
/** Returns the number of shapes the given shape owner contains. */
shape_owner_get_shape_count(owner_id: int64): int64
/** Returns the [Shape3D] with the given ID from the given shape owner. */
shape_owner_get_shape(owner_id: int64, shape_id: int64): Shape3D
/** Returns the child index of the [Shape3D] with the given ID from the given shape owner. */
shape_owner_get_shape_index(owner_id: int64, shape_id: int64): int64
/** Removes a shape from the given shape owner. */
shape_owner_remove_shape(owner_id: int64, shape_id: int64): void
/** Removes all shapes from the shape owner. */
shape_owner_clear_shapes(owner_id: int64): void
/** Returns the `owner_id` of the given shape. */
shape_find_owner(shape_index: int64): int64
/** Defines the behavior in physics when [member Node.process_mode] is set to [constant Node.PROCESS_MODE_DISABLED]. See [enum DisableMode] for more details about the different modes. */
get disable_mode(): int64
set disable_mode(value: int64)
/** 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.
*/
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.
*/
get collision_mask(): int64
set collision_mask(value: int64)
/** The priority used to solve colliding when occurring penetration. 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)
/** If `true`, this object is pickable. A pickable object can detect the mouse pointer entering/leaving, and if the mouse is inside it, report input events. Requires at least one [member collision_layer] bit to be set. */
get input_ray_pickable(): boolean
set input_ray_pickable(value: boolean)
/** If `true`, the [CollisionObject3D] will continue to receive input events as the mouse is dragged across its shapes. */
get input_capture_on_drag(): boolean
set input_capture_on_drag(value: boolean)
/** Emitted when the object receives an unhandled [InputEvent]. [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. */
readonly input_event: Signal5
/** Emitted when the mouse pointer enters any of this object's shapes. Requires [member input_ray_pickable] to be `true` and at least one [member collision_layer] bit to be set.
*
* **Note:** Due to the lack of continuous collision detection, this signal may not be emitted in the expected order if the mouse moves fast enough and the [CollisionObject3D]'s area is small. This signal may also not be emitted if another [CollisionObject3D] is overlapping the [CollisionObject3D] in question.
*/
readonly mouse_entered: Signal0
/** Emitted when the mouse pointer exits all this object's shapes. Requires [member input_ray_pickable] to be `true` and at least one [member collision_layer] bit to be set.
*
* **Note:** Due to the lack of continuous collision detection, this signal may not be emitted in the expected order if the mouse moves fast enough and the [CollisionObject3D]'s area is small. This signal may also not be emitted if another [CollisionObject3D] is overlapping the [CollisionObject3D] in question.
*/
readonly mouse_exited: Signal0
}
class CollisionObject3DGizmoPlugin extends EditorNode3DGizmoPlugin {
constructor(identifier?: any)
}
namespace CollisionPolygon2D {
enum BuildMode {
/** Collisions will include the polygon and its contained area. In this mode the node has the same effect as several [ConvexPolygonShape2D] nodes, one for each convex shape in the convex decomposition of the polygon (but without the overhead of multiple nodes). */
BUILD_SOLIDS = 0,
/** Collisions will only include the polygon edges. In this mode the node has the same effect as a single [ConcavePolygonShape2D] made of segments, with the restriction that each segment (after the first one) starts where the previous one ends, and the last one ends where the first one starts (forming a closed but hollow polygon). */
BUILD_SEGMENTS = 1,
}
}
/** A node that provides a polygon shape to a [CollisionObject2D] parent.
*
* @link https://docs.godotengine.org/en/4.3/classes/class_collisionpolygon2d.html
*/
class CollisionPolygon2D extends Node2D {
constructor(identifier?: any)
/** Collision build mode. Use one of the [enum BuildMode] constants. */
get build_mode(): int64
set build_mode(value: int64)
/** The polygon's list of vertices. Each point will be connected to the next, and the final point will be connected to the first.
*
* **Note:** The returned vertices are in the local coordinate space of the given [CollisionPolygon2D].
*/
get polygon(): PackedVector2Array
set polygon(value: PackedVector2Array | Vector2[])
/** If `true`, no collisions will be detected. */
get disabled(): boolean
set disabled(value: boolean)
/** If `true`, only edges that face up, relative to [CollisionPolygon2D]'s rotation, will collide with other objects.
*
* **Note:** This property has no effect if this [CollisionPolygon2D] is a child of an [Area2D] node.
*/
get one_way_collision(): boolean
set one_way_collision(value: boolean)
/** The margin used for one-way collision (in pixels). Higher values will make the shape thicker, and work better for colliders that enter the polygon at a high velocity. */
get one_way_collision_margin(): float64
set one_way_collision_margin(value: float64)
}
class CollisionPolygon2DEditor extends AbstractPolygon2DEditor {
constructor(identifier?: any)
}
class CollisionPolygon2DEditorPlugin 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
*/
class CollisionPolygon3D extends Node3D {
constructor(identifier?: any)
_is_editable_3d_polygon(): boolean
/** Length that the resulting collision extends in either direction perpendicular to its 2D polygon. */
get depth(): float64
set depth(value: float64)
/** If `true`, no collision will be produced. */
get disabled(): boolean
set disabled(value: boolean)
/** Array of vertices which define the 2D polygon in the local XY plane. */
get polygon(): PackedVector2Array
set polygon(value: PackedVector2Array | Vector2[])
/** The collision margin for the generated [Shape3D]. See [member Shape3D.margin] for more details. */
get margin(): float64
set margin(value: float64)
}
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
*/
class CollisionShape2D extends Node2D {
constructor(identifier?: any)
/** The actual shape owned by this collision shape. */
get shape(): Shape2D
set shape(value: Shape2D)
/** A disabled collision shape has no effect in the world. This property should be changed with [method Object.set_deferred]. */
get disabled(): boolean
set disabled(value: boolean)
/** Sets whether this collision shape should only detect collision on one side (top or bottom).
*
* **Note:** This property has no effect if this [CollisionShape2D] is a child of an [Area2D] node.
*/
get one_way_collision(): boolean
set one_way_collision(value: boolean)
/** The margin used for one-way collision (in pixels). Higher values will make the shape thicker, and work better for colliders that enter the shape at a high velocity. */
get one_way_collision_margin(): float64
set one_way_collision_margin(value: float64)
/** The collision shape debug color.
*
* **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.
*/
get debug_color(): Color
set debug_color(value: Color)
}
class CollisionShape2DEditor extends Control {
constructor(identifier?: any)
}
class CollisionShape2DEditorPlugin 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
*/
class CollisionShape3D extends Node3D {
constructor(identifier?: any)
/** This method does nothing. */
resource_changed(resource: Resource): void
/** Sets the collision shape's shape to the addition of all its convexed [MeshInstance3D] siblings geometry. */
make_convex_from_siblings(): void
/** The actual shape owned by this collision shape. */
get shape(): Shape3D
set shape(value: Shape3D)
/** A disabled collision shape has no effect in the world. */
get disabled(): boolean
set disabled(value: boolean)
}
class CollisionShape3DGizmoPlugin extends EditorNode3DGizmoPlugin {
constructor(identifier?: any)
}
namespace ColorPicker {
enum ColorModeType {
/** Allows editing the color with Red/Green/Blue sliders. */
MODE_RGB = 0,
/** Allows editing the color with Hue/Saturation/Value sliders. */
MODE_HSV = 1,
/** Allows the color R, G, B component values to go beyond 1.0, which can be used for certain special operations that require it (like tinting without darkening or rendering sprites in HDR). */
MODE_RAW = 2,
/** Allows editing the color with Hue/Saturation/Lightness sliders.
* OKHSL is a new color space similar to HSL but that better match perception by leveraging the Oklab color space which is designed to be simple to use, while doing a good job at predicting perceived lightness, chroma and hue.
* [url=https://bottosson.github.io/posts/colorpicker/]Okhsv and Okhsl color spaces[/url]
*/
MODE_OKHSL = 3,
}
enum PickerShapeType {
/** HSV Color Model rectangle color space. */
SHAPE_HSV_RECTANGLE = 0,
/** HSV Color Model rectangle color space with a wheel. */
SHAPE_HSV_WHEEL = 1,
/** HSV Color Model circle color space. Use Saturation as a radius. */
SHAPE_VHS_CIRCLE = 2,
/** HSL OK Color Model circle color space. */
SHAPE_OKHSL_CIRCLE = 3,
/** The color space shape and the shape select button are hidden. Can't be selected from the shapes popup. */
SHAPE_NONE = 4,
}
}
/** A widget that provides an interface for selecting or modifying a color.
*
* @link https://docs.godotengine.org/en/4.3/classes/class_colorpicker.html
*/
class ColorPicker 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.
*
* **Note:** The presets list is only for *this* color picker.
*/
add_preset(color: Color): void
/** Removes the given color from the list of color presets of this color picker. */
erase_preset(color: Color): void
/** Returns the list of colors in the presets of the color picker. */
get_presets(): PackedColorArray
/** Adds the given color to a list of color recent presets so that it can be picked later. Recent presets are the colors that were picked recently, a new preset is automatically created and added to recent presets when you pick a new color.
*
* **Note:** The recent presets list is only for *this* color picker.
*/
add_recent_preset(color: Color): void
/** Removes the given color from the list of color recent presets of this color picker. */
erase_recent_preset(color: Color): void
/** Returns the list of colors in the recent presets of the color picker. */
get_recent_presets(): PackedColorArray
/** The currently selected color. */
get color(): Color
set color(value: Color)
/** If `true`, shows an alpha channel slider (opacity). */
get edit_alpha(): boolean
set edit_alpha(value: boolean)
/** The currently selected color mode. See [enum ColorModeType]. */
get color_mode(): int64
set color_mode(value: int64)
/** If `true`, the color will apply only after the user releases the mouse button, otherwise it will apply immediately even in mouse motion event (which can cause performance issues). */
get deferred_mode(): boolean
set deferred_mode(value: boolean)
/** The shape of the color space view. See [enum PickerShapeType]. */
get picker_shape(): int64
set picker_shape(value: int64)
/** If `true`, it's possible to add presets under Swatches. If `false`, the button to add presets is disabled. */
get can_add_swatches(): boolean
set can_add_swatches(value: boolean)
/** If `true`, the color sampler and color preview are visible. */
get sampler_visible(): boolean
set sampler_visible(value: boolean)
/** If `true`, the color mode buttons are visible. */
get color_modes_visible(): boolean
set color_modes_visible(value: boolean)
/** If `true`, the color sliders are visible. */
get sliders_visible(): boolean
set sliders_visible(value: boolean)
/** If `true`, the hex color code input field is visible. */
get hex_visible(): boolean
set hex_visible(value: boolean)
/** If `true`, the Swatches and Recent Colors presets are visible. */
get presets_visible(): boolean
set presets_visible(value: boolean)
/** Emitted when the color is changed. */
readonly color_changed: Signal1
/** Emitted when a preset is added. */
readonly preset_added: Signal1
/** Emitted when a preset is removed. */
readonly preset_removed: Signal1
}
/** A button that brings up a [ColorPicker] when pressed.
*
* @link https://docs.godotengine.org/en/4.3/classes/class_colorpickerbutton.html
*/
class ColorPickerButton 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.
*/
get_picker(): ColorPicker
/** Returns the control's [PopupPanel] which allows you to connect to popup signals. This allows you to handle events when the ColorPicker is shown or hidden.
* **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(): PopupPanel
_about_to_popup(): void
/** The currently selected color. */
get color(): Color
set color(value: Color)
/** If `true`, the alpha channel in the displayed [ColorPicker] will be visible. */
get edit_alpha(): boolean
set edit_alpha(value: boolean)
/** Emitted when the color changes. */
readonly color_changed: Signal1
/** Emitted when the [ColorPicker] is closed. */
readonly popup_closed: Signal0
/** Emitted when the [ColorPicker] is created (the button is pressed for the first time). */
readonly picker_created: Signal0
}
/** A control that displays a solid color rectangle.
*
* @link https://docs.godotengine.org/en/4.3/classes/class_colorrect.html
*/
class ColorRect extends Control {
constructor(identifier?: any)
/** The fill color of the rectangle. */
get color(): Color
set color(value: Color)
}
/** Stores attributes used to customize how a Viewport is rendered.
*
* @link https://docs.godotengine.org/en/4.3/classes/class_compositor.html
*/
class Compositor extends Resource {
constructor(identifier?: any)
/** The custom [CompositorEffect]s that are applied during rendering of viewports using this compositor. */
get compositor_effects(): GArray
set compositor_effects(value: GArray)
}
namespace CompositorEffect {
enum EffectCallbackType {
/** The callback is called before our opaque rendering pass, but after depth prepass (if applicable). */
EFFECT_CALLBACK_TYPE_PRE_OPAQUE = 0,
/** The callback is called after our opaque rendering pass, but before our sky is rendered. */
EFFECT_CALLBACK_TYPE_POST_OPAQUE = 1,
/** The callback is called after our sky is rendered, but before our back buffers are created (and if enabled, before subsurface scattering and/or screen space reflections). */
EFFECT_CALLBACK_TYPE_POST_SKY = 2,
/** 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. */
EFFECT_CALLBACK_TYPE_POST_TRANSPARENT = 4,
/** Represents the size of the [enum EffectCallbackType] enum. */
EFFECT_CALLBACK_TYPE_MAX = 5,
}
}
/** This resource allows for creating a custom rendering effect.
*
* @link https://docs.godotengine.org/en/4.3/classes/class_compositoreffect.html
*/
class CompositorEffect extends Resource {
constructor(identifier?: any)
/** Implement this function with your custom rendering code. [param effect_callback_type] should always match the effect callback type you've specified in [member effect_callback_type]. [param render_data] provides access to the rendering state, it is only valid during rendering and should not be stored. */
/* gdvirtual */ _render_callback(effect_callback_type: int64, render_data: RenderData): void
/** If `true` this rendering effect is applied to any viewport it is added to. */
get enabled(): boolean
set enabled(value: boolean)
/** The type of effect that is implemented, determines at what stage of rendering the callback is called. */
get effect_callback_type(): int64
set effect_callback_type(value: int64)
/** If `true` and MSAA is enabled, this will trigger a color buffer resolve before the effect is run.
*
* **Note:** In [method _render_callback], to access the resolved buffer use:
*
*/
get access_resolved_color(): boolean
set access_resolved_color(value: boolean)
/** If `true` and MSAA is enabled, this will trigger a depth buffer resolve before the effect is run.
*
* **Note:** In [method _render_callback], to access the resolved buffer use:
*
*/
get access_resolved_depth(): boolean
set access_resolved_depth(value: boolean)
/** If `true` this triggers motion vectors being calculated during the opaque render state.
*
* **Note:** In [method _render_callback], to access the motion vector buffer use:
*
*/
get needs_motion_vectors(): boolean
set needs_motion_vectors(value: boolean)
/** If `true` this triggers normal and roughness data to be output during our depth pre-pass, only applicable for the Forward+ renderer.
*
* **Note:** In [method _render_callback], to access the roughness buffer use:
*
*/
get needs_normal_roughness(): boolean
set needs_normal_roughness(value: boolean)
/** If `true` this triggers specular data being rendered to a separate buffer and combined after effects have been applied, only applicable for the Forward+ renderer. */
get needs_separate_specular(): boolean
set needs_separate_specular(value: boolean)
}
/** An optionally compressed [Cubemap].
*
* @link https://docs.godotengine.org/en/4.3/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
*/
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
*/
class CompressedTexture2D extends Texture2D {
constructor(identifier?: any)
/** The [CompressedTexture2D]'s file path to a `.ctex` file. */
get load_path(): string
set load_path(value: string)
}
/** Array of 2-dimensional textures, optionally compressed.
*
* @link https://docs.godotengine.org/en/4.3/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
*/
class CompressedTexture3D extends Texture3D {
constructor(identifier?: any)
/** The [CompressedTexture3D]'s file path to a `.ctex3d` file. */
get load_path(): string
set load_path(value: string)
}
/** Base class for texture arrays that can optionally be compressed.
*
* @link https://docs.godotengine.org/en/4.3/classes/class_compressedtexturelayered.html
*/
class CompressedTextureLayered extends TextureLayered {
constructor(identifier?: any)
/** The path the texture should be loaded from. */
get load_path(): string
set load_path(value: string)
}
/** A 2D polyline shape used for physics collision.
*
* @link https://docs.godotengine.org/en/4.3/classes/class_concavepolygonshape2d.html
*/
class ConcavePolygonShape2D extends Shape2D {
constructor(identifier?: any)
/** The array of points that make up the [ConcavePolygonShape2D]'s line segments. The array (of length divisible by two) is naturally divided into pairs (one pair for each segment); each pair consists of the starting point of a segment and the endpoint of a segment. */
get segments(): PackedVector2Array
set segments(value: PackedVector2Array | Vector2[])
}
/** A 3D trimesh shape used for physics collision.
*
* @link https://docs.godotengine.org/en/4.3/classes/class_concavepolygonshape3d.html
*/
class ConcavePolygonShape3D extends Shape3D {
constructor(identifier?: any)
get data(): PackedVector3Array
set data(value: PackedVector3Array | Vector3[])
/** If set to `true`, collisions occur on both sides of the concave shape faces. Otherwise they occur only along the face normals. */
get backface_collision(): boolean
set backface_collision(value: boolean)
}
namespace ConeTwistJoint3D {
enum Param {
/** 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.
*/
PARAM_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.
*/
PARAM_TWIST_SPAN = 1,
/** The speed with which the swing or twist will take place.
* The higher, the faster.
*/
PARAM_BIAS = 2,
/** The ease with which the joint starts to twist. If it's too low, it takes more force to start twisting the joint. */
PARAM_SOFTNESS = 3,
/** Defines, how fast the swing- and twist-speed-difference on both sides gets synced. */
PARAM_RELAXATION = 4,
/** Represents the size of the [enum Param] enum. */
PARAM_MAX = 5,
}
}
/** 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
*/
class ConeTwistJoint3D extends Joint3D {
constructor(identifier?: any)
/** Sets the value of the specified parameter. */
set_param(param: ConeTwistJoint3D.Param, value: float64): void
/** Returns the value of the specified parameter. */
get_param(param: ConeTwistJoint3D.Param): float64
/** 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.
*/
get swing_span(): float64
set swing_span(value: float64)
/** Twist is the rotation around the twist axis, this value defined how far the joint can twist.
* Twist is locked if below 0.05.
*/
get twist_span(): float64
set twist_span(value: float64)
/** The speed with which the swing or twist will take place.
* The higher, the faster.
*/
get bias(): float64
set bias(value: float64)
/** The ease with which the joint starts to twist. If it's too low, it takes more force to start twisting the joint. */
get softness(): float64
set softness(value: float64)
/** Defines, how fast the swing- and twist-speed-difference on both sides gets synced. */
get relaxation(): float64
set relaxation(value: float64)
}
/** Helper class to handle INI-style files.
*
* @link https://docs.godotengine.org/en/4.3/classes/class_configfile.html
*/
class ConfigFile extends RefCounted {
constructor(identifier?: any)
/** Assigns a value to the specified key of the specified section. If either the section or the key do not exist, they are created. Passing a `null` value deletes the specified key if it exists, and deletes the section if it ends up empty once the key has been removed. */
set_value(section: string, key: string, value: any): void
/** Returns the current value for the specified section and key. If either the section or the key do not exist, the method returns the fallback [param default] value. If [param default] is not specified or set to `null`, an error is also raised. */
get_value(section: string, key: string, default_: any = {}): any
/** Returns `true` if the specified section exists. */
has_section(section: string): boolean
/** Returns `true` if the specified section-key pair exists. */
has_section_key(section: string, key: string): boolean
/** Returns an array of all defined section identifiers. */
get_sections(): PackedStringArray
/** Returns an array of all defined key identifiers in the specified section. Raises an error and returns an empty array if the section does not exist. */
get_section_keys(section: string): PackedStringArray
/** Deletes the specified section along with all the key-value pairs inside. Raises an error if the section does not exist. */
erase_section(section: string): void
/** Deletes the specified key in a section. Raises an error if either the section or the key do not exist. */
erase_section_key(section: string, key: string): void
/** Loads the config file specified as a parameter. The file's contents are parsed and loaded in the [ConfigFile] object which the method was called on.
* Returns [constant OK] on success, or one of the other [enum Error] values if the operation failed.
*/
load(path: string): GError
/** Parses the passed string as the contents of a config file. The string is parsed and loaded in the ConfigFile object which the method was called on.
* Returns [constant OK] on success, or one of the other [enum Error] values if the operation failed.
*/
parse(data: string): GError
/** Saves the contents of the [ConfigFile] object to the file specified as a parameter. The output file uses an INI-style structure.
* Returns [constant OK] on success, or one of the other [enum Error] values if the operation failed.
*/
save(path: string): GError
/** Obtain the text version of this config file (the same text that would be written to a file). */
encode_to_text(): string
/** Loads the encrypted config file specified as a parameter, using the provided [param key] to decrypt it. The file's contents are parsed and loaded in the [ConfigFile] object which the method was called on.
* Returns [constant OK] on success, or one of the other [enum Error] values if the operation failed.
*/
load_encrypted(path: string, key: PackedByteArray | byte[] | ArrayBuffer): GError
/** Loads the encrypted config file specified as a parameter, using the provided [param password] to decrypt it. The file's contents are parsed and loaded in the [ConfigFile] object which the method was called on.
* Returns [constant OK] on success, or one of the other [enum Error] values if the operation failed.
*/
load_encrypted_pass(path: string, password: string): GError
/** Saves the contents of the [ConfigFile] object to the AES-256 encrypted file specified as a parameter, using the provided [param key] to encrypt it. The output file uses an INI-style structure.
* Returns [constant OK] on success, or one of the other [enum Error] values if the operation failed.
*/
save_encrypted(path: string, key: PackedByteArray | byte[] | ArrayBuffer): GError
/** Saves the contents of the [ConfigFile] object to the AES-256 encrypted file specified as a parameter, using the provided [param password] to encrypt it. The output file uses an INI-style structure.
* Returns [constant OK] on success, or one of the other [enum Error] values if the operation failed.
*/
save_encrypted_pass(path: string, password: string): GError
/** Removes the entire contents of the config. */
clear(): void
}
/** A dialog used for confirmation of actions.
*
* @link https://docs.godotengine.org/en/4.3/classes/class_confirmationdialog.html
*/
class ConfirmationDialog 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.
*/
get_cancel_button(): Button
/** The text displayed by the cancel button (see [method get_cancel_button]). */
get cancel_button_text(): string
set cancel_button_text(value: string)
}
class ConnectDialog 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 {
constructor(identifier?: any)
update_tree(): void
}
/** Base class for all GUI containers.
*
* @link https://docs.godotengine.org/en/4.3/classes/class_container.html
*/
class Container 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
/** Notification for when sorting the children, it must be obeyed immediately. */
static readonly NOTIFICATION_SORT_CHILDREN = 51
constructor(identifier?: any)
/** Implement to return a list of allowed horizontal [enum Control.SizeFlags] for child nodes. This doesn't technically prevent the usages of any other size flags, if your implementation requires that. This only limits the options available to the user in the Inspector dock.
*
* **Note:** Having no size flags is equal to having [constant Control.SIZE_SHRINK_BEGIN]. As such, this value is always implicitly allowed.
*/
/* gdvirtual */ _get_allowed_size_flags_horizontal(): PackedInt32Array
/** Implement to return a list of allowed vertical [enum Control.SizeFlags] for child nodes. This doesn't technically prevent the usages of any other size flags, if your implementation requires that. This only limits the options available to the user in the Inspector dock.
*
* **Note:** Having no size flags is equal to having [constant Control.SIZE_SHRINK_BEGIN]. As such, this value is always implicitly allowed.
*/
/* gdvirtual */ _get_allowed_size_flags_vertical(): PackedInt32Array
/** Queue resort of the contained children. This is called automatically anyway, but can be called upon request. */
queue_sort(): void
/** Fit a child control in a given rect. This is mainly a helper for creating custom container classes. */
fit_child_in_rect(child: Control, rect: Rect2): void
/** Emitted when children are going to be sorted. */
readonly pre_sort_children: Signal0
/** Emitted when sorting the children is needed. */
readonly sort_children: Signal0
}
namespace Control {
enum FocusMode {
/** The node cannot grab focus. Use with [member focus_mode]. */
FOCUS_NONE = 0,
/** The node can only grab focus on mouse clicks. Use with [member focus_mode]. */
FOCUS_CLICK = 1,
/** The node can grab focus on mouse click, using the arrows and the Tab keys on the keyboard, or using the D-pad buttons on a gamepad. Use with [member focus_mode]. */
FOCUS_ALL = 2,
}
enum CursorShape {
/** Show the system's arrow mouse cursor when the user hovers the node. Use with [member mouse_default_cursor_shape]. */
CURSOR_ARROW = 0,
/** Show the system's I-beam mouse cursor when the user hovers the node. The I-beam pointer has a shape similar to "I". It tells the user they can highlight or insert text. */
CURSOR_IBEAM = 1,
/** Show the system's pointing hand mouse cursor when the user hovers the node. */
CURSOR_POINTING_HAND = 2,
/** Show the system's cross mouse cursor when the user hovers the node. */
CURSOR_CROSS = 3,
/** Show the system's wait mouse cursor when the user hovers the node. Often an hourglass. */
CURSOR_WAIT = 4,
/** Show the system's busy mouse cursor when the user hovers the node. Often an arrow with a small hourglass. */
CURSOR_BUSY = 5,
/** Show the system's drag mouse cursor, often a closed fist or a cross symbol, when the user hovers the node. It tells the user they're currently dragging an item, like a node in the Scene dock. */
CURSOR_DRAG = 6,
/** Show the system's drop mouse cursor when the user hovers the node. It can be an open hand. It tells the user they can drop an item they're currently grabbing, like a node in the Scene dock. */
CURSOR_CAN_DROP = 7,
/** Show the system's forbidden mouse cursor when the user hovers the node. Often a crossed circle. */
CURSOR_FORBIDDEN = 8,
/** Show the system's vertical resize mouse cursor when the user hovers the node. A double-headed vertical arrow. It tells the user they can resize the window or the panel vertically. */
CURSOR_VSIZE = 9,
/** Show the system's horizontal resize mouse cursor when the user hovers the node. A double-headed horizontal arrow. It tells the user they can resize the window or the panel horizontally. */
CURSOR_HSIZE = 10,
/** Show the system's window resize mouse cursor when the user hovers the node. 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,
/** Show the system's window resize mouse cursor when the user hovers the node. 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,
/** Show the system's move mouse cursor when the user hovers the node. It shows 2 double-headed arrows at a 90 degree angle. It tells the user they can move a UI element freely. */
CURSOR_MOVE = 13,
/** Show the system's vertical split mouse cursor when the user hovers the node. On Windows, it's the same as [constant CURSOR_VSIZE]. */
CURSOR_VSPLIT = 14,
/** Show the system's horizontal split mouse cursor when the user hovers the node. On Windows, it's the same as [constant CURSOR_HSIZE]. */
CURSOR_HSPLIT = 15,
/** Show the system's help mouse cursor when the user hovers the node, a question mark. */
CURSOR_HELP = 16,
}
enum LayoutPreset {
/** Snap all 4 anchors to the top-left of the parent control's bounds. Use with [method set_anchors_preset]. */
PRESET_TOP_LEFT = 0,
/** Snap all 4 anchors to the top-right of the parent control's bounds. Use with [method set_anchors_preset]. */
PRESET_TOP_RIGHT = 1,
/** Snap all 4 anchors to the bottom-left of the parent control's bounds. Use with [method set_anchors_preset]. */
PRESET_BOTTOM_LEFT = 2,
/** Snap all 4 anchors to the bottom-right of the parent control's bounds. Use with [method set_anchors_preset]. */
PRESET_BOTTOM_RIGHT = 3,
/** Snap all 4 anchors to the center of the left edge of the parent control's bounds. Use with [method set_anchors_preset]. */
PRESET_CENTER_LEFT = 4,
/** Snap all 4 anchors to the center of the top edge of the parent control's bounds. Use with [method set_anchors_preset]. */
PRESET_CENTER_TOP = 5,
/** Snap all 4 anchors to the center of the right edge of the parent control's bounds. Use with [method set_anchors_preset]. */
PRESET_CENTER_RIGHT = 6,
/** Snap all 4 anchors to the center of the bottom edge of the parent control's bounds. Use with [method set_anchors_preset]. */
PRESET_CENTER_BOTTOM = 7,
/** Snap all 4 anchors to the center of the parent control's bounds. Use with [method set_anchors_preset]. */
PRESET_CENTER = 8,
/** Snap all 4 anchors to the left edge of the parent control. The left offset becomes relative to the left edge and the top offset relative to the top left corner of the node's parent. Use with [method set_anchors_preset]. */
PRESET_LEFT_WIDE = 9,
/** Snap all 4 anchors to the top edge of the parent control. The left offset becomes relative to the top left corner, the top offset relative to the top edge, and the right offset relative to the top right corner of the node's parent. Use with [method set_anchors_preset]. */
PRESET_TOP_WIDE = 10,
/** Snap all 4 anchors to the right edge of the parent control. The right offset becomes relative to the right edge and the top offset relative to the top right corner of the node's parent. Use with [method set_anchors_preset]. */
PRESET_RIGHT_WIDE = 11,
/** Snap all 4 anchors to the bottom edge of the parent control. The left offset becomes relative to the bottom left corner, the bottom offset relative to the bottom edge, and the right offset relative to the bottom right corner of the node's parent. Use with [method set_anchors_preset]. */
PRESET_BOTTOM_WIDE = 12,
/** Snap all 4 anchors to a vertical line that cuts the parent control in half. Use with [method set_anchors_preset]. */
PRESET_VCENTER_WIDE = 13,
/** Snap all 4 anchors to a horizontal line that cuts the parent control in half. Use with [method set_anchors_preset]. */
PRESET_HCENTER_WIDE = 14,
/** Snap all 4 anchors to the respective corners of the parent control. Set all 4 offsets to 0 after you applied this preset and the [Control] will fit its parent control. Use with [method set_anchors_preset]. */
PRESET_FULL_RECT = 15,
}
enum LayoutPresetMode {
/** The control will be resized to its minimum size. */
PRESET_MODE_MINSIZE = 0,
/** The control's width will not change. */
PRESET_MODE_KEEP_WIDTH = 1,
/** The control's height will not change. */
PRESET_MODE_KEEP_HEIGHT = 2,
/** The control's size will not change. */
PRESET_MODE_KEEP_SIZE = 3,
}
enum SizeFlags {
/** Tells the parent [Container] to align the node with its start, either the top or the left edge. It is mutually exclusive with [constant SIZE_FILL] and other shrink size flags, but can be used with [constant SIZE_EXPAND] in some containers. Use with [member size_flags_horizontal] and [member size_flags_vertical].
*
* **Note:** Setting this flag is equal to not having any size flags.
*/
SIZE_SHRINK_BEGIN = 0,
/** Tells the parent [Container] to expand the bounds of this node to fill all the available space without pushing any other node. It is mutually exclusive with shrink size flags. Use with [member size_flags_horizontal] and [member size_flags_vertical]. */
SIZE_FILL = 1,
/** Tells the parent [Container] to let this node take all the available space on the axis you flag. If multiple neighboring nodes are set to expand, they'll share the space based on their stretch ratio. See [member size_flags_stretch_ratio]. Use with [member size_flags_horizontal] and [member size_flags_vertical]. */
SIZE_EXPAND = 2,
/** Sets the node's size flags to both fill and expand. See [constant SIZE_FILL] and [constant SIZE_EXPAND] for more information. */
SIZE_EXPAND_FILL = 3,
/** Tells the parent [Container] to center the node in the available space. It is mutually exclusive with [constant SIZE_FILL] and other shrink size flags, but can be used with [constant SIZE_EXPAND] in some containers. Use with [member size_flags_horizontal] and [member size_flags_vertical]. */
SIZE_SHRINK_CENTER = 4,
/** Tells the parent [Container] to align the node with its end, either the bottom or the right edge. It is mutually exclusive with [constant SIZE_FILL] and other shrink size flags, but can be used with [constant SIZE_EXPAND] in some containers. Use with [member size_flags_horizontal] and [member size_flags_vertical]. */
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. */
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. */
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.
*
* **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.
*/
MOUSE_FILTER_IGNORE = 2,
}
enum GrowDirection {
/** The control will grow to the left or top to make up if its minimum size is changed to be greater than its current size on the respective axis. */
GROW_DIRECTION_BEGIN = 0,
/** The control will grow to the right or bottom to make up if its minimum size is changed to be greater than its current size on the respective axis. */
GROW_DIRECTION_END = 1,
/** The control will grow in both directions equally to make up if its minimum size is changed to be greater than its current size. */
GROW_DIRECTION_BOTH = 2,
}
enum Anchor {
/** Snaps one of the 4 anchor's sides to the origin of the node's `Rect`, in the top left. Use it with one of the `anchor_*` member variables, like [member anchor_left]. To change all 4 anchors at once, use [method set_anchors_preset]. */
ANCHOR_BEGIN = 0,
/** Snaps one of the 4 anchor's sides to the end of the node's `Rect`, in the bottom right. Use it with one of the `anchor_*` member variables, like [member anchor_left]. To change all 4 anchors at once, use [method set_anchors_preset]. */
ANCHOR_END = 1,
}
enum LayoutDirection {
/** 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,
/** Left-to-right layout direction. */
LAYOUT_DIRECTION_LTR = 2,
/** Right-to-left layout direction. */
LAYOUT_DIRECTION_RTL = 3,
}
enum TextDirection {
/** Text writing direction is the same as layout direction. */
TEXT_DIRECTION_INHERITED = 3,
/** Automatic text writing direction, determined from the current locale and text content. */
TEXT_DIRECTION_AUTO = 0,
/** Left-to-right text writing direction. */
TEXT_DIRECTION_LTR = 1,
/** Right-to-left text writing direction. */
TEXT_DIRECTION_RTL = 2,
}
}
/** 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
*/
class Control extends CanvasItem {
/** Sent when the node changes size. Use [member size] to get the new size. */
static readonly NOTIFICATION_RESIZED = 40
/** Sent when the mouse cursor enters the control's (or any child control's) visible area, that is not occluded behind other Controls or Windows, provided its [member mouse_filter] lets the event reach it and regardless if it's currently focused or not.
*
* **Note:** [member CanvasItem.z_index] doesn't affect which Control receives the notification.
* See also [constant NOTIFICATION_MOUSE_ENTER_SELF].
*/
static readonly NOTIFICATION_MOUSE_ENTER = 41
/** Sent when the mouse cursor leaves the control's (and all child control's) visible area, that is not occluded behind other Controls or Windows, provided its [member mouse_filter] lets the event reach it and regardless if it's currently focused or not.
*
* **Note:** [member CanvasItem.z_index] doesn't affect which Control receives the notification.
* See also [constant NOTIFICATION_MOUSE_EXIT_SELF].
*/
static readonly NOTIFICATION_MOUSE_EXIT = 42
/** Sent when the mouse cursor enters the control's visible area, that is not occluded behind other Controls or Windows, provided its [member mouse_filter] lets the event reach it and regardless if it's currently focused or not.
*
* **Note:** [member CanvasItem.z_index] doesn't affect which Control receives the notification.
* See also [constant NOTIFICATION_MOUSE_ENTER].
*/
static readonly NOTIFICATION_MOUSE_ENTER_SELF = 60
/** Sent when the mouse cursor leaves the control's visible area, that is not occluded behind other Controls or Windows, provided its [member mouse_filter] lets the event reach it and regardless if it's currently focused or not.
*
* **Note:** [member CanvasItem.z_index] doesn't affect which Control receives the notification.
* See also [constant NOTIFICATION_MOUSE_EXIT].
*/
static readonly NOTIFICATION_MOUSE_EXIT_SELF = 61
/** Sent when the node grabs focus. */
static readonly NOTIFICATION_FOCUS_ENTER = 43
/** Sent when the node loses focus. */
static readonly NOTIFICATION_FOCUS_EXIT = 44
/** Sent when the node needs to refresh its theme items. This happens in one of the following cases:
* - The [member theme] property is changed on this node or any of its ancestors.
* - The [member theme_type_variation] property is changed on this node.
* - One of the node's theme property overrides is changed.
* - The node enters the scene tree.
*
* **Note:** As an optimization, this notification won't be sent from changes that occur while this node is outside of the scene tree. Instead, all of the theme item updates can be applied at once when the node enters the scene tree.
*
* **Note:** This notification is received alongside [constant Node.NOTIFICATION_ENTER_TREE], so if you are instantiating a scene, the child nodes will not be initialized yet. You can use it to setup theming 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 Node.is_node_ready].
*
*/
static readonly NOTIFICATION_THEME_CHANGED = 45
/** Sent when this node is inside a [ScrollContainer] which has begun being scrolled when dragging the scrollable area *with a touch event* . This notification is *not* sent when scrolling by dragging the scrollbar, scrolling with the mouse wheel or scrolling with keyboard/gamepad events.
*
* **Note:** This signal is only emitted on Android or iOS, or on desktop/web platforms when [member ProjectSettings.input_devices/pointing/emulate_touch_from_mouse] is enabled.
*/
static readonly NOTIFICATION_SCROLL_BEGIN = 47
/** Sent when this node is inside a [ScrollContainer] which has stopped being scrolled when dragging the scrollable area *with a touch event* . This notification is *not* sent when scrolling by dragging the scrollbar, scrolling with the mouse wheel or scrolling with keyboard/gamepad events.
*
* **Note:** This signal is only emitted on Android or iOS, or on desktop/web platforms when [member ProjectSettings.input_devices/pointing/emulate_touch_from_mouse] is enabled.
*/
static readonly NOTIFICATION_SCROLL_END = 48
/** Sent when control layout direction is changed. */
static readonly NOTIFICATION_LAYOUT_DIRECTION_CHANGED = 49
constructor(identifier?: any)
/** Virtual method to be implemented by the user. Returns whether the given [param point] is inside this control.
* If not overridden, default behavior is checking if the point is within control's Rect.
*
* **Note:** If you want to check if a point is inside the control, you can use `Rect2(Vector2.ZERO, size).has_point(point)`.
*/
/* gdvirtual */ _has_point(point: Vector2): boolean
/** User defined BiDi algorithm override function.
* Returns an [Array] of [Vector3i] text ranges and text base directions, in the left-to-right order. Ranges should cover full source [param text] without overlaps. BiDi algorithm will be used on each range separately.
*/
/* gdvirtual */ _structured_text_parser(args: GArray, text: string): GArray
/** Virtual method to be implemented by the user. Returns the minimum size for this control. Alternative to [member custom_minimum_size] for controlling minimum size via code. The actual minimum size will be the max value of these two (in each axis separately).
* If not overridden, defaults to [constant Vector2.ZERO].
*
* **Note:** This method will not be called when the script is attached to a [Control] node that already overrides its minimum size (e.g. [Label], [Button], [PanelContainer] etc.). It can only be used with most basic GUI nodes, like [Control], [Container], [Panel] etc.
*/
/* gdvirtual */ _get_minimum_size(): Vector2
/** 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.
*/
/* gdvirtual */ _get_tooltip(at_position: Vector2): string
/** Godot calls this method to get data that can be dragged and dropped onto controls that expect drop data. Returns `null` if there is no data to drag. Controls that want to receive drop data should implement [method _can_drop_data] and [method _drop_data]. [param at_position] is local to this control. Drag may be forced with [method force_drag].
* A preview that will follow the mouse that should represent the data can be set with [method set_drag_preview]. A good time to set the preview is in this method.
*
*/
/* gdvirtual */ _get_drag_data(at_position: Vector2): any
/** Godot calls this method to test if [param data] from a control's [method _get_drag_data] can be dropped at [param at_position]. [param at_position] is local to this control.
* This method should only be used to test the data. Process the data in [method _drop_data].
*
*/
/* gdvirtual */ _can_drop_data(at_position: Vector2, data: any): boolean
/** Godot calls this method to pass you the [param data] from a control's [method _get_drag_data] result. Godot first calls [method _can_drop_data] to test if [param data] is allowed to drop at [param at_position] where [param at_position] is local to this control.
*
*/
/* 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.
* 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:**
*
* **Example of usage with a custom scene instance:**
*
*/
/* 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:**
*
* 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.
*
* **Note:** Event position is relative to the control origin.
*/
/* gdvirtual */ _gui_input(event: InputEvent): void
/** Marks an input event as handled. Once you accept an input event, it stops propagating, even to nodes listening to [method Node._unhandled_input] or [method Node._unhandled_key_input].
*
* **Note:** This does not affect the methods in [Input], only the way events are propagated.
*/
accept_event(): void
/** Returns the minimum size for this control. See [member custom_minimum_size]. */
get_minimum_size(): Vector2
/** Returns combined minimum size from [member custom_minimum_size] and [method get_minimum_size]. */
get_combined_minimum_size(): Vector2
/** Sets the anchors to a [param preset] from [enum Control.LayoutPreset] enum. This is the code equivalent to using the Layout menu in the 2D editor.
* If [param keep_offsets] is `true`, control's position will also be updated.
*/
set_anchors_preset(preset: Control.LayoutPreset, keep_offsets: boolean = false): void
/** Sets the offsets to a [param preset] from [enum Control.LayoutPreset] enum. This is the code equivalent to using the Layout menu in the 2D editor.
* Use parameter [param resize_mode] with constants from [enum Control.LayoutPresetMode] to better determine the resulting size of the [Control]. Constant size will be ignored if used with presets that change size, e.g. [constant PRESET_LEFT_WIDE].
* Use parameter [param margin] to determine the gap between the [Control] and the edges.
*/
set_offsets_preset(preset: Control.LayoutPreset, resize_mode: Control.LayoutPresetMode = 0, margin: int64 = 0): void
/** Sets both anchor preset and offset preset. See [method set_anchors_preset] and [method set_offsets_preset]. */
set_anchors_and_offsets_preset(preset: Control.LayoutPreset, resize_mode: Control.LayoutPresetMode = 0, margin: int64 = 0): void
_set_anchor(side: Side, anchor: float64): void
/** Sets the anchor for the specified [enum Side] to [param anchor]. A setter method for [member anchor_bottom], [member anchor_left], [member anchor_right] and [member anchor_top].
* If [param keep_offset] is `true`, offsets aren't updated after this operation.
* If [param push_opposite_anchor] is `true` and the opposite anchor overlaps this anchor, the opposite one will have its value overridden. For example, when setting left anchor to 1 and the right anchor has value of 0.5, the right anchor will also get value of 1. If [param push_opposite_anchor] was `false`, the left anchor would get value 0.5.
*/
set_anchor(side: Side, anchor: float64, keep_offset: boolean = false, push_opposite_anchor: boolean = true): void
/** Returns the anchor for the specified [enum Side]. A getter method for [member anchor_bottom], [member anchor_left], [member anchor_right] and [member anchor_top]. */
get_anchor(side: Side): float64
/** Sets the offset for the specified [enum Side] to [param offset]. A setter method for [member offset_bottom], [member offset_left], [member offset_right] and [member offset_top]. */
set_offset(side: Side, offset: float64): void
/** Returns the offset for the specified [enum Side]. A getter method for [member offset_bottom], [member offset_left], [member offset_right] and [member offset_top]. */
get_offset(offset: Side): float64
/** Works the same as [method set_anchor], but instead of `keep_offset` argument and automatic update of offset, it allows to set the offset yourself (see [method set_offset]). */
set_anchor_and_offset(side: Side, anchor: float64, offset: float64, push_opposite_anchor: boolean = false): void
/** Sets [member offset_left] and [member offset_top] at the same time. Equivalent of changing [member position]. */
set_begin(position: Vector2): void
/** Sets [member offset_right] and [member offset_bottom] at the same time. */
set_end(position: Vector2): void
/** Sets the [member position] to given [param position].
* If [param keep_offsets] is `true`, control's anchors will be updated instead of offsets.
*/
set_position(position: Vector2, keep_offsets: boolean = false): void
/** Sets the size (see [member size]).
* If [param keep_offsets] is `true`, control's anchors will be updated instead of offsets.
*/
set_size(size: Vector2, keep_offsets: boolean = false): void
/** Resets the size to [method get_combined_minimum_size]. This is equivalent to calling `set_size(Vector2())` (or any size below the minimum). */
reset_size(): void
/** Sets the [member global_position] to given [param position].
* If [param keep_offsets] is `true`, control's anchors will be updated instead of offsets.
*/
set_global_position(position: Vector2, keep_offsets: boolean = false): void
/** Returns [member offset_left] and [member offset_top]. See also [member position]. */
get_begin(): Vector2
/** Returns [member offset_right] and [member offset_bottom]. */
get_end(): Vector2
/** Returns the width/height occupied in the parent control. */
get_parent_area_size(): Vector2
/** 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:**
*
*/
get_screen_position(): Vector2
/** Returns the position and size of the control in the coordinate system of the containing node. See [member position], [member scale] and [member size].
*
* **Note:** If [member rotation] is not the default rotation, the resulting size is not meaningful.
*
* **Note:** Setting [member Viewport.gui_snap_controls_to_pixels] to `true` can lead to rounding inaccuracies between the displayed control and the returned [Rect2].
*/
get_rect(): Rect2
/** Returns the position and size of the control relative to the containing canvas. See [member global_position] and [member size].
*
* **Note:** If the node itself or any parent [CanvasItem] between the node and the canvas have a non default rotation or skew, the resulting size is likely not meaningful.
*
* **Note:** Setting [member Viewport.gui_snap_controls_to_pixels] to `true` can lead to rounding inaccuracies between the displayed control and the returned [Rect2].
*/
get_global_rect(): Rect2
/** Returns `true` if this is the current focused control. See [member focus_mode]. */
has_focus(): boolean
/** Steal the focus from another control and become the focused control (see [member focus_mode]).
*
* **Note:** Using this method together with [method Callable.call_deferred] makes it more reliable, especially when called inside [method Node._ready].
*/
grab_focus(): void
/** Give up the focus. No other control will be able to receive input. */
release_focus(): void
/** Finds the previous (above in the tree) [Control] that can receive the focus. */
find_prev_valid_focus(): Control
/** Finds the next (below in the tree) [Control] that can receive the focus. */
find_next_valid_focus(): Control
/** Finds the next [Control] that can receive the focus on the specified [enum Side].
*
* **Note:** This is different from [method get_focus_neighbor], which returns the path of a specified focus neighbor.
*/
find_valid_focus_neighbor(side: Side): Control
/** Prevents `*_theme_*_override` methods from emitting [constant NOTIFICATION_THEME_CHANGED] until [method end_bulk_theme_override] is called. */
begin_bulk_theme_override(): void
/** Ends a bulk theme override update. See [method begin_bulk_theme_override]. */
end_bulk_theme_override(): void
/** Creates a local override for a theme icon 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_icon_override].
* See also [method get_theme_icon].
*/
add_theme_icon_override(name: StringName, texture: Texture2D): void
/** 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:**
*
*/
add_theme_stylebox_override(name: StringName, stylebox: StyleBox): void
/** Creates a local override for a theme [Font] 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_font_override].
* See also [method get_theme_font].
*/
add_theme_font_override(name: StringName, font: Font): void
/** Creates a local override for a theme font size 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_font_size_override].
* See also [method get_theme_font_size].
*/
add_theme_font_size_override(name: StringName, font_size: int64): void
/** 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:**
*
*/
add_theme_color_override(name: StringName, color: Color): void
/** Creates a local override for a theme constant 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_constant_override].
* See also [method get_theme_constant].
*/
add_theme_constant_override(name: StringName, constant: int64): void
/** Removes a local override for a theme icon with the specified [param name] previously added by [method add_theme_icon_override] or via the Inspector dock. */
remove_theme_icon_override(name: StringName): void
/** Removes a local override for a theme [StyleBox] with the specified [param name] previously added by [method add_theme_stylebox_override] or via the Inspector dock. */
remove_theme_stylebox_override(name: StringName): void
/** Removes a local override for a theme [Font] with the specified [param name] previously added by [method add_theme_font_override] or via the Inspector dock. */
remove_theme_font_override(name: StringName): void
/** Removes a local override for a theme font size with the specified [param name] previously added by [method add_theme_font_size_override] or via the Inspector dock. */
remove_theme_font_size_override(name: StringName): void
/** Removes a local override for a theme [Color] with the specified [param name] previously added by [method add_theme_color_override] or via the Inspector dock. */
remove_theme_color_override(name: StringName): void
/** Removes a local override for a theme constant with the specified [param name] previously added by [method add_theme_constant_override] or via the Inspector dock. */
remove_theme_constant_override(name: StringName): void
/** Returns an icon from the first matching [Theme] in the tree if that [Theme] has an icon item with the specified [param name] and [param theme_type].
* See [method get_theme_color] for details.
*/
get_theme_icon(name: StringName, theme_type: StringName = ''): Texture2D
/** Returns a [StyleBox] from the first matching [Theme] in the tree if that [Theme] has a stylebox item with the specified [param name] and [param theme_type].
* See [method get_theme_color] for details.
*/
get_theme_stylebox(name: StringName, theme_type: StringName = ''): StyleBox
/** Returns a [Font] from the first matching [Theme] in the tree if that [Theme] has a font item with the specified [param name] and [param theme_type].
* See [method get_theme_color] for details.
*/
get_theme_font(name: StringName, theme_type: StringName = ''): Font
/** Returns a font size from the first matching [Theme] in the tree if that [Theme] has a font size item with the specified [param name] and [param theme_type].
* See [method get_theme_color] for details.
*/
get_theme_font_size(name: StringName, theme_type: StringName = ''): int64
/** Returns a [Color] from the first matching [Theme] in the tree if that [Theme] has a color item with the specified [param name] and [param theme_type]. If [param theme_type] is omitted the class name of the current control is used as the type, or [member theme_type_variation] if it is defined. If the type is a class name its parent classes are also checked, in order of inheritance. If the type is a variation its base types are checked, in order of dependency, then the control's class name and its parent classes are checked.
* For the current control its local overrides are considered first (see [method add_theme_color_override]), then its assigned [member theme]. After the current control, each parent control and its assigned [member theme] are considered; controls without a [member theme] assigned are skipped. If no matching [Theme] is found in the tree, the custom project [Theme] (see [member ProjectSettings.gui/theme/custom]) and the default [Theme] are used (see [ThemeDB]).
*
*/
get_theme_color(name: StringName, theme_type: StringName = ''): Color
/** Returns a constant from the first matching [Theme] in the tree if that [Theme] has a constant item with the specified [param name] and [param theme_type].
* See [method get_theme_color] for details.
*/
get_theme_constant(name: StringName, theme_type: StringName = ''): int64
/** Returns `true` if there is a local override for a theme icon with the specified [param name] in this [Control] node.
* See [method add_theme_icon_override].
*/
has_theme_icon_override(name: StringName): boolean
/** Returns `true` if there is a local override for a theme [StyleBox] with the specified [param name] in this [Control] node.
* See [method add_theme_stylebox_override].
*/
has_theme_stylebox_override(name: StringName): boolean
/** Returns `true` if there is a local override for a theme [Font] with the specified [param name] in this [Control] node.
* See [method add_theme_font_override].
*/
has_theme_font_override(name: StringName): boolean
/** Returns `true` if there is a local override for a theme font size with the specified [param name] in this [Control] node.
* See [method add_theme_font_size_override].
*/
has_theme_font_size_override(name: StringName): boolean
/** Returns `true` if there is a local override for a theme [Color] with the specified [param name] in this [Control] node.
* See [method add_theme_color_override].
*/
has_theme_color_override(name: StringName): boolean
/** Returns `true` if there is a local override for a theme constant with the specified [param name] in this [Control] node.
* See [method add_theme_constant_override].
*/
has_theme_constant_override(name: StringName): boolean
/** Returns `true` if there is a matching [Theme] in the tree that has an icon item with the specified [param name] and [param theme_type].
* See [method get_theme_color] for details.
*/
has_theme_icon(name: StringName, theme_type: StringName = ''): boolean
/** Returns `true` if there is a matching [Theme] in the tree that has a stylebox item with the specified [param name] and [param theme_type].
* See [method get_theme_color] for details.
*/
has_theme_stylebox(name: StringName, theme_type: StringName = ''): boolean
/** Returns `true` if there is a matching [Theme] in the tree that has a font item with the specified [param name] and [param theme_type].
* See [method get_theme_color] for details.
*/
has_theme_font(name: StringName, theme_type: StringName = ''): boolean
/** Returns `true` if there is a matching [Theme] in the tree that has a font size item with the specified [param name] and [param theme_type].
* See [method get_theme_color] for details.
*/
has_theme_font_size(name: StringName, theme_type: StringName = ''): boolean
/** Returns `true` if there is a matching [Theme] in the tree that has a color item with the specified [param name] and [param theme_type].
* See [method get_theme_color] for details.
*/
has_theme_color(name: StringName, theme_type: StringName = ''): boolean
/** Returns `true` if there is a matching [Theme] in the tree that has a constant item with the specified [param name] and [param theme_type].
* See [method get_theme_color] for details.
*/
has_theme_constant(name: StringName, theme_type: StringName = ''): boolean
/** Returns the default base scale value from the first matching [Theme] in the tree if that [Theme] has a valid [member Theme.default_base_scale] value.
* See [method get_theme_color] for details.
*/
get_theme_default_base_scale(): float64
/** Returns the default font from the first matching [Theme] in the tree if that [Theme] has a valid [member Theme.default_font] value.
* See [method get_theme_color] for details.
*/
get_theme_default_font(): Font
/** Returns the default font size value from the first matching [Theme] in the tree if that [Theme] has a valid [member Theme.default_font_size] value.
* See [method get_theme_color] for details.
*/
get_theme_default_font_size(): int64
/** Returns the parent control node. */
get_parent_control(): Control
/** 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.
*/
get_tooltip(at_position: Vector2 = Vector2.ZERO): string
/** Returns the mouse cursor shape the control displays on mouse hover. See [enum CursorShape]. */
get_cursor_shape(position: Vector2 = Vector2.ZERO): Control.CursorShape
/** Sets the focus neighbor for the specified [enum Side] to the [Control] at [param neighbor] node path. A setter method for [member focus_neighbor_bottom], [member focus_neighbor_left], [member focus_neighbor_right] and [member focus_neighbor_top]. */
set_focus_neighbor(side: Side, neighbor: NodePath | string): void
/** Returns the focus neighbor for the specified [enum Side]. A getter method for [member focus_neighbor_bottom], [member focus_neighbor_left], [member focus_neighbor_right] and [member focus_neighbor_top].
*
* **Note:** To find the next [Control] on the specific [enum Side], even if a neighbor is not assigned, use [method find_valid_focus_neighbor].
*/
get_focus_neighbor(side: Side): NodePath
/** Forces drag and bypasses [method _get_drag_data] and [method set_drag_preview] by passing [param data] and [param preview]. Drag will start even if the mouse is neither over nor pressed on this control.
* The methods [method _can_drop_data] and [method _drop_data] must be implemented on controls that want to receive drop data.
*/
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.
*
*/
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.
*/
set_drag_forwarding(drag_func: Callable, can_drop_func: Callable, drop_func: Callable): void
/** Shows the given control at the mouse pointer. A good time to call this method is in [method _get_drag_data]. The control must not be in the scene tree. You should not free the control, and you should not keep a reference to the control beyond the duration of the drag. It will be deleted automatically after the drag has ended.
*
*/
set_drag_preview(control: Control): void
/** Returns `true` if a drag operation is successful. Alternative to [method Viewport.gui_is_drag_successful].
* Best used with [constant Node.NOTIFICATION_DRAG_END].
*/
is_drag_successful(): boolean
/** Moves the mouse cursor to [param position], relative to [member position] of this [Control].
*
* **Note:** [method warp_mouse] is only supported on Windows, macOS and Linux. It has no effect on Android, iOS and Web.
*/
warp_mouse(position: Vector2): void
/** 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. */
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. */
get clip_contents(): boolean
set clip_contents(value: boolean)
/** The minimum size of the node's bounding rectangle. If you set it to a value greater than `(0, 0)`, the node's bounding rectangle will always have at least this size. Note that [Control] nodes have their internal minimum size returned by [method get_minimum_size]. It depends on the control's contents, like text, textures, or style boxes. The actual minimum size is the maximum value of this property and the internal minimum size (see [method get_combined_minimum_size]). */
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). */
get layout_direction(): int64
set layout_direction(value: int64)
get layout_mode(): int64
set layout_mode(value: int64)
get anchors_preset(): int64
set anchors_preset(value: int64)
/** Anchors the left edge of the node to the origin, the center or the end of its parent control. It changes how the left offset updates when the node moves or changes size. You can use one of the [enum Anchor] constants for convenience. */
get anchor_left(): float64
set anchor_left(value: float64)
/** Anchors the top edge of the node to the origin, the center or the end of its parent control. It changes how the top offset updates when the node moves or changes size. You can use one of the [enum Anchor] constants for convenience. */
get anchor_top(): float64
set anchor_top(value: float64)
/** Anchors the right edge of the node to the origin, the center or the end of its parent control. It changes how the right offset updates when the node moves or changes size. You can use one of the [enum Anchor] constants for convenience. */
get anchor_right(): float64
set anchor_right(value: float64)
/** Anchors the bottom edge of the node to the origin, the center, or the end of its parent control. It changes how the bottom offset updates when the node moves or changes size. You can use one of the [enum Anchor] constants for convenience. */
get anchor_bottom(): float64
set anchor_bottom(value: float64)
/** 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)
/** 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)
/** 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)
/** 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)
/** 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
set grow_horizontal(value: int64)
/** Controls the direction on the vertical axis in which the control should grow if its vertical 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_vertical(): int64
set grow_vertical(value: int64)
/** The size of the node's bounding rectangle, in the node's coordinate system. [Container] nodes update this property automatically. */
get size(): Vector2
set size(value: Vector2)
/** The node's position, relative to its containing node. It corresponds to the rectangle's top-left corner. The property is not affected by [member pivot_offset]. */
get position(): Vector2
set position(value: Vector2)
/** The node's global position, relative to the world (usually to the [CanvasLayer]). */
get global_position(): Vector2
set global_position(value: Vector2)
/** The node's rotation around its pivot, in radians. See [member pivot_offset] to change the pivot's position.
*
* **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. */
get rotation_degrees(): float64
set rotation_degrees(value: float64)
/** 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:** [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.
*
* **Note:** If the Control node is a child of a [Container] node, the scale will be reset to `Vector2(1, 1)` when the scene is instantiated. To set the Control's scale when it's instantiated, wait for one frame using `await get_tree().process_frame` then set its [member scale] property.
*/
get scale(): Vector2
set scale(value: Vector2)
/** By default, the node's pivot is its top-left corner. When you change its [member rotation] or [member scale], it will rotate or scale around this pivot. Set this property to [member size] / 2 to pivot around the Control's center. */
get pivot_offset(): Vector2
set pivot_offset(value: Vector2)
/** Tells the parent [Container] nodes how they should resize and place the node on the X axis. Use a combination of the [enum SizeFlags] constants to change the flags. See the constants to learn what each does. */
get size_flags_horizontal(): int64
set size_flags_horizontal(value: int64)
/** Tells the parent [Container] nodes how they should resize and place the node on the Y axis. Use a combination of the [enum SizeFlags] constants to change the flags. See the constants to learn what each does. */
get size_flags_vertical(): int64
set size_flags_vertical(value: int64)
/** If the node and at least one of its neighbors uses the [constant SIZE_EXPAND] size flag, the parent [Container] will let it take more or less space depending on this property. If this node has a stretch ratio of 2 and its neighbor a ratio of 1, this node will take two thirds of the available space. */
get size_flags_stretch_ratio(): float64
set size_flags_stretch_ratio(value: float64)
/** If `true`, automatically converts code line numbers, list indices, [SpinBox] and [ProgressBar] values from the Western Arabic (0..9) to the numeral systems used in current locale.
*
* **Note:** Numbers within the text are not automatically converted, it can be done manually, using [method TextServer.format_number].
*/
get localize_numeral_system(): boolean
set localize_numeral_system(value: boolean)
/** Toggles if any text should automatically change to its translated version depending on the current locale. */
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 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)
/** 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)
/** Tells Godot which node it should give focus to if the user presses the top arrow on the keyboard or top on a gamepad by default. You can change the key by editing the [member ProjectSettings.input/ui_up] input action. The node must be a [Control]. If this property is not set, Godot will give focus to the closest [Control] to the top of this one. */
get focus_neighbor_top(): NodePath
set focus_neighbor_top(value: NodePath | string)
/** Tells Godot which node it should give focus to if the user presses the right arrow on the keyboard or right on a gamepad by default. You can change the key by editing the [member ProjectSettings.input/ui_right] input action. The node must be a [Control]. If this property is not set, Godot will give focus to the closest [Control] to the right of this one. */
get focus_neighbor_right(): NodePath
set focus_neighbor_right(value: NodePath | string)
/** Tells Godot which node it should give focus to if the user presses the down arrow on the keyboard or down on a gamepad by default. You can change the key by editing the [member ProjectSettings.input/ui_down] input action. The node must be a [Control]. If this property is not set, Godot will give focus to the closest [Control] to the bottom of this one. */
get focus_neighbor_bottom(): NodePath
set focus_neighbor_bottom(value: NodePath | string)
/** Tells Godot which node it should give focus to if the user presses [kbd]Tab[/kbd] on a keyboard by default. You can change the key by editing the [member ProjectSettings.input/ui_focus_next] input action.
* If this property is not set, Godot will select a "best guess" based on surrounding nodes in the scene tree.
*/
get focus_next(): NodePath
set focus_next(value: NodePath | string)
/** Tells Godot which node it should give focus to if the user presses [kbd]Shift + Tab[/kbd] on a keyboard by default. You can change the key by editing the [member ProjectSettings.input/ui_focus_prev] input action.
* If this property is not set, Godot will select a "best guess" based on surrounding nodes in the scene tree.
*/
get focus_previous(): NodePath
set focus_previous(value: NodePath | string)
/** The focus access mode for the control (None, Click or All). Only one Control can be focused at the same time, and it will receive keyboard, gamepad, and mouse signals. */
get focus_mode(): int64
set focus_mode(value: int64)
/** Controls whether the control will be able to receive mouse button input events through [method _gui_input] and how these events should be handled. Also controls whether the control can receive the [signal mouse_entered], and [signal mouse_exited] signals. See the constants to learn what each does. */
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.
* 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.
*/
get mouse_force_pass_scroll_events(): boolean
set mouse_force_pass_scroll_events(value: boolean)
/** The default cursor shape for this control. Useful for Godot plugins and applications or games that use the system's mouse cursors.
*
* **Note:** On Linux, shapes may vary depending on the cursor theme of the system.
*/
get mouse_default_cursor_shape(): int64
set mouse_default_cursor_shape(value: int64)
/** The [Node] which must be a parent of the focused [Control] for the shortcut to be activated. If `null`, the shortcut can be activated when any control is focused (a global shortcut). This allows shortcuts to be accepted only when the user has a certain area of the GUI focused. */
get shortcut_context(): Object
set shortcut_context(value: Object)
/** The [Theme] resource this node and all its [Control] and [Window] children use. If a child node has its own [Theme] resource set, theme items are merged with child's definitions having higher priority.
*
* **Note:** [Window] styles will have no effect unless the window is embedded.
*/
get theme(): Theme
set theme(value: Theme)
/** The name of a theme type variation used by this [Control] to look up its own theme items. When empty, the class name of the node is used (e.g. [code skip-lint]Button` for the [Button] control), as well as the class names of all parent classes (in order of inheritance).
* When set, this property gives the highest priority to the type of the specified name. This type can in turn extend another type, forming a dependency chain. See [method Theme.set_type_variation]. If the theme item cannot be found using this type or its base types, lookup falls back on the class names.
*
* **Note:** To look up [Control]'s own items use various `get_theme_*` methods without specifying `theme_type`.
*
* **Note:** Theme items are looked for in the tree order, from branch to root, where each [Control] node is checked for its [member theme] property. The earliest match against any type/class name is returned. The project-level Theme and the default Theme are checked last.
*/
get theme_type_variation(): string
set theme_type_variation(value: string)
/** Emitted when the control changes size. */
readonly resized: Signal0
/** Emitted when the node receives an [InputEvent]. */
readonly gui_input: Signal1
/** Emitted when the mouse cursor enters the control's (or any child control's) visible area, that is not occluded behind other Controls or Windows, provided its [member mouse_filter] lets the event reach it and regardless if it's currently focused or not.
*
* **Note:** [member CanvasItem.z_index] doesn't affect, which Control receives the signal.
*/
readonly mouse_entered: Signal0
/** Emitted when the mouse cursor leaves the control's (and all child control's) visible area, that is not occluded behind other Controls or Windows, provided its [member mouse_filter] lets the event reach it and regardless if it's currently focused or not.
*
* **Note:** [member CanvasItem.z_index] doesn't affect, which Control receives the signal.
*
* **Note:** If you want to check whether the mouse truly left the area, ignoring any top nodes, you can use code like this:
*
*/
readonly mouse_exited: Signal0
/** Emitted when the node gains focus. */
readonly focus_entered: Signal0
/** Emitted when the node loses focus. */
readonly focus_exited: Signal0
/** Emitted when one of the size flags changes. See [member size_flags_horizontal] and [member size_flags_vertical]. */
readonly size_flags_changed: Signal0
/** Emitted when the node's minimum size changes. */
readonly minimum_size_changed: Signal0
/** Emitted when the [constant NOTIFICATION_THEME_CHANGED] notification is sent. */
readonly theme_changed: Signal0
}
class ControlEditorPlugin extends EditorPlugin {
constructor(identifier?: any)
}
class ControlEditorPopupButton extends Button {
constructor(identifier?: any)
}
class ControlEditorPresetPicker extends MarginContainer {
constructor(identifier?: any)
}
class ControlEditorToolbar 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
*/
class ConvexPolygonShape2D extends Shape2D {
constructor(identifier?: any)
/** Based on the set of points provided, this assigns the [member points] property using the convex hull algorithm, removing all unneeded points. See [method Geometry2D.convex_hull] for details. */
set_point_cloud(point_cloud: PackedVector2Array | Vector2[]): void
/** The polygon's list of vertices that form a convex hull. Can be in either clockwise or counterclockwise order.
* **Warning:** Only set this property to a list of points that actually form a convex hull. Use [method set_point_cloud] to generate the convex hull of an arbitrary set of points.
*/
get points(): PackedVector2Array
set points(value: PackedVector2Array | Vector2[])
}
/** A 3D convex polyhedron shape used for physics collision.
*
* @link https://docs.godotengine.org/en/4.3/classes/class_convexpolygonshape3d.html
*/
class ConvexPolygonShape3D extends Shape3D {
constructor(identifier?: any)
/** The list of 3D points forming the convex polygon shape. */
get points(): GArray
set points(value: GArray)
}
class CreateDialog 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
*/
class Crypto extends RefCounted {
constructor(identifier?: any)
/** Generates a [PackedByteArray] of cryptographically secure random bytes with given [param size]. */
generate_random_bytes(size: int64): PackedByteArray
/** Generates an RSA [CryptoKey] that can be used for creating self-signed certificates and passed to [method StreamPeerTLS.accept_stream]. */
generate_rsa(size: int64): CryptoKey
/** Generates a self-signed [X509Certificate] from the given [CryptoKey] and [param issuer_name]. The certificate validity will be defined by [param not_before] and [param not_after] (first valid date and last valid date). The [param issuer_name] must contain at least "CN=" (common name, i.e. the domain name), "O=" (organization, i.e. your company name), "C=" (country, i.e. 2 lettered ISO-3166 code of the country the organization is based in).
* A small example to generate an RSA key and an X509 self-signed certificate.
*
*/
generate_self_signed_certificate(key: CryptoKey, issuer_name: string = 'CN=myserver,O=myorganisation,C=IT', not_before: string = '20140101000000', not_after: string = '20340101000000'): X509Certificate
/** Sign a given [param hash] of type [param hash_type] with the provided private [param key]. */
sign(hash_type: HashingContext.HashType, hash: PackedByteArray | byte[] | ArrayBuffer, key: CryptoKey): PackedByteArray
/** Verify that a given [param signature] for [param hash] of type [param hash_type] against the provided public [param key]. */
verify(hash_type: HashingContext.HashType, hash: PackedByteArray | byte[] | ArrayBuffer, signature: PackedByteArray | byte[] | ArrayBuffer, key: CryptoKey): boolean
/** Encrypt the given [param plaintext] with the provided public [param key].
*
* **Note:** The maximum size of accepted plaintext is limited by the key size.
*/
encrypt(key: CryptoKey, plaintext: PackedByteArray | byte[] | ArrayBuffer): PackedByteArray
/** Decrypt the given [param ciphertext] with the provided private [param key].
*
* **Note:** The maximum size of accepted ciphertext is limited by the key size.
*/
decrypt(key: CryptoKey, ciphertext: PackedByteArray | byte[] | ArrayBuffer): PackedByteArray
/** Generates an [url=https://en.wikipedia.org/wiki/HMAC]HMAC[/url] digest of [param msg] using [param key]. The [param hash_type] parameter is the hashing algorithm that is used for the inner and outer hashes.
* Currently, only [constant HashingContext.HASH_SHA256] and [constant HashingContext.HASH_SHA1] are supported.
*/
hmac_digest(hash_type: HashingContext.HashType, key: PackedByteArray | byte[] | ArrayBuffer, msg: PackedByteArray | byte[] | ArrayBuffer): PackedByteArray
/** Compares two [PackedByteArray]s for equality without leaking timing information in order to prevent timing attacks.
* See [url=https://paragonie.com/blog/2015/11/preventing-timing-attacks-on-string-comparison-with-double-hmac-strategy]this blog post[/url] for more information.
*/
constant_time_compare(trusted: PackedByteArray | byte[] | ArrayBuffer, received: PackedByteArray | byte[] | ArrayBuffer): boolean
}
/** A cryptographic key (RSA or elliptic-curve).
*
* @link https://docs.godotengine.org/en/4.3/classes/class_cryptokey.html
*/
class CryptoKey extends Resource {
constructor(identifier?: any)
/** Saves a key to the given [param path]. If [param public_only] is `true`, only the public key will be saved.
*
* **Note:** [param path] should be a "*.pub" file if [param public_only] is `true`, a "*.key" file otherwise.
*/
save(path: string, public_only: boolean = false): GError
/** Loads a key from [param path]. If [param public_only] is `true`, only the public key will be loaded.
*
* **Note:** [param path] should be a "*.pub" file if [param public_only] is `true`, a "*.key" file otherwise.
*/
load(path: string, public_only: boolean = false): GError
/** Returns `true` if this CryptoKey only has the public part, and not the private one. */
is_public_only(): boolean
/** Returns a string containing the key in PEM format. If [param public_only] is `true`, only the public key will be included. */
save_to_string(public_only: boolean = false): string
/** Loads a key from the given [param string_key]. If [param public_only] is `true`, only the public key will be loaded. */
load_from_string(string_key: string, public_only: boolean = false): GError
}
/** 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
*/
class Cubemap extends ImageTextureLayered {
constructor(identifier?: any)
/** Creates a placeholder version of this resource ([PlaceholderCubemap]). */
create_placeholder(): Resource
}
/** An array of [Cubemap]s, stored together and with a single reference.
*
* @link https://docs.godotengine.org/en/4.3/classes/class_cubemaparray.html
*/
class CubemapArray extends ImageTextureLayered {
constructor(identifier?: any)
/** Creates a placeholder version of this resource ([PlaceholderCubemapArray]). */
create_placeholder(): Resource
}
namespace Curve {
enum TangentMode {
/** The tangent on this side of the point is user-defined. */
TANGENT_FREE = 0,
/** The curve calculates the tangent on this side of the point as the slope halfway towards the adjacent point. */
TANGENT_LINEAR = 1,
/** The total number of available tangent modes. */
TANGENT_MODE_COUNT = 2,
}
}
/** A mathematical curve.
*
* @link https://docs.godotengine.org/en/4.3/classes/class_curve.html
*/
class Curve extends Resource {
constructor(identifier?: any)
/** Adds a point to the curve. For each side, if the `*_mode` is [constant TANGENT_LINEAR], the `*_tangent` angle (in degrees) uses the slope of the curve halfway to the adjacent point. Allows custom assignments to the `*_tangent` angle if `*_mode` is set to [constant TANGENT_FREE]. */
add_point(position: Vector2, left_tangent: float64 = 0, right_tangent: float64 = 0, left_mode: Curve.TangentMode = 0, right_mode: Curve.TangentMode = 0): int64
/** Removes the point at [param index] from the curve. */
remove_point(index: int64): void
/** Removes all points from the curve. */
clear_points(): void
/** Returns the curve coordinates for the point at [param index]. */
get_point_position(index: int64): Vector2
/** Assigns the vertical position [param y] to the point at [param index]. */
set_point_value(index: int64, y: float64): void
/** Sets the offset from `0.5`. */
set_point_offset(index: int64, offset: float64): int64
/** Returns the Y value for the point that would exist at the X position [param offset] along the curve. */
sample(offset: float64): float64
/** Returns the Y value for the point that would exist at the X position [param offset] along the curve using the baked cache. Bakes the curve's points if not already baked. */
sample_baked(offset: float64): float64
/** Returns the left tangent angle (in degrees) for the point at [param index]. */
get_point_left_tangent(index: int64): float64
/** Returns the right tangent angle (in degrees) for the point at [param index]. */
get_point_right_tangent(index: int64): float64
/** Returns the left [enum TangentMode] for the point at [param index]. */
get_point_left_mode(index: int64): Curve.TangentMode
/** Returns the right [enum TangentMode] for the point at [param index]. */
get_point_right_mode(index: int64): Curve.TangentMode
/** Sets the left tangent angle for the point at [param index] to [param tangent]. */
set_point_left_tangent(index: int64, tangent: float64): void
/** Sets the right tangent angle for the point at [param index] to [param tangent]. */
set_point_right_tangent(index: int64, tangent: float64): void
/** Sets the left [enum TangentMode] for the point at [param index] to [param mode]. */
set_point_left_mode(index: int64, mode: Curve.TangentMode): void
/** Sets the right [enum TangentMode] for the point at [param index] to [param mode]. */
set_point_right_mode(index: int64, mode: Curve.TangentMode): void
/** 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. */
get min_value(): float64
set min_value(value: float64)
/** The maximum value the curve can reach. */
get max_value(): float64
set max_value(value: float64)
/** The number of points to include in the baked (i.e. cached) curve data. */
get bake_resolution(): int64
set bake_resolution(value: int64)
get _data(): int64
set _data(value: int64)
/** The number of points describing the curve. */
get point_count(): any /*Points,point_*/
set point_count(value: any /*Points,point_*/)
/** Emitted when [member max_value] or [member min_value] is changed. */
readonly range_changed: Signal0
}
/** Describes a Bézier curve in 2D space.
*
* @link https://docs.godotengine.org/en/4.3/classes/class_curve2d.html
*/
class Curve2D extends Resource {
constructor(identifier?: any)
/** Adds a point with the specified [param position] relative to the curve's own position, with control points [param in] and [param out]. Appends the new point at the end of the point list.
* If [param index] is given, the new point is inserted before the existing point identified by index [param index]. Every existing point starting from [param index] is shifted further down the list of points. The index must be greater than or equal to `0` and must not exceed the number of existing points in the line. See [member point_count].
*/
add_point(position: Vector2, in_: Vector2 = Vector2.ZERO, out_: Vector2 = Vector2.ZERO, index: int64 = -1): void
/** Sets the position for the vertex [param idx]. If the index is out of bounds, the function sends an error to the console. */
set_point_position(idx: int64, position: Vector2): void
/** Returns the position of the vertex [param idx]. If the index is out of bounds, the function sends an error to the console, and returns `(0, 0)`. */
get_point_position(idx: int64): Vector2
/** Sets the position of the control point leading to the vertex [param idx]. If the index is out of bounds, the function sends an error to the console. The position is relative to the vertex. */
set_point_in(idx: int64, position: Vector2): void
/** Returns the position of the control point leading to the vertex [param idx]. The returned position is relative to the vertex [param idx]. If the index is out of bounds, the function sends an error to the console, and returns `(0, 0)`. */
get_point_in(idx: int64): Vector2
/** Sets the position of the control point leading out of the vertex [param idx]. If the index is out of bounds, the function sends an error to the console. The position is relative to the vertex. */
set_point_out(idx: int64, position: Vector2): void
/** Returns the position of the control point leading out of the vertex [param idx]. The returned position is relative to the vertex [param idx]. If the index is out of bounds, the function sends an error to the console, and returns `(0, 0)`. */
get_point_out(idx: int64): Vector2
/** Deletes the point [param idx] from the curve. Sends an error to the console if [param idx] is out of bounds. */
remove_point(idx: int64): void
/** Removes all points from the curve. */
clear_points(): void
/** Returns the position between the vertex [param idx] and the vertex `idx + 1`, where [param t] controls if the point is the first vertex (`t = 0.0`), the last vertex (`t = 1.0`), or in between. Values of [param t] outside the range (`0.0 <= t <= 1.0`) give strange, but predictable results.
* If [param idx] is out of bounds it is truncated to the first or last vertex, and [param t] is ignored. If the curve has no points, the function sends an error to the console, and returns `(0, 0)`.
*/
sample(idx: int64, t: float64): Vector2
/** Returns the position at the vertex [param fofs]. It calls [method sample] using the integer part of [param fofs] as `idx`, and its fractional part as `t`. */
samplef(fofs: float64): Vector2
/** Returns the total length of the curve, based on the cached points. Given enough density (see [member bake_interval]), it should be approximate enough. */
get_baked_length(): float64
/** Returns a point within the curve at position [param offset], where [param offset] is measured as a pixel distance along the curve.
* To do that, it finds the two cached points where the [param offset] lies between, then interpolates the values. This interpolation is cubic if [param cubic] is set to `true`, or linear if set to `false`.
* Cubic interpolation tends to follow the curves better, but linear is faster (and often, precise enough).
*/
sample_baked(offset: float64 = 0, cubic: boolean = false): Vector2
/** Similar to [method sample_baked], but returns [Transform2D] that includes a rotation along the curve, with [member Transform2D.origin] as the point position and the [member Transform2D.x] vector pointing in the direction of the path at that point. Returns an empty transform if the length of the curve is `0`.
*
*/
sample_baked_with_rotation(offset: float64 = 0, cubic: boolean = false): Transform2D
/** Returns the cache of points as a [PackedVector2Array]. */
get_baked_points(): PackedVector2Array
/** Returns the closest point on baked segments (in curve's local space) to [param to_point].
* [param to_point] must be in this curve's local space.
*/
get_closest_point(to_point: Vector2): Vector2
/** Returns the closest offset to [param to_point]. This offset is meant to be used in [method sample_baked].
* [param to_point] must be in this curve's local space.
*/
get_closest_offset(to_point: Vector2): float64
/** Returns a list of points along the curve, with a curvature controlled point density. That is, the curvier parts will have more points than the straighter parts.
* This approximation makes straight segments between each point, then subdivides those segments until the resulting shape is similar enough.
* [param max_stages] controls how many subdivisions a curve segment may face before it is considered approximate enough. Each subdivision splits the segment in half, so the default 5 stages may mean up to 32 subdivisions per curve segment. Increase with care!
* [param tolerance_degrees] controls how many degrees the midpoint of a segment may deviate from the real curve, before the segment has to be subdivided.
*/
tessellate(max_stages: int64 = 5, tolerance_degrees: float64 = 4): PackedVector2Array
/** Returns a list of points along the curve, with almost uniform density. [param max_stages] controls how many subdivisions a curve segment may face before it is considered approximate enough. Each subdivision splits the segment in half, so the default 5 stages may mean up to 32 subdivisions per curve segment. Increase with care!
* [param tolerance_length] controls the maximal distance between two neighboring points, before the segment has to be subdivided.
*/
tessellate_even_length(max_stages: int64 = 5, tolerance_length: float64 = 20): PackedVector2Array
/** The distance in pixels 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)
get _data(): int64
set _data(value: int64)
/** The number of points describing the curve. */
get point_count(): any /*Points,point_*/
set point_count(value: any /*Points,point_*/)
}
/** Describes a Bézier curve in 3D space.
*
* @link https://docs.godotengine.org/en/4.3/classes/class_curve3d.html
*/
class Curve3D extends Resource {
constructor(identifier?: any)
/** Adds a point with the specified [param position] relative to the curve's own position, with control points [param in] and [param out]. Appends the new point at the end of the point list.
* If [param index] is given, the new point is inserted before the existing point identified by index [param index]. Every existing point starting from [param index] is shifted further down the list of points. The index must be greater than or equal to `0` and must not exceed the number of existing points in the line. See [member point_count].
*/
add_point(position: Vector3, in_: Vector3 = new Vector3(0, 0, 0), out_: Vector3 = new Vector3(0, 0, 0), index: int64 = -1): void
/** Sets the position for the vertex [param idx]. If the index is out of bounds, the function sends an error to the console. */
set_point_position(idx: int64, position: Vector3): void
/** Returns the position of the vertex [param idx]. If the index is out of bounds, the function sends an error to the console, and returns `(0, 0, 0)`. */
get_point_position(idx: int64): Vector3
/** Sets the tilt angle in radians for the point [param idx]. If the index is out of bounds, the function sends an error to the console.
* The tilt controls the rotation along the look-at axis an object traveling the path would have. In the case of a curve controlling a [PathFollow3D], this tilt is an offset over the natural tilt the [PathFollow3D] calculates.
*/
set_point_tilt(idx: int64, tilt: float64): void
/** Returns the tilt angle in radians for the point [param idx]. If the index is out of bounds, the function sends an error to the console, and returns `0`. */
get_point_tilt(idx: int64): float64
/** Sets the position of the control point leading to the vertex [param idx]. If the index is out of bounds, the function sends an error to the console. The position is relative to the vertex. */
set_point_in(idx: int64, position: Vector3): void
/** Returns the position of the control point leading to the vertex [param idx]. The returned position is relative to the vertex [param idx]. If the index is out of bounds, the function sends an error to the console, and returns `(0, 0, 0)`. */
get_point_in(idx: int64): Vector3
/** Sets the position of the control point leading out of the vertex [param idx]. If the index is out of bounds, the function sends an error to the console. The position is relative to the vertex. */
set_point_out(idx: int64, position: Vector3): void
/** Returns the position of the control point leading out of the vertex [param idx]. The returned position is relative to the vertex [param idx]. If the index is out of bounds, the function sends an error to the console, and returns `(0, 0, 0)`. */
get_point_out(idx: int64): Vector3
/** Deletes the point [param idx] from the curve. Sends an error to the console if [param idx] is out of bounds. */
remove_point(idx: int64): void
/** Removes all points from the curve. */
clear_points(): void
/** Returns the position between the vertex [param idx] and the vertex `idx + 1`, where [param t] controls if the point is the first vertex (`t = 0.0`), the last vertex (`t = 1.0`), or in between. Values of [param t] outside the range (`0.0 >= t <=1`) give strange, but predictable results.
* If [param idx] is out of bounds it is truncated to the first or last vertex, and [param t] is ignored. If the curve has no points, the function sends an error to the console, and returns `(0, 0, 0)`.
*/
sample(idx: int64, t: float64): Vector3
/** Returns the position at the vertex [param fofs]. It calls [method sample] using the integer part of [param fofs] as `idx`, and its fractional part as `t`. */
samplef(fofs: float64): Vector3
/** Returns the total length of the curve, based on the cached points. Given enough density (see [member bake_interval]), it should be approximate enough. */
get_baked_length(): float64
/** Returns a point within the curve at position [param offset], where [param offset] is measured as a distance in 3D units along the curve. To do that, it finds the two cached points where the [param offset] lies between, then interpolates the values. This interpolation is cubic if [param cubic] is set to `true`, or linear if set to `false`.
* Cubic interpolation tends to follow the curves better, but linear is faster (and often, precise enough).
*/
sample_baked(offset: float64 = 0, cubic: boolean = false): Vector3
/** Returns a [Transform3D] with `origin` as point position, `basis.x` as sideway vector, `basis.y` as up vector, `basis.z` as forward vector. When the curve length is 0, there is no reasonable way to calculate the rotation, all vectors aligned with global space axes. See also [method sample_baked]. */
sample_baked_with_rotation(offset: float64 = 0, cubic: boolean = false, apply_tilt: boolean = false): Transform3D
/** Returns an up vector within the curve at position [param offset], where [param offset] is measured as a distance in 3D units along the curve. To do that, it finds the two cached up vectors where the [param offset] lies between, then interpolates the values. If [param apply_tilt] is `true`, an interpolated tilt is applied to the interpolated up vector.
* If the curve has no up vectors, the function sends an error to the console, and returns `(0, 1, 0)`.
*/
sample_baked_up_vector(offset: float64, apply_tilt: boolean = false): Vector3
/** Returns the cache of points as a [PackedVector3Array]. */
get_baked_points(): PackedVector3Array
/** Returns the cache of tilts as a [PackedFloat32Array]. */
get_baked_tilts(): PackedFloat32Array
/** Returns the cache of up vectors as a [PackedVector3Array].
* If [member up_vector_enabled] is `false`, the cache will be empty.
*/
get_baked_up_vectors(): PackedVector3Array
/** Returns the closest point on baked segments (in curve's local space) to [param to_point].
* [param to_point] must be in this curve's local space.
*/
get_closest_point(to_point: Vector3): Vector3
/** Returns the closest offset to [param to_point]. This offset is meant to be used in [method sample_baked] or [method sample_baked_up_vector].
* [param to_point] must be in this curve's local space.
*/
get_closest_offset(to_point: Vector3): float64
/** Returns a list of points along the curve, with a curvature controlled point density. That is, the curvier parts will have more points than the straighter parts.
* This approximation makes straight segments between each point, then subdivides those segments until the resulting shape is similar enough.
* [param max_stages] controls how many subdivisions a curve segment may face before it is considered approximate enough. Each subdivision splits the segment in half, so the default 5 stages may mean up to 32 subdivisions per curve segment. Increase with care!
* [param tolerance_degrees] controls how many degrees the midpoint of a segment may deviate from the real curve, before the segment has to be subdivided.
*/
tessellate(max_stages: int64 = 5, tolerance_degrees: float64 = 4): PackedVector3Array
/** Returns a list of points along the curve, with almost uniform density. [param max_stages] controls how many subdivisions a curve segment may face before it is considered approximate enough. Each subdivision splits the segment in half, so the default 5 stages may mean up to 32 subdivisions per curve segment. Increase with care!
* [param tolerance_length] controls the maximal distance between two neighboring points, before the segment has to be subdivided.
*/
tessellate_even_length(max_stages: int64 = 5, tolerance_length: float64 = 0.2): PackedVector3Array
/** 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)
get _data(): int64
set _data(value: int64)
/** The number of points describing the curve. */
get point_count(): any /*Points,point_*/
set point_count(value: any /*Points,point_*/)
/** If `true`, the curve will bake up vectors used for orientation. This is used when [member PathFollow3D.rotation_mode] is set to [constant PathFollow3D.ROTATION_ORIENTED]. Changing it forces the cache to be recomputed. */
get up_vector_enabled(): boolean
set up_vector_enabled(value: boolean)
}
class CurveEditorPlugin extends EditorPlugin {
constructor(identifier?: any)
}
class CurvePreviewGenerator extends EditorResourcePreviewGenerator {
constructor(identifier?: any)
}
namespace CurveTexture {
enum TextureMode {
/** Store the curve equally across the red, green and blue channels. This uses more video memory, but is more compatible with shaders that only read the green and blue values. */
TEXTURE_MODE_RGB = 0,
/** Store the curve only in the red channel. This saves video memory, but some custom shaders may not be able to work with this. */
TEXTURE_MODE_RED = 1,
}
}
/** A 1D texture where pixel brightness corresponds to points on a curve.
*
* @link https://docs.godotengine.org/en/4.3/classes/class_curvetexture.html
*/
class CurveTexture extends Texture2D {
constructor(identifier?: any)
/** The width of the texture (in pixels). Higher values make it possible to represent high-frequency data better (such as sudden direction changes), at the cost of increased generation time and memory usage. */
get width(): int64
set width(value: int64)
/** The format the texture should be generated with. When passing a CurveTexture as an input to a [Shader], this may need to be adjusted. */
get texture_mode(): int64
set texture_mode(value: int64)
/** The [Curve] that is rendered onto the texture. */
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
*/
class CurveXYZTexture extends Texture2D {
constructor(identifier?: any)
/** The width of the texture (in pixels). Higher values make it possible to represent high-frequency data better (such as sudden direction changes), at the cost of increased generation time and memory usage. */
get width(): int64
set width(value: int64)
/** The [Curve] that is rendered onto the texture's red channel. */
get curve_x(): Curve
set curve_x(value: Curve)
/** The [Curve] that is rendered onto the texture's green channel. */
get curve_y(): Curve
set curve_y(value: Curve)
/** The [Curve] that is rendered onto the texture's blue channel. */
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
*/
class CylinderMesh extends PrimitiveMesh {
constructor(identifier?: any)
/** Top radius of the cylinder. If set to `0.0`, the top faces will not be generated, resulting in a conic shape. See also [member cap_top]. */
get top_radius(): float64
set top_radius(value: float64)
/** Bottom radius of the cylinder. If set to `0.0`, the bottom faces will not be generated, resulting in a conic shape. See also [member cap_bottom]. */
get bottom_radius(): float64
set bottom_radius(value: float64)
/** Full height of the cylinder. */
get height(): float64
set height(value: float64)
/** Number of radial segments on the cylinder. Higher values result in a more detailed cylinder/cone at the cost of performance. */
get radial_segments(): int64
set radial_segments(value: int64)
/** Number of edge rings along the height of the cylinder. Changing [member rings] does not have any visual impact unless a shader or procedural mesh tool is used to alter the vertex data. Higher values result in more subdivisions, which can be used to create smoother-looking effects with shaders or procedural mesh tools (at the cost of performance). When not altering the vertex data using a shader or procedural mesh tool, [member rings] should be kept to its default value. */
get rings(): int64
set rings(value: int64)
/** If `true`, generates a cap at the top of the cylinder. This can be set to `false` to speed up generation and rendering when the cap is never seen by the camera. See also [member top_radius].
*
* **Note:** If [member top_radius] is `0.0`, cap generation is always skipped even if [member cap_top] is `true`.
*/
get cap_top(): boolean
set cap_top(value: boolean)
/** If `true`, generates a cap at the bottom of the cylinder. This can be set to `false` to speed up generation and rendering when the cap is never seen by the camera. See also [member bottom_radius].
*
* **Note:** If [member bottom_radius] is `0.0`, cap generation is always skipped even if [member cap_bottom] is `true`.
*/
get cap_bottom(): boolean
set cap_bottom(value: boolean)
}
/** A 3D cylinder shape used for physics collision.
*
* @link https://docs.godotengine.org/en/4.3/classes/class_cylindershape3d.html
*/
class CylinderShape3D extends Shape3D {
constructor(identifier?: any)
/** The cylinder's height. */
get height(): float64
set height(value: float64)
/** The cylinder's radius. */
get radius(): float64
set radius(value: float64)
}
/** Helper class to implement a DTLS server.
*
* @link https://docs.godotengine.org/en/4.3/classes/class_dtlsserver.html
*/
class DTLSServer extends RefCounted {
constructor(identifier?: any)
/** Setup the DTLS server to use the given [param server_options]. See [method TLSOptions.server]. */
setup(server_options: TLSOptions): GError
/** Try to initiate the DTLS handshake with the given [param udp_peer] which must be already connected (see [method PacketPeerUDP.connect_to_host]).
*
* **Note:** You must check that the state of the return PacketPeerUDP is [constant PacketPeerDTLS.STATUS_HANDSHAKING], as it is normal that 50% of the new connections will be invalid due to cookie exchange.
*/
take_connection(udp_peer: PacketPeerUDP): PacketPeerDTLS
}
/** 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
*/
class DampedSpringJoint2D extends Joint2D {
constructor(identifier?: any)
/** The spring joint's maximum length. The two attached bodies cannot stretch it past this value. */
get length(): float64
set length(value: float64)
/** When the bodies attached to the spring joint move they stretch or squash it. The joint always tries to resize towards this length. */
get rest_length(): float64
set rest_length(value: float64)
/** The higher the value, the less the bodies attached to the joint will deform it. The joint applies an opposing force to the bodies, the product of the stiffness multiplied by the size difference from its resting length. */
get stiffness(): float64
set stiffness(value: float64)
/** The spring joint's damping ratio. A value between `0` and `1`. When the two bodies move into different directions the system tries to align them to the spring axis again. A high [member damping] value forces the attached bodies to align faster. */
get damping(): float64
set damping(value: float64)
}
class DebugAdapterParser extends Object {
constructor(identifier?: any)
req_initialize(params: GDictionary): GDictionary
req_disconnect(params: GDictionary): GDictionary
req_launch(params: GDictionary): GDictionary
req_attach(params: GDictionary): GDictionary
req_restart(params: GDictionary): GDictionary
req_terminate(params: GDictionary): GDictionary
req_configurationDone(params: GDictionary): GDictionary
req_pause(params: GDictionary): GDictionary
req_continue(params: GDictionary): GDictionary
req_threads(params: GDictionary): GDictionary
req_stackTrace(params: GDictionary): GDictionary
req_setBreakpoints(params: GDictionary): GDictionary
req_breakpointLocations(params: GDictionary): GDictionary
req_scopes(params: GDictionary): GDictionary
req_variables(params: GDictionary): GDictionary
req_next(params: GDictionary): GDictionary
req_stepIn(params: GDictionary): GDictionary
req_evaluate(params: GDictionary): GDictionary
["req_godot/put_msg"]: (params: GDictionary) => GDictionary
}
class DebugAdapterServer extends EditorPlugin {
constructor(identifier?: any)
}
class DebuggerEditorPlugin extends EditorPlugin {
constructor(identifier?: any)
}
namespace Decal {
enum DecalTexture {
/** [Texture2D] corresponding to [member texture_albedo]. */
TEXTURE_ALBEDO = 0,
/** [Texture2D] corresponding to [member texture_normal]. */
TEXTURE_NORMAL = 1,
/** [Texture2D] corresponding to [member texture_orm]. */
TEXTURE_ORM = 2,
/** [Texture2D] corresponding to [member texture_emission]. */
TEXTURE_EMISSION = 3,
/** Max size of [enum DecalTexture] enum. */
TEXTURE_MAX = 4,
}
}
/** Node that projects a texture onto a [MeshInstance3D].
*
* @link https://docs.godotengine.org/en/4.3/classes/class_decal.html
*/
class Decal 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`.
* One case where this is better than accessing the texture directly is when you want to copy one Decal's textures to another. For example:
*
*/
set_texture(type: Decal.DecalTexture, texture: Texture2D): void
/** Returns 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 `albedo_tex = $Decal.get_texture(Decal.TEXTURE_ALBEDO)`, use `albedo_tex = $Decal.texture_albedo`.
* One case where this is better than accessing the texture directly is when you want to copy one Decal's textures to another. For example:
*
*/
get_texture(type: Decal.DecalTexture): Texture2D
/** Sets the size of the [AABB] used by the decal. All dimensions must be set to a value greater than zero (they will be clamped to `0.001` if this is not the case). The AABB goes from `-size/2` to `size/2`.
*
* **Note:** To improve culling efficiency of "hard surface" decals, set their [member upper_fade] and [member lower_fade] to `0.0` and set the Y component of the [member size] as low as possible. This will reduce the decals' AABB size without affecting their appearance.
*/
get size(): Vector3
set size(value: Vector3)
/** [Texture2D] with the base [Color] of the Decal. Either this or the [member texture_emission] 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_albedo(): Texture2D
set texture_albedo(value: Texture2D)
/** [Texture2D] with the per-pixel normal map for the decal. Use this to add extra detail to decals.
*
* **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].
*
* **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)
/** [Texture2D] storing ambient occlusion, roughness, and metallic for the decal. Use this to add extra detail to decals.
*
* **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].
*
* **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)
/** [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)
/** 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
set emission_energy(value: float64)
/** Changes the [Color] of the Decal by multiplying the albedo and emission colors with this value. The alpha component is only taken into account when multiplying the albedo color, not the emission color. See also [member emission_energy] and [member albedo_mix] to change the emission and albedo intensity independently of each other. */
get modulate(): Color
set modulate(value: Color)
/** Blends the albedo [Color] of the decal with albedo [Color] of the underlying mesh. This can be set to `0.0` to create a decal that only affects normal or ORM. In this case, an albedo texture is still required as its alpha channel will determine where the normal and ORM will be overridden. See also [member modulate]. */
get albedo_mix(): float64
set albedo_mix(value: float64)
/** Fades the Decal if the angle between the Decal's [AABB] and the target surface becomes too large. A value of `0` projects the Decal regardless of angle, a value of `1` limits the Decal to surfaces that are nearly perpendicular.
*
* **Note:** Setting [member normal_fade] to a value greater than `0.0` has a small performance cost due to the added normal angle computations.
*/
get normal_fade(): float64
set normal_fade(value: float64)
/** Sets the curve over which the decal will fade as the surface gets further from the center of the [AABB]. Only positive values are valid (negative values will be clamped to `0.0`). See also [member lower_fade]. */
get upper_fade(): float64
set upper_fade(value: float64)
/** Sets the curve over which the decal will fade as the surface gets further from the center of the [AABB]. Only positive values are valid (negative values will be clamped to `0.0`). See also [member upper_fade]. */
get lower_fade(): float64
set lower_fade(value: float64)
/** If `true`, decals will smoothly fade away when far from the active [Camera3D] starting at [member distance_fade_begin]. The Decal 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 Decals in a scene and thus improve performance. */
get distance_fade_enabled(): boolean
set distance_fade_enabled(value: boolean)
/** The distance from the camera at which the Decal begins to fade away (in 3D units). */
get distance_fade_begin(): float64
set distance_fade_begin(value: float64)
/** The distance over which the Decal fades (in 3D units). The Decal becomes slowly more transparent over this distance and is completely invisible at the end. Higher values result in a smoother fade-out transition, which is more suited when the camera moves fast. */
get distance_fade_length(): float64
set distance_fade_length(value: float64)
/** Specifies which [member VisualInstance3D.layers] this decal will project on. By default, Decals affect all layers. This is used so you can specify which types of objects receive the Decal and which do not. This is especially useful so you can ensure that dynamic objects don't accidentally receive a Decal intended for the terrain under them. */
get cull_mask(): int64
set cull_mask(value: int64)
}
class DecalGizmoPlugin extends EditorNode3DGizmoPlugin {
constructor(identifier?: any)
}
class DefaultThemeEditorPreview extends ThemeEditorPreview {
constructor(identifier?: any)
}
class DependencyEditor extends AcceptDialog {
constructor(identifier?: any)
}
class DependencyEditorOwners extends AcceptDialog {
constructor(identifier?: any)
}
class DependencyErrorDialog extends ConfirmationDialog {
constructor(identifier?: any)
}
class DependencyRemoveDialog extends ConfirmationDialog {
constructor(identifier?: any)
readonly resource_removed: Signal1