RID
A handle for a Resource
’s unique identifier.
class RID
The RID Variant
type is used to access a low-level resource by its unique ID. RIDs are opaque, which means they do not grant access to the resource by themselves. They are used by the low-level server classes, such as DisplayServer
, RenderingServer
, TextServer
, etc.
A low-level resource may correspond to a high-level Resource
, such as Texture
or Mesh
.
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 to
ContentVariantRepresentable
.protocol Equatable
A type that can be compared for value equality.
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 exampleGString
,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
init(
) Constructs an empty
RID
with the invalid ID0
.init(alreadyOwnedContent: ContentType
) init(content: ContentType
) init(from: RID
) static var godotType: Variant.GType
static let zero: ContentType
static func != (lhs: RID, rhs: RID
) -> Bool Returns
true
if theRID
s are not equal.static func < (lhs: RID, rhs: RID
) -> Bool Returns
true
if theRID
’s ID is less thanright
’s ID.static func <= (lhs: RID, rhs: RID
) -> Bool Returns
true
if theRID
’s ID is less than or equal toright
’s ID.static func == (lhs: RID, rhs: RID
) -> Bool Returns
true
if bothRID
s are equal, which means they both refer to the same low-level resource.static func > (lhs: RID, rhs: RID
) -> Bool Returns
true
if theRID
’s ID is greater thanright
’s ID.static func >= (lhs: RID, rhs: RID
) -> Bool Returns
true
if theRID
’s ID is greater than or equal toright
’s ID.
Instance members
var content: ContentType
func getId(
) -> Int64 Returns the ID of the referenced low-level resource.
func isValid(
) -> Bool Returns
true
if theRID
is not0
.
Type features
init?(Variant
) static func makeOrUnwrap(Variant
) -> Self? Unwraps an object from a variant.
static func makeOrUnwrap(Variant
) -> Self? Unwraps an object from a variant. This is useful when you want one method to call that will return the unwrapped Variant, regardless of whether it is a SwiftGodot.Object or not.
static func != (lhs: Self, rhs: Self
) -> Bool Returns a Boolean value indicating whether two values are not equal.