ResourceSaver
A singleton for saving Resource
s to the filesystem.
class ResourceSaver
A singleton for saving resource types to the filesystem.
It uses the many ResourceFormatSaver
classes registered in the engine (either built-in or from a plugin) to save resource data to text-based (e.g. .tres
or .tscn
) or binary files (e.g. .res
or .scn
).
Superclasses
class Object
Base class for all other classes in the engine.
Citizens in SwiftGodot
Conformances
protocol CustomStringConvertible
A type with a customized textual representation.
protocol Equatable
A type that can be compared for value equality.
protocol Hashable
A type that can be hashed into a
Hasher
to produce an integer hash value.protocol Identifiable<ID>
A class of types whose instances hold the value of an entity with stable identity.
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.
Types
Type members
static func addResourceFormatSaver(ResourceFormatSaver?, atFront: Bool
) Registers a new
ResourceFormatSaver
. The ResourceSaver will use the ResourceFormatSaver as described insave(resource:path:flags:)
.static func getRecognizedExtensions(type: Resource?
) -> PackedStringArray Returns the list of extensions available for saving a resource of a given type.
static func removeResourceFormatSaver(ResourceFormatSaver?
) Unregisters the given
ResourceFormatSaver
.static func save(resource: Resource?, path: String, flags: ResourceSaver.SaverFlags
) -> GodotError Saves a resource to disk to the given path, using a
ResourceFormatSaver
that recognizes the resource object. Ifpath
is empty,ResourceSaver
will try to useresourcePath
.class var godotClassName: StringName