coastline 0.0.4
Loading...
Searching...
No Matches
racecredits.h
Go to the documentation of this file.
1#pragma once
2
9
10#include <filesystem>
11#include <string>
12#include <vector>
13
14namespace coastline {
15
16class MenuText;
17class SceneRenderer;
18
21public:
30 bool Start(const std::filesystem::path &release);
31
39 void Step(float seconds);
40
48 void Draw(SceneRenderer &renderer, const MenuText &text) const;
49
50private:
52 struct Caption {
53 std::string title;
54 float duration;
56 };
57
59 struct ScrollLine {
60 int y;
61 int size;
62 int gap;
63 std::string text;
64 };
65
66 bool CaptionsShow() const;
67
68 std::vector<Caption> m_captions;
69 std::size_t m_caption = 0;
70 float m_captionTimer = 0.0f;
71 std::vector<ScrollLine> m_scrollLines;
72};
73
74} // namespace coastline
Captions and scrolling credits for one attract-demo controller.
Definition racecredits.h:20
bool Start(const std::filesystem::path &release)
Read the captions and the scrolling credits of a release, and start them as the race of the credits s...
void Draw(SceneRenderer &renderer, const MenuText &text) const
Draw the credits of the race of the credits that runs, as DrawCreditCaption() and DrawScrollingText()...
void Step(float seconds)
Advance the credits of the race of the credits that runs by a step of the race: the captions as DrawC...
The two fonts of the menus, their gradients, and the layout of their glyphs.
Definition menutext.h:63
The renderer of a frame.
Definition scenerenderer.h:467
Definition assetimport.h:11