JNGL
Easy to use cross-platform 2D game library
|
Fades between two scenes, first fading to black and then fading to the new scene. More...
#include <jngl/Fade.hpp>
Public Member Functions | |
Fade (std::shared_ptr< jngl::Work >, int speed=20) | |
void | step () override |
Advance the game logic. | |
void | draw () const override |
Draw the game state. | |
![]() | |
virtual void | onBackEvent () |
Gets called on Android's "back" gesture or when the Esc key is pressed. | |
virtual void | onControllerBack () |
Gets called when the "Back" button is pressed on any connected controller (Android only) | |
virtual void | onPauseEvent () |
Gets called when the main window loses focus or the app is put in the background. | |
virtual void | onLoad () |
Gets called when the Work is activated by the main loop. | |
virtual void | onUnload () |
Gets called when the Work is deactivated by the main loop. | |
![]() | |
virtual void | onFileDrop (const std::filesystem::path &) |
Called when a file has been dropped onto the window. | |
virtual void | onControllersChanged () |
Whenever the return value of jngl::getConnectedControllers would change, this method gets called. | |
Job ()=default | |
Does nothing. | |
Job (const Job &)=default | |
Copy constructor. | |
Job & | operator= (const Job &)=default |
Copy assignment. | |
Job (Job &&)=default | |
Move constructor. | |
Job & | operator= (Job &&)=default |
Move assignment. | |
virtual | ~Job () |
Does nothing. | |
Private Member Functions | |
void | onQuitEvent () override |
Gets called when the user closes the main window or quit() has been called. | |
Fades between two scenes, first fading to black and then fading to the new scene.
|
overridevirtual |
Advance the game logic.
This function gets called 60 times per second or whatever has been set by setStepsPerSecond().
Implements Job.
|
overridevirtual |
|
overrideprivatevirtual |
Gets called when the user closes the main window or quit() has been called.
To continue with the main loop, call cancelQuit(). For example if you want to switch to a pause menu instead of exiting the game:
Reimplemented from Work.