EditorResourcePreview.xml 2.9 KB

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