mirror of
https://github.com/godotengine/godot-docs.git
synced 2025-12-31 17:49:03 +03:00
65 lines
3.0 KiB
ReStructuredText
65 lines
3.0 KiB
ReStructuredText
.. Generated automatically by doc/tools/makerst.py in Godot's source tree.
|
|
.. DO NOT EDIT THIS FILE, but the EditorResourcePreviewGenerator.xml source instead.
|
|
.. The source is found in doc/classes or modules/<name>/doc_classes.
|
|
|
|
.. _class_EditorResourcePreviewGenerator:
|
|
|
|
EditorResourcePreviewGenerator
|
|
==============================
|
|
|
|
**Inherits:** :ref:`Reference<class_reference>` **<** :ref:`Object<class_object>`
|
|
|
|
**Category:** Core
|
|
|
|
Brief Description
|
|
-----------------
|
|
|
|
Custom generator of previews.
|
|
|
|
Member Functions
|
|
----------------
|
|
|
|
+--------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`Texture<class_texture>` | :ref:`generate<class_EditorResourcePreviewGenerator_generate>` **(** :ref:`Resource<class_resource>` from **)** virtual |
|
|
+--------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`Texture<class_texture>` | :ref:`generate_from_path<class_EditorResourcePreviewGenerator_generate_from_path>` **(** :ref:`String<class_string>` path **)** virtual |
|
|
+--------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`bool<class_bool>` | :ref:`handles<class_EditorResourcePreviewGenerator_handles>` **(** :ref:`String<class_string>` type **)** virtual |
|
|
+--------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
|
Description
|
|
-----------
|
|
|
|
Custom code to generate previews. Please check "file_dialog/thumbnail_size" in EditorSettings to find out the right size to do previews at.
|
|
|
|
Member Function Description
|
|
---------------------------
|
|
|
|
.. _class_EditorResourcePreviewGenerator_generate:
|
|
|
|
- :ref:`Texture<class_texture>` **generate** **(** :ref:`Resource<class_resource>` from **)** virtual
|
|
|
|
Generate a preview from a given resource. This must be always implemented.
|
|
|
|
Returning an empty texture is an OK way to fail and let another generator take care.
|
|
|
|
Care must be taken because this function is always called from a thread (not the main thread).
|
|
|
|
.. _class_EditorResourcePreviewGenerator_generate_from_path:
|
|
|
|
- :ref:`Texture<class_texture>` **generate_from_path** **(** :ref:`String<class_string>` path **)** virtual
|
|
|
|
Generate a preview directly from a path, implementing this is optional, as default code will load and call generate()
|
|
|
|
Returning an empty texture is an OK way to fail and let another generator take care.
|
|
|
|
Care must be taken because this function is always called from a thread (not the main thread).
|
|
|
|
.. _class_EditorResourcePreviewGenerator_handles:
|
|
|
|
- :ref:`bool<class_bool>` **handles** **(** :ref:`String<class_string>` type **)** virtual
|
|
|
|
Return if your generator supports this resource type.
|
|
|
|
|