PGE Engine
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Macros Pages
fader.h
1 /*
2  * Platformer Game Engine by Wohlstand, a free platform for game making
3  * Copyright (c) 2015 Vitaly Novichkov <admin@wohlnet.ru>
4  *
5  * This program is free software: you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation, either version 3 of the License, or
8  * any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program. If not, see <http://www.gnu.org/licenses/>.
17  */
18 
19 #ifndef PGE_FADER_H
20 #define PGE_FADER_H
21 
22 class PGE_Fader
23 {
24 public:
25  PGE_Fader();
26  PGE_Fader(const PGE_Fader&f);
27  ~PGE_Fader();
28 
29  void setFade(int speed, float target, float step);
30  void setRatio(float ratio);
31  bool tickFader(float ticks);
32  const float &fadeRatio();
33  bool isFading();
34  bool isFull();
35  void setFull();
36  bool isNull();
37  void setNull();
38 
39  int ticksLeft();
40 private:
41  void fadeStep();
42  float cur_ratio;
43  float target_ratio;
44  float fade_step;
45  int fadeSpeed;
46  float manual_ticks;
47 };
48 
49 #endif // PGE_FADER_H
Definition: fader.h:22