class_editorresourcepreviewgenerator.rst 3.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. .. Generated automatically by doc/tools/makerst.py in Godot's source tree.
  2. .. DO NOT EDIT THIS FILE, but the EditorResourcePreviewGenerator.xml source instead.
  3. .. The source is found in doc/classes or modules/<name>/doc_classes.
  4. .. _class_EditorResourcePreviewGenerator:
  5. EditorResourcePreviewGenerator
  6. ==============================
  7. **Inherits:** :ref:`Reference<class_reference>` **<** :ref:`Object<class_object>`
  8. **Category:** Core
  9. Brief Description
  10. -----------------
  11. Custom generator of previews.
  12. Member Functions
  13. ----------------
  14. +--------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------+
  15. | :ref:`Texture<class_texture>` | :ref:`generate<class_EditorResourcePreviewGenerator_generate>` **(** :ref:`Resource<class_resource>` from **)** virtual |
  16. +--------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------+
  17. | :ref:`Texture<class_texture>` | :ref:`generate_from_path<class_EditorResourcePreviewGenerator_generate_from_path>` **(** :ref:`String<class_string>` path **)** virtual |
  18. +--------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------+
  19. | :ref:`bool<class_bool>` | :ref:`handles<class_EditorResourcePreviewGenerator_handles>` **(** :ref:`String<class_string>` type **)** virtual |
  20. +--------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------+
  21. Description
  22. -----------
  23. Custom code to generate previews. Please check "file_dialog/thumbnail_size" in EditorSettings to find out the right size to do previews at.
  24. Member Function Description
  25. ---------------------------
  26. .. _class_EditorResourcePreviewGenerator_generate:
  27. - :ref:`Texture<class_texture>` **generate** **(** :ref:`Resource<class_resource>` from **)** virtual
  28. Generate a preview from a given resource. This must be always implemented.
  29. Returning an empty texture is an OK way to fail and let another generator take care.
  30. Care must be taken because this function is always called from a thread (not the main thread).
  31. .. _class_EditorResourcePreviewGenerator_generate_from_path:
  32. - :ref:`Texture<class_texture>` **generate_from_path** **(** :ref:`String<class_string>` path **)** virtual
  33. Generate a preview directly from a path, implementing this is optional, as default code will load and call generate()
  34. Returning an empty texture is an OK way to fail and let another generator take care.
  35. Care must be taken because this function is always called from a thread (not the main thread).
  36. .. _class_EditorResourcePreviewGenerator_handles:
  37. - :ref:`bool<class_bool>` **handles** **(** :ref:`String<class_string>` type **)** virtual
  38. Return if your generator supports this resource type.