FPS counter in settings

This commit is contained in:
2025-11-19 09:57:16 -07:00
parent 1098e383ce
commit a7e6f4e0bf
6 changed files with 279 additions and 98 deletions

View File

@@ -78,8 +78,15 @@ func (m MeterLabel) Draw(screen *ebiten.Image, x, y int) (int, int) {
if m.Color == nil {
m.Color = color.White
}
txt := fmt.Sprintf("%s: %3.0f%%", m.Meter.Label, m.Meter.Level)
drawHUDText(screen, txt, m.Color, x, y)
var txt string
if m.Meter.Base < 0 {
// Text-only display without percentage.
txt = m.Meter.Label
} else {
// Standard meter with percentage.
txt = fmt.Sprintf("%s: %3.0f%%", m.Meter.Label, m.Meter.Level)
}
drawHUDText(screen, txt, m.Meter.Color, x, y)
return len(txt) * 7, 13
}