dm 7 лет назад
Родитель
Сommit
c90fe5b1bc
2 измененных файлов с 8 добавлено и 1 удалено
  1. 3 1
      oxygine/src/oxygine/tween/Tween.cpp
  2. 5 0
      oxygine/src/oxygine/tween/Tween.h

+ 3 - 1
oxygine/src/oxygine/tween/Tween.cpp

@@ -10,6 +10,7 @@ namespace oxygine
 		_loopsDone(0),
         _percent(0),
         _status(status_not_started),
+        _disabledStatusDone(false),
         _elapsed(0), _twoSides(false), _ease(ease_linear), _detach(false), _delay(0), _client(0), _globalEase(ease_linear)
     {
 
@@ -181,7 +182,8 @@ namespace oxygine
                         else
                             _percent = 1;
 
-                        _status = status_done;
+                        if (!_disabledStatusDone)
+                            _status = status_done;
                     }
                 }
                 _update(*_client, us);

+ 5 - 0
oxygine/src/oxygine/tween/Tween.h

@@ -151,6 +151,10 @@ namespace oxygine
         /**set callback when tween done. Doesn't allocate memory. faster than addDoneCallback*/
         void setDoneCallback(const EventCallback& cb);
 
+
+        /** tween will freeze on 100% and never complete  */
+        void setDisabledStatusDone(bool disabled) { _disabledStatusDone = disabled; }
+
     protected:
         void done(Actor&, const UpdateState& us);
 
@@ -178,6 +182,7 @@ namespace oxygine
         EASE _ease;
         EASE _globalEase;
         bool _twoSides;
+        bool _disabledStatusDone;
 
         float _percent;
         bool _detach;