gdext.builtin
Members list
Type members
Classlikes
Godot's AABB: an axis-aligned box, position and size (24 bytes).
Godot's AABB: an axis-aligned box, position and size (24 bytes).
Attributes
- Companion
- object
- Supertypes
-
trait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass AnyShow all
A typed view over Godot's GArray — Arr[A]. Elements marshal through the ToVariant/FromVariant seam, so any builtin- or (where a given exists) object-convertible A works. The sibling of Dict for sequences.
A typed view over Godot's GArray — Arr[A]. Elements marshal through the ToVariant/FromVariant seam, so any builtin- or (where a given exists) object-convertible A works. The sibling of Dict for sequences.
The backing 8-byte Array handle is heap-owned so an Arr can live in a class field (an exported property) for the object's lifetime. As with the rest of the binding, freeing is explicit / process-lifetime (Phase 4 lifetimes).
Attributes
- Companion
- object
- Supertypes
-
trait AutoCloseableclass Objecttrait Matchableclass Any
Godot's Basis: a 3x3 matrix, stored flat so one value is one object.
Godot's Basis: a 3x3 matrix, stored flat so one value is one object.
Fields are named by column, as in GDScript: column x is (xx, xy, xz), y is (yx, yy, yz), z is (zx, zy, zz). The engine stores rows, so row 0 is (xx, yx, zx). Euler order values follow Godot's EulerOrder (0 XYZ, 1 XZY, 2 YXZ, 3 YZX, 4 ZXY, 5 ZYX).
Attributes
- Companion
- object
- Supertypes
-
trait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass AnyShow all
Caches ptrcall function pointers for builtin-type methods (Array.size, Dictionary.keys, ...). Resolving one requires the type, a StringName of the method, and the method's hash from extension_api.json; the resulting function pointer is stable for the process, so it is memoized.
Caches ptrcall function pointers for builtin-type methods (Array.size, Dictionary.keys, ...). Resolving one requires the type, a StringName of the method, and the method's hash from extension_api.json; the resulting function pointer is stable for the process, so it is memoized.
This is the builtin-type analogue of the engine-class method binding Phase 2 will generate; it is kept minimal here to support the Phase 1 containers.
Attributes
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
BuiltinMethods.type
Self-test exercised from the SCENE initialize callback. Round-trips values through Variant and reports PASS/FAIL lines via the supplied logger.
Self-test exercised from the SCENE initialize callback. Round-trips values through Variant and reports PASS/FAIL lines via the supplied logger.
This runs against the live engine, so it is the real proof that the Variant marshalling (constructor cache, buffer sizes, type-pointer layout) is correct — something no amount of sbt compile can establish.
Attributes
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
BuiltinSelfTest.type
Byte sizes of Godot's builtin (Variant) types for the float_64 build configuration (Godot's default desktop build), from the API dump's builtin_class_sizes. These types are opaque blobs on the GDExtension boundary: the binding allocates exactly this many bytes and hands Godot a pointer, so a wrong size corrupts memory silently.
Byte sizes of Godot's builtin (Variant) types for the float_64 build configuration (Godot's default desktop build), from the API dump's builtin_class_sizes. These types are opaque blobs on the GDExtension boundary: the binding allocates exactly this many bytes and hands Godot a pointer, so a wrong size corrupts memory silently.
Attributes
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
BuiltinSizes.type
Attributes
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
Callable.type
Godot's Color: RGBA as single-precision floats (16 bytes), usually in 0..1. The named colors (Color.RED, Color.ALICE_BLUE, ...) come from the engine's API dump; see ColorNames.
Godot's Color: RGBA as single-precision floats (16 bytes), usually in 0..1. The named colors (Color.RED, Color.ALICE_BLUE, ...) come from the engine's API dump; see ColorNames.
Attributes
- Companion
- object
- Supertypes
-
trait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass AnyShow all
Godot's named colors, reachable as Color.RED, Color.ALICE_BLUE, ...
Godot's named colors, reachable as Color.RED, Color.ALICE_BLUE, ...
Attributes
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
ColorNames.type
A typed view over Godot's Dictionary — Dict[K, V]. Keys and values marshal through the ToVariant/FromVariant seam, so any builtin- or (where a given exists) object-convertible K/V works.
A typed view over Godot's Dictionary — Dict[K, V]. Keys and values marshal through the ToVariant/FromVariant seam, so any builtin- or (where a given exists) object-convertible K/V works.
The backing 8-byte Dictionary handle is heap-owned so a Dict can live in a class field (an exported property) for the object's lifetime. As with the rest of the binding, freeing is explicit / process-lifetime (Phase 4 lifetimes).
Attributes
- Companion
- object
- Supertypes
-
trait AutoCloseableclass Objecttrait Matchableclass Any
Attributes
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
Dictionary.type
Decodes a Scala value out of a Godot Variant.
Decodes a Scala value out of a Godot Variant.
Attributes
- Companion
- object
- Supertypes
-
class Objecttrait Matchableclass Any
Attributes
- Companion
- trait
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
FromVariant.type
Godot's scalar math helpers (core/math/math_funcs.h), in single precision like the engine's real_t. The math builtins are built on these, so their results match the engine's own implementations.
Godot's scalar math helpers (core/math/math_funcs.h), in single precision like the engine's real_t. The math builtins are built on these, so their results match the engine's own implementations.
Attributes
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
GodotMath.type
Reads the property names of an arbitrary engine object via Object.get_property_list.
Reads the property names of an arbitrary engine object via Object.get_property_list.
Object.get_property_list returns typedarray::Dictionary (ABI-identical to an untyped Array of Dictionary), which the code generator drops — so this is the bespoke reader. It ptrcalls the bind into an Array buffer, then reads each element Dictionary's "name" key (a String). Used to enumerate an AnimationTree's parameters/... paths, which have no dedicated list method.
Attributes
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
ObjectPropertyList.type
Heap-owned PackedFloat32Array / PackedVector3Array values. The 16-byte handle lives in malloc'd storage so the value can outlive a call frame; call free when done (destroys the engine value and releases the storage).
Heap-owned PackedFloat32Array / PackedVector3Array values. The 16-byte handle lives in malloc'd storage so the value can outlive a call frame; call free when done (destroys the engine value and releases the storage).
Element access goes through the packed_*_operator_index interface functions, which return an interior pointer (the non-const variant triggers copy-on-write first). Indices are bounds-checked on the Scala side: the engine returns null for an out-of-range index, and dereferencing that segfaults.
Attributes
- Companion
- object
- Supertypes
-
trait AutoCloseableclass Objecttrait Matchableclass Any
- Known subtypes
Attributes
- Companion
- class
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
PackedArray.type
Attributes
- Companion
- object
- Supertypes
Attributes
- Companion
- class
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
PackedFloat32Array.type
Attributes
- Companion
- object
- Supertypes
Attributes
- Companion
- class
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
PackedInt32Array.type
Reads a PackedStringArray returned by a no-argument engine method into a Scala Seq[String].
Reads a PackedStringArray returned by a no-argument engine method into a Scala Seq[String].
The code generator drops methods whose return type is PackedStringArray (the Ptrcall seam has no case for it), so the few we need — AnimationMixer.get_animation_list, SpriteFrames.get_animation_names — are unreachable through generated wrappers. This is the bespoke reader for them: call the bind via object_method_bind_ptrcall into a heap-sized buffer, read the element count via the PackedStringArray.size builtin method, then decode each element through packed_string_array_operator_index (which hands back an interior pointer to the element String — read it, never destroy it). The array value itself is owned by us and destroyed when done.
Attributes
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
Attributes
- Companion
- object
- Supertypes
Attributes
- Companion
- class
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
PackedVector3Array.type
Godot's Plane: a normal and the distance d from the origin (16 bytes).
Godot's Plane: a normal and the distance d from the origin (16 bytes).
Attributes
- Companion
- object
- Supertypes
-
trait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass AnyShow all
Godot's Projection: a 4x4 matrix of columns x, y, z, w (each a Vector4), stored flat (16 floats) so one value is one object. Field xy is column x, component y. Plane indices for getProjectionPlane: 0 near, 1 far, 2 left, 3 top, 4 right, 5 bottom.
Godot's Projection: a 4x4 matrix of columns x, y, z, w (each a Vector4), stored flat (16 floats) so one value is one object. Field xy is column x, component y. Plane indices for getProjectionPlane: 0 near, 1 far, 2 left, 3 top, 4 right, 5 bottom.
Attributes
- Companion
- object
- Supertypes
-
trait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass AnyShow all
Attributes
- Companion
- class
- Supertypes
-
trait Producttrait Mirrorclass Objecttrait Matchableclass Any
- Self type
-
Projection.type
Godot's Quaternion: a rotation as (x, y, z, w) (16 bytes).
Godot's Quaternion: a rotation as (x, y, z, w) (16 bytes).
Attributes
- Companion
- object
- Supertypes
-
trait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass AnyShow all
Attributes
- Companion
- class
- Supertypes
-
trait Producttrait Mirrorclass Objecttrait Matchableclass Any
- Self type
-
Quaternion.type
Godot's Rect2: a position and a size (16 bytes).
Godot's Rect2: a position and a size (16 bytes).
Attributes
- Companion
- object
- Supertypes
-
trait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass AnyShow all
Godot's Rect2i: an integer position and size (16 bytes).
Godot's Rect2i: an integer position and size (16 bytes).
Attributes
- Companion
- object
- Supertypes
-
trait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass AnyShow all
Attributes
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
StringName.type
Process-lifetime cache of StringNames keyed by their Scala string.
Process-lifetime cache of StringNames keyed by their Scala string.
Entries are allocated with libc malloc (not the GC) so the 8-byte handle has a stable address for the whole process and is never moved or collected; they are intentionally never freed (the cache lives as long as the extension). This mirrors how name interning is meant to be used.
Attributes
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
StringNames.type
Encodes a Scala value into a (caller-allocated) Godot Variant.
Encodes a Scala value into a (caller-allocated) Godot Variant.
Attributes
- Companion
- object
- Supertypes
-
class Objecttrait Matchableclass Any
Godot's Transform2D: columns x = (xx, xy), y = (yx, yy) and origin = (ox, oy), stored flat (6 floats) so one value is one object.
Godot's Transform2D: columns x = (xx, xy), y = (yx, yy) and origin = (ox, oy), stored flat (6 floats) so one value is one object.
Attributes
- Companion
- object
- Supertypes
-
trait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass AnyShow all
Attributes
- Companion
- class
- Supertypes
-
trait Producttrait Mirrorclass Objecttrait Matchableclass Any
- Self type
-
Transform2D.type
Godot's Transform3D: a Basis plus an origin, stored flat (12 floats) so one value is one object. Basis fields are named by column as in Basis; ox, oy, oz is the origin. basis and origin build views on demand.
Godot's Transform3D: a Basis plus an origin, stored flat (12 floats) so one value is one object. Basis fields are named by column as in Basis; ox, oy, oz is the origin. basis and origin build views on demand.
Attributes
- Companion
- object
- Supertypes
-
trait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass AnyShow all
Attributes
- Companion
- class
- Supertypes
-
trait Producttrait Mirrorclass Objecttrait Matchableclass Any
- Self type
-
Transform3D.type
Caches the engine's per-type Variant constructor functions.
Caches the engine's per-type Variant constructor functions.
get_variant_from_type_constructor / ..._to_type_constructor are relatively expensive lookups, but the function pointer they return is stable for the lifetime of the process. gdext caches these in a table indexed by variant type; we do the same.
Variant type tags are small contiguous integers (NIL=0 .. MAX), so a flat array indexed by the tag is the natural cache. The cache is populated lazily on first use of each type and never invalidated.
Attributes
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
VariantConstructors.type
Primitive Variant reads and writes at Long addresses, for the registration trampolines: no Ptr crosses a method boundary and no primitive is boxed, so a call allocates nothing. Internal: public only because inlined registration code in game projects references it.
Primitive Variant reads and writes at Long addresses, for the registration trampolines: no Ptr crosses a method boundary and no primitive is boxed, so a call allocates nothing. Internal: public only because inlined registration code in game projects references it.
Attributes
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
VariantIO.type
Godot's Vector2: two single-precision components (8 bytes). The whole engine API is implemented in Scala (ported from core/math), so no method calls into the engine. Zero-argument methods take no parentheses.
Godot's Vector2: two single-precision components (8 bytes). The whole engine API is implemented in Scala (ported from core/math), so no method calls into the engine. Zero-argument methods take no parentheses.
Attributes
- Companion
- object
- Supertypes
-
trait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass AnyShow all
Godot's Vector2i: two 32-bit integer components (8 bytes).
Godot's Vector2i: two 32-bit integer components (8 bytes).
Attributes
- Companion
- object
- Supertypes
-
trait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass AnyShow all
Godot's Vector3: three single-precision components (12 bytes). The whole engine API is implemented in Scala (ported from core/math).
Godot's Vector3: three single-precision components (12 bytes). The whole engine API is implemented in Scala (ported from core/math).
Attributes
- Companion
- object
- Supertypes
-
trait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass AnyShow all
Godot's Vector3i: three 32-bit integer components (12 bytes).
Godot's Vector3i: three 32-bit integer components (12 bytes).
Attributes
- Companion
- object
- Supertypes
-
trait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass AnyShow all
Godot's Vector4: four single-precision components (16 bytes).
Godot's Vector4: four single-precision components (16 bytes).
Attributes
- Companion
- object
- Supertypes
-
trait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass AnyShow all
Godot's Vector4i: four 32-bit integer components (16 bytes).
Godot's Vector4i: four 32-bit integer components (16 bytes).
Attributes
- Companion
- object
- Supertypes
-
trait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass AnyShow all
Types
Godot's Callable (16 bytes, BuiltinSizes.Callable).
Godot's Callable (16 bytes, BuiltinSizes.Callable).
Built bound to an object + method name via the engine's builtin constructor (Callable constructor index 2 = (Object, StringName)). When the engine later invokes it — e.g. a connected signal fires — it calls that method on that object. For one of our registered classes, that routes back into Scala through the method-call trampoline (so the bound method must be registered, e.g. via gdext.internal.register.MethodRegistration).
Represented as a pointer to its 16-byte storage, like StringName.
Attributes
Godot's Dictionary. An 8-byte (BuiltinSizes.Dictionary) reference- counted handle.
Godot's Dictionary. An 8-byte (BuiltinSizes.Dictionary) reference- counted handle.
dictionary_operator_index returns a pointer to the Variant slot for a key, inserting a nil slot if the key is absent — so it serves both get and the lvalue side of set. size/has go through the builtin-method machinery, same as GArray.
Attributes
Godot's untyped Array. An 8-byte (BuiltinSizes.Array) reference-counted handle to a heap-backed variant array.
Godot's untyped Array. An 8-byte (BuiltinSizes.Array) reference-counted handle to a heap-backed variant array.
Element access uses array_operator_index, which hands back a pointer to the Variant slot inside the array (no copy). Mutating operations (push_back, size, ...) go through the engine's builtin-method machinery, keyed by the method hashes baked from extension_api.json (Godot 4.5). Phase 2 will generate these hash constants rather than hand-listing them.
Attributes
Godot's String (named GString to avoid clashing with scala.String).
Godot's String (named GString to avoid clashing with scala.String).
Physically an 8-byte (BuiltinSizes.String) reference-counted handle. Conversion in both directions copies UTF-16 code units (Scala's own string representation) through the *_utf16_* interface functions, using the two-call length probe for reads.
Strings are reference-counted, so a constructed GString must be destroyed when no longer needed; GString.scope does this automatically.
Attributes
Godot's StringName — an interned, 8-byte (BuiltinSizes.StringName) reference-counted handle used pervasively for method, class, property and signal names. Lookups by StringName are O(1) pointer comparisons engine-side, which is why every classdb/method API takes one.
Godot's StringName — an interned, 8-byte (BuiltinSizes.StringName) reference-counted handle used pervasively for method, class, property and signal names. Lookups by StringName are O(1) pointer comparisons engine-side, which is why every classdb/method API takes one.
Because the same names (class names, method names) are used over and over, StringNames are cached for the process lifetime via StringNames.cached rather than rebuilt per call — gdext does the same.
Attributes
A Godot Variant — the dynamically-typed value all of Godot's scripting and reflection traffics in.
A Godot Variant — the dynamically-typed value all of Godot's scripting and reflection traffics in.
Physically this is a ptr to a BuiltinSizes.Variant-byte buffer that Godot owns the contents of. Constructing a Variant from a value, and reading a value back out, go through the engine's per-type constructor functions (cached in VariantConstructors), matching gdext's approach exactly.
Memory: the backing buffer here is provided by the caller (typically stack- allocated within a Variant.scope). A Variant may hold a reference-counted payload (e.g. a String or Object), so when you are done with one you must destroy it to release that payload; the buffer itself is reclaimed by whoever allocated it.