Skip to content

song_info

Anthony Samms edited this page Jun 2, 2026 · 1 revision

Two small display classes show the song's title and play-count during gameplay. They are owned by game and rendered in draw_overlay().

SongNum

Displays the current song number (e.g. "1/3" in a multi-song session) as an outlined text label.

Construction

SongNum(int song_num);

Creates an OutlinedText from song_num using the song-number font.

Members

Member Type Description
text unique_ptr<OutlinedText> The rendered song count string
width float Text width in pixels; used by callers to align
height float Text height in pixels

Methods

void draw(float x, float y, float fade);

Draws the song-number text at (x, y) blended by fade (0–1).


SongInfo

Displays the song title and song number together. It appears briefly at the start of a song and fades out.

Construction

SongInfo(const string& song_name, int genre);

Creates the OutlinedText title and a SongNum, then starts a FadeAnimation that controls the overall visibility.

Members

Member Type Description
song_name string The song title string
genre int Genre index; selects the genre-coloured text style
fade FadeAnimation* Controls the fade-in and fade-out timing
song_title unique_ptr<OutlinedText> The song title rendered as outlined text
song_num unique_ptr<SongNum> The song count display

Methods

void update(double current_ms);

Advances the fade animation.

void draw();

Draws song_title and song_num at their configured positions, multiplied by the current fade value.

Clone this wiki locally