From a93834c819a9d482a388909279190c84780375ed Mon Sep 17 00:00:00 2001 From: Hendrik Brucker <hendrik.brucker@mail.de> Date: Thu, 21 Apr 2022 00:08:35 +0200 Subject: Add gradient resource preview generator --- editor/plugins/editor_preview_plugins.h | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'editor/plugins/editor_preview_plugins.h') diff --git a/editor/plugins/editor_preview_plugins.h b/editor/plugins/editor_preview_plugins.h index 803f03f17e..73eb90dd86 100644 --- a/editor/plugins/editor_preview_plugins.h +++ b/editor/plugins/editor_preview_plugins.h @@ -182,4 +182,15 @@ public: EditorTileMapPatternPreviewPlugin(); ~EditorTileMapPatternPreviewPlugin(); }; + +class EditorGradientPreviewPlugin : public EditorResourcePreviewGenerator { + GDCLASS(EditorGradientPreviewPlugin, EditorResourcePreviewGenerator); + +public: + virtual bool handles(const String &p_type) const override; + virtual bool generate_small_preview_automatically() const override; + virtual Ref<Texture2D> generate(const RES &p_from, const Size2 &p_size) const override; + + EditorGradientPreviewPlugin(); +}; #endif // EDITORPREVIEWPLUGINS_H -- cgit v1.2.3