ClassRegistration

gdext.internal.register.ClassRegistration

Registers a user-defined Scala class with Godot's ClassDB.

This is the explicit builder substrate the macro layer (and hand-written code) targets. It fills a GDExtensionClassCreationInfo4 with static trampolines — the GDExtension callbacks cannot capture closures — that defer all per-class/per-instance behaviour to ClassRegistry via integer tokens (see Tokens).

Lifecycle wired here:

  • create: construct the parent engine object, build the Scala instance, link them with object_set_instance, and return the engine handle.
  • free: drop the Scala instance from the registry.
  • get_virtual: report which engine virtuals (_ready/_process/ _physics_process) the subclass overrides, handing Godot the matching static dispatcher.

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type

Members list

Value members

Concrete methods

def consumeReloadDetected(): Boolean

True iff this registration pass replaced a class left over from a prior library image (i.e. we are in a hot-reload, not a first load). Clears the flag so a later call does not see a stale true.

True iff this registration pass replaced a class left over from a prior library image (i.e. we are in a hot-reload, not a first load). Clears the flag so a later call does not see a stale true.

Attributes

def inputExport(instance: Long, args: Long, ret: Long): Unit
def physicsProcessExport(instance: Long, args: Long, ret: Long): Unit
def processExport(instance: Long, args: Long, ret: Long): Unit
def register(desc: ClassDescriptor): Unit

Register desc so Godot can instantiate and drive instances of it.

Register desc so Godot can instantiate and drive instances of it.

Attributes

def shortcutInputExport(instance: Long, args: Long, ret: Long): Unit
def unhandledInputExport(instance: Long, args: Long, ret: Long): Unit
def unhandledKeyInputExport(instance: Long, args: Long, ret: Long): Unit
def unregisterAll(): Unit

Unregister every class we registered with Godot. Called on deinitialize so a hot-reload starts from a clean slate; re-registering then succeeds instead of hitting Godot's "already registered" error.

Unregister every class we registered with Godot. Called on deinitialize so a hot-reload starts from a clean slate; re-registering then succeeds instead of hitting Godot's "already registered" error.

Attributes