From c10522470527b8a7c18f6d5f1f8c16ad96f1990c Mon Sep 17 00:00:00 2001 From: Hajime Hoshi Date: Fri, 12 Apr 2024 15:16:26 +0900 Subject: [PATCH] examples/video: show FPS --- examples/video/main.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/examples/video/main.go b/examples/video/main.go index b54d42b7b..4c9f66661 100644 --- a/examples/video/main.go +++ b/examples/video/main.go @@ -24,6 +24,7 @@ import ( "github.com/hajimehoshi/ebiten/v2" "github.com/hajimehoshi/ebiten/v2/audio" + "github.com/hajimehoshi/ebiten/v2/ebitenutil" ) //go:embed shibuya.mpg @@ -48,6 +49,7 @@ func (g *Game) Draw(screen *ebiten.Image) { if err := g.player.Draw(screen); err != nil { g.err = err } + ebitenutil.DebugPrint(screen, fmt.Sprintf("FPS: %0.2f", ebiten.ActualFPS())) } func (g *Game) Layout(outsideWidth, outsideHeight int) (screenWidth, screenHeight int) {