class
#include <Jazz2/UI/Menu/IMenuContainer.h>
IMenuContainer Base interface of a menu container.
Derived classes
- class InGameMenu
- In-game menu.
- class MainMenu
- Main menu.
Public static variables
-
static std::
uint16_t MainLayer constexpr -
static std::
uint16_t ShadowLayer constexpr -
static std::
uint16_t BackgroundLayer constexpr -
static std::
uint16_t FontLayer constexpr -
static std::
uint16_t FontShadowLayer constexpr
Public static functions
- static auto EaseOutElastic(float t) -> float
- static auto EaseOutCubic(float t) -> float
Constructors, destructors, conversion operators
- ~IMenuContainer() virtual
Public functions
-
template<typename T, typename... Params>auto SwitchToSection(Params && ... args) -> T*
- Creates a section by type and switches to it.
-
auto SwitchToSectionDirect(std::
unique_ptr<MenuSection> section) -> MenuSection* pure virtual - Switches to already created section.
- void LeaveSection() pure virtual
- Leaves current section.
- auto GetUnderlyingSection() const -> MenuSection* pure virtual
- Returns the next section after the top one.
- void ChangeLevel(LevelInitialization&& levelInit) pure virtual
- Changes current level.
- auto HasResumableState() const -> bool pure virtual
- Returns
true
if a saved state can be resumed. - void ResumeSavedState() pure virtual
- Resumes a saved state.
- void ApplyPreferencesChanges(ChangedPreferencesType type) pure virtual
- Applies preferences changes.
- auto ActionPressed(PlayerActions action) -> bool pure virtual
- Returns
true
if specified action is pressed. - auto ActionHit(PlayerActions action) -> bool pure virtual
- Returns
true
if specified action is hit (newly pressed) - auto GetViewSize() const -> Vector2i pure virtual
- Returns viewport size of the menu.
- auto GetContentBounds() const -> Recti pure virtual
- Returns content bounds.
-
void DrawElement(AnimState state,
int32_t frame,
float x,
float y,
std::
uint16_t z, Alignment align, const Colorf& color, float scaleX = 1.0f, float scaleY = 1.0f, bool additiveBlending = false, bool unaligned = false) pure virtual - Draws a textured element.
-
void DrawElement(AnimState state,
float x,
float y,
std::
uint16_t z, Alignment align, const Colorf& color, Vector2f size, const Vector4f& texCoords, bool unaligned = false) pure virtual -
void DrawSolid(float x,
float y,
std::
uint16_t z, Alignment align, Vector2f size, const Colorf& color, bool additiveBlending = false) pure virtual - Draws a solid rectangle.
-
void DrawTexture(const Texture& texture,
float x,
float y,
std::
uint16_t z, Alignment align, Vector2f size, const Colorf& color, bool unaligned = false) pure virtual - Draws a textured rectangle.
- auto MeasureString(const StringView text, float scale = 1.0f, float charSpacing = 1.0f, float lineSpacing = 1.0f) -> Vector2f pure virtual
- Measures a string.
-
void DrawStringShadow(const StringView text,
std::
int32_t& charOffset, float x, float y, std:: uint16_t z, Alignment align, const Colorf& color, float scale = 1.0f, float angleOffset = 0.0f, float varianceX = 4.0f, float varianceY = 4.0f, float speed = 0.4f, float charSpacing = 1.0f, float lineSpacing = 1.0f) pure virtual - Draws a string with shadow.
- void PlaySfx(const StringView identifier, float gain = 1.0f) pure virtual
- Plays a common sound effect.
Function documentation
void Jazz2:: UI:: Menu:: IMenuContainer:: DrawElement(AnimState state,
float x,
float y,
std:: uint16_t z,
Alignment align,
const Colorf& color,
Vector2f size,
const Vector4f& texCoords,
bool unaligned = false) pure virtual
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.