Label Class

A control for displaying plain text. It gives you control over the horizontal and vertical alignment and can wrap the text inside the node’s bounding rectangle. It doesn’t support bold, italics, or other rich text formatting. For that, use instead.

Constructors

Label.__new()

Label.__new()

ReadOnly

Type Name Static Default Description
MultiplayerApi Multiplayer The instance associated with this node. See .Note: Renaming the node, or moving it in the tree, will not move the to the new path, you will have to update this manually.
IntPtr NativeInstance The pointer to the native instance of this .

Properties

Type Getter Setter Static Default Description
string get__ImportPath() set__ImportPath(val)
number get_AnchorBottom() set_AnchorBottom(val) Anchors the bottom edge of the node to the origin, the center, or the end of its parent control. It changes how the bottom offset updates when the node moves or changes size. You can use one of the constants for convenience.
number get_AnchorLeft() set_AnchorLeft(val) Anchors the left edge of the node to the origin, the center or the end of its parent control. It changes how the left offset updates when the node moves or changes size. You can use one of the constants for convenience.
number get_AnchorRight() set_AnchorRight(val) Anchors the right edge of the node to the origin, the center or the end of its parent control. It changes how the right offset updates when the node moves or changes size. You can use one of the constants for convenience.
number get_AnchorsPreset() set_AnchorsPreset(val)
number get_AnchorTop() set_AnchorTop(val) Anchors the top edge of the node to the origin, the center or the end of its parent control. It changes how the top offset updates when the node moves or changes size. You can use one of the constants for convenience.
boolean get_AutoTranslate() set_AutoTranslate(val) Toggles if any text should automatically change to its translated version depending on the current locale.
AutoTranslateModeEnum get_AutoTranslateMode() set_AutoTranslateMode(val) Defines if any text should automatically change to its translated version depending on the current locale (for nodes such as , , , etc.). Also decides if the node's strings should be parsed for POT generation.Note: For the root node, auto translate mode can also be set via ProjectSettings.internationalization/rendering/root_node_auto_translate.
AutowrapMode get_AutowrapMode() set_AutowrapMode(val) If set to something other than , the text gets wrapped inside the node's bounding rectangle. If you resize the node, it will change its height automatically to show all the text. To see how each mode behaves, see .
ClipChildrenMode get_ClipChildren() set_ClipChildren(val) Allows the current node to clip child nodes, essentially acting as a mask.Note: Clipping nodes cannot be nested or placed within s. If an ancestor of this node clips its children or is a , then this node's clip mode should be set to to avoid unexpected behavior.
boolean get_ClipContents() set_ClipContents(val) Enables whether rendering of based children should be clipped to this control's rectangle. If , parts of a child which would be visibly outside of this control's rectangle will not be rendered and won't receive input.
boolean get_ClipText() set_ClipText(val) If , the Label only shows the text that fits inside its bounding rectangle and will clip text horizontally.
Vector2 get_CustomMinimumSize() set_CustomMinimumSize(val) The minimum size of the node's bounding rectangle. If you set it to a value greater than (0, 0), the node's bounding rectangle will always have at least this size. Note that nodes have their internal minimum size returned by . It depends on the control's contents, like text, textures, or style boxes. The actual minimum size is the maximum value of this property and the internal minimum size (see ).
string get_EditorDescription() set_EditorDescription(val) An optional description to the node. It will be displayed as a tooltip when hovering over the node in the editor's Scene dock.
string get_EllipsisChar() set_EllipsisChar(val) Ellipsis character used for text clipping.
FocusModeEnum get_FocusMode() set_FocusMode(val) The focus access mode for the control (None, Click or All). Only one Control can be focused at the same time, and it will receive keyboard, gamepad, and mouse signals.
string get_FocusNeighborBottom() set_FocusNeighborBottom(val) Tells Godot which node it should give focus to if the user presses the down arrow on the keyboard or down on a gamepad by default. You can change the key by editing the ProjectSettings.input/ui_down input action. The node must be a . If this property is not set, Godot will give focus to the closest to the bottom of this one.
string get_FocusNeighborLeft() set_FocusNeighborLeft(val) Tells Godot which node it should give focus to if the user presses the left arrow on the keyboard or left on a gamepad by default. You can change the key by editing the ProjectSettings.input/ui_left input action. The node must be a . If this property is not set, Godot will give focus to the closest to the left of this one.
string get_FocusNeighborRight() set_FocusNeighborRight(val) Tells Godot which node it should give focus to if the user presses the right arrow on the keyboard or right on a gamepad by default. You can change the key by editing the ProjectSettings.input/ui_right input action. The node must be a . If this property is not set, Godot will give focus to the closest to the right of this one.
string get_FocusNeighborTop() set_FocusNeighborTop(val) Tells Godot which node it should give focus to if the user presses the top arrow on the keyboard or top on a gamepad by default. You can change the key by editing the ProjectSettings.input/ui_up input action. The node must be a . If this property is not set, Godot will give focus to the closest to the top of this one.
string get_FocusNext() set_FocusNext(val) Tells Godot which node it should give focus to if the user presses Tab on a keyboard by default. You can change the key by editing the ProjectSettings.input/ui_focus_next input action.If this property is not set, Godot will select a "best guess" based on surrounding nodes in the scene tree.
string get_FocusPrevious() set_FocusPrevious(val) Tells Godot which node it should give focus to if the user presses Shift + Tab on a keyboard by default. You can change the key by editing the ProjectSettings.input/ui_focus_prev input action.If this property is not set, Godot will select a "best guess" based on surrounding nodes in the scene tree.
Vector2 get_GlobalPosition() set_GlobalPosition(val) The node's global position, relative to the world (usually to the ).
GrowDirection get_GrowHorizontal() set_GrowHorizontal(val) Controls the direction on the horizontal axis in which the control should grow if its horizontal minimum size is changed to be greater than its current size, as the control always has to be at least the minimum size.
GrowDirection get_GrowVertical() set_GrowVertical(val) Controls the direction on the vertical axis in which the control should grow if its vertical minimum size is changed to be greater than its current size, as the control always has to be at least the minimum size.
HorizontalAlignment get_HorizontalAlignment() set_HorizontalAlignment(val) Controls the text's horizontal alignment. Supports left, center, right, and fill, or justify. Set it to one of the constants.
JustificationFlag get_JustificationFlags() set_JustificationFlags(val) Line fill alignment rules. See for more information.
LabelSettings get_LabelSettings() set_LabelSettings(val) A resource that can be shared between multiple nodes. Takes priority over theme properties.
string get_Language() set_Language(val) Language code used for line-breaking and text shaping algorithms, if left empty current locale is used instead.
LayoutDirectionEnum get_LayoutDirection() set_LayoutDirection(val) Controls layout direction and text writing direction. Right-to-left layouts are necessary for certain languages (e.g. Arabic and Hebrew). See also .
number get_LayoutMode() set_LayoutMode(val)
number get_LightMask() set_LightMask(val) The rendering layers in which this responds to nodes.
number get_LinesSkipped() set_LinesSkipped(val) The number of the lines ignored and not displayed from the start of the value.
boolean get_LocalizeNumeralSystem() set_LocalizeNumeralSystem(val) If , automatically converts code line numbers, list indices, and values from the Western Arabic (0..9) to the numeral systems used in current locale.Note: Numbers within the text are not automatically converted, it can be done manually, using .
Material get_Material() set_Material(val) The material applied to this .
number get_MaxLinesVisible() set_MaxLinesVisible(val) Limits the lines of text the node shows on screen.
Color get_Modulate() set_Modulate(val) The color applied to this . This property does affect child s, unlike which only affects the node itself.
CursorShape get_MouseDefaultCursorShape() set_MouseDefaultCursorShape(val) The default cursor shape for this control. Useful for Godot plugins and applications or games that use the system's mouse cursors.Note: On Linux, shapes may vary depending on the cursor theme of the system.
MouseFilterEnum get_MouseFilter() set_MouseFilter(val) Controls whether the control will be able to receive mouse button input events through and how these events should be handled. Also controls whether the control can receive the , and signals. See the constants to learn what each does.
boolean get_MouseForcePassScrollEvents() set_MouseForcePassScrollEvents(val) When enabled, scroll wheel events processed by will be passed to the parent control even if is set to .You should disable it on the root of your UI if you do not want scroll events to go to the processing.Note: Because this property defaults to , this allows nested scrollable containers to work out of the box.
string get_Name() set_Name(val) The name of the node. This name must be unique among the siblings (other child nodes from the same parent). When set to an existing sibling's name, the node is automatically renamed.Note: When changing the name, the following characters will be replaced with an underscore: (.:@/"%). In particular, the @ character is reserved for auto-generated names. See also String.validate_node_name.
number get_OffsetBottom() set_OffsetBottom(val) Distance between the node's bottom edge and its parent control, based on .Offsets are often controlled by one or multiple parent nodes, so you should not modify them manually if your node is a direct child of a . Offsets update automatically when you move or resize the node.
number get_OffsetLeft() set_OffsetLeft(val) Distance between the node's left edge and its parent control, based on .Offsets are often controlled by one or multiple parent nodes, so you should not modify them manually if your node is a direct child of a . Offsets update automatically when you move or resize the node.
number get_OffsetRight() set_OffsetRight(val) Distance between the node's right edge and its parent control, based on .Offsets are often controlled by one or multiple parent nodes, so you should not modify them manually if your node is a direct child of a . Offsets update automatically when you move or resize the node.
number get_OffsetTop() set_OffsetTop(val) Distance between the node's top edge and its parent control, based on .Offsets are often controlled by one or multiple parent nodes, so you should not modify them manually if your node is a direct child of a . Offsets update automatically when you move or resize the node.
Node get_Owner() set_Owner(val) The owner of this node. The owner must be an ancestor of this node. When packing the owner node in a , all the nodes it owns are also saved with it. See also .Note: In the editor, nodes not owned by the scene root are usually not displayed in the Scene dock, and will not be saved. To prevent this, remember to set the owner after calling .
string get_ParagraphSeparator() set_ParagraphSeparator(val) String used as a paragraph separator. Each paragraph is processed independently, in its own BiDi context.
PhysicsInterpolationModeEnum get_PhysicsInterpolationMode() set_PhysicsInterpolationMode(val) Allows enabling or disabling physics interpolation per node, offering a finer grain of control than turning physics interpolation on and off globally. See ProjectSettings.physics/common/physics_interpolation and for the global setting.Note: When teleporting a node to a distant position you should temporarily disable interpolation with .
Vector2 get_PivotOffset() set_PivotOffset(val) By default, the node's pivot is its top-left corner. When you change its or , it will rotate or scale around this pivot. Set this property to / 2 to pivot around the Control's center.
Vector2 get_Position() set_Position(val) The node's position, relative to its containing node. It corresponds to the rectangle's top-left corner. The property is not affected by .
ProcessModeEnum get_ProcessMode() set_ProcessMode(val) The node's processing behavior (see ). To check if the node can process in its current mode, use .
number get_ProcessPhysicsPriority() set_ProcessPhysicsPriority(val) Similar to but for , , or .
number get_ProcessPriority() set_ProcessPriority(val) The node's execution order of the process callbacks (, , and ). Nodes whose priority value is lower call their process callbacks first, regardless of tree order.
ProcessThreadGroupEnum get_ProcessThreadGroup() set_ProcessThreadGroup(val) Set the process thread group for this node (basically, whether it receives , , or (and the internal versions) on the main thread or in a sub-thread.By default, the thread group is , which means that this node belongs to the same thread group as the parent node. The thread groups means that nodes in a specific thread group will process together, separate to other thread groups (depending on ). If the value is set is , this thread group will occur on a sub thread (not the main thread), otherwise if set to it will process on the main thread. If there is not a parent or grandparent node set to something other than inherit, the node will belong to the default thread group. This default group will process on the main thread and its group order is 0.During processing in a sub-thread, accessing most functions in nodes outside the thread group is forbidden (and it will result in an error in debug mode). Use , , and the likes in order to communicate from the thread groups to the main thread (or to other thread groups).To better understand process thread groups, the idea is that any node set to any other value than will include any child (and grandchild) nodes set to inherit into its process thread group. This means that the processing of all the nodes in the group will happen together, at the same time as the node including them.
number get_ProcessThreadGroupOrder() set_ProcessThreadGroupOrder(val) Change the process thread group order. Groups with a lesser order will process before groups with a greater order. This is useful when a large amount of nodes process in sub thread and, afterwards, another group wants to collect their result in the main thread, as an example.
ProcessThreadMessagesEnum get_ProcessThreadMessages() set_ProcessThreadMessages(val) Set whether the current thread group will process messages (calls to on threads), and whether it wants to receive them during regular process or physics process callbacks.
number get_Rotation() set_Rotation(val) The node's rotation around its pivot, in radians. See to change the pivot's position.Note: This property is edited in the inspector in degrees. If you want to use degrees in a script, use .
number get_RotationDegrees() set_RotationDegrees(val) Helper property to access in degrees instead of radians.
Vector2 get_Scale() set_Scale(val) The node's scale, relative to its . Change this property to scale the node around its . The Control's will also scale according to this value.Note: This property is mainly intended to be used for animation purposes. To support multiple resolutions in your project, use an appropriate viewport stretch mode as described in the documentation instead of scaling Controls individually.Note: does not take into account. This means that scaling up/down will cause bitmap fonts and rasterized (non-MSDF) dynamic fonts to appear blurry or pixelated. To ensure text remains crisp regardless of scale, you can enable MSDF font rendering by enabling ProjectSettings.gui/theme/default_font_multichannel_signed_distance_field (applies to the default project font only), or enabling Multichannel Signed Distance Field in the import options of a DynamicFont for custom fonts. On system fonts, can be enabled in the inspector.Note: If the Control node is a child of a node, the scale will be reset to Vector2(1, 1) when the scene is instantiated. To set the Control's scale when it's instantiated, wait for one frame using await get_tree().process_frame then set its property.
string get_SceneFilePath() set_SceneFilePath(val) The original scene's file path, if the node has been instantiated from a file. Only scene root nodes contains this.
Color get_SelfModulate() set_SelfModulate(val) The color applied to this . This property does not affect child s, unlike which affects both the node itself and its children.Note: Internal children (e.g. sliders in or tab bar in ) are also not affected by this property (see include_internal parameter of and other similar methods).
Node get_ShortcutContext() set_ShortcutContext(val) The which must be a parent of the focused for the shortcut to be activated. If , the shortcut can be activated when any control is focused (a global shortcut). This allows shortcuts to be accepted only when the user has a certain area of the GUI focused.
boolean get_ShowBehindParent() set_ShowBehindParent(val) If , the object draws behind its parent.
Vector2 get_Size() set_Size(val) The size of the node's bounding rectangle, in the node's coordinate system. nodes update this property automatically.
SizeFlags get_SizeFlagsHorizontal() set_SizeFlagsHorizontal(val) Tells the parent nodes how they should resize and place the node on the X axis. Use a combination of the constants to change the flags. See the constants to learn what each does.
number get_SizeFlagsStretchRatio() set_SizeFlagsStretchRatio(val) If the node and at least one of its neighbors uses the size flag, the parent will let it take more or less space depending on this property. If this node has a stretch ratio of 2 and its neighbor a ratio of 1, this node will take two thirds of the available space.
SizeFlags get_SizeFlagsVertical() set_SizeFlagsVertical(val) Tells the parent nodes how they should resize and place the node on the Y axis. Use a combination of the constants to change the flags. See the constants to learn what each does.
StructuredTextParser get_StructuredTextBidiOverride() set_StructuredTextBidiOverride(val) Set BiDi algorithm override for the structured text.
Array get_StructuredTextBidiOverrideOptions() set_StructuredTextBidiOverrideOptions(val) Set additional options for BiDi override.
Single[] get_TabStops() set_TabStops(val) Aligns text to the given tab-stops.
string get_Text() set_Text(val) The text to display on screen.
TextDirection get_TextDirection() set_TextDirection(val) Base text writing direction.
OverrunBehavior get_TextOverrunBehavior() set_TextOverrunBehavior(val) Sets the clipping behavior when the text exceeds the node's bounding rectangle. See for a description of all modes.
TextureFilterEnum get_TextureFilter() set_TextureFilter(val) The texture filtering mode to use on this .
TextureRepeatEnum get_TextureRepeat() set_TextureRepeat(val) The texture repeating mode to use on this .
Theme get_Theme() set_Theme(val) The resource this node and all its and children use. If a child node has its own resource set, theme items are merged with child's definitions having higher priority.Note: styles will have no effect unless the window is embedded.
string get_ThemeTypeVariation() set_ThemeTypeVariation(val) The name of a theme type variation used by this to look up its own theme items. When empty, the class name of the node is used (e.g. Button for the control), as well as the class names of all parent classes (in order of inheritance).When set, this property gives the highest priority to the type of the specified name. This type can in turn extend another type, forming a dependency chain. See . If the theme item cannot be found using this type or its base types, lookup falls back on the class names.Note: To look up 's own items use various get_theme_* methods without specifying theme_type.Note: Theme items are looked for in the tree order, from branch to root, where each node is checked for its property. The earliest match against any type/class name is returned. The project-level Theme and the default Theme are checked last.
AutoTranslateModeEnum get_TooltipAutoTranslateMode() set_TooltipAutoTranslateMode(val) Defines if tooltip text should automatically change to its translated version depending on the current locale. Uses the same auto translate mode as this control when set to .Note: Tooltips customized using do not use this auto translate mode automatically.
string get_TooltipText() set_TooltipText(val) The default tooltip text. The tooltip appears when the user's mouse cursor stays idle over this control for a few moments, provided that the property is not . The time required for the tooltip to appear can be changed with the ProjectSettings.gui/timers/tooltip_delay_sec setting.This string is the default return value of . Override to generate tooltip text dynamically. Override to customize the tooltip interface and behavior.The tooltip popup will use either a default implementation, or a custom one that you can provide by overriding . The default tooltip includes a and whose theme properties can be customized using methods with the "TooltipPanel" and "TooltipLabel" respectively. For example: var styleBox = new StyleBoxFlat(); styleBox.SetBgColor(new Color(1, 1, 0)); styleBox.SetBorderWidthAll(2); // We assume here that the `Theme` property has been assigned a custom Theme beforehand. Theme.SetStyleBox("panel", "TooltipPanel", styleBox); Theme.SetColor("font_color", "TooltipLabel", new Color(0, 1, 1));
boolean get_TopLevel() set_TopLevel(val) If , this will not inherit its transform from parent s. Its draw order will also be changed to make it draw on top of other s that do not have set to . The will effectively act as if it was placed as a child of a bare .
boolean get_UniqueNameInOwner() set_UniqueNameInOwner(val) If , the node can be accessed from any node sharing the same or from the itself, with special %Name syntax in .Note: If another node with the same shares the same as this node, the other node will no longer be accessible as unique.
boolean get_Uppercase() set_Uppercase(val) If , all the text displays as UPPERCASE.
boolean get_UseParentMaterial() set_UseParentMaterial(val) If , the parent 's property is used as this one's material.
VerticalAlignment get_VerticalAlignment() set_VerticalAlignment(val) Controls the text's vertical alignment. Supports top, center, bottom, and fill. Set it to one of the constants.
UInt32 get_VisibilityLayer() set_VisibilityLayer(val) The rendering layer in which this is rendered by nodes. A will render a if it and all its parents share a layer with the 's canvas cull mask.
boolean get_Visible() set_Visible(val) If , this may be drawn. Whether this is actually drawn depends on the visibility of all of its ancestors. In other words: this will be drawn when returns and all ancestors share at least one with this .Note: For controls that inherit , the correct way to make them visible is to call one of the multiple popup*() functions instead.
number get_VisibleCharacters() set_VisibleCharacters(val) 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 accordingly.
VisibleCharactersBehavior get_VisibleCharactersBehavior() set_VisibleCharactersBehavior(val) Sets the clipping behavior when or is set. See for more info.
number get_VisibleRatio() set_VisibleRatio(val) The fraction of characters to display, relative to the total number of characters (see ). 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 accordingly.
boolean get_YSortEnabled() set_YSortEnabled(val) If , this and child nodes with a higher Y position are rendered in front of nodes with a lower Y position. If , this and child nodes are rendered normally in scene tree order.With Y-sorting enabled on a parent node ('A') but disabled on a child node ('B'), the child node ('B') is sorted but its children ('C1', 'C2', etc.) render together on the same Y position as the child node ('B'). This allows you to organize the render order of a scene without changing the scene tree.Nodes sort relative to each other only if they are on the same .
boolean get_ZAsRelative() set_ZAsRelative(val) If , the node's Z index is relative to its parent's Z index. If this node's Z index is 2 and its parent's effective Z index is 3, then this node's effective Z index will be 2 + 3 = 5.
number get_ZIndex() set_ZIndex(val) Controls the order in which the nodes render. A node with a higher Z index will display in front of others. Must be between and (inclusive).Note: Changing the Z index of a only affects the drawing order, not the order in which input events are handled. This can be useful to implement certain UI animations, e.g. a menu where hovered items are scaled and should overlap others.

Functions

Requires an instance!

SetHorizontalAlignment(HorizontalAlignment)

SetHorizontalAlignment(alignment: HorizontalAlignment) -> nil
Type Name Description
HorizontalAlignment alignment

GetHorizontalAlignment

GetHorizontalAlignment() -> HorizontalAlignment

SetVerticalAlignment(VerticalAlignment)

SetVerticalAlignment(alignment: VerticalAlignment) -> nil
Type Name Description
VerticalAlignment alignment

GetVerticalAlignment

GetVerticalAlignment() -> VerticalAlignment

SetText(string)

SetText(text: string) -> nil
Type Name Description
string text

GetText

GetText() -> string

SetLabelSettings(LabelSettings)

SetLabelSettings(settings: LabelSettings) -> nil
Type Name Description
LabelSettings settings

GetLabelSettings

GetLabelSettings() -> LabelSettings

SetTextDirection(TextDirection)

SetTextDirection(direction: TextDirection) -> nil
Type Name Description
TextDirection direction

GetTextDirection

GetTextDirection() -> TextDirection

SetLanguage(string)

SetLanguage(language: string) -> nil
Type Name Description
string language

GetLanguage

GetLanguage() -> string

SetParagraphSeparator(string)

SetParagraphSeparator(paragraphSeparator: string) -> nil
Type Name Description
string paragraphSeparator

GetParagraphSeparator

GetParagraphSeparator() -> string

SetAutowrapMode(AutowrapMode)

SetAutowrapMode(autowrapMode: AutowrapMode) -> nil
Type Name Description
AutowrapMode autowrapMode

GetAutowrapMode

GetAutowrapMode() -> AutowrapMode

SetJustificationFlags(JustificationFlag)

SetJustificationFlags(justificationFlags: JustificationFlag) -> nil
Type Name Description
JustificationFlag justificationFlags

GetJustificationFlags

GetJustificationFlags() -> JustificationFlag

SetClipText(boolean)

SetClipText(enable: boolean) -> nil
Type Name Description
boolean enable

IsClippingText

IsClippingText() -> boolean

SetTabStops(Single[])

SetTabStops(tabStops: Single[]) -> nil
Type Name Description
Single[] tabStops

SetTabStops(ReadOnlySpan__number)

SetTabStops(tabStops: ReadOnlySpan__number) -> nil
Type Name Description
ReadOnlySpan__number tabStops

GetTabStops

GetTabStops() -> Single[]

SetTextOverrunBehavior(OverrunBehavior)

SetTextOverrunBehavior(overrunBehavior: OverrunBehavior) -> nil
Type Name Description
OverrunBehavior overrunBehavior

GetTextOverrunBehavior

GetTextOverrunBehavior() -> OverrunBehavior

SetEllipsisChar(string)

SetEllipsisChar(char: string) -> nil
Type Name Description
string char

GetEllipsisChar

GetEllipsisChar() -> string

SetUppercase(boolean)

SetUppercase(enable: boolean) -> nil
Type Name Description
boolean enable

IsUppercase

IsUppercase() -> boolean

GetLineHeight(number)

Returns the height of the line .If is set to -1, returns the biggest line height.If there are no lines, returns font size in pixels.

GetLineHeight(line: number = -1) -> number
Type Name Description
number line

GetLineCount

Returns the number of lines of text the Label has.

GetLineCount() -> number

GetVisibleLineCount

Returns the number of lines shown. Useful if the ‘s height cannot currently display all lines.

GetVisibleLineCount() -> number

GetTotalCharacterCount

Returns the total number of printable characters in the text (excluding spaces and newlines).

GetTotalCharacterCount() -> number

SetVisibleCharacters(number)

SetVisibleCharacters(amount: number) -> nil
Type Name Description
number amount

GetVisibleCharacters

GetVisibleCharacters() -> number

GetVisibleCharactersBehavior

GetVisibleCharactersBehavior() -> VisibleCharactersBehavior

SetVisibleCharactersBehavior(VisibleCharactersBehavior)

SetVisibleCharactersBehavior(behavior: VisibleCharactersBehavior) -> nil
Type Name Description
VisibleCharactersBehavior behavior

SetVisibleRatio(number)

SetVisibleRatio(ratio: number) -> nil
Type Name Description
number ratio

GetVisibleRatio

GetVisibleRatio() -> number

SetLinesSkipped(number)

SetLinesSkipped(linesSkipped: number) -> nil
Type Name Description
number linesSkipped

GetLinesSkipped

GetLinesSkipped() -> number

SetMaxLinesVisible(number)

SetMaxLinesVisible(linesVisible: number) -> nil
Type Name Description
number linesVisible

GetMaxLinesVisible

GetMaxLinesVisible() -> number

SetStructuredTextBidiOverride(StructuredTextParser)

SetStructuredTextBidiOverride(parser: StructuredTextParser) -> nil
Type Name Description
StructuredTextParser parser

GetStructuredTextBidiOverride

GetStructuredTextBidiOverride() -> StructuredTextParser

SetStructuredTextBidiOverrideOptions(Array)

SetStructuredTextBidiOverrideOptions(args: Array) -> nil
Type Name Description
Array args

GetStructuredTextBidiOverrideOptions

GetStructuredTextBidiOverrideOptions() -> Array

GetCharacterBounds(number)

Returns the bounding rectangle of the character at position in the label’s local coordinate system. If the character is a non-visual character or is outside the valid range, an empty is returned. If the character is a part of a composite grapheme, the bounding rectangle of the whole grapheme is returned.

GetCharacterBounds(pos: number) -> Rect2
Type Name Description
number pos

_CanDropData(Vector2,Variant)

Godot calls this method to test if from a control’s can be dropped at . is local to this control.This method should only be used to test the data. Process the data in . public override bool _CanDropData(Vector2 atPosition, Variant data) { // Check position if it is relevant to you // Otherwise, just check data return data.VariantType == Variant.Type.Dictionary && data.AsGodotDictionary().ContainsKey(“expected”); }

_CanDropData(atPosition: Vector2,data: Variant) -> boolean
Type Name Description
Vector2 atPosition
Variant data

_DropData(Vector2,Variant)

Godot calls this method to pass you the from a control’s result. Godot first calls to test if is allowed to drop at where is local to this control. public override bool _CanDropData(Vector2 atPosition, Variant data) { return data.VariantType == Variant.Type.Dictionary && data.AsGodotDictionary().ContainsKey(“color”); } public override void _DropData(Vector2 atPosition, Variant data) { Color color = data.AsGodotDictionary()[“color”].AsColor(); }

_DropData(atPosition: Vector2,data: Variant) -> nil
Type Name Description
Vector2 atPosition
Variant data

_GetDragData(Vector2)

Godot calls this method to get data that can be dragged and dropped onto controls that expect drop data. Returns if there is no data to drag. Controls that want to receive drop data should implement and . is local to this control. Drag may be forced with .A preview that will follow the mouse that should represent the data can be set with . A good time to set the preview is in this method. public override Variant _GetDragData(Vector2 atPosition) { var myData = MakeData(); // This is your custom method generating the drag data. SetDragPreview(MakePreview(myData)); // This is your custom method generating the preview of the drag data. return myData; }

_GetDragData(atPosition: Vector2) -> Variant
Type Name Description
Vector2 atPosition

_GetMinimumSize

Virtual method to be implemented by the user. Returns the minimum size for this control. Alternative to for controlling minimum size via code. The actual minimum size will be the max value of these two (in each axis separately).If not overridden, defaults to Vector2.ZERO.Note: This method will not be called when the script is attached to a node that already overrides its minimum size (e.g. , , etc.). It can only be used with most basic GUI nodes, like , , etc.

_GetMinimumSize() -> Vector2

_GetTooltip(Vector2)

Virtual method to be implemented by the user. Returns the tooltip text for the position in control’s local coordinates, which will typically appear when the cursor is resting over this control. See .Note: If this method returns an empty and is not overridden, no tooltip is displayed.

_GetTooltip(atPosition: Vector2) -> string
Type Name Description
Vector2 atPosition

_GuiInput(InputEvent)

Virtual method to be implemented by the user. Override this method to handle and accept inputs on UI elements. See also .Example: Click on the control to print a message: public override void _GuiInput(InputEvent @event) { if (@event is InputEventMouseButton mb) { if (mb.ButtonIndex == MouseButton.Left && mb.Pressed) { GD.Print(“I’ve been clicked D:”); } } } If the inherits , this method will not be called when:- the control’s is set to ;- the control is obstructed by another control on top, that doesn’t have set to ;- the control’s parent has set to or has accepted the event;- the control’s parent has enabled and the ‘s position is outside the parent’s rectangle;- the ‘s position is outside the control (see ).Note: The ‘s position is relative to this control’s origin.

_GuiInput(event: InputEvent) -> nil
Type Name Description
InputEvent event

_HasPoint(Vector2)

Virtual method to be implemented by the user. Returns whether the given is inside this control.If not overridden, default behavior is checking if the point is within control’s Rect.Note: If you want to check if a point is inside the control, you can use Rect2(Vector2.ZERO, size).has_point(point).

_HasPoint(point: Vector2) -> boolean
Type Name Description
Vector2 point

_MakeCustomTooltip(string)

Virtual method to be implemented by the user. Returns a node that should be used as a tooltip instead of the default one. is the return value of .The returned node must be of type or Control-derived. It can have child nodes of any type. It is freed when the tooltip disappears, so make sure you always provide a new instance (if you want to use a pre-existing node from your scene tree, you can duplicate it and pass the duplicated instance). When or a non-Control node is returned, the default tooltip will be used instead.The returned node will be added as child to a , so you should only provide the contents of that panel. That can be themed using for the type “TooltipPanel” (see for an example).Note: The tooltip is shrunk to minimal size. If you want to ensure it’s fully visible, you might want to set its to some non-zero value.Note: The node (and any relevant children) should have their set to when returned, otherwise, the viewport that instantiates it will not be able to calculate its minimum size reliably.Note: If overridden, this method is called even if returns an empty string. When this happens with the default tooltip, it is not displayed. To copy this behavior, return in this method when is empty.Example: Use a constructed node as a tooltip: public override Control _MakeCustomTooltip(string forText) { var label = new Label(); label.Text = forText; return label; } Example: Usa a scene instance as a tooltip: public override Control _MakeCustomTooltip(string forText) { Node tooltip = ResourceLoader.Load("res://some_tooltip_scene.tscn").Instantiate(); tooltip.GetNode

_MakeCustomTooltip(forText: string) -> GodotObject
Type Name Description
string forText

_StructuredTextParser(Array,string)

User defined BiDi algorithm override function.Returns an of text ranges and text base directions, in the left-to-right order. Ranges should cover full source without overlaps. BiDi algorithm will be used on each range separately.

_StructuredTextParser(args: Array,text: string) -> Array__Vector3I
Type Name Description
Array args
string text

AcceptEvent

Marks an input event as handled. Once you accept an input event, it stops propagating, even to nodes listening to or .Note: This does not affect the methods in , only the way events are propagated.

AcceptEvent() -> nil

GetMinimumSize

Returns the minimum size for this control. See .

GetMinimumSize() -> Vector2

GetCombinedMinimumSize

Returns combined minimum size from and .

GetCombinedMinimumSize() -> Vector2

SetAnchorsPreset(LayoutPreset,boolean)

SetAnchorsPreset(preset: LayoutPreset,keepOffsets: boolean = False) -> nil
Type Name Description
LayoutPreset preset
boolean keepOffsets

SetOffsetsPreset(LayoutPreset,LayoutPresetMode,number)

SetOffsetsPreset(preset: LayoutPreset,resizeMode: LayoutPresetMode = Minsize,margin: number = 0) -> nil
Type Name Description
LayoutPreset preset
LayoutPresetMode resizeMode
number margin

SetAnchorsAndOffsetsPreset(LayoutPreset,LayoutPresetMode,number)

SetAnchorsAndOffsetsPreset(preset: LayoutPreset,resizeMode: LayoutPresetMode = Minsize,margin: number = 0) -> nil
Type Name Description
LayoutPreset preset
LayoutPresetMode resizeMode
number margin

SetAnchor(Side,number,boolean,boolean)

Sets the anchor for the specified to . A setter method for , , and .If is , offsets aren’t updated after this operation.If is and the opposite anchor overlaps this anchor, the opposite one will have its value overridden. For example, when setting left anchor to 1 and the right anchor has value of 0.5, the right anchor will also get value of 1. If was , the left anchor would get value 0.5.

SetAnchor(side: Side,anchor: number,keepOffset: boolean = False,pushOppositeAnchor: boolean = True) -> nil
Type Name Description
Side side
number anchor
boolean keepOffset
boolean pushOppositeAnchor

GetAnchor(Side)

Returns the anchor for the specified . A getter method for , , and .

GetAnchor(side: Side) -> number
Type Name Description
Side side

SetOffset(Side,number)

Sets the offset for the specified to . A setter method for , , and .

SetOffset(side: Side,offset: number) -> nil
Type Name Description
Side side
number offset

GetOffset(Side)

Returns the offset for the specified . A getter method for , , and .

GetOffset(offset: Side) -> number
Type Name Description
Side offset

SetAnchorAndOffset(Side,number,number,boolean)

Works the same as , but instead of keep_offset argument and automatic update of offset, it allows to set the offset yourself (see ).

SetAnchorAndOffset(side: Side,anchor: number,offset: number,pushOppositeAnchor: boolean = False) -> nil
Type Name Description
Side side
number anchor
number offset
boolean pushOppositeAnchor

SetBegin(Vector2)

Sets and at the same time. Equivalent of changing .

SetBegin(position: Vector2) -> nil
Type Name Description
Vector2 position

SetEnd(Vector2)

Sets and at the same time.

SetEnd(position: Vector2) -> nil
Type Name Description
Vector2 position

SetPosition(Vector2,boolean)

Sets the to given .If is , control’s anchors will be updated instead of offsets.

SetPosition(position: Vector2,keepOffsets: boolean = False) -> nil
Type Name Description
Vector2 position
boolean keepOffsets

SetSize(Vector2,boolean)

Sets the size (see ).If is , control’s anchors will be updated instead of offsets.

SetSize(size: Vector2,keepOffsets: boolean = False) -> nil
Type Name Description
Vector2 size
boolean keepOffsets

ResetSize

Resets the size to . This is equivalent to calling set_size(Vector2()) (or any size below the minimum).

ResetSize() -> nil

SetCustomMinimumSize(Vector2)

SetCustomMinimumSize(size: Vector2) -> nil
Type Name Description
Vector2 size

SetGlobalPosition(Vector2,boolean)

Sets the to given .If is , control’s anchors will be updated instead of offsets.

SetGlobalPosition(position: Vector2,keepOffsets: boolean = False) -> nil
Type Name Description
Vector2 position
boolean keepOffsets

SetRotation(number)

SetRotation(radians: number) -> nil
Type Name Description
number radians

SetRotationDegrees(number)

SetRotationDegrees(degrees: number) -> nil
Type Name Description
number degrees

SetScale(Vector2)

SetScale(scale: Vector2) -> nil
Type Name Description
Vector2 scale

SetPivotOffset(Vector2)

SetPivotOffset(pivotOffset: Vector2) -> nil
Type Name Description
Vector2 pivotOffset

GetBegin

Returns and . See also .

GetBegin() -> Vector2

GetEnd

Returns and .

GetEnd() -> Vector2

GetPosition

GetPosition() -> Vector2

GetSize

GetSize() -> Vector2

GetRotation

GetRotation() -> number

GetRotationDegrees

GetRotationDegrees() -> number

GetScale

GetScale() -> Vector2

GetPivotOffset

GetPivotOffset() -> Vector2

GetCustomMinimumSize

GetCustomMinimumSize() -> Vector2

GetParentAreaSize

Returns the width/height occupied in the parent control.

GetParentAreaSize() -> Vector2

GetGlobalPosition

GetGlobalPosition() -> Vector2

GetScreenPosition

Returns the position of this in global screen coordinates (i.e. taking window position into account). Mostly useful for editor plugins.Equals to if the window is embedded (see ).Example: Show a popup at the mouse position: popup_menu.position = get_screen_position() + get_local_mouse_position() popup_menu.reset_size() popup_menu.popup()

GetScreenPosition() -> Vector2

GetRect

Returns the position and size of the control in the coordinate system of the containing node. See , and .Note: If is not the default rotation, the resulting size is not meaningful.Note: Setting to can lead to rounding inaccuracies between the displayed control and the returned .

GetRect() -> Rect2

GetGlobalRect

Returns the position and size of the control relative to the containing canvas. See and .Note: If the node itself or any parent between the node and the canvas have a non default rotation or skew, the resulting size is likely not meaningful.Note: Setting to can lead to rounding inaccuracies between the displayed control and the returned .

GetGlobalRect() -> Rect2

SetFocusMode(FocusModeEnum)

SetFocusMode(mode: FocusModeEnum) -> nil
Type Name Description
FocusModeEnum mode

GetFocusMode

GetFocusMode() -> FocusModeEnum

HasFocus

Returns if this is the current focused control. See .

HasFocus() -> boolean

GrabFocus

Steal the focus from another control and become the focused control (see ).Note: Using this method together with Callable.call_deferred makes it more reliable, especially when called inside .

GrabFocus() -> nil

ReleaseFocus

Give up the focus. No other control will be able to receive input.

ReleaseFocus() -> nil

FindPrevValidFocus

Finds the previous (above in the tree) that can receive the focus.

FindPrevValidFocus() -> Control

FindNextValidFocus

Finds the next (below in the tree) that can receive the focus.

FindNextValidFocus() -> Control

FindValidFocusNeighbor(Side)

Finds the next that can receive the focus on the specified .Note: This is different from , which returns the path of a specified focus neighbor.

FindValidFocusNeighbor(side: Side) -> Control
Type Name Description
Side side

SetHSizeFlags(SizeFlags)

SetHSizeFlags(flags: SizeFlags) -> nil
Type Name Description
SizeFlags flags

GetHSizeFlags

GetHSizeFlags() -> SizeFlags

SetStretchRatio(number)

SetStretchRatio(ratio: number) -> nil
Type Name Description
number ratio

GetStretchRatio

GetStretchRatio() -> number

SetVSizeFlags(SizeFlags)

SetVSizeFlags(flags: SizeFlags) -> nil
Type Name Description
SizeFlags flags

GetVSizeFlags

GetVSizeFlags() -> SizeFlags

SetTheme(Theme)

SetTheme(theme: Theme) -> nil
Type Name Description
Theme theme

GetTheme

GetTheme() -> Theme

SetThemeTypeVariation(string)

SetThemeTypeVariation(themeType: string) -> nil
Type Name Description
string themeType

GetThemeTypeVariation

GetThemeTypeVariation() -> string

BeginBulkThemeOverride

Prevents _theme__override methods from emitting until is called.

BeginBulkThemeOverride() -> nil

EndBulkThemeOverride

Ends a bulk theme override update. See .

EndBulkThemeOverride() -> nil

AddThemeIconOverride(string,Texture2D)

Creates a local override for a theme icon with the specified . Local overrides always take precedence when fetching theme items for the control. An override can be removed with .See also .

AddThemeIconOverride(name: string,texture: Texture2D) -> nil
Type Name Description
string name
Texture2D texture

AddThemeStyleboxOverride(string,StyleBox)

Creates a local override for a theme with the specified . Local overrides always take precedence when fetching theme items for the control. An override can be removed with .See also .Example: Modify a property in a by duplicating it: // The snippet below assumes the child node “MyButton” has a StyleBoxFlat assigned. // Resources are shared across instances, so we need to duplicate it // to avoid modifying the appearance of all other buttons. StyleBoxFlat newStyleboxNormal = GetNode

AddThemeStyleboxOverride(name: string,stylebox: StyleBox) -> nil
Type Name Description
string name
StyleBox stylebox

AddThemeFontOverride(string,Font)

Creates a local override for a theme with the specified . Local overrides always take precedence when fetching theme items for the control. An override can be removed with .See also .

AddThemeFontOverride(name: string,font: Font) -> nil
Type Name Description
string name
Font font

AddThemeFontSizeOverride(string,number)

Creates a local override for a theme font size with the specified . Local overrides always take precedence when fetching theme items for the control. An override can be removed with .See also .

AddThemeFontSizeOverride(name: string,fontSize: number) -> nil
Type Name Description
string name
number fontSize

AddThemeColorOverride(string,Color)

Creates a local override for a theme with the specified . Local overrides always take precedence when fetching theme items for the control. An override can be removed with .See also .Example: Override a ‘s color and reset it later: // Given the child Label node “MyLabel”, override its font color with a custom value. GetNode

AddThemeColorOverride(name: string,color: Color) -> nil
Type Name Description
string name
Color color

AddThemeConstantOverride(string,number)

Creates a local override for a theme constant with the specified . Local overrides always take precedence when fetching theme items for the control. An override can be removed with .See also .

AddThemeConstantOverride(name: string,constant: number) -> nil
Type Name Description
string name
number constant

RemoveThemeIconOverride(string)

Removes a local override for a theme icon with the specified previously added by or via the Inspector dock.

RemoveThemeIconOverride(name: string) -> nil
Type Name Description
string name

RemoveThemeStyleboxOverride(string)

Removes a local override for a theme with the specified previously added by or via the Inspector dock.

RemoveThemeStyleboxOverride(name: string) -> nil
Type Name Description
string name

RemoveThemeFontOverride(string)

Removes a local override for a theme with the specified previously added by or via the Inspector dock.

RemoveThemeFontOverride(name: string) -> nil
Type Name Description
string name

RemoveThemeFontSizeOverride(string)

Removes a local override for a theme font size with the specified previously added by or via the Inspector dock.

RemoveThemeFontSizeOverride(name: string) -> nil
Type Name Description
string name

RemoveThemeColorOverride(string)

Removes a local override for a theme with the specified previously added by or via the Inspector dock.

RemoveThemeColorOverride(name: string) -> nil
Type Name Description
string name

RemoveThemeConstantOverride(string)

Removes a local override for a theme constant with the specified previously added by or via the Inspector dock.

RemoveThemeConstantOverride(name: string) -> nil
Type Name Description
string name

GetThemeIcon(string,string)

Returns an icon from the first matching in the tree if that has an icon item with the specified and .See for details.

GetThemeIcon(name: string,themeType: string) -> Texture2D
Type Name Description
string name
string themeType

GetThemeStylebox(string,string)

Returns a from the first matching in the tree if that has a stylebox item with the specified and .See for details.

GetThemeStylebox(name: string,themeType: string) -> StyleBox
Type Name Description
string name
string themeType

GetThemeFont(string,string)

Returns a from the first matching in the tree if that has a font item with the specified and .See for details.

GetThemeFont(name: string,themeType: string) -> Font
Type Name Description
string name
string themeType

GetThemeFontSize(string,string)

Returns a font size from the first matching in the tree if that has a font size item with the specified and .See for details.

GetThemeFontSize(name: string,themeType: string) -> number
Type Name Description
string name
string themeType

GetThemeColor(string,string)

Returns a from the first matching in the tree if that has a color item with the specified and . If is omitted the class name of the current control is used as the type, or if it is defined. If the type is a class name its parent classes are also checked, in order of inheritance. If the type is a variation its base types are checked, in order of dependency, then the control’s class name and its parent classes are checked.For the current control its local overrides are considered first (see ), then its assigned . After the current control, each parent control and its assigned are considered; controls without a assigned are skipped. If no matching is found in the tree, the custom project (see ProjectSettings.gui/theme/custom) and the default are used (see ). public override void _Ready() { // Get the font color defined for the current Control’s class, if it exists. Modulate = GetThemeColor(“font_color”); // Get the font color defined for the Button class. Modulate = GetThemeColor(“font_color”, “Button”); }

GetThemeColor(name: string,themeType: string) -> Color
Type Name Description
string name
string themeType

GetThemeConstant(string,string)

Returns a constant from the first matching in the tree if that has a constant item with the specified and .See for details.

GetThemeConstant(name: string,themeType: string) -> number
Type Name Description
string name
string themeType

HasThemeIconOverride(string)

Returns if there is a local override for a theme icon with the specified in this node.See .

HasThemeIconOverride(name: string) -> boolean
Type Name Description
string name

HasThemeStyleboxOverride(string)

Returns if there is a local override for a theme with the specified in this node.See .

HasThemeStyleboxOverride(name: string) -> boolean
Type Name Description
string name

HasThemeFontOverride(string)

Returns if there is a local override for a theme with the specified in this node.See .

HasThemeFontOverride(name: string) -> boolean
Type Name Description
string name

HasThemeFontSizeOverride(string)

Returns if there is a local override for a theme font size with the specified in this node.See .

HasThemeFontSizeOverride(name: string) -> boolean
Type Name Description
string name

HasThemeColorOverride(string)

Returns if there is a local override for a theme with the specified in this node.See .

HasThemeColorOverride(name: string) -> boolean
Type Name Description
string name

HasThemeConstantOverride(string)

Returns if there is a local override for a theme constant with the specified in this node.See .

HasThemeConstantOverride(name: string) -> boolean
Type Name Description
string name

HasThemeIcon(string,string)

Returns if there is a matching in the tree that has an icon item with the specified and .See for details.

HasThemeIcon(name: string,themeType: string) -> boolean
Type Name Description
string name
string themeType

HasThemeStylebox(string,string)

Returns if there is a matching in the tree that has a stylebox item with the specified and .See for details.

HasThemeStylebox(name: string,themeType: string) -> boolean
Type Name Description
string name
string themeType

HasThemeFont(string,string)

Returns if there is a matching in the tree that has a font item with the specified and .See for details.

HasThemeFont(name: string,themeType: string) -> boolean
Type Name Description
string name
string themeType

HasThemeFontSize(string,string)

Returns if there is a matching in the tree that has a font size item with the specified and .See for details.

HasThemeFontSize(name: string,themeType: string) -> boolean
Type Name Description
string name
string themeType

HasThemeColor(string,string)

Returns if there is a matching in the tree that has a color item with the specified and .See for details.

HasThemeColor(name: string,themeType: string) -> boolean
Type Name Description
string name
string themeType

HasThemeConstant(string,string)

Returns if there is a matching in the tree that has a constant item with the specified and .See for details.

HasThemeConstant(name: string,themeType: string) -> boolean
Type Name Description
string name
string themeType

GetThemeDefaultBaseScale

Returns the default base scale value from the first matching in the tree if that has a valid value.See for details.

GetThemeDefaultBaseScale() -> number

GetThemeDefaultFont

Returns the default font from the first matching in the tree if that has a valid value.See for details.

GetThemeDefaultFont() -> Font

GetThemeDefaultFontSize

Returns the default font size value from the first matching in the tree if that has a valid value.See for details.

GetThemeDefaultFontSize() -> number

GetParentControl

Returns the parent control node.

GetParentControl() -> Control

SetHGrowDirection(GrowDirection)

SetHGrowDirection(direction: GrowDirection) -> nil
Type Name Description
GrowDirection direction

GetHGrowDirection

GetHGrowDirection() -> GrowDirection

SetVGrowDirection(GrowDirection)

SetVGrowDirection(direction: GrowDirection) -> nil
Type Name Description
GrowDirection direction

GetVGrowDirection

GetVGrowDirection() -> GrowDirection

SetTooltipAutoTranslateMode(AutoTranslateModeEnum)

SetTooltipAutoTranslateMode(mode: AutoTranslateModeEnum) -> nil
Type Name Description
AutoTranslateModeEnum mode

GetTooltipAutoTranslateMode

GetTooltipAutoTranslateMode() -> AutoTranslateModeEnum

SetTooltipText(string)

SetTooltipText(hint: string) -> nil
Type Name Description
string hint

GetTooltipText

GetTooltipText() -> string

GetTooltip(Nullable__Vector2)

GetTooltip(atPosition: Nullable__Vector2) -> string
Type Name Description
Nullable__Vector2 atPosition

SetDefaultCursorShape(CursorShape)

SetDefaultCursorShape(shape: CursorShape) -> nil
Type Name Description
CursorShape shape

GetDefaultCursorShape

GetDefaultCursorShape() -> CursorShape

GetCursorShape(Nullable__Vector2)

GetCursorShape(position: Nullable__Vector2) -> CursorShape
Type Name Description
Nullable__Vector2 position

SetFocusNeighbor(Side,string)

Sets the focus neighbor for the specified to the at node path. A setter method for , , and .

SetFocusNeighbor(side: Side,neighbor: string) -> nil
Type Name Description
Side side
string neighbor

GetFocusNeighbor(Side)

Returns the focus neighbor for the specified . A getter method for , , and .Note: To find the next on the specific , even if a neighbor is not assigned, use .

GetFocusNeighbor(side: Side) -> string
Type Name Description
Side side

SetFocusNext(string)

SetFocusNext(next: string) -> nil
Type Name Description
string next

GetFocusNext

GetFocusNext() -> string

SetFocusPrevious(string)

SetFocusPrevious(previous: string) -> nil
Type Name Description
string previous

GetFocusPrevious

GetFocusPrevious() -> string

ForceDrag(Variant,Control)

Forces drag and bypasses and by passing and . Drag will start even if the mouse is neither over nor pressed on this control.The methods and must be implemented on controls that want to receive drop data.

ForceDrag(data: Variant,preview: Control) -> nil
Type Name Description
Variant data
Control preview

SetMouseFilter(MouseFilterEnum)

SetMouseFilter(filter: MouseFilterEnum) -> nil
Type Name Description
MouseFilterEnum filter

GetMouseFilter

GetMouseFilter() -> MouseFilterEnum

SetForcePassScrollEvents(boolean)

SetForcePassScrollEvents(forcePassScrollEvents: boolean) -> nil
Type Name Description
boolean forcePassScrollEvents

IsForcePassScrollEvents

IsForcePassScrollEvents() -> boolean

SetClipContents(boolean)

SetClipContents(enable: boolean) -> nil
Type Name Description
boolean enable

IsClippingContents

IsClippingContents() -> boolean

GrabClickFocus

Creates an that attempts to click the control. If the event is received, the control gains focus. public override void _Process(double delta) { GrabClickFocus(); // When clicking another Control node, this node will be clicked instead. }

GrabClickFocus() -> nil

SetDragForwarding(Callable,Callable,Callable)

Sets the given callables to be used instead of the control’s own drag-and-drop virtual methods. If a callable is empty, its respective virtual method is used as normal.The arguments for each callable should be exactly the same as their respective virtual methods, which would be:- corresponds to and requires a ;- corresponds to and requires both a and a ;- corresponds to and requires both a and a .

SetDragForwarding(dragFunc: Callable,canDropFunc: Callable,dropFunc: Callable) -> nil
Type Name Description
Callable dragFunc
Callable canDropFunc
Callable dropFunc

SetDragPreview(Control)

Shows the given control at the mouse pointer. A good time to call this method is in . The control must not be in the scene tree. You should not free the control, and you should not keep a reference to the control beyond the duration of the drag. It will be deleted automatically after the drag has ended. [Export] private Color _color = new Color(1, 0, 0, 1); public override Variant _GetDragData(Vector2 atPosition) { // Use a control that is not in the tree var cpb = new ColorPickerButton(); cpb.Color = _color; cpb.Size = new Vector2(50, 50); SetDragPreview(cpb); return _color; }

SetDragPreview(control: Control) -> nil
Type Name Description
Control control

IsDragSuccessful

Returns if a drag operation is successful. Alternative to .Best used with .

IsDragSuccessful() -> boolean

WarpMouse(Vector2)

Moves the mouse cursor to , relative to of this .Note: is only supported on Windows, macOS and Linux. It has no effect on Android, iOS and Web.

WarpMouse(position: Vector2) -> nil
Type Name Description
Vector2 position

SetShortcutContext(Node)

SetShortcutContext(node: Node) -> nil
Type Name Description
Node node

GetShortcutContext

GetShortcutContext() -> Node

UpdateMinimumSize

Invalidates the size cache in this node and in parent nodes up to top level. Intended to be used with when the return value is changed. Setting directly calls this method automatically.

UpdateMinimumSize() -> nil

SetLayoutDirection(LayoutDirectionEnum)

SetLayoutDirection(direction: LayoutDirectionEnum) -> nil
Type Name Description
LayoutDirectionEnum direction

GetLayoutDirection

GetLayoutDirection() -> LayoutDirectionEnum

IsLayoutRtl

Returns if layout is right-to-left. See also .

IsLayoutRtl() -> boolean

SetAutoTranslate(boolean)

SetAutoTranslate(enable: boolean) -> nil
Type Name Description
boolean enable

IsAutoTranslating

IsAutoTranslating() -> boolean

SetLocalizeNumeralSystem(boolean)

SetLocalizeNumeralSystem(enable: boolean) -> nil
Type Name Description
boolean enable

IsLocalizingNumeralSystem

IsLocalizingNumeralSystem() -> boolean

_Draw

Called when has been requested to redraw (after is called, either manually or by the engine).Corresponds to the notification in .

_Draw() -> nil

GetCanvasItem

Returns the canvas item RID used by for this item.

GetCanvasItem() -> Rid

SetVisible(boolean)

SetVisible(visible: boolean) -> nil
Type Name Description
boolean visible

IsVisible

IsVisible() -> boolean

IsVisibleInTree

Returns if the node is present in the , its property is and all its ancestors are also visible. If any ancestor is hidden, this node will not be visible in the scene tree, and is therefore not drawn (see ).Visibility is checked only in parent nodes that inherit from , , and . If the parent is of any other type (such as , , or ), it is assumed to be visible.Note: This method does not take into account, so even if this method returns , the node might end up not being rendered.

IsVisibleInTree() -> boolean

Show

Show the if it’s currently hidden. This is equivalent to setting to . For controls that inherit , the correct way to make them visible is to call one of the multiple popup*() functions instead.

Show() -> nil

Hide

Hide the if it’s currently visible. This is equivalent to setting to .

Hide() -> nil

QueueRedraw

Queues the to redraw. During idle time, if is visible, is sent and is called. This only occurs once per frame, even if this method has been called multiple times.

QueueRedraw() -> nil

MoveToFront

Moves this node to display on top of its siblings.Internally, the node is moved to the bottom of parent’s child list. The method has no effect on nodes without a parent.

MoveToFront() -> nil

SetAsTopLevel(boolean)

SetAsTopLevel(enable: boolean) -> nil
Type Name Description
boolean enable

IsSetAsTopLevel

IsSetAsTopLevel() -> boolean

SetLightMask(number)

SetLightMask(lightMask: number) -> nil
Type Name Description
number lightMask

GetLightMask

GetLightMask() -> number

SetModulate(Color)

SetModulate(modulate: Color) -> nil
Type Name Description
Color modulate

GetModulate

GetModulate() -> Color

SetSelfModulate(Color)

SetSelfModulate(selfModulate: Color) -> nil
Type Name Description
Color selfModulate

GetSelfModulate

GetSelfModulate() -> Color

SetZIndex(number)

SetZIndex(zIndex: number) -> nil
Type Name Description
number zIndex

GetZIndex

GetZIndex() -> number

SetZAsRelative(boolean)

SetZAsRelative(enable: boolean) -> nil
Type Name Description
boolean enable

IsZRelative

IsZRelative() -> boolean

SetYSortEnabled(boolean)

SetYSortEnabled(enabled: boolean) -> nil
Type Name Description
boolean enabled

IsYSortEnabled

IsYSortEnabled() -> boolean

SetDrawBehindParent(boolean)

SetDrawBehindParent(enable: boolean) -> nil
Type Name Description
boolean enable

IsDrawBehindParentEnabled

IsDrawBehindParentEnabled() -> boolean

DrawLine(Vector2,Vector2,Color,number,boolean)

Draws a line from a 2D point to another, with a given color and width. It can be optionally antialiased. See also , , and .If is negative, then a two-point primitive will be drawn instead of a four-point one. This means that when the CanvasItem is scaled, the line will remain thin. If this behavior is not desired, then pass a positive like 1.0.

DrawLine(from: Vector2,to: Vector2,color: Color,width: number = -1,antialiased: boolean = False) -> nil
Type Name Description
Vector2 from
Vector2 to
Color color
number width
boolean antialiased

DrawDashedLine(Vector2,Vector2,Color,number,number,boolean,boolean)

Draws a dashed line from a 2D point to another, with a given color and width. See also , , and .If is negative, then a two-point primitives will be drawn instead of a four-point ones. This means that when the CanvasItem is scaled, the line parts will remain thin. If this behavior is not desired, then pass a positive like 1.0. is the length of each dash in pixels, with the gap between each dash being the same length. If is , the length of the first and last dashes may be shortened or lengthened to allow the line to begin and end at the precise points defined by and . Both ends are always symmetrical when is . If is , all dashes will have the same length, but the line may appear incomplete at the end due to the dash length not dividing evenly into the line length. Only full dashes are drawn when is .If is , half transparent “feathers” will be attached to the boundary, making outlines smooth.Note: is only effective if is greater than 0.0.

DrawDashedLine(from: Vector2,to: Vector2,color: Color,width: number = -1,dash: number = 2,aligned: boolean = True,antialiased: boolean = False) -> nil
Type Name Description
Vector2 from
Vector2 to
Color color
number width
number dash
boolean aligned
boolean antialiased

DrawPolyline(Vector2[],Color,number,boolean)

Draws interconnected line segments with a uniform and and optional antialiasing (supported only for positive ). When drawing large amounts of lines, this is faster than using individual calls. To draw disconnected lines, use instead. See also .If is negative, it will be ignored and the polyline will be drawn using . This means that when the CanvasItem is scaled, the polyline will remain thin. If this behavior is not desired, then pass a positive like 1.0.

DrawPolyline(points: Vector2[],color: Color,width: number = -1,antialiased: boolean = False) -> nil
Type Name Description
Vector2[] points
Color color
number width
boolean antialiased

DrawPolyline(ReadOnlySpan__Vector2,Color,number,boolean)

DrawPolyline(points: ReadOnlySpan__Vector2,color: Color,width: number,antialiased: boolean) -> nil
Type Name Description
ReadOnlySpan__Vector2 points
Color color
number width
boolean antialiased

DrawPolylineColors(Vector2[],Color[],number,boolean)

Draws interconnected line segments with a uniform , point-by-point coloring, and optional antialiasing (supported only for positive ). Colors assigned to line points match by index between and , i.e. each line segment is filled with a gradient between the colors of the endpoints. When drawing large amounts of lines, this is faster than using individual calls. To draw disconnected lines, use instead. See also .If is negative, it will be ignored and the polyline will be drawn using . This means that when the CanvasItem is scaled, the polyline will remain thin. If this behavior is not desired, then pass a positive like 1.0.

DrawPolylineColors(points: Vector2[],colors: Color[],width: number = -1,antialiased: boolean = False) -> nil
Type Name Description
Vector2[] points
Color[] colors
number width
boolean antialiased

DrawPolylineColors(ReadOnlySpan__Vector2,ReadOnlySpan__Color,number,boolean)

DrawPolylineColors(points: ReadOnlySpan__Vector2,colors: ReadOnlySpan__Color,width: number,antialiased: boolean) -> nil
Type Name Description
ReadOnlySpan__Vector2 points
ReadOnlySpan__Color colors
number width
boolean antialiased

DrawArc(Vector2,number,number,number,number,Color,number,boolean)

Draws an unfilled arc between the given angles with a uniform and and optional antialiasing (supported only for positive ). The larger the value of , the smoother the curve. See also .If is negative, it will be ignored and the arc will be drawn using . This means that when the CanvasItem is scaled, the arc will remain thin. If this behavior is not desired, then pass a positive like 1.0.The arc is drawn from towards the value of so in clockwise direction if start_angle < end_angle and counter-clockwise otherwise. Passing the same angles but in reversed order will produce the same arc. If absolute difference of and is greater than @GDScript.TAU radians, then a full circle arc is drawn (i.e. arc will not overlap itself).

DrawArc(center: Vector2,radius: number,startAngle: number,endAngle: number,pointCount: number,color: Color,width: number = -1,antialiased: boolean = False) -> nil
Type Name Description
Vector2 center
number radius
number startAngle
number endAngle
number pointCount
Color color
number width
boolean antialiased

DrawMultiline(Vector2[],Color,number,boolean)

Draws multiple disconnected lines with a uniform and . Each line is defined by two consecutive points from array, i.e. i-th segment consists of points[2 * i], points[2 * i + 1] endpoints. When drawing large amounts of lines, this is faster than using individual calls. To draw interconnected lines, use instead.If is negative, then two-point primitives will be drawn instead of a four-point ones. This means that when the CanvasItem is scaled, the lines will remain thin. If this behavior is not desired, then pass a positive like 1.0.Note: is only effective if is greater than 0.0.

DrawMultiline(points: Vector2[],color: Color,width: number = -1,antialiased: boolean = False) -> nil
Type Name Description
Vector2[] points
Color color
number width
boolean antialiased

DrawMultiline(ReadOnlySpan__Vector2,Color,number,boolean)

DrawMultiline(points: ReadOnlySpan__Vector2,color: Color,width: number,antialiased: boolean) -> nil
Type Name Description
ReadOnlySpan__Vector2 points
Color color
number width
boolean antialiased

DrawMultilineColors(Vector2[],Color[],number,boolean)

Draws multiple disconnected lines with a uniform and segment-by-segment coloring. Each segment is defined by two consecutive points from array and a corresponding color from array, i.e. i-th segment consists of points[2 * i], points[2 * i + 1] endpoints and has colors[i] color. When drawing large amounts of lines, this is faster than using individual calls. To draw interconnected lines, use instead.If is negative, then two-point primitives will be drawn instead of a four-point ones. This means that when the CanvasItem is scaled, the lines will remain thin. If this behavior is not desired, then pass a positive like 1.0.Note: is only effective if is greater than 0.0.

DrawMultilineColors(points: Vector2[],colors: Color[],width: number = -1,antialiased: boolean = False) -> nil
Type Name Description
Vector2[] points
Color[] colors
number width
boolean antialiased

DrawMultilineColors(ReadOnlySpan__Vector2,ReadOnlySpan__Color,number,boolean)

DrawMultilineColors(points: ReadOnlySpan__Vector2,colors: ReadOnlySpan__Color,width: number,antialiased: boolean) -> nil
Type Name Description
ReadOnlySpan__Vector2 points
ReadOnlySpan__Color colors
number width
boolean antialiased

DrawRect(Rect2,Color,boolean,number,boolean)

Draws a rectangle. If is , the rectangle will be filled with the specified. If is , the rectangle will be drawn as a stroke with the and specified. See also .If is negative, then two-point primitives will be drawn instead of a four-point ones. This means that when the CanvasItem is scaled, the lines will remain thin. If this behavior is not desired, then pass a positive like 1.0.If is , half transparent “feathers” will be attached to the boundary, making outlines smooth.Note: is only effective if is .Note: Unfilled rectangles drawn with a negative may not display perfectly. For example, corners may be missing or brighter due to overlapping lines (for a translucent ).

DrawRect(rect: Rect2,color: Color,filled: boolean = True,width: number = -1,antialiased: boolean = False) -> nil
Type Name Description
Rect2 rect
Color color
boolean filled
number width
boolean antialiased

DrawCircle(Vector2,number,Color,boolean,number,boolean)

Draws a circle. See also , , and .If is , the circle will be filled with the specified. If is , the circle will be drawn as a stroke with the and specified.If is negative, then two-point primitives will be drawn instead of a four-point ones. This means that when the CanvasItem is scaled, the lines will remain thin. If this behavior is not desired, then pass a positive like 1.0.If is , half transparent “feathers” will be attached to the boundary, making outlines smooth.Note: is only effective if is .

DrawCircle(position: Vector2,radius: number,color: Color,filled: boolean = True,width: number = -1,antialiased: boolean = False) -> nil
Type Name Description
Vector2 position
number radius
Color color
boolean filled
number width
boolean antialiased

DrawTexture(Texture2D,Vector2,Nullable__Color)

DrawTexture(texture: Texture2D,position: Vector2,modulate: Nullable__Color) -> nil
Type Name Description
Texture2D texture
Vector2 position
Nullable__Color modulate

DrawTextureRect(Texture2D,Rect2,boolean,Nullable__Color,boolean)

DrawTextureRect(texture: Texture2D,rect: Rect2,tile: boolean,modulate: Nullable__Color,transpose: boolean = False) -> nil
Type Name Description
Texture2D texture
Rect2 rect
boolean tile
Nullable__Color modulate
boolean transpose

DrawTextureRectRegion(Texture2D,Rect2,Rect2,Nullable__Color,boolean,boolean)

DrawTextureRectRegion(texture: Texture2D,rect: Rect2,srcRect: Rect2,modulate: Nullable__Color,transpose: boolean = False,clipUV: boolean = True) -> nil
Type Name Description
Texture2D texture
Rect2 rect
Rect2 srcRect
Nullable__Color modulate
boolean transpose
boolean clipUV

DrawMsdfTextureRectRegion(Texture2D,Rect2,Rect2,Nullable__Color,number,number,number)

DrawMsdfTextureRectRegion(texture: Texture2D,rect: Rect2,srcRect: Rect2,modulate: Nullable__Color,outline: number = 0,pixelRange: number = 4,scale: number = 1) -> nil
Type Name Description
Texture2D texture
Rect2 rect
Rect2 srcRect
Nullable__Color modulate
number outline
number pixelRange
number scale

DrawLcdTextureRectRegion(Texture2D,Rect2,Rect2,Nullable__Color)

DrawLcdTextureRectRegion(texture: Texture2D,rect: Rect2,srcRect: Rect2,modulate: Nullable__Color) -> nil
Type Name Description
Texture2D texture
Rect2 rect
Rect2 srcRect
Nullable__Color modulate

DrawStyleBox(StyleBox,Rect2)

Draws a styled rectangle.

DrawStyleBox(styleBox: StyleBox,rect: Rect2) -> nil
Type Name Description
StyleBox styleBox
Rect2 rect

DrawPrimitive(Vector2[],Color[],Vector2[],Texture2D)

Draws a custom primitive. 1 point for a point, 2 points for a line, 3 points for a triangle, and 4 points for a quad. If 0 points or more than 4 points are specified, nothing will be drawn and an error message will be printed. See also , , , and .

DrawPrimitive(points: Vector2[],colors: Color[],uvs: Vector2[],texture: Texture2D) -> nil
Type Name Description
Vector2[] points
Color[] colors
Vector2[] uvs
Texture2D texture

DrawPrimitive(ReadOnlySpan__Vector2,ReadOnlySpan__Color,ReadOnlySpan__Vector2,Texture2D)

DrawPrimitive(points: ReadOnlySpan__Vector2,colors: ReadOnlySpan__Color,uvs: ReadOnlySpan__Vector2,texture: Texture2D) -> nil
Type Name Description
ReadOnlySpan__Vector2 points
ReadOnlySpan__Color colors
ReadOnlySpan__Vector2 uvs
Texture2D texture

DrawPolygon(Vector2[],Color[],Vector2[],Texture2D)

Draws a solid polygon of any number of points, convex or concave. Unlike , each point’s color can be changed individually. See also and . If you need more flexibility (such as being able to use bones), use instead.Note: If you frequently redraw the same polygon with a large number of vertices, consider pre-calculating the triangulation with and using , , or .

DrawPolygon(points: Vector2[],colors: Color[],uvs: Vector2[],texture: Texture2D) -> nil
Type Name Description
Vector2[] points
Color[] colors
Vector2[] uvs If the parameter is null, then the default value is Array.Empty().
Texture2D texture

DrawPolygon(ReadOnlySpan__Vector2,ReadOnlySpan__Color,ReadOnlySpan__Vector2,Texture2D)

DrawPolygon(points: ReadOnlySpan__Vector2,colors: ReadOnlySpan__Color,uvs: ReadOnlySpan__Vector2,texture: Texture2D) -> nil
Type Name Description
ReadOnlySpan__Vector2 points
ReadOnlySpan__Color colors
ReadOnlySpan__Vector2 uvs
Texture2D texture

DrawColoredPolygon(Vector2[],Color,Vector2[],Texture2D)

Draws a colored polygon of any number of points, convex or concave. Unlike , a single color must be specified for the whole polygon.Note: If you frequently redraw the same polygon with a large number of vertices, consider pre-calculating the triangulation with and using , , or .

DrawColoredPolygon(points: Vector2[],color: Color,uvs: Vector2[],texture: Texture2D) -> nil
Type Name Description
Vector2[] points
Color color
Vector2[] uvs If the parameter is null, then the default value is Array.Empty().
Texture2D texture

DrawColoredPolygon(ReadOnlySpan__Vector2,Color,ReadOnlySpan__Vector2,Texture2D)

DrawColoredPolygon(points: ReadOnlySpan__Vector2,color: Color,uvs: ReadOnlySpan__Vector2,texture: Texture2D) -> nil
Type Name Description
ReadOnlySpan__Vector2 points
Color color
ReadOnlySpan__Vector2 uvs
Texture2D texture

DrawString(Font,Vector2,string,HorizontalAlignment,number,number,Nullable__Color,JustificationFlag,Direction,Orientation)

DrawString(font: Font,pos: Vector2,text: string,alignment: HorizontalAlignment = Left,width: number = -1,fontSize: number = 16,modulate: Nullable__Color,justificationFlags: JustificationFlag = Kashida, WordBound,direction: Direction = Auto,orientation: Orientation = Horizontal) -> nil
Type Name Description
Font font
Vector2 pos
string text
HorizontalAlignment alignment
number width
number fontSize
Nullable__Color modulate
JustificationFlag justificationFlags
Direction direction
Orientation orientation

DrawMultilineString(Font,Vector2,string,HorizontalAlignment,number,number,number,Nullable__Color,LineBreakFlag,JustificationFlag,Direction,Orientation)

DrawMultilineString(font: Font,pos: Vector2,text: string,alignment: HorizontalAlignment = Left,width: number = -1,fontSize: number = 16,maxLines: number = -1,modulate: Nullable__Color,brkFlags: LineBreakFlag = Mandatory, WordBound,justificationFlags: JustificationFlag = Kashida, WordBound,direction: Direction = Auto,orientation: Orientation = Horizontal) -> nil
Type Name Description
Font font
Vector2 pos
string text
HorizontalAlignment alignment
number width
number fontSize
number maxLines
Nullable__Color modulate
LineBreakFlag brkFlags
JustificationFlag justificationFlags
Direction direction
Orientation orientation

DrawStringOutline(Font,Vector2,string,HorizontalAlignment,number,number,number,Nullable__Color,JustificationFlag,Direction,Orientation)

DrawStringOutline(font: Font,pos: Vector2,text: string,alignment: HorizontalAlignment = Left,width: number = -1,fontSize: number = 16,size: number = 1,modulate: Nullable__Color,justificationFlags: JustificationFlag = Kashida, WordBound,direction: Direction = Auto,orientation: Orientation = Horizontal) -> nil
Type Name Description
Font font
Vector2 pos
string text
HorizontalAlignment alignment
number width
number fontSize
number size
Nullable__Color modulate
JustificationFlag justificationFlags
Direction direction
Orientation orientation

DrawMultilineStringOutline(Font,Vector2,string,HorizontalAlignment,number,number,number,number,Nullable__Color,LineBreakFlag,JustificationFlag,Direction,Orientation)

DrawMultilineStringOutline(font: Font,pos: Vector2,text: string,alignment: HorizontalAlignment = Left,width: number = -1,fontSize: number = 16,maxLines: number = -1,size: number = 1,modulate: Nullable__Color,brkFlags: LineBreakFlag = Mandatory, WordBound,justificationFlags: JustificationFlag = Kashida, WordBound,direction: Direction = Auto,orientation: Orientation = Horizontal) -> nil
Type Name Description
Font font
Vector2 pos
string text
HorizontalAlignment alignment
number width
number fontSize
number maxLines
number size
Nullable__Color modulate
LineBreakFlag brkFlags
JustificationFlag justificationFlags
Direction direction
Orientation orientation

DrawChar(Font,Vector2,string,number,Nullable__Color)

DrawChar(font: Font,pos: Vector2,char: string,fontSize: number = 16,modulate: Nullable__Color) -> nil
Type Name Description
Font font
Vector2 pos
string char
number fontSize
Nullable__Color modulate

DrawCharOutline(Font,Vector2,string,number,number,Nullable__Color)

DrawCharOutline(font: Font,pos: Vector2,char: string,fontSize: number = 16,size: number = -1,modulate: Nullable__Color) -> nil
Type Name Description
Font font
Vector2 pos
string char
number fontSize
number size
Nullable__Color modulate

DrawMesh(Mesh,Texture2D,Nullable__Transform2D,Nullable__Color)

DrawMesh(mesh: Mesh,texture: Texture2D,transform: Nullable__Transform2D,modulate: Nullable__Color) -> nil
Type Name Description
Mesh mesh
Texture2D texture
Nullable__Transform2D transform
Nullable__Color modulate

DrawMultimesh(MultiMesh,Texture2D)

Draws a in 2D with the provided texture. See for related documentation.

DrawMultimesh(multimesh: MultiMesh,texture: Texture2D) -> nil
Type Name Description
MultiMesh multimesh
Texture2D texture

DrawSetTransform(Vector2,number,Nullable__Vector2)

DrawSetTransform(position: Vector2,rotation: number = 0,scale: Nullable__Vector2) -> nil
Type Name Description
Vector2 position
number rotation
Nullable__Vector2 scale

DrawSetTransformMatrix(Transform2D)

Sets a custom transform for drawing via matrix. Anything drawn afterwards will be transformed by this.

DrawSetTransformMatrix(xform: Transform2D) -> nil
Type Name Description
Transform2D xform

DrawAnimationSlice(number,number,number,number)

Subsequent drawing commands will be ignored unless they fall within the specified animation slice. This is a faster way to implement animations that loop on background rather than redrawing constantly.

DrawAnimationSlice(animationLength: number,sliceBegin: number,sliceEnd: number,offset: number = 0) -> nil
Type Name Description
number animationLength
number sliceBegin
number sliceEnd
number offset

DrawEndAnimation

After submitting all animations slices via , this function can be used to revert drawing to its default state (all subsequent drawing commands will be visible). If you don’t care about this particular use case, usage of this function after submitting the slices is not required.

DrawEndAnimation() -> nil

GetTransform

Returns the transform matrix of this item.

GetTransform() -> Transform2D

GetGlobalTransform

Returns the global transform matrix of this item, i.e. the combined transform up to the topmost node. The topmost item is a that either has no parent, has non- parent or it has enabled.

GetGlobalTransform() -> Transform2D

GetGlobalTransformWithCanvas

Returns the transform from the local coordinate system of this to the s coordinate system.

GetGlobalTransformWithCanvas() -> Transform2D

GetViewportTransform

Returns the transform from the coordinate system of the canvas, this item is in, to the s embedders coordinate system.

GetViewportTransform() -> Transform2D

GetViewportRect

Returns the viewport’s boundaries as a .

GetViewportRect() -> Rect2

GetCanvasTransform

Returns the transform from the coordinate system of the canvas, this item is in, to the s coordinate system.

GetCanvasTransform() -> Transform2D

GetScreenTransform

Returns the transform of this in global screen coordinates (i.e. taking window position into account). Mostly useful for editor plugins.Equals to if the window is embedded (see ).

GetScreenTransform() -> Transform2D

GetLocalMousePosition

Returns the mouse’s position in this using the local coordinate system of this .

GetLocalMousePosition() -> Vector2

GetGlobalMousePosition

Returns the mouse’s position in the that this is in using the coordinate system of the .Note: For screen-space coordinates (e.g. when using a non-embedded ), you can use .

GetGlobalMousePosition() -> Vector2

GetCanvas

Returns the of the canvas where this item is in.

GetCanvas() -> Rid

GetCanvasLayerNode

Returns the that contains this node, or if the node is not in any .

GetCanvasLayerNode() -> CanvasLayer

GetWorld2D

Returns the where this item is in.

GetWorld2D() -> World2D

SetMaterial(Material)

SetMaterial(material: Material) -> nil
Type Name Description
Material material

GetMaterial

GetMaterial() -> Material

SetInstanceShaderParameter(string,Variant)

Set the value of a shader uniform for this instance only (per-instance uniform). See also to assign a uniform on all instances using the same .Note: For a shader uniform to be assignable on a per-instance basis, it must be defined with instance uniform … rather than uniform … in the shader code.Note: is case-sensitive and must match the name of the uniform in the code exactly (not the capitalized name in the inspector).

SetInstanceShaderParameter(name: string,value: Variant) -> nil
Type Name Description
string name
Variant value

GetInstanceShaderParameter(string)

Get the value of a shader parameter as set on this instance.

GetInstanceShaderParameter(name: string) -> Variant
Type Name Description
string name

SetUseParentMaterial(boolean)

SetUseParentMaterial(enable: boolean) -> nil
Type Name Description
boolean enable

GetUseParentMaterial

GetUseParentMaterial() -> boolean

SetNotifyLocalTransform(boolean)

If is , this node will receive when its local transform changes.

SetNotifyLocalTransform(enable: boolean) -> nil
Type Name Description
boolean enable

IsLocalTransformNotificationEnabled

Returns if local transform notifications are communicated to children.

IsLocalTransformNotificationEnabled() -> boolean

SetNotifyTransform(boolean)

If is , this node will receive when its global transform changes.

SetNotifyTransform(enable: boolean) -> nil
Type Name Description
boolean enable

IsTransformNotificationEnabled

Returns if global transform notifications are communicated to children.

IsTransformNotificationEnabled() -> boolean

ForceUpdateTransform

Forces the transform to update. Transform changes in physics are not instant for performance reasons. Transforms are accumulated and then set. Use this if you need an up-to-date transform when doing physics operations.

ForceUpdateTransform() -> nil

MakeCanvasPositionLocal(Vector2)

Transforms from the viewport’s coordinates to this node’s local coordinates.For the opposite operation, use . var viewport_point = get_global_transform_with_canvas() * local_point

MakeCanvasPositionLocal(viewportPoint: Vector2) -> Vector2
Type Name Description
Vector2 viewportPoint

MakeInputLocal(InputEvent)

Transformations issued by ‘s inputs are applied in local space instead of global space.

MakeInputLocal(event: InputEvent) -> InputEvent
Type Name Description
InputEvent event

SetVisibilityLayer(UInt32)

SetVisibilityLayer(layer: UInt32) -> nil
Type Name Description
UInt32 layer

GetVisibilityLayer

GetVisibilityLayer() -> UInt32

SetVisibilityLayerBit(UInt32,boolean)

Set/clear individual bits on the rendering visibility layer. This simplifies editing this ‘s visibility layer.

SetVisibilityLayerBit(layer: UInt32,enabled: boolean) -> nil
Type Name Description
UInt32 layer
boolean enabled

GetVisibilityLayerBit(UInt32)

Returns an individual bit on the rendering visibility layer.

GetVisibilityLayerBit(layer: UInt32) -> boolean
Type Name Description
UInt32 layer

SetTextureFilter(TextureFilterEnum)

SetTextureFilter(mode: TextureFilterEnum) -> nil
Type Name Description
TextureFilterEnum mode

GetTextureFilter

GetTextureFilter() -> TextureFilterEnum

SetTextureRepeat(TextureRepeatEnum)

SetTextureRepeat(mode: TextureRepeatEnum) -> nil
Type Name Description
TextureRepeatEnum mode

GetTextureRepeat

GetTextureRepeat() -> TextureRepeatEnum

SetClipChildrenMode(ClipChildrenMode)

SetClipChildrenMode(mode: ClipChildrenMode) -> nil
Type Name Description
ClipChildrenMode mode

GetClipChildrenMode

GetClipChildrenMode() -> ClipChildrenMode

DrawMultilineColors(Vector2[],Color[],number)

Draws multiple disconnected lines with a uniform and segment-by-segment coloring. Each segment is defined by two consecutive points from array and a corresponding color from array, i.e. i-th segment consists of points[2 * i], points[2 * i + 1] endpoints and has colors[i] color. When drawing large amounts of lines, this is faster than using individual calls. To draw interconnected lines, use instead.If is negative, then two-point primitives will be drawn instead of a four-point ones. This means that when the CanvasItem is scaled, the lines will remain thin. If this behavior is not desired, then pass a positive like 1.0.Note: is only effective if is greater than 0.0.

DrawMultilineColors(points: Vector2[],colors: Color[],width: number) -> nil
Type Name Description
Vector2[] points
Color[] colors
number width

DrawMultilineColors(ReadOnlySpan__Vector2,ReadOnlySpan__Color,number)

DrawMultilineColors(points: ReadOnlySpan__Vector2,colors: ReadOnlySpan__Color,width: number) -> nil
Type Name Description
ReadOnlySpan__Vector2 points
ReadOnlySpan__Color colors
number width

DrawMultiline(Vector2[],Color,number)

Draws multiple disconnected lines with a uniform and . Each line is defined by two consecutive points from array, i.e. i-th segment consists of points[2 * i], points[2 * i + 1] endpoints. When drawing large amounts of lines, this is faster than using individual calls. To draw interconnected lines, use instead.If is negative, then two-point primitives will be drawn instead of a four-point ones. This means that when the CanvasItem is scaled, the lines will remain thin. If this behavior is not desired, then pass a positive like 1.0.Note: is only effective if is greater than 0.0.

DrawMultiline(points: Vector2[],color: Color,width: number) -> nil
Type Name Description
Vector2[] points
Color color
number width

DrawMultiline(ReadOnlySpan__Vector2,Color,number)

DrawMultiline(points: ReadOnlySpan__Vector2,color: Color,width: number) -> nil
Type Name Description
ReadOnlySpan__Vector2 points
Color color
number width

DrawDashedLine(Vector2,Vector2,Color,number,number,boolean)

Draws a dashed line from a 2D point to another, with a given color and width. See also , , and .If is negative, then a two-point primitives will be drawn instead of a four-point ones. This means that when the CanvasItem is scaled, the line parts will remain thin. If this behavior is not desired, then pass a positive like 1.0. is the length of each dash in pixels, with the gap between each dash being the same length. If is , the length of the first and last dashes may be shortened or lengthened to allow the line to begin and end at the precise points defined by and . Both ends are always symmetrical when is . If is , all dashes will have the same length, but the line may appear incomplete at the end due to the dash length not dividing evenly into the line length. Only full dashes are drawn when is .If is , half transparent “feathers” will be attached to the boundary, making outlines smooth.Note: is only effective if is greater than 0.0.

DrawDashedLine(from: Vector2,to: Vector2,color: Color,width: number,dash: number,aligned: boolean) -> nil
Type Name Description
Vector2 from
Vector2 to
Color color
number width
number dash
boolean aligned

DrawRect(Rect2,Color,boolean,number)

Draws a rectangle. If is , the rectangle will be filled with the specified. If is , the rectangle will be drawn as a stroke with the and specified. See also .If is negative, then two-point primitives will be drawn instead of a four-point ones. This means that when the CanvasItem is scaled, the lines will remain thin. If this behavior is not desired, then pass a positive like 1.0.If is , half transparent “feathers” will be attached to the boundary, making outlines smooth.Note: is only effective if is .Note: Unfilled rectangles drawn with a negative may not display perfectly. For example, corners may be missing or brighter due to overlapping lines (for a translucent ).

DrawRect(rect: Rect2,color: Color,filled: boolean,width: number) -> nil
Type Name Description
Rect2 rect
Color color
boolean filled
number width

DrawCircle(Vector2,number,Color)

Draws a circle. See also , , and .If is , the circle will be filled with the specified. If is , the circle will be drawn as a stroke with the and specified.If is negative, then two-point primitives will be drawn instead of a four-point ones. This means that when the CanvasItem is scaled, the lines will remain thin. If this behavior is not desired, then pass a positive like 1.0.If is , half transparent “feathers” will be attached to the boundary, making outlines smooth.Note: is only effective if is .

DrawCircle(position: Vector2,radius: number,color: Color) -> nil
Type Name Description
Vector2 position
number radius
Color color

GetNode(string)

Fetches a node. The can either be a relative path (from this node), or an absolute path (from the ) to a node. If does not point to a valid node, generates an error and returns . Attempts to access methods on the return value will result in an “Attempt to call on a null instance." error.Note: Fetching by absolute path only works when the node is inside the scene tree (see ).Example: Assume this method is called from the Character node, inside the following tree: ┖╴root ┠╴Character (you are here!) ┃ ┠╴Sword ┃ ┖╴Backpack ┃ ┖╴Dagger ┠╴MyGame ┖╴Swamp ┠╴Alligator ┠╴Mosquito ┖╴Goblin The following calls will return a valid node: GetNode("Sword"); GetNode("Backpack/Dagger"); GetNode("../Swamp/Alligator"); GetNode("/root/MyGame");

GetNode(path: string) -> T
Type Name Description
string path

GetNodeOrNull(string)

Fetches a node by . Similar to , but does not generate an error if does not point to a valid node.

GetNodeOrNull(path: string) -> T
Type Name Description
string path

GetChild(number,boolean)

Fetches a child node by its index. Each child node has an index relative its siblings (see ). The first child is at index 0. Negative values can also be used to start from the end of the list. This method can be used in combination with to iterate over this node’s children. If no child exists at the given index, this method returns and an error is generated.If is , internal children are ignored (see ‘s internal parameter). # Assuming the following are children of this node, in order: # First, Middle, Last. var a = get_child(0).name # a is “First” var b = get_child(1).name # b is “Middle” var b = get_child(2).name # b is “Last” var c = get_child(-1).name # c is “Last” Note: To fetch a node by , use .

GetChild(idx: number,includeInternal: boolean = False) -> T
Type Name Description
number idx
boolean includeInternal

GetChildOrNull(number,boolean)

GetChildOrNull(idx: number,includeInternal: boolean = False) -> T
Type Name Description
number idx
boolean includeInternal

GetOwner

GetOwner() -> T

GetOwnerOrNull

GetOwnerOrNull() -> T

GetParent

Returns this node’s parent node, or if the node doesn’t have a parent.

GetParent() -> T

GetParentOrNull

GetParentOrNull() -> T

_EnterTree

Called when the node enters the (e.g. upon instantiating, scene changing, or after calling in a script). If the node has children, its callback will be called first, and then that of the children.Corresponds to the notification in .

_EnterTree() -> nil

_ExitTree

Called when the node is about to leave the (e.g. upon freeing, scene changing, or after calling in a script). If the node has children, its callback will be called last, after all its children have left the tree.Corresponds to the notification in and signal . To get notified when the node has already left the active tree, connect to the .

_ExitTree() -> nil

_GetConfigurationWarnings

The elements in the array returned from this method are displayed as warnings in the Scene dock if the script that overrides it is a tool script.Returning an empty array produces no warnings.Call when the warnings need to be updated for this node. @export var energy = 0: set(value): energy = value update_configuration_warnings() func _get_configuration_warnings(): if energy < 0: return [“Energy must be 0 or greater.”] else: return []

_GetConfigurationWarnings() -> String[]

_Input(InputEvent)

Called when there is an input event. The input event propagates up through the node tree until a node consumes it.It is only called if input processing is enabled, which is done automatically if this method is overridden, and can be toggled with .To consume the input event and stop it propagating further to other nodes, can be called.For gameplay input, and are usually a better fit as they allow the GUI to intercept the events first.Note: This method is only called if the node is present in the scene tree (i.e. if it’s not an orphan).

_Input(event: InputEvent) -> nil
Type Name Description
InputEvent event

_PhysicsProcess(number)

Called during the physics processing step of the main loop. Physics processing means that the frame rate is synced to the physics, i.e. the parameter will generally be constant (see exceptions below). is in seconds.It is only called if physics processing is enabled, which is done automatically if this method is overridden, and can be toggled with .Processing happens in order of , lower priority values are called first. Nodes with the same priority are processed in tree order, or top to bottom as seen in the editor (also known as pre-order traversal).Corresponds to the notification in .Note: This method is only called if the node is present in the scene tree (i.e. if it’s not an orphan).Note: will be larger than expected if running at a framerate lower than / FPS. This is done to avoid “spiral of death” scenarios where performance would plummet due to an ever-increasing number of physics steps per frame. This behavior affects both and . As a result, avoid using for time measurements in real-world seconds. Use the singleton’s methods for this purpose instead, such as .

_PhysicsProcess(delta: number) -> nil
Type Name Description
number delta

_Process(number)

Called during the processing step of the main loop. Processing happens at every frame and as fast as possible, so the time since the previous frame is not constant. is in seconds.It is only called if processing is enabled, which is done automatically if this method is overridden, and can be toggled with .Processing happens in order of , lower priority values are called first. Nodes with the same priority are processed in tree order, or top to bottom as seen in the editor (also known as pre-order traversal).Corresponds to the notification in .Note: This method is only called if the node is present in the scene tree (i.e. if it’s not an orphan).Note: will be larger than expected if running at a framerate lower than / FPS. This is done to avoid “spiral of death” scenarios where performance would plummet due to an ever-increasing number of physics steps per frame. This behavior affects both and . As a result, avoid using for time measurements in real-world seconds. Use the singleton’s methods for this purpose instead, such as .

_Process(delta: number) -> nil
Type Name Description
number delta

_Ready

Called when the node is “ready”, i.e. when both the node and its children have entered the scene tree. If the node has children, their callbacks get triggered first, and the parent node will receive the ready notification afterwards.Corresponds to the notification in . See also the @onready annotation for variables.Usually used for initialization. For even earlier initialization, may be used. See also .Note: This method may be called only once for each node. After removing a node from the scene tree and adding it again, will not be called a second time. This can be bypassed by requesting another call with , which may be called anywhere before adding the node again.

_Ready() -> nil

_ShortcutInput(InputEvent)

Called when an , , or hasn’t been consumed by or any GUI item. It is called before and . The input event propagates up through the node tree until a node consumes it.It is only called if shortcut processing is enabled, which is done automatically if this method is overridden, and can be toggled with .To consume the input event and stop it propagating further to other nodes, can be called.This method can be used to handle shortcuts. For generic GUI events, use instead. Gameplay events should usually be handled with either or .Note: This method is only called if the node is present in the scene tree (i.e. if it’s not orphan).

_ShortcutInput(event: InputEvent) -> nil
Type Name Description
InputEvent event

_UnhandledInput(InputEvent)

Called when an hasn’t been consumed by or any GUI item. It is called after and after . The input event propagates up through the node tree until a node consumes it.It is only called if unhandled input processing is enabled, which is done automatically if this method is overridden, and can be toggled with .To consume the input event and stop it propagating further to other nodes, can be called.For gameplay input, this method is usually a better fit than , as GUI events need a higher priority. For keyboard shortcuts, consider using instead, as it is called before this method. Finally, to handle keyboard events, consider using for performance reasons.Note: This method is only called if the node is present in the scene tree (i.e. if it’s not an orphan).

_UnhandledInput(event: InputEvent) -> nil
Type Name Description
InputEvent event

_UnhandledKeyInput(InputEvent)

Called when an hasn’t been consumed by or any GUI item. It is called after but before . The input event propagates up through the node tree until a node consumes it.It is only called if unhandled key input processing is enabled, which is done automatically if this method is overridden, and can be toggled with .To consume the input event and stop it propagating further to other nodes, can be called.This method can be used to handle Unicode character input with Alt, Alt + Ctrl, and Alt + Shift modifiers, after shortcuts were handled.For gameplay input, this and are usually a better fit than , as GUI events should be handled first. This method also performs better than , since unrelated events such as are automatically filtered. For shortcuts, consider using instead.Note: This method is only called if the node is present in the scene tree (i.e. if it’s not an orphan).

_UnhandledKeyInput(event: InputEvent) -> nil
Type Name Description
InputEvent event

AddSibling(Node,boolean)

Adds a node to this node’s parent, and moves the added sibling right below this node.If is , improves the readability of the added . If not named, the is renamed to its type, and if it shares with a sibling, a number is suffixed more appropriately. This operation is very slow. As such, it is recommended leaving this to , which assigns a dummy name featuring @ in both situations.Use instead of this method if you don’t need the child node to be added below a specific node in the list of children.Note: If this node is internal, the added sibling will be internal too (see ‘s internal parameter).

AddSibling(sibling: Node,forceReadableName: boolean = False) -> nil
Type Name Description
Node sibling
boolean forceReadableName

SetName(string)

SetName(name: string) -> nil
Type Name Description
string name

GetName

GetName() -> string

AddChild(Node,boolean,InternalMode)

AddChild(node: Node,forceReadableName: boolean = False,internal: InternalMode = Disabled) -> nil
Type Name Description
Node node
boolean forceReadableName
InternalMode internal

RemoveChild(Node)

Removes a child . The , along with its children, are not deleted. To delete a node, see .Note: When this node is inside the tree, this method sets the of the removed (or its descendants) to , if their is no longer an ancestor (see ).

RemoveChild(node: Node) -> nil
Type Name Description
Node node

Reparent(Node,boolean)

Changes the parent of this to the . The node needs to already have a parent. The node’s is preserved if its owner is still reachable from the new location (i.e., the node is still a descendant of the new parent after the operation).If is , the node’s global transform will be preserved if supported. , and support this argument (but keeps only position).

Reparent(newParent: Node,keepGlobalTransform: boolean = True) -> nil
Type Name Description
Node newParent
boolean keepGlobalTransform

GetChildCount(boolean)

Returns the number of children of this node.If is , internal children are not counted (see ‘s internal parameter).

GetChildCount(includeInternal: boolean = False) -> number
Type Name Description
boolean includeInternal

GetChildren(boolean)

Returns all children of this node inside an .If is , excludes internal children from the returned array (see ‘s internal parameter).

GetChildren(includeInternal: boolean = False) -> Array__Node
Type Name Description
boolean includeInternal

GetChild(number,boolean)

Fetches a child node by its index. Each child node has an index relative its siblings (see ). The first child is at index 0. Negative values can also be used to start from the end of the list. This method can be used in combination with to iterate over this node’s children. If no child exists at the given index, this method returns and an error is generated.If is , internal children are ignored (see ‘s internal parameter). # Assuming the following are children of this node, in order: # First, Middle, Last. var a = get_child(0).name # a is “First” var b = get_child(1).name # b is “Middle” var b = get_child(2).name # b is “Last” var c = get_child(-1).name # c is “Last” Note: To fetch a node by , use .

GetChild(idx: number,includeInternal: boolean = False) -> Node
Type Name Description
number idx
boolean includeInternal

HasNode(string)

Returns if the points to a valid node. See also .

HasNode(path: string) -> boolean
Type Name Description
string path

GetNode(string)

Fetches a node. The can either be a relative path (from this node), or an absolute path (from the ) to a node. If does not point to a valid node, generates an error and returns . Attempts to access methods on the return value will result in an “Attempt to call on a null instance." error.Note: Fetching by absolute path only works when the node is inside the scene tree (see ).Example: Assume this method is called from the Character node, inside the following tree: ┖╴root ┠╴Character (you are here!) ┃ ┠╴Sword ┃ ┖╴Backpack ┃ ┖╴Dagger ┠╴MyGame ┖╴Swamp ┠╴Alligator ┠╴Mosquito ┖╴Goblin The following calls will return a valid node: GetNode("Sword"); GetNode("Backpack/Dagger"); GetNode("../Swamp/Alligator"); GetNode("/root/MyGame");

GetNode(path: string) -> Node
Type Name Description
string path

GetNodeOrNull(string)

Fetches a node by . Similar to , but does not generate an error if does not point to a valid node.

GetNodeOrNull(path: string) -> Node
Type Name Description
string path

GetParent

Returns this node’s parent node, or if the node doesn’t have a parent.

GetParent() -> Node

FindChild(string,boolean,boolean)

Finds the first descendant of this node whose matches , returning if no match is found. The matching is done against node names, not their paths, through String.match. As such, it is case-sensitive, “*” matches zero or more characters, and “?” matches any single character.If is , only this node’s direct children are checked. Nodes are checked in tree order, so this node’s first direct child is checked first, then its own direct children, etc., before moving to the second direct child, and so on. Internal children are also included in the search (see internal parameter in ).If is , only descendants with a valid node are checked.Note: This method can be very slow. Consider storing a reference to the found node in a variable. Alternatively, use with unique names (see ).Note: To find all descendant nodes matching a pattern or a class type, see .

FindChild(pattern: string,recursive: boolean = True,owned: boolean = True) -> Node
Type Name Description
string pattern
boolean recursive
boolean owned

FindChildren(string,string,boolean,boolean)

Finds all descendants of this node whose names match , returning an empty if no match is found. The matching is done against node names, not their paths, through String.match. As such, it is case-sensitive, “*” matches zero or more characters, and “?” matches any single character.If is not empty, only ancestors inheriting from are included (see ).If is , only this node’s direct children are checked. Nodes are checked in tree order, so this node’s first direct child is checked first, then its own direct children, etc., before moving to the second direct child, and so on. Internal children are also included in the search (see internal parameter in ).If is , only descendants with a valid node are checked.Note: This method can be very slow. Consider storing references to the found nodes in a variable.Note: To find a single descendant node matching a pattern, see .

FindChildren(pattern: string,type: string = '',recursive: boolean = True,owned: boolean = True) -> Array__Node
Type Name Description
string pattern
string type
boolean recursive
boolean owned

FindParent(string)

Finds the first ancestor of this node whose matches , returning if no match is found. The matching is done through String.match. As such, it is case-sensitive, “*” matches zero or more characters, and “?” matches any single character. See also and .Note: As this method walks upwards in the scene tree, it can be slow in large, deeply nested nodes. Consider storing a reference to the found node in a variable. Alternatively, use with unique names (see ).

FindParent(pattern: string) -> Node
Type Name Description
string pattern

HasNodeAndResource(string)

Returns if points to a valid node and its subnames point to a valid , e.g. Area2D/CollisionShape2D:shape. Properties that are not types (such as nodes or other types) are not considered. See also .

HasNodeAndResource(path: string) -> boolean
Type Name Description
string path

GetNodeAndResource(string)

Fetches a node and its most nested resource as specified by the ‘s subname. Returns an of size 3 where:- Element 0 is the , or if not found;- Element 1 is the subname’s last nested , or if not found;- Element 2 is the remaining , referring to an existing, non- property (see ).Example: Assume that the child’s has been assigned a : var a = GetNodeAndResource(NodePath(“Area2D/Sprite2D”)); GD.Print(a[0].Name); // Prints Sprite2D GD.Print(a[1]); // Prints GD.Print(a[2]); // Prints ^" var b = GetNodeAndResource(NodePath("Area2D/Sprite2D:texture:atlas")); GD.Print(b[0].name); // Prints Sprite2D GD.Print(b[1].get_class()); // Prints AtlasTexture GD.Print(b[2]); // Prints ^"" var c = GetNodeAndResource(NodePath("Area2D/Sprite2D:texture:atlas:region")); GD.Print(c[0].name); // Prints Sprite2D GD.Print(c[1].get_class()); // Prints AtlasTexture GD.Print(c[2]); // Prints ^":region"

GetNodeAndResource(path: string) -> Array
Type Name Description
string path

IsInsideTree

Returns if this node is currently inside a . See also .

IsInsideTree() -> boolean

IsPartOfEditedScene

Returns if the node is part of the scene currently opened in the editor.

IsPartOfEditedScene() -> boolean

IsAncestorOf(Node)

Returns if the given is a direct or indirect child of this node.

IsAncestorOf(node: Node) -> boolean
Type Name Description
Node node

IsGreaterThan(Node)

Returns if the given occurs later in the scene hierarchy than this node. A node occurring later is usually processed last.

IsGreaterThan(node: Node) -> boolean
Type Name Description
Node node

GetPath

Returns the node’s absolute path, relative to the . If the node is not inside the scene tree, this method fails and returns an empty .

GetPath() -> string

GetPathTo(Node,boolean)

Returns the relative from this node to the specified . Both nodes must be in the same or scene hierarchy, otherwise this method fails and returns an empty .If is , returns the shortest path accounting for this node’s unique name (see ).Note: If you get a relative path which starts from a unique node, the path may be longer than a normal relative path, due to the addition of the unique node’s name.

GetPathTo(node: Node,useUniquePath: boolean = False) -> string
Type Name Description
Node node
boolean useUniquePath

AddToGroup(string,boolean)

Adds the node to the . Groups can be helpful to organize a subset of nodes, for example “enemies” or “collectables”. See notes in the description, and the group methods in .If is , the group will be stored when saved inside a . All groups created and displayed in the Node dock are persistent.Note: To improve performance, the order of group names is not guaranteed and may vary between project runs. Therefore, do not rely on the group order.Note:’s group methods will not work on this node if not inside the tree (see ).

AddToGroup(group: string,persistent: boolean = False) -> nil
Type Name Description
string group
boolean persistent

RemoveFromGroup(string)

Removes the node from the given . Does nothing if the node is not in the . See also notes in the description, and the ‘s group methods.

RemoveFromGroup(group: string) -> nil
Type Name Description
string group

IsInGroup(string)

Returns if this node has been added to the given . See and . See also notes in the description, and the ‘s group methods.

IsInGroup(group: string) -> boolean
Type Name Description
string group

MoveChild(Node,number)

Moves to the given index. A node’s index is the order among its siblings. If is negative, the index is counted from the end of the list. See also and .Note: The processing order of several engine callbacks (, , etc.) and notifications sent through is affected by tree order. nodes are also rendered in tree order. See also .

MoveChild(childNode: Node,toIndex: number) -> nil
Type Name Description
Node childNode
number toIndex

GetGroups

Returns an of group names that the node has been added to.Note: To improve performance, the order of group names is not guaranteed and may vary between project runs. Therefore, do not rely on the group order.Note: This method may also return some group names starting with an underscore (_). These are internally used by the engine. To avoid conflicts, do not use custom groups starting with underscores. To exclude internal groups, see the following code snippet: // Stores the node’s non-internal groups only (as a List of StringNames). List nonInternalGroups = new List(); foreach (string group in GetGroups()) { if (!group.BeginsWith("_")) nonInternalGroups.Add(group); }

GetGroups() -> Array__string

SetOwner(Node)

SetOwner(owner: Node) -> nil
Type Name Description
Node owner

GetOwner

GetOwner() -> Node

GetIndex(boolean)

Returns this node’s order among its siblings. The first node’s index is 0. See also .If is , returns the index ignoring internal children. The first, non-internal child will have an index of 0 (see ‘s internal parameter).

GetIndex(includeInternal: boolean = False) -> number
Type Name Description
boolean includeInternal

PrintTree

Prints the node and its children to the console, recursively. The node does not have to be inside the tree. This method outputs s relative to this node, and is good for copy/pasting into . See also .May print, for example: . Menu Menu/Label Menu/Camera2D SplashScreen SplashScreen/Camera2D

PrintTree() -> nil

PrintTreePretty

Prints the node and its children to the console, recursively. The node does not have to be inside the tree. Similar to , but the graphical representation looks like what is displayed in the editor’s Scene dock. It is useful for inspecting larger trees.May print, for example: ┖╴TheGame ┠╴Menu ┃ ┠╴Label ┃ ┖╴Camera2D ┖╴SplashScreen ┖╴Camera2D

PrintTreePretty() -> nil

GetTreeString

Returns the tree as a . Used mainly for debugging purposes. This version displays the path relative to the current node, and is good for copy/pasting into the function. It also can be used in game UI/UX.May print, for example: TheGame TheGame/Menu TheGame/Menu/Label TheGame/Menu/Camera2D TheGame/SplashScreen TheGame/SplashScreen/Camera2D

GetTreeString() -> string

GetTreeStringPretty

Similar to , this returns the tree as a . This version displays a more graphical representation similar to what is displayed in the Scene Dock. It is useful for inspecting larger trees.May print, for example: ┖╴TheGame ┠╴Menu ┃ ┠╴Label ┃ ┖╴Camera2D ┖╴SplashScreen ┖╴Camera2D

GetTreeStringPretty() -> string

SetSceneFilePath(string)

SetSceneFilePath(sceneFilePath: string) -> nil
Type Name Description
string sceneFilePath

GetSceneFilePath

GetSceneFilePath() -> string

PropagateNotification(number)

Calls with on this node and all of its children, recursively.

PropagateNotification(what: number) -> nil
Type Name Description
number what

PropagateCall(string,Array,boolean)

Calls the given name, passing as arguments, on this node and all of its children, recursively.If is , the method is called on this node first, then on all of its children. If , the children’s methods are called first.

PropagateCall(method: string,args: Array,parentFirst: boolean = False) -> nil
Type Name Description
string method
Array args
boolean parentFirst

SetPhysicsProcess(boolean)

If set to , enables physics (fixed framerate) processing. When a node is being processed, it will receive a at a fixed (usually 60 FPS, see to change) interval (and the callback will be called if it exists).Note: If is overridden, this will be automatically enabled before is called.

SetPhysicsProcess(enable: boolean) -> nil
Type Name Description
boolean enable

GetPhysicsProcessDeltaTime

Returns the time elapsed (in seconds) since the last physics callback. This value is identical to ‘s delta parameter, and is often consistent at run-time, unless is changed. See also .Note: The returned value will be larger than expected if running at a framerate lower than / FPS. This is done to avoid “spiral of death” scenarios where performance would plummet due to an ever-increasing number of physics steps per frame. This behavior affects both and . As a result, avoid using delta for time measurements in real-world seconds. Use the singleton’s methods for this purpose instead, such as .

GetPhysicsProcessDeltaTime() -> number

IsPhysicsProcessing

Returns if physics processing is enabled (see ).

IsPhysicsProcessing() -> boolean

GetProcessDeltaTime

Returns the time elapsed (in seconds) since the last process callback. This value is identical to ‘s delta parameter, and may vary from frame to frame. See also .Note: The returned value will be larger than expected if running at a framerate lower than / FPS. This is done to avoid “spiral of death” scenarios where performance would plummet due to an ever-increasing number of physics steps per frame. This behavior affects both and . As a result, avoid using delta for time measurements in real-world seconds. Use the singleton’s methods for this purpose instead, such as .

GetProcessDeltaTime() -> number

SetProcess(boolean)

If set to , enables processing. When a node is being processed, it will receive a on every drawn frame (and the callback will be called if it exists).Note: If is overridden, this will be automatically enabled before is called.Note: This method only affects the callback, i.e. it has no effect on other callbacks like . If you want to disable all processing for the node, set to .

SetProcess(enable: boolean) -> nil
Type Name Description
boolean enable

SetProcessPriority(number)

SetProcessPriority(priority: number) -> nil
Type Name Description
number priority

GetProcessPriority

GetProcessPriority() -> number

SetPhysicsProcessPriority(number)

SetPhysicsProcessPriority(priority: number) -> nil
Type Name Description
number priority

GetPhysicsProcessPriority

GetPhysicsProcessPriority() -> number

IsProcessing

Returns if processing is enabled (see ).

IsProcessing() -> boolean

SetProcessInput(boolean)

If set to , enables input processing.Note: If is overridden, this will be automatically enabled before is called. Input processing is also already enabled for GUI controls, such as and .

SetProcessInput(enable: boolean) -> nil
Type Name Description
boolean enable

IsProcessingInput

Returns if the node is processing input (see ).

IsProcessingInput() -> boolean

SetProcessShortcutInput(boolean)

If set to , enables shortcut processing for this node.Note: If is overridden, this will be automatically enabled before is called.

SetProcessShortcutInput(enable: boolean) -> nil
Type Name Description
boolean enable

IsProcessingShortcutInput

Returns if the node is processing shortcuts (see ).

IsProcessingShortcutInput() -> boolean

SetProcessUnhandledInput(boolean)

If set to , enables unhandled input processing. It enables the node to receive all input that was not previously handled (usually by a ).Note: If is overridden, this will be automatically enabled before is called. Unhandled input processing is also already enabled for GUI controls, such as and .

SetProcessUnhandledInput(enable: boolean) -> nil
Type Name Description
boolean enable

IsProcessingUnhandledInput

Returns if the node is processing unhandled input (see ).

IsProcessingUnhandledInput() -> boolean

SetProcessUnhandledKeyInput(boolean)

If set to , enables unhandled key input processing.Note: If is overridden, this will be automatically enabled before is called.

SetProcessUnhandledKeyInput(enable: boolean) -> nil
Type Name Description
boolean enable

IsProcessingUnhandledKeyInput

Returns if the node is processing unhandled key input (see ).

IsProcessingUnhandledKeyInput() -> boolean

SetProcessMode(ProcessModeEnum)

SetProcessMode(mode: ProcessModeEnum) -> nil
Type Name Description
ProcessModeEnum mode

GetProcessMode

GetProcessMode() -> ProcessModeEnum

CanProcess

Returns if the node can receive processing notifications and input callbacks (, , etc.) from the and . The returned value depends on :- If set to , returns when the game is processing, i.e. is ;- If set to , returns when the game is paused, i.e. is ;- If set to , always returns ;- If set to , always returns ;- If set to , use the parent node’s to determine the result.If the node is not inside the tree, returns no matter the value of .

CanProcess() -> boolean

SetProcessThreadGroup(ProcessThreadGroupEnum)

SetProcessThreadGroup(mode: ProcessThreadGroupEnum) -> nil
Type Name Description
ProcessThreadGroupEnum mode

GetProcessThreadGroup

GetProcessThreadGroup() -> ProcessThreadGroupEnum

SetProcessThreadMessages(ProcessThreadMessagesEnum)

SetProcessThreadMessages(flags: ProcessThreadMessagesEnum) -> nil
Type Name Description
ProcessThreadMessagesEnum flags

GetProcessThreadMessages

GetProcessThreadMessages() -> ProcessThreadMessagesEnum

SetProcessThreadGroupOrder(number)

SetProcessThreadGroupOrder(order: number) -> nil
Type Name Description
number order

GetProcessThreadGroupOrder

GetProcessThreadGroupOrder() -> number

SetDisplayFolded(boolean)

If set to , the node appears folded in the Scene dock. As a result, all of its children are hidden. This method is intended to be used in editor plugins and tools, but it also works in release builds. See also .

SetDisplayFolded(fold: boolean) -> nil
Type Name Description
boolean fold

IsDisplayedFolded

Returns if the node is folded (collapsed) in the Scene dock. This method is intended to be used in editor plugins and tools. See also .

IsDisplayedFolded() -> boolean

SetProcessInternal(boolean)

If set to , enables internal processing for this node. Internal processing happens in isolation from the normal calls and is used by some nodes internally to guarantee proper functioning even if the node is paused or processing is disabled for scripting ().Warning: Built-in nodes rely on internal processing for their internal logic. Disabling it is unsafe and may lead to unexpected behavior. Use this method if you know what you are doing.

SetProcessInternal(enable: boolean) -> nil
Type Name Description
boolean enable

IsProcessingInternal

Returns if internal processing is enabled (see ).

IsProcessingInternal() -> boolean

SetPhysicsProcessInternal(boolean)

If set to , enables internal physics for this node. Internal physics processing happens in isolation from the normal calls and is used by some nodes internally to guarantee proper functioning even if the node is paused or physics processing is disabled for scripting ().Warning: Built-in nodes rely on internal processing for their internal logic. Disabling it is unsafe and may lead to unexpected behavior. Use this method if you know what you are doing.

SetPhysicsProcessInternal(enable: boolean) -> nil
Type Name Description
boolean enable

IsPhysicsProcessingInternal

Returns if internal physics processing is enabled (see ).

IsPhysicsProcessingInternal() -> boolean

SetPhysicsInterpolationMode(PhysicsInterpolationModeEnum)

SetPhysicsInterpolationMode(mode: PhysicsInterpolationModeEnum) -> nil
Type Name Description
PhysicsInterpolationModeEnum mode

GetPhysicsInterpolationMode

GetPhysicsInterpolationMode() -> PhysicsInterpolationModeEnum

IsPhysicsInterpolated

Returns if physics interpolation is enabled for this node (see ).Note: Interpolation will only be active if both the flag is set and physics interpolation is enabled within the . This can be tested using .

IsPhysicsInterpolated() -> boolean

IsPhysicsInterpolatedAndEnabled

Returns if physics interpolation is enabled (see ) and enabled in the .This is a convenience version of that also checks whether physics interpolation is enabled globally.See and ProjectSettings.physics/common/physics_interpolation.

IsPhysicsInterpolatedAndEnabled() -> boolean

ResetPhysicsInterpolation

When physics interpolation is active, moving a node to a radically different transform (such as placement within a level) can result in a visible glitch as the object is rendered moving from the old to new position over the physics tick.That glitch can be prevented by calling this method, which temporarily disables interpolation until the physics tick is complete.The notification will be received by the node and all children recursively.Note: This function should be called after moving the node, rather than before.

ResetPhysicsInterpolation() -> nil

SetAutoTranslateMode(AutoTranslateModeEnum)

SetAutoTranslateMode(mode: AutoTranslateModeEnum) -> nil
Type Name Description
AutoTranslateModeEnum mode

GetAutoTranslateMode

GetAutoTranslateMode() -> AutoTranslateModeEnum

SetTranslationDomainInherited

Makes this node inherit the translation domain from its parent node. If this node has no parent, the main translation domain will be used.This is the default behavior for all nodes. Calling disables this behavior.

SetTranslationDomainInherited() -> nil

GetWindow

Returns the that contains this node. If the node is in the main window, this is equivalent to getting the root node (get_tree().get_root()).

GetWindow() -> Window

GetLastExclusiveWindow

Returns the that contains this node, or the last exclusive child in a chain of windows starting with the one that contains this node.

GetLastExclusiveWindow() -> Window

GetTree

Returns the that contains this node. If this node is not inside the tree, generates an error and returns . See also .

GetTree() -> SceneTree

CreateTween

Creates a new and binds it to this node.This is the equivalent of doing: GetTree().CreateTween().BindNode(this); The Tween will start automatically on the next process frame or physics frame (depending on ). See for more info on Tweens bound to nodes.Note: The method can still be used when the node is not inside . It can fail in an unlikely case of using a custom .

CreateTween() -> Tween

Duplicate(number)

Duplicates the node, returning a new node with all of its properties, signals, groups, and children copied from the original. The behavior can be tweaked through the (see ).Note: For nodes with a attached, if has been defined with required parameters, the duplicated node will not have a .

Duplicate(flags: number = 15) -> Node
Type Name Description
number flags

ReplaceBy(Node,boolean)

Replaces this node by the given . All children of this node are moved to .If is , the is added to the same groups that the replaced node is in (see ).Warning: The replaced node is removed from the tree, but it is not deleted. To prevent memory leaks, store a reference to the node in a variable, or use .

ReplaceBy(node: Node,keepGroups: boolean = False) -> nil
Type Name Description
Node node
boolean keepGroups

SetSceneInstanceLoadPlaceholder(boolean)

If set to , the node becomes a when packed and instantiated from a . See also .

SetSceneInstanceLoadPlaceholder(loadPlaceholder: boolean) -> nil
Type Name Description
boolean loadPlaceholder

GetSceneInstanceLoadPlaceholder

Returns if this node is an instance load placeholder. See and .

GetSceneInstanceLoadPlaceholder() -> boolean

SetEditableInstance(Node,boolean)

Set to to allow all nodes owned by to be available, and editable, in the Scene dock, even if their is not the scene root. This method is intended to be used in editor plugins and tools, but it also works in release builds. See also .

SetEditableInstance(node: Node,isEditable: boolean) -> nil
Type Name Description
Node node
boolean isEditable

IsEditableInstance(Node)

Returns if has editable children enabled relative to this node. This method is intended to be used in editor plugins and tools. See also .

IsEditableInstance(node: Node) -> boolean
Type Name Description
Node node

GetViewport

Returns the node’s closest ancestor, if the node is inside the tree. Otherwise, returns .

GetViewport() -> Viewport

QueueFree

Queues this node to be deleted at the end of the current frame. When deleted, all of its children are deleted as well, and all references to the node and its children become invalid.Unlike with , the node is not deleted instantly, and it can still be accessed before deletion. It is also safe to call multiple times. Use to check if the node will be deleted at the end of the frame.Note: The node will only be freed after all other deferred calls are finished. Using this method is not always the same as calling through .

QueueFree() -> nil

RequestReady

Requests to be called again the next time the node enters the tree. Does not immediately call .Note: This method only affects the current node. If the node’s children also need to request ready, this method needs to be called for each one of them. When the node and its children enter the tree again, the order of callbacks will be the same as normal.

RequestReady() -> nil

IsNodeReady

Returns if the node is ready, i.e. it’s inside scene tree and all its children are initialized. resets it back to .

IsNodeReady() -> boolean

SetMultiplayerAuthority(number,boolean)

Sets the node’s multiplayer authority to the peer with the given peer . The multiplayer authority is the peer that has authority over the node on the network. Defaults to peer ID 1 (the server). Useful in conjunction with and the .If is , the given peer is recursively set as the authority for all children of this node.Warning: This does not automatically replicate the new authority to other peers. It is the developer’s responsibility to do so. You may replicate the new authority’s information using , an RPC, or a . Furthermore, the parent’s authority does not propagate to newly added children.

SetMultiplayerAuthority(id: number,recursive: boolean = True) -> nil
Type Name Description
number id
boolean recursive

GetMultiplayerAuthority

Returns the peer ID of the multiplayer authority for this node. See .

GetMultiplayerAuthority() -> number

IsMultiplayerAuthority

Returns if the local system is the multiplayer authority of this node.

IsMultiplayerAuthority() -> boolean

GetMultiplayer

GetMultiplayer() -> MultiplayerApi

RpcConfig(string,Variant)

Changes the RPC configuration for the given . should either be to disable the feature (as by default), or a containing the following entries:- rpc_mode: see ;- transfer_mode: see ;- call_local: if , the method will also be called locally;- channel: an representing the channel to send the RPC on.Note: In GDScript, this method corresponds to the [annotation @GDScript.@rpc] annotation, with various parameters passed (@rpc(any), @rpc(authority)…). See also the high-level multiplayer tutorial.

RpcConfig(method: string,config: Variant) -> nil
Type Name Description
string method
Variant config

GetRpcConfig

Returns a mapping method names to their RPC configuration defined for this node using .

GetRpcConfig() -> Variant

SetEditorDescription(string)

SetEditorDescription(editorDescription: string) -> nil
Type Name Description
string editorDescription

GetEditorDescription

GetEditorDescription() -> string

SetUniqueNameInOwner(boolean)

SetUniqueNameInOwner(enable: boolean) -> nil
Type Name Description
boolean enable

IsUniqueNameInOwner

IsUniqueNameInOwner() -> boolean

Atr(string,string)

Translates a , using the translation catalogs configured in the Project Settings. Further can be specified to help with the translation. Note that most nodes automatically translate their strings, so this method is mostly useful for formatted strings or custom drawn text.This method works the same as , with the addition of respecting the state.If is , or no translation is available, this method returns the without changes. See .For detailed examples, see Internationalizing games.

Atr(message: string,context: string) -> string
Type Name Description
string message
string context

AtrN(string,string,number,string)

Translates a or , using the translation catalogs configured in the Project Settings. Further can be specified to help with the translation.This method works the same as , with the addition of respecting the state.If is , or no translation is available, this method returns or , without changes. See .The is the number, or amount, of the message’s subject. It is used by the translation system to fetch the correct plural form for the current language.For detailed examples, see Localization using gettext.Note: Negative and numbers may not properly apply to some countable subjects. It’s recommended to handle these cases with .

AtrN(message: string,pluralMessage: string,n: number,context: string) -> string
Type Name Description
string message
string pluralMessage
number n
string context

Rpc(string,Variant[])

Sends a remote procedure call request for the given to peers on the network (and locally), sending additional arguments to the method called by the RPC. The call request will only be received by nodes with the same , including the exact same . Behavior depends on the RPC configuration for the given (see and [annotation @GDScript.@rpc]). By default, methods are not exposed to RPCs.May return if the call is successful, if the arguments passed in the do not match, if the node’s cannot be fetched (such as when the node is not inside the tree), if ‘s connection is not available.Note: You can only safely use RPCs on clients after you received the signal from the . You also need to keep track of the connection state, either by the signals like or by checking (get_multiplayer().peer.get_connection_status() == CONNECTION_CONNECTED).

Rpc(method: string,args: Variant[]) -> Error
Type Name Description
string method
Variant[] args

Rpc(string,ReadOnlySpan__Variant)

Rpc(method: string,args: ReadOnlySpan__Variant) -> Error
Type Name Description
string method
ReadOnlySpan__Variant args

RpcId(number,string,Variant[])

Sends a to a specific peer identified by (see ).May return if the call is successful, if the arguments passed in the do not match, if the node’s cannot be fetched (such as when the node is not inside the tree), if ‘s connection is not available.

RpcId(peerId: number,method: string,args: Variant[]) -> Error
Type Name Description
number peerId
string method
Variant[] args

RpcId(number,string,ReadOnlySpan__Variant)

RpcId(peerId: number,method: string,args: ReadOnlySpan__Variant) -> Error
Type Name Description
number peerId
string method
ReadOnlySpan__Variant args

UpdateConfigurationWarnings

Refreshes the warnings displayed for this node in the Scene dock. Use to customize the warning messages to display.

UpdateConfigurationWarnings() -> nil

CallDeferredThreadGroup(string,Variant[])

This function is similar to except that the call will take place when the node thread group is processed. If the node thread group processes in sub-threads, then the call will be done on that thread, right before or , the or or their internal versions are called.

CallDeferredThreadGroup(method: string,args: Variant[]) -> Variant
Type Name Description
string method
Variant[] args

CallDeferredThreadGroup(string,ReadOnlySpan__Variant)

CallDeferredThreadGroup(method: string,args: ReadOnlySpan__Variant) -> Variant
Type Name Description
string method
ReadOnlySpan__Variant args

SetDeferredThreadGroup(string,Variant)

Similar to , but for setting properties.

SetDeferredThreadGroup(property: string,value: Variant) -> nil
Type Name Description
string property
Variant value

NotifyDeferredThreadGroup(number)

Similar to , but for notifications.

NotifyDeferredThreadGroup(what: number) -> nil
Type Name Description
number what

CallThreadSafe(string,Variant[])

This function ensures that the calling of this function will succeed, no matter whether it’s being done from a thread or not. If called from a thread that is not allowed to call the function, the call will become deferred. Otherwise, the call will go through directly.

CallThreadSafe(method: string,args: Variant[]) -> Variant
Type Name Description
string method
Variant[] args

CallThreadSafe(string,ReadOnlySpan__Variant)

CallThreadSafe(method: string,args: ReadOnlySpan__Variant) -> Variant
Type Name Description
string method
ReadOnlySpan__Variant args

SetThreadSafe(string,Variant)

Similar to , but for setting properties.

SetThreadSafe(property: string,value: Variant) -> nil
Type Name Description
string property
Variant value

NotifyThreadSafe(number)

Similar to , but for notifications.

NotifyThreadSafe(what: number) -> nil
Type Name Description
number what

Dispose

Disposes of this .

Dispose() -> nil

ToString

Converts this to a string.

ToString() -> string

ToSignal(GodotObject,string)

Returns a new awaiter configured to complete when the instance emits the signal specified by the parameter.

ToSignal(source: GodotObject,signal: string) -> SignalAwaiter
Type Name Description
GodotObject source The instance the awaiter will be listening to.
string signal The signal the awaiter will be waiting for.

_Get(string)

Override this method to customize the behavior of . Should return the given ‘s value, or if the should be handled normally.Combined with and , this method allows defining custom properties, which is particularly useful for editor plugins. Note that a property must be present in , otherwise this method will not be called. public override Variant _Get(StringName property) { if (property == “FakeProperty”) { GD.Print(“Getting my property!”); return 4; } return default; } public override Godot.Collections.Array _GetPropertyList() { return [ new Godot.Collections.Dictionary() { { "name", "FakeProperty" }, { "type", (int)Variant.Type.Int }, }, ]; }

_Get(property: string) -> Variant
Type Name Description
string property

_GetPropertyList

Override this method to provide a custom list of additional properties to handle by the engine.Should return a property list, as an of dictionaries. The result is added to the array of , and should be formatted in the same way. Each must at least contain the name and type entries.You can use and to customize the default values of the properties added by this method.The example below displays a list of numbers shown as words going from ZERO to FIVE, with number_count controlling the size of the list: [Tool] public partial class MyNode : Node { private int _numberCount; [Export] public int NumberCount { get => _numberCount; set { _numberCount = value; _numbers.Resize(_numberCount); NotifyPropertyListChanged(); } } private Godot.Collections.Array _numbers = []; public override Godot.Collections.Array _GetPropertyList() { Godot.Collections.Array properties = []; for (int i = 0; i < _numberCount; i++) { properties.Add(new Godot.Collections.Dictionary() { { "name", $"number_{i}" }, { "type", (int)Variant.Type.Int }, { "hint", (int)PropertyHint.Enum }, { "hint_string", "Zero,One,Two,Three,Four,Five" }, }); } return properties; } public override Variant _Get(StringName property) { string propertyName = property.ToString(); if (propertyName.StartsWith("number_")) { int index = int.Parse(propertyName.Substring("number_".Length)); return _numbers[index]; } return default; } public override bool _Set(StringName property, Variant value) { string propertyName = property.ToString(); if (propertyName.StartsWith("number_")) { int index = int.Parse(propertyName.Substring("number_".Length)); _numbers[index] = value.As(); return true; } return false; } } Note: This method is intended for advanced purposes. For most common use cases, the scripting languages offer easier ways to handle properties. See [annotation @GDScript.@export], [annotation @GDScript.@export_enum], [annotation @GDScript.@export_group], etc. If you want to customize exported properties, use .Note: If the object's script is not [annotation @GDScript.@tool], this method will not be called in the editor.

_GetPropertyList() -> Array__Dictionary

_IterGet(Variant)

Returns the current iterable value. stores the iteration state, but unlike and the state is supposed to be read-only, so there is no wrapper.

_IterGet(iter: Variant) -> Variant
Type Name Description
Variant iter

_IterInit(Array)

Initializes the iterator. stores the iteration state. Since GDScript does not support passing arguments by reference, a single-element array is used as a wrapper. Returns so long as the iterator has not reached the end.Example: class MyRange: var _from var _to func _init(from, to): assert(from <= to) _from = from _to = to func _iter_init(iter): iter[0] = _from return iter[0] < _to func _iter_next(iter): iter[0] += 1 return iter[0] < _to func _iter_get(iter): return iter func _ready(): var my_range = MyRange.new(2, 5) for x in my_range: print(x) # Prints 2, 3, 4. Note: Alternatively, you can ignore and use the object’s state instead, see online docs for an example. Note that in this case you will not be able to reuse the same iterator instance in nested loops. Also, make sure you reset the iterator state in this method if you want to reuse the same instance multiple times.

_IterInit(iter: Array) -> boolean
Type Name Description
Array iter

_IterNext(Array)

Moves the iterator to the next iteration. stores the iteration state. Since GDScript does not support passing arguments by reference, a single-element array is used as a wrapper. Returns so long as the iterator has not reached the end.

_IterNext(iter: Array) -> boolean
Type Name Description
Array iter

_Notification(number)

Called when the object receives a notification, which can be identified in by comparing it with a constant. See also . public override void _Notification(int what) { if (what == NotificationPredelete) { GD.Print(“Goodbye!”); } } Note: The base defines a few notifications ( and ). Inheriting classes such as define a lot more notifications, which are also received by this method.

_Notification(what: number) -> nil
Type Name Description
number what

_PropertyCanRevert(string)

Override this method to customize the given ‘s revert behavior. Should return if the has a custom default value and is revertible in the Inspector dock. Use to specify the ‘s default value.Note: This method must return consistently, regardless of the current value of the .

_PropertyCanRevert(property: string) -> boolean
Type Name Description
string property

_PropertyGetRevert(string)

Override this method to customize the given ‘s revert behavior. Should return the default value for the . If the default value differs from the ‘s current value, a revert icon is displayed in the Inspector dock.Note: must also be overridden for this method to be called.

_PropertyGetRevert(property: string) -> Variant
Type Name Description
string property

_Set(string,Variant)

Override this method to customize the behavior of . Should set the to and return , or if the should be handled normally. The exact way to set the is up to this method’s implementation.Combined with and , this method allows defining custom properties, which is particularly useful for editor plugins. Note that a property must be present in , otherwise this method will not be called. private Godot.Collections.Dictionary _internalData = new Godot.Collections.Dictionary(); public override bool _Set(StringName property, Variant value) { if (property == “FakeProperty”) { // Storing the value in the fake property. _internalData[“FakeProperty”] = value; return true; } return false; } public override Godot.Collections.Array _GetPropertyList() { return [ new Godot.Collections.Dictionary() { { "name", "FakeProperty" }, { "type", (int)Variant.Type.Int }, }, ]; }

_Set(property: string,value: Variant) -> boolean
Type Name Description
string property
Variant value

_ValidateProperty(Dictionary)

Override this method to customize existing properties. Every property info goes through this method, except properties added with . The dictionary contents is the same as in . [Tool] public partial class MyNode : Node { private bool _isNumberEditable; [Export] public bool IsNumberEditable { get => _isNumberEditable; set { _isNumberEditable = value; NotifyPropertyListChanged(); } } [Export] public int Number { get; set; } public override void _ValidateProperty(Godot.Collections.Dictionary property) { if (property[“name”].AsStringName() == PropertyName.Number && !IsNumberEditable) { var usage = property[“usage”].As() | PropertyUsageFlags.ReadOnly; property["usage"] = (int)usage; } } }

_ValidateProperty(property: Dictionary) -> nil
Type Name Description
Dictionary property

Free

Deletes the object from memory. Pre-existing references to the object become invalid, and any attempt to access them will result in a run-time error. Checking the references with @GlobalScope.is_instance_valid will return .

Free() -> nil

GetClass

Returns the object’s built-in class name, as a . See also .Note: This method ignores class_name declarations. If this object’s script has defined a class_name, the base, built-in class name is returned instead.

GetClass() -> string

IsClass(string)

Returns if the object inherits from the given . See also . var sprite2D = new Sprite2D(); sprite2D.IsClass(“Sprite2D”); // Returns true sprite2D.IsClass(“Node”); // Returns true sprite2D.IsClass(“Node3D”); // Returns false Note: This method ignores class_name declarations in the object’s script.

IsClass(class: string) -> boolean
Type Name Description
string class

Set(string,Variant)

Assigns to the given . If the property does not exist or the given ‘s type doesn’t match, nothing happens. var node = new Node2D(); node.Set(Node2D.PropertyName.GlobalScale, new Vector2(8, 2.5f)); GD.Print(node.GlobalScale); // Prints (8, 2.5) Note: In C#, 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 on each call.

Set(property: string,value: Variant) -> nil
Type Name Description
string property
Variant value

Get(string)

Returns the value of the given . If the does not exist, this method returns . var node = new Node2D(); node.Rotation = 1.5f; var a = node.Get(Node2D.PropertyName.Rotation); // a is 1.5 Note: In C#, 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 on each call.

Get(property: string) -> Variant
Type Name Description
string property

SetIndexed(string,Variant)

Assigns a new to the property identified by the . The path should be a relative to this object, and can use the colon character (:) to access nested properties. var node = new Node2D(); node.SetIndexed(“position”, new Vector2(42, 0)); node.SetIndexed(“position:y”, -10); GD.Print(node.Position); // Prints (42, -10) Note: In C#, 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 on each call.

SetIndexed(propertyPath: string,value: Variant) -> nil
Type Name Description
string propertyPath
Variant value

GetIndexed(string)

Gets the object’s property indexed by the given . The path should be a relative to the current object and can use the colon character (:) to access nested properties.Examples:”position:x” or “material:next_pass:blend_mode”. var node = new Node2D(); node.Position = new Vector2(5, -10); var a = node.GetIndexed(“position”); // a is Vector2(5, -10) var b = node.GetIndexed(“position:y”); // b is -10 Note: In C#, 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 on each call.Note: This method does not support actual paths to nodes in the , only sub-property paths. In the context of nodes, use instead.

GetIndexed(propertyPath: string) -> Variant
Type Name Description
string propertyPath

GetPropertyList

Returns the object’s property list as an of dictionaries. Each contains the following entries:- name is the property’s name, as a ;- class_name is an empty , unless the property is and it inherits from a class;- type is the property’s type, as an (see );- hint is how the property is meant to be edited (see );- hint_string depends on the hint (see );- usage is a combination of .Note: In GDScript, all class members are treated as properties. In C# and GDExtension, it may be necessary to explicitly mark class members as Godot properties using decorators or attributes.

GetPropertyList() -> Array__Dictionary

GetMethodList

Returns this object’s methods and their signatures as an of dictionaries. Each contains the following entries:- name is the name of the method, as a ;- args is an of dictionaries representing the arguments;- default_args is the default arguments as an of variants;- flags is a combination of ;- id is the method’s internal identifier ;- return is the returned value, as a ;Note: The dictionaries of args and return are formatted identically to the results of , although not all entries are used.

GetMethodList() -> Array__Dictionary

PropertyCanRevert(string)

Returns if the given has a custom default value. Use to get the ‘s default value.Note: This method is used by the Inspector dock to display a revert icon. The object must implement to customize the default value. If is not implemented, this method returns .

PropertyCanRevert(property: string) -> boolean
Type Name Description
string property

PropertyGetRevert(string)

Returns the custom default value of the given . Use to check if the has a custom default value.Note: This method is used by the Inspector dock to display a revert icon. The object must implement to customize the default value. If is not implemented, this method returns .

PropertyGetRevert(property: string) -> Variant
Type Name Description
string property

Notification(number,boolean)

Sends the given notification to all classes inherited by the object, triggering calls to , starting from the highest ancestor (the class) and going down to the object’s script.If is , the call order is reversed. var player = new Node2D(); player.SetScript(GD.Load(“res://player.gd”)); player.Notification(NotificationEnterTree); // The call order is GodotObject -> Node -> Node2D -> player.gd. player.Notification(NotificationEnterTree, true); // The call order is player.gd -> Node2D -> Node -> GodotObject.

Notification(what: number,reversed: boolean = False) -> nil
Type Name Description
number what
boolean reversed

GetInstanceId

Returns the object’s unique instance ID. This ID can be saved in , and can be used to retrieve this object instance with @GlobalScope.instance_from_id.Note: This ID is only useful during the current session. It won’t correspond to a similar object if the ID is sent over a network, or loaded from a file at a later time.

GetInstanceId() -> UInt64

SetScript(Variant)

Attaches to the object, and instantiates it. As a result, the script’s is called. A is used to extend the object’s functionality.If a script already exists, its instance is detached, and its property values and state are lost. Built-in property values are still kept.

SetScript(script: Variant) -> nil
Type Name Description
Variant script

GetScript

Returns the object’s instance, or if no script is attached.

GetScript() -> Variant

SetMeta(string,Variant)

Adds or changes the entry inside the object’s metadata. The metadata can be any , although some types cannot be serialized correctly.If is , the entry is removed. This is the equivalent of using . See also and .Note: A metadata’s name must be a valid identifier as per StringName.is_valid_identifier method.Note: Metadata that has a name starting with an underscore (_) is considered editor-only. Editor-only metadata is not displayed in the Inspector and should not be edited, although it can still be found by this method.

SetMeta(name: string,value: Variant) -> nil
Type Name Description
string name
Variant value

RemoveMeta(string)

Removes the given entry from the object’s metadata. See also , and .Note: A metadata’s name must be a valid identifier as per StringName.is_valid_identifier method.Note: Metadata that has a name starting with an underscore (_) is considered editor-only. Editor-only metadata is not displayed in the Inspector and should not be edited, although it can still be found by this method.

RemoveMeta(name: string) -> nil
Type Name Description
string name

GetMeta(string,Variant)

Returns the object’s metadata value for the given entry . If the entry does not exist, returns . If is , an error is also generated.Note: A metadata’s name must be a valid identifier as per StringName.is_valid_identifier method.Note: Metadata that has a name starting with an underscore (_) is considered editor-only. Editor-only metadata is not displayed in the Inspector and should not be edited, although it can still be found by this method.

GetMeta(name: string,default: Variant) -> Variant
Type Name Description
string name
Variant default

HasMeta(string)

Returns if a metadata entry is found with the given . See also , and .Note: A metadata’s name must be a valid identifier as per StringName.is_valid_identifier method.Note: Metadata that has a name starting with an underscore (_) is considered editor-only. Editor-only metadata is not displayed in the Inspector and should not be edited, although it can still be found by this method.

HasMeta(name: string) -> boolean
Type Name Description
string name

GetMetaList

Returns the object’s metadata entry names as an of s.

GetMetaList() -> Array__string

AddUserSignal(string,Array)

Adds a user-defined signal named . Optional arguments for the signal can be added as an of dictionaries, each defining a name and a type (see ). See also and . AddUserSignal(“Hurt”, [ new Godot.Collections.Dictionary() { { “name”, “damage” }, { “type”, (int)Variant.Type.Int }, }, new Godot.Collections.Dictionary() { { “name”, “source” }, { “type”, (int)Variant.Type.Object }, }, ]);

AddUserSignal(signal: string,arguments: Array) -> nil
Type Name Description
string signal
Array arguments

HasUserSignal(string)

Returns if the given user-defined name exists. Only signals added with are included. See also .

HasUserSignal(signal: string) -> boolean
Type Name Description
string signal

RemoveUserSignal(string)

Removes the given user signal from the object. See also and .

RemoveUserSignal(signal: string) -> nil
Type Name Description
string signal

EmitSignal(string,Variant[])

Emits the given by name. The signal must exist, so it should be a built-in signal of this class or one of its inherited classes, or a user-defined signal (see ). This method supports a variable number of arguments, so parameters can be passed as a comma separated list.Returns if does not exist or the parameters are invalid. EmitSignal(SignalName.Hit, “sword”, 100); EmitSignal(SignalName.GameOver); Note: In C#, must be in snake_case when referring to built-in Godot signals. Prefer using the names exposed in the SignalName class to avoid allocating a new on each call.

EmitSignal(signal: string,args: Variant[]) -> Error
Type Name Description
string signal
Variant[] args

EmitSignal(string,ReadOnlySpan__Variant)

EmitSignal(signal: string,args: ReadOnlySpan__Variant) -> Error
Type Name Description
string signal
ReadOnlySpan__Variant args

Call(string,Variant[])

Calls the on the object and returns the result. This method supports a variable number of arguments, so parameters can be passed as a comma separated list. var node = new Node3D(); node.Call(Node3D.MethodName.Rotate, new Vector3(1f, 0f, 0f), 1.571f); Note: In C#, 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 on each call.

Call(method: string,args: Variant[]) -> Variant
Type Name Description
string method
Variant[] args

Call(string,ReadOnlySpan__Variant)

Call(method: string,args: ReadOnlySpan__Variant) -> Variant
Type Name Description
string method
ReadOnlySpan__Variant args

CallDeferred(string,Variant[])

Calls the on the object during idle time. Always returns , not the method’s result.Idle time happens mainly at the end of process and physics frames. In it, deferred calls will be run until there are none left, which means you can defer calls from other deferred calls and they’ll still be run in the current idle time cycle. This means you should not call a method deferred from itself (or from a method called by it), as this causes infinite recursion the same way as if you had called the method directly.This method supports a variable number of arguments, so parameters can be passed as a comma separated list. var node = new Node3D(); node.CallDeferred(Node3D.MethodName.Rotate, new Vector3(1f, 0f, 0f), 1.571f); See also Callable.call_deferred.Note: In C#, 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 on each call.Note: If you’re looking to delay the function call by a frame, refer to the and signals. var node = Node3D.new() # Make a Callable and bind the arguments to the node’s rotate() call. var callable = node.rotate.bind(Vector3(1.0, 0.0, 0.0), 1.571) # Connect the callable to the process_frame signal, so it gets called in the next process frame. # CONNECT_ONE_SHOT makes sure it only gets called once instead of every frame. get_tree().process_frame.connect(callable, CONNECT_ONE_SHOT)

CallDeferred(method: string,args: Variant[]) -> Variant
Type Name Description
string method
Variant[] args

CallDeferred(string,ReadOnlySpan__Variant)

CallDeferred(method: string,args: ReadOnlySpan__Variant) -> Variant
Type Name Description
string method
ReadOnlySpan__Variant args

SetDeferred(string,Variant)

Assigns to the given , at the end of the current frame. This is equivalent to calling through . var node = new Node2D(); node.Rotation = 1.5f; node.SetDeferred(Node2D.PropertyName.Rotation, 3f); GD.Print(node.Rotation); // Prints 1.5 await ToSignal(GetTree(), SceneTree.SignalName.ProcessFrame); GD.Print(node.Rotation); // Prints 3.0 Note: In C#, 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 on each call.

SetDeferred(property: string,value: Variant) -> nil
Type Name Description
string property
Variant value

Callv(string,Array)

Calls the on the object and returns the result. Unlike , this method expects all parameters to be contained inside . var node = new Node3D(); node.Callv(Node3D.MethodName.Rotate, [new Vector3(1f, 0f, 0f), 1.571f]); Note: In C#, 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 on each call.

Callv(method: string,argArray: Array) -> Variant
Type Name Description
string method
Array argArray

HasMethod(string)

Returns if the given name exists in the object.Note: In C#, 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 on each call.

HasMethod(method: string) -> boolean
Type Name Description
string method

GetMethodArgumentCount(string)

Returns the number of arguments of the given by name.Note: In C#, 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 on each call.

GetMethodArgumentCount(method: string) -> number
Type Name Description
string method

HasSignal(string)

Returns if the given name exists in the object.Note: In C#, must be in snake_case when referring to built-in Godot signals. Prefer using the names exposed in the SignalName class to avoid allocating a new on each call.

HasSignal(signal: string) -> boolean
Type Name Description
string signal

GetSignalList

Returns the list of existing signals as an of dictionaries.Note: Due of the implementation, each is formatted very similarly to the returned values of .

GetSignalList() -> Array__Dictionary

GetSignalConnectionList(string)

Returns an of connections for the given name. Each connection is represented as a that contains three entries:- signal is a reference to the ;- callable is a reference to the connected ;- flags is a combination of .

GetSignalConnectionList(signal: string) -> Array__Dictionary
Type Name Description
string signal

GetIncomingConnections

Returns an of signal connections received by this object. Each connection is represented as a that contains three entries:- signal is a reference to the ;- callable is a reference to the ;- flags is a combination of .

GetIncomingConnections() -> Array__Dictionary

Connect(string,Callable,UInt32)

Connects a by name to a . Optional can be also added to configure the connection’s behavior (see constants).A signal can only be connected once to the same . If the signal is already connected, this method returns and pushes an error message, unless the signal is connected with . To prevent this, use first to check for existing connections.If the ‘s object is freed, the connection will be lost.Examples with recommended syntax:Connecting signals is one of the most common operations in Godot and the API gives many options to do so, which are described further down. The code block below shows the recommended approach. public override void _Ready() { var button = new Button(); // C# supports passing signals as events, so we can use this idiomatic construct: button.ButtonDown += OnButtonDown; // This assumes that a Player class exists, which defines a Hit signal. var player = new Player(); // We can use lambdas when we need to bind additional parameters. player.Hit += () => OnPlayerHit(“sword”, 100); } private void OnButtonDown() { GD.Print(“Button down!”); } private void OnPlayerHit(string weaponType, int damage) { GD.Print($”Hit with weapon {weaponType} for {damage} damage.”); } Object.connect() or Signal.connect()?As seen above, the recommended method to connect signals is not . The code block below shows the four options for connecting signals, using either this legacy method or the recommended Signal.connect, and using either an implicit or a manually defined one. public override void _Ready() { var button = new Button(); // Option 1: In C#, we can use signals as events and connect with this idiomatic syntax: button.ButtonDown += OnButtonDown; // Option 2: GodotObject.Connect() with a constructed Callable from a method group. button.Connect(Button.SignalName.ButtonDown, Callable.From(OnButtonDown)); // Option 3: GodotObject.Connect() with a constructed Callable using a target object and method name. button.Connect(Button.SignalName.ButtonDown, new Callable(this, MethodName.OnButtonDown)); } private void OnButtonDown() { GD.Print(“Button down!”); } While all options have the same outcome (button’s signal will be connected to _on_button_down), option 3 offers the best validation: it will print a compile-time error if either the button_down or the _on_button_down are not defined. On the other hand, option 2 only relies on string names and will only be able to validate either names at runtime: it will print a runtime error if “button_down” doesn’t correspond to a signal, or if “_on_button_down” is not a registered method in the object self. The main reason for using options 1, 2, or 4 would be if you actually need to use strings (e.g. to connect signals programmatically based on strings read from a configuration file). Otherwise, option 3 is the recommended (and fastest) method.Binding and passing parameters:The syntax to bind parameters is through Callable.bind, which returns a copy of the with its parameters bound.When calling or Signal.emit, the signal parameters can be also passed. The examples below show the relationship between these signal parameters and bound parameters. public override void _Ready() { // This assumes that a Player class exists, which defines a Hit signal. var player = new Player(); // Using lambda expressions that create a closure that captures the additional parameters. // The lambda only receives the parameters defined by the signal’s delegate. player.Hit += (hitBy, level) => OnPlayerHit(hitBy, level, “sword”, 100); // Parameters added when emitting the signal are passed first. player.EmitSignal(SignalName.Hit, “Dark lord”, 5); } // We pass two arguments when emitting (hit_by, level), // and bind two more arguments when connecting (weapon_type, damage). private void OnPlayerHit(string hitBy, int level, string weaponType, int damage) { GD.Print($”Hit by {hitBy} (level {level}) with weapon {weaponType} for {damage} damage.”); }

Connect(signal: string,callable: Callable,flags: UInt32 = 0) -> Error
Type Name Description
string signal
Callable callable
UInt32 flags

Disconnect(string,Callable)

Disconnects a by name from a given . If the connection does not exist, generates an error. Use to make sure that the connection exists.

Disconnect(signal: string,callable: Callable) -> nil
Type Name Description
string signal
Callable callable

IsConnected(string,Callable)

Returns if a connection exists between the given name and .Note: In C#, must be in snake_case when referring to built-in Godot signals. Prefer using the names exposed in the SignalName class to avoid allocating a new on each call.

IsConnected(signal: string,callable: Callable) -> boolean
Type Name Description
string signal
Callable callable

HasConnections(string)

Returns if any connection exists on the given name.Note: In C#, must be in snake_case when referring to built-in Godot methods. Prefer using the names exposed in the SignalName class to avoid allocating a new on each call.

HasConnections(signal: string) -> boolean
Type Name Description
string signal

SetBlockSignals(boolean)

If set to , the object becomes unable to emit signals. As such, and signal connections will not work, until it is set to .

SetBlockSignals(enable: boolean) -> nil
Type Name Description
boolean enable

IsBlockingSignals

Returns if the object is blocking its signals from being emitted. See .

IsBlockingSignals() -> boolean

NotifyPropertyListChanged

Emits the signal. This is mainly used to refresh the editor, so that the Inspector and editor plugins are properly updated.

NotifyPropertyListChanged() -> nil

SetMessageTranslation(boolean)

If set to , allows the object to translate messages with and . Enabled by default. See also .

SetMessageTranslation(enable: boolean) -> nil
Type Name Description
boolean enable

CanTranslateMessages

Returns if the object is allowed to translate messages with and . See also .

CanTranslateMessages() -> boolean

Tr(string,string)

Translates a , using the translation catalogs configured in the Project Settings. Further can be specified to help with the translation. Note that most nodes automatically translate their strings, so this method is mostly useful for formatted strings or custom drawn text.If is , or no translation is available, this method returns the without changes. See .For detailed examples, see Internationalizing games.Note: This method can’t be used without an instance, as it requires the method. To translate strings in a static context, use .

Tr(message: string,context: string) -> string
Type Name Description
string message
string context

TrN(string,string,number,string)

Translates a or , using the translation catalogs configured in the Project Settings. Further can be specified to help with the translation.If is , or no translation is available, this method returns or , without changes. See .The is the number, or amount, of the message’s subject. It is used by the translation system to fetch the correct plural form for the current language.For detailed examples, see Localization using gettext.Note: Negative and numbers may not properly apply to some countable subjects. It’s recommended to handle these cases with .Note: This method can’t be used without an instance, as it requires the method. To translate strings in a static context, use .

TrN(message: string,pluralMessage: string,n: number,context: string) -> string
Type Name Description
string message
string pluralMessage
number n
string context

GetTranslationDomain

Returns the name of the translation domain used by and . See also .

GetTranslationDomain() -> string

SetTranslationDomain(string)

Sets the name of the translation domain used by and . See also .

SetTranslationDomain(domain: string) -> nil
Type Name Description
string domain

IsQueuedForDeletion

Returns if the method was called for the object.

IsQueuedForDeletion() -> boolean

CancelFree

If this method is called during , this object will reject being freed and will remain allocated. This is mostly an internal function used for error handling to avoid the user from freeing objects when they are not intended to.

CancelFree() -> nil

Categories:

Updated: