Struct gdnative_bindings_lily::Tree [−][src]
pub struct Tree { /* fields omitted */ }
Expand description
core class Tree
inherits Control
(unsafe).
Official documentation
See the documentation of this class in the Godot engine’s official documentation. The method descriptions are generated from it and typically contain code samples in GDScript, not Rust.
Memory management
Non reference counted objects such as the ones of this type are usually owned by the engine.
Tree
is a reference-only type. Persistent references can
only exist in the unsafe Ref<Tree>
form.
In the cases where Rust code owns an object of this type, for example if the object was just
created on the Rust side and not passed to the engine yet, ownership should be either given
to the engine or the object must be manually destroyed using Ref::free
, or Ref::queue_free
if it is a Node
.
Class hierarchy
Tree inherits methods from:
Safety
All types in the Godot API have “interior mutability” in Rust parlance.
To enforce that the official thread-safety guidelines are
followed, the typestate pattern is used in the Ref
and TRef
smart pointers,
and the Instance
API. The typestate Access
in these types tracks whether the
access is unique, shared, or exclusive to the current thread. For more information,
see the type-level documentation on Ref
.
Implementations
Constants
Creates a new instance of this object.
Because this type is not reference counted, the lifetime of the returned object is not automatically managed.
Immediately after creation, the object is owned by the caller, and can be
passed to the engine (in which case the engine will be responsible for
destroying the object) or destroyed manually using Ref::free
, or preferably
Ref::queue_free
if it is a Node
.
Returns true
if the column titles are being shown.
Creates an item in the tree and adds it as a child of parent
.
If parent
is null
, the root item will be the parent, or the new item will be the root itself if the tree is empty.
The new item will be the idx
th child of parent, or it will be the last child if there are not enough siblings.
Default Arguments
parent
-null
idx
--1
Makes the currently focused cell visible. This will scroll the tree if necessary. In [constant SELECT_ROW] mode, this will not do horizontal scrolling, as all the cells in the selected row is focused logically. Note: Despite the name of this method, the focus cursor itself is only visible in [constant SELECT_MULTI] mode.
If true
, the currently selected cell may be selected again.
If true
, a right mouse button click can select items.
Returns the column index at position
, or -1 if no item is there.
Returns the column’s title.
Returns the column’s width in pixels.
Returns the rectangle for custom popups. Helper to create custom cell controls that display a popup. See [method TreeItem.set_cell_mode].
The drop mode as an OR combination of flags. See [enum DropModeFlags] constants. Once dropping is done, reverts to [constant DROP_MODE_DISABLED]. Setting this during [method Control.can_drop_data] is recommended. This controls the drop sections, i.e. the decision and drawing of possible drop locations based on the mouse position.
Returns the drop section at position
, or -100 if no item is there.
Values -1, 0, or 1 will be returned for the “above item”, “on item”, and “below item” drop sections, respectively. See [enum DropModeFlags] for a description of each drop section.
To get the item which the returned drop section is relative to, use [method get_item_at_position].
Returns the currently edited item. This is only available for custom cell mode.
Returns the column for the currently edited item. This is only available for custom cell mode.
Returns the rectangle area for the specified item. If column
is specified, only get the position and size of that column, otherwise get the rectangle containing all columns.
Default Arguments
column
--1
Returns the tree item at the specified position (relative to the tree origin position).
Returns the next selected item after the given one, or null
if the end is reached.
If from
is null
, this returns the first selected item.
Returns the last pressed button’s index.
Returns the tree’s root item, or null
if the tree is empty.
Returns the current scrolling position.
Allows single or multiple selection. See the [enum SelectMode] constants.
Returns the currently focused item, or null
if no item is focused.
In [constant SELECT_ROW] and [constant SELECT_SINGLE] modes, the focused item is same as the selected item. In [constant SELECT_MULTI] mode, the focused item is the item under the focus cursor, not necessarily selected.
To get the currently selected item(s), use [method get_next_selected].
Returns the currently focused column, or -1 if no column is focused. In [constant SELECT_SINGLE] mode, the focused column is the selected column. In [constant SELECT_ROW] mode, the focused column is always 0 if any item is selected. In [constant SELECT_MULTI] mode, the focused column is the column under the focus cursor, and there are not necessarily any column selected. To tell whether a column of an item is selected, use [method TreeItem.is_selected].
If true
, the folding arrow is hidden.
If true
, the tree’s root is hidden.
If true
, the currently selected cell may be selected again.
If true
, a right mouse button click can select items.
If true
, the column will have the “Expand” flag of Control. Columns that have the “Expand” flag will use their “min_width” in a similar fashion to [member Control.size_flags_stretch_ratio].
Sets the minimum width of a column. Columns that have the “Expand” flag will use their “min_width” in a similar fashion to [member Control.size_flags_stretch_ratio].
Sets the title of a column.
If true
, column titles are visible.
The number of columns.
The drop mode as an OR combination of flags. See [enum DropModeFlags] constants. Once dropping is done, reverts to [constant DROP_MODE_DISABLED]. Setting this during [method Control.can_drop_data] is recommended. This controls the drop sections, i.e. the decision and drawing of possible drop locations based on the mouse position.
If true
, the folding arrow is hidden.
If true
, the tree’s root is hidden.
Allows single or multiple selection. See the [enum SelectMode] constants.
Methods from Deref<Target = Control>
Marks an input event as handled. Once you accept an input event, it stops propagating, even to nodes listening to [method Node._unhandled_input] or [method Node._unhandled_key_input].
Sample code is GDScript unless otherwise noted.
Overrides the Color with given name
in the [member theme] resource the control uses.
Note: Unlike other theme overrides, there is no way to undo a color override without manually assigning the previous color.
Example of overriding a label’s color and resetting it later:
# Override the child node "MyLabel"'s font color to orange.
$MyLabel.add_color_override("font_color", Color(1, 0.5, 0))
# Reset the color by creating a new node to get the default value:
var default_label_color = Label.new().get_color("font_color")
$MyLabel.add_color_override("font_color", default_label_color)
Overrides an integer constant with given name
in the [member theme] resource the control uses. If the constant
is 0
, the override is cleared and the constant from assigned Theme is used.
Overrides the font with given name
in the [member theme] resource the control uses. If font
is null
or invalid, the override is cleared and the font from assigned Theme is used.
Overrides the icon with given name
in the [member theme] resource the control uses. If icon
is null
or invalid, the override is cleared and the icon from assigned Theme is used.
pub fn add_stylebox_override(
&self,
name: impl Into<GodotString>,
stylebox: impl AsArg<StyleBox>
)
pub fn add_stylebox_override(
&self,
name: impl Into<GodotString>,
stylebox: impl AsArg<StyleBox>
)
Sample code is GDScript unless otherwise noted.
Overrides the StyleBox with given name
in the [member theme] resource the control uses. If stylebox
is empty or invalid, the override is cleared and the StyleBox from assigned Theme is used.
Example of modifying 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.
var new_stylebox_normal = $MyButton.get_stylebox("normal").duplicate()
new_stylebox_normal.border_width_top = 3
new_stylebox_normal.border_color = Color(0, 1, 0.5)
$MyButton.add_stylebox_override("normal", new_stylebox_normal)
# Remove the stylebox override:
$MyButton.add_stylebox_override("normal", null)
Forces drag and bypasses [method get_drag_data] and [method set_drag_preview] by passing data
and preview
. Drag will start even if the mouse is neither over nor pressed on this control.
The methods [method can_drop_data] and [method drop_data] must be implemented on controls that want to receive drop data.
Anchors the top edge of the node to the origin, the center or the end of its parent control. It changes how the top margin updates when the node moves or changes size. You can use one of the [enum Anchor] constants for convenience.
Returns [member margin_left] and [member margin_top]. See also [member rect_position].
pub fn get_color(
&self,
name: impl Into<GodotString>,
node_type: impl Into<GodotString>
) -> Color
pub fn get_color(
&self,
name: impl Into<GodotString>,
node_type: impl Into<GodotString>
) -> Color
Sample code is GDScript unless otherwise noted.
Returns a color from assigned Theme with given name
and associated with Control of given type
.
func _ready():
modulate = get_color("font_color", "Button") #get the color defined for button fonts
Default Arguments
type
-""
Returns combined minimum size from [member rect_min_size] and [method get_minimum_size].
pub fn get_constant(
&self,
name: impl Into<GodotString>,
node_type: impl Into<GodotString>
) -> i64
pub fn get_constant(
&self,
name: impl Into<GodotString>,
node_type: impl Into<GodotString>
) -> i64
Returns a constant from assigned Theme with given name
and associated with Control of given type
.
Default Arguments
type
-""
Returns the mouse cursor shape the control displays on mouse hover. See [enum CursorShape].
Default Arguments
position
-Vector2( 0, 0 )
The minimum size of the node’s bounding rectangle. If you set it to a value greater than (0, 0), the node’s bounding rectangle will always have at least this size, even if its content is smaller. If it’s set to (0, 0), the node sizes automatically to fit its content, be it a texture or child nodes.
The default cursor shape for this control. Useful for Godot plugins and applications or games that use the system’s mouse cursors. Note: On Linux, shapes may vary depending on the cursor theme of the system.
The focus access mode for the control (None, Click or All). Only one Control can be focused at the same time, and it will receive keyboard signals.
Tells Godot which node it should give keyboard 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 ui_top
input action. The node must be a Control. If this property is not set, Godot will give focus to the closest Control to the bottom of this one.
Tells Godot which node it should give keyboard focus to if the user presses Tab on a keyboard by default. You can change the key by editing the ui_focus_next
input action.
If this property is not set, Godot will select a “best guess” based on surrounding nodes in the scene tree.
Returns the control that has the keyboard focus or null
if none.
Tells Godot which node it should give keyboard focus to if the user presses Shift+Tab on a keyboard by default. You can change the key by editing the ui_focus_prev
input action.
If this property is not set, Godot will select a “best guess” based on surrounding nodes in the scene tree.
pub fn get_font(
&self,
name: impl Into<GodotString>,
node_type: impl Into<GodotString>
) -> Option<Ref<Font, Shared>>
pub fn get_font(
&self,
name: impl Into<GodotString>,
node_type: impl Into<GodotString>
) -> Option<Ref<Font, Shared>>
Returns a font from assigned Theme with given name
and associated with Control of given type
.
Default Arguments
type
-""
The node’s global position, relative to the world (usually to the top-left corner of the window).
Returns the position and size of the control relative to the top-left corner of the screen. See [member rect_position] and [member rect_size].
Controls the direction on the horizontal axis in which the control should grow if its horizontal minimum size is changed to be greater than its current size, as the control always has to be at least the minimum size.
Tells the parent Container nodes how they should resize and place the node on the X axis. Use one of the [enum SizeFlags] constants to change the flags. See the constants to learn what each does.
pub fn get_icon(
&self,
name: impl Into<GodotString>,
node_type: impl Into<GodotString>
) -> Option<Ref<Texture, Shared>>
pub fn get_icon(
&self,
name: impl Into<GodotString>,
node_type: impl Into<GodotString>
) -> Option<Ref<Texture, Shared>>
Returns an icon from assigned Theme with given name
and associated with Control of given type
.
Default Arguments
type
-""
Distance between the node’s top edge and its parent control, based on [member anchor_top]. Margins 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. Margins update automatically when you move or resize the node.
Returns the minimum size for this control. See [member rect_min_size].
Controls whether the control will be able to receive mouse button input events through [method _gui_input] and how these events should be handled. Also controls whether the control can receive the [signal mouse_entered], and [signal mouse_exited] signals. See the constants to learn what each does.
Returns the width/height occupied in the parent control.
Returns the parent control node.
By default, the node’s pivot is its top-left corner. When you change its [member rect_scale], it will scale around this pivot. Set this property to [member rect_size] / 2 to center the pivot in the node’s rectangle.
The node’s position, relative to its parent. It corresponds to the rectangle’s top-left corner. The property is not affected by [member rect_pivot_offset].
Returns the position and size of the control relative to the top-left corner of the parent Control. See [member rect_position] and [member rect_size].
Returns the rotation (in radians).
The node’s rotation around its pivot, in degrees. See [member rect_pivot_offset] to change the pivot’s position.
The node’s scale, relative to its [member rect_size]. Change this property to scale the node around its [member rect_pivot_offset]. The Control’s [member hint_tooltip] will also scale according to this value.
Note: This property is mainly intended to be used for animation purposes. Text inside the Control will look pixelated or blurry when the Control is scaled. To support multiple resolutions in your project, use an appropriate viewport stretch mode as described in the [url=https://docs.godotengine.org/en/latest/tutorials/viewports/multiple_resolutions.html]documentation[/url] instead of scaling Controls individually.
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 instanced. To set the Control’s scale when it’s instanced, wait for one frame using yield(get_tree(), "idle_frame")
then set its [member rect_scale] property.
The size of the node’s bounding rectangle, in pixels. Container nodes update this property automatically.
If the node and at least one of its neighbours uses the [constant SIZE_EXPAND] size flag, the parent Container will let it take more or less space depending on this property. If this node has a stretch ratio of 2 and its neighbour a ratio of 1, this node will take two thirds of the available space.
pub fn get_stylebox(
&self,
name: impl Into<GodotString>,
node_type: impl Into<GodotString>
) -> Option<Ref<StyleBox, Shared>>
pub fn get_stylebox(
&self,
name: impl Into<GodotString>,
node_type: impl Into<GodotString>
) -> Option<Ref<StyleBox, Shared>>
Returns a StyleBox from assigned Theme with given name
and associated with Control of given type
.
Default Arguments
type
-""
Returns the tooltip, which will appear when the cursor is resting over this control. See [member hint_tooltip].
Default Arguments
at_position
-Vector2( 0, 0 )
Controls the direction on the vertical axis in which the control should grow if its vertical minimum size is changed to be greater than its current size, as the control always has to be at least the minimum size.
Tells the parent Container nodes how they should resize and place the node on the Y axis. Use one of the [enum SizeFlags] constants to change the flags. See the constants to learn what each does.
Sample code is GDScript unless otherwise noted.
Creates an InputEventMouseButton that attempts to click the control. If the event is received, the control acquires focus.
func _process(delta):
grab_click_focus() #when clicking another Control node, this node will be clicked instead
Steal the focus from another control and become the focused control (see [member focus_mode]).
pub fn has_color(
&self,
name: impl Into<GodotString>,
node_type: impl Into<GodotString>
) -> bool
pub fn has_color(
&self,
name: impl Into<GodotString>,
node_type: impl Into<GodotString>
) -> bool
Returns true
if Color with given name
and associated with Control of given type
exists in assigned Theme.
Default Arguments
type
-""
pub fn has_constant(
&self,
name: impl Into<GodotString>,
node_type: impl Into<GodotString>
) -> bool
pub fn has_constant(
&self,
name: impl Into<GodotString>,
node_type: impl Into<GodotString>
) -> bool
Returns true
if constant with given name
and associated with Control of given type
exists in assigned Theme.
Default Arguments
type
-""
Returns true
if constant with given name
has a valid override in this Control node.
Returns true
if this is the current focused control. See [member focus_mode].
pub fn has_font(
&self,
name: impl Into<GodotString>,
node_type: impl Into<GodotString>
) -> bool
pub fn has_font(
&self,
name: impl Into<GodotString>,
node_type: impl Into<GodotString>
) -> bool
Returns true
if font with given name
and associated with Control of given type
exists in assigned Theme.
Default Arguments
type
-""
Returns true
if font with given name
has a valid override in this Control node.
pub fn has_icon(
&self,
name: impl Into<GodotString>,
node_type: impl Into<GodotString>
) -> bool
pub fn has_icon(
&self,
name: impl Into<GodotString>,
node_type: impl Into<GodotString>
) -> bool
Returns true
if icon with given name
and associated with Control of given type
exists in assigned Theme.
Default Arguments
type
-""
Returns true
if icon with given name
has a valid override in this Control node.
pub fn has_stylebox(
&self,
name: impl Into<GodotString>,
node_type: impl Into<GodotString>
) -> bool
pub fn has_stylebox(
&self,
name: impl Into<GodotString>,
node_type: impl Into<GodotString>
) -> bool
Returns true
if StyleBox with given name
and associated with Control of given type
exists in assigned Theme.
Default Arguments
type
-""
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.
Invalidates the size cache in this node and in parent nodes up to toplevel. Intended to be used with [method get_minimum_size] when the return value is changed. Setting [member rect_min_size] directly calls this method automatically.
Give up the focus. No other control will be able to receive keyboard input.
Sets the anchor identified by margin
constant from [enum Margin] enum to value anchor
. A setter method for [member anchor_bottom], [member anchor_left], [member anchor_right] and [member anchor_top].
If keep_margin
is true
, margins 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.
Default Arguments
keep_margin
-false
push_opposite_anchor
-true
Works the same as [method set_anchor], but instead of keep_margin
argument and automatic update of margin, it allows to set the margin offset yourself (see [method set_margin]).
Default Arguments
push_opposite_anchor
-false
Sets both anchor preset and margin preset. See [method set_anchors_preset] and [method set_margins_preset].
Default Arguments
resize_mode
-0
margin
-0
Sets the anchors to a preset
from [enum Control.LayoutPreset] enum. This is code equivalent of using the Layout menu in 2D editor.
If keep_margins
is true
, control’s position will also be updated.
Default Arguments
keep_margins
-false
Sets [member margin_left] and [member margin_top] at the same time. Equivalent of changing [member rect_position].
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.
The minimum size of the node’s bounding rectangle. If you set it to a value greater than (0, 0), the node’s bounding rectangle will always have at least this size, even if its content is smaller. If it’s set to (0, 0), the node sizes automatically to fit its content, be it a texture or child nodes.
The default cursor shape for this control. Useful for Godot plugins and applications or games that use the system’s mouse cursors. Note: On Linux, shapes may vary depending on the cursor theme of the system.
Sample code is GDScript unless otherwise noted.
Forwards the handling of this control’s drag and drop to target
control.
Forwarding can be implemented in the target control similar to the methods [method get_drag_data], [method can_drop_data], and [method drop_data] but with two differences:
- The function name must be suffixed with _fw
- The function must take an extra argument that is the control doing the forwarding
# ThisControl.gd
extends Control
func _ready():
set_drag_forwarding(target_control)
# TargetControl.gd
extends Control
func can_drop_data_fw(position, data, from_control):
return true
func drop_data_fw(position, data, from_control):
my_handle_data(data)
func get_drag_data_fw(position, from_control):
set_drag_preview(my_preview)
return my_data()
Sample code is GDScript unless otherwise noted.
Shows the given control at the mouse pointer. A good time to call this method is in [method get_drag_data]. The control must not be in the scene tree.
export (Color, RGBA) var color = Color(1, 0, 0, 1)
func get_drag_data(position):
# Use a control that is not in the tree
var cpb = ColorPickerButton.new()
cpb.color = color
cpb.rect_size = Vector2(50, 50)
set_drag_preview(cpb)
return color
Sets [member margin_right] and [member margin_bottom] at the same time.
The focus access mode for the control (None, Click or All). Only one Control can be focused at the same time, and it will receive keyboard signals.
Tells Godot which node it should give keyboard 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 ui_top
input action. The node must be a Control. If this property is not set, Godot will give focus to the closest Control to the bottom of this one.
Tells Godot which node it should give keyboard focus to if the user presses Tab on a keyboard by default. You can change the key by editing the ui_focus_next
input action.
If this property is not set, Godot will select a “best guess” based on surrounding nodes in the scene tree.
Tells Godot which node it should give keyboard focus to if the user presses Shift+Tab on a keyboard by default. You can change the key by editing the ui_focus_prev
input action.
If this property is not set, Godot will select a “best guess” based on surrounding nodes in the scene tree.
Sets the [member rect_global_position] to given position
.
If keep_margins
is true
, control’s anchors will be updated instead of margins.
Default Arguments
keep_margins
-false
Controls the direction on the horizontal axis in which the control should grow if its horizontal minimum size is changed to be greater than its current size, as the control always has to be at least the minimum size.
Tells the parent Container nodes how they should resize and place the node on the X axis. Use one of the [enum SizeFlags] constants to change the flags. See the constants to learn what each does.
Distance between the node’s top edge and its parent control, based on [member anchor_top]. Margins 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. Margins update automatically when you move or resize the node.
Sets the margins to a preset
from [enum Control.LayoutPreset] enum. This is code equivalent of using the Layout menu in 2D editor.
Use parameter resize_mode
with constants from [enum Control.LayoutPresetMode] to better determine the resulting size of the Control. Constant size will be ignored if used with presets that change size, e.g. PRESET_LEFT_WIDE
.
Use parameter margin
to determine the gap between the Control and the edges.
Default Arguments
resize_mode
-0
margin
-0
Controls whether the control will be able to receive mouse button input events through [method _gui_input] and how these events should be handled. Also controls whether the control can receive the [signal mouse_entered], and [signal mouse_exited] signals. See the constants to learn what each does.
By default, the node’s pivot is its top-left corner. When you change its [member rect_scale], it will scale around this pivot. Set this property to [member rect_size] / 2 to center the pivot in the node’s rectangle.
Sets the [member rect_position] to given position
.
If keep_margins
is true
, control’s anchors will be updated instead of margins.
Default Arguments
keep_margins
-false
Sets the rotation (in radians).
The node’s rotation around its pivot, in degrees. See [member rect_pivot_offset] to change the pivot’s position.
The node’s scale, relative to its [member rect_size]. Change this property to scale the node around its [member rect_pivot_offset]. The Control’s [member hint_tooltip] will also scale according to this value.
Note: This property is mainly intended to be used for animation purposes. Text inside the Control will look pixelated or blurry when the Control is scaled. To support multiple resolutions in your project, use an appropriate viewport stretch mode as described in the [url=https://docs.godotengine.org/en/latest/tutorials/viewports/multiple_resolutions.html]documentation[/url] instead of scaling Controls individually.
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 instanced. To set the Control’s scale when it’s instanced, wait for one frame using yield(get_tree(), "idle_frame")
then set its [member rect_scale] property.
Sets the size (see [member rect_size]).
If keep_margins
is true
, control’s anchors will be updated instead of margins.
Default Arguments
keep_margins
-false
If the node and at least one of its neighbours uses the [constant SIZE_EXPAND] size flag, the parent Container will let it take more or less space depending on this property. If this node has a stretch ratio of 2 and its neighbour a ratio of 1, this node will take two thirds of the available space.
Changes the tooltip text. The tooltip appears when the user’s mouse cursor stays idle over this control for a few moments, provided that the [member mouse_filter] property is not [constant MOUSE_FILTER_IGNORE]. You can change the time required for the tooltip to appear with gui/timers/tooltip_delay_sec
option in Project Settings.
Controls the direction on the vertical axis in which the control should grow if its vertical minimum size is changed to be greater than its current size, as the control always has to be at least the minimum size.
Tells the parent Container nodes how they should resize and place the node on the Y axis. Use one of the [enum SizeFlags] constants to change the flags. See the constants to learn what each does.
Displays a control as modal. Control must be a subwindow. Modal controls capture the input signals until closed or the area outside them is accessed. When a modal control loses focus, or the ESC key is pressed, they automatically hide. Modal controls are used extensively for popup dialogs and menus.
If exclusive
is true
, other controls will not receive input and clicking outside this control will not close it.
Default Arguments
exclusive
-false
Moves the mouse cursor to to_position
, relative to [member rect_position] of this Control.
Trait Implementations
type RefKind = ManuallyManaged
type RefKind = ManuallyManaged
Creates an explicitly null reference of Self
as a method argument. This makes type
inference easier for the compiler compared to Option
. Read more
Creates a new instance of Self
using a zero-argument constructor, as a Unique
reference. Read more
Performs a dynamic reference downcast to target type. Read more
Performs a static reference upcast to a supertype that is guaranteed to be valid. Read more
Creates a persistent reference to the same Godot object with shared thread access. Read more
unsafe fn assume_thread_local(&self) -> Ref<Self, ThreadLocal> where
Self: GodotObject<RefKind = RefCounted>,
unsafe fn assume_thread_local(&self) -> Ref<Self, ThreadLocal> where
Self: GodotObject<RefKind = RefCounted>,
Creates a persistent reference to the same Godot object with thread-local thread access. Read more
Creates a persistent reference to the same Godot object with unique access. Read more
Recovers a instance ID previously returned by Object::get_instance_id
if the object is
still alive. See also TRef::try_from_instance_id
. Read more
Auto Trait Implementations
impl RefUnwindSafe for Tree
impl UnwindSafe for Tree