dync classref with current source

This commit is contained in:
Rémi Verschelde
2019-06-29 12:36:34 +02:00
parent 7d1e807f69
commit 05d7b34796
349 changed files with 3655 additions and 2920 deletions
+10 -4
View File
@@ -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: