|
resonance 1.0.1
|
Highlight box of the head-up display, a quad whose corners glide to a target rectangle. More...
#include <hudhighlight.h>
Public Member Functions | |
| HudHighlight () | |
| Resolve the box and its material and hide the box. | |
| void | MoveTo (float flLeft, float flTop, float flRight, float flBottom, float flDuration) |
| Start moving the box's corners to a rectangle over a time. | |
| void | JumpTo (float flLeft, float flTop, float flRight, float flBottom) |
| Put the box's corners on a rectangle at once. | |
| void | SetFrame (float flTime) |
| Advance a move in progress and its fade. | |
| void | SetShowing (int nShowing) |
| Show or hide the box. | |
Highlight box of the head-up display, a quad whose corners glide to a target rectangle.
The class is not polymorphic and emits no RTTI. No descriptor, tag, or file path identifies it, and its name is inferred from the hilite_box objects it resolves. The head-up display panel embeds one at +0x90.
The box mesh has sixteen vertices in four corner groups of four. A move gives every group a constant horizontal speed that moves its first vertex to the target corner in the requested time, and moves the group vertically along the straight line from that vertex to the target. The box fades in over the same time.
| HudHighlight::HudHighlight | ( | ) |
Resolve the box and its material and hide the box.
| void HudHighlight::MoveTo | ( | float | flLeft, |
| float | flTop, | ||
| float | flRight, | ||
| float | flBottom, | ||
| float | flDuration ) |
Start moving the box's corners to a rectangle over a time.
The move starts at the next SetFrame(), and the alpha starts from 0. The title is inferred.
| flLeft | The target left edge. |
| flTop | The target top edge. |
| flRight | The target right edge. |
| flBottom | The target bottom edge. |
| flDuration | The time the move takes, in the units SetFrame() receives. |
| void HudHighlight::JumpTo | ( | float | flLeft, |
| float | flTop, | ||
| float | flRight, | ||
| float | flBottom ) |
Put the box's corners on a rectangle at once.
The title is inferred.
| flLeft | The left edge. |
| flTop | The top edge. |
| flRight | The right edge. |
| flBottom | The bottom edge. |
| void HudHighlight::SetFrame | ( | float | flTime | ) |
Advance a move in progress and its fade.
The first call after MoveTo() records the start and the end time and does nothing else. Each later call moves the corners by the time elapsed since the previous call, stopping at the end time, and raises the alpha by the same share of the move, up to 1.
| flTime | The current time. |
| void HudHighlight::SetShowing | ( | int | nShowing | ) |
Show or hide the box.
The constructor is the one caller. The title is inferred.
| nShowing | Non-zero to show. |