examples/noise: Show FPS

This commit is contained in:
Hajime Hoshi 2021-06-24 12:06:59 +09:00
parent 7f60cd41eb
commit bd13e96727

View File

@ -62,9 +62,11 @@ func (g *Game) Update() error {
return nil
}
var offscreen = ebiten.NewImage(320, 240)
func (g *Game) Draw(screen *ebiten.Image) {
screen.ReplacePixels(g.noiseImage.Pix)
ebitenutil.DebugPrint(screen, fmt.Sprintf("TPS: %0.2f", ebiten.CurrentTPS()))
ebitenutil.DebugPrint(screen, fmt.Sprintf("TPS: %0.2f\nFPS: %0.2f", ebiten.CurrentTPS(), ebiten.CurrentFPS()))
}
func (g *Game) Layout(outsideWidth, outsideHeight int) (int, int) {