LoadingHandler class
#include <Jazz2/UI/LoadingHandler.h>
Handler that only shows the loading indicator.
State handler for the loading screen shown while content is being prepared, drawing an animated loading indicator over a light or dark background. An optional callback is invoked once loading completes.
Base classes
- class Jazz2::IStateHandler
- Base interface of a state handler, only one handler runs at a time.
Constructors, destructors, conversion operators
- LoadingHandler(IRootController* root, bool darkMode)
- Creates a new instance.
- LoadingHandler(IRootController* root, bool darkMode, Function<bool(IRootController*)>&& callback)
- Creates a new instance with a completion callback.
- ~LoadingHandler() override
Public functions
- auto GetViewSize() const -> Vector2i override
- Returns viewport size of the handler.
- void OnBeginFrame() override
- Called at the beginning of each frame.
-
void OnInitializeViewport(std::
int32_t width, std:: int32_t height) override - Called when the viewport needs to be initialized (e.g., when the resolution is changed).
Constants
-
static std::
int32_t DefaultWidth constexpr - Default width of viewport.
-
static std::
int32_t DefaultHeight constexpr - Default height of viewport.
Function documentation
Jazz2:: UI:: LoadingHandler:: LoadingHandler(IRootController* root,
bool darkMode)
Creates a new instance.
| Parameters | |
|---|---|
| root | Root controller |
| darkMode | Whether the loading indicator should use the dark theme |
Jazz2:: UI:: LoadingHandler:: LoadingHandler(IRootController* root,
bool darkMode,
Function<bool(IRootController*)>&& callback)
Creates a new instance with a completion callback.
| Parameters | |
|---|---|
| root | Root controller |
| darkMode | Whether the loading indicator should use the dark theme |
| callback | Called when the loading finishes |