Skip to content

Latest commit

 

History

History
85 lines (51 loc) · 5.86 KB

class_editorresourcepreview.rst

File metadata and controls

85 lines (51 loc) · 5.86 KB
github_url:hide

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.

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:`StringName<class_StringName>` 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:`StringName<class_StringName>` receiver_func, :ref:`Variant<class_Variant>` userdata )
void :ref:`remove_preview_generator<class_EditorResourcePreview_method_remove_preview_generator>` ( :ref:`EditorResourcePreviewGenerator<class_EditorResourcePreviewGenerator>` generator )

Signals

Emitted if a preview was invalidated (changed). path corresponds to the path of the preview.

Method Descriptions

Create an own, custom preview generator.


Check if the resource changed, if so, it will be invalidated and the corresponding signal emitted.


Queue a resource being edited for preview (using an instance). Once the preview is ready, your receiver.receiver_func will be called either containing the preview texture or an empty texture (if no preview was possible). Callback must have the format: (path,texture,userdata). Userdata can be anything.


Queue a resource file for preview (using a path). Once the preview is ready, your receiver.receiver_func will be called either containing the preview texture or an empty texture (if no preview was possible). Callback must have the format: (path,texture,userdata). Userdata can be anything.


Removes a custom preview generator.