class

Godot::Object

Inherits Reference < Object

Base class for all Godot engine objects and extension classes. Provides identity, lifecycle dispatch hooks, and signal emission functionality.

Constructors

new(pointer : Pointer(Void) = Pointer(Void).null)
Source

Class methods

_godot_has_virtual_method(method_name : String) : Bool

Checks if this object class overrides a generic virtual method.

Source
is_instance_id_valid(id : Int | UInt64) : Bool

Checks if a 64-bit instance ID is currently valid in Godot's ObjectDB

Source

Instance methods

==(other : Godot::Object) : Bool

Value equality based on Godot engine identity (instance ID or underlying pointer)

Source
==(other : Nil) : Bool
Source
_godot_call_tool_button(button_name : String) : Void

Dispatches inspector tool button clicks on this object.

Source
_godot_call_virtual(method_name : String, delta : Float64) : Void

Virtual method and property dispatch hooks overridden by class registration macros. Delta timestep is received with 64-bit precision (Float64).

Source
_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.

Source
_godot_get_property(prop_name : String, ret_ptr : Pointer(Void)) : Void

Invoked by the GDExtension bridge when retrieving an exposed @export property.

Source
_godot_set_property(prop_name : String, val_ptr : Pointer(Void)) : Void

Invoked by the GDExtension bridge when setting an exposed @export property.

Source
add_user_signal(signal : String, arguments : Godot::Array) : Void
Source
alive?

Returns true if this object instance has a valid engine pointer and is alive in Godot's ObjectDB

Source
await_signal(signal_name : String, timeout_sec : Float64 | Nil = nil) : Array(Variant)

Cooperatively awaits a signal emitted on this object.

Source
call(method : String, *args) : Pointer(Void)

Calls the named method on the object with variable arguments.

Source
call_bool(method : String, *args) : Bool

Calls the named method and returns the result as Bool

Source
call_deferred(method : String, *args) : Pointer(Void)

Calls the named method on the object during idle time.

Source
call_f64(method : String, *args) : Float64

Calls the named method and returns the result as Float64

Source
call_i64(method : String, *args) : Int64

Calls the named method and returns the result as Int64

Source
call_obj(method : String, *args) : Node | Nil

Calls the named method and returns an Object/Node (or nil if null)

Source
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)

Source
call_str(method : String, *args) : String

Calls the named method and returns the result as String

Source
callv(method : String, arg_array : Godot::Array) : Pointer(Void)
Source
can_translate_messages
Source
cancel_free
Source
check_alive!

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.

Source
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.

Source
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.

Source
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.

Source
connect(signal : String, callable : Pointer(Void), flags : Int64) : Int64
Source
connect_one_shot(signal_name : String, &block : Array(Variant) -> Void) : SignalSubscription

Connects a one-shot callback block to the named signal (backwards compatibility).

Source
destroy

Destroys this Object in the Godot engine and invalidates the Crystal pointer.

Source
destroyed?
Source
disconnect(signal : String, callable : Pointer(Void)) : Void
Source
disconnect(signal_name : String) : Void

Disconnects all signal subscriptions for the named signal on this object.

Source
editor_hint?

Returns true if running inside the Godot Editor

Source
emit_signal(name : String) : Void

Emits a parameterless signal on this Godot object.

Source
emit_signal(name : String, *args) : Void

Emits a signal with variable arguments on this Godot object.

Source
free

Destroys this Object in the Godot engine (alias to #destroy).

Source
get(property : String) : Pointer(Void)
Source
get_class
Source
get_incoming_connections
Source
get_indexed(property_path : NodePath) : Pointer(Void)
Source
get_instance_id
Source
get_meta(name : String, default : Pointer(Void)) : Pointer(Void)
Source
get_meta_list
Source
get_method_argument_count(method : String) : Int64
Source
get_method_list
Source
get_property_list
Source
get_script
Source
get_signal_connection_list(signal : String) : Godot::Array
Source
get_signal_list
Source
get_translation_domain
Source
has_connections(signal : String) : Bool
Source
has_meta(name : String) : Bool
Source
has_method(method : String) : Bool
Source
has_signal(signal : String) : Bool
Source
has_signal?(signal_name : String) : Bool

Returns true if this object or its registered class defines the given signal.

Source
has_user_signal(signal : String) : Bool
Source
hash(hasher)

Hashing based on engine instance ID for use in Sets and Hash keys

Source
if_alive

Convenient nil-coalescing helper: returns self if alive, otherwise nil

Source
instance_id
Source
is_blocking_signals
Source
is_class(godot_class : String) : Bool
Source
is_connected(signal : String, callable : Pointer(Void)) : Bool
Source
is_queued_for_deletion
Source
is_valid?
Source
notification(what : Int64, reversed : Bool) : Void
Source
notify_property_list_changed
Source
pointer
Source
pointer=(val : Pointer(Void))
Source
printerr(*args)

Prints an error message to Godot's error console.

Source
property_can_revert(property : String) : Bool
Source
property_get_revert(property : String) : Pointer(Void)
Source
puts(*args)

Prints a message to Godot's debug console.

Source
remove_meta(name : String) : Void
Source
remove_user_signal(signal : String) : Void
Source
set(property : String, value : Pointer(Void)) : Void
Source
set_block_signals(enable : Bool) : Void
Source
set_deferred(property : String, value : Pointer(Void)) : Void
Source
set_indexed(property_path : NodePath, value : Pointer(Void)) : Void
Source
set_message_translation(enable : Bool) : Void
Source
set_meta(name : String, value : Pointer(Void)) : Void
Source
set_script(script : Pointer(Void)) : Void
Source
set_translation_domain(domain : String) : Void
Source
signal(name : String) : Godot::BoundSignal

Returns a bound signal representation for the named signal. Enables idiomatic usage: enemy.signal("died").await or button.signal("pressed").connect { ... }.

Source
signal_connection_count(signal_name : String) : Int32

Returns the count of active subscriptions for the given signal on this object.

Source
signal_target_id

Identifier used for signal routing and lifecycle tracking (engine instance ID or Crystal object_id)

Source
to_s(io : IO) : Void

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>
Source
to_string
Source
to_unsafe

Idiomatic Crystal pointer conversion

Source
tr(message : String, context : String) : String
Source
tr_n(message : String, plural_message : String, n : Int64, context : String) : String
Source

Nested types