From 855f4dc1930007f13f32bed5572aa812e32f9e63 Mon Sep 17 00:00:00 2001 From: Rasmus Vermeulen Date: Tue, 17 Mar 2020 21:33:36 +0100 Subject: Add size warning to Viewport Node --- scene/main/viewport.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scene/main/viewport.cpp b/scene/main/viewport.cpp index dfd55e2577..dbb0e8215a 100644 --- a/scene/main/viewport.cpp +++ b/scene/main/viewport.cpp @@ -2948,12 +2948,14 @@ Control *Viewport::get_modal_stack_top() const { } String Viewport::get_configuration_warning() const { - /*if (get_parent() && !Object::cast_to(get_parent()) && !render_target) { return TTR("This viewport is not set as render target. If you intend for it to display its contents directly to the screen, make it a child of a Control so it can obtain a size. Otherwise, make it a RenderTarget and assign its internal texture to some node for display."); }*/ + if (size.x == 0 || size.y == 0) { + return TTR("This viewport can't render anything.\nConsider increasing the size."); + } return String(); } -- cgit v1.2.3