FPS counter in settings
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user