Skip to content

nameplate

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

Nameplate draws the player identity card showing a name, title, dan emblem, and title background frame. It reads its layout from global_tex's skin config and supports gold dan emblems and animated rainbow title frames.

Nameplate

Nameplate(std::string name, std::string title, PlayerNum player_num, int dan, bool is_gold, bool is_rainbow, int title_bg);

Creates OutlinedText objects for the name and title at sizes defined in SC::NAMEPLATE_TEXT_NAME and SC::NAMEPLATE_TEXT_TITLE. Retrieves the rainbow frame animation (animation ID 12) from global_tex.

dan is the index into the dan emblem sprite sheet, or -1 if no emblem should be shown. title_bg selects the title background frame: 0 = Red, 1 = Blue, 2 = Wood, 3 = Purple, 4 = Gold.

Members

Member Type Description
dan_index int Dan emblem frame index, or -1 for none
player_num PlayerNum Which player this nameplate belongs to
is_gold bool Whether to use the gold variant of the dan emblem
is_rainbow bool Whether the title frame animates through rainbow colors
title_bg int Title background frame index

Update and Draw

void update(double current_ms);

Advances the rainbow frame animation.

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

Draws the nameplate at (x, y). If player_num is AI, draws only the AI placeholder. Otherwise draws the title background frame (or animated rainbow frame), outline, dan emblem (if present), player number indicator, name, and title. Name and title are clamped to fit within the frame width using x2 clipping.

Clone this wiki locally