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.

    VariantRepresentable.swift:18
    protocol VariantRepresentable : VariantStorable
    Browse conforming types

    They each map to a specific Variant.GType value.

    If you want to make an additional type work with Variants that does not have a direct GType, you should instead conform that type to VariantStorable.

    Supertypes

    • protocol VariantStorable

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

    Requirements

    Type members

    Instance members

    Citizens in SwiftGodot

    Instance members

    Subtypes

    • 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 SelfVariantRepresentable

      Structs and scalar types use their own layout for storage.

    Citizens in SwiftGodot

    where Self:Object

    Type members