class
Godot::Object
- Godot::Object
- Reference
- Object
Overview
Base class for all Godot engine objects and extension classes. Provides identity, lifecycle dispatch hooks, and signal emission functionality.
Direct Known Subclasses
- Godot::AccessibilityServer
- Godot::AudioServer
- Godot::CameraServer
- Godot::ClassDB
- Godot::DisplayServer
- Godot::EditorFileSystemDirectory
- Godot::EditorInterface
- Godot::EditorPaths
- Godot::EditorSelection
- Godot::EditorUndoRedoManager
- Godot::EditorVCSInterface
- Godot::Engine
- Godot::EngineDebugger
- Godot::FramebufferCacheRD
- Godot::GDExtensionManager
- Godot::Geometry2D
- Godot::Geometry3D
- Godot::GodotInstance
- Godot::Input
- Godot::InputMap
- Godot::IP
- Godot::JavaClassWrapper
- Godot::JavaScriptBridge
- Godot::JNISingleton
- Godot::JSONRPC
- Godot::MainLoop
- Godot::Marshalls
- Godot::MovieWriter
- Godot::NativeMenu
- Godot::NavigationMeshGenerator
- Godot::NavigationServer2D
- Godot::NavigationServer2DManager
- Godot::NavigationServer3D
- Godot::NavigationServer3DManager
- Godot::Node
- Godot::OpenXRExtensionWrapper
- Godot::OpenXRInteractionProfileMetadata
- Godot::OS
- Godot::Performance
- Godot::PhysicsDirectBodyState2D
- Godot::PhysicsDirectBodyState3D
- Godot::PhysicsDirectSpaceState2D
- Godot::PhysicsDirectSpaceState3D
- Godot::PhysicsServer2D
- Godot::PhysicsServer2DManager
- Godot::PhysicsServer3D
- Godot::PhysicsServer3DManager
- Godot::PhysicsServer3DRenderingServerHandler
- Godot::ProjectSettings
- Godot::RefCounted
- Godot::RenderData
- Godot::RenderingDevice
- Godot::RenderingServer
- Godot::RenderSceneData
- Godot::ResourceLoader
- Godot::ResourceSaver
- Godot::ResourceUID
- Godot::ScriptLanguage
- Godot::ShaderIncludeDB
- Godot::TextServerManager
- Godot::TextureStreaming
- Godot::ThemeDB
- Godot::TileData
- Godot::Time
- Godot::TranslationServer
- Godot::TreeItem
- Godot::UndoRedo
- Godot::UniformSetCacheRD
- Godot::WorkerThreadPool
- Godot::XRServer
- Godot::XRVRS
Defined in:
libgodot/generated/classes/classes_part1.crlibgodot/object.cr
libgodot/variant.cr
Constructors
Class Method Summary
-
._godot_has_virtual_method(method_name : String) : Bool
Checks if this object class overrides a generic virtual method.
-
.is_instance_id_valid(id : Int | UInt64) : Bool
Checks if a 64-bit instance ID is currently valid in Godot's ObjectDB
Instance Method Summary
-
#==(other : Godot::Object) : Bool
Value equality based on Godot engine identity (instance ID or underlying pointer)
- #==(other : Nil) : Bool
-
#_godot_call_tool_button(button_name : String) : Void
Dispatches inspector tool button clicks on this object.
-
#_godot_call_virtual(method_name : String, delta : Float64) : Void
Virtual method and property dispatch hooks overridden by class registration macros.
-
#_godot_call_virtual_with_data(method_name : String, args : Pointer(Pointer(Void)), ret : Pointer(Void)) : Void
Dispatches generic virtual methods with raw arguments and return buffer.
-
#_godot_get_property(prop_name : String, ret_ptr : Pointer(Void)) : Void
Invoked by the GDExtension bridge when retrieving an exposed
@exportproperty. -
#_godot_set_property(prop_name : String, val_ptr : Pointer(Void)) : Void
Invoked by the GDExtension bridge when setting an exposed
@exportproperty. - #add_user_signal(signal : String, arguments : Godot::Array) : Void
-
#alive? : Bool
Returns true if this object instance has a valid engine pointer and is alive in Godot's ObjectDB
-
#await_signal(signal_name : String, timeout_sec : Float64 | Nil = nil) : Array(Variant)
Cooperatively awaits a signal emitted on this object.
-
#call(method : String, *args) : Pointer(Void)
Calls the named method on the object with variable arguments.
-
#call_bool(method : String, *args) : Bool
Calls the named method and returns the result as Bool
-
#call_deferred(method : String, *args) : Pointer(Void)
Calls the named method on the object during idle time.
-
#call_f64(method : String, *args) : Float64
Calls the named method and returns the result as Float64
-
#call_i64(method : String, *args) : Int64
Calls the named method and returns the result as Int64
-
#call_obj(method : String, *args) : Node | Nil
Calls the named method and returns an Object/Node (or nil if null)
-
#call_obj_as(type : T.class, method : String, *args) : T | Nil forall T
Calls the named method and returns the result cast to T (or nil if null)
-
#call_str(method : String, *args) : String
Calls the named method and returns the result as String
- #callv(method : String, arg_array : Godot::Array) : Pointer(Void)
- #can_translate_messages : Bool
- #cancel_free : Void
-
#check_alive! : Void
Validates that the underlying engine object is still alive before executing bridge calls.
-
#connect(signal_name : String, flags : Godot::ConnectFlags = ::Godot::ConnectFlags::None, callback : Proc(Array(Variant), Void) | Nil = nil) : SignalSubscription
Connects a callback proc to the named signal.
-
#connect(signal_name : String, flags : Godot::ConnectFlags = ::Godot::ConnectFlags::None, &block : Array(Variant) -> Void) : SignalSubscription
Connects a callback block accepting Array(Variant) to the named signal.
-
#connect(signal_name : String, listener_target : Godot::Object, method_name : Symbol, flags : Godot::ConnectFlags = ::Godot::ConnectFlags::None) : SignalSubscription
Connects the named signal to a method call on a listener target by symbol name.
- #connect(signal : String, callable : Pointer(Void), flags : Int64) : Int64
-
#connect_one_shot(signal_name : String, &block : Array(Variant) -> Void) : SignalSubscription
Connects a one-shot callback block to the named signal (backwards compatibility).
-
#destroy : Void
Destroys this Object in the Godot engine and invalidates the Crystal pointer.
- #destroyed? : Bool
- #disconnect(signal : String, callable : Pointer(Void)) : Void
-
#disconnect(signal_name : String) : Void
Disconnects all signal subscriptions for the named signal on this object.
-
#editor_hint? : Bool
Returns true if running inside the Godot Editor
-
#emit_signal(name : String) : Void
Emits a parameterless signal on this Godot object.
-
#emit_signal(name : String, *args) : Void
Emits a signal with variable arguments on this Godot object.
-
#free : Void
Destroys this Object in the Godot engine (alias to #destroy).
- #get(property : String) : Pointer(Void)
- #get_class : String
- #get_incoming_connections : Godot::Array
- #get_indexed(property_path : NodePath) : Pointer(Void)
- #get_instance_id : Int64
- #get_meta(name : String, default : Pointer(Void)) : Pointer(Void)
- #get_meta_list : Godot::Array
- #get_method_argument_count(method : String) : Int64
- #get_method_list : Godot::Array
- #get_property_list : Godot::Array
- #get_script : Pointer(Void)
- #get_signal_connection_list(signal : String) : Godot::Array
- #get_signal_list : Godot::Array
- #get_translation_domain : String
- #has_connections(signal : String) : Bool
- #has_meta(name : String) : Bool
- #has_method(method : String) : Bool
- #has_signal(signal : String) : Bool
-
#has_signal?(signal_name : String) : Bool
Returns true if this object or its registered class defines the given signal.
- #has_user_signal(signal : String) : Bool
-
#hash(hasher)
Hashing based on engine instance ID for use in Sets and Hash keys
-
#if_alive : self | Nil
Convenient nil-coalescing helper: returns self if alive, otherwise nil
- #instance_id : UInt64
- #is_blocking_signals : Bool
- #is_class(godot_class : String) : Bool
- #is_connected(signal : String, callable : Pointer(Void)) : Bool
- #is_queued_for_deletion : Bool
- #is_valid? : Bool
-
#link_class_script : Void
Automatically links this node's registered CrystalScript resource if running inside the Godot Editor
- #notification(what : Int64, reversed : Bool) : Void
- #notify_property_list_changed : Void
- #pointer : Pointer(Void)
- #pointer=(val : Pointer(Void))
-
#print(*args)
Prints a message to Godot's debug console.
-
#printerr(*args)
Prints an error message to Godot's error console.
- #property_can_revert(property : String) : Bool
- #property_get_revert(property : String) : Pointer(Void)
-
#puts(*args)
Prints a message to Godot's debug console.
- #remove_meta(name : String) : Void
- #remove_user_signal(signal : String) : Void
- #set(property : String, value : Pointer(Void)) : Void
- #set_block_signals(enable : Bool) : Void
- #set_deferred(property : String, value : Pointer(Void)) : Void
- #set_indexed(property_path : NodePath, value : Pointer(Void)) : Void
- #set_message_translation(enable : Bool) : Void
- #set_meta(name : String, value : Pointer(Void)) : Void
- #set_script(script : Pointer(Void)) : Void
- #set_translation_domain(domain : String) : Void
-
#signal(name : String) : Godot::BoundSignal
Returns a bound signal representation for the named signal.
-
#signal_connection_count(signal_name : String) : Int32
Returns the count of active subscriptions for the given signal on this object.
-
#signal_target_id : UInt64
Identifier used for signal routing and lifecycle tracking (engine instance ID or Crystal object_id)
-
#to_s(io : IO) : Void
Appends a short String representation of this object which includes its class name and its object address.
- #to_string : String
-
#to_unsafe : Pointer(Void)
Idiomatic Crystal pointer conversion
- #tr(message : String, context : String) : String
- #tr_n(message : String, plural_message : String, n : Int64, context : String) : String
Constructor Detail
Class Method Detail
Checks if this object class overrides a generic virtual method.
Checks if a 64-bit instance ID is currently valid in Godot's ObjectDB
Instance Method Detail
Value equality based on Godot engine identity (instance ID or underlying pointer)
Dispatches inspector tool button clicks on this object.
Virtual method and property dispatch hooks overridden by class registration macros.
Delta timestep is received with 64-bit precision (Float64).
Dispatches generic virtual methods with raw arguments and return buffer.
Invoked by the GDExtension bridge when retrieving an exposed @export property.
Invoked by the GDExtension bridge when setting an exposed @export property.
Returns true if this object instance has a valid engine pointer and is alive in Godot's ObjectDB
Cooperatively awaits a signal emitted on this object.
Calls the named method on the object with variable arguments.
Calls the named method and returns the result as Bool
Calls the named method on the object during idle time.
Calls the named method and returns the result as Float64
Calls the named method and returns the result as Int64
Calls the named method and returns an Object/Node (or nil if null)
Calls the named method and returns the result cast to T (or nil if null)
Calls the named method and returns the result as String
Validates that the underlying engine object is still alive before executing bridge calls.
Raises DisposedObjectError if the object was destroyed by GDScript, engine, or Crystal.
Connects a callback proc to the named signal.
Connects a callback block accepting Array(Variant) to the named signal.
Connects the named signal to a method call on a listener target by symbol name.
Connects a one-shot callback block to the named signal (backwards compatibility).
Disconnects all signal subscriptions for the named signal on this object.
Emits a signal with variable arguments on this Godot object.
Returns true if this object or its registered class defines the given signal.
Convenient nil-coalescing helper: returns self if alive, otherwise nil
Automatically links this node's registered CrystalScript resource if running inside the Godot Editor
Returns a bound signal representation for the named signal.
Enables idiomatic usage: enemy.signal("died").await or button.signal("pressed").connect { ... }.
Returns the count of active subscriptions for the given signal on this object.
Identifier used for signal routing and lifecycle tracking (engine instance ID or Crystal object_id)
Appends a short String representation of this object which includes its class name and its object address.
class Person
def initialize(@name : String, @age : Int32)
end
end
Person.new("John", 32).to_s # => #<Person:0x10a199f20>