MpHUD class
#include <Jazz2/UI/Multiplayer/MpHUD.h>
Player HUD for multiplayer.
Multiplayer-specific extension of HUD. It overrides the overview and score drawing to show multiplayer information such as the player's position in the current round, and adds a centered countdown display.
Base classes
- class Jazz2::UI::HUD
- Player HUD.
- class Jazz2::Multiplayer::GameModes::IGameModeHUD
- Drawing surface a game mode uses to render its own part of the HUD.
Constructors, destructors, conversion operators
-
MpHUD(Jazz2::
Multiplayer:: MpLevelHandler* levelHandler) - Creates a new instance.
Public functions
- void OnUpdate(float timeMult) override
- Called every frame to update the node state.
- auto OnDraw(RenderQueue& renderQueue) -> bool override
- Called when the node needs to be drawn, returning
trueif a command was added. -
void ShowCountdown(std::
int32_t secsLeft) - Shows countdown text in the middle of the screen.
Protected functions
-
void OnDrawOverview(const Rectf& view,
const Rectf& adjustedView,
Actors::
Player* player) override - Called when some overview information of the player needs to be drawn.
-
void OnDrawScore(const Rectf& view,
Actors::
Player* player) override - Called when score of the player needs to be drawn.
-
void DrawPositionInRound(const Rectf& view,
Actors::
Player* player) override - Draws the position of the player in the current round (also serves as IGameModeHUD::DrawPositionInRound).
-
void DrawMinimap(const Rectf& view,
Actors::
Player* player) override - Draws the race-track minimap in the top-right corner (also serves as IGameModeHUD::DrawMinimap).
- void DrawHudText(Jazz2::Multiplayer::GameModes::GameModeFontType font, StringView text, float x, float y, float shadowOffsetY, Alignment alignment, const Colorf& color, float scale, float charSpacing, float angleOffset, float variance, float speed) override
- Draws a text string (shadow + main) with the small or medium HUD font.
- void DrawHudIcon(Jazz2::Multiplayer::GameModes::GameModeHudIcon icon, float x, float y, float shadowOffsetY, Alignment alignment, const Colorf& color, float scaleX, float scaleY) override
- Draws a semantic HUD icon (shadow + main).
Function documentation
void Jazz2:: UI:: Multiplayer:: MpHUD:: DrawHudText(Jazz2::Multiplayer::GameModes::GameModeFontType font,
StringView text,
float x,
float y,
float shadowOffsetY,
Alignment alignment,
const Colorf& color,
float scale,
float charSpacing,
float angleOffset,
float variance,
float speed) override protected
Draws a text string (shadow + main) with the small or medium HUD font.
angleOffset, variance and speed drive the optional wavy-text animation (all 0 = static text, which is what most HUD text uses).