作る

ScoreDisplay

Animated score counter that interpolates toward the desired value.

ScoreDisplay

Animated score counter that interpolates toward the desired value.

Examples

const display = new ScoreDisplay({ prefix: "Coins " });
hud.append(display.element);
display.setScore(1200);

Members

setScore

setScore(value: number): void

Animates the UI toward the provided score.

element

element: HTMLDivElement

DOM node for the label. Append this to your HUD.