dmuratshin 8 vuotta sitten
vanhempi
sitoutus
e077b72224
2 muutettua tiedostoa jossa 17 lisäystä ja 0 poistoa
  1. 12 0
      oxygine/src/Actor.cpp
  2. 5 0
      oxygine/src/Actor.h

+ 12 - 0
oxygine/src/Actor.cpp

@@ -1421,6 +1421,18 @@ namespace oxygine
         return t;
         return t;
     }
     }
 
 
+
+
+    spTween setTimeout(timeMS dur, const EventCallback& cb, spActor root)
+    {
+        if (!root)
+            root = getStage();
+        dur = std::max(dur, 1);
+        spTween t = root->addTween(TweenDummy(), dur);
+        t->setDoneCallback(cb);
+        return t;
+    }
+
     Transform getGlobalTransform2(spActor child, Actor* parent)
     Transform getGlobalTransform2(spActor child, Actor* parent)
     {
     {
         Transform t;
         Transform t;

+ 5 - 0
oxygine/src/Actor.h

@@ -383,6 +383,11 @@ namespace oxygine
         short   _zOrder;
         short   _zOrder;
     };
     };
 
 
+
+
+    /*Runs callback in time ms.Stage used as default actor*/
+    spTween setTimeout(timeMS dur, const EventCallback& cb, spActor root = 0);
+
     Vector2 convert_local2stage(spActor child, const Vector2& pos, spActor root = 0);
     Vector2 convert_local2stage(spActor child, const Vector2& pos, spActor root = 0);
     Vector2 convert_local2stage(const Actor* child, const Vector2& pos, const Actor* root = 0);
     Vector2 convert_local2stage(const Actor* child, const Vector2& pos, const Actor* root = 0);
     Vector2 convert_stage2local(spActor child, const Vector2& pos, spActor root = 0);
     Vector2 convert_stage2local(spActor child, const Vector2& pos, spActor root = 0);