NasNas
An intuitive and beginner friendly 2D game framework for C++
TypedText.hpp
1 
6 #pragma once
7 
8 #include <string>
9 #include <vector>
10 
11 #include <SFML/Window/Event.hpp>
12 
13 #include <NasNas/core/graphics/BitmapText.hpp>
14 
15 namespace ns::ui {
16 /*
17  class TypedText : public BitmapText {
18  public:
19  explicit TypedText(std::wstring string);
20 
21  void setMaxWidth(int max_width);
22  void setMaxLines(int lines_nb);
23 
24  void setTypingDelay(int delay);
25 
26  auto isWaiting() const -> bool;
27  auto hasEnded() const -> bool;
28 
29  virtual void onEvent(const sf::Event& event);
30  void update();
31 
32  protected:
33  void nextPage();
34 
35  private:
36  std::wstring m_string;
37  std::vector<std::wstring> m_pages;
38  int m_max_lines = 0;
39  int m_counter = 0;
40  int m_typing_delay = 0;
41  unsigned m_current_page = 0;
42  unsigned m_current_letter_index = 0;
43  };
44 */
45 }