examples/sprites: Add FPS

This commit is contained in:
Hajime Hoshi 2018-12-23 01:23:38 +09:00
parent bf67998fc5
commit e4d976e964
2 changed files with 4 additions and 2 deletions

View File

@ -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
}

View File

@ -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
}