resonance 1.0.1
Loading...
Searching...
No Matches
hudhighlight.h
Go to the documentation of this file.
1#pragma once
2
3namespace Rnd {
4class Mat;
5class Mesh;
6} // namespace Rnd
7
21public:
29
43 void MoveTo(float flLeft, float flTop, float flRight, float flBottom, float flDuration);
44
57 void JumpTo(float flLeft, float flTop, float flRight, float flBottom);
58
70 void SetFrame(float flTime);
71
81 void SetShowing(int nShowing);
82
83private:
84 // Corner groups of the box, and vertices in each group.
85 static constexpr int kCornerCount = 4;
86 static constexpr int kCornerVertexCount = 4;
87 // Edges of a rectangle, left, top, right, and bottom.
88 static constexpr int kEdgeCount = 4;
89
90 Rnd::Mesh *mMesh; // `HUD1 hilite_box.mesh`
91 Rnd::Mat *mMat; // `HUD hilite_box.mat`
92 // Set by MoveTo() until the next SetFrame() records the start.
93 int mStarting;
94 // Set once a move has run to its end time.
95 int mDone;
96 float mEndTime;
97 float mDuration;
98 // The time SetFrame() last moved the corners at.
99 float mLastTime;
100 // The mesh vertex indices of each corner group. The first vertex of a group is the one a move
101 // steers.
102 unsigned char mCornerVerts[kCornerCount][kCornerVertexCount];
103 // The line each corner follows, y = mSlope * x + mIntercept.
104 float mSlope[kCornerCount];
105 float mIntercept[kCornerCount];
106 // Horizontal speed of each corner.
107 float mVelocity[kCornerCount];
108 // Alpha gained per unit of time.
109 float mFadeRate;
110 float mAlpha;
111 // The rectangle MoveTo() last received.
112 float mTarget[kEdgeCount];
113};
void SetShowing(int nShowing)
Show or hide the box.
void JumpTo(float flLeft, float flTop, float flRight, float flBottom)
Put the box's corners on a rectangle at once.
HudHighlight()
Resolve the box and its material and hide the box.
void SetFrame(float flTime)
Advance a move in progress and its fade.
void MoveTo(float flLeft, float flTop, float flRight, float flBottom, float flDuration)
Start moving the box's corners to a rectangle over a time.
Surface description a Rnd::Mesh draws with.
Definition mat.h:36
Indexed triangle mesh with one material.
Definition mesh.h:46
The rendering engine.
Definition animhelper.h:3