classref: Sync with latest 4.0-dev

This commit is contained in:
Rémi Verschelde
2021-10-05 16:09:21 +02:00
parent 6952796767
commit f6f6c1bf19
958 changed files with 113054 additions and 52009 deletions

View File

@@ -9,7 +9,7 @@
EditorResourcePreviewGenerator
==============================
**Inherits:** :ref:`Reference<class_Reference>` **<** :ref:`Object<class_Object>`
**Inherits:** :ref:`RefCounted<class_RefCounted>` **<** :ref:`Object<class_Object>`
Custom generator of previews.
@@ -21,34 +21,34 @@ Custom code to generate previews. Please check ``file_dialog/thumbnail_size`` in
Methods
-------
+-----------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`can_generate_small_preview<class_EditorResourcePreviewGenerator_method_can_generate_small_preview>` **(** **)** virtual |
+-----------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Texture2D<class_Texture2D>` | :ref:`generate<class_EditorResourcePreviewGenerator_method_generate>` **(** :ref:`Resource<class_Resource>` from, :ref:`Vector2<class_Vector2>` size **)** virtual |
+-----------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Texture2D<class_Texture2D>` | :ref:`generate_from_path<class_EditorResourcePreviewGenerator_method_generate_from_path>` **(** :ref:`String<class_String>` path, :ref:`Vector2<class_Vector2>` size **)** virtual |
+-----------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`generate_small_preview_automatically<class_EditorResourcePreviewGenerator_method_generate_small_preview_automatically>` **(** **)** virtual |
+-----------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`handles<class_EditorResourcePreviewGenerator_method_handles>` **(** :ref:`String<class_String>` type **)** virtual |
+-----------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
+-----------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`_can_generate_small_preview<class_EditorResourcePreviewGenerator_method__can_generate_small_preview>` **(** **)** |virtual| |const| |
+-----------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Texture2D<class_Texture2D>` | :ref:`_generate<class_EditorResourcePreviewGenerator_method__generate>` **(** :ref:`Resource<class_Resource>` resource, :ref:`Vector2i<class_Vector2i>` size **)** |virtual| |const| |
+-----------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Texture2D<class_Texture2D>` | :ref:`_generate_from_path<class_EditorResourcePreviewGenerator_method__generate_from_path>` **(** :ref:`String<class_String>` path, :ref:`Vector2i<class_Vector2i>` size **)** |virtual| |const| |
+-----------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`_generate_small_preview_automatically<class_EditorResourcePreviewGenerator_method__generate_small_preview_automatically>` **(** **)** |virtual| |const| |
+-----------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`_handles<class_EditorResourcePreviewGenerator_method__handles>` **(** :ref:`String<class_String>` type **)** |virtual| |const| |
+-----------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
Method Descriptions
-------------------
.. _class_EditorResourcePreviewGenerator_method_can_generate_small_preview:
.. _class_EditorResourcePreviewGenerator_method__can_generate_small_preview:
- :ref:`bool<class_bool>` **can_generate_small_preview** **(** **)** virtual
- :ref:`bool<class_bool>` **_can_generate_small_preview** **(** **)** |virtual| |const|
If this function returns ``true``, the generator will call :ref:`generate<class_EditorResourcePreviewGenerator_method_generate>` or :ref:`generate_from_path<class_EditorResourcePreviewGenerator_method_generate_from_path>` for small previews as well.
If this function returns ``true``, the generator will call :ref:`_generate<class_EditorResourcePreviewGenerator_method__generate>` or :ref:`_generate_from_path<class_EditorResourcePreviewGenerator_method__generate_from_path>` for small previews as well.
By default, it returns ``false``.
----
.. _class_EditorResourcePreviewGenerator_method_generate:
.. _class_EditorResourcePreviewGenerator_method__generate:
- :ref:`Texture2D<class_Texture2D>` **generate** **(** :ref:`Resource<class_Resource>` from, :ref:`Vector2<class_Vector2>` size **)** virtual
- :ref:`Texture2D<class_Texture2D>` **_generate** **(** :ref:`Resource<class_Resource>` resource, :ref:`Vector2i<class_Vector2i>` size **)** |virtual| |const|
Generate a preview from a given resource with the specified size. This must always be implemented.
@@ -58,11 +58,11 @@ Care must be taken because this function is always called from a thread (not the
----
.. _class_EditorResourcePreviewGenerator_method_generate_from_path:
.. _class_EditorResourcePreviewGenerator_method__generate_from_path:
- :ref:`Texture2D<class_Texture2D>` **generate_from_path** **(** :ref:`String<class_String>` path, :ref:`Vector2<class_Vector2>` size **)** virtual
- :ref:`Texture2D<class_Texture2D>` **_generate_from_path** **(** :ref:`String<class_String>` path, :ref:`Vector2i<class_Vector2i>` size **)** |virtual| |const|
Generate a preview directly from a path with the specified size. Implementing this is optional, as default code will load and call :ref:`generate<class_EditorResourcePreviewGenerator_method_generate>`.
Generate a preview directly from a path with the specified size. Implementing this is optional, as default code will load and call :ref:`_generate<class_EditorResourcePreviewGenerator_method__generate>`.
Returning an empty texture is an OK way to fail and let another generator take care.
@@ -70,19 +70,25 @@ Care must be taken because this function is always called from a thread (not the
----
.. _class_EditorResourcePreviewGenerator_method_generate_small_preview_automatically:
.. _class_EditorResourcePreviewGenerator_method__generate_small_preview_automatically:
- :ref:`bool<class_bool>` **generate_small_preview_automatically** **(** **)** virtual
- :ref:`bool<class_bool>` **_generate_small_preview_automatically** **(** **)** |virtual| |const|
If this function returns ``true``, the generator will automatically generate the small previews from the normal preview texture generated by the methods :ref:`generate<class_EditorResourcePreviewGenerator_method_generate>` or :ref:`generate_from_path<class_EditorResourcePreviewGenerator_method_generate_from_path>`.
If this function returns ``true``, the generator will automatically generate the small previews from the normal preview texture generated by the methods :ref:`_generate<class_EditorResourcePreviewGenerator_method__generate>` or :ref:`_generate_from_path<class_EditorResourcePreviewGenerator_method__generate_from_path>`.
By default, it returns ``false``.
----
.. _class_EditorResourcePreviewGenerator_method_handles:
.. _class_EditorResourcePreviewGenerator_method__handles:
- :ref:`bool<class_bool>` **handles** **(** :ref:`String<class_String>` type **)** virtual
- :ref:`bool<class_bool>` **_handles** **(** :ref:`String<class_String>` type **)** |virtual| |const|
Returns ``true`` if your generator supports the resource of type ``type``.
.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
.. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
.. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
.. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`