module
Godot::Bridge
Defined in:
libgodot/bridge.crClass Method Summary
- ._set_creating_extension(val : Bool) : Void
- .alive_instance_count : Int32
-
.alive_instances : Hash(Pointer(Void), Godot::Object)
Retrieves the active Crystal instance root table for testing and diagnostics
- .alive_mutex : ::Thread::Mutex
- .api : Pointer(LibBridge::BridgeAPI)
- .arg_to_string(arg_ptr : Pointer(Void)) : String
- .arg_to_string_name(arg_ptr : Pointer(Void)) : String
- .array_from_bridge_payload(payload_ptr : Pointer(Void), _elem_type : T.class) : Array(T) forall T
- .available? : Bool
- .cached_string_name(str : String | Symbol) : Pointer(Void)
- .construct_object(class_name : String) : Pointer(Void)
- .creating_extension? : Bool
- .debug(msg : String) : Void
- .deinit : Void
- .deinitialized? : Bool
-
.drain_deferred_unrefs!(force : Bool = false) : Int32
Drains queued RefCounted finalizer unreferences on the main thread.
- .editor_get_selected_node(ed_iface : Pointer(Void)) : Pointer(Void)
- .emit_signal(godot_obj : Pointer(Void), signal_name : String) : Void
- .emit_signal(godot_obj : Pointer(Void), signal_name : String, *args) : Void
-
.enqueue_deferred_unref(ptr : Pointer(Void), instance_id : UInt64, count : Int32) : Void
Lock-free C-heap enqueue safe to invoke from Boehm GC finalizers on any thread.
- .error(desc : String, msg : String = "", func : String = "", file : String = "", line : Int32 = 0) : Void
- .find_alive_instance(godot_obj : Pointer(Void)) : Godot::Object | Nil
- .free_nodepath(ptr : Pointer(Void) | Nil) : Void
- .free_string(ptr : Pointer(Void) | Nil) : Void
- .free_string_name(ptr : Pointer(Void) | Nil) : Void
- .get_axis(negative_action : String | Symbol, positive_action : String | Symbol) : Float32
- .get_language_object : Pointer(Void)
-
.get_method_bind(class_name : String, method_name : String, hash : Int64) : Pointer(Void)
Generic Engine Dispatchers
- .get_singleton(name : String) : Pointer(Void)
- .get_vector(negative_x : String | Symbol, positive_x : String | Symbol, negative_y : String | Symbol, positive_y : String | Symbol, deadzone : Float64 = -1.0) : Vector2
- .get_velocity(godot_obj : Pointer(Void)) : Vector3
- .has_alive_instance?(boxed : Pointer(Void)) : Bool
- .highlighter_add_span(ret : Pointer(Void), col : Int64, r : Float32, g : Float32, b : Float32, a : Float32 = 1.0_f32) : Void
- .image_copy_to_buffer(img : Pointer(Void), dst : Pointer(UInt8), max_len : Int64) : Int64
- .image_update_buffer(img : Pointer(Void), width : Int32, height : Int32, mipmaps : Bool, format : Int32, pixels : Pointer(UInt8), len : Int64) : Void
- .init(api : Pointer(LibBridge::BridgeAPI))
- .init_done=(init_done : Bool)
- .init_done? : Bool
- .is_action_just_pressed(action : String | Symbol, exact_match : Bool = false) : Bool
- .is_action_just_released(action : String | Symbol, exact_match : Bool = false) : Bool
- .is_action_pressed(action : String | Symbol, exact_match : Bool = false) : Bool
- .is_instance_valid(id : UInt64) : Bool
- .is_key_pressed(key : Int32) : Bool
- .is_language_registered? : Bool
- .is_loader_registered? : Bool
- .is_mouse_button_pressed(button : Int64) : Bool
- .is_object_valid(obj : Pointer(Void)) : Bool
-
.is_on_floor(godot_obj : Pointer(Void)) : Bool
Engine Method Calls
- .is_physical_key_pressed(key : Int32) : Bool
- .is_saver_registered? : Bool
- .load_editor_help(xml : String) : Void
- .make_nodepath(path : String) : Pointer(Void)
- .make_string(str : String) : Pointer(Void)
- .make_string_name(str : String) : Pointer(Void)
- .move_and_slide(godot_obj : Pointer(Void)) : Bool
- .node_find_child(godot_obj : Pointer(Void), pattern : String, recursive : Bool = true, owned : Bool = false) : Pointer(Void)
- .node_get_name(godot_obj : Pointer(Void)) : String
- .node_get_node(godot_obj : Pointer(Void), path : String) : Pointer(Void)
- .node_rpc_config(godot_obj : Pointer(Void), method : String, rpc_mode : Int32, transfer_mode : Int32, call_local : Bool, channel : Int32) : Void
- .object_call(godot_obj : Pointer(Void), method_name : String) : Void
- .object_call(godot_obj : Pointer(Void), method_name : String, *args) : Void
- .object_call_deferred(godot_obj : Pointer(Void), method_name : String) : Void
- .object_call_deferred(godot_obj : Pointer(Void), method_name : String, *args) : Void
- .object_call_ret_bool(godot_obj : Pointer(Void), method_name : String, *args) : Bool
- .object_call_ret_float(godot_obj : Pointer(Void), method_name : String, *args) : Float64
- .object_call_ret_int(godot_obj : Pointer(Void), method_name : String, *args) : Int64
- .object_call_ret_object(godot_obj : Pointer(Void), method_name : String, *args) : Pointer(Void)
- .object_call_ret_string(godot_obj : Pointer(Void), method_name : String, *args) : String
- .object_class_name(obj : Pointer(Void)) : String
- .object_connect_signal(godot_obj : Pointer(Void), signal_name : String, flags : UInt32 = 0_u32) : Void
- .object_destroy(godot_obj : Pointer(Void)) : Void
- .object_disconnect_signal(godot_obj : Pointer(Void), signal_name : String) : Void
- .object_get_instance_from_id(id : UInt64) : Pointer(Void)
- .object_get_instance_id(godot_obj : Pointer(Void)) : UInt64
- .object_is_class(obj : Pointer(Void), class_name : String) : Bool
- .on_main_loop_frame : Void
- .on_main_loop_shutdown : Void
- .packed_byte_array_operator_index(pba : Pointer(Void), index : Int64) : Pointer(UInt8)
- .packed_scene_instantiate(scene_ptr : Pointer(Void), edit_state : Int64 = 0_i64) : Pointer(Void)
- .placeholder_script_instance_create(language : Pointer(Void), script : Pointer(Void), owner : Pointer(Void)) : Pointer(Void)
- .print(msg : String) : Void
- .print_verbose(msg : String) : Void
- .printerr(msg : String) : Void
-
.prune_dead_ptr_instances! : Void
Prunes entries from
@@alive_instances_by_ptrwhose underlying native engine object has already been freed by Godot (e.g., viaqueue_freeon an ancestor node). - .ptrcall(method_bind : Pointer(Void), instance : Pointer(Void), args : Pointer(Pointer(Void)), ret : Pointer(Void)) : Void
- .range_set_value(godot_obj : Pointer(Void), value : Float64) : Void
- .ref_get_object(ref_ptr : Pointer(Void)) : Pointer(Void)
- .register_alive_instance(boxed : Pointer(Void), inst : Godot::Object) : Void
- .register_alive_instance_by_ptr(godot_obj : Pointer(Void), inst : Godot::Object) : Void
- .register_shutdown_callback(&block : -> Void)
- .reloading? : Bool
- .resource_get_path(res_obj : Pointer(Void)) : String
- .resource_loader_load(path : String, type_hint : String = "", cache_mode : Int64 = 0_i64) : Pointer(Void)
- .ret_array_empty(ret : Pointer(Void)) : Void
- .ret_dictionary_complete_code(ret : Pointer(Void)) : Void
- .ret_dictionary_complete_code_ex(ret : Pointer(Void), result : Int64, force : Bool, call_hint : String, options : Slice(BridgeCompletionOption) | Array(BridgeCompletionOption)) : Void
- .ret_dictionary_empty(ret : Pointer(Void)) : Void
- .ret_dictionary_global_class(ret : Pointer(Void), class_name : String, base_type : String = "Node", icon_path : String = "") : Void
- .ret_dictionary_lookup_code(ret : Pointer(Void)) : Void
- .ret_dictionary_lookup_code_ex(ret : Pointer(Void), result : Int64, type : Int64, class_name : String, class_member : String, description : String, script_path : String, location : Int64) : Void
- .ret_dictionary_validate(ret : Pointer(Void), valid : Bool) : Void
- .ret_dictionary_validate_ex(ret : Pointer(Void), valid : Bool, errors : Slice(BridgeValidationError) | Array(BridgeValidationError) = [] of BridgeValidationError, warnings : Slice(BridgeValidationWarning) | Array(BridgeValidationWarning) = [] of BridgeValidationWarning) : Void
- .ret_object(ret : Pointer(Void), obj_ptr : Pointer(Void)) : Void
- .ret_packed_string_array(ret : Pointer(Void), strings : Array(String)) : Void
- .ret_property_list(ret : Pointer(Void), props : Slice(LibBridge::CrystalPropertyDesc) | Array(LibBridge::CrystalPropertyDesc)) : Void
- .ret_ref(ret : Pointer(Void), obj_ptr : Pointer(Void)) : Void
- .ret_script_templates(ret : Pointer(Void), templates : Slice(BridgeScriptTemplate) | Array(BridgeScriptTemplate)) : Void
- .ret_signal_list(ret : Pointer(Void), signals : Slice(LibBridge::CrystalSignalDesc) | Array(LibBridge::CrystalSignalDesc)) : Void
- .ret_string(ret : Pointer(Void), str : String) : Void
- .ret_string_name(ret : Pointer(Void), str : String) : Void
- .ret_variant_nil(ret : Pointer(Void)) : Void
- .ret_variant_object(ret : Pointer(Void), obj_ptr : Pointer(Void)) : Void
-
.run_pre_objectdb_teardown! : Void
Executes all Crystal-side cache, singleton, loader, saver, and RefCounted teardown BEFORE Godot runs
ResourceCache::clear()andObjectDB::cleanup(). - .script_get_source_code(script_obj : Pointer(Void)) : String
-
.scrub_c_stack_for_gc! : Void
Scrubs residual stack words so conservative Boehm GC does not falsely pin dead wrappers on the stack.
- .set_debugger_cleanup(callback : -> Void) : Void
- .set_language_object(obj : Pointer(Void)) : Void
- .set_language_registered(registered : Bool) : Void
- .set_loader_registered(registered : Bool) : Void
- .set_reloading(reloading : Bool) : Void
- .set_saver_registered(registered : Bool) : Void
- .set_velocity(godot_obj : Pointer(Void), v : Vector3) : Void
- .static_ptrcall(method_bind : Pointer(Void), args : Pointer(Pointer(Void)), ret : Pointer(Void)) : Void
- .text_edit_get_line(text_edit : Pointer(Void), line : Int64) : String
- .trigger_debugger_cleanup : Void
- .type_from_variant(type : Int32, dst : Pointer(Void), variant_ptr : Pointer(Void)) : Void
- .unpack_variant_return_ptr(variant_ptr : Pointer(Void)) : Pointer(Void)
-
.unref_raw_n(ptr : Pointer(Void), instance_id : UInt64 = 0_u64, count : Int32 = 1) : Void
Decrements
RefCountedC++ reference countcounttimes, destroying the object ifunreference()returns true (should_free). - .unref_raw_once(ptr : Pointer(Void), instance_id : UInt64 = 0_u64) : Void
- .unregister_alive_instance(boxed : Pointer(Void)) : Void
- .unregister_alive_instance_by_ptr(godot_obj : Pointer(Void)) : Void
- .use_accumulated_input : Bool
- .use_accumulated_input=(enable : Bool) : Void
- .variant_destroy(variant_ptr : Pointer(Void)) : Void
- .variant_from_type(type : Int32, variant_ptr : Pointer(Void), src : Pointer(Void)) : Void
-
.verbose? : Bool
Engine Logging Helpers
- .warning(desc : String, msg : String = "", func : String = "", file : String = "", line : Int32 = 0) : Void
- .write_array_bridge_payload(arr : Array(T), ret_ptr : Pointer(Void)) : Void forall T
Macro Summary
-
early_register_component(class_name)
Early-registers an engine component if it is defined in the current compilation unit
-
unregister_component(class_name, display_name = nil)
Unregisters an engine component during bridge deinitialization if defined in the current compilation unit
Class Method Detail
Retrieves the active Crystal instance root table for testing and diagnostics
Drains queued RefCounted finalizer unreferences on the main thread.
Lock-free C-heap enqueue safe to invoke from Boehm GC finalizers on any thread.
Generic Engine Dispatchers
Prunes entries from @@alive_instances_by_ptr whose underlying native engine object
has already been freed by Godot (e.g., via queue_free on an ancestor node).
Executes all Crystal-side cache, singleton, loader, saver, and RefCounted teardown
BEFORE Godot runs ResourceCache::clear() and ObjectDB::cleanup().
Scrubs residual stack words so conservative Boehm GC does not falsely pin dead wrappers on the stack.
Decrements RefCounted C++ reference count count times, destroying the object
if unreference() returns true (should_free).
Macro Detail
Early-registers an engine component if it is defined in the current compilation unit
Unregisters an engine component during bridge deinitialization if defined in the current compilation unit