diff options
| author | Juan Linietsky | 2015-06-06 11:09:00 -0300 |
|---|---|---|
| committer | Juan Linietsky | 2015-06-06 11:09:00 -0300 |
| commit | 954256268afe89b648d356ee0b296a9e97a07373 (patch) | |
| tree | 36c42fb01f05d26bbae438d470676c9487b47a04 /scene/animation | |
| parent | 0e1510214a7585d5446f06344468ab52298cfa81 (diff) | |
| parent | ab99671bb835a5fe24a092ec34afe1ad862ac254 (diff) | |
| download | godot-954256268afe89b648d356ee0b296a9e97a07373.tar.gz godot-954256268afe89b648d356ee0b296a9e97a07373.tar.zst godot-954256268afe89b648d356ee0b296a9e97a07373.zip | |
Merge branch 'master' of https://github.com/okamstudio/godot
Conflicts:
demos/2d/motion/engine.cfg
Diffstat (limited to 'scene/animation')
| -rw-r--r-- | scene/animation/animation_player.cpp | 10 | ||||
| -rw-r--r-- | scene/animation/animation_player.h | 2 |
2 files changed, 7 insertions, 5 deletions
diff --git a/scene/animation/animation_player.cpp b/scene/animation/animation_player.cpp index c33265ea8..74ae2c0d5 100644 --- a/scene/animation/animation_player.cpp +++ b/scene/animation/animation_player.cpp @@ -967,14 +967,16 @@ String AnimationPlayer::get_current_animation() const { } -void AnimationPlayer::stop() { +void AnimationPlayer::stop(bool p_reset) { Playback &c=playback; c.blend.clear(); - c.current.from=NULL; + if (p_reset) { + c.current.from=NULL; + } _set_process(false); queued.clear(); - playing = false; + playing = false; } void AnimationPlayer::stop_all() { @@ -1211,7 +1213,7 @@ void AnimationPlayer::_bind_methods() { ObjectTypeDB::bind_method(_MD("get_default_blend_time"),&AnimationPlayer::get_default_blend_time); ObjectTypeDB::bind_method(_MD("play","name","custom_blend","custom_speed","from_end"),&AnimationPlayer::play,DEFVAL(""),DEFVAL(-1),DEFVAL(1.0),DEFVAL(false)); - ObjectTypeDB::bind_method(_MD("stop"),&AnimationPlayer::stop); + ObjectTypeDB::bind_method(_MD("stop","reset"),&AnimationPlayer::stop,DEFVAL(true)); ObjectTypeDB::bind_method(_MD("stop_all"),&AnimationPlayer::stop_all); ObjectTypeDB::bind_method(_MD("is_playing"),&AnimationPlayer::is_playing); ObjectTypeDB::bind_method(_MD("set_current_animation","anim"),&AnimationPlayer::set_current_animation); diff --git a/scene/animation/animation_player.h b/scene/animation/animation_player.h index 8d7d6d04e..3fddc283a 100644 --- a/scene/animation/animation_player.h +++ b/scene/animation/animation_player.h @@ -260,7 +260,7 @@ public: void play(const StringName& p_name=StringName(),float p_custom_blend=-1,float p_custom_scale=1.0,bool p_from_end=false); void queue(const StringName& p_name); void clear_queue(); - void stop(); + void stop(bool p_reset=true); bool is_playing() const; String get_current_animation() const; void set_current_animation(const String& p_anim); |
