public class ResourceFormatSaver : Reference
The engine can save resources when you do it from the editor, or when you use the ResourceSaver singleton. This is accomplished thanks to multiple ResourceFormatSavers, each handling its own format and called automatically by the engine.
By default, Godot saves resources as
.res(binary) or another built-in format, but you can choose to create your own format by extending this class. Be sure to respect the documented return types and values. You should give it a global class name with
class_namefor it to be registered. Like built-in ResourceFormatSavers, it will be called automatically when saving resources of its recognized type(s). You may also implement a ResourceFormatLoader.
public virtual string GetRecognizedExtensions(Resource resource)
Returns the list of extensions available for saving the resource object, provided it is recognized (see Recognize(Godot.Resource)).
public virtual bool Recognize(Resource resource)
public virtual int Save(string path, Resource resource, int flags)
Saves the given resource object to a file at the target
flagsis a bitmask composed with ResourceSaver.SaverFlags constants.
Returns [constant OK] on success, or an [enum Error] constant in case of failure.