Oxygine  1
2g game engine
TweenQueue.h
1 #pragma once
2 #include "oxygine-include.h"
3 #include "Tween.h"
4 
5 namespace oxygine
6 {
7  DECLARE_SMART(TweenQueue, spTweenQueue);
8  class TweenQueue : public Tween
9  {
10  public:
11 
12  enum { EVENT_LOOP_BEGIN = sysEventID('T', 'L', 'B'), };
13  enum { EVENT_LOOP_END = sysEventID('T', 'L', 'E'), };
14 
15  TweenQueue();
16 
18  static spTweenQueue create(spTween t1);
19 
21  static spTweenQueue create(spTween t1, spTween t2);
22 
24  static spTweenQueue create(spTween t1, spTween t2, spTween t3);
25 
27  static spTweenQueue create(spTween t1, spTween t2, spTween t3, spTween t4);
28 
30  static spTweenQueue create(spTween t1, spTween t2, spTween t3, spTween t4, spTween t5);
31 
33  static spTweenQueue create(spTween t1, spTween t2, spTween t3, spTween t4, spTween t5, spTween t6);
34 
36  static spTweenQueue create(spTween t1, spTween t2, spTween t3, spTween t4, spTween t5, spTween t6, spTween t7);
37 
38  /*Add new new tween to Queue, returns added tween*/
39  spTween add(spTween t);
40 
41  template<class GS>
42  spTween add(const GS& gs, timeMS duration, int loops = 1, bool twoSides = false, timeMS delay = 0, Tween::EASE ease = Tween::ease_linear);
43 
44  template<class GS>
45  spTween add(const GS& gs, const TweenOptions&);
46 
47  void complete(timeMS deltaTime);
48 
49  private:
50  void _start(Actor& actor);
51  void _update(Actor& actor, const UpdateState& us);
52 
54  tweens _tweens;
55  spTween _current;
56  int _loopsDone;
57  };
58 
59 
60  template<class GS>
61  spTween TweenQueue::add(const GS& gs, timeMS duration, int loops, bool twoSides, timeMS delay, Tween::EASE ease)
62  {
63  return add(createTween(gs, duration, loops, twoSides, delay, ease));
64  }
65 
66  template<class GS>
67  spTween TweenQueue::add(const GS& gs, const TweenOptions& opt)
68  {
69  return add(createTween2(gs, opt));
70  }
71 }
Definition: Actor.h:42
static spTweenQueue create(spTween t1)
void complete(timeMS deltaTime)
Definition: Actor.h:16
Definition: TweenQueue.h:8
Definition: UpdateState.h:6
–oxgl-end–!
Definition: Actor.h:14
Definition: Tween.h:37