EditorResourcePreview

Inherits: Node < Object

Helper to generate previews of resources or files.

Description

This object is used to generate previews for resources of files.

Methods

voidadd_preview_generator ( EditorResourcePreviewGenerator generator )
voidcheck_for_invalidation ( String path )
voidqueue_edited_resource_preview ( Resource resource, Object receiver, String receiver_func, Variant userdata )
voidqueue_resource_preview ( String path, Object receiver, String receiver_func, Variant userdata )
voidremove_preview_generator ( EditorResourcePreviewGenerator generator )

Signals

  • preview_invalidated ( String path )

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

Method Descriptions

Create an own, custom preview generator.


  • void check_for_invalidation ( String path )

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.

Doc ID missing

Disclaimer: This page has been automaticaly and directly extracted from the official Godot Docs website, the 1970-01-01 at 00:00:00. It’s the English Stable version because it’s what most Godot users should use. The Copyright owners are Juan Linietsky, Ariel Manzur and the Godot community. CC-BY 3.0. Thanks for your patience and generosity.