|
@@ -368,7 +368,7 @@ void AnimatedSprite2D::_res_changed() {
|
|
update();
|
|
update();
|
|
}
|
|
}
|
|
|
|
|
|
-void AnimatedSprite2D::_set_playing(bool p_playing) {
|
|
|
|
|
|
+void AnimatedSprite2D::set_playing(bool p_playing) {
|
|
if (playing == p_playing) {
|
|
if (playing == p_playing) {
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
@@ -377,7 +377,7 @@ void AnimatedSprite2D::_set_playing(bool p_playing) {
|
|
set_process_internal(playing);
|
|
set_process_internal(playing);
|
|
}
|
|
}
|
|
|
|
|
|
-bool AnimatedSprite2D::_is_playing() const {
|
|
|
|
|
|
+bool AnimatedSprite2D::is_playing() const {
|
|
return playing;
|
|
return playing;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -391,15 +391,11 @@ void AnimatedSprite2D::play(const StringName &p_animation, const bool p_backward
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- _set_playing(true);
|
|
|
|
|
|
+ set_playing(true);
|
|
}
|
|
}
|
|
|
|
|
|
void AnimatedSprite2D::stop() {
|
|
void AnimatedSprite2D::stop() {
|
|
- _set_playing(false);
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
-bool AnimatedSprite2D::is_playing() const {
|
|
|
|
- return playing;
|
|
|
|
|
|
+ set_playing(false);
|
|
}
|
|
}
|
|
|
|
|
|
float AnimatedSprite2D::_get_frame_duration() {
|
|
float AnimatedSprite2D::_get_frame_duration() {
|
|
@@ -457,12 +453,11 @@ void AnimatedSprite2D::_bind_methods() {
|
|
ClassDB::bind_method(D_METHOD("set_animation", "animation"), &AnimatedSprite2D::set_animation);
|
|
ClassDB::bind_method(D_METHOD("set_animation", "animation"), &AnimatedSprite2D::set_animation);
|
|
ClassDB::bind_method(D_METHOD("get_animation"), &AnimatedSprite2D::get_animation);
|
|
ClassDB::bind_method(D_METHOD("get_animation"), &AnimatedSprite2D::get_animation);
|
|
|
|
|
|
- ClassDB::bind_method(D_METHOD("_set_playing", "playing"), &AnimatedSprite2D::_set_playing);
|
|
|
|
- ClassDB::bind_method(D_METHOD("_is_playing"), &AnimatedSprite2D::_is_playing);
|
|
|
|
|
|
+ ClassDB::bind_method(D_METHOD("set_playing", "playing"), &AnimatedSprite2D::set_playing);
|
|
|
|
+ ClassDB::bind_method(D_METHOD("is_playing"), &AnimatedSprite2D::is_playing);
|
|
|
|
|
|
ClassDB::bind_method(D_METHOD("play", "anim", "backwards"), &AnimatedSprite2D::play, DEFVAL(StringName()), DEFVAL(false));
|
|
ClassDB::bind_method(D_METHOD("play", "anim", "backwards"), &AnimatedSprite2D::play, DEFVAL(StringName()), DEFVAL(false));
|
|
ClassDB::bind_method(D_METHOD("stop"), &AnimatedSprite2D::stop);
|
|
ClassDB::bind_method(D_METHOD("stop"), &AnimatedSprite2D::stop);
|
|
- ClassDB::bind_method(D_METHOD("is_playing"), &AnimatedSprite2D::is_playing);
|
|
|
|
|
|
|
|
ClassDB::bind_method(D_METHOD("set_centered", "centered"), &AnimatedSprite2D::set_centered);
|
|
ClassDB::bind_method(D_METHOD("set_centered", "centered"), &AnimatedSprite2D::set_centered);
|
|
ClassDB::bind_method(D_METHOD("is_centered"), &AnimatedSprite2D::is_centered);
|
|
ClassDB::bind_method(D_METHOD("is_centered"), &AnimatedSprite2D::is_centered);
|
|
@@ -490,7 +485,7 @@ void AnimatedSprite2D::_bind_methods() {
|
|
ADD_PROPERTY(PropertyInfo(Variant::STRING_NAME, "animation"), "set_animation", "get_animation");
|
|
ADD_PROPERTY(PropertyInfo(Variant::STRING_NAME, "animation"), "set_animation", "get_animation");
|
|
ADD_PROPERTY(PropertyInfo(Variant::INT, "frame"), "set_frame", "get_frame");
|
|
ADD_PROPERTY(PropertyInfo(Variant::INT, "frame"), "set_frame", "get_frame");
|
|
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "speed_scale"), "set_speed_scale", "get_speed_scale");
|
|
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "speed_scale"), "set_speed_scale", "get_speed_scale");
|
|
- ADD_PROPERTY(PropertyInfo(Variant::BOOL, "playing"), "_set_playing", "_is_playing");
|
|
|
|
|
|
+ ADD_PROPERTY(PropertyInfo(Variant::BOOL, "playing"), "set_playing", "is_playing");
|
|
ADD_GROUP("Offset", "");
|
|
ADD_GROUP("Offset", "");
|
|
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "centered"), "set_centered", "is_centered");
|
|
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "centered"), "set_centered", "is_centered");
|
|
ADD_PROPERTY(PropertyInfo(Variant::VECTOR2, "offset"), "set_offset", "get_offset");
|
|
ADD_PROPERTY(PropertyInfo(Variant::VECTOR2, "offset"), "set_offset", "get_offset");
|