Control
A rectangular interface entity with layout, focus and GUI input.
Control stores a UI rectangle, anchors/offsets, size bounds, theme and focus. It belongs to the regular Entity hierarchy. Use an appropriate CanvasLayer for a screen HUD independent of the world camera.
A plain Control parent permits manual layout; a Container manages eligible direct child Controls itself. Do not mix those owners for one position. Minimum, maximum and size flags affect the final rectangle. Handle GUI input in _GuiInput(); keyboard input requires focus. A FocusMode alone does not select the initial control.
Declarations checked against C# SDK 1.0.0. Expand a name to see declarations and documentation.
Constructors1
ControlConstructor
public Control();Properties63
AccessibilityControlsEntitiesProperty
public Reckfell.Collections.Array<EntityPath> AccessibilityControlsEntities { get; set; }The paths to the nodes which are controlled by this node.
AccessibilityDescribedByEntitiesProperty
public Reckfell.Collections.Array<EntityPath> AccessibilityDescribedByEntities { get; set; }The paths to the nodes which are describing this node.
AccessibilityDescriptionProperty
public string AccessibilityDescription { get; set; }The human-readable node description that is reported to assistive apps.
AccessibilityFlowToEntitiesProperty
public Reckfell.Collections.Array<EntityPath> AccessibilityFlowToEntities { get; set; }The paths to the nodes which this node flows into.
AccessibilityLabeledByEntitiesProperty
public Reckfell.Collections.Array<EntityPath> AccessibilityLabeledByEntities { get; set; }The paths to the nodes which label this node.
AccessibilityLiveProperty
public AccessibilityServer.AccessibilityLiveMode AccessibilityLive { get; set; }The mode with which a live region updates. A live region is a Entity that is updated as a result of an external event when the user's focus may be elsewhere.
AccessibilityNameProperty
public string AccessibilityName { get; set; }The human-readable node name that is reported to assistive apps.
AnchorBottomProperty
public float AnchorBottom { get; set; }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 Control.Anchor constants for convenience.
AnchorLeftProperty
public float AnchorLeft { get; set; }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 Control.Anchor constants for convenience.
AnchorRightProperty
public float AnchorRight { get; set; }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 Control.Anchor constants for convenience.
AnchorTopProperty
public float AnchorTop { get; set; }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 Control.Anchor constants for convenience.
AnchorsPresetProperty
public int AnchorsPreset { get; set; }AutoTranslateProperty · Deprecated
public bool AutoTranslate { get; set; }Toggles if any text should automatically change to its translated version depending on the current locale.
ClipContentsProperty
public bool ClipContents { get; set; }Enables whether rendering of CanvasItem based children should be clipped to this control's rectangle. If true, parts of a child which would be visibly outside of this control's rectangle will not be rendered and won't receive input.
CustomMaximumSizeProperty
public Vector2 CustomMaximumSize { get; set; }An additional per-axis upper bound. A negative component normalizes to -1 and means no custom bound; zero is a bound, not unlimited. Do not set minimum above maximum.
CustomMinimumSizeProperty
public Vector2 CustomMinimumSize { get; set; }An additional per-axis minimum, not the final size. Built-in text/theme/content requirements also participate; inspect GetCombinedMinimumSize(). Use _GetMinimumSize and UpdateMinimumSize for a dynamic custom requirement.
FocusBehaviorRecursiveProperty
public Control.FocusBehaviorRecursiveEnum FocusBehaviorRecursive { get; set; }Determines which controls can be focused together with Control.FocusMode. See Control.GetFocusModeWithOverride. Since the default behavior is Control.FocusBehaviorRecursiveEnum.Inherited, this can be used to prevent all children controls from getting focused.
FocusModeProperty
public Control.FocusModeEnum FocusMode { get; set; }Focus eligibility. All enables ordinary keyboard traversal; None excludes ordinary focus. Assign initial GrabFocus separately. Visibility and recursive parent rules also count; a button's Disabled does not replace None.
FocusNeighborBottomProperty
public EntityPath FocusNeighborBottom { get; set; }Tells Reckfell 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 Control. If this property is not set, Reckfell will give focus to the closest Control to the bottom of this one.
FocusNeighborLeftProperty
public EntityPath FocusNeighborLeft { get; set; }Tells Reckfell 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 Control. If this property is not set, Reckfell will give focus to the closest Control to the left of this one.
FocusNeighborRightProperty
public EntityPath FocusNeighborRight { get; set; }Tells Reckfell 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 Control. If this property is not set, Reckfell will give focus to the closest Control to the right of this one.
FocusNeighborTopProperty
public EntityPath FocusNeighborTop { get; set; }Tells Reckfell 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 Control. If this property is not set, Reckfell will give focus to the closest Control to the top of this one.
FocusNextProperty
public EntityPath FocusNext { get; set; }A path relative to this control to the next ordinary Tab target. Use GetPathTo(target) and maintain target existence/visibility when the tree changes. Arrow directions are configured separately through FocusNeighbor*.
FocusPreviousProperty
public EntityPath FocusPrevious { get; set; }Tells Reckfell which node it should give focus to if the user presses [kbd]Shift + Tab[/kbd] on a keyboard by default. You can change the key by editing the ProjectSettings.input/ui_focus_prev input action.
If this property is not set, Reckfell will select a "best guess" based on surrounding nodes in the scene tree.
GlobalPositionProperty
public Vector2 GlobalPosition { get; set; }The node's global position, relative to the world (usually to the CanvasLayer).
GrowHorizontalProperty
public Control.GrowDirection GrowHorizontal { get; set; }Controls the direction on the horizontal axis in which the control should grow or shrink if its horizontal size is changed.
GrowVerticalProperty
public Control.GrowDirection GrowVertical { get; set; }Controls the direction on the vertical axis in which the control should grow or shrink if its vertical size is changed.
LayoutDirectionProperty
public Control.LayoutDirectionEnum LayoutDirection { get; set; }Controls layout direction and text writing direction. Right-to-left layouts are necessary for certain languages (e.g. Arabic and Hebrew). See also Control.IsLayoutRtl.
LayoutModeProperty
public int LayoutMode { get; set; }LocalizeNumeralSystemProperty
public bool LocalizeNumeralSystem { get; set; }If true, automatically converts code line numbers, list indices, SpinBox and ProgressBar values from the Western Arabic (0..9) to the numeral systems used in current locale.
Note: Numbers within the text are not automatically converted, it can be done manually, using TextServer.FormatNumber.
MouseBehaviorRecursiveProperty
public Control.MouseBehaviorRecursiveEnum MouseBehaviorRecursive { get; set; }Determines which controls can receive mouse input together with Control.MouseFilter. See Control.GetMouseFilterWithOverride. Since the default behavior is Control.MouseBehaviorRecursiveEnum.Inherited, this can be used to prevent all children controls from receiving mouse input.
MouseDefaultCursorShapeProperty
public Control.CursorShape MouseDefaultCursorShape { get; set; }The default cursor shape for this control. Useful for Reckfell 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.
MouseFilterProperty
public Control.MouseFilterEnum MouseFilter { get; set; }Stop stops ordinary upward pointer propagation; Pass allows propagation to the parent and is not click-through to siblings; Ignore excludes the control from hit testing. Keyboard focus is configured separately.
MouseForcePassScrollEventsProperty
public bool MouseForcePassScrollEvents { get; set; }When enabled, scroll wheel events processed by Control.GuiInput will be passed to the parent control even if Control.MouseFilter is set to Control.MouseFilterEnum.Stop.
You should disable it on the root of your UI if you do not want scroll events to go to the Entity._UnhandledInput processing.
Note: Because this property defaults to true, this allows nested scrollable containers to work out of the box.
OffsetBottomProperty
public float OffsetBottom { get; set; }Distance between the node's bottom edge and its parent control, based on Control.AnchorBottom.
Offsets are often controlled by one or multiple parent Container nodes, so you should not modify them manually if your node is a direct child of a Container. Offsets update automatically when you move or resize the node.
OffsetLeftProperty
public float OffsetLeft { get; set; }Distance between the node's left edge and its parent control, based on Control.AnchorLeft.
Offsets are often controlled by one or multiple parent Container nodes, so you should not modify them manually if your node is a direct child of a Container. Offsets update automatically when you move or resize the node.
OffsetRightProperty
public float OffsetRight { get; set; }Distance between the node's right edge and its parent control, based on Control.AnchorRight.
Offsets are often controlled by one or multiple parent Container nodes, so you should not modify them manually if your node is a direct child of a Container. Offsets update automatically when you move or resize the node.
OffsetTopProperty
public float OffsetTop { get; set; }Distance between the node's top edge and its parent control, based on Control.AnchorTop.
Offsets are often controlled by one or multiple parent Container nodes, so you should not modify them manually if your node is a direct child of a Container. Offsets update automatically when you move or resize the node.
OffsetTransformEnabledProperty
public bool OffsetTransformEnabled { get; set; }If true, applies all offset transform properties. Otherwise, no offset transform is applied and the properties have no effect.
OffsetTransformPivotProperty
public Vector2 OffsetTransformPivot { get; set; }Pivot used by Control.OffsetTransformRotation and Control.OffsetTransformScale in absolute units.
The final pivot position is the combined value of this property and Control.OffsetTransformPivotRatio.
Has no effect unless Control.OffsetTransformEnabled is true.
OffsetTransformPivotRatioProperty
public Vector2 OffsetTransformPivotRatio { get; set; }Same as Control.OffsetTransformPivot but expressed in units relative to the Control Control.Size where Vector2(0, 0) is the top-left corner of this control, and Vector2(1, 1) is its bottom-right corner.
The final pivot position is the combined value of this property and Control.OffsetTransformPivot.
Has no effect unless Control.OffsetTransformEnabled is true.
OffsetTransformPositionProperty
public Vector2 OffsetTransformPosition { get; set; }Position offset in absolute units. The final offset is the combined value of this property and Control.OffsetTransformPositionRatio.
Has no effect unless Control.OffsetTransformEnabled is true.
OffsetTransformPositionRatioProperty
public Vector2 OffsetTransformPositionRatio { get; set; }Same as Control.OffsetTransformPosition but expressed in units relative to the Control Control.Size where Vector2(0, 0) is the top-left corner of this control, and Vector2(1, 1) is its bottom-right corner.
The final offset is the combined value of this property and Control.OffsetTransformPosition.
Has no effect unless Control.OffsetTransformEnabled is true.
OffsetTransformRotationProperty
public float OffsetTransformRotation { get; set; }Rotation offset. The rotation pivot is defined by Control.OffsetTransformPivot and Control.OffsetTransformPivotRatio.
Has no effect unless Control.OffsetTransformEnabled is true.
OffsetTransformScaleProperty
public Vector2 OffsetTransformScale { get; set; }Scale offset. The scale pivot is defined by Control.OffsetTransformPivot and Control.OffsetTransformPivotRatio.
Has no effect unless Control.OffsetTransformEnabled is true.
OffsetTransformVisualOnlyProperty
public bool OffsetTransformVisualOnly { get; set; }If true, the offset transforms is only applied visually and does not affect input. In other words, this Control will still receive input events at its original location before the offset transform is applied.
If false, the entire transform of this Control is affected and input events will register where the Control is visually.
Has no effect unless Control.OffsetTransformEnabled is true.
PivotOffsetProperty
public Vector2 PivotOffset { get; set; }By default, the node's pivot is its top-left corner. When you change its Control.Rotation or Control.Scale, it will rotate or scale around this pivot.
The actual offset is the combined value of this property and Control.PivotOffsetRatio.
PivotOffsetRatioProperty
public Vector2 PivotOffsetRatio { get; set; }Same as Control.PivotOffset, but expressed as uniform vector, where Vector2(0, 0) is the top-left corner of this control, and Vector2(1, 1) is its bottom-right corner. Set this property to Vector2(0.5, 0.5) to pivot around this control's center.
The actual offset is the combined value of this property and Control.PivotOffset.
PositionProperty
public Vector2 Position { get; set; }The node's position, relative to its containing node. It corresponds to the rectangle's top-left corner. The property is not affected by Control.PivotOffset.
PropagateMaximumSizeProperty
public bool PropagateMaximumSize { get; set; }If true, this Control's children will use the value returned by Control.GetCombinedMaximumSize in their own size calculations.
RotationProperty
public float Rotation { get; set; }The node's rotation around its pivot, in radians. See Control.PivotOffset 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 Control.RotationDegrees.
RotationDegreesProperty
public float RotationDegrees { get; set; }Helper property to access Control.Rotation in degrees instead of radians.
ScaleProperty
public Vector2 Scale { get; set; }The node's scale, relative to its Control.Size. Change this property to scale the node around its Control.PivotOffset. The Control's tooltip 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: FontFile.Oversampling does not take Control Control.Scale into account. This means that scaling up/down will cause bitmap fonts and rasterized (non-MSDF) dynamic fonts to appear blurry or pixelated. To ensure text remains crisp regardless of scale, you can enable MSDF font rendering by enabling 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, SystemFont.MultichannelSignedDistanceField can be enabled in the inspector.
Note: If the Control node is a child of a Container node, the scale will be reset to Vector2(1, 1) when the scene is instantiated. To set the Control's scale when it's instantiated, wait for one frame using await get_tree().process_frame then set its Control.Scale property.
ShortcutContextProperty
public Entity ShortcutContext { get; set; }The Entity which must be a parent of the focused Control for the shortcut to be activated. If null, the shortcut can be activated when any control is focused (a global shortcut). This allows shortcuts to be accepted only when the user has a certain area of the GUI focused.
SizeProperty
public Vector2 Size { get; set; }Current rectangle dimensions in local logical coordinates. Assignment observes minimum/maximum. A direct Container child can be resized by sorting; separated anchors also recalculate edges when the parent changes.
SizeFlagsHorizontalProperty
public Control.SizeFlags SizeFlagsHorizontal { get; set; }Horizontal placement flags in a supporting container. Fill fills the allocated share; Expand requests participation in space distribution; ExpandFill combines them. They do not replace anchors under a plain parent.
SizeFlagsStretchRatioProperty
public float SizeFlagsStretchRatio { get; set; }A relative stretch weight for containers that use it. Minima, maxima, gaps and other items' flags affect the result; weight 2 does not guarantee exactly twice the final width.
SizeFlagsVerticalProperty
public Control.SizeFlags SizeFlagsVertical { get; set; }Tells the parent Container nodes how they should resize and place the node on the Y axis. Use a combination of the Control.SizeFlags constants to change the flags. See the constants to learn what each does.
ThemeProperty
public Theme Theme { get; set; }The Theme resource this node and all its Control and Window children use. If a child node has its own Theme resource set, theme items are merged with child's definitions having higher priority.
Note: Window styles will have no effect unless the window is embedded.
ThemeTypeVariationProperty
public StringName ThemeTypeVariation { get; set; }The name of a theme type variation used by this Control to look up its own theme items. When empty, the class name of the node is used (e.g. Button control), as well as the class names of all parent classes (in order of inheritance).
When set, this property gives the highest priority to the type of the specified name. This type can in turn extend another type, forming a dependency chain. See Theme.SetTypeVariation. If the theme item cannot be found using this type or its base types, lookup falls back on the class names.
Note: To look up Control's own items use various get_theme_* methods without specifying theme_type.
Note: Theme items are looked for in the tree order, from branch to root, where each Control node is checked for its Control.Theme property. The earliest match against any type/class name is returned. The project-level Theme and the default Theme are checked last.
TooltipAutoTranslateModeProperty
public Entity.AutoTranslateModeEnum TooltipAutoTranslateMode { get; set; }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 Entity.AutoTranslateModeEnum.Inherit.
Note: Tooltips customized using Control._MakeCustomTooltip do not use this auto translate mode automatically.
TooltipTextProperty
public string TooltipText { get; set; }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 Control.MouseFilter property is not Control.MouseFilterEnum.Ignore. 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 Control.GetTooltip. Override Control.GetTooltip to generate tooltip text dynamically. Override Control._MakeCustomTooltip 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 Control._MakeCustomTooltip. The default tooltip includes a PopupPanel and Label whose theme properties can be customized using Theme methods with the "TooltipPanel" and "TooltipLabel" respectively. For example:
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));TranslationContextProperty
public StringName TranslationContext { get; set; }Context for automatic translation lookup on a Control. For Label, set it before Text: changing context alone does not recalculate the existing internal text. Send NotificationTranslationChanged after changing it when immediate lookup is needed.
Methods203
AcceptEventvoid
public void AcceptEvent();Marks the current GUI event handled in the viewport. Call from _GuiInput after handling it to prevent later GUI/_UnhandledInput delivery. This cannot undo an earlier _Input or direct polling of Input state.
AccessibilityDragvoid
public void AccessibilityDrag();Starts drag-and-drop operation without using a mouse.
AccessibilityDropvoid
public void AccessibilityDrop();Ends drag-and-drop operation without using a mouse.
AddThemeColorOverridevoid
public void AddThemeColorOverride(StringName name, Color color);Creates a local override for a theme Color with the specified name. Local overrides always take precedence when fetching theme items for the control. An override can be removed with Control.RemoveThemeColorOverride.
See also Control.GetThemeColor.
Example: Override a Label's color and reset it later:
// Given the child Label node "MyLabel", override its font color with a custom value.
GetEntity<Label>("MyLabel").AddThemeColorOverride("font_color", new Color(1, 0.5f, 0));
// Reset the font color of the child label.
GetEntity<Label>("MyLabel").RemoveThemeColorOverride("font_color");
// Alternatively it can be overridden with the default value from the Label type.
GetEntity<Label>("MyLabel").AddThemeColorOverride("font_color", GetThemeColor("font_color", "Label"));| Name | Type | Default |
|---|---|---|
name | StringName | — |
color | Color | — |
AddThemeConstantOverridevoid
public void AddThemeConstantOverride(StringName name, int constant);Creates a local override for a theme constant with the specified name. Local overrides always take precedence when fetching theme items for the control. An override can be removed with Control.RemoveThemeConstantOverride.
See also Control.GetThemeConstant.
| Name | Type | Default |
|---|---|---|
name | StringName | — |
constant | int | — |
AddThemeFontOverridevoid
public void AddThemeFontOverride(StringName name, Font font);Creates a local override for a theme Font with the specified name. Local overrides always take precedence when fetching theme items for the control. An override can be removed with Control.RemoveThemeFontOverride.
See also Control.GetThemeFont.
| Name | Type | Default |
|---|---|---|
name | StringName | — |
font | Font | — |
AddThemeFontSizeOverridevoid
public void AddThemeFontSizeOverride(StringName name, int fontSize);Creates a local override for a theme font size with the specified name. Local overrides always take precedence when fetching theme items for the control. An override can be removed with Control.RemoveThemeFontSizeOverride.
See also Control.GetThemeFontSize.
| Name | Type | Default |
|---|---|---|
name | StringName | — |
fontSize | int | — |
AddThemeIconOverridevoid
public void AddThemeIconOverride(StringName name, Texture2D texture);Creates a local override for a theme icon with the specified name. Local overrides always take precedence when fetching theme items for the control. An override can be removed with Control.RemoveThemeIconOverride.
See also Control.GetThemeIcon.
| Name | Type | Default |
|---|---|---|
name | StringName | — |
texture | Texture2D | — |
AddThemeSoundOverridevoid
public void AddThemeSoundOverride(StringName name, AudioStream audio);Creates a local override for a theme sound with the specified name. Local overrides always take precedence when fetching theme items for the control. An override can be removed with Control.RemoveThemeSoundOverride.
See also Control.GetThemeSound.
| Name | Type | Default |
|---|---|---|
name | StringName | — |
audio | AudioStream | — |
AddThemeStyleboxOverridevoid
public void AddThemeStyleboxOverride(StringName name, StyleBox stylebox);Creates a local override for a theme StyleBox with the specified name. Local overrides always take precedence when fetching theme items for the control. An override can be removed with Control.RemoveThemeStyleboxOverride.
See also Control.GetThemeStylebox.
Example: Modify a property in a StyleBox 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 = GetEntity<Button>("MyButton").GetThemeStylebox("normal").Duplicate() as StyleBoxFlat;
newStyleboxNormal.BorderWidthTop = 3;
newStyleboxNormal.BorderColor = new Color(0, 1, 0.5f);
GetEntity<Button>("MyButton").AddThemeStyleboxOverride("normal", newStyleboxNormal);
// Remove the stylebox override.
GetEntity<Button>("MyButton").RemoveThemeStyleboxOverride("normal");| Name | Type | Default |
|---|---|---|
name | StringName | — |
stylebox | StyleBox | — |
BeginBulkThemeOverridevoid
public void BeginBulkThemeOverride();Prevents *_theme_*_override methods from emitting Control.NotificationThemeChanged until Control.EndBulkThemeOverride is called.
EndBulkThemeOverridevoid
public void EndBulkThemeOverride();Ends a bulk theme override update. See Control.BeginBulkThemeOverride.
FindNextValidFocusControl
public Control FindNextValidFocus();Finds the next (below in the tree) Control that can receive the focus.
ControlFindPrevValidFocusControl
public Control FindPrevValidFocus();Finds the previous (above in the tree) Control that can receive the focus.
ControlFindValidFocusNeighborControl
public Control FindValidFocusNeighbor(Side side);Finds the next Control that can receive the focus on the specified Side.
Note: This is different from Control.GetFocusNeighbor, which returns the path of a specified focus neighbor.
| Name | Type | Default |
|---|---|---|
side | Side | — |
ControlForceDragvoid
public void ForceDrag(Variant data, Control preview);Forces drag and bypasses Control._GetDragData and Control.SetDragPreview by passing data and preview. Drag will start even if the mouse is neither over nor pressed on this control.
The methods Control._CanDropData and Control._DropData must be implemented on controls that want to receive drop data.
| Name | Type | Default |
|---|---|---|
data | Variant | — |
preview | Control | — |
GetAccessibilityControlsEntitiesReckfell.Collections.Array<EntityPath>
public Reckfell.Collections.Array<EntityPath> GetAccessibilityControlsEntities();Reckfell.Collections.Array<EntityPath>GetAccessibilityDescribedByEntitiesReckfell.Collections.Array<EntityPath>
public Reckfell.Collections.Array<EntityPath> GetAccessibilityDescribedByEntities();Reckfell.Collections.Array<EntityPath>GetAccessibilityDescriptionstring
public string GetAccessibilityDescription();stringGetAccessibilityFlowToEntitiesReckfell.Collections.Array<EntityPath>
public Reckfell.Collections.Array<EntityPath> GetAccessibilityFlowToEntities();Reckfell.Collections.Array<EntityPath>GetAccessibilityLabeledByEntitiesReckfell.Collections.Array<EntityPath>
public Reckfell.Collections.Array<EntityPath> GetAccessibilityLabeledByEntities();Reckfell.Collections.Array<EntityPath>GetAccessibilityLiveAccessibilityServer.AccessibilityLiveMode
public AccessibilityServer.AccessibilityLiveMode GetAccessibilityLive();AccessibilityServer.AccessibilityLiveModeGetAccessibilityNamestring
public string GetAccessibilityName();stringGetAnchorfloat
public float GetAnchor(Side side);Returns the anchor for the specified Side. A getter method for Control.AnchorBottom, Control.AnchorLeft, Control.AnchorRight and Control.AnchorTop.
| Name | Type | Default |
|---|---|---|
side | Side | — |
floatGetBeginVector2
public Vector2 GetBegin();Returns Control.OffsetLeft and Control.OffsetTop. See also Control.Position.
Vector2GetBoundMinimumSizeVector2
public Vector2 GetBoundMinimumSize();Returns the bound value of Control.GetCombinedMinimumSize by Control.GetCombinedMaximumSize.
This value is the true minimum size of the container, as the maximum size has priority over the minimum size.
For example, if the combined minimum size is (100, 100) and the combined maximum size is (50, 150), the bound minimum size will be (50, 100).
Vector2GetCombinedMaximumSizeVector2
public Vector2 GetCombinedMaximumSize();Returns the combined maximum size from Control.CustomMaximumSize and Control.GetMaximumSize, as well as the Control.CustomMaximumSize of this node's parent if it is a Control node with Control.PropagateMaximumSize set to true.
Vector2GetCombinedMinimumSizeVector2
public Vector2 GetCombinedMinimumSize();Returns the combined minimum size from Control.CustomMinimumSize and Control.GetMinimumSize.
Vector2GetCombinedPivotOffsetVector2
public Vector2 GetCombinedPivotOffset();Returns the combined value of Control.PivotOffset and Control.PivotOffsetRatio, in pixels. The ratio is multiplied by the control's size.
Vector2GetCursorShapeControl.CursorShape
public Control.CursorShape GetCursorShape(Vector2? atPosition = default);Virtual method to be implemented by the user. Returns the cursor shape for the position at_position in the control's local coordinates, which will typically be used while hovering over this control. See Control.GetCursorShape.
If not overridden, defaults to Control.MouseDefaultCursorShape.
| Name | Type | Default |
|---|---|---|
atPosition | Vector2? | default |
atPositionIf the parameter is null, then the default value is new Vector2(0.0f, 0.0f).
Control.CursorShapeGetCustomMaximumSizeVector2
public Vector2 GetCustomMaximumSize();Vector2GetCustomMinimumSizeVector2
public Vector2 GetCustomMinimumSize();Vector2GetDefaultCursorShapeControl.CursorShape
public Control.CursorShape GetDefaultCursorShape();Control.CursorShapeGetEndVector2
public Vector2 GetEnd();Returns Control.OffsetRight and Control.OffsetBottom.
Vector2GetFocusBehaviorRecursiveControl.FocusBehaviorRecursiveEnum
public Control.FocusBehaviorRecursiveEnum GetFocusBehaviorRecursive();Control.FocusBehaviorRecursiveEnumGetFocusModeControl.FocusModeEnum
public Control.FocusModeEnum GetFocusMode();Control.FocusModeEnumGetFocusModeWithOverrideControl.FocusModeEnum
public Control.FocusModeEnum GetFocusModeWithOverride();Returns the Control.FocusMode, but takes the Control.FocusBehaviorRecursive into account. If Control.FocusBehaviorRecursive is set to Control.FocusBehaviorRecursiveEnum.Disabled, or it is set to Control.FocusBehaviorRecursiveEnum.Inherited and its ancestor is set to Control.FocusBehaviorRecursiveEnum.Disabled, then this returns Control.FocusModeEnum.None.
Control.FocusModeEnumGetFocusNeighborEntityPath
public EntityPath GetFocusNeighbor(Side side);Returns the focus neighbor for the specified Side. A getter method for Control.FocusNeighborBottom, Control.FocusNeighborLeft, Control.FocusNeighborRight and Control.FocusNeighborTop.
Note: To find the next Control on the specific Side, even if a neighbor is not assigned, use Control.FindValidFocusNeighbor.
| Name | Type | Default |
|---|---|---|
side | Side | — |
EntityPathGetFocusNextEntityPath
public EntityPath GetFocusNext();EntityPathGetFocusPreviousEntityPath
public EntityPath GetFocusPrevious();EntityPathGetGlobalPositionVector2
public Vector2 GetGlobalPosition();Vector2GetGlobalRectRect2
public Rect2 GetGlobalRect();Returns the position and size of the control relative to the containing canvas. See Control.GlobalPosition and Control.Size.
Note: If the node itself or any parent CanvasItem between the node and the canvas have a non default rotation or skew, the resulting size is likely not meaningful.
Note: Setting Viewport.GuiSnapControlsToPixels to true can lead to rounding inaccuracies between the displayed control and the returned Rect2.
Rect2GetHGrowDirectionControl.GrowDirection
public Control.GrowDirection GetHGrowDirection();Control.GrowDirectionGetHSizeFlagsControl.SizeFlags
public Control.SizeFlags GetHSizeFlags();Control.SizeFlagsGetLayoutDirectionControl.LayoutDirectionEnum
public Control.LayoutDirectionEnum GetLayoutDirection();Control.LayoutDirectionEnumGetMaximumSizeVector2
public Vector2 GetMaximumSize();Virtual method to be implemented by the user. Returns the maximum size for this control. Alternative to Control.CustomMaximumSize for controlling maximum size via code. The actual maximum 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 Control node that already overrides its maximum size (e.g. ScrollContainer).
Note: It is recommended to use Control.GetBoundMinimumSize instead of Control.GetCombinedMinimumSize when implementing this method, as the former respects maximum size limits when calculating the minimum size, while the latter does not.
Vector2GetMinimumSizeVector2
public Vector2 GetMinimumSize();Virtual method to be implemented by the user. Returns the minimum size for this control. Alternative to Control.CustomMinimumSize 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 Control node that already overrides its minimum size (e.g. Label, Button, PanelContainer etc.). It can only be used with most basic GUI nodes, like Control, Container, Panel etc.
Vector2GetMouseBehaviorRecursiveControl.MouseBehaviorRecursiveEnum
public Control.MouseBehaviorRecursiveEnum GetMouseBehaviorRecursive();Control.MouseBehaviorRecursiveEnumGetMouseFilterControl.MouseFilterEnum
public Control.MouseFilterEnum GetMouseFilter();Control.MouseFilterEnumGetMouseFilterWithOverrideControl.MouseFilterEnum
public Control.MouseFilterEnum GetMouseFilterWithOverride();Returns the Control.MouseFilter, but takes the Control.MouseBehaviorRecursive into account. If Control.MouseBehaviorRecursive is set to Control.MouseBehaviorRecursiveEnum.Disabled, or it is set to Control.MouseBehaviorRecursiveEnum.Inherited and its ancestor is set to Control.MouseBehaviorRecursiveEnum.Disabled, then this returns Control.MouseFilterEnum.Ignore.
Control.MouseFilterEnumGetOffsetfloat
public float GetOffset(Side offset);Returns the offset for the specified Side. A getter method for Control.OffsetBottom, Control.OffsetLeft, Control.OffsetRight and Control.OffsetTop.
| Name | Type | Default |
|---|---|---|
offset | Side | — |
floatGetOffsetTransformPivotVector2
public Vector2 GetOffsetTransformPivot();Vector2GetOffsetTransformPivotRatioVector2
public Vector2 GetOffsetTransformPivotRatio();Vector2GetOffsetTransformPositionVector2
public Vector2 GetOffsetTransformPosition();Vector2GetOffsetTransformPositionRatioVector2
public Vector2 GetOffsetTransformPositionRatio();Vector2GetOffsetTransformRotationfloat
public float GetOffsetTransformRotation();floatGetOffsetTransformScaleVector2
public Vector2 GetOffsetTransformScale();Vector2GetParentAreaSizeVector2
public Vector2 GetParentAreaSize();Returns the width/height occupied in the parent control.
Vector2GetParentControlControl
public Control GetParentControl();Returns the parent control node.
ControlGetPivotOffsetVector2
public Vector2 GetPivotOffset();Vector2GetPivotOffsetRatioVector2
public Vector2 GetPivotOffsetRatio();Vector2GetPositionVector2
public Vector2 GetPosition();Vector2GetRectRect2
public Rect2 GetRect();Returns the position and size of the control in the coordinate system of the containing node. See Control.Position, Control.Scale and Control.Size.
Note: If Control.Rotation is not the default rotation, the resulting size is not meaningful.
Note: Setting Viewport.GuiSnapControlsToPixels to true can lead to rounding inaccuracies between the displayed control and the returned Rect2.
Rect2GetRotationfloat
public float GetRotation();floatGetRotationDegreesfloat
public float GetRotationDegrees();floatGetScaleVector2
public Vector2 GetScale();Vector2GetScreenPositionVector2
public Vector2 GetScreenPosition();Returns the position of this Control in global screen coordinates (i.e. taking window position into account). Mostly useful for editor plugins.
Equivalent to get_screen_transform().origin (see CanvasItem.GetScreenTransform).
Example: Show a popup at the mouse position:
Vector2GetShortcutContextEntity
public Entity GetShortcutContext();EntityGetSizeVector2
public Vector2 GetSize();Vector2GetStretchRatiofloat
public float GetStretchRatio();floatGetThemeTheme
public Theme GetTheme();ThemeGetThemeColorColor
public Color GetThemeColor(StringName name, StringName themeType = null);Returns a Color from the first matching Theme in the tree if that Theme has a color item with the specified name and theme_type. If theme_type is omitted the class name of the current control is used as the type, or Control.ThemeTypeVariation 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 Control.AddThemeColorOverride), then its assigned Control.Theme. After the current control, each parent control and its assigned Control.Theme are considered; controls without a Control.Theme assigned are skipped. If no matching Theme is found in the tree, the custom project Theme (see ProjectSettings.gui/theme/custom) and the default Theme are used (see ThemeDB).
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");
}| Name | Type | Default |
|---|---|---|
name | StringName | — |
themeType | StringName | null |
ColorGetThemeConstantint
public int GetThemeConstant(StringName name, StringName themeType = null);Returns a constant from the first matching Theme in the tree if that Theme has a constant item with the specified name and theme_type.
See Control.GetThemeColor for details.
| Name | Type | Default |
|---|---|---|
name | StringName | — |
themeType | StringName | null |
intGetThemeDefaultBaseScalefloat
public float GetThemeDefaultBaseScale();Returns the default base scale value from the first matching Theme in the tree if that Theme has a valid Theme.DefaultBaseScale value.
See Control.GetThemeColor for details.
floatGetThemeDefaultFontFont
public Font GetThemeDefaultFont();Returns the default font from the first matching Theme in the tree if that Theme has a valid Theme.DefaultFont value.
See Control.GetThemeColor for details.
FontGetThemeDefaultFontSizeint
public int GetThemeDefaultFontSize();Returns the default font size value from the first matching Theme in the tree if that Theme has a valid Theme.DefaultFontSize value.
See Control.GetThemeColor for details.
intGetThemeFontFont
public Font GetThemeFont(StringName name, StringName themeType = null);Returns a Font from the first matching Theme in the tree if that Theme has a font item with the specified name and theme_type.
See Control.GetThemeColor for details.
| Name | Type | Default |
|---|---|---|
name | StringName | — |
themeType | StringName | null |
FontGetThemeFontSizeint
public int GetThemeFontSize(StringName name, StringName themeType = null);Returns a font size from the first matching Theme in the tree if that Theme has a font size item with the specified name and theme_type.
See Control.GetThemeColor for details.
| Name | Type | Default |
|---|---|---|
name | StringName | — |
themeType | StringName | null |
intGetThemeIconTexture2D
public Texture2D GetThemeIcon(StringName name, StringName themeType = null);Returns an icon from the first matching Theme in the tree if that Theme has an icon item with the specified name and theme_type.
See Control.GetThemeColor for details.
| Name | Type | Default |
|---|---|---|
name | StringName | — |
themeType | StringName | null |
Texture2DGetThemeSoundAudioStream
public AudioStream GetThemeSound(StringName name, StringName themeType = null);Returns a sound from the first matching Theme in the tree if that Theme has a sound item with the specified name and theme_type.
See Control.GetThemeColor for details.
| Name | Type | Default |
|---|---|---|
name | StringName | — |
themeType | StringName | null |
AudioStreamGetThemeStyleboxStyleBox
public StyleBox GetThemeStylebox(StringName name, StringName themeType = null);Returns a StyleBox from the first matching Theme in the tree if that Theme has a stylebox item with the specified name and theme_type.
See Control.GetThemeColor for details.
| Name | Type | Default |
|---|---|---|
name | StringName | — |
themeType | StringName | null |
StyleBoxGetThemeTypeVariationStringName
public StringName GetThemeTypeVariation();StringNameGetTooltipstring
public string GetTooltip(Vector2? atPosition = default);Virtual method to be implemented by the user. Returns the tooltip text for the position at_position in the control's local coordinates, which will typically appear when the cursor is resting over this control. See Control.GetTooltip.
Note: If this method returns an empty string and Control._MakeCustomTooltip is not overridden, no tooltip is displayed.
| Name | Type | Default |
|---|---|---|
atPosition | Vector2? | default |
atPositionIf the parameter is null, then the default value is new Vector2(0.0f, 0.0f).
stringGetTooltipAutoTranslateModeEntity.AutoTranslateModeEnum
public Entity.AutoTranslateModeEnum GetTooltipAutoTranslateMode();Entity.AutoTranslateModeEnumGetTooltipTextstring
public string GetTooltipText();stringGetTranslationContextStringName
public StringName GetTranslationContext();StringNameGetVGrowDirectionControl.GrowDirection
public Control.GrowDirection GetVGrowDirection();Control.GrowDirectionGetVSizeFlagsControl.SizeFlags
public Control.SizeFlags GetVSizeFlags();Control.SizeFlagsGrabClickFocusvoid
public void GrabClickFocus();Creates an InputEventMouseButton 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.
}GrabFocus2 overloads
public void GrabFocus();Assigns focus to this visible eligible control. Deferring initial selection until hierarchy readiness is useful. Hiding releases focus; assign it again when opening a screen. The hideFocus overload controls the indicator, not input availability.
public void GrabFocus(bool hideFocus = false);Assigns focus to this visible eligible control. Deferring initial selection until hierarchy readiness is useful. Hiding releases focus; assign it again when opening a screen. The hideFocus overload controls the indicator, not input availability.
| Name | Type | Default |
|---|---|---|
hideFocus | bool | false |
HasFocus2 overloads
public bool HasFocus();Returns true if this is the current focused control. See Control.FocusMode.
If ignore_hidden_focus is true, controls that have their focus hidden will always return false. Hidden focus happens automatically when controls gain focus via mouse input, or manually using Control.GrabFocus with hide_focus set to true.
boolpublic bool HasFocus(bool ignoreHiddenFocus = false);Returns true if this is the current focused control. See Control.FocusMode.
If ignore_hidden_focus is true, controls that have their focus hidden will always return false. Hidden focus happens automatically when controls gain focus via mouse input, or manually using Control.GrabFocus with hide_focus set to true.
| Name | Type | Default |
|---|---|---|
ignoreHiddenFocus | bool | false |
boolHasThemeColorbool
public bool HasThemeColor(StringName name, StringName themeType = null);Returns true if there is a matching Theme in the tree that has a color item with the specified name and theme_type.
See Control.GetThemeColor for details.
| Name | Type | Default |
|---|---|---|
name | StringName | — |
themeType | StringName | null |
boolHasThemeColorOverridebool
public bool HasThemeColorOverride(StringName name);Returns true if there is a local override for a theme Color with the specified name in this Control node.
See Control.AddThemeColorOverride.
| Name | Type | Default |
|---|---|---|
name | StringName | — |
boolHasThemeConstantbool
public bool HasThemeConstant(StringName name, StringName themeType = null);Returns true if there is a matching Theme in the tree that has a constant item with the specified name and theme_type.
See Control.GetThemeColor for details.
| Name | Type | Default |
|---|---|---|
name | StringName | — |
themeType | StringName | null |
boolHasThemeConstantOverridebool
public bool HasThemeConstantOverride(StringName name);Returns true if there is a local override for a theme constant with the specified name in this Control node.
See Control.AddThemeConstantOverride.
| Name | Type | Default |
|---|---|---|
name | StringName | — |
boolHasThemeFontbool
public bool HasThemeFont(StringName name, StringName themeType = null);Returns true if there is a matching Theme in the tree that has a font item with the specified name and theme_type.
See Control.GetThemeColor for details.
| Name | Type | Default |
|---|---|---|
name | StringName | — |
themeType | StringName | null |
boolHasThemeFontOverridebool
public bool HasThemeFontOverride(StringName name);Returns true if there is a local override for a theme Font with the specified name in this Control node.
See Control.AddThemeFontOverride.
| Name | Type | Default |
|---|---|---|
name | StringName | — |
boolHasThemeFontSizebool
public bool HasThemeFontSize(StringName name, StringName themeType = null);Returns true if there is a matching Theme in the tree that has a font size item with the specified name and theme_type.
See Control.GetThemeColor for details.
| Name | Type | Default |
|---|---|---|
name | StringName | — |
themeType | StringName | null |
boolHasThemeFontSizeOverridebool
public bool HasThemeFontSizeOverride(StringName name);Returns true if there is a local override for a theme font size with the specified name in this Control node.
See Control.AddThemeFontSizeOverride.
| Name | Type | Default |
|---|---|---|
name | StringName | — |
boolHasThemeIconbool
public bool HasThemeIcon(StringName name, StringName themeType = null);Returns true if there is a matching Theme in the tree that has an icon item with the specified name and theme_type.
See Control.GetThemeColor for details.
| Name | Type | Default |
|---|---|---|
name | StringName | — |
themeType | StringName | null |
boolHasThemeIconOverridebool
public bool HasThemeIconOverride(StringName name);Returns true if there is a local override for a theme icon with the specified name in this Control node.
See Control.AddThemeIconOverride.
| Name | Type | Default |
|---|---|---|
name | StringName | — |
boolHasThemeSoundbool
public bool HasThemeSound(StringName name, StringName themeType = null);Returns true if there is a matching Theme in the tree that has a sound item with the specified name and theme_type.
See Control.GetThemeColor for details.
| Name | Type | Default |
|---|---|---|
name | StringName | — |
themeType | StringName | null |
boolHasThemeSoundOverridebool
public bool HasThemeSoundOverride(StringName name);Returns true if there is a local override for a theme sound with the specified name in this Control node.
See Control.AddThemeSoundOverride.
| Name | Type | Default |
|---|---|---|
name | StringName | — |
boolHasThemeStyleboxbool
public bool HasThemeStylebox(StringName name, StringName themeType = null);Returns true if there is a matching Theme in the tree that has a stylebox item with the specified name and theme_type.
See Control.GetThemeColor for details.
| Name | Type | Default |
|---|---|---|
name | StringName | — |
themeType | StringName | null |
boolHasThemeStyleboxOverridebool
public bool HasThemeStyleboxOverride(StringName name);Returns true if there is a local override for a theme StyleBox with the specified name in this Control node.
See Control.AddThemeStyleboxOverride.
| Name | Type | Default |
|---|---|---|
name | StringName | — |
boolIsAutoTranslatingbool
public bool IsAutoTranslating();boolIsClippingContentsbool
public bool IsClippingContents();boolIsDragSuccessfulbool
public bool IsDragSuccessful();Returns true if a drag operation is successful. Alternative to Viewport.GuiIsDragSuccessful.
Best used with Entity.NotificationDragEnd.
boolIsForcePassScrollEventsbool
public bool IsForcePassScrollEvents();boolIsLayoutRtlbool
public bool IsLayoutRtl();Returns the effective Control layout direction using LayoutDirection and inheritance. Does not determine the direction of every text string or switch the game locale.
booltrue for an effective right-to-left layout, otherwise false. This is configuration state, not proof that the entire UI renders correctly.
IsLocalizingNumeralSystembool
public bool IsLocalizingNumeralSystem();boolIsOffsetTransformEnabledbool
public bool IsOffsetTransformEnabled();boolIsOffsetTransformVisualOnlybool
public bool IsOffsetTransformVisualOnly();boolIsPropagatingMaximumSizebool
public bool IsPropagatingMaximumSize();boolReleaseFocusvoid
public void ReleaseFocus();Give up the focus. No other control will be able to receive input.
RemoveThemeColorOverridevoid
public void RemoveThemeColorOverride(StringName name);Removes a local override for a theme Color with the specified name previously added by Control.AddThemeColorOverride or via the Inspector dock.
| Name | Type | Default |
|---|---|---|
name | StringName | — |
RemoveThemeConstantOverridevoid
public void RemoveThemeConstantOverride(StringName name);Removes a local override for a theme constant with the specified name previously added by Control.AddThemeConstantOverride or via the Inspector dock.
| Name | Type | Default |
|---|---|---|
name | StringName | — |
RemoveThemeFontOverridevoid
public void RemoveThemeFontOverride(StringName name);Removes a local override for a theme Font with the specified name previously added by Control.AddThemeFontOverride or via the Inspector dock.
| Name | Type | Default |
|---|---|---|
name | StringName | — |
RemoveThemeFontSizeOverridevoid
public void RemoveThemeFontSizeOverride(StringName name);Removes a local override for a theme font size with the specified name previously added by Control.AddThemeFontSizeOverride or via the Inspector dock.
| Name | Type | Default |
|---|---|---|
name | StringName | — |
RemoveThemeIconOverridevoid
public void RemoveThemeIconOverride(StringName name);Removes a local override for a theme icon with the specified name previously added by Control.AddThemeIconOverride or via the Inspector dock.
| Name | Type | Default |
|---|---|---|
name | StringName | — |
RemoveThemeSoundOverridevoid
public void RemoveThemeSoundOverride(StringName name);Removes a local override for a theme sound with the specified name previously added by Control.AddThemeSoundOverride or via the Inspector dock.
| Name | Type | Default |
|---|---|---|
name | StringName | — |
RemoveThemeStyleboxOverridevoid
public void RemoveThemeStyleboxOverride(StringName name);Removes a local override for a theme StyleBox with the specified name previously added by Control.AddThemeStyleboxOverride or via the Inspector dock.
| Name | Type | Default |
|---|---|---|
name | StringName | — |
ResetSizevoid
public void ResetSize();Resets the size to Control.GetCombinedMinimumSize. This is equivalent to calling set_size(Vector2()) (or any size below the minimum).
SetAccessibilityControlsEntitiesvoid
public void SetAccessibilityControlsEntities(Reckfell.Collections.Array<EntityPath> entityPath);| Name | Type | Default |
|---|---|---|
entityPath | Reckfell.Collections.Array<EntityPath> | — |
SetAccessibilityDescribedByEntitiesvoid
public void SetAccessibilityDescribedByEntities(Reckfell.Collections.Array<EntityPath> entityPath);| Name | Type | Default |
|---|---|---|
entityPath | Reckfell.Collections.Array<EntityPath> | — |
SetAccessibilityDescriptionvoid
public void SetAccessibilityDescription(string description);| Name | Type | Default |
|---|---|---|
description | string | — |
SetAccessibilityFlowToEntitiesvoid
public void SetAccessibilityFlowToEntities(Reckfell.Collections.Array<EntityPath> entityPath);| Name | Type | Default |
|---|---|---|
entityPath | Reckfell.Collections.Array<EntityPath> | — |
SetAccessibilityLabeledByEntitiesvoid
public void SetAccessibilityLabeledByEntities(Reckfell.Collections.Array<EntityPath> entityPath);| Name | Type | Default |
|---|---|---|
entityPath | Reckfell.Collections.Array<EntityPath> | — |
SetAccessibilityLive2 overloads
public void SetAccessibilityLive(AccessibilityServer.AccessibilityLiveMode mode);| Name | Type | Default |
|---|---|---|
mode | AccessibilityServer.AccessibilityLiveMode | — |
public void SetAccessibilityLive(DisplayServer.AccessibilityLiveMode mode);| Name | Type | Default |
|---|---|---|
mode | DisplayServer.AccessibilityLiveMode | — |
SetAccessibilityNamevoid
public void SetAccessibilityName(string name);| Name | Type | Default |
|---|---|---|
name | string | — |
SetAnchorvoid
public void SetAnchor(Side side, float anchor, bool keepOffset = false, bool pushOppositeAnchor = true);Sets the anchor for the specified Side to anchor. A setter method for Control.AnchorBottom, Control.AnchorLeft, Control.AnchorRight and Control.AnchorTop.
If keep_offset is true, offsets aren't updated after this operation.
If push_opposite_anchor is true and the opposite anchor overlaps this anchor, the opposite one will have its value overridden. For example, when setting left anchor to 1 and the right anchor has value of 0.5, the right anchor will also get value of 1. If push_opposite_anchor was false, the left anchor would get value 0.5.
| Name | Type | Default |
|---|---|---|
side | Side | — |
anchor | float | — |
keepOffset | bool | false |
pushOppositeAnchor | bool | true |
SetAnchorAndOffsetvoid
public void SetAnchorAndOffset(Side side, float anchor, float offset, bool pushOppositeAnchor = false);Works the same as Control.SetAnchor, but instead of keep_offset argument and automatic update of offset, it allows to set the offset yourself (see Control.SetOffset).
| Name | Type | Default |
|---|---|---|
side | Side | — |
anchor | float | — |
offset | float | — |
pushOppositeAnchor | bool | false |
SetAnchorsAndOffsetsPresetvoid
public void SetAnchorsAndOffsetsPreset(Control.LayoutPreset preset, Control.LayoutPresetMode resizeMode = Control.LayoutPresetMode.Minsize, int margin = 0);Assigns standard anchors and offsets using the selected size-retention mode and margin. FullRect fills the parent anchorable area with that margin unless size constraints interfere. A Container parent can subsequently own the rectangle itself.
| Name | Type | Default |
|---|---|---|
preset | Control.LayoutPreset | — |
resizeMode | Control.LayoutPresetMode | Control.LayoutPresetMode.Minsize |
margin | int | 0 |
SetAnchorsPresetvoid
public void SetAnchorsPreset(Control.LayoutPreset preset, bool keepOffsets = false);Assigns a standard anchor set; keepOffsets controls offset retention. To set anchors and offsets together, use SetAnchorsAndOffsetsPreset or configure offsets explicitly after the preset.
| Name | Type | Default |
|---|---|---|
preset | Control.LayoutPreset | — |
keepOffsets | bool | false |
SetAutoTranslatevoid
public void SetAutoTranslate(bool enable);| Name | Type | Default |
|---|---|---|
enable | bool | — |
SetBeginvoid
public void SetBegin(Vector2 position);Sets Control.OffsetLeft and Control.OffsetTop at the same time. Equivalent of changing Control.Position.
| Name | Type | Default |
|---|---|---|
position | Vector2 | — |
SetClipContentsvoid
public void SetClipContents(bool enable);| Name | Type | Default |
|---|---|---|
enable | bool | — |
SetCustomMaximumSizevoid
public void SetCustomMaximumSize(Vector2 size);| Name | Type | Default |
|---|---|---|
size | Vector2 | — |
SetCustomMinimumSizevoid
public void SetCustomMinimumSize(Vector2 size);| Name | Type | Default |
|---|---|---|
size | Vector2 | — |
SetDefaultCursorShapevoid
public void SetDefaultCursorShape(Control.CursorShape shape);| Name | Type | Default |
|---|---|---|
shape | Control.CursorShape | — |
SetDragForwardingvoid
public void SetDragForwarding(Callable dragFunc, Callable canDropFunc, Callable dropFunc);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:
drag_funccorresponds toControl._GetDragDataand requires aVector2;can_drop_funccorresponds toControl._CanDropDataand requires both aVector2and aVariant;drop_funccorresponds toControl._DropDataand requires both aVector2and aVariant.
| Name | Type | Default |
|---|---|---|
dragFunc | Callable | — |
canDropFunc | Callable | — |
dropFunc | Callable | — |
SetDragPreviewvoid
public void SetDragPreview(Control control);Shows the given control at the mouse pointer. A good time to call this method is in Control._GetDragData. 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;
}| Name | Type | Default |
|---|---|---|
control | Control | — |
SetEndvoid
public void SetEnd(Vector2 position);Sets Control.OffsetRight and Control.OffsetBottom at the same time.
| Name | Type | Default |
|---|---|---|
position | Vector2 | — |
SetFocusBehaviorRecursivevoid
public void SetFocusBehaviorRecursive(Control.FocusBehaviorRecursiveEnum focusBehaviorRecursive);| Name | Type | Default |
|---|---|---|
focusBehaviorRecursive | Control.FocusBehaviorRecursiveEnum | — |
SetFocusModevoid
public void SetFocusMode(Control.FocusModeEnum mode);| Name | Type | Default |
|---|---|---|
mode | Control.FocusModeEnum | — |
SetFocusNeighborvoid
public void SetFocusNeighbor(Side side, EntityPath neighbor);Sets the focus neighbor for the specified Side to the Control at neighbor node path. A setter method for Control.FocusNeighborBottom, Control.FocusNeighborLeft, Control.FocusNeighborRight and Control.FocusNeighborTop.
| Name | Type | Default |
|---|---|---|
side | Side | — |
neighbor | EntityPath | — |
SetFocusNextvoid
public void SetFocusNext(EntityPath next);| Name | Type | Default |
|---|---|---|
next | EntityPath | — |
SetFocusPreviousvoid
public void SetFocusPrevious(EntityPath previous);| Name | Type | Default |
|---|---|---|
previous | EntityPath | — |
SetForcePassScrollEventsvoid
public void SetForcePassScrollEvents(bool forcePassScrollEvents);| Name | Type | Default |
|---|---|---|
forcePassScrollEvents | bool | — |
SetGlobalPositionvoid
public void SetGlobalPosition(Vector2 position, bool keepOffsets = false);Sets the Control.GlobalPosition to given Control.Position.
If keep_offsets is true, control's anchors will be updated instead of offsets.
| Name | Type | Default |
|---|---|---|
position | Vector2 | — |
keepOffsets | bool | false |
SetHGrowDirectionvoid
public void SetHGrowDirection(Control.GrowDirection direction);| Name | Type | Default |
|---|---|---|
direction | Control.GrowDirection | — |
SetHSizeFlagsvoid
public void SetHSizeFlags(Control.SizeFlags flags);| Name | Type | Default |
|---|---|---|
flags | Control.SizeFlags | — |
SetLayoutDirectionvoid
public void SetLayoutDirection(Control.LayoutDirectionEnum direction);| Name | Type | Default |
|---|---|---|
direction | Control.LayoutDirectionEnum | — |
SetLocalizeNumeralSystemvoid
public void SetLocalizeNumeralSystem(bool enable);| Name | Type | Default |
|---|---|---|
enable | bool | — |
SetMouseBehaviorRecursivevoid
public void SetMouseBehaviorRecursive(Control.MouseBehaviorRecursiveEnum mouseBehaviorRecursive);| Name | Type | Default |
|---|---|---|
mouseBehaviorRecursive | Control.MouseBehaviorRecursiveEnum | — |
SetMouseFiltervoid
public void SetMouseFilter(Control.MouseFilterEnum filter);| Name | Type | Default |
|---|---|---|
filter | Control.MouseFilterEnum | — |
SetOffsetvoid
public void SetOffset(Side side, float offset);Sets the offset for the specified Side to offset. A setter method for Control.OffsetBottom, Control.OffsetLeft, Control.OffsetRight and Control.OffsetTop.
| Name | Type | Default |
|---|---|---|
side | Side | — |
offset | float | — |
SetOffsetTransformEnabledvoid
public void SetOffsetTransformEnabled(bool enabled);| Name | Type | Default |
|---|---|---|
enabled | bool | — |
SetOffsetTransformPivotvoid
public void SetOffsetTransformPivot(Vector2 pivot);| Name | Type | Default |
|---|---|---|
pivot | Vector2 | — |
SetOffsetTransformPivotRatiovoid
public void SetOffsetTransformPivotRatio(Vector2 pivot);| Name | Type | Default |
|---|---|---|
pivot | Vector2 | — |
SetOffsetTransformPositionvoid
public void SetOffsetTransformPosition(Vector2 offset);| Name | Type | Default |
|---|---|---|
offset | Vector2 | — |
SetOffsetTransformPositionRatiovoid
public void SetOffsetTransformPositionRatio(Vector2 offset);| Name | Type | Default |
|---|---|---|
offset | Vector2 | — |
SetOffsetTransformRotationvoid
public void SetOffsetTransformRotation(float rotation);| Name | Type | Default |
|---|---|---|
rotation | float | — |
SetOffsetTransformScalevoid
public void SetOffsetTransformScale(Vector2 scale);| Name | Type | Default |
|---|---|---|
scale | Vector2 | — |
SetOffsetTransformVisualOnlyvoid
public void SetOffsetTransformVisualOnly(bool enabled);| Name | Type | Default |
|---|---|---|
enabled | bool | — |
SetOffsetsPresetvoid
public void SetOffsetsPreset(Control.LayoutPreset preset, Control.LayoutPresetMode resizeMode = Control.LayoutPresetMode.Minsize, int margin = 0);Sets the offsets to a preset from Control.LayoutPreset enum. This is the code equivalent to using the Layout menu in the 2D editor.
Use parameter resize_mode with constants from Control.LayoutPresetMode to better determine the resulting size of the Control. Constant size will be ignored if used with presets that change size, e.g. Control.LayoutPreset.LeftWide.
Use parameter margin to determine the gap between the Control and the edges.
| Name | Type | Default |
|---|---|---|
preset | Control.LayoutPreset | — |
resizeMode | Control.LayoutPresetMode | Control.LayoutPresetMode.Minsize |
margin | int | 0 |
SetPivotOffsetvoid
public void SetPivotOffset(Vector2 pivotOffset);| Name | Type | Default |
|---|---|---|
pivotOffset | Vector2 | — |
SetPivotOffsetRatiovoid
public void SetPivotOffsetRatio(Vector2 ratio);| Name | Type | Default |
|---|---|---|
ratio | Vector2 | — |
SetPositionvoid
public void SetPosition(Vector2 position, bool keepOffsets = false);Sets the Control.Position to given Control.Position.
If keep_offsets is true, control's anchors will be updated instead of offsets.
| Name | Type | Default |
|---|---|---|
position | Vector2 | — |
keepOffsets | bool | false |
SetPropagateMaximumSizevoid
public void SetPropagateMaximumSize(bool enable);| Name | Type | Default |
|---|---|---|
enable | bool | — |
SetRotationvoid
public void SetRotation(float radians);| Name | Type | Default |
|---|---|---|
radians | float | — |
SetRotationDegreesvoid
public void SetRotationDegrees(float degrees);| Name | Type | Default |
|---|---|---|
degrees | float | — |
SetScalevoid
public void SetScale(Vector2 scale);| Name | Type | Default |
|---|---|---|
scale | Vector2 | — |
SetShortcutContextvoid
public void SetShortcutContext(Entity node);| Name | Type | Default |
|---|---|---|
node | Entity | — |
SetSizevoid
public void SetSize(Vector2 size, bool keepOffsets = false);Sets the size (see Control.Size).
If keep_offsets is true, control's anchors will be updated instead of offsets.
| Name | Type | Default |
|---|---|---|
size | Vector2 | — |
keepOffsets | bool | false |
SetStretchRatiovoid
public void SetStretchRatio(float ratio);| Name | Type | Default |
|---|---|---|
ratio | float | — |
SetThemevoid
public void SetTheme(Theme theme);| Name | Type | Default |
|---|---|---|
theme | Theme | — |
SetThemeTypeVariationvoid
public void SetThemeTypeVariation(StringName themeType);| Name | Type | Default |
|---|---|---|
themeType | StringName | — |
SetTooltipAutoTranslateModevoid
public void SetTooltipAutoTranslateMode(Entity.AutoTranslateModeEnum mode);| Name | Type | Default |
|---|---|---|
mode | Entity.AutoTranslateModeEnum | — |
SetTooltipTextvoid
public void SetTooltipText(string hint);| Name | Type | Default |
|---|---|---|
hint | string | — |
SetTranslationContextvoid
public void SetTranslationContext(StringName context);| Name | Type | Default |
|---|---|---|
context | StringName | — |
SetVGrowDirectionvoid
public void SetVGrowDirection(Control.GrowDirection direction);| Name | Type | Default |
|---|---|---|
direction | Control.GrowDirection | — |
SetVSizeFlagsvoid
public void SetVSizeFlags(Control.SizeFlags flags);| Name | Type | Default |
|---|---|---|
flags | Control.SizeFlags | — |
UpdateMaximumSizevoid
public void UpdateMaximumSize();Invalidates the maximum size cache in this node and in child nodes with CanvasItem.TopLevel set to false. Intended to be used with Control.GetMaximumSize when the return value is changed. Setting Control.CustomMaximumSize directly calls this method automatically.
Note: Calling this method also calls Control.UpdateMinimumSize since the combined minimum size may be affected by the maximum size change.
UpdateMinimumSizevoid
public void UpdateMinimumSize();Invalidates the minimum size cache in this node and in parent nodes up to top level. Intended to be used with Control.GetMinimumSize when the return value is changed. Setting Control.CustomMinimumSize directly calls this method automatically.
WarpMousevoid
public void WarpMouse(Vector2 position);Moves the mouse cursor to Control.Position, relative to Control.Position of this Control.
Note: Control.WarpMouse is only supported on Windows, macOS and Linux. It has no effect on Android, iOS and Web.
| Name | Type | Default |
|---|---|---|
position | Vector2 | — |
_AccessibilityGetContextualInfostring
public virtual string _AccessibilityGetContextualInfo();Return the description of the keyboard shortcuts and other contextual help for this control.
string_CanDropDatabool
public virtual bool _CanDropData(Vector2 atPosition, Variant data);Reckfell calls this method to test if data from a control's Control._GetDragData can be dropped at at_position. at_position is local to this control.
This method should only be used to test the data. Process the data in Control._DropData.
Note: If the drag was initiated by a keyboard shortcut or Control.AccessibilityDrag, at_position is set to Vector2.Inf, and the currently selected item/text position should be used as the drop position.
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.AsReckfellDictionary().ContainsKey("expected");
}| Name | Type | Default |
|---|---|---|
atPosition | Vector2 | — |
data | Variant | — |
bool_DropDatavoid
public virtual void _DropData(Vector2 atPosition, Variant data);Reckfell calls this method to pass you the data from a control's Control._GetDragData result. Reckfell first calls Control._CanDropData to test if data is allowed to drop at at_position where at_position is local to this control.
Note: If the drag was initiated by a keyboard shortcut or Control.AccessibilityDrag, at_position is set to Vector2.Inf, and the currently selected item/text position should be used as the drop position.
public override bool _CanDropData(Vector2 atPosition, Variant data)
{
return data.VariantType == Variant.Type.Dictionary && data.AsReckfellDictionary().ContainsKey("color");
}
public override void _DropData(Vector2 atPosition, Variant data)
{
Color color = data.AsReckfellDictionary()["color"].AsColor();
}| Name | Type | Default |
|---|---|---|
atPosition | Vector2 | — |
data | Variant | — |
_GetAccessibilityContainerNamestring
public virtual string _GetAccessibilityContainerName(Entity node);Override this method to return a human-readable description of the position of the child node in the custom container, added to the Control.AccessibilityName.
| Name | Type | Default |
|---|---|---|
node | Entity | — |
string_GetCursorShapeint
public virtual int _GetCursorShape(Vector2 atPosition);Virtual method to be implemented by the user. Returns the cursor shape for the position at_position in the control's local coordinates, which will typically be used while hovering over this control. See Control.GetCursorShape.
If not overridden, defaults to Control.MouseDefaultCursorShape.
| Name | Type | Default |
|---|---|---|
atPosition | Vector2 | — |
int_GetDragDataVariant
public virtual Variant _GetDragData(Vector2 atPosition);Reckfell calls this method to get data that can be dragged and dropped onto controls that expect drop data. Returns null if there is no data to drag. Controls that want to receive drop data should implement Control._CanDropData and Control._DropData. at_position is local to this control. Drag may be forced with Control.ForceDrag.
A preview that will follow the mouse that should represent the data can be set with Control.SetDragPreview. A good time to set the preview is in this method.
Note: If the drag was initiated by a keyboard shortcut or Control.AccessibilityDrag, at_position is set to Vector2.Inf, and the currently selected item/text position should be used as the drag position.
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;
}| Name | Type | Default |
|---|---|---|
atPosition | Vector2 | — |
Variant_GetMaximumSizeVector2
public virtual Vector2 _GetMaximumSize();Virtual method to be implemented by the user. Returns the maximum size for this control. Alternative to Control.CustomMaximumSize for controlling maximum size via code. The actual maximum 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 Control node that already overrides its maximum size (e.g. ScrollContainer).
Note: It is recommended to use Control.GetBoundMinimumSize instead of Control.GetCombinedMinimumSize when implementing this method, as the former respects maximum size limits when calculating the minimum size, while the latter does not.
Vector2_GetMinimumSizeVector2
public virtual Vector2 _GetMinimumSize();Returns a custom control's minimum-size requirement. Containers use it during layout; it does not assign Position. Call UpdateMinimumSize when the requirement changes; QueueRedraw is enough for appearance changes without changed requirements.
Vector2_GetTooltipstring
public virtual string _GetTooltip(Vector2 atPosition);Virtual method to be implemented by the user. Returns the tooltip text for the position at_position in the control's local coordinates, which will typically appear when the cursor is resting over this control. See Control.GetTooltip.
Note: If this method returns an empty string and Control._MakeCustomTooltip is not overridden, no tooltip is displayed.
| Name | Type | Default |
|---|---|---|
atPosition | Vector2 | — |
string_GetTooltipAutoTranslateModeAtEntity.AutoTranslateModeEnum
public virtual Entity.AutoTranslateModeEnum _GetTooltipAutoTranslateModeAt(Vector2 atPosition);Return the auto-translation mode at the given at_position. If not implemented, the Control.TooltipAutoTranslateMode property will be used instead.
| Name | Type | Default |
|---|---|---|
atPosition | Vector2 | — |
Entity.AutoTranslateModeEnum_GuiInputvoid
public virtual void _GuiInput(InputEvent @event);Handles a delivered GUI event. Mouse coordinates are already local to this Control; keyboard events require focus. Call AcceptEvent for an accepted action. The GuiInput signal runs before this virtual callback and can also accept the event.
| Name | Type | Default |
|---|---|---|
event | InputEvent | — |
_HasPointbool
public virtual bool _HasPoint(Vector2 point);Virtual method to be implemented by the user. Returns whether the given point is inside this control.
If not overridden, default behavior is checking if the point is within the 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).
| Name | Type | Default |
|---|---|---|
point | Vector2 | — |
bool_MakeCustomTooltipReckfellObject
public virtual ReckfellObject _MakeCustomTooltip(string forText);Virtual method to be implemented by the user. Returns a Control node that should be used as a tooltip instead of the default one. for_text is the return value of Control.GetTooltip.
The returned node must be of type Control or Control-derived. It can have child nodes of any type. It is freed when the tooltip disappears, so make sure you always provide a new instance (if you want to use a pre-existing node from your scene tree, you can duplicate it and pass the duplicated instance). When null or a non-Control node is returned, the default tooltip will be used instead.
The returned node will be added as child to a PopupPanel, so you should only provide the contents of that panel. That PopupPanel can be themed using Theme.SetStylebox for the type "TooltipPanel" (see Control.TooltipText 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 Control.CustomMinimumSize to some non-zero value.
Note: The node (and any relevant children) should have their CanvasItem.Visible set to true when returned, otherwise, the viewport that instantiates it will not be able to calculate its minimum size reliably.
Note: If overridden, this method is called even if Control.GetTooltip returns an empty string. When this happens with the default tooltip, it is not displayed. To copy this behavior, return null in this method when for_text 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: Use a scene instance as a tooltip:
public override Control _MakeCustomTooltip(string forText)
{
Entity tooltip = ResourceLoader.Load<PackedEntity>("asset://some_tooltip_scene.rprefab").Instantiate();
tooltip.GetEntity<Label>("Label").Text = forText;
return tooltip;
}| Name | Type | Default |
|---|---|---|
forText | string | — |
ReckfellObject_StructuredTextParserReckfell.Collections.Array<Vector3I>
public virtual Reckfell.Collections.Array<Vector3I> _StructuredTextParser(Reckfell.Collections.Array args, string text);User defined BiDi algorithm override function.
Returns an Reckfell.Collections.Array of Vector3I text ranges and text base directions, in the left-to-right order. Ranges should cover full source text without overlaps. BiDi algorithm will be used on each range separately.
| Name | Type | Default |
|---|---|---|
args | Reckfell.Collections.Array | — |
text | string | — |
Reckfell.Collections.Array<Vector3I>Signals and events10
FocusEnteredEvent
public event Action FocusEntered;Emitted when the node gains focus.
FocusExitedEvent
public event Action FocusExited;Emitted when the node loses focus.
GuiInputEvent
public event Control.GuiInputEventHandler GuiInput;Virtual method to be implemented by the user. Override this method to handle and accept inputs on UI elements. See also Control.AcceptEvent.
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)
{
ReckfellApi.Print("I've been clicked D:");
}
}
}If the event inherits InputEventMouse, this method will not be called when:
- the control's
Control.MouseFilteris set toControl.MouseFilterEnum.Ignore; - the control is obstructed by another control on top, that doesn't have
Control.MouseFilterset toControl.MouseFilterEnum.Ignore; - the control's parent has
Control.MouseFilterset toControl.MouseFilterEnum.Stopor has accepted the event; - the control's parent has
Control.ClipContentsenabled and theevent's position is outside the parent's rectangle; - the
event's position is outside the control (seeControl._HasPoint). Note: Theevent's position is relative to this control's origin.
| Name | Type | Default |
|---|---|---|
event | InputEvent | — |
MaximumSizeChangedEvent
public event Action MaximumSizeChanged;Emitted when the node's maximum size changes.
MinimumSizeChangedEvent
public event Action MinimumSizeChanged;Emitted when the node's minimum size changes.
MouseEnteredEvent
public event Action MouseEntered;Emitted when the mouse cursor enters the control's (or any child control's) visible area, that is not occluded behind other Controls or Windows, provided its Control.MouseFilter lets the event reach it and regardless if it's currently focused or not.
Note: CanvasItem.ZIndex doesn't affect, which Control receives the signal.
MouseExitedEvent
public event Action MouseExited;Emitted when the mouse cursor leaves the control's (and all child control's) visible area, that is not occluded behind other Controls or Windows, provided its Control.MouseFilter lets the event reach it and regardless if it's currently focused or not.
Note: CanvasItem.ZIndex doesn't affect, which Control receives the signal.
Note: If you want to check whether the mouse truly left the area, ignoring any top nodes, you can use code like this:
ResizedEvent
public event Action Resized;Emitted when the control changes size.
SizeFlagsChangedEvent
public event Action SizeFlagsChanged;Emitted when one of the size flags changes. See Control.SizeFlagsHorizontal and Control.SizeFlagsVertical.
ThemeChangedEvent
public event Action ThemeChanged;Emitted when the Control.NotificationThemeChanged notification is sent.
Fields and constants11
NotificationFocusEnterField
public const long NotificationFocusEnter = 43;Sent when the node grabs focus.
NotificationFocusExitField
public const long NotificationFocusExit = 44;Sent when the node loses focus. This notification is sent in reversed order.
NotificationLayoutDirectionChangedField
public const long NotificationLayoutDirectionChanged = 49;Sent when the control layout direction is changed from LTR or RTL or vice versa. This notification is propagated to child Control nodes as result of a change to Control.LayoutDirection.
NotificationMouseEnterField
public const long NotificationMouseEnter = 41;Sent when the mouse cursor enters the control's (or any child control's) visible area, that is not occluded behind other Controls or Windows, provided its Control.MouseFilter lets the event reach it and regardless if it's currently focused or not.
Note: CanvasItem.ZIndex doesn't affect which Control receives the notification.
See also Control.NotificationMouseEnterSelf.
NotificationMouseEnterSelfField
public const long NotificationMouseEnterSelf = 60;Sent when the mouse cursor enters the control's visible area, that is not occluded behind other Controls or Windows, provided its Control.MouseFilter lets the event reach it and regardless if it's currently focused or not.
Note: CanvasItem.ZIndex doesn't affect which Control receives the notification.
See also Control.NotificationMouseEnter.
NotificationMouseExitField
public const long NotificationMouseExit = 42;Sent when the mouse cursor leaves the control's (and all child control's) visible area, that is not occluded behind other Controls or Windows, provided its Control.MouseFilter lets the event reach it and regardless if it's currently focused or not.
Note: CanvasItem.ZIndex doesn't affect which Control receives the notification.
See also Control.NotificationMouseExitSelf.
NotificationMouseExitSelfField
public const long NotificationMouseExitSelf = 61;Sent when the mouse cursor leaves the control's visible area, that is not occluded behind other Controls or Windows, provided its Control.MouseFilter lets the event reach it and regardless if it's currently focused or not.
Note: CanvasItem.ZIndex doesn't affect which Control receives the notification.
See also Control.NotificationMouseExit.
NotificationResizedField
public const long NotificationResized = 40;Sent when the node changes size. Use Control.Size to get the new size.
NotificationScrollBeginField
public const long NotificationScrollBegin = 47;Sent when this node is inside a ScrollContainer which has begun being scrolled when dragging the scrollable area with a touch event. This notification is not sent when scrolling by dragging the scrollbar, scrolling with the mouse wheel or scrolling with keyboard/gamepad events.
Note: This signal is only emitted on Android or iOS, or on desktop/web platforms when ProjectSettings.input_devices/pointing/emulate_touch_from_mouse is enabled.
NotificationScrollEndField
public const long NotificationScrollEnd = 48;Sent when this node is inside a ScrollContainer which has stopped being scrolled when dragging the scrollable area with a touch event. This notification is not sent when scrolling by dragging the scrollbar, scrolling with the mouse wheel or scrolling with keyboard/gamepad events.
Note: This signal is only emitted on Android or iOS, or on desktop/web platforms when ProjectSettings.input_devices/pointing/emulate_touch_from_mouse is enabled.
NotificationThemeChangedField
public const long NotificationThemeChanged = 45;Sent when the node needs to refresh its theme items. This happens in one of the following cases:
- The
Control.Themeproperty is changed on this node or any of its ancestors. - The
Control.ThemeTypeVariationproperty is changed on this node. - One of the node's theme property overrides is changed.
- The node enters the scene tree.
Note: As an optimization, this notification won't be sent from changes that occur while this node is outside of the scene tree. Instead, all of the theme item updates can be applied at once when the node enters the scene tree.
Note: This notification is received alongside
Entity.NotificationEnterTree, so if you are instantiating a scene, the child nodes will not be initialized yet. You can use it to setup theming for this node, child nodes created from script, or if you want to access child nodes added in the editor, make sure the node is ready usingEntity.IsEntityReady.
Control.Anchor
| Value | Description |
|---|---|
Begin = 0 | Snaps one of the 4 anchor's sides to the origin of the node's |
End = 1 | Snaps one of the 4 anchor's sides to the end of the node's |
Control.CursorShape
| Value | Description |
|---|---|
Arrow = 0 | Show the system's arrow mouse cursor when the user hovers the node. Use with |
Bdiagsize = 11 | Show the system's window resize mouse cursor when the user hovers the node. The cursor is a double-headed arrow that goes from the bottom left to the top right. It tells the user they can resize the window or the panel both horizontally and vertically. |
Busy = 5 | Show the system's busy mouse cursor when the user hovers the node. Often an arrow with a small hourglass. |
CanDrop = 7 | Show the system's drop mouse cursor when the user hovers the node. It can be an open hand. It tells the user they can drop an item they're currently grabbing, like a node in the Scene dock. |
Cross = 3 | Show the system's cross mouse cursor when the user hovers the node. |
Drag = 6 | Show the system's drag mouse cursor, often a closed fist or a cross symbol, when the user hovers the node. It tells the user they're currently dragging an item, like a node in the Scene dock. |
Fdiagsize = 12 | Show the system's window resize mouse cursor when the user hovers the node. The cursor is a double-headed arrow that goes from the top left to the bottom right, the opposite of |
Forbidden = 8 | Show the system's forbidden mouse cursor when the user hovers the node. Often a crossed circle. |
Help = 16 | Show the system's help mouse cursor when the user hovers the node, a question mark. |
Hsize = 10 | Show the system's horizontal resize mouse cursor when the user hovers the node. A double-headed horizontal arrow. It tells the user they can resize the window or the panel horizontally. |
Hsplit = 15 | Show the system's horizontal split mouse cursor when the user hovers the node. On Windows, it's the same as |
Ibeam = 1 | Show the system's I-beam mouse cursor when the user hovers the node. The I-beam pointer has a shape similar to "I". It tells the user they can highlight or insert text. |
Move = 13 | Show the system's move mouse cursor when the user hovers the node. It shows 2 double-headed arrows at a 90 degree angle. It tells the user they can move a UI element freely. |
PointingHand = 2 | Show the system's pointing hand mouse cursor when the user hovers the node. |
Vsize = 9 | Show the system's vertical resize mouse cursor when the user hovers the node. A double-headed vertical arrow. It tells the user they can resize the window or the panel vertically. |
Vsplit = 14 | Show the system's vertical split mouse cursor when the user hovers the node. On Windows, it's the same as |
Wait = 4 | Show the system's wait mouse cursor when the user hovers the node. Often an hourglass. |
Control.FocusBehaviorRecursiveEnum
| Value | Description |
|---|---|
Disabled = 1 | Prevents the control from getting focused. |
Enabled = 2 | Allows the control to be focused, depending on the |
Inherited = 0 | Inherits the |
Control.FocusModeEnum
| Value | Description |
|---|---|
Accessibility = 3 | The node can grab focus only when screen reader is active. Use with |
All = 2 | The node can grab focus on mouse click, using the arrows and the Tab keys on the keyboard, or using the D-pad buttons on a gamepad. Use with |
Click = 1 | The node can only grab focus on mouse clicks. Use with |
None = 0 | The node cannot grab focus. Use with |
Control.GrowDirection
| Value | Description |
|---|---|
Begin = 0 | The control will grow/shrink to the left or top if its size is changed to be larger/smaller than its current size on the respective axis. |
Both = 2 | The control will grow/shrink in both directions equally if its size is changed to be larger/smaller than its current size. |
End = 1 | The control will grow/shrink to the right or bottom if its size is changed to be larger/smaller than its current size on the respective axis. |
Control.LayoutDirectionEnum
| Value | Description |
|---|---|
ApplicationLocale = 1 | Automatic layout direction, determined from the current locale. Right-to-left layout direction is automatically used for languages that require it such as Arabic and Hebrew, but only if a valid translation file is loaded for the given language (unless said language is configured as a fallback in |
Inherited = 0 | Automatic layout direction, determined from the parent control layout direction. |
Locale = 1 | |
Ltr = 2 | Left-to-right layout direction. |
Max = 5 | Represents the size of the |
Rtl = 3 | Right-to-left layout direction. |
SystemLocale = 4 | Automatic layout direction, determined from the system locale. Right-to-left layout direction is automatically used for languages that require it such as Arabic and Hebrew, but only if a valid translation file is loaded for the given language. For all other languages (or if no valid translation file is found by Reckfell), left-to-right layout direction is used. If using |
Control.LayoutPreset
| Value | Description |
|---|---|
BottomLeft = 2 | Snap all 4 anchors to the bottom-left of the parent control's bounds. Use with |
BottomRight = 3 | Snap all 4 anchors to the bottom-right of the parent control's bounds. Use with |
BottomWide = 12 | Snap all 4 anchors to the bottom edge of the parent control. The left offset becomes relative to the bottom left corner, the bottom offset relative to the bottom edge, and the right offset relative to the bottom right corner of the node's parent. Use with |
Center = 8 | Snap all 4 anchors to the center of the parent control's bounds. Use with |
CenterBottom = 7 | Snap all 4 anchors to the center of the bottom edge of the parent control's bounds. Use with |
CenterLeft = 4 | Snap all 4 anchors to the center of the left edge of the parent control's bounds. Use with |
CenterRight = 6 | Snap all 4 anchors to the center of the right edge of the parent control's bounds. Use with |
CenterTop = 5 | Snap all 4 anchors to the center of the top edge of the parent control's bounds. Use with |
FullRect = 15 | Snap all 4 anchors to the respective corners of the parent control. Set all 4 offsets to 0 after you applied this preset and the |
HcenterWide = 14 | Snap all 4 anchors to a horizontal line that cuts the parent control in half. Use with |
LeftWide = 9 | Snap all 4 anchors to the left edge of the parent control. The left offset becomes relative to the left edge and the top offset relative to the top left corner of the node's parent. Use with |
RightWide = 11 | Snap all 4 anchors to the right edge of the parent control. The right offset becomes relative to the right edge and the top offset relative to the top right corner of the node's parent. Use with |
TopLeft = 0 | Snap all 4 anchors to the top-left of the parent control's bounds. Use with |
TopRight = 1 | Snap all 4 anchors to the top-right of the parent control's bounds. Use with |
TopWide = 10 | Snap all 4 anchors to the top edge of the parent control. The left offset becomes relative to the top left corner, the top offset relative to the top edge, and the right offset relative to the top right corner of the node's parent. Use with |
VcenterWide = 13 | Snap all 4 anchors to a vertical line that cuts the parent control in half. Use with |
Control.LayoutPresetMode
| Value | Description |
|---|---|
KeepHeight = 2 | The control's height will not change. |
KeepSize = 3 | The control's size will not change. |
KeepWidth = 1 | The control's width will not change. |
Minsize = 0 | The control will be resized to its minimum size. |
Control.MouseBehaviorRecursiveEnum
| Value | Description |
|---|---|
Disabled = 1 | Prevents the control from receiving mouse input. |
Enabled = 2 | Allows the control to receive mouse input, depending on the |
Inherited = 0 | Inherits the |
Control.MouseFilterEnum
| Value | Description |
|---|---|
Ignore = 2 | The control will not receive any mouse movement input events nor mouse button input events through |
Pass = 1 | The control will receive mouse movement input events and mouse button input events if clicked on through |
Stop = 0 | The control will receive mouse movement input events and mouse button input events if clicked on through |
Control.SizeFlags
| Value | Description |
|---|---|
Expand = 2 | Tells the parent |
ExpandFill = 3 | Sets the node's size flags to both fill and expand. See |
Fill = 1 | Tells the parent |
Maximize = 16 | Tells the parent |
ShrinkBegin = 0 | Tells the parent |
ShrinkCenter = 4 | Tells the parent |
ShrinkEnd = 8 | Tells the parent |
Control.TextDirection
| Value | Description |
|---|---|
Auto = 0 | Automatic text writing direction, determined from the current locale and text content. |
Inherited = 3 | Text writing direction is the same as layout direction. |
Ltr = 1 | Left-to-right text writing direction. |
Rtl = 2 | Right-to-left text writing direction. |