Cinematics class
#include <Jazz2/UI/Cinematics.h>
Handler that plays a cinematic video.
State handler that plays the original intro and ending cutscenes, decompressing the custom frame format, applying the palette, and synchronizing the accompanying music and sound effects. Playback can be skipped, after which the supplied callback is invoked.
Base classes
- class Jazz2::IStateHandler
- Base interface of a state handler, only one handler runs at a time.
Constructors, destructors, conversion operators
- Cinematics(IRootController* root, StringView path, Function<bool(IRootController*, bool)>&& callback)
- Creates a new instance and starts playing the specified cinematic.
- ~Cinematics() 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).
- void OnKeyPressed(const KeyboardEvent& event) override
- Called when a key is pressed.
- void OnKeyReleased(const KeyboardEvent& event) override
- Called when a key is released.
- void OnTouchEvent(const TouchEvent& event) override
- Called when a touch event is triggered.
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:: Cinematics:: Cinematics(IRootController* root,
StringView path,
Function<bool(IRootController*, bool)>&& callback)
Creates a new instance and starts playing the specified cinematic.
| Parameters | |
|---|---|
| root | Root controller |
| path | Path to the cinematic to play |
| callback | Called when the playback finishes or is skipped |