GDevelop Core
Core library for developing platforms and tools compatible with GDevelop.
LoadingScreen.h
1 /*
2  * GDevelop Core
3  * Copyright 2008-2018 Florian Rival ([email protected]). All rights
4  * reserved. This project is released under the MIT License.
5  */
6 
7 #ifndef GDCORE_LOADINGSCREEN_H
8 #define GDCORE_LOADINGSCREEN_H
9 #include "GDCore/String.h"
10 namespace gd {
11 class SerializerElement;
12 }
13 
14 namespace gd {
15 
23 class GD_CORE_API LoadingScreen {
24  public:
25  LoadingScreen();
26  virtual ~LoadingScreen(){};
27 
32  bool IsGDevelopLogoShownDuringLoadingScreen() const { return showGDevelopLogoDuringLoadingScreen; };
33 
38  showGDevelopLogoDuringLoadingScreen = show;
39  return *this;
40  };
41 
42  const gd::String& GetGDevelopLogoStyle() const { return gdevelopLogoStyle; };
43 
44  LoadingScreen& SetGDevelopLogoStyle(const gd::String& value) {
45  gdevelopLogoStyle = value;
46  return *this;
47  }
48 
49  const gd::String& GetBackgroundImageResourceName() const {
50  return backgroundImageResourceName;
51  };
52 
53  gd::String& GetBackgroundImageResourceName() {
54  return backgroundImageResourceName;
55  };
56 
57  LoadingScreen& SetBackgroundImageResourceName(const gd::String& value) {
58  backgroundImageResourceName = value;
59  return *this;
60  }
61 
62  int GetBackgroundColor() const { return backgroundColor; };
63 
64  LoadingScreen& SetBackgroundColor(int value) {
65  backgroundColor = value;
66  return *this;
67  }
68 
69  double GetBackgroundFadeInDuration() const {
70  return backgroundFadeInDuration;
71  };
72 
73  LoadingScreen& SetBackgroundFadeInDuration(double value) {
74  backgroundFadeInDuration = value;
75  return *this;
76  }
77 
78  double GetMinDuration() const { return minDuration; };
79 
80  LoadingScreen& SetMinDuration(double value) {
81  minDuration = value;
82  return *this;
83  }
84 
85  double GetLogoAndProgressFadeInDuration() const {
86  return logoAndProgressFadeInDuration;
87  }
88 
89  LoadingScreen& SetLogoAndProgressFadeInDuration(double value) {
90  logoAndProgressFadeInDuration = value;
91  return *this;
92  }
93 
94  double GetLogoAndProgressLogoFadeInDelay() const {
95  return logoAndProgressLogoFadeInDelay;
96  }
97 
98  LoadingScreen& SetLogoAndProgressLogoFadeInDelay(double value) {
99  logoAndProgressLogoFadeInDelay = value;
100  return *this;
101  }
102 
103  bool GetShowProgressBar() const { return showProgressBar; }
104 
105  LoadingScreen& SetShowProgressBar(bool value) {
106  showProgressBar = value;
107  return *this;
108  }
109 
110  double GetProgressBarMinWidth() const { return progressBarMinWidth; }
111 
112  LoadingScreen& SetProgressBarMinWidth(double value) {
113  progressBarMinWidth = value;
114  return *this;
115  }
116 
117  double GetProgressBarMaxWidth() const { return progressBarMaxWidth; }
118 
119  LoadingScreen& SetProgressBarMaxWidth(double value) {
120  progressBarMaxWidth = value;
121  return *this;
122  }
123 
124  double GetProgressBarWidthPercent() const { return progressBarWidthPercent; }
125 
126  LoadingScreen& SetProgressBarWidthPercent(double value) {
127  progressBarWidthPercent = value;
128  return *this;
129  }
130 
131  double GetProgressBarHeight() const { return progressBarHeight; }
132 
133  LoadingScreen& SetProgressBarHeight(double value) {
134  progressBarHeight = value;
135  return *this;
136  }
137 
138  int GetProgressBarColor() const { return progressBarColor; }
139 
140  LoadingScreen& SetProgressBarColor(int value) {
141  progressBarColor = value;
142  return *this;
143  }
144 
148 
151  void SerializeTo(SerializerElement& element) const;
152 
156  void UnserializeFrom(const SerializerElement& element);
158 
159  private:
160  bool showGDevelopLogoDuringLoadingScreen;
161  gd::String gdevelopLogoStyle;
162  gd::String backgroundImageResourceName;
163  int backgroundColor;
164  double backgroundFadeInDuration; // In seconds.
165  double minDuration; // In seconds.
166  double logoAndProgressFadeInDuration; // In seconds.
167  double logoAndProgressLogoFadeInDelay; // In seconds.
168  bool showProgressBar;
169  double progressBarMinWidth; // In pixels.
170  double progressBarMaxWidth; // In pixels.
171  double progressBarWidthPercent;
172  double progressBarHeight; // In pixels.
173  int progressBarColor;
174 };
175 } // namespace gd
176 
177 #endif // GDCORE_LOADINGSCREEN_H
Describe the content and set up of the loading screen.
Definition: LoadingScreen.h:23
bool IsGDevelopLogoShownDuringLoadingScreen() const
Return true if the GDevelop logo should be shown while loading assets.
Definition: LoadingScreen.h:32
LoadingScreen & ShowGDevelopLogoDuringLoadingScreen(bool show)
Set if the GDevelop logo should be shown while loading assets.
Definition: LoadingScreen.h:37
String represents an UTF8 encoded string.
Definition: String.h:31
Definition: CommonTools.h:24