diff options
Diffstat (limited to 'scene/2d/animated_sprite.cpp')
| -rw-r--r-- | scene/2d/animated_sprite.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/scene/2d/animated_sprite.cpp b/scene/2d/animated_sprite.cpp index 1d2f91278..c062a6d1f 100644 --- a/scene/2d/animated_sprite.cpp +++ b/scene/2d/animated_sprite.cpp @@ -452,6 +452,7 @@ void AnimatedSprite::set_sprite_frames(const Ref<SpriteFrames> &p_frames) { _change_notify(); _reset_timeout(); update(); + update_configuration_warning(); } @@ -486,6 +487,8 @@ void AnimatedSprite::set_frame(int p_frame) { _change_notify("frame"); emit_signal(SceneStringNames::get_singleton()->frame_changed); + + } int AnimatedSprite::get_frame() const { @@ -646,6 +649,15 @@ StringName AnimatedSprite::get_animation() const{ return animation; } +String AnimatedSprite::get_configuration_warning() const { + + if (frames.is_null()) { + return TTR("A SpriteFrames resource must be created or set in the 'Frames' property in order for AnimatedSprite to display frames."); + } + + return String(); +} + void AnimatedSprite::_bind_methods() { |
