supertux
textscroller_screen.hpp
1 // SuperTux
2 // Copyright (C) 2006 Matthias Braun <matze@braunis.de>
3 //
4 // This program is free software: you can redistribute it and/or modify
5 // it under the terms of the GNU General Public License as published by
6 // the Free Software Foundation, either version 3 of the License, or
7 // (at your option) any later version.
8 //
9 // This program is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 // GNU General Public License for more details.
13 //
14 // You should have received a copy of the GNU General Public License
15 // along with this program. If not, see <http://www.gnu.org/licenses/>.
16 
17 #ifndef HEADER_SUPERTUX_SUPERTUX_TEXTSCROLLER_SCREEN_HPP
18 #define HEADER_SUPERTUX_SUPERTUX_TEXTSCROLLER_SCREEN_HPP
19 
20 #include <memory>
21 
22 #include "supertux/screen.hpp"
23 #include "video/color.hpp"
24 #include "video/surface_ptr.hpp"
25 
26 class DrawingContext;
27 class InfoBoxLine;
28 class TextScroller;
29 
33 class TextScrollerScreen final : public Screen
34 {
35 public:
36  TextScrollerScreen(const std::string& file);
37  ~TextScrollerScreen() override;
38 
39  virtual void setup() override;
40  virtual void draw(Compositor& compositor) override;
41  virtual void update(float dt_sec, const Controller& controller) override;
42  virtual IntegrationStatus get_status() const override;
43 
44 private:
45  float m_defaultspeed;
46  std::string m_music;
47  SurfacePtr m_background;
48  std::unique_ptr<TextScroller> m_text_scroller;
49 
50 private:
51  TextScrollerScreen(const TextScrollerScreen&) = delete;
52  TextScrollerScreen& operator=(const TextScrollerScreen&) = delete;
53 };
54 
55 #endif
56 
57 /* EOF */
Definition: controller.hpp:57
virtual IntegrationStatus get_status() const override
Gives details about what the user is doing right now.
Definition: textscroller_screen.cpp:139
Abstract base class for code the MainLoop runs exclusively and full-screen.
Definition: screen.hpp:31
Screen that displays intro text, extro text, etc.
Definition: textscroller_screen.hpp:33
Definition: textscroller.hpp:34
virtual void setup() override
gets called before this screen gets activated (which is at least once before the first draw or update...
Definition: textscroller_screen.cpp:88
Definition: compositor.hpp:29
Definition: integration.hpp:26
Helper class for InfoBox: Represents a line of text.
Definition: info_box_line.hpp:34
This class provides functions for drawing things on screen.
Definition: drawing_context.hpp:42
virtual void draw(Compositor &compositor) override
gets called once per frame.
Definition: textscroller_screen.cpp:103
virtual void update(float dt_sec, const Controller &controller) override
gets called for once (per logical) frame.
Definition: textscroller_screen.cpp:95