Browse Source

fixed demo

dmuratshin 9 years ago
parent
commit
5ceb8506a2
1 changed files with 5 additions and 11 deletions
  1. 5 11
      examples/Demo/src/TestTweens.h

+ 5 - 11
examples/Demo/src/TestTweens.h

@@ -107,6 +107,7 @@ public:
         }
         }
 
 
         int dur = 2000;
         int dur = 2000;
+
         if (id == "TweenAnim")
         if (id == "TweenAnim")
         {
         {
             _addTween(createTween(TweenAnim(resources.getResAnim("anim")), dur / 4, 10));
             _addTween(createTween(TweenAnim(resources.getResAnim("anim")), dur / 4, 10));
@@ -119,8 +120,10 @@ public:
 
 
         if (id == "TweenRotationGlobalEase")
         if (id == "TweenRotationGlobalEase")
         {
         {
-            _addTween(createTween2(Actor::TweenRotation(_sprite->getRotation() + (float)MATH_PI * 2),
-                                   TweenOptions(500).loops(10)));
+            spTween tween = _sprite->addTween(
+                                Actor::TweenRotation(_sprite->getRotation() + (float)MATH_PI * 2),
+                                TweenOptions(500).loops(10).globalEase(_ease));
+            tween->addEventListener(TweenEvent::DONE, CLOSURE(this, &TweensTest::tweenDone));
         }
         }
 
 
         if (id == "TweenPosition")
         if (id == "TweenPosition")
@@ -161,15 +164,6 @@ public:
         if (id == "complete")
         if (id == "complete")
         {
         {
             _sprite->removeTweens(true);
             _sprite->removeTweens(true);
-            /*
-            spTween t = _sprite->getFirstTween();
-            while(t)
-            {
-                spTween next = t->getNextSibling();
-                t->complete();//removes self from actor
-                t = next;
-            }
-            */
         }
         }
 
 
     }
     }