PGE Engine
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Macros Pages
lvl_backgrnd.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 GRAPHICS_LVL_BACKGRND_H
20 #define GRAPHICS_LVL_BACKGRND_H
21 
22 #include <data_configs/obj_bg.h>
23 
24 #include <common_features/pge_texture.h>
25 #include <common_features/rectf.h>
26 
27 #include "lvl_camera.h"
28 
29 //Magic background strip value
31 {
32  double repeat_h;
33  double top;
34  double bottom;
35  int height;
36 };
37 
38 class PGE_LevelCamera;
40 {
41  friend class PGE_LevelCamera;
42 public:
44  LVL_Background(const LVL_Background &_bg);
45  ~LVL_Background();
46 
47  void setBg(obj_BG &bg);
48  void setNone();
49  void setBox(PGE_RectF &_box);
50  void draw(float x, float y, float w, float h); //draw by camera position
51  bool isInit();
52  int curBgId();
53 
54  bool _isInited;
55 
56  enum type
57  {
58  single_row = 0,
59  double_row = 1,
60  tiled = 2,
61  multi_layered = 3
62  };
63  obj_BG setup;
64  type bgType;
65 
66  bool isNoImage;
67 
68  PGE_Texture txData1;
69  PGE_Texture txData2;
70 
71  bool isAnimated;
72  long animator_ID;
73 
74  bool isMagic;
75  QList<LVL_Background_strip > strips;
76 
77  PGEColor color;
78 
79  PGE_RectF box;
80 
81 private:
82  void construct();
83  PGE_RectF backgrndG;
84 };
85 
86 
87 #endif // GRAPHICS_LVL_BACKGRND_H
Definition: obj_bg.h:25
Definition: lvl_camera.h:36
Definition: pge_texture.h:32
Definition: lvl_backgrnd.h:30
Definition: pge_texture.h:25
int h()
Height.
Definition: lvl_camera.cpp:88
int w()
Width.
Definition: lvl_camera.cpp:83
Definition: rectf.h:26
Definition: lvl_backgrnd.h:39