mirror of
https://github.com/stan220/godot-docs.git
synced 2026-09-08 18:29:11 +00:00
dync classref with current source
This commit is contained in:
@@ -40,7 +40,7 @@ Godot loads resources in the editor or in exported games using ResourceFormatLoa
|
||||
|
||||
Extending this class allows you to define your own loader. Be sure to respect the documented return types and values. You should give it a global class name with ``class_name`` for it to be registered. Like built-in ResourceFormatLoaders, it will be called automatically when loading resources of its handled type(s). You may also implement a :ref:`ResourceFormatSaver<class_ResourceFormatSaver>`.
|
||||
|
||||
Note: You can also extend :ref:`EditorImportPlugin<class_EditorImportPlugin>` if the resource type you need exists but Godot is unable to load its format. Choosing one way over another depends if the format is suitable or not for the final exported game. For example, it's better to import ``.png`` textures as ``.stex`` (:ref:`StreamTexture<class_StreamTexture>`) first, so they can be loaded with better efficiency on the graphics card.
|
||||
**Note:** You can also extend :ref:`EditorImportPlugin<class_EditorImportPlugin>` if the resource type you need exists but Godot is unable to load its format. Choosing one way over another depends if the format is suitable or not for the final exported game. For example, it's better to import ``.png`` textures as ``.stex`` (:ref:`StreamTexture<class_StreamTexture>`) first, so they can be loaded with better efficiency on the graphics card.
|
||||
|
||||
Method Descriptions
|
||||
-------------------
|
||||
@@ -49,7 +49,9 @@ Method Descriptions
|
||||
|
||||
- void **get_dependencies** **(** :ref:`String<class_String>` path, :ref:`String<class_String>` add_types **)** virtual
|
||||
|
||||
If implemented, gets the dependencies of a given resource. If ``add_types`` is ``true``, paths should be appended ``::TypeName``, where ``TypeName`` is the class name of the dependency. Note that custom resource types defined by scripts aren't known by the :ref:`ClassDB<class_ClassDB>`, so you might just return ``"Resource"`` for them.
|
||||
If implemented, gets the dependencies of a given resource. If ``add_types`` is ``true``, paths should be appended ``::TypeName``, where ``TypeName`` is the class name of the dependency.
|
||||
|
||||
**Note:** Custom resource types defined by scripts aren't known by the :ref:`ClassDB<class_ClassDB>`, so you might just return ``"Resource"`` for them.
|
||||
|
||||
.. _class_ResourceFormatLoader_method_get_recognized_extensions:
|
||||
|
||||
@@ -61,13 +63,17 @@ Gets the list of extensions for files this loader is able to read.
|
||||
|
||||
- :ref:`String<class_String>` **get_resource_type** **(** :ref:`String<class_String>` path **)** virtual
|
||||
|
||||
Gets the class name of the resource associated with the given path. If the loader cannot handle it, it should return ``""``. Note that custom resource types defined by scripts aren't known by the :ref:`ClassDB<class_ClassDB>`, so you might just return ``"Resource"`` for them.
|
||||
Gets the class name of the resource associated with the given path. If the loader cannot handle it, it should return ``""``.
|
||||
|
||||
**Note:** Custom resource types defined by scripts aren't known by the :ref:`ClassDB<class_ClassDB>`, so you might just return ``"Resource"`` for them.
|
||||
|
||||
.. _class_ResourceFormatLoader_method_handles_type:
|
||||
|
||||
- :ref:`bool<class_bool>` **handles_type** **(** :ref:`String<class_String>` typename **)** virtual
|
||||
|
||||
Tells which resource class this loader can load. Note that custom resource types defined by scripts aren't known by the :ref:`ClassDB<class_ClassDB>`, so you might just handle ``"Resource"`` for them.
|
||||
Tells which resource class this loader can load.
|
||||
|
||||
**Note:** Custom resource types defined by scripts aren't known by the :ref:`ClassDB<class_ClassDB>`, so you might just handle ``"Resource"`` for them.
|
||||
|
||||
.. _class_ResourceFormatLoader_method_load:
|
||||
|
||||
|
||||
Reference in New Issue
Block a user