JNGL
Easy to use cross-platform 2D game library
Loading...
Searching...
No Matches
Fade.hpp
Go to the documentation of this file.
1// Copyright 2025 Jan Niklas Hasse <jhasse@bixense.com>
2// For conditions of distribution and use, see copyright notice in LICENSE.txt
5#pragma once
6
7#include "Scene.hpp"
8
9namespace jngl {
10
12class Fade : public Scene {
13public:
14 explicit Fade(std::shared_ptr<Scene>, int speed = 20);
15 ~Fade() override;
16 void step() override;
17 void draw() const override;
18
19private:
20 void onQuitEvent() override;
21
24 double fadeCount;
25 int speed;
26 bool quit = false;
27};
28
29} // namespace jngl
Contains jngl::Scene class and related functions.
Fades between two scenes, first fading to black and then fading to the new scene.
Definition Fade.hpp:12
void draw() const override
Draw the game state.
void onQuitEvent() override
Gets called when the user closes the main window or quit() has been called.
void step() override
Advance the game logic.
Active state of the game, e.g. a menu or the game itself.
Definition work.hpp:13
JNGL's main namespace.