diff options
Diffstat (limited to 'scene/2d/parallax_layer.cpp')
-rw-r--r-- | scene/2d/parallax_layer.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/scene/2d/parallax_layer.cpp b/scene/2d/parallax_layer.cpp index 4ed335dec8..ec1f1f40fa 100644 --- a/scene/2d/parallax_layer.cpp +++ b/scene/2d/parallax_layer.cpp @@ -136,11 +136,16 @@ void ParallaxLayer::set_base_offset_and_scale(const Point2 &p_offset, float p_sc } String ParallaxLayer::get_configuration_warning() const { + String warning = Node2D::get_configuration_warning(); + if (!Object::cast_to<ParallaxBackground>(get_parent())) { - return TTR("ParallaxLayer node only works when set as child of a ParallaxBackground node."); + if (!warning.empty()) { + warning += "\n\n"; + } + warning += TTR("ParallaxLayer node only works when set as child of a ParallaxBackground node."); } - return String(); + return warning; } void ParallaxLayer::_bind_methods() { |