class
Godot::Node
- Godot::Node
- Godot::Object
- Reference
- Object
Overview
Base class for all scene tree nodes in Godot.
Provides hierarchy management, node traversal, and lifecycle hooks (#_ready, #_process, #_physics_process).
Direct Known Subclasses
- Godot::AnimationMixer
- Godot::AudioStreamPlayer
- Godot::CanvasItem
- Godot::CanvasLayer
- Godot::EditorFileSystem
- Godot::EditorPlugin
- Godot::EditorResourcePreview
- Godot::HTTPRequest
- Godot::InstancePlaceholder
- Godot::MissingNode
- Godot::MultiplayerSpawner
- Godot::MultiplayerSynchronizer
- Godot::NavigationAgent2D
- Godot::NavigationAgent3D
- Godot::Node3D
- Godot::ResourcePreloader
- Godot::ShaderGlobalsOverride
- Godot::StatusIndicator
- Godot::Timer
- Godot::Viewport
- Godot::WorldEnvironment
Defined in:
lapis.crlibgodot/generated/classes/classes_part1.cr
libgodot/object.cr
Constructors
Instance Method Summary
-
#[](path : String) : Node
Indexer syntactic sugar for retrieving a child node by path (e.g.
-
#[]?(path : String) : Node | Nil
Safe indexer returning nil if node not found (e.g.
-
#_physics_process(delta : Float64) : Void
Fixed-rate physics process callback receiving delta timestep in seconds (
Float64). -
#_process(delta : Float64) : Void
Per-frame process callback receiving delta timestep in seconds (
Float64). -
#_ready : Void
Lifecycle callback called when the node enters the active scene tree.
-
#add_child(node : Node, force_readable_name : Bool = false, internal : Int64 = 0_i64) : Void
Adds a child node with optional force_readable_name and internal mode flags
- #add_sibling(sibling : Node, force_readable_name : Bool) : Void
- #add_to_group(group : String, persistent : Bool) : Void
-
#add_to_group(group : String) : Void
Adds this node to the specified group (with default non-persistent flag)
- #atr(message : String, context : String) : String
- #atr_n(message : String, plural_message : String, n : Int64, context : String) : String
-
#auto_translate_mode
Property
#auto_translate_modegetter -
#auto_translate_mode=(val : Int)
Property
#auto_translate_modesetter - #can_auto_translate : Bool
- #can_process : Bool
- #create_tween : Tween
- #duplicate(flags : Int64) : Node
-
#each_child(include_internal : Bool = false, &block : Node -> Void) : Void
Yields each child node without allocating an intermediate array.
-
#editor_description
Property
#editor_descriptiongetter -
#editor_description=(val)
Property
#editor_descriptionsetter -
#find_child(pattern : String, recursive : Bool = true, owned : Bool = false) : Node | Nil
Reliable GDExtension bridge implementation of find_child with default parameters
-
#find_child_as(type : T.class, pattern : String, recursive : Bool = true, owned : Bool = false) : T | Nil forall T
Finds child node matching pattern and casts to T, returning nil if not found
- #find_children(pattern : String, get_type : String, recursive : Bool, owned : Bool) : Godot::Array
- #find_parent(pattern : String) : Node
- #get_accessibility_element : Int64
- #get_auto_translate_mode : Int64
- #get_child(idx : Int64, include_internal : Bool) : Node
-
#get_child(idx : Int, include_internal : Bool = false) : Node
Retrieves child at specified index
-
#get_child?(idx : Int, include_internal : Bool = false) : Node | Nil
Retrieves child at specified index, or nil if not found
-
#get_child_as(type : T.class, idx : Int, include_internal : Bool = false) : T | Nil forall T
Retrieves child at specified index cast to type T, or nil if not found or not matching type
-
#get_child_count(include_internal : Bool = false) : Int64
Returns the count of children belonging to this node
-
#get_children(include_internal : Bool = false) : Array(Node)
Returns an Array containing all child nodes belonging to this node.
-
#get_children_as(type : T.class, include_internal : Bool = false) : Array(T) forall T
Returns all children of this node matching or cast to type T.
- #get_editor_description : String
- #get_groups : Godot::Array
- #get_index(include_internal : Bool) : Int64
- #get_last_exclusive_window : Window
- #get_multiplayer : MultiplayerAPI
- #get_multiplayer_authority : Int64
- #get_name : String
-
#get_node(path : String) : Node
Retrieves a child or sibling node by NodePath string.
- #get_node(path : NodePath) : Node
-
#get_node?(path : String) : Node | Nil
Retrieves a child or sibling node by NodePath string, or returns nil if not found.
- #get_node_and_resource(path : NodePath) : Godot::Array
-
#get_node_as(type : T.class, path : String) : T forall T
Retrieves a child node cast to the specified Crystal class type
T. -
#get_node_as?(type : T.class, path : String) : T | Nil forall T
Retrieves a child node cast to the specified Crystal class type
T, or nil if not found. -
#get_node_or_null(path : String) : Node | Nil
Fetches a node by String path.
- #get_node_or_null(path : NodePath) : Node
- #get_node_rpc_config : Pointer(Void)
- #get_orphan_node_ids : Godot::Array
- #get_owner : Node
-
#get_parent : Node
Returns the parent Node
-
#get_parent? : Node | Nil
Returns the parent Node, or nil if orphan
-
#get_parent_as(type : T.class) : T | Nil forall T
Returns the parent node cast to T, or nil if parent is not of type T or is null
- #get_path : NodePath
- #get_path_to(node : Node, use_unique_path : Bool) : NodePath
- #get_physics_interpolation_mode : Int64
- #get_physics_process_delta_time : Float64
- #get_physics_process_priority : Int64
- #get_process_delta_time : Float64
- #get_process_mode : Int64
- #get_process_priority : Int64
- #get_process_thread_group : Int64
- #get_process_thread_group_order : Int64
- #get_process_thread_messages : Int64
- #get_scene_file_path : String
- #get_scene_instance_load_placeholder : Bool
-
#get_tree : SceneTree
Returns the SceneTree containing this node.
- #get_tree_string : String
- #get_tree_string_pretty : String
-
#get_unique_node_as(type : T.class, unique_name : String) : T | Nil forall T
Returns the scene unique node with name
%unique_namecast to T - #get_viewport : Viewport
- #get_window : Window
- #has_node(path : NodePath) : Bool
- #has_node_and_resource(path : NodePath) : Bool
-
#in_group?(group_name : String) : Bool
Returns true if this node belongs to the given node group.
-
#inside_tree? : Bool
Returns true if this node is currently a member of the active SceneTree.
- #is_ancestor_of(node : Node) : Bool
- #is_displayed_folded : Bool
- #is_editable_instance(node : Node) : Bool
- #is_greater_than(node : Node) : Bool
- #is_in_group(group : String) : Bool
-
#is_inside_tree : Bool
Returns true if the node is currently inside the active scene tree
- #is_multiplayer_authority : Bool
- #is_node_ready : Bool
- #is_part_of_edited_scene : Bool
- #is_physics_interpolated : Bool
- #is_physics_interpolated_and_enabled : Bool
- #is_physics_processing : Bool
- #is_physics_processing_internal : Bool
- #is_processing : Bool
- #is_processing_input : Bool
- #is_processing_internal : Bool
- #is_processing_shortcut_input : Bool
- #is_processing_unhandled_input : Bool
- #is_processing_unhandled_key_input : Bool
-
#is_queued_for_deletion : Bool
Checks if this node is queued for deletion
- #is_unique_name_in_owner : Bool
- #local_groups : Set(String)
- #move_child(child_node : Node, to_index : Int64) : Void
-
#multiplayer
Property
#multiplayergetter - #name : String
- #name=(val : String)
-
#node_as(type : T.class, path : String) : T forall T
Shorthand for get_node_as
-
#node_as?(type : T.class, path : String) : T | Nil forall T
Shorthand for get_node_as?
- #notify_deferred_thread_group(what : Int64) : Void
- #notify_thread_safe(what : Int64) : Void
-
#owner : Node | Nil
Returns the scene owner node responsible for serialization packing.
-
#owner=(o : Node | Nil)
Sets the scene owner node for serialization packing.
-
#physics_interpolation_mode
Property
#physics_interpolation_modegetter -
#physics_interpolation_mode=(val : Int)
Property
#physics_interpolation_modesetter - #print_orphan_nodes : Void
- #print_tree : Void
- #print_tree_pretty : Void
-
#process_mode
Property
#process_modegetter -
#process_mode=(val : Int)
Property
#process_modesetter -
#process_physics_priority
Property
#process_physics_prioritygetter -
#process_physics_priority=(val : Int)
Property
#process_physics_prioritysetter -
#process_priority
Property
#process_prioritygetter -
#process_priority=(val : Int)
Property
#process_prioritysetter -
#process_thread_group
Property
#process_thread_groupgetter -
#process_thread_group=(val : Int)
Property
#process_thread_groupsetter -
#process_thread_group_order
Property
#process_thread_group_ordergetter -
#process_thread_group_order=(val : Int)
Property
#process_thread_group_ordersetter -
#process_thread_messages
Property
#process_thread_messagesgetter -
#process_thread_messages=(val : Int)
Property
#process_thread_messagessetter - #propagate_call(method : String, args : Godot::Array, parent_first : Bool) : Void
- #propagate_notification(what : Int64) : Void
- #queue_accessibility_update : Void
-
#queue_free : Void
Queues this node for deletion at the end of the current frame
-
#remove_child(node : Node) : Void
Removes a child node from this node without freeing it
- #remove_from_group(group : String) : Void
-
#reparent(new_parent : Node, keep_global_transform : Bool = true) : Void
Changes the parent of this Node to new_parent
- #replace_by(node : Node, keep_groups : Bool) : Void
- #request_ready : Void
- #reset_physics_interpolation : Void
- #rpc_config(method : String, config : Pointer(Void)) : Void
-
#scene_file_path
Property
#scene_file_pathgetter -
#scene_file_path=(val)
Property
#scene_file_pathsetter - #set_auto_translate_mode(mode : Int64) : Void
- #set_deferred_thread_group(property : String, value : Pointer(Void)) : Void
- #set_display_folded(fold : Bool) : Void
- #set_editable_instance(node : Node, is_editable : Bool) : Void
- #set_editor_description(editor_description : String) : Void
- #set_multiplayer_authority(id : Int64, recursive : Bool) : Void
-
#set_name(name : String) : Void
Sets the name of the node safely via dynamic reflection
- #set_owner(owner : Node) : Void
- #set_physics_interpolation_mode(mode : Int64) : Void
- #set_physics_process(enable : Bool) : Void
- #set_physics_process_internal(enable : Bool) : Void
- #set_physics_process_priority(priority : Int64) : Void
- #set_process(enable : Bool) : Void
- #set_process_input(enable : Bool) : Void
- #set_process_internal(enable : Bool) : Void
- #set_process_mode(mode : Int64) : Void
- #set_process_priority(priority : Int64) : Void
- #set_process_shortcut_input(enable : Bool) : Void
- #set_process_thread_group(mode : Int64) : Void
- #set_process_thread_group_order(order : Int64) : Void
- #set_process_thread_messages(flags : Int64) : Void
- #set_process_unhandled_input(enable : Bool) : Void
- #set_process_unhandled_key_input(enable : Bool) : Void
- #set_scene_file_path(scene_file_path : String) : Void
- #set_scene_instance_load_placeholder(load_placeholder : Bool) : Void
- #set_thread_safe(property : String, value : Pointer(Void)) : Void
- #set_translation_domain_inherited : Void
- #set_unique_name_in_owner(enable : Bool) : Void
-
#unique_name_in_owner
Property
#unique_name_in_ownergetter -
#unique_name_in_owner=(val)
Property
#unique_name_in_ownersetter - #unique_name_in_owner?
- #update_configuration_warnings : Void
Instance methods inherited from class Godot::Object
==(other : Godot::Object) : Bool==(other : Nil) : Bool ==, _godot_call_tool_button(button_name : String) : Void _godot_call_tool_button, _godot_call_virtual(method_name : String, delta : Float64) : Void _godot_call_virtual, _godot_call_virtual_with_data(method_name : String, args : Pointer(Pointer(Void)), ret : Pointer(Void)) : Void _godot_call_virtual_with_data, _godot_get_property(prop_name : String, ret_ptr : Pointer(Void)) : Void _godot_get_property, _godot_set_property(prop_name : String, val_ptr : Pointer(Void)) : Void _godot_set_property, add_user_signal(signal : String, arguments : Godot::Array) : Void add_user_signal, alive? : Bool alive?, await_signal(signal_name : String, timeout_sec : Float64 | Nil = nil) : Array(Variant) await_signal, call(method : String, *args) : Pointer(Void) call, call_bool(method : String, *args) : Bool call_bool, call_deferred(method : String, *args) : Pointer(Void) call_deferred, call_f64(method : String, *args) : Float64 call_f64, call_i64(method : String, *args) : Int64 call_i64, call_obj(method : String, *args) : Node | Nil call_obj, call_obj_as(type : T.class, method : String, *args) : T | Nil forall T call_obj_as, call_str(method : String, *args) : String call_str, callv(method : String, arg_array : Godot::Array) : Pointer(Void) callv, can_translate_messages : Bool can_translate_messages, cancel_free : Void cancel_free, check_alive! : Void check_alive!, connect(signal_name : String, flags : Godot::ConnectFlags = ::Godot::ConnectFlags::None, callback : Proc(Array(Variant), Void) | Nil = nil) : SignalSubscription
connect(signal_name : String, flags : Godot::ConnectFlags = ::Godot::ConnectFlags::None, &block : Array(Variant) -> Void) : SignalSubscription
connect(signal_name : String, listener_target : Godot::Object, method_name : Symbol, flags : Godot::ConnectFlags = ::Godot::ConnectFlags::None) : SignalSubscription
connect(signal : String, callable : Pointer(Void), flags : Int64) : Int64 connect, connect_one_shot(signal_name : String, &block : Array(Variant) -> Void) : SignalSubscription connect_one_shot, destroy : Void destroy, destroyed? : Bool destroyed?, disconnect(signal : String, callable : Pointer(Void)) : Void
disconnect(signal_name : String) : Void disconnect, editor_hint? : Bool editor_hint?, emit_signal(name : String) : Void
emit_signal(name : String, *args) : Void emit_signal, free : Void free, get(property : String) : Pointer(Void) get, get_class : String get_class, get_incoming_connections : Godot::Array get_incoming_connections, get_indexed(property_path : NodePath) : Pointer(Void) get_indexed, get_instance_id : Int64 get_instance_id, get_meta(name : String, default : Pointer(Void)) : Pointer(Void) get_meta, get_meta_list : Godot::Array get_meta_list, get_method_argument_count(method : String) : Int64 get_method_argument_count, get_method_list : Godot::Array get_method_list, get_property_list : Godot::Array get_property_list, get_script : Pointer(Void) get_script, get_signal_connection_list(signal : String) : Godot::Array get_signal_connection_list, get_signal_list : Godot::Array get_signal_list, get_translation_domain : String get_translation_domain, has_connections(signal : String) : Bool has_connections, has_meta(name : String) : Bool has_meta, has_method(method : String) : Bool has_method, has_signal(signal : String) : Bool has_signal, has_signal?(signal_name : String) : Bool has_signal?, has_user_signal(signal : String) : Bool has_user_signal, hash(hasher) hash, if_alive : self | Nil if_alive, instance_id : UInt64 instance_id, is_blocking_signals : Bool is_blocking_signals, is_class(godot_class : String) : Bool is_class, is_connected(signal : String, callable : Pointer(Void)) : Bool is_connected, is_queued_for_deletion : Bool is_queued_for_deletion, is_valid? : Bool is_valid?, link_class_script : Void link_class_script, notification(what : Int64, reversed : Bool) : Void notification, notify_property_list_changed : Void notify_property_list_changed, pointer : Pointer(Void) pointer, pointer=(val : Pointer(Void)) pointer=, print(*args) print, printerr(*args) printerr, property_can_revert(property : String) : Bool property_can_revert, property_get_revert(property : String) : Pointer(Void) property_get_revert, puts(*args) puts, remove_meta(name : String) : Void remove_meta, remove_user_signal(signal : String) : Void remove_user_signal, set(property : String, value : Pointer(Void)) : Void set, set_block_signals(enable : Bool) : Void set_block_signals, set_deferred(property : String, value : Pointer(Void)) : Void set_deferred, set_indexed(property_path : NodePath, value : Pointer(Void)) : Void set_indexed, set_message_translation(enable : Bool) : Void set_message_translation, set_meta(name : String, value : Pointer(Void)) : Void set_meta, set_script(script : Pointer(Void)) : Void set_script, set_translation_domain(domain : String) : Void set_translation_domain, signal(name : String) : Godot::BoundSignal signal, signal_connection_count(signal_name : String) : Int32 signal_connection_count, signal_target_id : UInt64 signal_target_id, to_s(io : IO) : Void to_s, to_string : String to_string, to_unsafe : Pointer(Void) to_unsafe, tr(message : String, context : String) : String tr, tr_n(message : String, plural_message : String, n : Int64, context : String) : String tr_n
Constructor methods inherited from class Godot::Object
new(pointer : Pointer(Void) = Pointer(Void).null)
new
Class methods inherited from class Godot::Object
_godot_has_virtual_method(method_name : String) : Bool
_godot_has_virtual_method,
is_instance_id_valid(id : Int | UInt64) : Bool
is_instance_id_valid
Constructor Detail
Instance Method Detail
Indexer syntactic sugar for retrieving a child node by path (e.g. self["Camera3D"])
Safe indexer returning nil if node not found (e.g. self["Camera3D"]?)
Fixed-rate physics process callback receiving delta timestep in seconds (Float64).
Per-frame process callback receiving delta timestep in seconds (Float64).
Adds a child node with optional force_readable_name and internal mode flags
Adds this node to the specified group (with default non-persistent flag)
Yields each child node without allocating an intermediate array.
Reliable GDExtension bridge implementation of find_child with default parameters
Finds child node matching pattern and casts to T, returning nil if not found
Retrieves child at specified index
Retrieves child at specified index, or nil if not found
Retrieves child at specified index cast to type T, or nil if not found or not matching type
Returns the count of children belonging to this node
Returns an Array containing all child nodes belonging to this node.
Returns all children of this node matching or cast to type T.
Retrieves a child or sibling node by NodePath string. Returns the Node if found, or produces an error if the node does not exist.
Retrieves a child or sibling node by NodePath string, or returns nil if not found.
Retrieves a child node cast to the specified Crystal class type T.
Returns the node cast to T, or produces an error if the node does not exist.
Retrieves a child node cast to the specified Crystal class type T, or nil if not found.
Fetches a node by String path. Similar to #get_node, but returns nil if path does not point to a valid node.
Returns the parent node cast to T, or nil if parent is not of type T or is null
Returns the scene unique node with name %unique_name cast to T
Returns true if this node belongs to the given node group.
Shorthand for get_node_as?
Returns the scene owner node responsible for serialization packing.
Property #physics_interpolation_mode setter
Property #process_thread_group_order setter
Removes a child node from this node without freeing it
Changes the parent of this Node to new_parent