diff options
| author | Juan Linietsky | 2016-05-17 18:27:15 -0300 |
|---|---|---|
| committer | Juan Linietsky | 2016-05-17 18:28:44 -0300 |
| commit | c195c0df6b36debc870216dd42e49fbda70fa861 (patch) | |
| tree | 194a26e39ace86d7a471f3e86159c2aed6be261c /scene/2d/sprite.cpp | |
| parent | 3a26e14a2bab777c9ba6aedceff6e4ef2666faf0 (diff) | |
| download | godot-c195c0d.tar.gz godot-c195c0d.tar.zst godot-c195c0d.zip | |
-Added configuration warning system for nodes
-Added a new "add" and "instance" buttons for scene tree
-Added a vformat() function to ease translation work
Diffstat (limited to '')
| -rw-r--r-- | scene/2d/sprite.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/scene/2d/sprite.cpp b/scene/2d/sprite.cpp index b2902b286..aebb9a4c2 100644 --- a/scene/2d/sprite.cpp +++ b/scene/2d/sprite.cpp @@ -529,6 +529,25 @@ Rect2 ViewportSprite::get_item_rect() const { return Rect2(ofs,s); } +String ViewportSprite::get_configuration_warning() const { + + if (!has_node(viewport_path) || !get_node(viewport_path) || !get_node(viewport_path)->cast_to<Viewport>()) { + return TTR("Path property must point to a valid Viewport node to work. Such Viewport must be set to 'render target' mode."); + } else { + + Node *n = get_node(viewport_path); + if (n) { + Viewport *vp = n->cast_to<Viewport>(); + if (!vp->is_set_as_render_target()) { + + return TTR("The Viewport set in the path property must be set as 'render taget' in order for this sprite to work"); + } + } + } + + return String(); + +} void ViewportSprite::_bind_methods() { |
