resonance 1.0.1
Loading...
Searching...
No Matches
HudTextMessage Class Reference

One animated text message of the head-up display. More...

#include <hudtextmessage.h>

Collaboration diagram for HudTextMessage:

Public Member Functions

 HudTextMessage (const HxStr &name)
 Resolve the message's objects and hide it.
 ~HudTextMessage ()
 Restore the font's size.
void Show (const HxStr &text, float flScale, float flHold)
 Start showing one text unless a message is already active.
void Hide ()
 Hide the text at once and mark the message inactive.
void SetFrame (float flTime)
 Advance the fade animation, hiding the text once it has faded out.

Public Attributes

Rnd::Text * mText
 The text, <name>.txt.
int mActive
 Non-zero while a message is active.

Detailed Description

One animated text message of the head-up display.

The class is not polymorphic and emits no RTTI. No descriptor, tag, or file path identifies it, and its name is inferred from the three objects it resolves, <name>.blur, <name>.txt, and <name>.tnm. HudTrack embeds one at +0x28 under the name <layout> textmsg<n>, and HudWinMessage embeds one under HUD winmsg.

A message fades in over 250 units of SetFrame()'s time, stays for the time Show() gives it, and fades out over 250 more. Show() scales the text's font from its size at construction, and the destructor restores that size.

Constructor & Destructor Documentation

◆ HudTextMessage()

HudTextMessage::HudTextMessage ( const HxStr & name)

Resolve the message's objects and hide it.

Records the text's font and its size at construction, hides the text, and shows the blur when one exists.

Parameters
nameThe object name the three suffixes are appended to.
Ghidra address:
NTSC-U/C: 0x00416dd8
Ghidra address:
PAL: 0x00450ac0

◆ ~HudTextMessage()

HudTextMessage::~HudTextMessage ( )
inline

Restore the font's size.

HudTrack's destructor and Overlay's destructor inline the body, and the out-of-line copy has no caller.

Ghidra address:
NTSC-U/C: 0x00429aa8
Ghidra address:
PAL: 0x004650e8

Member Function Documentation

◆ Show()

void HudTextMessage::Show ( const HxStr & text,
float flScale,
float flHold )

Start showing one text unless a message is already active.

Scales the font from its original size, sets and shows the text, rewinds the animation, and marks the start time as pending until the next SetFrame(). The title is inferred.

Parameters
textThe text to show.
flScaleThe font scale relative to the original size.
flHoldHow long the message stays between its fades.
Ghidra address:
NTSC-U/C: 0x00429b58
Ghidra address:
PAL: 0x00465198

◆ Hide()

void HudTextMessage::Hide ( )

Hide the text at once and mark the message inactive.

The title is inferred.

Ghidra address:
NTSC-U/C: 0x00429af8
Ghidra address:
PAL: 0x00465138

◆ SetFrame()

void HudTextMessage::SetFrame ( float flTime)

Advance the fade animation, hiding the text once it has faded out.

Parameters
flTimeThe current time. The first call after Show() records it as the start.
Ghidra address:
NTSC-U/C: 0x00429c20
Ghidra address:
PAL: 0x00465260

Member Data Documentation

◆ mText

Rnd::Text* HudTextMessage::mText

The text, <name>.txt.

+0x08

Public because HudWinMessage::Draw() at 0x0042a830 draws it directly, and the image has no accessor for it.

◆ mActive

int HudTextMessage::mActive

Non-zero while a message is active.

+0x1c

Show() does nothing while it is set, and Hide() and SetFrame() clear it. Show() never sets it. Overlay's handler at 0x0041e020 sets it directly after an inlined Show() whenever the text reports itself showing, and the image has no accessor for it.


The documentation for this class was generated from the following file: