class_editorresourcepreview.rst 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. :github_url: hide
  2. .. Generated automatically by doc/tools/makerst.py in Godot's source tree.
  3. .. DO NOT EDIT THIS FILE, but the EditorResourcePreview.xml source instead.
  4. .. The source is found in doc/classes or modules/<name>/doc_classes.
  5. .. _class_EditorResourcePreview:
  6. EditorResourcePreview
  7. =====================
  8. **Inherits:** :ref:`Node<class_Node>` **<** :ref:`Object<class_Object>`
  9. Helper to generate previews of resources or files.
  10. Description
  11. -----------
  12. This object is used to generate previews for resources of files.
  13. **Note:** This class shouldn't be instantiated directly. Instead, access the singleton using :ref:`EditorInterface.get_resource_previewer<class_EditorInterface_method_get_resource_previewer>`.
  14. Methods
  15. -------
  16. +------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  17. | void | :ref:`add_preview_generator<class_EditorResourcePreview_method_add_preview_generator>` **(** :ref:`EditorResourcePreviewGenerator<class_EditorResourcePreviewGenerator>` generator **)** |
  18. +------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  19. | void | :ref:`check_for_invalidation<class_EditorResourcePreview_method_check_for_invalidation>` **(** :ref:`String<class_String>` path **)** |
  20. +------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  21. | 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 **)** |
  22. +------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  23. | 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 **)** |
  24. +------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  25. | void | :ref:`remove_preview_generator<class_EditorResourcePreview_method_remove_preview_generator>` **(** :ref:`EditorResourcePreviewGenerator<class_EditorResourcePreviewGenerator>` generator **)** |
  26. +------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  27. Signals
  28. -------
  29. .. _class_EditorResourcePreview_signal_preview_invalidated:
  30. - **preview_invalidated** **(** :ref:`String<class_String>` path **)**
  31. Emitted if a preview was invalidated (changed). ``path`` corresponds to the path of the preview.
  32. Method Descriptions
  33. -------------------
  34. .. _class_EditorResourcePreview_method_add_preview_generator:
  35. - void **add_preview_generator** **(** :ref:`EditorResourcePreviewGenerator<class_EditorResourcePreviewGenerator>` generator **)**
  36. Create an own, custom preview generator.
  37. ----
  38. .. _class_EditorResourcePreview_method_check_for_invalidation:
  39. - void **check_for_invalidation** **(** :ref:`String<class_String>` path **)**
  40. Check if the resource changed, if so, it will be invalidated and the corresponding signal emitted.
  41. ----
  42. .. _class_EditorResourcePreview_method_queue_edited_resource_preview:
  43. - 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 **)**
  44. 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.
  45. ----
  46. .. _class_EditorResourcePreview_method_queue_resource_preview:
  47. - 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 **)**
  48. 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.
  49. ----
  50. .. _class_EditorResourcePreview_method_remove_preview_generator:
  51. - void **remove_preview_generator** **(** :ref:`EditorResourcePreviewGenerator<class_EditorResourcePreviewGenerator>` generator **)**
  52. Removes a custom preview generator.
  53. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  54. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  55. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`