group2 0.1.0
CSE 125 Group 2
Loading...
Searching...
No Matches
PickupPrompt Struct Reference

Centered prompt rendered just below the crosshair while the local player is in range of, and looking at, an available weapon spawner. More...

#include <PickupPrompt.hpp>

Inheritance diagram for PickupPrompt:
[legend]
Collaboration diagram for PickupPrompt:
[legend]

Public Member Functions

 PickupPrompt ()
void update (float dt, const HudGameState &state, HudTweenPool &tweens) override
 Called each frame before draw(). Update animation, consume events.
void draw (HudContext &ctx, float drawX, float drawY) override
 Emit geometry into the draw context.
Public Member Functions inherited from HudWidget
virtual ~HudWidget ()=default

Public Attributes

float fontSize = 24.f
 Size of the descriptive text (logical px).
float keyFontSize = 26.f
 Size of the "F" key glyph (logical px).
float keyBoxPadding = 5.f
 Padding inside the key glyph box.
float keyBoxRadius = 4.f
 Corner radius of the key glyph box.
float spacing = 10.f
 Gap between the key glyph box and the text.
Public Attributes inherited from HudWidget
bool visible = true
HudAnchor anchor = HudAnchor::TopLeft
float offsetX = 0.f
float offsetY = 0.f
float width = 0.f
float height = 0.f
float uiScale_ = 1.f
 Set by Hud each frame (screenH / 1080).

Private Attributes

int weaponId_ = 0

Detailed Description

Centered prompt rendered just below the crosshair while the local player is in range of, and looking at, an available weapon spawner.

Visibility and the displayed weapon name are driven entirely by HudGameState::pickupAvailable / pickupWeaponId — Game.cpp populates them each frame by replicating the WeaponSpawnerSystem proximity check for the local player.

Constructor & Destructor Documentation

◆ PickupPrompt()

PickupPrompt::PickupPrompt ( )

Member Function Documentation

◆ draw()

void PickupPrompt::draw ( HudContext & ctx,
float drawX,
float drawY )
overridevirtual

Emit geometry into the draw context.

Parameters
ctxImmediate-mode draw API.
drawXResolved pixel X (anchor + offset already applied).
drawYResolved pixel Y.

Implements HudWidget.

Here is the call graph for this function:

◆ update()

void PickupPrompt::update ( float dt,
const HudGameState & state,
HudTweenPool & tweens )
overridevirtual

Called each frame before draw(). Update animation, consume events.

Implements HudWidget.

Member Data Documentation

◆ fontSize

float PickupPrompt::fontSize = 24.f

Size of the descriptive text (logical px).

◆ keyBoxPadding

float PickupPrompt::keyBoxPadding = 5.f

Padding inside the key glyph box.

◆ keyBoxRadius

float PickupPrompt::keyBoxRadius = 4.f

Corner radius of the key glyph box.

◆ keyFontSize

float PickupPrompt::keyFontSize = 26.f

Size of the "F" key glyph (logical px).

◆ spacing

float PickupPrompt::spacing = 10.f

Gap between the key glyph box and the text.

◆ weaponId_

int PickupPrompt::weaponId_ = 0
private

The documentation for this struct was generated from the following files: