From e4d976e9642b30842434087b1cd380609ef803f1 Mon Sep 17 00:00:00 2001 From: Hajime Hoshi Date: Sun, 23 Dec 2018 01:23:38 +0900 Subject: [PATCH] examples/sprites: Add FPS --- examples/sprites/main.go | 3 ++- examples/spriteshd/main.go | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/examples/sprites/main.go b/examples/sprites/main.go index 3f5204455..cb441348d 100644 --- a/examples/sprites/main.go +++ b/examples/sprites/main.go @@ -174,8 +174,9 @@ func update(screen *ebiten.Image) error { screen.DrawImage(ebitenImage, op) } msg := fmt.Sprintf(`TPS: %0.2f +FPS: %0.2f Num of sprites: %d -Press <- or -> to change the number of sprites`, ebiten.CurrentTPS(), sprites.num) +Press <- or -> to change the number of sprites`, ebiten.CurrentTPS(), ebiten.CurrentFPS(), sprites.num) ebitenutil.DebugPrint(screen, msg) return nil } diff --git a/examples/spriteshd/main.go b/examples/spriteshd/main.go index 7af850121..fdc9e8427 100644 --- a/examples/spriteshd/main.go +++ b/examples/spriteshd/main.go @@ -180,9 +180,10 @@ func update(screen *ebiten.Image) error { screen.DrawImage(ebitenImage, op) } msg := fmt.Sprintf(`TPS: %0.2f +FPS: %0.2f Num of sprites: %d Press <- or -> to change the number of sprites -Press Q to quit`, ebiten.CurrentTPS(), sprites.num) +Press Q to quit`, ebiten.CurrentTPS(), ebiten.CurrentFPS(), sprites.num) ebitenutil.DebugPrint(screen, msg) return nil }