mirror of
https://github.com/Relintai/pandemonium_engine_docs.git
synced 2025-02-02 15:55:58 +01:00
95 lines
6.8 KiB
ReStructuredText
95 lines
6.8 KiB
ReStructuredText
|
:github_url: hide
|
||
|
|
||
|
.. Generated automatically by doc/tools/make_rst.py in Godot's source tree.
|
||
|
.. DO NOT EDIT THIS FILE, but the EditorResourcePreview.xml source instead.
|
||
|
.. The source is found in doc/classes or modules/<name>/doc_classes.
|
||
|
|
||
|
.. _class_EditorResourcePreview:
|
||
|
|
||
|
EditorResourcePreview
|
||
|
=====================
|
||
|
|
||
|
**Inherits:** :ref:`Node<class_Node>` **<** :ref:`Object<class_Object>`
|
||
|
|
||
|
Helper to generate previews of resources or files.
|
||
|
|
||
|
Description
|
||
|
-----------
|
||
|
|
||
|
This object is used to generate previews for resources of files.
|
||
|
|
||
|
**Note:** This class shouldn't be instantiated directly. Instead, access the singleton using :ref:`EditorInterface.get_resource_previewer<class_EditorInterface_method_get_resource_previewer>`.
|
||
|
|
||
|
Methods
|
||
|
-------
|
||
|
|
||
|
+------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
|
| void | :ref:`add_preview_generator<class_EditorResourcePreview_method_add_preview_generator>` **(** :ref:`EditorResourcePreviewGenerator<class_EditorResourcePreviewGenerator>` generator **)** |
|
||
|
+------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
|
| void | :ref:`check_for_invalidation<class_EditorResourcePreview_method_check_for_invalidation>` **(** :ref:`String<class_String>` path **)** |
|
||
|
+------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
|
| void | :ref:`queue_edited_resource_preview<class_EditorResourcePreview_method_queue_edited_resource_preview>` **(** :ref:`Resource<class_Resource>` resource, :ref:`Object<class_Object>` receiver, :ref:`String<class_String>` receiver_func, :ref:`Variant<class_Variant>` userdata **)** |
|
||
|
+------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
|
| void | :ref:`queue_resource_preview<class_EditorResourcePreview_method_queue_resource_preview>` **(** :ref:`String<class_String>` path, :ref:`Object<class_Object>` receiver, :ref:`String<class_String>` receiver_func, :ref:`Variant<class_Variant>` userdata **)** |
|
||
|
+------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
|
| void | :ref:`remove_preview_generator<class_EditorResourcePreview_method_remove_preview_generator>` **(** :ref:`EditorResourcePreviewGenerator<class_EditorResourcePreviewGenerator>` generator **)** |
|
||
|
+------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
|
|
||
|
Signals
|
||
|
-------
|
||
|
|
||
|
.. _class_EditorResourcePreview_signal_preview_invalidated:
|
||
|
|
||
|
- **preview_invalidated** **(** :ref:`String<class_String>` path **)**
|
||
|
|
||
|
Emitted if a preview was invalidated (changed). ``path`` corresponds to the path of the preview.
|
||
|
|
||
|
Method Descriptions
|
||
|
-------------------
|
||
|
|
||
|
.. _class_EditorResourcePreview_method_add_preview_generator:
|
||
|
|
||
|
- void **add_preview_generator** **(** :ref:`EditorResourcePreviewGenerator<class_EditorResourcePreviewGenerator>` generator **)**
|
||
|
|
||
|
Create an own, custom preview generator.
|
||
|
|
||
|
----
|
||
|
|
||
|
.. _class_EditorResourcePreview_method_check_for_invalidation:
|
||
|
|
||
|
- void **check_for_invalidation** **(** :ref:`String<class_String>` path **)**
|
||
|
|
||
|
Check if the resource changed, if so, it will be invalidated and the corresponding signal emitted.
|
||
|
|
||
|
----
|
||
|
|
||
|
.. _class_EditorResourcePreview_method_queue_edited_resource_preview:
|
||
|
|
||
|
- void **queue_edited_resource_preview** **(** :ref:`Resource<class_Resource>` resource, :ref:`Object<class_Object>` receiver, :ref:`String<class_String>` receiver_func, :ref:`Variant<class_Variant>` userdata **)**
|
||
|
|
||
|
Queue the ``resource`` being edited for preview. Once the preview is ready, the ``receiver``'s ``receiver_func`` will be called. The ``receiver_func`` must take the following four arguments: :ref:`String<class_String>` path, :ref:`Texture<class_Texture>` preview, :ref:`Texture<class_Texture>` thumbnail_preview, :ref:`Variant<class_Variant>` userdata. ``userdata`` can be anything, and will be returned when ``receiver_func`` is called.
|
||
|
|
||
|
**Note:** If it was not possible to create the preview the ``receiver_func`` will still be called, but the preview will be null.
|
||
|
|
||
|
----
|
||
|
|
||
|
.. _class_EditorResourcePreview_method_queue_resource_preview:
|
||
|
|
||
|
- void **queue_resource_preview** **(** :ref:`String<class_String>` path, :ref:`Object<class_Object>` receiver, :ref:`String<class_String>` receiver_func, :ref:`Variant<class_Variant>` userdata **)**
|
||
|
|
||
|
Queue a resource file located at ``path`` for preview. Once the preview is ready, the ``receiver``'s ``receiver_func`` will be called. The ``receiver_func`` must take the following four arguments: :ref:`String<class_String>` path, :ref:`Texture<class_Texture>` preview, :ref:`Texture<class_Texture>` thumbnail_preview, :ref:`Variant<class_Variant>` userdata. ``userdata`` can be anything, and will be returned when ``receiver_func`` is called.
|
||
|
|
||
|
**Note:** If it was not possible to create the preview the ``receiver_func`` will still be called, but the preview will be null.
|
||
|
|
||
|
----
|
||
|
|
||
|
.. _class_EditorResourcePreview_method_remove_preview_generator:
|
||
|
|
||
|
- void **remove_preview_generator** **(** :ref:`EditorResourcePreviewGenerator<class_EditorResourcePreviewGenerator>` generator **)**
|
||
|
|
||
|
Removes a custom preview generator.
|
||
|
|
||
|
.. |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.)`
|