.. Generated automatically by doc/tools/makerst.py in Godot's source tree. .. DO NOT EDIT THIS FILE, but the ResourceFormatSaver.xml source instead. .. The source is found in doc/classes or modules//doc_classes. .. _class_ResourceFormatSaver: ResourceFormatSaver =================== **Inherits:** :ref:`Reference` **<** :ref:`Object` **Inherited By:** :ref:`GDNativeLibraryResourceSaver`, :ref:`ResourceFormatSaverBinary`, :ref:`ResourceFormatSaverGDScript`, :ref:`ResourceFormatSaverNativeScript`, :ref:`ResourceFormatSaverShader`, :ref:`ResourceFormatSaverText`, :ref:`ResourceSaverPNG` **Category:** Core Brief Description ----------------- Saves a specific resource type to a file. Methods ------- +-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`PoolStringArray` | :ref:`get_recognized_extensions` **(** :ref:`Resource` resource **)** virtual | +-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`recognize` **(** :ref:`Resource` resource **)** virtual | +-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`save` **(** :ref:`String` path, :ref:`Resource` resource, :ref:`int` flags **)** virtual | +-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ Description ----------- The engine can save resources when you do it from the editor, or when you call :ref:`ResourceSaver.save`. This is accomplished with multiple ``ResourceFormatSaver``\ s, each handling its own format. By default, Godot saves resources as ``.tres``, ``.res`` or another built-in format, but you can choose to create your own format by extending this class. You should give it a global class name with ``class_name`` for it to be registered. You may as well implement a :ref:`ResourceFormatLoader`. Method Descriptions ------------------- .. _class_ResourceFormatSaver_method_get_recognized_extensions: - :ref:`PoolStringArray` **get_recognized_extensions** **(** :ref:`Resource` resource **)** virtual Gets the list of extensions for files this saver is able to write. .. _class_ResourceFormatSaver_method_recognize: - :ref:`bool` **recognize** **(** :ref:`Resource` resource **)** virtual Returns true if the given resource object can be saved by this saver. .. _class_ResourceFormatSaver_method_save: - :ref:`int` **save** **(** :ref:`String` path, :ref:`Resource` resource, :ref:`int` flags **)** virtual Saves the given resource object to a file. ``flags`` is a bitmask composed with ``FLAG_*`` constants defined in :ref:`ResourceSaver`. Returns ``OK`` on success, or an ``ERR_*`` constant listed in :ref:`@GlobalScope` if it failed.