godot.api.traits

Compile-time introspection of Godot types

Members

Enums

GodotBaseClass
enum GodotBaseClass

A UDA with which base Godot classes are marked. NOT used by new D classes.

Functions

assumeNoGC
auto assumeNoGC(T t)

https://p0nce.github.io/d-idioms/#Bypassing-@nogc Casts @nogc out of a function or delegate type.

getDefaultValueFromAlias
auto getDefaultValueFromAlias()

Get the Godot-compatible default value of a field in T.

getGDExtensionObject
godot_object getGDExtensionObject(T t)
Undocumented in source. Be warned that the author may not have intended to support it.
getGDExtensionObject
godot_object getGDExtensionObject(R r)
Undocumented in source. Be warned that the author may not have intended to support it.
getGodotObject
GodotClass!T getGodotObject(T t)

Get the C++ Godot Object pointer of either a Godot Object OR a D native script.

getGodotObject
GodotClass!(NonRef!R) getGodotObject(R r)
Undocumented in source. Be warned that the author may not have intended to support it.

Templates

GodotBaseClasses
template GodotBaseClasses(T)

A list of all of T's base classes, both script and C++, ending with GodotObject.

GodotClass
template GodotClass(R)

Get the Godot class of R (the class of the owner for D native scripts)

NonRef
template NonRef(R)

Removes the Ref wrapper from R, if present

RefOrT
template RefOrT(T)

Adds the Ref wrapper to T, if T is a Reference type

extends
template extends(R, ParentR)

Checks whether R is a subtype of ParentR by Godot's script inheritance system. Both D script and C++ classes are accounted for. If R and ParentR are the same, extends is true as well.

extendsGodotBaseClass
template extendsGodotBaseClass(T)

Determine if T is a D native script (extends a Godot base class).

from
template from(string moduleName)
Undocumented in source.
godotDefaultInit
template godotDefaultInit(T)

Alias to default-constructed T, as an expression.

godotName
template godotName(alias a)
Undocumented in source.
isGodotBaseClass
template isGodotBaseClass(T)

Determine if T is a class originally from the Godot Engine (but *not* a new D class registered to Godot).

Variables

dName
enum string dName(alias a);
Undocumented in source.
isGodotClass
enum bool isGodotClass(T);

Determine if T is any Godot class (base C++ class or D native script, but NOT a godot struct)

Meta