EditorResourcePreview.xml 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <class name="EditorResourcePreview" inherits="Node" category="Core" version="3.1.2">
  3. <brief_description>
  4. Helper to generate previews of resources or files.
  5. </brief_description>
  6. <description>
  7. This object is used to generate previews for resources of files.
  8. </description>
  9. <tutorials>
  10. </tutorials>
  11. <methods>
  12. <method name="add_preview_generator">
  13. <return type="void">
  14. </return>
  15. <argument index="0" name="generator" type="EditorResourcePreviewGenerator">
  16. </argument>
  17. <description>
  18. Create an own, custom preview generator.
  19. </description>
  20. </method>
  21. <method name="check_for_invalidation">
  22. <return type="void">
  23. </return>
  24. <argument index="0" name="path" type="String">
  25. </argument>
  26. <description>
  27. Check if the resource changed, if so it will be invalidated and the corresponding signal emitted.
  28. </description>
  29. </method>
  30. <method name="queue_edited_resource_preview">
  31. <return type="void">
  32. </return>
  33. <argument index="0" name="resource" type="Resource">
  34. </argument>
  35. <argument index="1" name="receiver" type="Object">
  36. </argument>
  37. <argument index="2" name="receiver_func" type="String">
  38. </argument>
  39. <argument index="3" name="userdata" type="Variant">
  40. </argument>
  41. <description>
  42. 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.
  43. </description>
  44. </method>
  45. <method name="queue_resource_preview">
  46. <return type="void">
  47. </return>
  48. <argument index="0" name="path" type="String">
  49. </argument>
  50. <argument index="1" name="receiver" type="Object">
  51. </argument>
  52. <argument index="2" name="receiver_func" type="String">
  53. </argument>
  54. <argument index="3" name="userdata" type="Variant">
  55. </argument>
  56. <description>
  57. 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.
  58. </description>
  59. </method>
  60. <method name="remove_preview_generator">
  61. <return type="void">
  62. </return>
  63. <argument index="0" name="generator" type="EditorResourcePreviewGenerator">
  64. </argument>
  65. <description>
  66. Remove a custom preview generator.
  67. </description>
  68. </method>
  69. </methods>
  70. <signals>
  71. <signal name="preview_invalidated">
  72. <argument index="0" name="path" type="String">
  73. </argument>
  74. <description>
  75. If a preview was invalidated (changed) this signal will emit (using the path of the preview)
  76. </description>
  77. </signal>
  78. </signals>
  79. <constants>
  80. </constants>
  81. </class>