MenuSection class
#include <Jazz2/UI/Menu/MenuSection.h>
Base class of a menu section.
A single screen ("section") in the menu stack hosted by an IMenuContainer. Subclasses implement the update, layered draw, and input callbacks to define what an individual screen shows and does.
Derived classes
-
template<class TItem>class ScrollableMenuSection
- Simplifies creation of unified scrollable menu sections.
- class AboutSection
- About menu section.
- class BeginSection
- Main menu root section.
- class CreateServerOptionsSection
- Create server options menu section.
- class CustomLevelSelectSection
- Custom level selection menu section.
- class ImportSection
- Import Episodes menu section (Emscripten only).
- class InputDiagnosticsSection
- Input diagnostics menu section.
- class PauseSection
- In-game menu root section.
- class RefreshCacheSection
- Refresh cache menu section.
- class ServerSelectSection
- Server selection menu section.
- class SimpleMessageSection
- Section showing a simple message.
- class SoundsOptionsSection
- Sounds options menu section.
- class StartGameOptionsSection
- Start game options menu section.
- class TouchControlsOptionsSection
- Touch controls options menu section.
Constructors, destructors, conversion operators
- MenuSection()
- ~MenuSection() virtual
Public functions
- auto GetClipRectangle(const Recti& contentBounds) -> Recti virtual
- Allows to override clip rectangle of the middle layer.
- void OnShow(IMenuContainer* root) virtual
- Called when the section is shown.
- void OnHide() virtual
- Called when the section is hidden.
- void OnUpdate(float timeMult) pure virtual
- Called when the section should be updated.
- void OnDraw(Canvas* canvas) pure virtual
- Called when the section should be drawn — the bottom background layer.
- void OnDrawClipped(Canvas* canvas) virtual
- Called when the section should be drawn — the middle clipped layer.
- void OnDrawOverlay(Canvas* canvas) virtual
- Called when the section should be drawn — the top overlay layer.
-
void OnKeyPressed(const nCine::
KeyboardEvent& event) virtual - Called when a key is pressed.
-
void OnKeyReleased(const nCine::
KeyboardEvent& event) virtual - Called when a key is released.
-
void OnTextInput(const nCine::
TextInputEvent& event) virtual - Called when a text input is detected.
-
void OnTouchEvent(const nCine::
TouchEvent& event, Vector2i viewSize) pure virtual - Called when a touch event is triggered.
- auto GetNavigationFlags() const -> NavigationFlags virtual
- Allows to override navigation behavior.
Protected static variables
- static float TouchKineticDivider constexpr
- Kinetic divider for smooth touch controls.
- static float TouchKineticFriction constexpr
- Kinetic friction for smooth touch controls.
- static float TouchKineticDamping constexpr
- Kinetic damping for smooth touch controls.