examples/lines: show FPS/TPS

This commit is contained in:
Hajime Hoshi 2022-10-15 02:23:26 +09:00
parent 32a2a705c0
commit bcc5dc1703

View File

@ -15,6 +15,7 @@
package main package main
import ( import (
"fmt"
"image" "image"
"image/color" "image/color"
"log" "log"
@ -130,8 +131,9 @@ func (g *Game) Draw(screen *ebiten.Image) {
screen.DrawImage(g.offscreen, op) screen.DrawImage(g.offscreen, op)
} }
msg := `Press A to switch anti-aliasing. msg := fmt.Sprintf(`FPS: %0.2f, TPS: %0.2f
Press C to switch to draw the center lines.` Press A to switch anti-aliasing.
Press C to switch to draw the center lines.`, ebiten.ActualFPS(), ebiten.ActualTPS())
ebitenutil.DebugPrint(screen, msg) ebitenutil.DebugPrint(screen, msg)
} }