Score
Displays a changing number using pooled digit icons.
import { Score } from 'filedom';
<Score value={points} places={4} at={{ x: 480, y: 80 }} />
Render Score inside a Stage. Each place mounts ten
pooled sprites, one per digit face, and moves the one it needs into position, so
no icon is ever swapped in place. Leading zeros are hidden and the visible
digits are centered on at. Values are floored and clamped to zero, and digits
beyond places are dropped from the high end.
Props
PropType
valuenumber
Number to show.
Type
numberplacesnumber
Number of digit positions.
Type
numberatStagePoint | null
Readout center; null hides it.
Type
StagePoint | nullgap?number
Digit-center spacing in px. Default 0.62 × provider icon size. Required when the provider has no metrics; otherwise Score throws.
Type
numberdigitIcon?((digit: number) => IconDescriptor)
Face for digits 0 to 9. Defaults to scoreDigitIcon.
Type
((digit: number) => IconDescriptor)