mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2025-01-13 20:42:07 +01:00
examples/video: show FPS
This commit is contained in:
parent
3c1d74b2d5
commit
c105224705
@ -24,6 +24,7 @@ import (
|
|||||||
|
|
||||||
"github.com/hajimehoshi/ebiten/v2"
|
"github.com/hajimehoshi/ebiten/v2"
|
||||||
"github.com/hajimehoshi/ebiten/v2/audio"
|
"github.com/hajimehoshi/ebiten/v2/audio"
|
||||||
|
"github.com/hajimehoshi/ebiten/v2/ebitenutil"
|
||||||
)
|
)
|
||||||
|
|
||||||
//go:embed shibuya.mpg
|
//go:embed shibuya.mpg
|
||||||
@ -48,6 +49,7 @@ func (g *Game) Draw(screen *ebiten.Image) {
|
|||||||
if err := g.player.Draw(screen); err != nil {
|
if err := g.player.Draw(screen); err != nil {
|
||||||
g.err = err
|
g.err = err
|
||||||
}
|
}
|
||||||
|
ebitenutil.DebugPrint(screen, fmt.Sprintf("FPS: %0.2f", ebiten.ActualFPS()))
|
||||||
}
|
}
|
||||||
|
|
||||||
func (g *Game) Layout(outsideWidth, outsideHeight int) (screenWidth, screenHeight int) {
|
func (g *Game) Layout(outsideWidth, outsideHeight int) (screenWidth, screenHeight int) {
|
||||||
|
Loading…
Reference in New Issue
Block a user