Callable

    A built-in type representing a method or a standalone function.

    Callable.swift:23
    class Callable

    Callable is a built-in Variant type that represents a function. It can either be a method within an Object instance, or a custom callable used for different purposes (see isCustom). Like all Variant types, it can be stored in variables and passed to other functions. It is most commonly used for signal callbacks.

    Example:

    In GDScript, it’s possible to create lambda functions within a method. Lambda functions are custom callables that are not associated with an Object instance. Optionally, lambda functions can also be named. The name will be displayed in the debugger, or when calling getMethod.

    In GDScript, you can access methods and global functions as Callables:

    Citizens in SwiftGodot

    Conformances

    • protocol ContentVariantRepresentable

      Some of Godot’s builtin classes use ContentType for storage. This needs to be public because it affects their initialization, but SwiftGodot users should never need to conform their types toContentVariantRepresentable.

    • protocol Copyable

      A type whose values can be implicitly or explicitly copied.

    • protocol Equatable

      A type that can be compared for value equality.

    • protocol Escapable
    • protocol VariantRepresentable

      Types that conform to VariantRepresentable can be stored directly in Variant with no conversion. These include all of the Variant types from Godot (for example GString, Rect, Plane), Godot objects (those that subclass SwiftGodot.Object) as well as the built-in Swift types UInt8, Int64 and Double.

    • protocol VariantStorable

      Types that conform to VariantStorable can be stored in a Variant and can be extracted back out of a Variant.

    Typealiases

    Type members

    Instance members

    Type features

    Instance features