wavelength 1.0.0
Loading...
Searching...
No Matches
hudpowerup.h
Go to the documentation of this file.
1#pragma once
2
3#include "app/rampanimator.h"
4#include "rnd/rndmesh.h"
5#include "rnd/rndtext.h"
6#include "rnd/rndview.h"
7
15public:
26
28 static constexpr float kHiddenFrame = 480.0f;
29
42 HudPowerup(int nIndex, RndView *pHudView);
43
50 void Reset();
51
59 void ShowPowerup(int nPowerup);
60
70 void Poll(float fDelta, float fUnused, float fDeltaTicks);
71
80
82 void SetEnabled(int nEnabled) {
83 mEnabled = nEnabled;
84 }
85
86private:
87 RndView *mIcons[kNumIcons];
88 RndView *mView;
89 RndText *mName;
90 RndMesh *mMesh;
91 RampAnimator mSlide;
92 int mHolding;
93 int mEnabled;
94};
Icon
The icons, the indices of mIcons.
Definition hudpowerup.h:17
@ kIconAutocatcher
Definition hudpowerup.h:18
@ kIconCrippler
Definition hudpowerup.h:21
@ kIconFreestyle
Definition hudpowerup.h:22
@ kIconMultiplier
Definition hudpowerup.h:23
@ kIconBumper
Definition hudpowerup.h:20
@ kNumIcons
Definition hudpowerup.h:24
@ kIconSlowdown
Definition hudpowerup.h:19
void UpdateSlide()
Slide the icon into view when a power-up is held and the icon is enabled, and out of sight otherwise.
void Reset()
Empty the icon and move it out of sight at once.
static constexpr float kHiddenFrame
The frame of the slide at which the icon is out of sight.
Definition hudpowerup.h:28
void ShowPowerup(int nPowerup)
Show the icon and the name of a power-up, or empty the icon.
HudPowerup(int nIndex, RndView *pHudView)
Construct an empty icon of a player.
void Poll(float fDelta, float fUnused, float fDeltaTicks)
Advance the slide, and show the icon while it is not out of sight.
void SetEnabled(int nEnabled)
Definition hudpowerup.h:82
Value that moves toward a target along an interpolator, and poses an animation on the value.
Definition rampanimator.h:14
Triangle mesh with a material.
Definition rndmesh.h:31
Text drawn with a bitmap font as a mesh of one quad per character.
Definition rndtext.h:27
View that shows the children of another view, its children owner, under its own transform and frame.
Definition rndview.h:27