resonance 1.0.1
Loading...
Searching...
No Matches
hudtextmessage.h
Go to the documentation of this file.
1#pragma once
2
3#include "rnd/font.h"
4
5class HxStr;
6
7namespace Rnd {
8class Blur;
9class Text;
10class TransAnim;
11} // namespace Rnd
12
26public:
37 HudTextMessage(const HxStr &name);
38
49 mFont->SetSize(mFontSize);
50 }
51
64 void Show(const HxStr &text, float flScale, float flHold);
65
74 void Hide();
75
83 void SetFrame(float flTime);
84
85private:
86 Rnd::Blur *mBlur; // `<name>.blur`
87 Rnd::Font *mFont; // The text's font.
88
89public:
97
98private:
99 Rnd::TransAnim *mAnim; // `<name>.tnm`
100 // When the message started. 0 marks it idle and 1e9 marks a start not yet recorded.
101 float mStart;
102 // The font size at construction. The destructor restores it.
103 float mFontSize;
104 // How long the message stays between its fades.
105 float mHold;
106
107public:
116};
void Show(const HxStr &text, float flScale, float flHold)
Start showing one text unless a message is already active.
~HudTextMessage()
Restore the font's size.
Definition hudtextmessage.h:48
void Hide()
Hide the text at once and mark the message inactive.
int mActive
Non-zero while a message is active.
Definition hudtextmessage.h:115
Rnd::Text * mText
The text, <name>.txt.
Definition hudtextmessage.h:96
void SetFrame(float flTime)
Advance the fade animation, hiding the text once it has faded out.
HudTextMessage(const HxStr &name)
Resolve the message's objects and hide it.
Heap-allocated NUL-terminated string.
Definition hxstr.h:41
Motion trail that redraws one drawable at the transforms it recently occupied.
Definition blur.h:39
Glyph atlas, either a host font description or a grid of cells inside a material texture.
Definition font.h:59
Run of text drawn as a quad per glyph.
Definition text.h:57
Animation that drives one transformable from three keyframe channels.
Definition transanim.h:49
The rendering engine.
Definition animhelper.h:3