mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-24 02:38:53 +01:00
examples/lines: show FPS/TPS
This commit is contained in:
parent
32a2a705c0
commit
bcc5dc1703
@ -15,6 +15,7 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"image"
|
||||
"image/color"
|
||||
"log"
|
||||
@ -130,8 +131,9 @@ func (g *Game) Draw(screen *ebiten.Image) {
|
||||
screen.DrawImage(g.offscreen, op)
|
||||
}
|
||||
|
||||
msg := `Press A to switch anti-aliasing.
|
||||
Press C to switch to draw the center lines.`
|
||||
msg := fmt.Sprintf(`FPS: %0.2f, TPS: %0.2f
|
||||
Press A to switch anti-aliasing.
|
||||
Press C to switch to draw the center lines.`, ebiten.ActualFPS(), ebiten.ActualTPS())
|
||||
ebitenutil.DebugPrint(screen, msg)
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user