// AUTO-GENERATED
///
declare module "godot" {
class ReparentDialog extends ConfirmationDialog {
constructor(identifier?: any)
_cancel(): void
readonly reparent: Signal2
}
class ReplicationEditor extends VBoxContainer {
constructor(identifier?: any)
_update_config(): void
_update_value(property: NodePath | string, column: int64, value: int64): void
}
/** Base class for serializable objects.
*
* @link https://docs.godotengine.org/en/4.3/classes/class_resource.html
*/
class Resource extends RefCounted {
constructor(identifier?: any)
/** Override this method to return a custom [RID] when [method get_rid] is called. */
/* gdvirtual */ _get_rid(): RID
/** Override this method to customize the newly duplicated resource created from [method PackedScene.instantiate], if the original's [member resource_local_to_scene] is set to `true`.
* **Example:** Set a random `damage` value to every local resource from an instantiated scene.
*
*/
/* gdvirtual */ _setup_local_to_scene(): void
/** Sets the [member resource_path] to [param path], potentially overriding an existing cache entry for this path. Further attempts to load an overridden resource by path will instead return this resource. */
take_over_path(path: string): void
/** Returns the [RID] of this resource (or an empty RID). Many resources (such as [Texture2D], [Mesh], and so on) are high-level abstractions of resources stored in a specialized server ([DisplayServer], [RenderingServer], etc.), so this function will return the original [RID]. */
get_rid(): RID
/** If [member resource_local_to_scene] is set to `true` and the resource has been loaded from a [PackedScene] instantiation, returns the root [Node] of the scene where this resource is used. Otherwise, returns `null`. */
get_local_scene(): Node
/** Calls [method _setup_local_to_scene]. If [member resource_local_to_scene] is set to `true`, this method is automatically called from [method PackedScene.instantiate] by the newly duplicated resource within the scene instance. */
setup_local_to_scene(): void
/** Generates a unique identifier for a resource to be contained inside a [PackedScene], based on the current date, time, and a random value. The returned string is only composed of letters (`a` to `y`) and numbers (`0` to `8`). See also [member resource_scene_unique_id]. */
static generate_scene_unique_id(): string
/** Emits the [signal changed] signal. This method is called automatically for some built-in resources.
*
* **Note:** For custom resources, it's recommended to call this method whenever a meaningful change occurs, such as a modified property. This ensures that custom [Object]s depending on the resource are properly updated.
*
*/
emit_changed(): void
/** Duplicates this resource, returning a new resource with its `export`ed or [constant PROPERTY_USAGE_STORAGE] properties copied from the original.
* If [param subresources] is `false`, a shallow copy is returned; nested resources within subresources are not duplicated and are shared with the original resource (with one exception; see below). If [param subresources] is `true`, a deep copy is returned; nested subresources will be duplicated and are not shared (with two exceptions; see below).
* [param subresources] is usually respected, with the following exceptions:
* - Subresource properties with the [constant PROPERTY_USAGE_ALWAYS_DUPLICATE] flag are always duplicated.
* - Subresource properties with the [constant PROPERTY_USAGE_NEVER_DUPLICATE] flag are never duplicated.
* - Subresources inside [Array] and [Dictionary] properties are never duplicated.
*
* **Note:** For custom resources, this method will fail if [method Object._init] has been defined with required parameters.
*/
duplicate(subresources: boolean = false): Resource
/** If `true`, the resource is duplicated for each instance of all scenes using it. At run-time, the resource can be modified in one scene without affecting other instances (see [method PackedScene.instantiate]).
*
* **Note:** Changing this property at run-time has no effect on already created duplicate resources.
*/
get resource_local_to_scene(): boolean
set resource_local_to_scene(value: boolean)
/** The unique path to this resource. If it has been saved to disk, the value will be its filepath. If the resource is exclusively contained within a scene, the value will be the [PackedScene]'s filepath, followed by a unique identifier.
*
* **Note:** Setting this property manually may fail if a resource with the same path has already been previously loaded. If necessary, use [method take_over_path].
*/
get resource_path(): string
set resource_path(value: string)
/** An optional name for this resource. When defined, its value is displayed to represent the resource in the Inspector dock. For built-in scripts, the name is displayed as part of the tab name in the script editor.
*
* **Note:** Some resource formats do not support resource names. You can still set the name in the editor or via code, but it will be lost when the resource is reloaded. For example, only built-in scripts can have a resource name, while scripts stored in separate files cannot.
*/
get resource_name(): string
set resource_name(value: string)
/** An unique identifier relative to the this resource's scene. If left empty, the ID is automatically generated when this resource is saved inside a [PackedScene]. If the resource is not inside a scene, this property is empty by default.
*
* **Note:** When the [PackedScene] is saved, if multiple resources in the same scene use the same ID, only the earliest resource in the scene hierarchy keeps the original ID. The other resources are assigned new IDs from [method generate_scene_unique_id].
*
* **Note:** Setting this property does not emit the [signal changed] signal.
* **Warning:** When setting, the ID must only consist of letters, numbers, and underscores. Otherwise, it will fail and default to a randomly generated ID.
*/
get resource_scene_unique_id(): string
set resource_scene_unique_id(value: string)
/** Emitted when the resource changes, usually when one of its properties is modified. See also [method emit_changed].
*
* **Note:** This signal is not emitted automatically for properties of custom resources. If necessary, a setter needs to be created to emit the signal.
*/
readonly changed: Signal0
/** Emitted by a newly duplicated resource with [member resource_local_to_scene] set to `true`. */
readonly setup_local_to_scene_requested: Signal0
}
class ResourceFormatImporterSaver extends ResourceFormatSaver {
constructor(identifier?: any)
}
namespace ResourceFormatLoader {
enum CacheMode {
/** Neither the main resource (the one requested to be loaded) nor any of its subresources are retrieved from cache nor stored into it. Dependencies (external resources) are loaded with [constant CACHE_MODE_REUSE]. */
CACHE_MODE_IGNORE = 0,
/** The main resource (the one requested to be loaded), its subresources, and its dependencies (external resources) are retrieved from cache if present, instead of loaded. Those not cached are loaded and then stored into the cache. The same rules are propagated recursively down the tree of dependencies (external resources). */
CACHE_MODE_REUSE = 1,
/** Like [constant CACHE_MODE_REUSE], but the cache is checked for the main resource (the one requested to be loaded) as well as for each of its subresources. Those already in the cache, as long as the loaded and cached types match, have their data refreshed from storage into the already existing instances. Otherwise, they are recreated as completely new objects. */
CACHE_MODE_REPLACE = 2,
/** Like [constant CACHE_MODE_IGNORE], but propagated recursively down the tree of dependencies (external resources). */
CACHE_MODE_IGNORE_DEEP = 3,
/** Like [constant CACHE_MODE_REPLACE], but propagated recursively down the tree of dependencies (external resources). */
CACHE_MODE_REPLACE_DEEP = 4,
}
}
/** Loads a specific resource type from a file.
*
* @link https://docs.godotengine.org/en/4.3/classes/class_resourceformatloader.html
*/
class ResourceFormatLoader extends RefCounted {
constructor(identifier?: any)
/** Gets the list of extensions for files this loader is able to read. */
/* gdvirtual */ _get_recognized_extensions(): PackedStringArray
/** Tells whether or not this loader should load a resource from its resource path for a given type.
* If it is not implemented, the default behavior returns whether the path's extension is within the ones provided by [method _get_recognized_extensions], and if the type is within the ones provided by [method _get_resource_type].
*/
/* gdvirtual */ _recognize_path(path: string, type: StringName): boolean
/** Tells which resource class this loader can load.
*
* **Note:** Custom resource types defined by scripts aren't known by the [ClassDB], so you might just handle `"Resource"` for them.
*/
/* gdvirtual */ _handles_type(type: StringName): boolean
/** Gets the class name of the resource associated with the given path. If the loader cannot handle it, it should return `""`.
*
* **Note:** Custom resource types defined by scripts aren't known by the [ClassDB], so you might just return `"Resource"` for them.
*/
/* gdvirtual */ _get_resource_type(path: string): string
/** Returns the script class name associated with the [Resource] under the given [param path]. If the resource has no script or the script isn't a named class, it should return `""`. */
/* gdvirtual */ _get_resource_script_class(path: string): string
/* gdvirtual */ _get_resource_uid(path: string): int64
/** If implemented, gets the dependencies of a given resource. If [param add_types] is `true`, paths should be appended `::TypeName`, where `TypeName` is the class name of the dependency.
*
* **Note:** Custom resource types defined by scripts aren't known by the [ClassDB], so you might just return `"Resource"` for them.
*/
/* gdvirtual */ _get_dependencies(path: string, add_types: boolean): PackedStringArray
/** If implemented, renames dependencies within the given resource and saves it. [param renames] is a dictionary `{ String => String }` mapping old dependency paths to new paths.
* Returns [constant OK] on success, or an [enum Error] constant in case of failure.
*/
/* gdvirtual */ _rename_dependencies(path: string, renames: GDictionary): GError
/* gdvirtual */ _exists(path: string): boolean
/* gdvirtual */ _get_classes_used(path: string): PackedStringArray
/** Loads a resource when the engine finds this loader to be compatible. If the loaded resource is the result of an import, [param original_path] will target the source file. Returns a [Resource] object on success, or an [enum Error] constant in case of failure.
* The [param cache_mode] property defines whether and how the cache should be used or updated when loading the resource. See [enum CacheMode] for details.
*/
/* gdvirtual */ _load(path: string, original_path: string, use_sub_threads: boolean, cache_mode: int64): any
}
/** Saves a specific resource type to a file.
*
* @link https://docs.godotengine.org/en/4.3/classes/class_resourceformatsaver.html
*/
class ResourceFormatSaver extends RefCounted {
constructor(identifier?: any)
/** Saves the given resource object to a file at the target [param path]. [param flags] is a bitmask composed with [enum ResourceSaver.SaverFlags] constants.
* Returns [constant OK] on success, or an [enum Error] constant in case of failure.
*/
/* gdvirtual */ _save(resource: Resource, path: string, flags: int64): GError
/** Sets a new UID for the resource at the given [param path]. Returns [constant OK] on success, or an [enum Error] constant in case of failure. */
/* gdvirtual */ _set_uid(path: string, uid: int64): GError
/** Returns whether the given resource object can be saved by this saver. */
/* gdvirtual */ _recognize(resource: Resource): boolean
/** Returns the list of extensions available for saving the resource object, provided it is recognized (see [method _recognize]). */
/* gdvirtual */ _get_recognized_extensions(resource: Resource): PackedStringArray
/** Returns `true` if this saver handles a given save path and `false` otherwise.
* If this method is not implemented, the default behavior returns whether the path's extension is within the ones provided by [method _get_recognized_extensions].
*/
/* gdvirtual */ _recognize_path(resource: Resource, path: string): boolean
}
namespace ResourceImporter {
enum ImportOrder {
/** The default import order. */
IMPORT_ORDER_DEFAULT = 0,
/** The import order for scenes, which ensures scenes are imported *after* all other core resources such as textures. Custom importers should generally have an import order lower than `100` to avoid issues when importing scenes that rely on custom resources. */
IMPORT_ORDER_SCENE = 100,
}
}
/** Base class for resource importers.
*
* @link https://docs.godotengine.org/en/4.3/classes/class_resourceimporter.html
*/
class ResourceImporter extends RefCounted {
constructor(identifier?: any)
}
/** Imports a bitmap font in the BMFont (`.fnt`) format.
*
* @link https://docs.godotengine.org/en/4.3/classes/class_resourceimporterbmfont.html
*/
class ResourceImporterBMFont extends ResourceImporter {
constructor(identifier?: any)
}
/** Imports a [BitMap] resource (2D array of boolean values).
*
* @link https://docs.godotengine.org/en/4.3/classes/class_resourceimporterbitmap.html
*/
class ResourceImporterBitMap extends ResourceImporter {
constructor(identifier?: any)
}
/** Imports comma-separated values
*
* @link https://docs.godotengine.org/en/4.3/classes/class_resourceimportercsvtranslation.html
*/
class ResourceImporterCSVTranslation extends ResourceImporter {
constructor(identifier?: any)
}
/** Imports a TTF, TTC, OTF, OTC, WOFF or WOFF2 font file for font rendering that adapts to any size.
*
* @link https://docs.godotengine.org/en/4.3/classes/class_resourceimporterdynamicfont.html
*/
class ResourceImporterDynamicFont extends ResourceImporter {
constructor(identifier?: any)
}
/** Imports a image for use in scripting, with no rendering capabilities.
*
* @link https://docs.godotengine.org/en/4.3/classes/class_resourceimporterimage.html
*/
class ResourceImporterImage extends ResourceImporter {
constructor(identifier?: any)
}
/** Imports a bitmap font where all glyphs have the same width and height.
*
* @link https://docs.godotengine.org/en/4.3/classes/class_resourceimporterimagefont.html
*/
class ResourceImporterImageFont extends ResourceImporter {
constructor(identifier?: any)
}
/** Imports a 3-dimensional texture ([Texture3D]), a [Texture2DArray], a [Cubemap] or a [CubemapArray].
*
* @link https://docs.godotengine.org/en/4.3/classes/class_resourceimporterlayeredtexture.html
*/
class ResourceImporterLayeredTexture extends ResourceImporter {
constructor(identifier?: any)
}
/** Imports an MP3 audio file for playback.
*
* @link https://docs.godotengine.org/en/4.3/classes/class_resourceimportermp3.html
*/
class ResourceImporterMP3 extends ResourceImporter {
constructor(identifier?: any)
}
/** Imports an OBJ 3D model as an independent [Mesh] or scene.
*
* @link https://docs.godotengine.org/en/4.3/classes/class_resourceimporterobj.html
*/
class ResourceImporterOBJ extends ResourceImporter {
constructor(identifier?: any)
}
/** Imports an Ogg Vorbis audio file for playback.
*
* @link https://docs.godotengine.org/en/4.3/classes/class_resourceimporteroggvorbis.html
*/
class ResourceImporterOggVorbis extends ResourceImporter {
constructor(identifier?: any)
/** This method loads audio data from a PackedByteArray buffer into an AudioStreamOggVorbis object. */
static load_from_buffer(buffer: PackedByteArray | byte[] | ArrayBuffer): AudioStreamOggVorbis
/** This method loads audio data from a file into an AudioStreamOggVorbis object. The file path is provided as a string. */
static load_from_file(path: string): AudioStreamOggVorbis
}
/** Imports a glTF, FBX, Collada or Blender 3D scene.
*
* @link https://docs.godotengine.org/en/4.3/classes/class_resourceimporterscene.html
*/
class ResourceImporterScene extends ResourceImporter {
constructor(identifier?: any)
}
/** Imports native GLSL shaders (not Godot shaders) as a [RDShaderFile].
*
* @link https://docs.godotengine.org/en/4.3/classes/class_resourceimportershaderfile.html
*/
class ResourceImporterShaderFile extends ResourceImporter {
constructor(identifier?: any)
}
/** Imports an image for use in 2D or 3D rendering.
*
* @link https://docs.godotengine.org/en/4.3/classes/class_resourceimportertexture.html
*/
class ResourceImporterTexture extends ResourceImporter {
constructor(identifier?: any)
}
/** Imports a collection of textures from a PNG image into an optimized [AtlasTexture] for 2D rendering.
*
* @link https://docs.godotengine.org/en/4.3/classes/class_resourceimportertextureatlas.html
*/
class ResourceImporterTextureAtlas extends ResourceImporter {
constructor(identifier?: any)
}
/** Imports a WAV audio file for playback.
*
* @link https://docs.godotengine.org/en/4.3/classes/class_resourceimporterwav.html
*/
class ResourceImporterWAV extends ResourceImporter {
constructor(identifier?: any)
}
/** A node used to preload sub-resources inside a scene.
*
* @link https://docs.godotengine.org/en/4.3/classes/class_resourcepreloader.html
*/
class ResourcePreloader extends Node {
constructor(identifier?: any)
/** Adds a resource to the preloader with the given [param name]. If a resource with the given [param name] already exists, the new resource will be renamed to "[param name] N" where N is an incrementing number starting from 2. */
add_resource(name: StringName, resource: Resource): void
/** Removes the resource associated to [param name] from the preloader. */
remove_resource(name: StringName): void
/** Renames a resource inside the preloader from [param name] to [param newname]. */
rename_resource(name: StringName, newname: StringName): void
/** Returns `true` if the preloader contains a resource associated to [param name]. */
has_resource(name: StringName): boolean
/** Returns the resource associated to [param name]. */
get_resource(name: StringName): Resource
/** Returns the list of resources inside the preloader. */
get_resource_list(): PackedStringArray
get resources(): GArray
set resources(value: GArray)
}
class ResourcePreloaderEditor extends PanelContainer {
constructor(identifier?: any)
_update_library(): void
_remove_resource(to_remove: string): void
}
class ResourcePreloaderEditorPlugin extends EditorPlugin {
constructor(identifier?: any)
}
namespace RibbonTrailMesh {
enum Shape {
/** Gives the mesh a single flat face. */
SHAPE_FLAT = 0,
/** Gives the mesh two perpendicular flat faces, making a cross shape. */
SHAPE_CROSS = 1,
}
}
/** Represents a straight ribbon-shaped [PrimitiveMesh] with variable width.
*
* @link https://docs.godotengine.org/en/4.3/classes/class_ribbontrailmesh.html
*/
class RibbonTrailMesh extends PrimitiveMesh {
constructor(identifier?: any)
/** Determines the shape of the ribbon. */
get shape(): int64
set shape(value: int64)
/** The baseline size of the ribbon. The size of a particular section segment is obtained by multiplying this size by the value of the [member curve] at the given distance. */
get size(): float64
set size(value: float64)
/** The total number of sections on the ribbon. */
get sections(): int64
set sections(value: int64)
/** The length of a section of the ribbon. */
get section_length(): float64
set section_length(value: float64)
/** The number of segments in a section. The [member curve] is sampled on each segment to determine its size. Higher values result in a more detailed ribbon at the cost of performance. */
get section_segments(): int64
set section_segments(value: int64)
/** Determines the size of the ribbon along its length. The size of a particular section segment is obtained by multiplying the baseline [member size] by the value of this curve at the given distance. For values smaller than `0`, the faces will be inverted. */
get curve(): Curve
set curve(value: Curve)
}
/** A custom effect for a [RichTextLabel].
*
* @link https://docs.godotengine.org/en/4.3/classes/class_richtexteffect.html
*/
class RichTextEffect extends Resource {
constructor(identifier?: any)
/** Override this method to modify properties in [param char_fx]. The method must return `true` if the character could be transformed successfully. If the method returns `false`, it will skip transformation to avoid displaying broken text. */
/* gdvirtual */ _process_custom_fx(char_fx: CharFXTransform): boolean
}
namespace RichTextLabel {
enum ListType {
/** Each list item has a number marker. */
LIST_NUMBERS = 0,
/** Each list item has a letter marker. */
LIST_LETTERS = 1,
/** Each list item has a roman number marker. */
LIST_ROMAN = 2,
/** Each list item has a filled circle marker. */
LIST_DOTS = 3,
}
enum MenuItems {
/** Copies the selected text. */
MENU_COPY = 0,
/** Selects the whole [RichTextLabel] text. */
MENU_SELECT_ALL = 1,
/** Represents the size of the [enum MenuItems] enum. */
MENU_MAX = 2,
}
enum MetaUnderline {
/** Meta tag does not display an underline, even if [member meta_underlined] is `true`. */
META_UNDERLINE_NEVER = 0,
/** If [member meta_underlined] is `true`, meta tag always display an underline. */
META_UNDERLINE_ALWAYS = 1,
/** If [member meta_underlined] is `true`, meta tag display an underline when the mouse cursor is over it. */
META_UNDERLINE_ON_HOVER = 2,
}
enum ImageUpdateMask {
/** If this bit is set, [method update_image] changes image texture. */
UPDATE_TEXTURE = 1,
/** If this bit is set, [method update_image] changes image size. */
UPDATE_SIZE = 2,
/** If this bit is set, [method update_image] changes image color. */
UPDATE_COLOR = 4,
/** If this bit is set, [method update_image] changes image inline alignment. */
UPDATE_ALIGNMENT = 8,
/** If this bit is set, [method update_image] changes image texture region. */
UPDATE_REGION = 16,
/** If this bit is set, [method update_image] changes image padding. */
UPDATE_PAD = 32,
/** If this bit is set, [method update_image] changes image tooltip. */
UPDATE_TOOLTIP = 64,
/** If this bit is set, [method update_image] changes image width from/to percents. */
UPDATE_WIDTH_IN_PERCENT = 128,
}
}
/** A control for displaying text that can contain different font styles, images, and basic formatting.
*
* @link https://docs.godotengine.org/en/4.3/classes/class_richtextlabel.html
*/
class RichTextLabel extends Control {
constructor(identifier?: any)
/** Returns the text without BBCode mark-up. */
get_parsed_text(): string
/** Adds raw non-BBCode-parsed text to the tag stack. */
add_text(text: string): void
/** Adds an image's opening and closing tags to the tag stack, optionally providing a [param width] and [param height] to resize the image, a [param color] to tint the image and a [param region] to only use parts of the image.
* If [param width] or [param height] is set to 0, the image size will be adjusted in order to keep the original aspect ratio.
* If [param width] and [param height] are not set, but [param region] is, the region's rect will be used.
* [param key] is an optional identifier, that can be used to modify the image via [method update_image].
* If [param pad] is set, and the image is smaller than the size specified by [param width] and [param height], the image padding is added to match the size instead of upscaling.
* If [param size_in_percent] is set, [param width] and [param height] values are percentages of the control width instead of pixels.
*/
add_image(image: Texture2D, width: int64 = 0, height: int64 = 0, color: Color = new Color(1, 1, 1, 1), inline_align: InlineAlignment = 5, region: Rect2 = new Rect2(0, 0, 0, 0), key: any = {}, pad: boolean = false, tooltip: string = '', size_in_percent: boolean = false): void
/** Updates the existing images with the key [param key]. Only properties specified by [param mask] bits are updated. See [method add_image]. */
update_image(key: any, mask: RichTextLabel.ImageUpdateMask, image: Texture2D, width: int64 = 0, height: int64 = 0, color: Color = new Color(1, 1, 1, 1), inline_align: InlineAlignment = 5, region: Rect2 = new Rect2(0, 0, 0, 0), pad: boolean = false, tooltip: string = '', size_in_percent: boolean = false): void
/** Adds a newline tag to the tag stack. */
newline(): void
/** Removes a paragraph of content from the label. Returns `true` if the paragraph exists.
* The [param paragraph] argument is the index of the paragraph to remove, it can take values in the interval `[0, get_paragraph_count() - 1]`.
* If [param no_invalidate] is set to `true`, cache for the subsequent paragraphs is not invalidated. Use it for faster updates if deleted paragraph is fully self-contained (have no unclosed tags), or this call is part of the complex edit operation and [method invalidate_paragraph] will be called at the end of operation.
*/
remove_paragraph(paragraph: int64, no_invalidate: boolean = false): boolean
/** Invalidates [param paragraph] and all subsequent paragraphs cache. */
invalidate_paragraph(paragraph: int64): boolean
/** Adds a [code skip-lint][font]` tag to the tag stack. Overrides default fonts for its duration.
* Passing `0` to [param font_size] will use the existing default font size.
*/
push_font(font: Font, font_size: int64 = 0): void
/** Adds a [code skip-lint][font_size]` tag to the tag stack. Overrides default font size for its duration. */
push_font_size(font_size: int64): void
/** Adds a [code skip-lint][font]` tag with a normal font to the tag stack. */
push_normal(): void
/** Adds a [code skip-lint][font]` tag with a bold font to the tag stack. This is the same as adding a [code skip-lint]**` tag if not currently in a [code skip-lint] *` tag. */
push_bold(): void
/** Adds a [code skip-lint][font]` tag with a bold italics font to the tag stack. */
push_bold_italics(): void
/** Adds a [code skip-lint][font]` tag with an italics font to the tag stack. This is the same as adding an [code skip-lint] *` tag if not currently in a [code skip-lint]**` tag. */
push_italics(): void
/** Adds a [code skip-lint][font]` tag with a monospace font to the tag stack. */
push_mono(): void
/** Adds a [code skip-lint][color]` tag to the tag stack. */
push_color(color: Color): void
/** Adds a [code skip-lint][outline_size]` tag to the tag stack. Overrides default text outline size for its duration. */
push_outline_size(outline_size: int64): void
/** Adds a [code skip-lint][outline_color]` tag to the tag stack. Adds text outline for its duration. */
push_outline_color(color: Color): void
/** Adds a [code skip-lint][p]` tag to the tag stack. */
push_paragraph(alignment: HorizontalAlignment, base_direction: Control.TextDirection = 0, language: string = '', st_parser: TextServer.StructuredTextParser = 0, justification_flags: TextServer.JustificationFlag = 163, tab_stops: PackedFloat32Array | float32[] = []): void
/** Adds an [code skip-lint][indent]` tag to the tag stack. Multiplies [param level] by current [member tab_size] to determine new margin length. */
push_indent(level: int64): void
/** Adds [code skip-lint][ol]` or [code skip-lint][ul]` tag to the tag stack. Multiplies [param level] by current [member tab_size] to determine new margin length. */
push_list(level: int64, type: RichTextLabel.ListType, capitalize: boolean, bullet: string = '•'): void
/** Adds a meta tag to the tag stack. Similar to the BBCode [code skip-lint][url=something]{text}[/url]`, but supports non-[String] metadata types.
* If [member meta_underlined] is `true`, meta tags display an underline. This behavior can be customized with [param underline_mode].
*
* **Note:** Meta tags do nothing by default when clicked. To assign behavior when clicked, connect [signal meta_clicked] to a function that is called when the meta tag is clicked.
*/
push_meta(data: any, underline_mode: RichTextLabel.MetaUnderline = 1): void
/** Adds a [code skip-lint][hint]` tag to the tag stack. Same as BBCode [code skip-lint][hint=something]{text}[/hint]`. */
push_hint(description: string): void
/** Adds language code used for text shaping algorithm and Open-Type font features. */
push_language(language: string): void
/** Adds a [code skip-lint][u]` tag to the tag stack. */
push_underline(): void
/** Adds a [code skip-lint][s]` tag to the tag stack. */
push_strikethrough(): void
/** Adds a [code skip-lint][table=columns,inline_align]` tag to the tag stack. Use [method set_table_column_expand] to set column expansion ratio. Use [method push_cell] to add cells. */
push_table(columns: int64, inline_align: InlineAlignment = 0, align_to_row: int64 = -1): void
/** Adds a [code skip-lint][dropcap]` tag to the tag stack. Drop cap (dropped capital) is a decorative element at the beginning of a paragraph that is larger than the rest of the text. */
push_dropcap(string_: string, font: Font, size: int64, dropcap_margins: Rect2 = new Rect2(0, 0, 0, 0), color: Color = new Color(1, 1, 1, 1), outline_size: int64 = 0, outline_color: Color = new Color(0, 0, 0, 0)): void
/** Edits the selected column's expansion options. If [param expand] is `true`, the column expands in proportion to its expansion ratio versus the other columns' ratios.
* For example, 2 columns with ratios 3 and 4 plus 70 pixels in available width would expand 30 and 40 pixels, respectively.
* If [param expand] is `false`, the column will not contribute to the total ratio.
*/
set_table_column_expand(column: int64, expand: boolean, ratio: int64 = 1): void
/** Sets color of a table cell. Separate colors for alternating rows can be specified. */
set_cell_row_background_color(odd_row_bg: Color, even_row_bg: Color): void
/** Sets color of a table cell border. */
set_cell_border_color(color: Color): void
/** Sets minimum and maximum size overrides for a table cell. */
set_cell_size_override(min_size: Vector2, max_size: Vector2): void
/** Sets inner padding of a table cell. */
set_cell_padding(padding: Rect2): void
/** Adds a [code skip-lint][cell]` tag to the tag stack. Must be inside a [code skip-lint][table]` tag. See [method push_table] for details. Use [method set_table_column_expand] to set column expansion ratio, [method set_cell_border_color] to set cell border, [method set_cell_row_background_color] to set cell background, [method set_cell_size_override] to override cell size, and [method set_cell_padding] to set padding. */
push_cell(): void
/** Adds a [code skip-lint][fgcolor]` tag to the tag stack. */
push_fgcolor(fgcolor: Color): void
/** Adds a [code skip-lint][bgcolor]` tag to the tag stack. */
push_bgcolor(bgcolor: Color): void
/** Adds a custom effect tag to the tag stack. The effect does not need to be in [member custom_effects]. The environment is directly passed to the effect. */
push_customfx(effect: RichTextEffect, env: GDictionary): void
/** Adds a context marker to the tag stack. See [method pop_context]. */
push_context(): void
/** Terminates tags opened after the last [method push_context] call (including context marker), or all tags if there's no context marker on the stack. */
pop_context(): void
/** Terminates the current tag. Use after `push_*` methods to close BBCodes manually. Does not need to follow `add_*` methods. */
pop(): void
/** Terminates all tags opened by `push_*` methods. */
pop_all(): void
/** Clears the tag stack, causing the label to display nothing.
*
* **Note:** This method does not affect [member text], and its contents will show again if the label is redrawn. However, setting [member text] to an empty [String] also clears the stack.
*/
clear(): void
/** Returns the vertical scrollbar.
* **Warning:** This is a required internal node, removing and freeing it may cause a crash. If you wish to hide it or any of its children, use their [member CanvasItem.visible] property.
*/
get_v_scroll_bar(): VScrollBar
/** Scrolls the window's top line to match [param line]. */
scroll_to_line(line: int64): void
/** Scrolls the window's top line to match first line of the [param paragraph]. */
scroll_to_paragraph(paragraph: int64): void
/** Scrolls to the beginning of the current selection. */
scroll_to_selection(): void
/** Returns the current selection first character index if a selection is active, `-1` otherwise. Does not include BBCodes. */
get_selection_from(): int64
/** Returns the current selection last character index if a selection is active, `-1` otherwise. Does not include BBCodes. */
get_selection_to(): int64
/** Select all the text.
* If [member selection_enabled] is `false`, no selection will occur.
*/
select_all(): void
/** Returns the current selection text. Does not include BBCodes. */
get_selected_text(): string
/** Clears the current selection. */
deselect(): void
/** The assignment version of [method append_text]. Clears the tag stack and inserts the new content. */
parse_bbcode(bbcode: string): void
/** Parses [param bbcode] and adds tags to the tag stack as needed.
*
* **Note:** Using this method, you can't close a tag that was opened in a previous [method append_text] call. This is done to improve performance, especially when updating large RichTextLabels since rebuilding the whole BBCode every time would be slower. If you absolutely need to close a tag in a future method call, append the [member text] instead of using [method append_text].
*/
append_text(bbcode: string): void
/** If [member threaded] is enabled, returns `true` if the background thread has finished text processing, otherwise always return `true`. */
is_ready(): boolean
/** Returns the line number of the character position provided. Line and character numbers are both zero-indexed.
*
* **Note:** If [member threaded] is enabled, this method returns a value for the loaded part of the document. Use [method is_ready] or [signal finished] to determine whether document is fully loaded.
*/
get_character_line(character: int64): int64
/** Returns the paragraph number of the character position provided. Paragraph and character numbers are both zero-indexed.
*
* **Note:** If [member threaded] is enabled, this method returns a value for the loaded part of the document. Use [method is_ready] or [signal finished] to determine whether document is fully loaded.
*/
get_character_paragraph(character: int64): int64
/** Returns the total number of characters from text tags. Does not include BBCodes. */
get_total_character_count(): int64
/** Returns the total number of lines in the text. Wrapped text is counted as multiple lines.
*
* **Note:** If [member threaded] is enabled, this method returns a value for the loaded part of the document. Use [method is_ready] or [signal finished] to determine whether document is fully loaded.
*/
get_line_count(): int64
/** Returns the number of visible lines.
*
* **Note:** If [member threaded] is enabled, this method returns a value for the loaded part of the document. Use [method is_ready] or [signal finished] to determine whether document is fully loaded.
*/
get_visible_line_count(): int64
/** Returns the total number of paragraphs (newlines or `p` tags in the tag stack's text tags). Considers wrapped text as one paragraph. */
get_paragraph_count(): int64
/** Returns the number of visible paragraphs. A paragraph is considered visible if at least one of its lines is visible.
*
* **Note:** If [member threaded] is enabled, this method returns a value for the loaded part of the document. Use [method is_ready] or [signal finished] to determine whether document is fully loaded.
*/
get_visible_paragraph_count(): int64
/** Returns the height of the content.
*
* **Note:** If [member threaded] is enabled, this method returns a value for the loaded part of the document. Use [method is_ready] or [signal finished] to determine whether document is fully loaded.
*/
get_content_height(): int64
/** Returns the width of the content.
*
* **Note:** If [member threaded] is enabled, this method returns a value for the loaded part of the document. Use [method is_ready] or [signal finished] to determine whether document is fully loaded.
*/
get_content_width(): int64
/** Returns the vertical offset of the line found at the provided index.
*
* **Note:** If [member threaded] is enabled, this method returns a value for the loaded part of the document. Use [method is_ready] or [signal finished] to determine whether document is fully loaded.
*/
get_line_offset(line: int64): float64
/** Returns the vertical offset of the paragraph found at the provided index.
*
* **Note:** If [member threaded] is enabled, this method returns a value for the loaded part of the document. Use [method is_ready] or [signal finished] to determine whether document is fully loaded.
*/
get_paragraph_offset(paragraph: int64): float64
/** Parses BBCode parameter [param expressions] into a dictionary. */
parse_expressions_for_values(expressions: PackedStringArray | string[]): GDictionary
/** Installs a custom effect. This can also be done in the RichTextLabel inspector using the [member custom_effects] property. [param effect] should be a valid [RichTextEffect].
* Example RichTextEffect:
*
* Registering the above effect in RichTextLabel from script:
*
*/
install_effect(effect: any): void
/** Returns the [PopupMenu] of this [RichTextLabel]. By default, this menu is displayed when right-clicking on the [RichTextLabel].
* You can add custom menu items or remove standard ones. Make sure your IDs don't conflict with the standard ones (see [enum MenuItems]). For example:
*
* **Warning:** This is a required internal node, removing and freeing it may cause a crash. If you wish to hide it or any of its children, use their [member Window.visible] property.
*/
get_menu(): PopupMenu
/** Returns whether the menu is visible. Use this instead of `get_menu().visible` to improve performance (so the creation of the menu is avoided). */
is_menu_visible(): boolean
/** Executes a given action as defined in the [enum MenuItems] enum. */
menu_option(option: int64): void
/** If `true`, the label uses BBCode formatting.
*
* **Note:** This only affects the contents of [member text], not the tag stack.
*/
get bbcode_enabled(): boolean
set bbcode_enabled(value: boolean)
/** The label's text in BBCode format. Is not representative of manual modifications to the internal tag stack. Erases changes made by other methods when edited.
*
* **Note:** If [member bbcode_enabled] is `true`, it is unadvised to use the `+=` operator with [member text] (e.g. `text += "some string"`) as it replaces the whole text and can cause slowdowns. It will also erase all BBCode that was added to stack using `push_*` methods. Use [method append_text] for adding text instead, unless you absolutely need to close a tag that was opened in an earlier method call.
*/
get text(): string
set text(value: string)
/** If `true`, the label's minimum size will be automatically updated to fit its content, matching the behavior of [Label]. */
get fit_content(): boolean
set fit_content(value: boolean)
/** If `true`, the scrollbar is visible. Setting this to `false` does not block scrolling completely. See [method scroll_to_line]. */
get scroll_active(): boolean
set scroll_active(value: boolean)
/** If `true`, the window scrolls down to display new content automatically. */
get scroll_following(): boolean
set scroll_following(value: boolean)
/** If set to something other than [constant TextServer.AUTOWRAP_OFF], the text gets wrapped inside the node's bounding rectangle. To see how each mode behaves, see [enum TextServer.AutowrapMode]. */
get autowrap_mode(): int64
set autowrap_mode(value: int64)
/** The number of spaces associated with a single tab length. Does not affect `\t` in text tags, only indent tags. */
get tab_size(): int64
set tab_size(value: int64)
/** If `true`, a right-click displays the context menu. */
get context_menu_enabled(): boolean
set context_menu_enabled(value: boolean)
/** If `true`, shortcut keys for context menu items are enabled, even if the context menu is disabled. */
get shortcut_keys_enabled(): boolean
set shortcut_keys_enabled(value: boolean)
/** The currently installed custom effects. This is an array of [RichTextEffect]s.
* To add a custom effect, it's more convenient to use [method install_effect].
*/
get custom_effects(): GArray
set custom_effects(value: GArray)
/** If `true`, the label underlines meta tags such as [code skip-lint][url]{text}[/url]`. These tags can call a function when clicked if [signal meta_clicked] is connected to a function. */
get meta_underlined(): boolean
set meta_underlined(value: boolean)
/** If `true`, the label underlines hint tags such as [code skip-lint][hint=description]{text}[/hint]`. */
get hint_underlined(): boolean
set hint_underlined(value: boolean)
/** If `true`, text processing is done in a background thread. */
get threaded(): boolean
set threaded(value: boolean)
/** The delay after which the loading progress bar is displayed, in milliseconds. Set to `-1` to disable progress bar entirely.
*
* **Note:** Progress bar is displayed only if [member threaded] is enabled.
*/
get progress_bar_delay(): int64
set progress_bar_delay(value: int64)
/** If `true`, the label allows text selection. */
get selection_enabled(): boolean
set selection_enabled(value: boolean)
/** If `true`, the selected text will be deselected when focus is lost. */
get deselect_on_focus_loss_enabled(): boolean
set deselect_on_focus_loss_enabled(value: boolean)
/** If `true`, allow drag and drop of selected text. */
get drag_and_drop_selection_enabled(): boolean
set drag_and_drop_selection_enabled(value: boolean)
/** The number of characters to display. If set to `-1`, all characters are displayed. This can be useful when animating the text appearing in a dialog box.
*
* **Note:** Setting this property updates [member visible_ratio] accordingly.
*/
get visible_characters(): int64
set visible_characters(value: int64)
/** Sets the clipping behavior when [member visible_characters] or [member visible_ratio] is set. See [enum TextServer.VisibleCharactersBehavior] for more info. */
get visible_characters_behavior(): int64
set visible_characters_behavior(value: int64)
/** The fraction of characters to display, relative to the total number of characters (see [method get_total_character_count]). If set to `1.0`, all characters are displayed. If set to `0.5`, only half of the characters will be displayed. This can be useful when animating the text appearing in a dialog box.
*
* **Note:** Setting this property updates [member visible_characters] accordingly.
*/
get visible_ratio(): float64
set visible_ratio(value: float64)
/** Base text writing direction. */
get text_direction(): int64
set text_direction(value: int64)
/** Language code used for line-breaking and text shaping algorithms, if left empty current locale is used instead. */
get language(): string
set language(value: string)
/** Set BiDi algorithm override for the structured text. */
get structured_text_bidi_override(): int64
set structured_text_bidi_override(value: int64)
/** Set additional options for BiDi override. */
get structured_text_bidi_override_options(): GArray
set structured_text_bidi_override_options(value: GArray)
/** Triggered when the user clicks on content between meta (URL) tags. If the meta is defined in BBCode, e.g. [code skip-lint][url={"key": "value"}]Text[/url]`, then the parameter for this signal will always be a [String] type. If a particular type or an object is desired, the [method push_meta] method must be used to manually insert the data into the tag stack. Alternatively, you can convert the [String] input to the desired type based on its contents (such as calling [method JSON.parse] on it).
* For example, the following method can be connected to [signal meta_clicked] to open clicked URLs using the user's default web browser:
*
*/
readonly meta_clicked: Signal1
/** Triggers when the mouse enters a meta tag. */
readonly meta_hover_started: Signal1
/** Triggers when the mouse exits a meta tag. */
readonly meta_hover_ended: Signal1
/** Triggered when the document is fully loaded. */
readonly finished: Signal0
}
namespace RigidBody2D {
enum FreezeMode {
/** Static body freeze mode (default). The body is not affected by gravity and forces. It can be only moved by user code and doesn't collide with other bodies along its path. */
FREEZE_MODE_STATIC = 0,
/** Kinematic body freeze mode. Similar to [constant FREEZE_MODE_STATIC], but collides with other bodies along its path when moved. Useful for a frozen body that needs to be animated. */
FREEZE_MODE_KINEMATIC = 1,
}
enum CenterOfMassMode {
/** In this mode, the body's center of mass is calculated automatically based on its shapes. This assumes that the shapes' origins are also their center of mass. */
CENTER_OF_MASS_MODE_AUTO = 0,
/** In this mode, the body's center of mass is set through [member center_of_mass]. Defaults to the body's origin position. */
CENTER_OF_MASS_MODE_CUSTOM = 1,
}
enum DampMode {
/** In this mode, the body's damping value is added to any value set in areas or the default value. */
DAMP_MODE_COMBINE = 0,
/** In this mode, the body's damping value replaces any value set in areas or the default value. */
DAMP_MODE_REPLACE = 1,
}
enum CCDMode {
/** Continuous collision detection disabled. This is the fastest way to detect body collisions, but can miss small, fast-moving objects. */
CCD_MODE_DISABLED = 0,
/** Continuous collision detection enabled using raycasting. This is faster than shapecasting but less precise. */
CCD_MODE_CAST_RAY = 1,
/** Continuous collision detection enabled using shapecasting. This is the slowest CCD method and the most precise. */
CCD_MODE_CAST_SHAPE = 2,
}
}
/** A 2D physics body that is moved by a physics simulation.
*
* @link https://docs.godotengine.org/en/4.3/classes/class_rigidbody2d.html
*/
class RigidBody2D extends PhysicsBody2D {
constructor(identifier?: any)
/** Called during physics processing, allowing you to read and safely modify the simulation state for the object. By default, it is called before the standard force integration, but the [member custom_integrator] property allows you to disable the standard force integration and do fully custom force integration for a body. */
/* gdvirtual */ _integrate_forces(state: PhysicsDirectBodyState2D): void
/** Returns the number of contacts this body has with other bodies. By default, this returns 0 unless bodies are configured to monitor contacts (see [member contact_monitor]).
*
* **Note:** To retrieve the colliding bodies, use [method get_colliding_bodies].
*/
get_contact_count(): int64
/** Sets the body's velocity on the given axis. The velocity in the given vector axis will be set as the given vector length. This is useful for jumping behavior. */
set_axis_velocity(axis_velocity: Vector2): void
/** Applies a directional impulse without affecting rotation.
* An impulse is time-independent! Applying an impulse every frame would result in a framerate-dependent force. For this reason, it should only be used when simulating one-time impacts (use the "_force" functions otherwise).
* This is equivalent to using [method apply_impulse] at the body's center of mass.
*/
apply_central_impulse(impulse: Vector2 = Vector2.ZERO): void
/** Applies a positioned impulse to the body.
* An impulse is time-independent! Applying an impulse every frame would result in a framerate-dependent force. For this reason, it should only be used when simulating one-time impacts (use the "_force" functions otherwise).
* [param position] is the offset from the body origin in global coordinates.
*/
apply_impulse(impulse: Vector2, position: Vector2 = Vector2.ZERO): void
/** Applies a rotational impulse to the body without affecting the position.
* An impulse is time-independent! Applying an impulse every frame would result in a framerate-dependent force. For this reason, it should only be used when simulating one-time impacts (use the "_force" functions otherwise).
*
* **Note:** [member inertia] is required for this to work. To have [member inertia], an active [CollisionShape2D] must be a child of the node, or you can manually set [member inertia].
*/
apply_torque_impulse(torque: float64): void
/** Applies a directional force without affecting rotation. A force is time dependent and meant to be applied every physics update.
* This is equivalent to using [method apply_force] at the body's center of mass.
*/
apply_central_force(force: Vector2): void
/** Applies a positioned force to the body. A force is time dependent and meant to be applied every physics update.
* [param position] is the offset from the body origin in global coordinates.
*/
apply_force(force: Vector2, position: Vector2 = Vector2.ZERO): void
/** Applies a rotational force without affecting position. A force is time dependent and meant to be applied every physics update.
*
* **Note:** [member inertia] is required for this to work. To have [member inertia], an active [CollisionShape2D] must be a child of the node, or you can manually set [member inertia].
*/
apply_torque(torque: float64): void
/** Adds a constant directional force without affecting rotation that keeps being applied over time until cleared with `constant_force = Vector2(0, 0)`.
* This is equivalent to using [method add_constant_force] at the body's center of mass.
*/
add_constant_central_force(force: Vector2): void
/** Adds a constant positioned force to the body that keeps being applied over time until cleared with `constant_force = Vector2(0, 0)`.
* [param position] is the offset from the body origin in global coordinates.
*/
add_constant_force(force: Vector2, position: Vector2 = Vector2.ZERO): void
/** Adds a constant rotational force without affecting position that keeps being applied over time until cleared with `constant_torque = 0`. */
add_constant_torque(torque: float64): void
/** Returns a list of the bodies colliding with this one. Requires [member contact_monitor] to be set to `true` and [member max_contacts_reported] to be set high enough to detect all the collisions.
*
* **Note:** The result of this test is not immediate after moving objects. For performance, list of collisions is updated once per frame and before the physics step. Consider using signals instead.
*/
get_colliding_bodies(): GArray
/** The body's mass. */
get mass(): float64
set mass(value: float64)
/** The physics material override for the body.
* If a material is assigned to this property, it will be used instead of any other physics material, such as an inherited one.
*/
get physics_material_override(): PhysicsMaterial
set physics_material_override(value: PhysicsMaterial)
/** Multiplies the gravity applied to the body. The body's gravity is calculated from the **Default Gravity** value in **Project > Project Settings > Physics > 2d** and/or any additional gravity vector applied by [Area2D]s. */
get gravity_scale(): float64
set gravity_scale(value: float64)
/** Defines the way the body's center of mass is set. See [enum CenterOfMassMode] for possible values. */
get center_of_mass_mode(): int64
set center_of_mass_mode(value: int64)
/** The body's custom center of mass, relative to the body's origin position, when [member center_of_mass_mode] is set to [constant CENTER_OF_MASS_MODE_CUSTOM]. This is the balanced point of the body, where applied forces only cause linear acceleration. Applying forces outside of the center of mass causes angular acceleration.
* When [member center_of_mass_mode] is set to [constant CENTER_OF_MASS_MODE_AUTO] (default value), the center of mass is automatically computed.
*/
get center_of_mass(): Vector2
set center_of_mass(value: Vector2)
/** The body's moment of inertia. This is like mass, but for rotation: it determines how much torque it takes to rotate the body. The moment of inertia is usually computed automatically from the mass and the shapes, but this property allows you to set a custom value.
* If set to `0`, inertia is automatically computed (default value).
*
* **Note:** This value does not change when inertia is automatically computed. Use [PhysicsServer2D] to get the computed inertia.
*
*/
get inertia(): float64
set inertia(value: float64)
/** If `true`, the body will not move and will not calculate forces until woken up by another body through, for example, a collision, or by using the [method apply_impulse] or [method apply_force] methods. */
get sleeping(): boolean
set sleeping(value: boolean)
/** If `true`, the body can enter sleep mode when there is no movement. See [member sleeping]. */
get can_sleep(): boolean
set can_sleep(value: boolean)
/** If `true`, the body cannot rotate. Gravity and forces only apply linear movement. */
get lock_rotation(): boolean
set lock_rotation(value: boolean)
/** If `true`, the body is frozen. Gravity and forces are not applied anymore.
* See [member freeze_mode] to set the body's behavior when frozen.
* For a body that is always frozen, use [StaticBody2D] or [AnimatableBody2D] instead.
*/
get freeze(): boolean
set freeze(value: boolean)
/** The body's freeze mode. Can be used to set the body's behavior when [member freeze] is enabled. See [enum FreezeMode] for possible values.
* For a body that is always frozen, use [StaticBody2D] or [AnimatableBody2D] instead.
*/
get freeze_mode(): int64
set freeze_mode(value: int64)
/** If `true`, the standard force integration (like gravity or damping) will be disabled for this body. Other than collision response, the body will only move as determined by the [method _integrate_forces] method, if that virtual method is overridden.
* Setting this property will call the method [method PhysicsServer2D.body_set_omit_force_integration] internally.
*/
get custom_integrator(): boolean
set custom_integrator(value: boolean)
/** Continuous collision detection mode.
* Continuous collision detection tries to predict where a moving body will collide instead of moving it and correcting its movement after collision. Continuous collision detection is slower, but more precise and misses fewer collisions with small, fast-moving objects. Raycasting and shapecasting methods are available. See [enum CCDMode] for details.
*/
get continuous_cd(): int64
set continuous_cd(value: int64)
/** If `true`, the RigidBody2D will emit signals when it collides with another body.
*
* **Note:** By default the maximum contacts reported is set to 0, meaning nothing will be recorded, see [member max_contacts_reported].
*/
get contact_monitor(): boolean
set contact_monitor(value: boolean)
/** The maximum number of contacts that will be recorded. Requires a value greater than 0 and [member contact_monitor] to be set to `true` to start to register contacts. Use [method get_contact_count] to retrieve the count or [method get_colliding_bodies] to retrieve bodies that have been collided with.
*
* **Note:** The number of contacts is different from the number of collisions. Collisions between parallel edges will result in two contacts (one at each end), and collisions between parallel faces will result in four contacts (one at each corner).
*/
get max_contacts_reported(): int64
set max_contacts_reported(value: int64)
/** The body's linear velocity in pixels per second. Can be used sporadically, but **don't set this every frame**, because physics may run in another thread and runs at a different granularity. Use [method _integrate_forces] as your process loop for precise control of the body state. */
get linear_velocity(): Vector2
set linear_velocity(value: Vector2)
/** Defines how [member linear_damp] is applied. See [enum DampMode] for possible values. */
get linear_damp_mode(): int64
set linear_damp_mode(value: int64)
/** Damps the body's movement. By default, the body will use the **Default Linear Damp** in **Project > Project Settings > Physics > 2d** or any value override set by an [Area2D] the body is in. Depending on [member linear_damp_mode], you can set [member linear_damp] to be added to or to replace the body's damping value.
* See [member ProjectSettings.physics/2d/default_linear_damp] for more details about damping.
*/
get linear_damp(): float64
set linear_damp(value: float64)
/** The body's rotational velocity in *radians* per second. */
get angular_velocity(): float64
set angular_velocity(value: float64)
/** Defines how [member angular_damp] is applied. See [enum DampMode] for possible values. */
get angular_damp_mode(): int64
set angular_damp_mode(value: int64)
/** Damps the body's rotation. By default, the body will use the **Default Angular Damp** in **Project > Project Settings > Physics > 2d** or any value override set by an [Area2D] the body is in. Depending on [member angular_damp_mode], you can set [member angular_damp] to be added to or to replace the body's damping value.
* See [member ProjectSettings.physics/2d/default_angular_damp] for more details about damping.
*/
get angular_damp(): float64
set angular_damp(value: float64)
/** The body's total constant positional forces applied during each physics update.
* See [method add_constant_force] and [method add_constant_central_force].
*/
get constant_force(): Vector2
set constant_force(value: Vector2)
/** The body's total constant rotational forces applied during each physics update.
* See [method add_constant_torque].
*/
get constant_torque(): float64
set constant_torque(value: float64)
/** Emitted when one of this RigidBody2D's [Shape2D]s collides with another [PhysicsBody2D] or [TileMap]'s [Shape2D]s. Requires [member contact_monitor] to be set to `true` and [member max_contacts_reported] to be set high enough to detect all the collisions. [TileMap]s are detected if the [TileSet] has Collision [Shape2D]s.
* [param body_rid] the [RID] of the other [PhysicsBody2D] or [TileSet]'s [CollisionObject2D] used by the [PhysicsServer2D].
* [param body] the [Node], if it exists in the tree, of the other [PhysicsBody2D] or [TileMap].
* [param body_shape_index] the index of the [Shape2D] of the other [PhysicsBody2D] or [TileMap] used by the [PhysicsServer2D]. Get the [CollisionShape2D] node with `body.shape_owner_get_owner(body.shape_find_owner(body_shape_index))`.
* [param local_shape_index] the index of the [Shape2D] of this RigidBody2D used by the [PhysicsServer2D]. Get the [CollisionShape2D] node with `self.shape_owner_get_owner(self.shape_find_owner(local_shape_index))`.
*/
readonly body_shape_entered: Signal4
/** Emitted when the collision between one of this RigidBody2D's [Shape2D]s and another [PhysicsBody2D] or [TileMap]'s [Shape2D]s ends. Requires [member contact_monitor] to be set to `true` and [member max_contacts_reported] to be set high enough to detect all the collisions. [TileMap]s are detected if the [TileSet] has Collision [Shape2D]s.
* [param body_rid] the [RID] of the other [PhysicsBody2D] or [TileSet]'s [CollisionObject2D] used by the [PhysicsServer2D].
* [param body] the [Node], if it exists in the tree, of the other [PhysicsBody2D] or [TileMap].
* [param body_shape_index] the index of the [Shape2D] of the other [PhysicsBody2D] or [TileMap] used by the [PhysicsServer2D]. Get the [CollisionShape2D] node with `body.shape_owner_get_owner(body.shape_find_owner(body_shape_index))`.
* [param local_shape_index] the index of the [Shape2D] of this RigidBody2D used by the [PhysicsServer2D]. Get the [CollisionShape2D] node with `self.shape_owner_get_owner(self.shape_find_owner(local_shape_index))`.
*/
readonly body_shape_exited: Signal4
/** Emitted when a collision with another [PhysicsBody2D] or [TileMap] occurs. Requires [member contact_monitor] to be set to `true` and [member max_contacts_reported] to be set high enough to detect all the collisions. [TileMap]s are detected if the [TileSet] has Collision [Shape2D]s.
* [param body] the [Node], if it exists in the tree, of the other [PhysicsBody2D] or [TileMap].
*/
readonly body_entered: Signal1
/** Emitted when the collision with another [PhysicsBody2D] or [TileMap] ends. Requires [member contact_monitor] to be set to `true` and [member max_contacts_reported] to be set high enough to detect all the collisions. [TileMap]s are detected if the [TileSet] has Collision [Shape2D]s.
* [param body] the [Node], if it exists in the tree, of the other [PhysicsBody2D] or [TileMap].
*/
readonly body_exited: Signal1
/** Emitted when the physics engine changes the body's sleeping state.
*
* **Note:** Changing the value [member sleeping] will not trigger this signal. It is only emitted if the sleeping state is changed by the physics engine or `emit_signal("sleeping_state_changed")` is used.
*/
readonly sleeping_state_changed: Signal0
}
namespace RigidBody3D {
enum FreezeMode {
/** Static body freeze mode (default). The body is not affected by gravity and forces. It can be only moved by user code and doesn't collide with other bodies along its path. */
FREEZE_MODE_STATIC = 0,
/** Kinematic body freeze mode. Similar to [constant FREEZE_MODE_STATIC], but collides with other bodies along its path when moved. Useful for a frozen body that needs to be animated. */
FREEZE_MODE_KINEMATIC = 1,
}
enum CenterOfMassMode {
/** In this mode, the body's center of mass is calculated automatically based on its shapes. This assumes that the shapes' origins are also their center of mass. */
CENTER_OF_MASS_MODE_AUTO = 0,
/** In this mode, the body's center of mass is set through [member center_of_mass]. Defaults to the body's origin position. */
CENTER_OF_MASS_MODE_CUSTOM = 1,
}
enum DampMode {
/** In this mode, the body's damping value is added to any value set in areas or the default value. */
DAMP_MODE_COMBINE = 0,
/** In this mode, the body's damping value replaces any value set in areas or the default value. */
DAMP_MODE_REPLACE = 1,
}
}
/** A 3D physics body that is moved by a physics simulation.
*
* @link https://docs.godotengine.org/en/4.3/classes/class_rigidbody3d.html
*/
class RigidBody3D extends PhysicsBody3D {
constructor(identifier?: any)
/** Called during physics processing, allowing you to read and safely modify the simulation state for the object. By default, it is called before the standard force integration, but the [member custom_integrator] property allows you to disable the standard force integration and do fully custom force integration for a body. */
/* gdvirtual */ _integrate_forces(state: PhysicsDirectBodyState3D): void
/** Returns the inverse inertia tensor basis. This is used to calculate the angular acceleration resulting from a torque applied to the [RigidBody3D]. */
get_inverse_inertia_tensor(): Basis
/** Returns the number of contacts this body has with other bodies. By default, this returns 0 unless bodies are configured to monitor contacts (see [member contact_monitor]).
*
* **Note:** To retrieve the colliding bodies, use [method get_colliding_bodies].
*/
get_contact_count(): int64
/** Sets an axis velocity. The velocity in the given vector axis will be set as the given vector length. This is useful for jumping behavior. */
set_axis_velocity(axis_velocity: Vector3): void
/** Applies a directional impulse without affecting rotation.
* An impulse is time-independent! Applying an impulse every frame would result in a framerate-dependent force. For this reason, it should only be used when simulating one-time impacts (use the "_force" functions otherwise).
* This is equivalent to using [method apply_impulse] at the body's center of mass.
*/
apply_central_impulse(impulse: Vector3): void
/** Applies a positioned impulse to the body.
* An impulse is time-independent! Applying an impulse every frame would result in a framerate-dependent force. For this reason, it should only be used when simulating one-time impacts (use the "_force" functions otherwise).
* [param position] is the offset from the body origin in global coordinates.
*/
apply_impulse(impulse: Vector3, position: Vector3 = new Vector3(0, 0, 0)): void
/** Applies a rotational impulse to the body without affecting the position.
* An impulse is time-independent! Applying an impulse every frame would result in a framerate-dependent force. For this reason, it should only be used when simulating one-time impacts (use the "_force" functions otherwise).
*
* **Note:** [member inertia] is required for this to work. To have [member inertia], an active [CollisionShape3D] must be a child of the node, or you can manually set [member inertia].
*/
apply_torque_impulse(impulse: Vector3): void
/** Applies a directional force without affecting rotation. A force is time dependent and meant to be applied every physics update.
* This is equivalent to using [method apply_force] at the body's center of mass.
*/
apply_central_force(force: Vector3): void
/** Applies a positioned force to the body. A force is time dependent and meant to be applied every physics update.
* [param position] is the offset from the body origin in global coordinates.
*/
apply_force(force: Vector3, position: Vector3 = new Vector3(0, 0, 0)): void
/** Applies a rotational force without affecting position. A force is time dependent and meant to be applied every physics update.
*
* **Note:** [member inertia] is required for this to work. To have [member inertia], an active [CollisionShape3D] must be a child of the node, or you can manually set [member inertia].
*/
apply_torque(torque: Vector3): void
/** Adds a constant directional force without affecting rotation that keeps being applied over time until cleared with `constant_force = Vector3(0, 0, 0)`.
* This is equivalent to using [method add_constant_force] at the body's center of mass.
*/
add_constant_central_force(force: Vector3): void
/** Adds a constant positioned force to the body that keeps being applied over time until cleared with `constant_force = Vector3(0, 0, 0)`.
* [param position] is the offset from the body origin in global coordinates.
*/
add_constant_force(force: Vector3, position: Vector3 = new Vector3(0, 0, 0)): void
/** Adds a constant rotational force without affecting position that keeps being applied over time until cleared with `constant_torque = Vector3(0, 0, 0)`. */
add_constant_torque(torque: Vector3): void
/** Returns a list of the bodies colliding with this one. Requires [member contact_monitor] to be set to `true` and [member max_contacts_reported] to be set high enough to detect all the collisions.
*
* **Note:** The result of this test is not immediate after moving objects. For performance, list of collisions is updated once per frame and before the physics step. Consider using signals instead.
*/
get_colliding_bodies(): GArray
/** The body's mass. */
get mass(): float64
set mass(value: float64)
/** The physics material override for the body.
* If a material is assigned to this property, it will be used instead of any other physics material, such as an inherited one.
*/
get physics_material_override(): PhysicsMaterial
set physics_material_override(value: PhysicsMaterial)
/** This is multiplied by the global 3D gravity setting found in **Project > Project Settings > Physics > 3d** to produce RigidBody3D's gravity. For example, a value of 1 will be normal gravity, 2 will apply double gravity, and 0.5 will apply half gravity to this object. */
get gravity_scale(): float64
set gravity_scale(value: float64)
/** Defines the way the body's center of mass is set. See [enum CenterOfMassMode] for possible values. */
get center_of_mass_mode(): int64
set center_of_mass_mode(value: int64)
/** The body's custom center of mass, relative to the body's origin position, when [member center_of_mass_mode] is set to [constant CENTER_OF_MASS_MODE_CUSTOM]. This is the balanced point of the body, where applied forces only cause linear acceleration. Applying forces outside of the center of mass causes angular acceleration.
* When [member center_of_mass_mode] is set to [constant CENTER_OF_MASS_MODE_AUTO] (default value), the center of mass is automatically computed.
*/
get center_of_mass(): Vector3
set center_of_mass(value: Vector3)
/** The body's moment of inertia. This is like mass, but for rotation: it determines how much torque it takes to rotate the body on each axis. The moment of inertia is usually computed automatically from the mass and the shapes, but this property allows you to set a custom value.
* If set to [constant Vector3.ZERO], inertia is automatically computed (default value).
*
* **Note:** This value does not change when inertia is automatically computed. Use [PhysicsServer3D] to get the computed inertia.
*
*/
get inertia(): Vector3
set inertia(value: Vector3)
/** If `true`, the body will not move and will not calculate forces until woken up by another body through, for example, a collision, or by using the [method apply_impulse] or [method apply_force] methods. */
get sleeping(): boolean
set sleeping(value: boolean)
/** If `true`, the body can enter sleep mode when there is no movement. See [member sleeping]. */
get can_sleep(): boolean
set can_sleep(value: boolean)
/** If `true`, the body cannot rotate. Gravity and forces only apply linear movement. */
get lock_rotation(): boolean
set lock_rotation(value: boolean)
/** If `true`, the body is frozen. Gravity and forces are not applied anymore.
* See [member freeze_mode] to set the body's behavior when frozen.
* For a body that is always frozen, use [StaticBody3D] or [AnimatableBody3D] instead.
*/
get freeze(): boolean
set freeze(value: boolean)
/** The body's freeze mode. Can be used to set the body's behavior when [member freeze] is enabled. See [enum FreezeMode] for possible values.
* For a body that is always frozen, use [StaticBody3D] or [AnimatableBody3D] instead.
*/
get freeze_mode(): int64
set freeze_mode(value: int64)
/** If `true`, the standard force integration (like gravity or damping) will be disabled for this body. Other than collision response, the body will only move as determined by the [method _integrate_forces] method, if that virtual method is overridden.
* Setting this property will call the method [method PhysicsServer3D.body_set_omit_force_integration] internally.
*/
get custom_integrator(): boolean
set custom_integrator(value: boolean)
/** If `true`, continuous collision detection is used.
* Continuous collision detection tries to predict where a moving body will collide, instead of moving it and correcting its movement if it collided. Continuous collision detection is more precise, and misses fewer impacts by small, fast-moving objects. Not using continuous collision detection is faster to compute, but can miss small, fast-moving objects.
*/
get continuous_cd(): boolean
set continuous_cd(value: boolean)
/** If `true`, the RigidBody3D will emit signals when it collides with another body.
*
* **Note:** By default the maximum contacts reported is set to 0, meaning nothing will be recorded, see [member max_contacts_reported].
*/
get contact_monitor(): boolean
set contact_monitor(value: boolean)
/** The maximum number of contacts that will be recorded. Requires a value greater than 0 and [member contact_monitor] to be set to `true` to start to register contacts. Use [method get_contact_count] to retrieve the count or [method get_colliding_bodies] to retrieve bodies that have been collided with.
*
* **Note:** The number of contacts is different from the number of collisions. Collisions between parallel edges will result in two contacts (one at each end), and collisions between parallel faces will result in four contacts (one at each corner).
*/
get max_contacts_reported(): int64
set max_contacts_reported(value: int64)
/** The body's linear velocity in units per second. Can be used sporadically, but **don't set this every frame**, because physics may run in another thread and runs at a different granularity. Use [method _integrate_forces] as your process loop for precise control of the body state. */
get linear_velocity(): Vector3
set linear_velocity(value: Vector3)
/** Defines how [member linear_damp] is applied. See [enum DampMode] for possible values. */
get linear_damp_mode(): int64
set linear_damp_mode(value: int64)
/** Damps the body's movement. By default, the body will use the **Default Linear Damp** in **Project > Project Settings > Physics > 3d** or any value override set by an [Area3D] the body is in. Depending on [member linear_damp_mode], you can set [member linear_damp] to be added to or to replace the body's damping value.
* See [member ProjectSettings.physics/3d/default_linear_damp] for more details about damping.
*/
get linear_damp(): float64
set linear_damp(value: float64)
/** The RigidBody3D's rotational velocity in *radians* per second. */
get angular_velocity(): Vector3
set angular_velocity(value: Vector3)
/** Defines how [member angular_damp] is applied. See [enum DampMode] for possible values. */
get angular_damp_mode(): int64
set angular_damp_mode(value: int64)
/** Damps the body's rotation. By default, the body will use the **Default Angular Damp** in **Project > Project Settings > Physics > 3d** or any value override set by an [Area3D] the body is in. Depending on [member angular_damp_mode], you can set [member angular_damp] to be added to or to replace the body's damping value.
* See [member ProjectSettings.physics/3d/default_angular_damp] for more details about damping.
*/
get angular_damp(): float64
set angular_damp(value: float64)
/** The body's total constant positional forces applied during each physics update.
* See [method add_constant_force] and [method add_constant_central_force].
*/
get constant_force(): Vector3
set constant_force(value: Vector3)
/** The body's total constant rotational forces applied during each physics update.
* See [method add_constant_torque].
*/
get constant_torque(): Vector3
set constant_torque(value: Vector3)
/** Emitted when one of this RigidBody3D's [Shape3D]s collides with another [PhysicsBody3D] or [GridMap]'s [Shape3D]s. Requires [member contact_monitor] to be set to `true` and [member max_contacts_reported] to be set high enough to detect all the collisions. [GridMap]s are detected if the [MeshLibrary] has Collision [Shape3D]s.
* [param body_rid] the [RID] of the other [PhysicsBody3D] or [MeshLibrary]'s [CollisionObject3D] used by the [PhysicsServer3D].
* [param body] the [Node], if it exists in the tree, of the other [PhysicsBody3D] or [GridMap].
* [param body_shape_index] the index of the [Shape3D] of the other [PhysicsBody3D] or [GridMap] used by the [PhysicsServer3D]. Get the [CollisionShape3D] node with `body.shape_owner_get_owner(body.shape_find_owner(body_shape_index))`.
* [param local_shape_index] the index of the [Shape3D] of this RigidBody3D used by the [PhysicsServer3D]. Get the [CollisionShape3D] node with `self.shape_owner_get_owner(self.shape_find_owner(local_shape_index))`.
*/
readonly body_shape_entered: Signal4
/** Emitted when the collision between one of this RigidBody3D's [Shape3D]s and another [PhysicsBody3D] or [GridMap]'s [Shape3D]s ends. Requires [member contact_monitor] to be set to `true` and [member max_contacts_reported] to be set high enough to detect all the collisions. [GridMap]s are detected if the [MeshLibrary] has Collision [Shape3D]s.
* [param body_rid] the [RID] of the other [PhysicsBody3D] or [MeshLibrary]'s [CollisionObject3D] used by the [PhysicsServer3D]. [GridMap]s are detected if the Meshes have [Shape3D]s.
* [param body] the [Node], if it exists in the tree, of the other [PhysicsBody3D] or [GridMap].
* [param body_shape_index] the index of the [Shape3D] of the other [PhysicsBody3D] or [GridMap] used by the [PhysicsServer3D]. Get the [CollisionShape3D] node with `body.shape_owner_get_owner(body.shape_find_owner(body_shape_index))`.
* [param local_shape_index] the index of the [Shape3D] of this RigidBody3D used by the [PhysicsServer3D]. Get the [CollisionShape3D] node with `self.shape_owner_get_owner(self.shape_find_owner(local_shape_index))`.
*/
readonly body_shape_exited: Signal4
/** Emitted when a collision with another [PhysicsBody3D] or [GridMap] occurs. Requires [member contact_monitor] to be set to `true` and [member max_contacts_reported] to be set high enough to detect all the collisions. [GridMap]s are detected if the [MeshLibrary] has Collision [Shape3D]s.
* [param body] the [Node], if it exists in the tree, of the other [PhysicsBody3D] or [GridMap].
*/
readonly body_entered: Signal1
/** Emitted when the collision with another [PhysicsBody3D] or [GridMap] ends. Requires [member contact_monitor] to be set to `true` and [member max_contacts_reported] to be set high enough to detect all the collisions. [GridMap]s are detected if the [MeshLibrary] has Collision [Shape3D]s.
* [param body] the [Node], if it exists in the tree, of the other [PhysicsBody3D] or [GridMap].
*/
readonly body_exited: Signal1
/** Emitted when the physics engine changes the body's sleeping state.
*
* **Note:** Changing the value [member sleeping] will not trigger this signal. It is only emitted if the sleeping state is changed by the physics engine or `emit_signal("sleeping_state_changed")` is used.
*/
readonly sleeping_state_changed: Signal0
}
/** Editor-only helper for setting up root motion in [AnimationMixer].
*
* @link https://docs.godotengine.org/en/4.3/classes/class_rootmotionview.html
*/
class RootMotionView extends VisualInstance3D {
constructor(identifier?: any)
/** Path to an [AnimationMixer] node to use as a basis for root motion. */
get animation_path(): NodePath
set animation_path(value: NodePath | string)
/** The grid's color. */
get color(): Color
set color(value: Color)
/** The grid's cell size in 3D units. */
get cell_size(): float64
set cell_size(value: float64)
/** The grid's radius in 3D units. The grid's opacity will fade gradually as the distance from the origin increases until this [member radius] is reached. */
get radius(): float64
set radius(value: float64)
/** If `true`, the grid's points will all be on the same Y coordinate ( *local* Y = 0). If `false`, the points' original Y coordinate is preserved. */
get zero_y(): boolean
set zero_y(value: boolean)
}
class RunInstancesDialog extends AcceptDialog {
constructor(identifier?: any)
}
class SceneCacheInterface extends RefCounted {
constructor(identifier?: any)
}
class SceneCreateDialog extends ConfirmationDialog {
constructor(identifier?: any)
}
class SceneExporterGLTFPlugin extends EditorPlugin {
constructor(identifier?: any)
}
class SceneImportSettingsData extends Object {
constructor(identifier?: any)
}
class SceneImportSettingsDialog extends ConfirmationDialog {
constructor(identifier?: any)
}
/** High-level multiplayer API implementation.
*
* @link https://docs.godotengine.org/en/4.3/classes/class_scenemultiplayer.html
*/
class SceneMultiplayer extends MultiplayerAPI {
constructor(identifier?: any)
/** Clears the current SceneMultiplayer network state (you shouldn't call this unless you know what you are doing). */
clear(): void
/** Disconnects the peer identified by [param id], removing it from the list of connected peers, and closing the underlying connection with it. */
disconnect_peer(id: int64): void
/** Returns the IDs of the peers currently trying to authenticate with this [MultiplayerAPI]. */
get_authenticating_peers(): PackedInt32Array
/** Sends the specified [param data] to the remote peer identified by [param id] as part of an authentication message. This can be used to authenticate peers, and control when [signal MultiplayerAPI.peer_connected] is emitted (and the remote peer accepted as one of the connected peers). */
send_auth(id: int64, data: PackedByteArray | byte[] | ArrayBuffer): GError
/** Mark the authentication step as completed for the remote peer identified by [param id]. The [signal MultiplayerAPI.peer_connected] signal will be emitted for this peer once the remote side also completes the authentication. No further authentication messages are expected to be received from this peer.
* If a peer disconnects before completing authentication, either due to a network issue, the [member auth_timeout] expiring, or manually calling [method disconnect_peer], the [signal peer_authentication_failed] signal will be emitted instead of [signal MultiplayerAPI.peer_disconnected].
*/
complete_auth(id: int64): GError
/** Sends the given raw [param bytes] to a specific peer identified by [param id] (see [method MultiplayerPeer.set_target_peer]). Default ID is `0`, i.e. broadcast to all peers. */
send_bytes(bytes: PackedByteArray | byte[] | ArrayBuffer, id: int64 = 0, mode: MultiplayerPeer.TransferMode = 2, channel: int64 = 0): GError
/** The root path to use for RPCs and replication. Instead of an absolute path, a relative path will be used to find the node upon which the RPC should be executed.
* This effectively allows to have different branches of the scene tree to be managed by different MultiplayerAPI, allowing for example to run both client and server in the same scene.
*/
get root_path(): NodePath
set root_path(value: NodePath | string)
/** The callback to execute when when receiving authentication data sent via [method send_auth]. If the [Callable] is empty (default), peers will be automatically accepted as soon as they connect. */
get auth_callback(): Callable
set auth_callback(value: Callable)
/** If set to a value greater than `0.0`, the maximum amount of time peers can stay in the authenticating state, after which the authentication will automatically fail. See the [signal peer_authenticating] and [signal peer_authentication_failed] signals. */
get auth_timeout(): float64
set auth_timeout(value: float64)
/** If `true`, the MultiplayerAPI will allow encoding and decoding of object during RPCs.
* **Warning:** Deserialized objects can contain code which gets executed. Do not use this option if the serialized object comes from untrusted sources to avoid potential security threat such as remote code execution.
*/
get allow_object_decoding(): boolean
set allow_object_decoding(value: boolean)
/** If `true`, the MultiplayerAPI's [member MultiplayerAPI.multiplayer_peer] refuses new incoming connections. */
get refuse_new_connections(): boolean
set refuse_new_connections(value: boolean)
/** Enable or disable the server feature that notifies clients of other peers' connection/disconnection, and relays messages between them. When this option is `false`, clients won't be automatically notified of other peers and won't be able to send them packets through the server.
*
* **Note:** Changing this option while other peers are connected may lead to unexpected behaviors.
*
* **Note:** Support for this feature may depend on the current [MultiplayerPeer] configuration. See [method MultiplayerPeer.is_server_relay_supported].
*/
get server_relay(): boolean
set server_relay(value: boolean)
/** Maximum size of each synchronization packet. Higher values increase the chance of receiving full updates in a single frame, but also the chance of packet loss. See [MultiplayerSynchronizer]. */
get max_sync_packet_size(): int64
set max_sync_packet_size(value: int64)
/** Maximum size of each delta packet. Higher values increase the chance of receiving full updates in a single frame, but also the chance of causing networking congestion (higher latency, disconnections). See [MultiplayerSynchronizer]. */
get max_delta_packet_size(): int64
set max_delta_packet_size(value: int64)
/** Emitted when this MultiplayerAPI's [member MultiplayerAPI.multiplayer_peer] connects to a new peer and a valid [member auth_callback] is set. In this case, the [signal MultiplayerAPI.peer_connected] will not be emitted until [method complete_auth] is called with given peer [param id]. While in this state, the peer will not be included in the list returned by [method MultiplayerAPI.get_peers] (but in the one returned by [method get_authenticating_peers]), and only authentication data will be sent or received. See [method send_auth] for sending authentication data. */
readonly peer_authenticating: Signal1
/** Emitted when this MultiplayerAPI's [member MultiplayerAPI.multiplayer_peer] disconnects from a peer for which authentication had not yet completed. See [signal peer_authenticating]. */
readonly peer_authentication_failed: Signal1
/** Emitted when this MultiplayerAPI's [member MultiplayerAPI.multiplayer_peer] receives a [param packet] with custom data (see [method send_bytes]). ID is the peer ID of the peer that sent the packet. */
readonly peer_packet: Signal2
}
class SceneRPCInterface extends RefCounted {
constructor(identifier?: any)
}
namespace SceneReplicationConfig {
enum ReplicationMode {
/** Do not keep the given property synchronized. */
REPLICATION_MODE_NEVER = 0,
/** Replicate the given property on process by constantly sending updates using unreliable transfer mode. */
REPLICATION_MODE_ALWAYS = 1,
/** Replicate the given property on process by sending updates using reliable transfer mode when its value changes. */
REPLICATION_MODE_ON_CHANGE = 2,
}
}
/** Configuration for properties to synchronize with a [MultiplayerSynchronizer].
*
* @link https://docs.godotengine.org/en/4.3/classes/class_scenereplicationconfig.html
*/
class SceneReplicationConfig extends Resource {
constructor(identifier?: any)
/** Returns a list of synchronized property [NodePath]s. */
get_properties(): GArray
/** Adds the property identified by the given [param path] to the list of the properties being synchronized, optionally passing an [param index].
*
* **Note:** For details on restrictions and limitations on property synchronization, see [MultiplayerSynchronizer].
*/
add_property(path: NodePath | string, index: int64 = -1): void
/** Returns `true` if the given [param path] is configured for synchronization. */
has_property(path: NodePath | string): boolean
/** Removes the property identified by the given [param path] from the configuration. */
remove_property(path: NodePath | string): void
/** Finds the index of the given [param path]. */
property_get_index(path: NodePath | string): int64
/** Returns `true` if the property identified by the given [param path] is configured to be synchronized on spawn. */
property_get_spawn(path: NodePath | string): boolean
/** Sets whether the property identified by the given [param path] is configured to be synchronized on spawn. */
property_set_spawn(path: NodePath | string, enabled: boolean): void
/** Returns the replication mode for the property identified by the given [param path]. See [enum ReplicationMode]. */
property_get_replication_mode(path: NodePath | string): SceneReplicationConfig.ReplicationMode
/** Sets the synchronization mode for the property identified by the given [param path]. See [enum ReplicationMode]. */
property_set_replication_mode(path: NodePath | string, mode: SceneReplicationConfig.ReplicationMode): void
/** Returns `true` if the property identified by the given [param path] is configured to be synchronized on process. */
property_get_sync(path: NodePath | string): boolean
/** Sets whether the property identified by the given [param path] is configured to be synchronized on process. */
property_set_sync(path: NodePath | string, enabled: boolean): void
/** Returns `true` if the property identified by the given [param path] is configured to be reliably synchronized when changes are detected on process. */
property_get_watch(path: NodePath | string): boolean
/** Sets whether the property identified by the given [param path] is configured to be reliably synchronized when changes are detected on process. */
property_set_watch(path: NodePath | string, enabled: boolean): void
}
class SceneReplicationInterface extends RefCounted {
constructor(identifier?: any)
}
namespace SceneState {
enum GenEditState {
/** If passed to [method PackedScene.instantiate], blocks edits to the scene state. */
GEN_EDIT_STATE_DISABLED = 0,
/** If passed to [method PackedScene.instantiate], provides inherited scene resources to the local scene.
*
* **Note:** Only available in editor builds.
*/
GEN_EDIT_STATE_INSTANCE = 1,
/** If passed to [method PackedScene.instantiate], provides local scene resources to the local scene. Only the main scene should receive the main edit state.
*
* **Note:** Only available in editor builds.
*/
GEN_EDIT_STATE_MAIN = 2,
/** If passed to [method PackedScene.instantiate], it's similar to [constant GEN_EDIT_STATE_MAIN], but for the case where the scene is being instantiated to be the base of another one.
*
* **Note:** Only available in editor builds.
*/
GEN_EDIT_STATE_MAIN_INHERITED = 3,
}
}
/** Provides access to a scene file's information.
*
* @link https://docs.godotengine.org/en/4.3/classes/class_scenestate.html
*/
class SceneState extends RefCounted {
constructor(identifier?: any)
/** Returns the number of nodes in the scene.
* The `idx` argument used to query node data in other `get_node_*` methods in the interval `[0, get_node_count() - 1]`.
*/
get_node_count(): int64
/** Returns the type of the node at [param idx]. */
get_node_type(idx: int64): StringName
/** Returns the name of the node at [param idx]. */
get_node_name(idx: int64): StringName
/** Returns the path to the node at [param idx].
* If [param for_parent] is `true`, returns the path of the [param idx] node's parent instead.
*/
get_node_path(idx: int64, for_parent: boolean = false): NodePath
/** Returns the path to the owner of the node at [param idx], relative to the root node. */
get_node_owner_path(idx: int64): NodePath
/** Returns `true` if the node at [param idx] is an [InstancePlaceholder]. */
is_node_instance_placeholder(idx: int64): boolean
/** Returns the path to the represented scene file if the node at [param idx] is an [InstancePlaceholder]. */
get_node_instance_placeholder(idx: int64): string
/** Returns a [PackedScene] for the node at [param idx] (i.e. the whole branch starting at this node, with its child nodes and resources), or `null` if the node is not an instance. */
get_node_instance(idx: int64): PackedScene
/** Returns the list of group names associated with the node at [param idx]. */
get_node_groups(idx: int64): PackedStringArray
/** Returns the node's index, which is its position relative to its siblings. This is only relevant and saved in scenes for cases where new nodes are added to an instantiated or inherited scene among siblings from the base scene. Despite the name, this index is not related to the [param idx] argument used here and in other methods. */
get_node_index(idx: int64): int64
/** Returns the number of exported or overridden properties for the node at [param idx].
* The `prop_idx` argument used to query node property data in other `get_node_property_*` methods in the interval `[0, get_node_property_count() - 1]`.
*/
get_node_property_count(idx: int64): int64
/** Returns the name of the property at [param prop_idx] for the node at [param idx]. */
get_node_property_name(idx: int64, prop_idx: int64): StringName
/** Returns the value of the property at [param prop_idx] for the node at [param idx]. */
get_node_property_value(idx: int64, prop_idx: int64): any
/** Returns the number of signal connections in the scene.
* The `idx` argument used to query connection metadata in other `get_connection_*` methods in the interval `[0, get_connection_count() - 1]`.
*/
get_connection_count(): int64
/** Returns the path to the node that owns the signal at [param idx], relative to the root node. */
get_connection_source(idx: int64): NodePath
/** Returns the name of the signal at [param idx]. */
get_connection_signal(idx: int64): StringName
/** Returns the path to the node that owns the method connected to the signal at [param idx], relative to the root node. */
get_connection_target(idx: int64): NodePath
/** Returns the method connected to the signal at [param idx]. */
get_connection_method(idx: int64): StringName
/** Returns the connection flags for the signal at [param idx]. See [enum Object.ConnectFlags] constants. */
get_connection_flags(idx: int64): int64
/** Returns the list of bound parameters for the signal at [param idx]. */
get_connection_binds(idx: int64): GArray
/** Returns the number of unbound parameters for the signal at [param idx]. */
get_connection_unbinds(idx: int64): int64
}
class SceneTileProxyObject extends Object {
constructor(identifier?: any)
readonly changed: Signal1
}
namespace SceneTree {
enum GroupCallFlags {
/** Call nodes within a group with no special behavior (default). */
GROUP_CALL_DEFAULT = 0,
/** Call nodes within a group in reverse tree hierarchy order (all nested children are called before their respective parent nodes). */
GROUP_CALL_REVERSE = 1,
/** Call nodes within a group at the end of the current frame (can be either process or physics frame), similar to [method Object.call_deferred]. */
GROUP_CALL_DEFERRED = 2,
/** Call nodes within a group only once, even if the call is executed many times in the same frame. Must be combined with [constant GROUP_CALL_DEFERRED] to work.
*
* **Note:** Different arguments are not taken into account. Therefore, when the same call is executed with different arguments, only the first call will be performed.
*/
GROUP_CALL_UNIQUE = 4,
}
}
/** Manages the game loop via a hierarchy of nodes.
*
* @link https://docs.godotengine.org/en/4.3/classes/class_scenetree.html
*/
class SceneTree extends MainLoop {
constructor(identifier?: any)
/** Returns `true` if a node added to the given group [param name] exists in the tree. */
has_group(name: StringName): boolean
/** Returns a new [SceneTreeTimer]. After [param time_sec] in seconds have passed, the timer will emit [signal SceneTreeTimer.timeout] and will be automatically freed.
* If [param process_always] is `false`, the timer will be paused when setting [member SceneTree.paused] to `true`.
* If [param process_in_physics] is `true`, the timer will update at the end of the physics frame, instead of the process frame.
* If [param ignore_time_scale] is `true`, the timer will ignore [member Engine.time_scale] and update with the real, elapsed time.
* This method is commonly used to create a one-shot delay timer, as in the following example:
*
*
* **Note:** The timer is always updated *after* all of the nodes in the tree. A node's [method Node._process] method would be called before the timer updates (or [method Node._physics_process] if [param process_in_physics] is set to `true`).
*/
create_timer(time_sec: float64, process_always: boolean = true, process_in_physics: boolean = false, ignore_time_scale: boolean = false): SceneTreeTimer
/** Creates and returns a new [Tween] processed in this tree. The Tween will start automatically on the next process frame or physics frame (depending on its [enum Tween.TweenProcessMode]).
*
* **Note:** A [Tween] created using this method is not bound to any [Node]. It may keep working until there is nothing left to animate. If you want the [Tween] to be automatically killed when the [Node] is freed, use [method Node.create_tween] or [method Tween.bind_node].
*/
create_tween(): Tween
/** Returns an [Array] of currently existing [Tween]s in the tree, including paused tweens. */
get_processed_tweens(): GArray
/** Returns the number of nodes inside this tree. */
get_node_count(): int64
/** Returns how many frames have been processed, since the application started. This is *not* a measurement of elapsed time. */
get_frame(): int64
/** Quits the application at the end of the current iteration, with the given [param exit_code].
* By convention, an exit code of `0` indicates success, whereas any other exit code indicates an error. For portability reasons, it should be between `0` and `125` (inclusive).
*
* **Note:** On iOS this method doesn't work. Instead, as recommended by the [url=https://developer.apple.com/library/archive/qa/qa1561/_index.html]iOS Human Interface Guidelines[/url], the user is expected to close apps via the Home button.
*/
quit(exit_code: int64 = 0): void
/** Queues the given [param obj] to be deleted, calling its [method Object.free] at the end of the current frame. This method is similar to [method Node.queue_free]. */
queue_delete(obj: Object): void
/** Calls the given [param method] on each node inside this tree added to the given [param group]. Use [param flags] to customize this method's behavior (see [enum GroupCallFlags]). Additional arguments for [param method] can be passed at the end of this method. Nodes that cannot call [param method] (either because the method doesn't exist or the arguments do not match) are ignored.
*
*
* **Note:** In C#, [param method] must be in snake_case when referring to built-in Godot methods. Prefer using the names exposed in the `MethodName` class to avoid allocating a new [StringName] on each call.
*/
call_group_flags(flags: int64, group: StringName, method: StringName, ...vargargs: any[]): void
/** Calls [method Object.notification] with the given [param notification] to all nodes inside this tree added to the [param group]. Use [param call_flags] to customize this method's behavior (see [enum GroupCallFlags]). */
notify_group_flags(call_flags: int64, group: StringName, notification: int64): void
/** Sets the given [param property] to [param value] on all nodes inside this tree added to the given [param group]. Nodes that do not have the [param property] are ignored. Use [param call_flags] to customize this method's behavior (see [enum GroupCallFlags]).
*
* **Note:** In C#, [param property] must be in snake_case when referring to built-in Godot properties. Prefer using the names exposed in the `PropertyName` class to avoid allocating a new [StringName] on each call.
*/
set_group_flags(call_flags: int64, group: StringName, property: string, value: any): void
/** Calls [param method] on each node inside this tree added to the given [param group]. You can pass arguments to [param method] by specifying them at the end of this method call. Nodes that cannot call [param method] (either because the method doesn't exist or the arguments do not match) are ignored. See also [method set_group] and [method notify_group].
*
* **Note:** This method acts immediately on all selected nodes at once, which may cause stuttering in some performance-intensive situations.
*
* **Note:** In C#, [param method] must be in snake_case when referring to built-in Godot methods. Prefer using the names exposed in the `MethodName` class to avoid allocating a new [StringName] on each call.
*/
call_group(group: StringName, method: StringName, ...vargargs: any[]): void
/** Calls [method Object.notification] with the given [param notification] to all nodes inside this tree added to the [param group]. See also [url=https://docs.godotengine.org/en/4.3/tutorials/best_practices/godot_notifications.html]Godot notifications[/url] and [method call_group] and [method set_group].
*
* **Note:** This method acts immediately on all selected nodes at once, which may cause stuttering in some performance-intensive situations.
*/
notify_group(group: StringName, notification: int64): void
/** Sets the given [param property] to [param value] on all nodes inside this tree added to the given [param group]. Nodes that do not have the [param property] are ignored. See also [method call_group] and [method notify_group].
*
* **Note:** This method acts immediately on all selected nodes at once, which may cause stuttering in some performance-intensive situations.
*
* **Note:** In C#, [param property] must be in snake_case when referring to built-in Godot properties. Prefer using the names exposed in the `PropertyName` class to avoid allocating a new [StringName] on each call.
*/
set_group(group: StringName, property: string, value: any): void
/** Returns an [Array] containing all nodes inside this tree, that have been added to the given [param group], in scene hierarchy order. */
get_nodes_in_group(group: StringName): GArray
/** Returns the first [Node] found inside the tree, that has been added to the given [param group], in scene hierarchy order. Returns `null` if no match is found. See also [method get_nodes_in_group]. */
get_first_node_in_group(group: StringName): Node
/** Returns the number of nodes assigned to the given group. */
get_node_count_in_group(group: StringName): int64
/** Changes the running scene to the one at the given [param path], after loading it into a [PackedScene] and creating a new instance.
* Returns [constant OK] on success, [constant ERR_CANT_OPEN] if the [param path] cannot be loaded into a [PackedScene], or [constant ERR_CANT_CREATE] if that scene cannot be instantiated.
*
* **Note:** See [method change_scene_to_packed] for details on the order of operations.
*/
change_scene_to_file(path: string): GError
/** Changes the running scene to a new instance of the given [PackedScene] (which must be valid).
* Returns [constant OK] on success, [constant ERR_CANT_CREATE] if the scene cannot be instantiated, or [constant ERR_INVALID_PARAMETER] if the scene is invalid.
*
* **Note:** Operations happen in the following order when [method change_scene_to_packed] is called:
* 1. The current scene node is immediately removed from the tree. From that point, [method Node.get_tree] called on the current (outgoing) scene will return `null`. [member current_scene] will be `null`, too, because the new scene is not available yet.
* 2. At the end of the frame, the formerly current scene, already removed from the tree, will be deleted (freed from memory) and then the new scene will be instantiated and added to the tree. [method Node.get_tree] and [member current_scene] will be back to working as usual.
* This ensures that both scenes aren't running at the same time, while still freeing the previous scene in a safe way similar to [method Node.queue_free].
*/
change_scene_to_packed(packed_scene: PackedScene): GError
/** Reloads the currently active scene, replacing [member current_scene] with a new instance of its original [PackedScene].
* Returns [constant OK] on success, [constant ERR_UNCONFIGURED] if no [member current_scene] is defined, [constant ERR_CANT_OPEN] if [member current_scene] cannot be loaded into a [PackedScene], or [constant ERR_CANT_CREATE] if the scene cannot be instantiated.
*/
reload_current_scene(): GError
/** If a current scene is loaded, calling this method will unload it. */
unload_current_scene(): void
/** Sets a custom [MultiplayerAPI] with the given [param root_path] (controlling also the relative subpaths), or override the default one if [param root_path] is empty.
*
* **Note:** No [MultiplayerAPI] must be configured for the subpath containing [param root_path], nested custom multiplayers are not allowed. I.e. if one is configured for `"/root/Foo"` setting one for `"/root/Foo/Bar"` will cause an error.
*/
set_multiplayer(multiplayer: MultiplayerAPI, root_path: NodePath | string = ''): void
/** Searches for the [MultiplayerAPI] configured for the given path, if one does not exist it searches the parent paths until one is found. If the path is empty, or none is found, the default one is returned. See [method set_multiplayer]. */
get_multiplayer(for_path: NodePath | string = ''): MultiplayerAPI
/** If `true`, the application automatically accepts quitting requests.
* For mobile platforms, see [member quit_on_go_back].
*/
get auto_accept_quit(): boolean
set auto_accept_quit(value: boolean)
/** If `true`, the application quits automatically when navigating back (e.g. using the system "Back" button on Android).
* To handle 'Go Back' button when this option is disabled, use [constant DisplayServer.WINDOW_EVENT_GO_BACK_REQUEST].
*/
get quit_on_go_back(): boolean
set quit_on_go_back(value: boolean)
/** If `true`, collision shapes will be visible when running the game from the editor for debugging purposes.
*
* **Note:** This property is not designed to be changed at run-time. Changing the value of [member debug_collisions_hint] while the project is running will not have the desired effect.
*/
get debug_collisions_hint(): boolean
set debug_collisions_hint(value: boolean)
/** If `true`, curves from [Path2D] and [Path3D] nodes will be visible when running the game from the editor for debugging purposes.
*
* **Note:** This property is not designed to be changed at run-time. Changing the value of [member debug_paths_hint] while the project is running will not have the desired effect.
*/
get debug_paths_hint(): boolean
set debug_paths_hint(value: boolean)
/** If `true`, navigation polygons will be visible when running the game from the editor for debugging purposes.
*
* **Note:** This property is not designed to be changed at run-time. Changing the value of [member debug_navigation_hint] while the project is running will not have the desired effect.
*/
get debug_navigation_hint(): boolean
set debug_navigation_hint(value: boolean)
/** If `true`, the scene tree is considered paused. This causes the following behavior:
* - 2D and 3D physics will be stopped, as well as collision detection and related signals.
* - Depending on each node's [member Node.process_mode], their [method Node._process], [method Node._physics_process] and [method Node._input] callback methods may not called anymore.
*/
get paused(): boolean
set paused(value: boolean)
/** The root of the scene currently being edited in the editor. This is usually a direct child of [member root].
*
* **Note:** This property does nothing in release builds.
*/
get edited_scene_root(): Node
set edited_scene_root(value: Node)
/** The root node of the currently loaded main scene, usually as a direct child of [member root]. See also [method change_scene_to_file], [method change_scene_to_packed], and [method reload_current_scene].
* **Warning:** Setting this property directly may not work as expected, as it does *not* add or remove any nodes from this tree.
*/
get current_scene(): Node
set current_scene(value: Node)
/** The tree's root [Window]. This is top-most [Node] of the scene tree, and is always present. An absolute [NodePath] always starts from this node. Children of the root node may include the loaded [member current_scene], as well as any [url=https://docs.godotengine.org/en/4.3/tutorials/scripting/singletons_autoload.html]AutoLoad[/url] configured in the Project Settings.
* **Warning:** Do not delete this node. This will result in unstable behavior, followed by a crash.
*/
get root(): Node
/** If `true` (default value), enables automatic polling of the [MultiplayerAPI] for this SceneTree during [signal process_frame].
* If `false`, you need to manually call [method MultiplayerAPI.poll] to process network packets and deliver RPCs. This allows running RPCs in a different loop (e.g. physics, thread, specific time step) and for manual [Mutex] protection when accessing the [MultiplayerAPI] from threads.
*/
get multiplayer_poll(): boolean
set multiplayer_poll(value: boolean)
/** If `true`, the renderer will interpolate the transforms of physics objects between the last two transforms, so that smooth motion is seen even when physics ticks do not coincide with rendered frames.
* The default value of this property is controlled by [member ProjectSettings.physics/common/physics_interpolation].
*/
get physics_interpolation(): boolean
set physics_interpolation(value: boolean)
/** Emitted any time the tree's hierarchy changes (nodes being moved, renamed, etc.). */
readonly tree_changed: Signal0
/** Emitted when the [member Node.process_mode] of any node inside the tree is changed. Only emitted in the editor, to update the visibility of disabled nodes. */
readonly tree_process_mode_changed: Signal0
/** Emitted when the [param node] enters this tree. */
readonly node_added: Signal1
/** Emitted when the [param node] exits this tree. */
readonly node_removed: Signal1
/** Emitted when the [param node]'s [member Node.name] is changed. */
readonly node_renamed: Signal1
/** Emitted when the [param node]'s [method Node.update_configuration_warnings] is called. Only emitted in the editor. */
readonly node_configuration_warning_changed: Signal1
/** Emitted immediately before [method Node._process] is called on every node in this tree. */
readonly process_frame: Signal0
/** Emitted immediately before [method Node._physics_process] is called on every node in this tree. */
readonly physics_frame: Signal0
}
class SceneTreeDialog extends ConfirmationDialog {
constructor(identifier?: any)
_cancel(): void
readonly selected: Signal1
}
class SceneTreeDock extends VBoxContainer {
constructor(identifier?: any)
_post_do_create(_unnamed_arg0: Node): void
_set_owners(_unnamed_arg0: Node, _unnamed_arg1: GArray): void
_reparent_nodes_to_root(_unnamed_arg0: Node, _unnamed_arg1: GArray, _unnamed_arg2: Node): void
_reparent_nodes_to_paths_with_transform_and_name(_unnamed_arg0: Node, _unnamed_arg1: GArray, _unnamed_arg2: GArray, _unnamed_arg3: GArray, _unnamed_arg4: GArray, _unnamed_arg5: Node): void
_update_script_button(): void
instantiate(_unnamed_arg0: string): void
get_tree_editor(): SceneTreeEditor
replace_node(_unnamed_arg0: Node, _unnamed_arg1: Node, _unnamed_arg2: boolean, _unnamed_arg3: boolean): void
readonly remote_tree_selected: Signal0
readonly add_node_used: Signal0
readonly node_created: Signal1
}
class SceneTreeEditor extends Control {
constructor(identifier?: any)
_update_tree(_unnamed_arg0: boolean = false): void
update_tree(): void
readonly node_selected: Signal0
readonly node_renamed: Signal0
readonly node_prerename: Signal0
readonly node_changed: Signal0
readonly nodes_dragged: Signal0
readonly nodes_rearranged: Signal3
readonly files_dropped: Signal3
readonly script_dropped: Signal2
readonly rmb_pressed: Signal1
readonly open: Signal0
readonly open_script: Signal0
}
/** One-shot timer.
*
* @link https://docs.godotengine.org/en/4.3/classes/class_scenetreetimer.html
*/
class SceneTreeTimer extends RefCounted {
constructor(identifier?: any)
/** The time remaining (in seconds). */
get time_left(): float64
set time_left(value: float64)
/** Emitted when the timer reaches 0. */
readonly timeout: Signal0
}
class ScreenSelect extends Button {
constructor(identifier?: any)
readonly request_open_in_screen: Signal1
}
/** A class stored as a resource.
*
* @link https://docs.godotengine.org/en/4.3/classes/class_script.html
*/
class Script extends Resource {
constructor(identifier?: any)
/** Returns `true` if the script can be instantiated. */
can_instantiate(): boolean
/** Returns `true` if [param base_object] is an instance of this script. */
instance_has(base_object: Object): boolean
/** Returns `true` if the script contains non-empty source code.
*
* **Note:** If a script does not have source code, this does not mean that it is invalid or unusable. For example, a [GDScript] that was exported with binary tokenization has no source code, but still behaves as expected and could be instantiated. This can be checked with [method can_instantiate].
*/
has_source_code(): boolean
/** Reloads the script's class implementation. Returns an error code. */
reload(keep_state: boolean = false): GError
/** Returns the script directly inherited by this script. */
get_base_script(): Script
/** Returns the script's base type. */
get_instance_base_type(): StringName
/** Returns the class name associated with the script, if there is one. Returns an empty string otherwise.
* To give the script a global name, you can use the `class_name` keyword in GDScript and the `[GlobalClass]` attribute in C#.
*
*/
get_global_name(): StringName
/** Returns `true` if the script, or a base class, defines a signal with the given name. */
has_script_signal(signal_name: StringName): boolean
/** Returns the list of properties in this [Script]. */
get_script_property_list(): GArray
/** Returns the list of methods in this [Script]. */
get_script_method_list(): GArray
/** Returns the list of user signals defined in this [Script]. */
get_script_signal_list(): GArray
/** Returns a dictionary containing constant names and their values. */
get_script_constant_map(): GDictionary
/** Returns the default value of the specified property. */
get_property_default_value(property: StringName): any
/** Returns `true` if the script is a tool script. A tool script can run in the editor. */
is_tool(): boolean
/** Returns `true` if the script is an abstract script. An abstract script does not have a constructor and cannot be instantiated. */
is_abstract(): boolean
/** The script source code or an empty string if source code is not available. When set, does not reload the class implementation automatically. */
get source_code(): string
set source_code(value: string)
}
/** Godot editor's popup dialog for creating new [Script] files.
*
* @link https://docs.godotengine.org/en/4.3/classes/class_scriptcreatedialog.html
*/
class ScriptCreateDialog extends ConfirmationDialog {
constructor(identifier?: any)
/** Prefills required fields to configure the ScriptCreateDialog for use. */
config(inherits: string, path: string, built_in_enabled: boolean = true, load_enabled: boolean = true): void
/** Emitted when the user clicks the OK button. */
readonly script_created: Signal1