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